Update ooo320-m1
[ooovba.git] / sc / source / ui / undo / undodraw.cxx
blobd596035d7787de0f99ec54bb62a1713b950847e4
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: undodraw.cxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sc.hxx"
36 //------------------------------------------------------------------
38 // TOOLS
39 #define _BIGINT_HXX
40 #define _SFXMULTISEL_HXX
41 #define _STACK_HXX
42 #define _QUEUE_HXX
43 #define _DYNARR_HXX
44 #define _TREELIST_HXX
45 #define _CACHESTR_HXX
46 #define _NEW_HXX
47 //#define _SHL_HXX
48 //#define _LINK_HXX
49 //#define _ERRCODE_HXX
50 //#define _GEN_HXX
51 //#define _FRACT_HXX
52 //#define _STRING_HXX
53 //#define _MTF_HXX
54 //#define _CONTNR_HXX
55 //#define _LIST_HXX
56 //#define _TABLE_HXX
57 #define _DYNARY_HXX
58 //#define _UNQIDX_HXX
59 #define _SVMEMPOOL_HXX
60 //#define _UNQID_HXX
61 //#define _DEBUG_HXX
62 //#define _DATE_HXX
63 //#define _TIME_HXX
64 //#define _DATETIME_HXX
65 //#define _INTN_HXX
66 //#define _WLDCRD_HXX
67 //#define _FSYS_HXX
68 //#define _STREAM_HXX
69 #define _CACHESTR_HXX
70 #define _SV_MULTISEL_HXX
72 //SV
73 //#define _CLIP_HXX
74 #define _CONFIG_HXX
75 #define _CURSOR_HXX
76 #define _FONTDLG_HXX
77 #define _PRVWIN_HXX
78 //#define _COLOR_HXX
79 //#define _PAL_HXX
80 //#define _BITMAP_HXX
81 //#define _GDIOBJ_HXX
82 //#define _POINTR_HXX
83 //#define _ICON_HXX
84 //#define _IMAGE_HXX
85 //#define _KEYCOD_HXX
86 //#define _EVENT_HXX
87 #define _HELP_HXX
88 //#define _APP_HXX
89 //#define _MDIAPP_HXX
90 //#define _TIMER_HXX
91 //#define _METRIC_HXX
92 //#define _REGION_HXX
93 //#define _OUTDEV_HXX
94 //#define _SYSTEM_HXX
95 //#define _VIRDEV_HXX
96 //#define _JOBSET_HXX
97 //#define _PRINT_HXX
98 //#define _WINDOW_HXX
99 //#define _SYSWIN_HXX
100 //#define _WRKWIN_HXX
101 #define _MDIWIN_HXX
102 //#define _FLOATWIN_HXX
103 //#define _DOCKWIN_HXX
104 //#define _CTRL_HXX
105 //#define _SCRBAR_HXX
106 //#define _BUTTON_HXX
107 //#define _IMAGEBTN_HXX
108 //#define _FIXED_HXX
109 //#define _GROUP_HXX
110 //#define _EDIT_HXX
111 //#define _COMBOBOX_HXX
112 //#define _LSTBOX_HXX
113 //#define _SELENG_HXX
114 //#define _SPLIT_HXX
115 #define _SPIN_HXX
116 //#define _FIELD_HXX
117 //#define _MOREBTN_HXX
118 //#define _TOOLBOX_HXX
119 //#define _STATUS_HXX
120 //#define _DIALOG_HXX
121 //#define _MSGBOX_HXX
122 //#define _SYSDLG_HXX
123 #define _FILDLG_HXX
124 //#define _PRNDLG_HXX
125 #define _COLDLG_HXX
126 //#define _TABDLG_HXX
127 //#define _MENU_HXX
128 //#define _GDIMTF_HXX
129 //#define _POLY_HXX
130 //#define _ACCEL_HXX
131 //#define _GRAPH_HXX
132 #define _SOUND_HXX
135 #define SI_NOITEMS
136 //#define SI_NODRW
137 #define _SI_NOSBXCONTROLS
138 #define _SI_NOOTHERFORMS
139 #define _SI_NOCONTROL
140 #define _SI_NOSBXCONTROLS
141 #define _SIDLL_HXX
143 // SFX
144 #define _SFXAPPWIN_HXX
145 #define _SFX_SAVEOPT_HXX
146 //#define _SFX_CHILDWIN_HXX
147 //#define _SFXCTRLITEM_HXX
148 #define _SFXPRNMON_HXX
149 #define _INTRO_HXX
150 #define _SFXMSGDESCR_HXX
151 #define _SFXMSGPOOL_HXX
152 #define _SFXFILEDLG_HXX
153 #define _PASSWD_HXX
154 #define _SFXTBXCTRL_HXX
155 #define _SFXSTBITEM_HXX
156 #define _SFXMNUITEM_HXX
157 #define _SFXIMGMGR_HXX
158 #define _SFXTBXMGR_HXX
159 #define _SFXSTBMGR_HXX
160 #define _SFX_MINFITEM_HXX
161 #define _SFXEVENT_HXX
163 // INCLUDE ---------------------------------------------------------------
165 #include <svx/svdundo.hxx>
167 #include "undodraw.hxx"
168 #include "docsh.hxx"
171 // -----------------------------------------------------------------------
173 TYPEINIT1(ScUndoDraw, SfxUndoAction);
175 // -----------------------------------------------------------------------
177 ScUndoDraw::ScUndoDraw( SfxUndoAction* pUndo, ScDocShell* pDocSh ) :
178 pDrawUndo( pUndo ),
179 pDocShell( pDocSh )
183 __EXPORT ScUndoDraw::~ScUndoDraw()
185 delete pDrawUndo;
188 void ScUndoDraw::ForgetDrawUndo()
190 pDrawUndo = NULL; // nicht loeschen (Draw-Undo muss dann von aussen gemerkt werden)
193 String __EXPORT ScUndoDraw::GetComment() const
195 if (pDrawUndo)
196 return pDrawUndo->GetComment();
197 else
198 return String();
201 String __EXPORT ScUndoDraw::GetRepeatComment(SfxRepeatTarget& rTarget) const
203 if (pDrawUndo)
204 return pDrawUndo->GetRepeatComment(rTarget);
205 else
206 return String();
209 USHORT __EXPORT ScUndoDraw::GetId() const
211 if (pDrawUndo)
212 return pDrawUndo->GetId();
213 else
214 return 0;
217 BOOL __EXPORT ScUndoDraw::IsLinked()
219 if (pDrawUndo)
220 return pDrawUndo->IsLinked();
221 else
222 return FALSE;
225 void __EXPORT ScUndoDraw::SetLinked( BOOL bIsLinked )
227 if (pDrawUndo)
228 pDrawUndo->SetLinked(bIsLinked);
231 BOOL __EXPORT ScUndoDraw::Merge( SfxUndoAction* pNextAction )
233 if (pDrawUndo)
234 return pDrawUndo->Merge(pNextAction);
235 else
236 return FALSE;
239 void __EXPORT ScUndoDraw::Undo()
241 if (pDrawUndo)
243 pDrawUndo->Undo();
244 pDocShell->SetDrawModified();
248 void __EXPORT ScUndoDraw::Redo()
250 if (pDrawUndo)
252 pDrawUndo->Redo();
253 pDocShell->SetDrawModified();
257 void __EXPORT ScUndoDraw::Repeat(SfxRepeatTarget& rTarget)
259 if (pDrawUndo)
260 pDrawUndo->Repeat(rTarget);
263 BOOL __EXPORT ScUndoDraw::CanRepeat(SfxRepeatTarget& rTarget) const
265 if (pDrawUndo)
266 return pDrawUndo->CanRepeat(rTarget);
267 else
268 return FALSE;