bump product version to 4.1.6.2
[LibreOffice.git] / svx / source / engine3d / e3dundo.cxx
blob14934f734e3ff1ef0db7e61c161ddedd259ef48e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <svx/e3dundo.hxx>
21 #include <svx/svdmodel.hxx>
22 #include <editeng/outlobj.hxx>
23 #include <svx/view3d.hxx>
24 #include <svx/scene3d.hxx>
25 #include <svx/e3dsceneupdater.hxx>
27 /************************************************************************/
29 TYPEINIT1(E3dUndoAction, SfxUndoAction);
31 E3dUndoAction::~E3dUndoAction ()
35 // Repeat does not exist
37 sal_Bool E3dUndoAction::CanRepeat(SfxRepeatTarget&) const
39 return sal_False;
42 /************************************************************************/
44 TYPEINIT1(E3dRotateUndoAction, E3dUndoAction);
46 /************************************************************************
48 E3dRotateUndoAction
50 ************************************************************************/
52 // Undo destructor for 3D-Rotation
54 E3dRotateUndoAction::~E3dRotateUndoAction ()
58 // Undo for 3D-Rotation on the Rotation matrix
60 void E3dRotateUndoAction::Undo ()
62 E3DModifySceneSnapRectUpdater aUpdater(pMy3DObj);
63 pMy3DObj->SetTransform(aMyOldRotation);
66 // Redo for 3D-Rotation on the Rotation matrix
68 void E3dRotateUndoAction::Redo ()
70 E3DModifySceneSnapRectUpdater aUpdater(pMy3DObj);
71 pMy3DObj->SetTransform(aMyNewRotation);
74 TYPEINIT1(E3dAttributesUndoAction, SdrUndoAction);
76 E3dAttributesUndoAction::E3dAttributesUndoAction( SdrModel &rModel,
77 E3dObject* pInObject,
78 const SfxItemSet& rNewSet,
79 const SfxItemSet& rOldSet)
80 : SdrUndoAction( rModel ),
81 pObject ( pInObject ),
82 aNewSet ( rNewSet ),
83 aOldSet ( rOldSet )
87 E3dAttributesUndoAction::~E3dAttributesUndoAction()
91 // Undo() implemented through Set3DAttributes() to only maintain the attributes
92 // in one place
94 void E3dAttributesUndoAction::Undo()
96 E3DModifySceneSnapRectUpdater aUpdater(pObject);
97 pObject->SetMergedItemSetAndBroadcast(aOldSet);
100 void E3dAttributesUndoAction::Redo()
102 E3DModifySceneSnapRectUpdater aUpdater(pObject);
103 pObject->SetMergedItemSetAndBroadcast(aNewSet);
106 // Multiple Undo is not possible
108 sal_Bool E3dAttributesUndoAction::CanRepeat(SfxRepeatTarget& /*rView*/) const
110 return sal_False;
113 // Multiple Undo is not possible
115 void E3dAttributesUndoAction::Repeat()
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */