merge the formfield patch from ooo-build
[ooovba.git] / svx / source / engine3d / e3dundo.cxx
bloba564149499fbeeaabacf516e821232288beec9e5
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: e3dundo.cxx,v $
10 * $Revision: 1.9.226.1 $
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_svx.hxx"
33 #include <svx/e3dundo.hxx>
34 #include <svx/svdmodel.hxx>
35 #include <svx/outlobj.hxx>
36 #include <svx/view3d.hxx>
37 #include <svx/scene3d.hxx>
38 #include <svx/e3dsceneupdater.hxx>
40 /************************************************************************/
42 TYPEINIT1(E3dUndoAction, SfxUndoAction);
44 /************************************************************************\
46 |* Destruktor der Basisklasse
48 \************************************************************************/
49 E3dUndoAction::~E3dUndoAction ()
53 /************************************************************************\
55 |* Repeat gibt es nicht
57 \************************************************************************/
58 BOOL E3dUndoAction::CanRepeat(SfxRepeatTarget&) const
60 return FALSE;
63 /************************************************************************/
65 TYPEINIT1(E3dRotateUndoAction, E3dUndoAction);
67 /************************************************************************
69 E3dRotateUndoAction
71 ************************************************************************/
73 /************************************************************************\
75 |* Undodestruktor fuer 3D-Rotation
77 \************************************************************************/
78 E3dRotateUndoAction::~E3dRotateUndoAction ()
82 /************************************************************************\
84 |* Undo fuer 3D-Rotation ueber die Rotationsmatrizen
86 \************************************************************************/
87 void E3dRotateUndoAction::Undo ()
89 E3DModifySceneSnapRectUpdater aUpdater(pMy3DObj);
90 pMy3DObj->SetTransform(aMyOldRotation);
93 /************************************************************************\
95 |* Undo fuer 3D-Rotation ueber die Rotationsmatrizen
97 \************************************************************************/
98 void E3dRotateUndoAction::Redo ()
100 E3DModifySceneSnapRectUpdater aUpdater(pMy3DObj);
101 pMy3DObj->SetTransform(aMyNewRotation);
104 /*************************************************************************
106 |* E3dAttributesUndoAction
108 \************************************************************************/
110 TYPEINIT1(E3dAttributesUndoAction, SdrUndoAction);
112 /*************************************************************************
114 |* Konstruktor
116 \************************************************************************/
117 E3dAttributesUndoAction::E3dAttributesUndoAction( SdrModel &rModel,
118 E3dView* p3dView,
119 E3dObject* pInObject,
120 const SfxItemSet& rNewSet,
121 const SfxItemSet& rOldSet,
122 BOOL bUseSubObj)
123 : SdrUndoAction( rModel ),
124 pObject ( pInObject ),
125 pView ( p3dView ),
126 bUseSubObjects(bUseSubObj),
127 aNewSet ( rNewSet ),
128 aOldSet ( rOldSet )
132 /*************************************************************************
134 |* Destruktor
136 \************************************************************************/
137 E3dAttributesUndoAction::~E3dAttributesUndoAction()
141 /*************************************************************************
143 |* Undo()
144 |* Implementiert ueber Set3DAttributes(), um die Attribute nur an einer
145 |* Stelle pflegen zu muessen!
147 \************************************************************************/
148 void E3dAttributesUndoAction::Undo()
150 E3DModifySceneSnapRectUpdater aUpdater(pObject);
151 pObject->SetMergedItemSetAndBroadcast(aOldSet);
154 /*************************************************************************
156 |* Redo()
158 \************************************************************************/
159 void E3dAttributesUndoAction::Redo()
161 E3DModifySceneSnapRectUpdater aUpdater(pObject);
162 pObject->SetMergedItemSetAndBroadcast(aNewSet);
165 /*************************************************************************
167 |* Mehrfaches Undo nicht moeglich
169 \************************************************************************/
170 BOOL E3dAttributesUndoAction::CanRepeat(SfxRepeatTarget& /*rView*/) const
172 return FALSE;
175 /*************************************************************************
177 |* Mehrfaches Undo nicht moeglich
179 \************************************************************************/
180 void E3dAttributesUndoAction::Repeat()