Get the style color and number just once
[LibreOffice.git] / sd / source / ui / func / undopage.cxx
blob174747bf6c5de8418f140185d037e839f110cbab
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>
21 #include <sdpage.hxx>
24 SdPageFormatUndoAction::~SdPageFormatUndoAction()
28 void SdPageFormatUndoAction::Undo()
30 ::tools::Rectangle aOldBorderRect(mnOldLeft, mnOldUpper, mnOldRight, mnOldLower);
31 mpPage->ScaleObjects(maOldSize, aOldBorderRect, mbNewScale);
32 mpPage->SetSize(maOldSize);
33 mpPage->SetLeftBorder(mnOldLeft);
34 mpPage->SetRightBorder(mnOldRight);
35 mpPage->SetUpperBorder(mnOldUpper);
36 mpPage->SetLowerBorder(mnOldLower);
37 mpPage->SetOrientation(meOldOrientation);
38 mpPage->SetPaperBin( mnOldPaperBin );
40 mpPage->SetBackgroundFullSize( mbOldFullSize );
41 if( !mpPage->IsMasterPage() )
42 static_cast<SdPage&>( mpPage->TRG_GetMasterPage() ).SetBackgroundFullSize( mbOldFullSize );
46 void SdPageFormatUndoAction::Redo()
48 ::tools::Rectangle aNewBorderRect(mnNewLeft, mnNewUpper, mnNewRight, mnNewLower);
49 mpPage->ScaleObjects(maNewSize, aNewBorderRect, mbNewScale);
50 mpPage->SetSize(maNewSize);
51 mpPage->SetLeftBorder(mnNewLeft);
52 mpPage->SetRightBorder(mnNewRight);
53 mpPage->SetUpperBorder(mnNewUpper);
54 mpPage->SetLowerBorder(mnNewLower);
55 mpPage->SetOrientation(meNewOrientation);
56 mpPage->SetPaperBin( mnNewPaperBin );
58 mpPage->SetBackgroundFullSize( mbNewFullSize );
59 if( !mpPage->IsMasterPage() )
60 static_cast<SdPage&>( mpPage->TRG_GetMasterPage() ).SetBackgroundFullSize( mbNewFullSize );
64 SdPageLRUndoAction::~SdPageLRUndoAction()
68 void SdPageLRUndoAction::Undo()
70 mpPage->SetLeftBorder(mnOldLeft);
71 mpPage->SetRightBorder(mnOldRight);
74 void SdPageLRUndoAction::Redo()
76 mpPage->SetLeftBorder(mnNewLeft);
77 mpPage->SetRightBorder(mnNewRight);
80 SdPageULUndoAction::~SdPageULUndoAction()
84 void SdPageULUndoAction::Undo()
86 mpPage->SetUpperBorder(mnOldUpper);
87 mpPage->SetLowerBorder(mnOldLower);
90 /**
91 * UL-Redo()
93 void SdPageULUndoAction::Redo()
95 mpPage->SetUpperBorder(mnNewUpper);
96 mpPage->SetLowerBorder(mnNewLower);
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */