Update ooo320-m1
[ooovba.git] / sd / source / ui / func / unoaprms.cxx
blob2a373199b6a938c906f352bea034a91f289284a6
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: unoaprms.cxx,v $
10 * $Revision: 1.10 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sd.hxx"
35 #include "drawdoc.hxx"
36 #include "unoaprms.hxx"
37 #include "anminfo.hxx"
40 TYPEINIT1(SdAnimationPrmsUndoAction, SdUndoAction);
43 /*************************************************************************
45 |* 2. Ctor, der den ersten (inline) nach der Version 4.0 einmal ersetzen
46 |* soll (mit 3. Parameter dann)
47 |* Hier werden die Member mit den Animations-Informationen vorbelegt,
48 |* um nicht immer alle inline-Methoden aufrufen zu muessen, auch im
49 |* Hinblick auf zukuenftige Erweiterungen (neue Member etc.)
51 \************************************************************************/
53 SdAnimationPrmsUndoAction::SdAnimationPrmsUndoAction(
54 SdDrawDocument* pTheDoc,
55 SdrObject* pObj ) :
56 SdUndoAction ( pTheDoc ),
57 pObject ( pObj ),
58 bInfoCreated ( FALSE ) // Fuer Animationsreihenfolge existiert Info
60 SdAnimationInfo* pInfo = pTheDoc->GetAnimationInfo( pObject );
61 if( pInfo )
63 bNewActive = bOldActive = pInfo->mbActive;
64 eNewEffect = eOldEffect = pInfo->meEffect;
65 eNewTextEffect = eOldTextEffect = pInfo->meTextEffect;
66 eNewSpeed = eOldSpeed = pInfo->meSpeed;
67 bNewDimPrevious = bOldDimPrevious= pInfo->mbDimPrevious;
68 aNewDimColor = aOldDimColor = pInfo->maDimColor;
69 bNewDimHide = bOldDimHide = pInfo->mbDimHide;
70 bNewSoundOn = bOldSoundOn = pInfo->mbSoundOn;
71 aNewSoundFile = aOldSoundFile = pInfo->maSoundFile;
72 bNewPlayFull = bOldPlayFull = pInfo->mbPlayFull;
74 pNewPathObj = pOldPathObj = pInfo->mpPathObj;
76 eNewClickAction = eOldClickAction = pInfo->meClickAction;
77 aNewBookmark = aOldBookmark = pInfo->GetBookmark();
78 // bNewInvisibleInPres = bOldInvisibleInPres= pInfo->mbInvisibleInPresentation;
79 nNewVerb = nOldVerb = pInfo->mnVerb;
80 nNewPresOrder = nOldPresOrder = pInfo->mnPresOrder;
82 eNewSecondEffect = eOldSecondEffect = pInfo->meSecondEffect;
83 eNewSecondSpeed = eOldSecondSpeed = pInfo->meSecondSpeed;
84 bNewSecondSoundOn = bOldSecondSoundOn = pInfo->mbSecondSoundOn;
85 bNewSecondPlayFull = bOldSecondPlayFull = pInfo->mbSecondPlayFull;
89 /*************************************************************************
91 |* Undo()
93 \************************************************************************/
95 void SdAnimationPrmsUndoAction::Undo()
97 // keine neu Info erzeugt: Daten restaurieren
98 if (!bInfoCreated)
100 SdDrawDocument* pDoc = (SdDrawDocument*)pObject->GetModel();
101 if( pDoc )
103 SdAnimationInfo* pInfo = pDoc->GetAnimationInfo( pObject );
104 // So nicht...
105 //SdAnimationInfo* pInfo = (SdAnimationInfo*)pObject->GetUserData(0);
106 pInfo->mbActive = bOldActive;
107 pInfo->meEffect = eOldEffect;
108 pInfo->meTextEffect = eOldTextEffect;
109 pInfo->meSpeed = eOldSpeed;
110 pInfo->mbDimPrevious = bOldDimPrevious;
111 pInfo->maDimColor = aOldDimColor;
112 pInfo->mbDimHide = bOldDimHide;
113 pInfo->mbSoundOn = bOldSoundOn;
114 pInfo->maSoundFile = aOldSoundFile;
115 pInfo->mbPlayFull = bOldPlayFull;
116 // pInfo->mSetPath(pOldPathObj);
117 pInfo->meClickAction = eOldClickAction;
118 pInfo->SetBookmark( aOldBookmark );
119 // pInfo->mbInvisibleInPresentation = bOldInvisibleInPres;
120 pInfo->mnVerb = nOldVerb;
121 pInfo->mnPresOrder = nOldPresOrder;
123 pInfo->meSecondEffect = eOldSecondEffect;
124 pInfo->meSecondSpeed = eOldSecondSpeed;
125 pInfo->mbSecondSoundOn = bOldSecondSoundOn;
126 pInfo->mbSecondPlayFull = bOldSecondPlayFull;
129 // Info wurde durch Aktion erzeugt: Info loeschen
130 else
132 pObject->DeleteUserData(0);
134 // Damit ein ModelHasChanged() ausgeloest wird, um das Effekte-Window
135 // auf Stand zu bringen (Animations-Reihenfolge)
136 pObject->SetChanged();
137 pObject->BroadcastObjectChange();
140 /*************************************************************************
142 |* Redo()
144 \************************************************************************/
146 void SdAnimationPrmsUndoAction::Redo()
148 SdAnimationInfo* pInfo = NULL;
150 pInfo = SdDrawDocument::GetShapeUserData(*pObject,true);
152 pInfo->mbActive = bNewActive;
153 pInfo->meEffect = eNewEffect;
154 pInfo->meTextEffect = eNewTextEffect;
155 pInfo->meSpeed = eNewSpeed;
156 pInfo->mbDimPrevious = bNewDimPrevious;
157 pInfo->maDimColor = aNewDimColor;
158 pInfo->mbDimHide = bNewDimHide;
159 pInfo->mbSoundOn = bNewSoundOn;
160 pInfo->maSoundFile = aNewSoundFile;
161 pInfo->mbPlayFull = bNewPlayFull;
162 // pInfo->mSetPath(pNewPathObj);
163 pInfo->meClickAction = eNewClickAction;
164 pInfo->SetBookmark( aNewBookmark );
165 // pInfo->mbInvisibleInPresentation = bNewInvisibleInPres;
166 pInfo->mnVerb = nNewVerb;
167 pInfo->mnPresOrder = nNewPresOrder;
169 pInfo->meSecondEffect = eNewSecondEffect;
170 pInfo->meSecondSpeed = eNewSecondSpeed;
171 pInfo->mbSecondSoundOn = bNewSecondSoundOn;
172 pInfo->mbSecondPlayFull = bNewSecondPlayFull;
174 // Damit ein ModelHasChanged() ausgeloest wird, um das Effekte-Window
175 // auf Stand zu bringen (Animations-Reihenfolge)
176 pObject->SetChanged();
177 pObject->BroadcastObjectChange();
180 /*************************************************************************
182 |* Destruktor
184 \************************************************************************/
186 SdAnimationPrmsUndoAction::~SdAnimationPrmsUndoAction()