xref: /aoo41x/main/sd/source/ui/func/unoaprms.cxx (revision 79aad27f)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sd.hxx"
26 
27 
28 #include "drawdoc.hxx"
29 #include "unoaprms.hxx"
30 #include "anminfo.hxx"
31 
32 
33 TYPEINIT1(SdAnimationPrmsUndoAction, SdUndoAction);
34 
35 
36 /*************************************************************************
37 |*
38 |* Undo()
39 |*
40 \************************************************************************/
41 
Undo()42 void SdAnimationPrmsUndoAction::Undo()
43 {
44 	// keine neu Info erzeugt: Daten restaurieren
45 	if (!bInfoCreated)
46 	{
47 		SdDrawDocument*	pDoc   = (SdDrawDocument*)pObject->GetModel();
48 		if( pDoc )
49 		{
50 			SdAnimationInfo* pInfo = pDoc->GetAnimationInfo( pObject );
51 			// So nicht...
52 			//SdAnimationInfo* pInfo = (SdAnimationInfo*)pObject->GetUserData(0);
53 			pInfo->mbActive		= bOldActive;
54 			pInfo->meEffect      = eOldEffect;
55 			pInfo->meTextEffect  = eOldTextEffect;
56 			pInfo->meSpeed		= eOldSpeed;
57 			pInfo->mbDimPrevious = bOldDimPrevious;
58 			pInfo->maDimColor    = aOldDimColor;
59 			pInfo->mbDimHide     = bOldDimHide;
60 			pInfo->mbSoundOn     = bOldSoundOn;
61 			pInfo->maSoundFile   = aOldSoundFile;
62 			pInfo->mbPlayFull    = bOldPlayFull;
63 //			pInfo->mSetPath(pOldPathObj);
64 			pInfo->meClickAction = eOldClickAction;
65 			pInfo->SetBookmark( aOldBookmark );
66 //			pInfo->mbInvisibleInPresentation = bOldInvisibleInPres;
67 			pInfo->mnVerb        = nOldVerb;
68 			pInfo->mnPresOrder   = nOldPresOrder;
69 
70 			pInfo->meSecondEffect    = eOldSecondEffect;
71 			pInfo->meSecondSpeed     = eOldSecondSpeed;
72 			pInfo->mbSecondSoundOn   = bOldSecondSoundOn;
73 			pInfo->mbSecondPlayFull  = bOldSecondPlayFull;
74 		}
75 	}
76 	// Info wurde durch Aktion erzeugt: Info loeschen
77 	else
78 	{
79 		pObject->DeleteUserData(0);
80 	}
81 	// Damit ein ModelHasChanged() ausgeloest wird, um das Effekte-Window
82 	// auf Stand zu bringen (Animations-Reihenfolge)
83 	pObject->SetChanged();
84 	pObject->BroadcastObjectChange();
85 }
86 
87 /*************************************************************************
88 |*
89 |* Redo()
90 |*
91 \************************************************************************/
92 
Redo()93 void SdAnimationPrmsUndoAction::Redo()
94 {
95 	SdAnimationInfo* pInfo = NULL;
96 
97 	pInfo = SdDrawDocument::GetShapeUserData(*pObject,true);
98 
99 	pInfo->mbActive      = bNewActive;
100 	pInfo->meEffect      = eNewEffect;
101 	pInfo->meTextEffect  = eNewTextEffect;
102 	pInfo->meSpeed       = eNewSpeed;
103 	pInfo->mbDimPrevious = bNewDimPrevious;
104 	pInfo->maDimColor    = aNewDimColor;
105 	pInfo->mbDimHide     = bNewDimHide;
106 	pInfo->mbSoundOn     = bNewSoundOn;
107 	pInfo->maSoundFile   = aNewSoundFile;
108 	pInfo->mbPlayFull    = bNewPlayFull;
109 //	pInfo->mSetPath(pNewPathObj);
110 	pInfo->meClickAction = eNewClickAction;
111 	pInfo->SetBookmark( aNewBookmark );
112 //	pInfo->mbInvisibleInPresentation = bNewInvisibleInPres;
113 	pInfo->mnVerb        = nNewVerb;
114 	pInfo->mnPresOrder   = nNewPresOrder;
115 
116 	pInfo->meSecondEffect    = eNewSecondEffect;
117 	pInfo->meSecondSpeed     = eNewSecondSpeed;
118 	pInfo->mbSecondSoundOn   = bNewSecondSoundOn;
119 	pInfo->mbSecondPlayFull  = bNewSecondPlayFull;
120 
121 	// Damit ein ModelHasChanged() ausgeloest wird, um das Effekte-Window
122 	// auf Stand zu bringen (Animations-Reihenfolge)
123 	pObject->SetChanged();
124 	pObject->BroadcastObjectChange();
125 }
126 
127 /*************************************************************************
128 |*
129 |* Destruktor
130 |*
131 \************************************************************************/
132 
~SdAnimationPrmsUndoAction()133 SdAnimationPrmsUndoAction::~SdAnimationPrmsUndoAction()
134 {
135 }
136 
137 
138