bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / func / unoaprms.cxx
blobe777fb1a269299bbfdba8a634cb8d94b01e3dd27
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "drawdoc.hxx"
21 #include "unoaprms.hxx"
22 #include "anminfo.hxx"
24 TYPEINIT1(SdAnimationPrmsUndoAction, SdUndoAction);
26 void SdAnimationPrmsUndoAction::Undo()
28 // no new info created: restore data
29 if (!bInfoCreated)
31 SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(pObject->GetModel());
32 if( pDoc )
34 SdAnimationInfo* pInfo = pDoc->GetAnimationInfo( pObject );
36 pInfo->mbActive = bOldActive;
37 pInfo->meEffect = eOldEffect;
38 pInfo->meTextEffect = eOldTextEffect;
39 pInfo->meSpeed = eOldSpeed;
40 pInfo->mbDimPrevious = bOldDimPrevious;
41 pInfo->maDimColor = aOldDimColor;
42 pInfo->mbDimHide = bOldDimHide;
43 pInfo->mbSoundOn = bOldSoundOn;
44 pInfo->maSoundFile = aOldSoundFile;
45 pInfo->mbPlayFull = bOldPlayFull;
46 pInfo->meClickAction = eOldClickAction;
47 pInfo->SetBookmark( aOldBookmark );
48 pInfo->mnVerb = nOldVerb;
49 pInfo->mnPresOrder = nOldPresOrder;
51 pInfo->meSecondEffect = eOldSecondEffect;
52 pInfo->meSecondSpeed = eOldSecondSpeed;
53 pInfo->mbSecondSoundOn = bOldSecondSoundOn;
54 pInfo->mbSecondPlayFull = bOldSecondPlayFull;
57 // info was created by action: delete info
58 else
60 pObject->DeleteUserData(0);
62 // force ModelHasChanged() in order to update effect window (animation order)
63 pObject->SetChanged();
64 pObject->BroadcastObjectChange();
67 void SdAnimationPrmsUndoAction::Redo()
69 SdAnimationInfo* pInfo = NULL;
71 pInfo = SdDrawDocument::GetShapeUserData(*pObject,true);
73 pInfo->mbActive = bNewActive;
74 pInfo->meEffect = eNewEffect;
75 pInfo->meTextEffect = eNewTextEffect;
76 pInfo->meSpeed = eNewSpeed;
77 pInfo->mbDimPrevious = bNewDimPrevious;
78 pInfo->maDimColor = aNewDimColor;
79 pInfo->mbDimHide = bNewDimHide;
80 pInfo->mbSoundOn = bNewSoundOn;
81 pInfo->maSoundFile = aNewSoundFile;
82 pInfo->mbPlayFull = bNewPlayFull;
83 pInfo->meClickAction = eNewClickAction;
84 pInfo->SetBookmark( aNewBookmark );
85 pInfo->mnVerb = nNewVerb;
86 pInfo->mnPresOrder = nNewPresOrder;
88 pInfo->meSecondEffect = eNewSecondEffect;
89 pInfo->meSecondSpeed = eNewSecondSpeed;
90 pInfo->mbSecondSoundOn = bNewSecondSoundOn;
91 pInfo->mbSecondPlayFull = bNewSecondPlayFull;
93 // force ModelHasChanged() in order to update effect window (animation order)
94 pObject->SetChanged();
95 pObject->BroadcastObjectChange();
98 SdAnimationPrmsUndoAction::~SdAnimationPrmsUndoAction()
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */