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 <svx/e3dundo.hxx>
30 : : #include <svx/svdmodel.hxx>
31 : : #include <editeng/outlobj.hxx>
32 : : #include <svx/view3d.hxx>
33 : : #include <svx/scene3d.hxx>
34 : : #include <svx/e3dsceneupdater.hxx>
35 : :
36 : : /************************************************************************/
37 : :
38 [ # # ][ # # ]: 0 : TYPEINIT1(E3dUndoAction, SfxUndoAction);
39 : :
40 : 0 : E3dUndoAction::~E3dUndoAction ()
41 : : {
42 [ # # ]: 0 : }
43 : :
44 : : // Repeat does not exist
45 : :
46 : 0 : sal_Bool E3dUndoAction::CanRepeat(SfxRepeatTarget&) const
47 : : {
48 : 0 : return sal_False;
49 : : }
50 : :
51 : : /************************************************************************/
52 : :
53 [ # # ][ # # ]: 0 : TYPEINIT1(E3dRotateUndoAction, E3dUndoAction);
54 : :
55 : : /************************************************************************
56 : :
57 : : E3dRotateUndoAction
58 : :
59 : : ************************************************************************/
60 : :
61 : : // Undo destructor for 3D-Rotation
62 : :
63 [ # # ][ # # ]: 0 : E3dRotateUndoAction::~E3dRotateUndoAction ()
64 : : {
65 [ # # ]: 0 : }
66 : :
67 : : // Undo for 3D-Rotation on the Rotation matrix
68 : :
69 : 0 : void E3dRotateUndoAction::Undo ()
70 : : {
71 [ # # ]: 0 : E3DModifySceneSnapRectUpdater aUpdater(pMy3DObj);
72 [ # # ][ # # ]: 0 : pMy3DObj->SetTransform(aMyOldRotation);
73 : 0 : }
74 : :
75 : : // Redo for 3D-Rotation on the Rotation matrix
76 : :
77 : 0 : void E3dRotateUndoAction::Redo ()
78 : : {
79 [ # # ]: 0 : E3DModifySceneSnapRectUpdater aUpdater(pMy3DObj);
80 [ # # ][ # # ]: 0 : pMy3DObj->SetTransform(aMyNewRotation);
81 : 0 : }
82 : :
83 [ # # ][ # # ]: 0 : TYPEINIT1(E3dAttributesUndoAction, SdrUndoAction);
84 : :
85 : 0 : E3dAttributesUndoAction::E3dAttributesUndoAction( SdrModel &rModel,
86 : : E3dObject* pInObject,
87 : : const SfxItemSet& rNewSet,
88 : : const SfxItemSet& rOldSet)
89 : : : SdrUndoAction( rModel ),
90 : : pObject ( pInObject ),
91 : : aNewSet ( rNewSet ),
92 [ # # ][ # # ]: 0 : aOldSet ( rOldSet )
93 : : {
94 : 0 : }
95 : :
96 [ # # ][ # # ]: 0 : E3dAttributesUndoAction::~E3dAttributesUndoAction()
97 : : {
98 [ # # ]: 0 : }
99 : :
100 : : // Undo() implemented through Set3DAttributes() to only maintain the attributes
101 : : // in one place
102 : :
103 : 0 : void E3dAttributesUndoAction::Undo()
104 : : {
105 [ # # ]: 0 : E3DModifySceneSnapRectUpdater aUpdater(pObject);
106 [ # # ][ # # ]: 0 : pObject->SetMergedItemSetAndBroadcast(aOldSet);
107 : 0 : }
108 : :
109 : 0 : void E3dAttributesUndoAction::Redo()
110 : : {
111 [ # # ]: 0 : E3DModifySceneSnapRectUpdater aUpdater(pObject);
112 [ # # ][ # # ]: 0 : pObject->SetMergedItemSetAndBroadcast(aNewSet);
113 : 0 : }
114 : :
115 : : // Multiple Undo is not possible
116 : :
117 : 0 : sal_Bool E3dAttributesUndoAction::CanRepeat(SfxRepeatTarget& /*rView*/) const
118 : : {
119 : 0 : return sal_False;
120 : : }
121 : :
122 : : // Multiple Undo is not possible
123 : :
124 : 0 : void E3dAttributesUndoAction::Repeat()
125 : : {
126 : 0 : }
127 : :
128 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|