1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/e3dsceneupdater.hxx>
24 E3dUndoAction::~E3dUndoAction ()
28 // Repeat does not exist
30 bool E3dUndoAction::CanRepeat(SfxRepeatTarget
&) const
36 // Undo destructor for 3D-Rotation
37 E3dRotateUndoAction::~E3dRotateUndoAction()
41 // Undo for 3D-Rotation on the Rotation matrix
42 void E3dRotateUndoAction::Undo()
44 E3DModifySceneSnapRectUpdater
aUpdater(&mrMy3DObj
);
45 mrMy3DObj
.SetTransform(maMyOldRotation
);
48 // Redo for 3D-Rotation on the Rotation matrix
49 void E3dRotateUndoAction::Redo()
51 E3DModifySceneSnapRectUpdater
aUpdater(&mrMy3DObj
);
52 mrMy3DObj
.SetTransform(maMyNewRotation
);
55 E3dAttributesUndoAction::E3dAttributesUndoAction(
57 const SfxItemSet
& rNewSet
,
58 const SfxItemSet
& rOldSet
)
59 : SdrUndoAction(rInObject
.getSdrModelFromSdrObject())
66 E3dAttributesUndoAction::~E3dAttributesUndoAction()
70 // Undo() implemented through Set3DAttributes() to only maintain the attributes
73 void E3dAttributesUndoAction::Undo()
75 E3DModifySceneSnapRectUpdater
aUpdater(&mrObject
);
76 mrObject
.SetMergedItemSetAndBroadcast(maOldSet
);
79 void E3dAttributesUndoAction::Redo()
81 E3DModifySceneSnapRectUpdater
aUpdater(&mrObject
);
82 mrObject
.SetMergedItemSetAndBroadcast(maNewSet
);
85 // Multiple Undo is not possible
86 bool E3dAttributesUndoAction::CanRepeat(SfxRepeatTarget
& /*rView*/) const
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */