xref: /aoo42x/main/sd/source/ui/func/unoaprms.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_sd.hxx"
30 
31 
32 #include "drawdoc.hxx"
33 #include "unoaprms.hxx"
34 #include "anminfo.hxx"
35 
36 
37 TYPEINIT1(SdAnimationPrmsUndoAction, SdUndoAction);
38 
39 
40 /*************************************************************************
41 |*
42 |* Undo()
43 |*
44 \************************************************************************/
45 
46 void SdAnimationPrmsUndoAction::Undo()
47 {
48 	// keine neu Info erzeugt: Daten restaurieren
49 	if (!bInfoCreated)
50 	{
51 		SdDrawDocument*	pDoc   = (SdDrawDocument*)pObject->GetModel();
52 		if( pDoc )
53 		{
54 			SdAnimationInfo* pInfo = pDoc->GetAnimationInfo( pObject );
55 			// So nicht...
56 			//SdAnimationInfo* pInfo = (SdAnimationInfo*)pObject->GetUserData(0);
57 			pInfo->mbActive		= bOldActive;
58 			pInfo->meEffect      = eOldEffect;
59 			pInfo->meTextEffect  = eOldTextEffect;
60 			pInfo->meSpeed		= eOldSpeed;
61 			pInfo->mbDimPrevious = bOldDimPrevious;
62 			pInfo->maDimColor    = aOldDimColor;
63 			pInfo->mbDimHide     = bOldDimHide;
64 			pInfo->mbSoundOn     = bOldSoundOn;
65 			pInfo->maSoundFile   = aOldSoundFile;
66 			pInfo->mbPlayFull    = bOldPlayFull;
67 //			pInfo->mSetPath(pOldPathObj);
68 			pInfo->meClickAction = eOldClickAction;
69 			pInfo->SetBookmark( aOldBookmark );
70 //			pInfo->mbInvisibleInPresentation = bOldInvisibleInPres;
71 			pInfo->mnVerb        = nOldVerb;
72 			pInfo->mnPresOrder   = nOldPresOrder;
73 
74 			pInfo->meSecondEffect    = eOldSecondEffect;
75 			pInfo->meSecondSpeed     = eOldSecondSpeed;
76 			pInfo->mbSecondSoundOn   = bOldSecondSoundOn;
77 			pInfo->mbSecondPlayFull  = bOldSecondPlayFull;
78 		}
79 	}
80 	// Info wurde durch Aktion erzeugt: Info loeschen
81 	else
82 	{
83 		pObject->DeleteUserData(0);
84 	}
85 	// Damit ein ModelHasChanged() ausgeloest wird, um das Effekte-Window
86 	// auf Stand zu bringen (Animations-Reihenfolge)
87 	pObject->SetChanged();
88 	pObject->BroadcastObjectChange();
89 }
90 
91 /*************************************************************************
92 |*
93 |* Redo()
94 |*
95 \************************************************************************/
96 
97 void SdAnimationPrmsUndoAction::Redo()
98 {
99 	SdAnimationInfo* pInfo = NULL;
100 
101 	pInfo = SdDrawDocument::GetShapeUserData(*pObject,true);
102 
103 	pInfo->mbActive      = bNewActive;
104 	pInfo->meEffect      = eNewEffect;
105 	pInfo->meTextEffect  = eNewTextEffect;
106 	pInfo->meSpeed       = eNewSpeed;
107 	pInfo->mbDimPrevious = bNewDimPrevious;
108 	pInfo->maDimColor    = aNewDimColor;
109 	pInfo->mbDimHide     = bNewDimHide;
110 	pInfo->mbSoundOn     = bNewSoundOn;
111 	pInfo->maSoundFile   = aNewSoundFile;
112 	pInfo->mbPlayFull    = bNewPlayFull;
113 //	pInfo->mSetPath(pNewPathObj);
114 	pInfo->meClickAction = eNewClickAction;
115 	pInfo->SetBookmark( aNewBookmark );
116 //	pInfo->mbInvisibleInPresentation = bNewInvisibleInPres;
117 	pInfo->mnVerb        = nNewVerb;
118 	pInfo->mnPresOrder   = nNewPresOrder;
119 
120 	pInfo->meSecondEffect    = eNewSecondEffect;
121 	pInfo->meSecondSpeed     = eNewSecondSpeed;
122 	pInfo->mbSecondSoundOn   = bNewSecondSoundOn;
123 	pInfo->mbSecondPlayFull  = bNewSecondPlayFull;
124 
125 	// Damit ein ModelHasChanged() ausgeloest wird, um das Effekte-Window
126 	// auf Stand zu bringen (Animations-Reihenfolge)
127 	pObject->SetChanged();
128 	pObject->BroadcastObjectChange();
129 }
130 
131 /*************************************************************************
132 |*
133 |* Destruktor
134 |*
135 \************************************************************************/
136 
137 SdAnimationPrmsUndoAction::~SdAnimationPrmsUndoAction()
138 {
139 }
140 
141 
142