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