Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include "unprlout.hxx"
30 : :
31 : : #include "strings.hrc"
32 : : #include "sdpage.hxx"
33 : : #include "drawdoc.hxx"
34 : : #include "sdresid.hxx"
35 : :
36 : :
37 [ # # ][ # # ]: 0 : TYPEINIT1(SdPresentationLayoutUndoAction, SdUndoAction);
38 : :
39 : :
40 : :
41 : : /*************************************************************************
42 : : |*
43 : : |* Konstruktor
44 : : |*
45 : : \************************************************************************/
46 : :
47 : 0 : SdPresentationLayoutUndoAction::SdPresentationLayoutUndoAction(
48 : : SdDrawDocument* pTheDoc,
49 : : String aTheOldLayoutName,
50 : : String aTheNewLayoutName,
51 : : AutoLayout eTheOldAutoLayout,
52 : : AutoLayout eTheNewAutoLayout,
53 : : sal_Bool bSet,
54 : : SdPage* pThePage):
55 [ # # ][ # # ]: 0 : SdUndoAction(pTheDoc)
[ # # ]
56 : : {
57 [ # # ]: 0 : aOldLayoutName = aTheOldLayoutName;
58 [ # # ]: 0 : aNewLayoutName = aTheNewLayoutName;
59 : 0 : eOldAutoLayout = eTheOldAutoLayout;
60 : 0 : eNewAutoLayout = eTheNewAutoLayout;
61 : 0 : bSetAutoLayout = bSet;
62 : :
63 : : DBG_ASSERT(pThePage, "keine Page gesetzt!");
64 : 0 : pPage = pThePage;
65 [ # # ][ # # ]: 0 : aComment = String(SdResId(STR_UNDO_SET_PRESLAYOUT));
[ # # ][ # # ]
66 : 0 : }
67 : :
68 : : /*************************************************************************
69 : : |*
70 : : |* Undo()
71 : : |*
72 : : \************************************************************************/
73 : :
74 : 0 : void SdPresentationLayoutUndoAction::Undo()
75 : : {
76 : 0 : pPage->SetPresentationLayout(aOldLayoutName, sal_True, sal_True, sal_True);
77 [ # # ]: 0 : if (bSetAutoLayout)
78 : 0 : pPage->SetAutoLayout(eOldAutoLayout, sal_True);
79 : 0 : }
80 : :
81 : : /*************************************************************************
82 : : |*
83 : : |* Redo()
84 : : |*
85 : : \************************************************************************/
86 : :
87 : 0 : void SdPresentationLayoutUndoAction::Redo()
88 : : {
89 : 0 : pPage->SetPresentationLayout(aNewLayoutName);
90 [ # # ]: 0 : if (bSetAutoLayout)
91 : 0 : pPage->SetAutoLayout(eNewAutoLayout, sal_True);
92 : 0 : }
93 : :
94 : : /*************************************************************************
95 : : |*
96 : : |* Destruktor
97 : : |*
98 : : \************************************************************************/
99 : :
100 [ # # ][ # # ]: 0 : SdPresentationLayoutUndoAction::~SdPresentationLayoutUndoAction()
[ # # ]
101 : : {
102 [ # # ]: 0 : }
103 : :
104 : : /*************************************************************************
105 : : |*
106 : : |* Kommentar liefern
107 : : |*
108 : : \************************************************************************/
109 : :
110 : 0 : rtl::OUString SdPresentationLayoutUndoAction::GetComment() const
111 : : {
112 : 0 : return aComment;
113 : : }
114 : :
115 : :
116 : :
117 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|