Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / sd / source / ui / func / undopage.cxx
blob6a073dbd6e217a8ae51a3acfa677452f12da428b
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 <undopage.hxx>
22 #include <svx/svxids.hrc>
23 #include <sfx2/bindings.hxx>
24 #include <sfx2/dispatch.hxx>
25 #include <sfx2/viewfrm.hxx>
27 #include <sdpage.hxx>
28 #include <DrawViewShell.hxx>
29 #include <drawview.hxx>
30 #include <svx/svdpagv.hxx>
33 SdPageFormatUndoAction::~SdPageFormatUndoAction()
37 void SdPageFormatUndoAction::Undo()
39 ::tools::Rectangle aOldBorderRect(mnOldLeft, mnOldUpper, mnOldRight, mnOldLower);
40 mpPage->ScaleObjects(maOldSize, aOldBorderRect, mbNewScale);
41 mpPage->SetSize(maOldSize);
42 mpPage->SetLeftBorder(mnOldLeft);
43 mpPage->SetRightBorder(mnOldRight);
44 mpPage->SetUpperBorder(mnOldUpper);
45 mpPage->SetLowerBorder(mnOldLower);
46 mpPage->SetOrientation(meOldOrientation);
47 mpPage->SetPaperBin( mnOldPaperBin );
49 mpPage->SetBackgroundFullSize( mbOldFullSize );
50 if( !mpPage->IsMasterPage() )
51 static_cast<SdPage&>( mpPage->TRG_GetMasterPage() ).SetBackgroundFullSize( mbOldFullSize );
55 void SdPageFormatUndoAction::Redo()
57 ::tools::Rectangle aNewBorderRect(mnNewLeft, mnNewUpper, mnNewRight, mnNewLower);
58 mpPage->ScaleObjects(maNewSize, aNewBorderRect, mbNewScale);
59 mpPage->SetSize(maNewSize);
60 mpPage->SetLeftBorder(mnNewLeft);
61 mpPage->SetRightBorder(mnNewRight);
62 mpPage->SetUpperBorder(mnNewUpper);
63 mpPage->SetLowerBorder(mnNewLower);
64 mpPage->SetOrientation(meNewOrientation);
65 mpPage->SetPaperBin( mnNewPaperBin );
67 mpPage->SetBackgroundFullSize( mbNewFullSize );
68 if( !mpPage->IsMasterPage() )
69 static_cast<SdPage&>( mpPage->TRG_GetMasterPage() ).SetBackgroundFullSize( mbNewFullSize );
73 SdPageLRUndoAction::~SdPageLRUndoAction()
77 void SdPageLRUndoAction::Undo()
79 mpPage->SetLeftBorder(mnOldLeft);
80 mpPage->SetRightBorder(mnOldRight);
83 void SdPageLRUndoAction::Redo()
85 mpPage->SetLeftBorder(mnNewLeft);
86 mpPage->SetRightBorder(mnNewRight);
89 SdPageULUndoAction::~SdPageULUndoAction()
93 void SdPageULUndoAction::Undo()
95 mpPage->SetUpperBorder(mnOldUpper);
96 mpPage->SetLowerBorder(mnOldLower);
99 /**
100 * UL-Redo()
102 void SdPageULUndoAction::Redo()
104 mpPage->SetUpperBorder(mnNewUpper);
105 mpPage->SetLowerBorder(mnNewLower);
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */