Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / svx / source / engine3d / e3dundo.cxx
blob5f8319767d38b2940bc8a33c8169d192c08ac10c
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/e3dsceneupdater.hxx>
22 #include <utility>
25 E3dUndoAction::~E3dUndoAction ()
29 // Repeat does not exist
31 bool E3dUndoAction::CanRepeat(SfxRepeatTarget&) const
33 return false;
37 // Undo destructor for 3D-Rotation
38 E3dRotateUndoAction::~E3dRotateUndoAction()
42 // Undo for 3D-Rotation on the Rotation matrix
43 void E3dRotateUndoAction::Undo()
45 E3DModifySceneSnapRectUpdater aUpdater(&mrMy3DObj);
46 mrMy3DObj.SetTransform(maMyOldRotation);
49 // Redo for 3D-Rotation on the Rotation matrix
50 void E3dRotateUndoAction::Redo()
52 E3DModifySceneSnapRectUpdater aUpdater(&mrMy3DObj);
53 mrMy3DObj.SetTransform(maMyNewRotation);
56 E3dAttributesUndoAction::E3dAttributesUndoAction(
57 E3dObject& rInObject,
58 SfxItemSet aNewSet,
59 SfxItemSet aOldSet)
60 : SdrUndoAction(rInObject.getSdrModelFromSdrObject())
61 ,mrObject(rInObject)
62 ,maNewSet(std::move(aNewSet))
63 ,maOldSet(std::move(aOldSet))
67 E3dAttributesUndoAction::~E3dAttributesUndoAction()
71 // Undo() implemented through Set3DAttributes() to only maintain the attributes
72 // in one place
74 void E3dAttributesUndoAction::Undo()
76 E3DModifySceneSnapRectUpdater aUpdater(&mrObject);
77 mrObject.SetMergedItemSetAndBroadcast(maOldSet);
80 void E3dAttributesUndoAction::Redo()
82 E3DModifySceneSnapRectUpdater aUpdater(&mrObject);
83 mrObject.SetMergedItemSetAndBroadcast(maNewSet);
86 // Multiple Undo is not possible
87 bool E3dAttributesUndoAction::CanRepeat(SfxRepeatTarget& /*rView*/) const
89 return false;
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */