fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / ui / inc / undoblk.hxx
blobe19ade3db28cef58b5d8d06346e84bcba35e37e6
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 .
19 #ifndef INCLUDED_SC_SOURCE_UI_INC_UNDOBLK_HXX
20 #define INCLUDED_SC_SOURCE_UI_INC_UNDOBLK_HXX
22 #include "undobase.hxx"
23 #include "markdata.hxx"
24 #include "viewutil.hxx"
25 #include "spellparam.hxx"
26 #include "cellmergeoption.hxx"
27 #include "paramisc.hxx"
29 #include <boost/shared_ptr.hpp>
30 #include <boost/scoped_ptr.hpp>
32 class ScDocShell;
33 class ScDocument;
34 class ScOutlineTable;
35 class ScRangeList;
36 class ScPatternAttr;
37 class SvxBoxItem;
38 class SvxBoxInfoItem;
39 class SvxSearchItem;
40 class SdrUndoAction;
41 class ScEditDataArray;
43 class ScUndoInsertCells: public ScMoveUndo
45 public:
46 TYPEINFO_OVERRIDE();
47 ScUndoInsertCells( ScDocShell* pNewDocShell,
48 const ScRange& rRange, SCTAB nNewCount, SCTAB* pNewTabs, SCTAB* pNewScenarios,
49 InsCellCmd eNewCmd, ScDocument* pUndoDocument, ScRefUndoData* pRefData,
50 bool bNewPartOfPaste );
51 virtual ~ScUndoInsertCells();
53 virtual void Undo() SAL_OVERRIDE;
54 virtual void Redo() SAL_OVERRIDE;
55 virtual void Repeat( SfxRepeatTarget& rTarget ) SAL_OVERRIDE;
56 virtual bool CanRepeat( SfxRepeatTarget& rTarget ) const SAL_OVERRIDE;
58 virtual OUString GetComment() const SAL_OVERRIDE;
60 virtual bool Merge( SfxUndoAction *pNextAction ) SAL_OVERRIDE;
62 private:
63 ScRange aEffRange;
64 SCTAB nCount;
65 SCTAB* pTabs;
66 SCTAB* pScenarios;
67 sal_uLong nEndChangeAction;
68 InsCellCmd eCmd;
69 bool bPartOfPaste;
70 SfxUndoAction* pPasteUndo;
72 void DoChange ( const bool bUndo );
73 void SetChangeTrack();
76 class ScUndoDeleteCells: public ScMoveUndo
78 public:
79 TYPEINFO_OVERRIDE();
80 ScUndoDeleteCells( ScDocShell* pNewDocShell,
81 const ScRange& rRange, SCTAB nNewCount, SCTAB* pNewTabs, SCTAB* pNewScenarios,
82 DelCellCmd eNewCmd, ScDocument* pUndoDocument, ScRefUndoData* pRefData );
83 virtual ~ScUndoDeleteCells();
85 virtual void Undo() SAL_OVERRIDE;
86 virtual void Redo() SAL_OVERRIDE;
87 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
88 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
90 virtual OUString GetComment() const SAL_OVERRIDE;
92 private:
93 ScRange aEffRange;
94 SCTAB nCount;
95 SCTAB* pTabs;
96 SCTAB* pScenarios;
97 sal_uLong nStartChangeAction;
98 sal_uLong nEndChangeAction;
99 DelCellCmd eCmd;
101 void DoChange ( const bool bUndo );
102 void SetChangeTrack();
105 class ScUndoDeleteMulti: public ScMoveUndo
107 public:
108 TYPEINFO_OVERRIDE();
110 ScUndoDeleteMulti( ScDocShell* pNewDocShell,
111 bool bNewRows, bool bNeedsRefresh, SCTAB nNewTab,
112 const std::vector<sc::ColRowSpan>& rSpans,
113 ScDocument* pUndoDocument, ScRefUndoData* pRefData );
115 virtual ~ScUndoDeleteMulti();
117 virtual void Undo() SAL_OVERRIDE;
118 virtual void Redo() SAL_OVERRIDE;
119 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
120 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
122 virtual OUString GetComment() const SAL_OVERRIDE;
124 private:
125 bool mbRows:1;
126 bool mbRefresh:1;
127 SCTAB nTab;
128 std::vector<sc::ColRowSpan> maSpans;
129 sal_uLong nStartChangeAction;
130 sal_uLong nEndChangeAction;
132 void DoChange() const;
133 void SetChangeTrack();
136 class ScUndoCut: public ScBlockUndo
138 public:
139 TYPEINFO_OVERRIDE();
140 ScUndoCut( ScDocShell* pNewDocShell,
141 ScRange aRange, // adjusted for merged cells
142 ScAddress aOldEnd, // end position without adjustment
143 const ScMarkData& rMark, // selected sheets
144 ScDocument* pNewUndoDoc );
145 virtual ~ScUndoCut();
147 virtual void Undo() SAL_OVERRIDE;
148 virtual void Redo() SAL_OVERRIDE;
149 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
150 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
152 virtual OUString GetComment() const SAL_OVERRIDE;
154 private:
155 ScMarkData aMarkData;
156 ScDocument* pUndoDoc;
157 ScRange aExtendedRange;
158 sal_uLong nStartChangeAction;
159 sal_uLong nEndChangeAction;
161 void DoChange( const bool bUndo );
162 void SetChangeTrack();
165 struct ScUndoPasteOptions
167 sal_uInt16 nFunction;
168 bool bSkipEmpty;
169 bool bTranspose;
170 bool bAsLink;
171 InsCellCmd eMoveMode;
173 ScUndoPasteOptions() :
174 nFunction( PASTE_NOFUNC ),
175 bSkipEmpty( false ),
176 bTranspose( false ),
177 bAsLink( false ),
178 eMoveMode( INS_NONE )
182 class ScUndoPaste: public ScMultiBlockUndo
184 public:
185 TYPEINFO_OVERRIDE();
186 ScUndoPaste(ScDocShell* pNewDocShell, const ScRangeList& rRanges,
187 const ScMarkData& rMark,
188 ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc,
189 InsertDeleteFlags nNewFlags,
190 ScRefUndoData* pRefData,
191 bool bRedoIsFilled = true,
192 const ScUndoPasteOptions* pOptions = NULL);
193 virtual ~ScUndoPaste();
195 virtual void Undo() SAL_OVERRIDE;
196 virtual void Redo() SAL_OVERRIDE;
197 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
198 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
200 virtual OUString GetComment() const SAL_OVERRIDE;
202 private:
203 ScMarkData aMarkData;
204 ScDocument* pUndoDoc;
205 ScDocument* pRedoDoc;
206 InsertDeleteFlags nFlags;
207 ScRefUndoData* pRefUndoData;
208 ScRefUndoData* pRefRedoData;
209 sal_uLong nStartChangeAction;
210 sal_uLong nEndChangeAction;
211 bool bRedoFilled;
212 ScUndoPasteOptions aPasteOptions;
214 void DoChange(bool bUndo);
215 void SetChangeTrack();
218 class ScUndoDragDrop: public ScMoveUndo
220 public:
221 TYPEINFO_OVERRIDE();
222 ScUndoDragDrop( ScDocShell* pNewDocShell,
223 const ScRange& rRange, ScAddress aNewDestPos, bool bNewCut,
224 ScDocument* pUndoDocument, ScRefUndoData* pRefData,
225 bool bScenario );
226 virtual ~ScUndoDragDrop();
228 virtual void Undo() SAL_OVERRIDE;
229 virtual void Redo() SAL_OVERRIDE;
230 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
231 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
233 virtual OUString GetComment() const SAL_OVERRIDE;
235 private:
236 sal_uInt16 mnPaintExtFlags;
237 ScRangeList maPaintRanges;
239 ScRange aSrcRange;
240 ScRange aDestRange;
241 sal_uLong nStartChangeAction;
242 sal_uLong nEndChangeAction;
243 bool bCut;
244 bool bKeepScenarioFlags;
246 void PaintArea( ScRange aRange, sal_uInt16 nExtFlags ) const;
247 void DoUndo( ScRange aRange );
249 void SetChangeTrack();
252 class ScUndoDeleteContents: public ScSimpleUndo
254 public:
255 TYPEINFO_OVERRIDE();
256 ScUndoDeleteContents( ScDocShell* pNewDocShell,
257 const ScMarkData& rMark,
258 const ScRange& rRange,
259 ScDocument* pNewUndoDoc, bool bNewMulti,
260 InsertDeleteFlags nNewFlags, bool bObjects );
261 virtual ~ScUndoDeleteContents();
263 virtual void Undo() SAL_OVERRIDE;
264 virtual void Redo() SAL_OVERRIDE;
265 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
266 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
268 virtual OUString GetComment() const SAL_OVERRIDE;
270 void SetDataSpans( const boost::shared_ptr<DataSpansType>& pSpans );
272 private:
273 boost::shared_ptr<DataSpansType> mpDataSpans; // Spans of non-empty cells.
275 ScRange aRange;
276 ScMarkData aMarkData;
277 ScDocument* pUndoDoc; // Block mark and deleted data
278 SdrUndoAction* pDrawUndo; // Deleted objects
279 sal_uLong nStartChangeAction;
280 sal_uLong nEndChangeAction;
281 InsertDeleteFlags nFlags;
282 bool bMulti; // Multi selection
284 void DoChange( const bool bUndo );
285 void SetChangeTrack();
288 class ScUndoFillTable: public ScSimpleUndo
290 public:
291 TYPEINFO_OVERRIDE();
292 ScUndoFillTable( ScDocShell* pNewDocShell,
293 const ScMarkData& rMark,
294 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
295 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
296 ScDocument* pNewUndoDoc, bool bNewMulti, SCTAB nSrc,
297 InsertDeleteFlags nFlg, sal_uInt16 nFunc, bool bSkip, bool bLink );
298 virtual ~ScUndoFillTable();
300 virtual void Undo() SAL_OVERRIDE;
301 virtual void Redo() SAL_OVERRIDE;
302 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
303 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
305 virtual OUString GetComment() const SAL_OVERRIDE;
307 private:
308 ScRange aRange;
309 ScMarkData aMarkData;
310 ScDocument* pUndoDoc; // Block mark and deleted data
311 sal_uLong nStartChangeAction;
312 sal_uLong nEndChangeAction;
313 InsertDeleteFlags nFlags;
314 sal_uInt16 nFunction;
315 SCTAB nSrcTab;
316 bool bMulti; // Multi selection
317 bool bSkipEmpty;
318 bool bAsLink;
320 void DoChange( const bool bUndo );
321 void SetChangeTrack();
324 class ScUndoSelectionAttr: public ScSimpleUndo
326 public:
327 TYPEINFO_OVERRIDE();
328 ScUndoSelectionAttr( ScDocShell* pNewDocShell,
329 const ScMarkData& rMark,
330 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
331 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
332 ScDocument* pNewUndoDoc, bool bNewMulti,
333 const ScPatternAttr* pNewApply,
334 const SvxBoxItem* pNewOuter = NULL,
335 const SvxBoxInfoItem* pNewInner = NULL );
336 virtual ~ScUndoSelectionAttr();
338 virtual void Undo() SAL_OVERRIDE;
339 virtual void Redo() SAL_OVERRIDE;
340 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
341 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
343 virtual OUString GetComment() const SAL_OVERRIDE;
345 ScEditDataArray* GetDataArray();
346 private:
347 ScMarkData aMarkData;
348 ScRange aRange;
349 boost::scoped_ptr<ScEditDataArray> mpDataArray;
350 ScDocument* pUndoDoc;
351 bool bMulti;
352 ScPatternAttr* pApplyPattern;
353 SvxBoxItem* pLineOuter;
354 SvxBoxInfoItem* pLineInner;
356 void DoChange( const bool bUndo );
357 void ChangeEditData( const bool bUndo );
360 class ScUndoWidthOrHeight: public ScSimpleUndo
362 public:
363 TYPEINFO_OVERRIDE();
364 ScUndoWidthOrHeight( ScDocShell* pNewDocShell,
365 const ScMarkData& rMark,
366 SCCOLROW nNewStart, SCTAB nNewStartTab,
367 SCCOLROW nNewEnd, SCTAB nNewEndTab,
368 ScDocument* pNewUndoDoc,
369 const std::vector<sc::ColRowSpan>& rRanges,
370 ScOutlineTable* pNewUndoTab,
371 ScSizeMode eNewMode, sal_uInt16 nNewSizeTwips,
372 bool bNewWidth );
373 virtual ~ScUndoWidthOrHeight();
375 virtual void Undo() SAL_OVERRIDE;
376 virtual void Redo() SAL_OVERRIDE;
377 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
378 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
380 virtual OUString GetComment() const SAL_OVERRIDE;
382 private:
383 ScMarkData aMarkData;
384 SCCOLROW nStart;
385 SCCOLROW nEnd;
386 SCTAB nStartTab;
387 SCTAB nEndTab;
388 ScDocument* pUndoDoc;
389 ScOutlineTable* pUndoTab;
390 std::vector<sc::ColRowSpan> maRanges;
391 sal_uInt16 nNewSize;
392 bool bWidth;
393 ScSizeMode eMode;
394 SdrUndoAction* pDrawUndo;
397 class ScUndoAutoFill: public ScBlockUndo
399 public:
400 TYPEINFO_OVERRIDE();
401 ScUndoAutoFill( ScDocShell* pNewDocShell,
402 const ScRange& rRange, const ScRange& rSourceArea,
403 ScDocument* pNewUndoDoc, const ScMarkData& rMark,
404 FillDir eNewFillDir,
405 FillCmd eNewFillCmd, FillDateCmd eNewFillDateCmd,
406 double fNewStartValue, double fNewStepValue, double fNewMaxValue );
407 virtual ~ScUndoAutoFill();
409 virtual void Undo() SAL_OVERRIDE;
410 virtual void Redo() SAL_OVERRIDE;
411 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
412 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
414 virtual OUString GetComment() const SAL_OVERRIDE;
416 private:
417 ScRange aSource;
418 ScMarkData aMarkData;
419 ScDocument* pUndoDoc;
420 FillDir eFillDir;
421 FillCmd eFillCmd;
422 FillDateCmd eFillDateCmd;
423 double fStartValue;
424 double fStepValue;
425 double fMaxValue;
426 sal_uLong nStartChangeAction;
427 sal_uLong nEndChangeAction;
429 void SetChangeTrack();
432 class ScUndoMerge: public ScSimpleUndo
434 public:
435 TYPEINFO_OVERRIDE();
436 ScUndoMerge( ScDocShell* pNewDocShell, const ScCellMergeOption& rOption,
437 bool bMergeContents, ScDocument* pUndoDoc, SdrUndoAction* pDrawUndo);
438 virtual ~ScUndoMerge();
440 virtual void Undo() SAL_OVERRIDE;
441 virtual void Redo() SAL_OVERRIDE;
442 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
443 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
445 virtual OUString GetComment() const SAL_OVERRIDE;
447 private:
448 ScCellMergeOption maOption;
449 bool mbMergeContents; // Merge contents in Redo().
450 ScDocument* mpUndoDoc; // when data is merged
451 SdrUndoAction* mpDrawUndo;
453 void DoChange( bool bUndo ) const;
456 class ScUndoAutoFormat: public ScBlockUndo
458 public:
459 TYPEINFO_OVERRIDE();
460 ScUndoAutoFormat( ScDocShell* pNewDocShell,
461 const ScRange& rRange, ScDocument* pNewUndoDoc,
462 const ScMarkData& rMark,
463 bool bNewSize, sal_uInt16 nNewFormatNo );
464 virtual ~ScUndoAutoFormat();
466 virtual void Undo() SAL_OVERRIDE;
467 virtual void Redo() SAL_OVERRIDE;
468 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
469 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
471 virtual OUString GetComment() const SAL_OVERRIDE;
473 private:
474 ScDocument* pUndoDoc; // deleted data
475 ScMarkData aMarkData;
476 bool bSize;
477 sal_uInt16 nFormatNo;
480 class ScUndoReplace: public ScSimpleUndo
482 public:
483 TYPEINFO_OVERRIDE();
484 ScUndoReplace( ScDocShell* pNewDocShell,
485 const ScMarkData& rMark,
486 SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
487 const OUString& rNewUndoStr, ScDocument* pNewUndoDoc,
488 const SvxSearchItem* pItem );
489 virtual ~ScUndoReplace();
491 virtual void Undo() SAL_OVERRIDE;
492 virtual void Redo() SAL_OVERRIDE;
493 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
494 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
496 virtual OUString GetComment() const SAL_OVERRIDE;
498 private:
499 ScAddress aCursorPos;
500 ScMarkData aMarkData;
501 OUString aUndoStr; // Data at single selection
502 ScDocument* pUndoDoc; // Block mark and deleted data
503 SvxSearchItem* pSearchItem;
504 sal_uLong nStartChangeAction;
505 sal_uLong nEndChangeAction;
507 void SetChangeTrack();
510 class ScUndoTabOp: public ScSimpleUndo
512 public:
513 TYPEINFO_OVERRIDE();
514 ScUndoTabOp( ScDocShell* pNewDocShell,
515 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
516 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
517 ScDocument* pNewUndoDoc,
518 const ScRefAddress& rFormulaCell,
519 const ScRefAddress& rFormulaEnd,
520 const ScRefAddress& rRowCell,
521 const ScRefAddress& rColCell,
522 ScTabOpParam::Mode eMode );
523 virtual ~ScUndoTabOp();
525 virtual void Undo() SAL_OVERRIDE;
526 virtual void Redo() SAL_OVERRIDE;
527 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
528 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
530 virtual OUString GetComment() const SAL_OVERRIDE;
532 private:
533 ScRange aRange;
534 ScDocument* pUndoDoc; // Deleted data
535 ScRefAddress theFormulaCell;
536 ScRefAddress theFormulaEnd;
537 ScRefAddress theRowCell;
538 ScRefAddress theColCell;
539 ScTabOpParam::Mode meMode;
542 class ScUndoConversion : public ScSimpleUndo
544 public:
545 TYPEINFO_OVERRIDE();
547 ScUndoConversion( ScDocShell* pNewDocShell, const ScMarkData& rMark,
548 SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScDocument* pNewUndoDoc,
549 SCCOL nNewX, SCROW nNewY, SCTAB nNewZ, ScDocument* pNewRedoDoc,
550 const ScConversionParam& rConvParam );
551 virtual ~ScUndoConversion();
553 virtual void Undo() SAL_OVERRIDE;
554 virtual void Redo() SAL_OVERRIDE;
555 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
556 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
558 virtual OUString GetComment() const SAL_OVERRIDE;
560 private:
561 ScMarkData aMarkData;
562 ScAddress aCursorPos;
563 ScDocument* pUndoDoc; // Block mark and deleted data
564 ScAddress aNewCursorPos;
565 ScDocument* pRedoDoc; // Block mark and new data
566 sal_uLong nStartChangeAction;
567 sal_uLong nEndChangeAction;
568 ScConversionParam maConvParam; /// Conversion type and parameters.
570 void DoChange( ScDocument* pRefDoc, const ScAddress& rCursorPos );
571 void SetChangeTrack();
574 class ScUndoRefConversion: public ScSimpleUndo
576 public:
577 TYPEINFO_OVERRIDE();
578 ScUndoRefConversion( ScDocShell* pNewDocShell,
579 const ScRange& aMarkRange, const ScMarkData& rMark,
580 ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc, bool bNewMulti, InsertDeleteFlags nNewFlag);
581 virtual ~ScUndoRefConversion();
583 virtual void Undo() SAL_OVERRIDE;
584 virtual void Redo() SAL_OVERRIDE;
585 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
586 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
588 virtual OUString GetComment() const SAL_OVERRIDE;
590 private:
591 ScMarkData aMarkData;
592 ScDocument* pUndoDoc;
593 ScDocument* pRedoDoc;
594 ScRange aRange;
595 bool bMulti;
596 InsertDeleteFlags nFlags;
597 sal_uLong nStartChangeAction;
598 sal_uLong nEndChangeAction;
600 void DoChange( ScDocument* pRefDoc);
601 void SetChangeTrack();
604 class ScUndoListNames: public ScBlockUndo
606 public:
607 TYPEINFO_OVERRIDE();
608 ScUndoListNames( ScDocShell* pNewDocShell,
609 const ScRange& rRange,
610 ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc );
611 virtual ~ScUndoListNames();
613 virtual void Undo() SAL_OVERRIDE;
614 virtual void Redo() SAL_OVERRIDE;
615 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
616 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
618 virtual OUString GetComment() const SAL_OVERRIDE;
620 private:
621 ScDocument* pUndoDoc;
622 ScDocument* pRedoDoc;
624 void DoChange( ScDocument* pSrcDoc ) const;
627 class ScUndoConditionalFormat : public ScSimpleUndo
629 public:
630 TYPEINFO_OVERRIDE();
631 ScUndoConditionalFormat( ScDocShell* pNewDocShell,
632 ScDocument* pUndoDoc, ScDocument* pRedoDoc, const ScRange& rRange);
633 virtual ~ScUndoConditionalFormat();
635 virtual void Undo() SAL_OVERRIDE;
636 virtual void Redo() SAL_OVERRIDE;
637 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
638 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
640 virtual OUString GetComment() const SAL_OVERRIDE;
642 private:
643 void DoChange(ScDocument* pDoc);
644 boost::scoped_ptr<ScDocument> mpUndoDoc;
645 boost::scoped_ptr<ScDocument> mpRedoDoc;
646 ScRange maRange;
649 class ScUndoUseScenario: public ScSimpleUndo
651 public:
652 TYPEINFO_OVERRIDE();
653 ScUndoUseScenario( ScDocShell* pNewDocShell,
654 const ScMarkData& rMark,
655 const ScArea& rDestArea, ScDocument* pNewUndoDoc,
656 const OUString& rNewName );
657 virtual ~ScUndoUseScenario();
659 virtual void Undo() SAL_OVERRIDE;
660 virtual void Redo() SAL_OVERRIDE;
661 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
662 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
664 virtual OUString GetComment() const SAL_OVERRIDE;
666 private:
667 ScDocument* pUndoDoc;
668 ScRange aRange;
669 ScMarkData aMarkData;
670 OUString aName;
673 class ScUndoSelectionStyle: public ScSimpleUndo
675 public:
676 TYPEINFO_OVERRIDE();
677 ScUndoSelectionStyle( ScDocShell* pNewDocShell,
678 const ScMarkData& rMark,
679 const ScRange& rRange,
680 const OUString& rName,
681 ScDocument* pNewUndoDoc );
682 virtual ~ScUndoSelectionStyle();
684 virtual void Undo() SAL_OVERRIDE;
685 virtual void Redo() SAL_OVERRIDE;
686 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
687 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
689 virtual OUString GetComment() const SAL_OVERRIDE;
690 virtual sal_uInt16 GetId() const SAL_OVERRIDE;
692 private:
693 ScMarkData aMarkData;
694 ScDocument* pUndoDoc;
695 OUString aStyleName;
696 ScRange aRange;
698 void DoChange( const bool bUndo );
701 class ScUndoRefreshLink: public ScSimpleUndo
703 public:
704 TYPEINFO_OVERRIDE();
705 ScUndoRefreshLink( ScDocShell* pNewDocShell,
706 ScDocument* pNewUndoDoc );
707 virtual ~ScUndoRefreshLink();
709 virtual void Undo() SAL_OVERRIDE;
710 virtual void Redo() SAL_OVERRIDE;
711 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
712 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
714 virtual OUString GetComment() const SAL_OVERRIDE;
716 private:
717 ScDocument* pUndoDoc;
718 ScDocument* pRedoDoc;
721 class ScUndoEnterMatrix: public ScBlockUndo
723 public:
724 TYPEINFO_OVERRIDE();
725 ScUndoEnterMatrix( ScDocShell* pNewDocShell,
726 const ScRange& rArea,
727 ScDocument* pNewUndoDoc,
728 const OUString& rForm );
729 virtual ~ScUndoEnterMatrix();
731 virtual void Undo() SAL_OVERRIDE;
732 virtual void Redo() SAL_OVERRIDE;
733 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
734 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
736 virtual OUString GetComment() const SAL_OVERRIDE;
738 private:
739 ScDocument* pUndoDoc;
740 OUString aFormula;
741 sal_uLong nStartChangeAction;
742 sal_uLong nEndChangeAction;
744 void SetChangeTrack();
747 class ScUndoInsertAreaLink : public ScSimpleUndo
749 public:
750 TYPEINFO_OVERRIDE();
751 ScUndoInsertAreaLink( ScDocShell* pShell,
752 const OUString& rDocName,
753 const OUString& rFltName, const OUString& rOptions,
754 const OUString& rAreaName, const ScRange& rDestRange,
755 sal_uLong nRefreshDelay );
756 virtual ~ScUndoInsertAreaLink();
758 virtual void Undo() SAL_OVERRIDE;
759 virtual void Redo() SAL_OVERRIDE;
760 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
761 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
763 virtual OUString GetComment() const SAL_OVERRIDE;
765 private:
766 OUString aDocName;
767 OUString aFltName;
768 OUString aOptions;
769 OUString aAreaName;
770 ScRange aRange;
771 sal_uLong nRefreshDelay;
774 class ScUndoRemoveAreaLink : public ScSimpleUndo
776 public:
777 TYPEINFO_OVERRIDE();
778 ScUndoRemoveAreaLink( ScDocShell* pShell,
779 const OUString& rDocName,
780 const OUString& rFltName, const OUString& rOptions,
781 const OUString& rAreaName, const ScRange& rDestRange,
782 sal_uLong nRefreshDelay );
783 virtual ~ScUndoRemoveAreaLink();
785 virtual void Undo() SAL_OVERRIDE;
786 virtual void Redo() SAL_OVERRIDE;
787 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
788 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
790 virtual OUString GetComment() const SAL_OVERRIDE;
792 private:
793 OUString aDocName;
794 OUString aFltName;
795 OUString aOptions;
796 OUString aAreaName;
797 ScRange aRange;
798 sal_uLong nRefreshDelay;
801 class ScUndoUpdateAreaLink : public ScSimpleUndo //! also change BlockUndo?
803 public:
804 TYPEINFO_OVERRIDE();
805 ScUndoUpdateAreaLink( ScDocShell* pShell,
806 const OUString& rOldD,
807 const OUString& rOldF, const OUString& rOldO,
808 const OUString& rOldA, const ScRange& rOldR,
809 sal_uLong nOldRD,
810 const OUString& rNewD,
811 const OUString& rNewF, const OUString& rNewO,
812 const OUString& rNewA, const ScRange& rNewR,
813 sal_uLong nNewRD,
814 ScDocument* pUndo, ScDocument* pRedo,
815 bool bDoInsert );
816 virtual ~ScUndoUpdateAreaLink();
818 virtual void Undo() SAL_OVERRIDE;
819 virtual void Redo() SAL_OVERRIDE;
820 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
821 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
823 virtual OUString GetComment() const SAL_OVERRIDE;
825 private:
826 OUString aOldDoc;
827 OUString aOldFlt;
828 OUString aOldOpt;
829 OUString aOldArea;
830 ScRange aOldRange;
831 OUString aNewDoc;
832 OUString aNewFlt;
833 OUString aNewOpt;
834 OUString aNewArea;
835 ScRange aNewRange;
836 ScDocument* pUndoDoc;
837 ScDocument* pRedoDoc;
838 sal_uLong nOldRefresh;
839 sal_uLong nNewRefresh;
840 bool bWithInsert;
842 void DoChange( const bool bUndo ) const;
845 class ScUndoIndent: public ScBlockUndo
847 public:
848 TYPEINFO_OVERRIDE();
849 ScUndoIndent( ScDocShell* pNewDocShell, const ScMarkData& rMark,
850 ScDocument* pNewUndoDoc, bool bIncrement );
851 virtual ~ScUndoIndent();
853 virtual void Undo() SAL_OVERRIDE;
854 virtual void Redo() SAL_OVERRIDE;
855 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
856 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
858 virtual OUString GetComment() const SAL_OVERRIDE;
860 private:
861 ScMarkData aMarkData;
862 ScDocument* pUndoDoc;
863 bool bIsIncrement;
866 class ScUndoTransliterate: public ScBlockUndo
868 public:
869 TYPEINFO_OVERRIDE();
870 ScUndoTransliterate( ScDocShell* pNewDocShell, const ScMarkData& rMark,
871 ScDocument* pNewUndoDoc, sal_Int32 nType );
872 virtual ~ScUndoTransliterate();
874 virtual void Undo() SAL_OVERRIDE;
875 virtual void Redo() SAL_OVERRIDE;
876 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
877 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
879 virtual OUString GetComment() const SAL_OVERRIDE;
881 private:
882 ScMarkData aMarkData;
883 ScDocument* pUndoDoc;
884 sal_Int32 nTransliterationType;
887 class ScUndoClearItems: public ScBlockUndo
889 public:
890 TYPEINFO_OVERRIDE();
891 ScUndoClearItems( ScDocShell* pNewDocShell, const ScMarkData& rMark,
892 ScDocument* pNewUndoDoc, const sal_uInt16* pW );
893 virtual ~ScUndoClearItems();
895 virtual void Undo() SAL_OVERRIDE;
896 virtual void Redo() SAL_OVERRIDE;
897 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
898 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
900 virtual OUString GetComment() const SAL_OVERRIDE;
902 private:
903 ScMarkData aMarkData;
904 ScDocument* pUndoDoc;
905 sal_uInt16* pWhich;
908 class ScUndoRemoveBreaks: public ScSimpleUndo
910 public:
911 TYPEINFO_OVERRIDE();
912 ScUndoRemoveBreaks( ScDocShell* pNewDocShell,
913 SCTAB nNewTab, ScDocument* pNewUndoDoc );
914 virtual ~ScUndoRemoveBreaks();
916 virtual void Undo() SAL_OVERRIDE;
917 virtual void Redo() SAL_OVERRIDE;
918 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
919 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
921 virtual OUString GetComment() const SAL_OVERRIDE;
923 private:
924 SCTAB nTab;
925 ScDocument* pUndoDoc;
928 class ScUndoRemoveMerge: public ScBlockUndo
930 public:
931 TYPEINFO_OVERRIDE();
932 ScUndoRemoveMerge( ScDocShell* pNewDocShell,
933 const ScCellMergeOption& rOption,
934 ScDocument* pNewUndoDoc );
935 virtual ~ScUndoRemoveMerge();
937 virtual void Undo() SAL_OVERRIDE;
938 virtual void Redo() SAL_OVERRIDE;
939 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
940 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
942 virtual OUString GetComment() const SAL_OVERRIDE;
944 private:
945 void SetCurTab();
947 ScCellMergeOption maOption;
948 ScDocument* pUndoDoc;
951 class ScUndoBorder: public ScBlockUndo
953 public:
954 TYPEINFO_OVERRIDE();
955 ScUndoBorder( ScDocShell* pNewDocShell,
956 const ScRangeList& rRangeList,
957 ScDocument* pNewUndoDoc,
958 const SvxBoxItem& rNewOuter,
959 const SvxBoxInfoItem& rNewInner );
960 virtual ~ScUndoBorder();
962 virtual void Undo() SAL_OVERRIDE;
963 virtual void Redo() SAL_OVERRIDE;
964 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
965 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
967 virtual OUString GetComment() const SAL_OVERRIDE;
969 private:
970 ScDocument* pUndoDoc;
971 ScRangeList* pRanges;
972 SvxBoxItem* pOuter;
973 SvxBoxInfoItem* pInner;
976 #endif
978 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */