Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / inc / undoblk.hxx
blob1b10216b3ebd5f55b12d12396458db2bc901d12d
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 SC_UNDOBLK_HXX
20 #define SC_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 //----------------------------------------------------------------------------
45 class ScUndoInsertCells: public ScMoveUndo
47 public:
48 TYPEINFO();
49 ScUndoInsertCells( ScDocShell* pNewDocShell,
50 const ScRange& rRange, SCTAB nNewCount, SCTAB* pNewTabs, SCTAB* pNewScenarios,
51 InsCellCmd eNewCmd, ScDocument* pUndoDocument, ScRefUndoData* pRefData,
52 sal_Bool bNewPartOfPaste );
53 virtual ~ScUndoInsertCells();
55 virtual void Undo();
56 virtual void Redo();
57 virtual void Repeat( SfxRepeatTarget& rTarget );
58 virtual bool CanRepeat( SfxRepeatTarget& rTarget ) const;
60 virtual OUString GetComment() const;
62 virtual bool Merge( SfxUndoAction *pNextAction );
64 private:
65 ScRange aEffRange;
66 SCTAB nCount;
67 SCTAB* pTabs;
68 SCTAB* pScenarios;
69 sal_uLong nEndChangeAction;
70 InsCellCmd eCmd;
71 sal_Bool bPartOfPaste;
72 SfxUndoAction* pPasteUndo;
74 void DoChange ( const sal_Bool bUndo );
75 void SetChangeTrack();
79 class ScUndoDeleteCells: public ScMoveUndo
81 public:
82 TYPEINFO();
83 ScUndoDeleteCells( ScDocShell* pNewDocShell,
84 const ScRange& rRange, SCTAB nNewCount, SCTAB* pNewTabs, SCTAB* pNewScenarios,
85 DelCellCmd eNewCmd, ScDocument* pUndoDocument, ScRefUndoData* pRefData );
86 virtual ~ScUndoDeleteCells();
88 virtual void Undo();
89 virtual void Redo();
90 virtual void Repeat(SfxRepeatTarget& rTarget);
91 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
93 virtual OUString GetComment() const;
95 private:
96 ScRange aEffRange;
97 SCTAB nCount;
98 SCTAB* pTabs;
99 SCTAB* pScenarios;
100 sal_uLong nStartChangeAction;
101 sal_uLong nEndChangeAction;
102 DelCellCmd eCmd;
104 void DoChange ( const sal_Bool bUndo );
105 void SetChangeTrack();
109 class ScUndoDeleteMulti: public ScMoveUndo
111 public:
112 TYPEINFO();
113 ScUndoDeleteMulti( ScDocShell* pNewDocShell,
114 sal_Bool bNewRows, sal_Bool bNeedsRefresh, SCTAB nNewTab,
115 const SCCOLROW* pRng, SCCOLROW nRngCnt,
116 ScDocument* pUndoDocument, ScRefUndoData* pRefData );
117 virtual ~ScUndoDeleteMulti();
119 virtual void Undo();
120 virtual void Redo();
121 virtual void Repeat(SfxRepeatTarget& rTarget);
122 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
124 virtual OUString GetComment() const;
126 private:
127 sal_Bool bRows;
128 sal_Bool bRefresh;
129 SCTAB nTab;
130 SCCOLROW* pRanges;
131 SCCOLROW nRangeCnt;
132 sal_uLong nStartChangeAction;
133 sal_uLong nEndChangeAction;
135 void DoChange() const;
136 void SetChangeTrack();
140 class ScUndoCut: public ScBlockUndo
142 public:
143 TYPEINFO();
144 ScUndoCut( ScDocShell* pNewDocShell,
145 ScRange aRange, // adjusted for merged cells
146 ScAddress aOldEnd, // end position without adjustment
147 const ScMarkData& rMark, // selected sheets
148 ScDocument* pNewUndoDoc );
149 virtual ~ScUndoCut();
151 virtual void Undo();
152 virtual void Redo();
153 virtual void Repeat(SfxRepeatTarget& rTarget);
154 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
156 virtual OUString GetComment() const;
158 private:
159 ScMarkData aMarkData;
160 ScDocument* pUndoDoc;
161 ScRange aExtendedRange;
162 sal_uLong nStartChangeAction;
163 sal_uLong nEndChangeAction;
165 void DoChange( const sal_Bool bUndo );
166 void SetChangeTrack();
170 struct ScUndoPasteOptions
172 sal_uInt16 nFunction;
173 sal_Bool bSkipEmpty;
174 sal_Bool bTranspose;
175 sal_Bool bAsLink;
176 InsCellCmd eMoveMode;
178 ScUndoPasteOptions() :
179 nFunction( PASTE_NOFUNC ),
180 bSkipEmpty( false ),
181 bTranspose( false ),
182 bAsLink( false ),
183 eMoveMode( INS_NONE )
187 class ScUndoPaste: public ScMultiBlockUndo
189 public:
190 TYPEINFO();
191 ScUndoPaste(ScDocShell* pNewDocShell, const ScRangeList& rRanges,
192 const ScMarkData& rMark,
193 ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc,
194 sal_uInt16 nNewFlags,
195 ScRefUndoData* pRefData,
196 bool bRedoIsFilled = true,
197 const ScUndoPasteOptions* pOptions = NULL);
198 virtual ~ScUndoPaste();
200 virtual void Undo();
201 virtual void Redo();
202 virtual void Repeat(SfxRepeatTarget& rTarget);
203 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
205 virtual OUString GetComment() const;
207 private:
208 ScMarkData aMarkData;
209 ScDocument* pUndoDoc;
210 ScDocument* pRedoDoc;
211 sal_uInt16 nFlags;
212 ScRefUndoData* pRefUndoData;
213 ScRefUndoData* pRefRedoData;
214 sal_uLong nStartChangeAction;
215 sal_uLong nEndChangeAction;
216 sal_Bool bRedoFilled;
217 ScUndoPasteOptions aPasteOptions;
219 void DoChange(bool bUndo);
220 void SetChangeTrack();
224 class ScUndoDragDrop: public ScMoveUndo
226 public:
227 TYPEINFO();
228 ScUndoDragDrop( ScDocShell* pNewDocShell,
229 const ScRange& rRange, ScAddress aNewDestPos, sal_Bool bNewCut,
230 ScDocument* pUndoDocument, ScRefUndoData* pRefData,
231 sal_Bool bScenario );
232 virtual ~ScUndoDragDrop();
234 virtual void Undo();
235 virtual void Redo();
236 virtual void Repeat(SfxRepeatTarget& rTarget);
237 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
239 virtual OUString GetComment() const;
241 private:
242 ScRange aSrcRange;
243 ScRange aDestRange;
244 sal_uLong nStartChangeAction;
245 sal_uLong nEndChangeAction;
246 sal_Bool bCut;
247 sal_Bool bKeepScenarioFlags;
249 void PaintArea( ScRange aRange, sal_uInt16 nExtFlags ) const;
250 void DoUndo( ScRange aRange ) const;
252 void SetChangeTrack();
256 class ScUndoDeleteContents: public ScSimpleUndo
258 public:
259 TYPEINFO();
260 ScUndoDeleteContents( ScDocShell* pNewDocShell,
261 const ScMarkData& rMark,
262 const ScRange& rRange,
263 ScDocument* pNewUndoDoc, sal_Bool bNewMulti,
264 sal_uInt16 nNewFlags, sal_Bool bObjects );
265 virtual ~ScUndoDeleteContents();
267 virtual void Undo();
268 virtual void Redo();
269 virtual void Repeat(SfxRepeatTarget& rTarget);
270 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
272 virtual OUString GetComment() const;
274 private:
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 sal_uInt16 nFlags;
282 sal_Bool bMulti; // Multi selection
284 void DoChange( const sal_Bool bUndo );
285 void SetChangeTrack();
289 class ScUndoFillTable: public ScSimpleUndo
291 public:
292 TYPEINFO();
293 ScUndoFillTable( ScDocShell* pNewDocShell,
294 const ScMarkData& rMark,
295 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
296 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
297 ScDocument* pNewUndoDoc, sal_Bool bNewMulti, SCTAB nSrc,
298 sal_uInt16 nFlg, sal_uInt16 nFunc, sal_Bool bSkip, sal_Bool bLink );
299 virtual ~ScUndoFillTable();
301 virtual void Undo();
302 virtual void Redo();
303 virtual void Repeat(SfxRepeatTarget& rTarget);
304 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
306 virtual OUString GetComment() const;
308 private:
309 ScRange aRange;
310 ScMarkData aMarkData;
311 ScDocument* pUndoDoc; // Block mark and deleted data
312 sal_uLong nStartChangeAction;
313 sal_uLong nEndChangeAction;
314 sal_uInt16 nFlags;
315 sal_uInt16 nFunction;
316 SCTAB nSrcTab;
317 sal_Bool bMulti; // Multi selection
318 sal_Bool bSkipEmpty;
319 sal_Bool bAsLink;
321 void DoChange( const sal_Bool bUndo );
322 void SetChangeTrack();
326 class ScUndoSelectionAttr: public ScSimpleUndo
328 public:
329 TYPEINFO();
330 ScUndoSelectionAttr( ScDocShell* pNewDocShell,
331 const ScMarkData& rMark,
332 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
333 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
334 ScDocument* pNewUndoDoc, sal_Bool bNewMulti,
335 const ScPatternAttr* pNewApply,
336 const SvxBoxItem* pNewOuter = NULL,
337 const SvxBoxInfoItem* pNewInner = NULL );
338 virtual ~ScUndoSelectionAttr();
340 virtual void Undo();
341 virtual void Redo();
342 virtual void Repeat(SfxRepeatTarget& rTarget);
343 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
345 virtual OUString GetComment() const;
347 ScEditDataArray* GetDataArray();
348 private:
349 ScMarkData aMarkData;
350 ScRange aRange;
351 boost::scoped_ptr<ScEditDataArray> mpDataArray;
352 ScDocument* pUndoDoc;
353 sal_Bool bMulti;
354 ScPatternAttr* pApplyPattern;
355 SvxBoxItem* pLineOuter;
356 SvxBoxInfoItem* pLineInner;
358 void DoChange( const sal_Bool bUndo );
359 void ChangeEditData( const bool bUndo );
363 class ScUndoWidthOrHeight: public ScSimpleUndo
365 public:
366 TYPEINFO();
367 ScUndoWidthOrHeight( ScDocShell* pNewDocShell,
368 const ScMarkData& rMark,
369 SCCOLROW nNewStart, SCTAB nNewStartTab,
370 SCCOLROW nNewEnd, SCTAB nNewEndTab,
371 ScDocument* pNewUndoDoc,
372 SCCOLROW nNewCnt, SCCOLROW* pNewRanges,
373 ScOutlineTable* pNewUndoTab,
374 ScSizeMode eNewMode, sal_uInt16 nNewSizeTwips,
375 sal_Bool bNewWidth );
376 virtual ~ScUndoWidthOrHeight();
378 virtual void Undo();
379 virtual void Redo();
380 virtual void Repeat(SfxRepeatTarget& rTarget);
381 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
383 virtual OUString GetComment() const;
385 private:
386 ScMarkData aMarkData;
387 SCCOLROW nStart;
388 SCCOLROW nEnd;
389 SCTAB nStartTab;
390 SCTAB nEndTab;
391 ScDocument* pUndoDoc;
392 ScOutlineTable* pUndoTab;
393 SCCOLROW nRangeCnt;
394 SCCOLROW* pRanges;
395 sal_uInt16 nNewSize;
396 sal_Bool bWidth;
397 ScSizeMode eMode;
398 SdrUndoAction* pDrawUndo;
402 class ScUndoAutoFill: public ScBlockUndo
404 public:
405 TYPEINFO();
406 ScUndoAutoFill( ScDocShell* pNewDocShell,
407 const ScRange& rRange, const ScRange& rSourceArea,
408 ScDocument* pNewUndoDoc, const ScMarkData& rMark,
409 FillDir eNewFillDir,
410 FillCmd eNewFillCmd, FillDateCmd eNewFillDateCmd,
411 double fNewStartValue, double fNewStepValue, double fNewMaxValue );
412 virtual ~ScUndoAutoFill();
414 virtual void Undo();
415 virtual void Redo();
416 virtual void Repeat(SfxRepeatTarget& rTarget);
417 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
419 virtual OUString GetComment() const;
421 private:
422 ScRange aSource;
423 ScMarkData aMarkData;
424 ScDocument* pUndoDoc;
425 FillDir eFillDir;
426 FillCmd eFillCmd;
427 FillDateCmd eFillDateCmd;
428 double fStartValue;
429 double fStepValue;
430 double fMaxValue;
431 sal_uLong nStartChangeAction;
432 sal_uLong nEndChangeAction;
434 void SetChangeTrack();
438 class ScUndoMerge: public ScSimpleUndo
440 public:
441 TYPEINFO();
442 ScUndoMerge( ScDocShell* pNewDocShell, const ScCellMergeOption& rOption,
443 bool bMergeContents, ScDocument* pUndoDoc, SdrUndoAction* pDrawUndo);
444 virtual ~ScUndoMerge();
446 virtual void Undo();
447 virtual void Redo();
448 virtual void Repeat(SfxRepeatTarget& rTarget);
449 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
451 virtual OUString GetComment() const;
453 private:
454 ScCellMergeOption maOption;
455 bool mbMergeContents; // Merge contents in Redo().
456 ScDocument* mpUndoDoc; // when data is merged
457 SdrUndoAction* mpDrawUndo;
459 void DoChange( bool bUndo ) const;
463 class ScUndoAutoFormat: public ScBlockUndo
465 public:
466 TYPEINFO();
467 ScUndoAutoFormat( ScDocShell* pNewDocShell,
468 const ScRange& rRange, ScDocument* pNewUndoDoc,
469 const ScMarkData& rMark,
470 sal_Bool bNewSize, sal_uInt16 nNewFormatNo );
471 virtual ~ScUndoAutoFormat();
473 virtual void Undo();
474 virtual void Redo();
475 virtual void Repeat(SfxRepeatTarget& rTarget);
476 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
478 virtual OUString GetComment() const;
480 private:
481 ScDocument* pUndoDoc; // deleted data
482 ScMarkData aMarkData;
483 sal_Bool bSize;
484 sal_uInt16 nFormatNo;
488 class ScUndoReplace: public ScSimpleUndo
490 public:
491 TYPEINFO();
492 ScUndoReplace( ScDocShell* pNewDocShell,
493 const ScMarkData& rMark,
494 SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
495 const OUString& rNewUndoStr, ScDocument* pNewUndoDoc,
496 const SvxSearchItem* pItem );
497 virtual ~ScUndoReplace();
499 virtual void Undo();
500 virtual void Redo();
501 virtual void Repeat(SfxRepeatTarget& rTarget);
502 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
504 virtual OUString GetComment() const;
506 private:
507 ScAddress aCursorPos;
508 ScMarkData aMarkData;
509 OUString aUndoStr; // Data at single selection
510 ScDocument* pUndoDoc; // Block mark and deleted data
511 SvxSearchItem* pSearchItem;
512 sal_uLong nStartChangeAction;
513 sal_uLong nEndChangeAction;
515 void SetChangeTrack();
519 class ScUndoTabOp: public ScSimpleUndo
521 public:
522 TYPEINFO();
523 ScUndoTabOp( ScDocShell* pNewDocShell,
524 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
525 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
526 ScDocument* pNewUndoDoc,
527 const ScRefAddress& rFormulaCell,
528 const ScRefAddress& rFormulaEnd,
529 const ScRefAddress& rRowCell,
530 const ScRefAddress& rColCell,
531 ScTabOpParam::Mode eMode );
532 virtual ~ScUndoTabOp();
534 virtual void Undo();
535 virtual void Redo();
536 virtual void Repeat(SfxRepeatTarget& rTarget);
537 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
539 virtual OUString GetComment() const;
541 private:
542 ScRange aRange;
543 ScDocument* pUndoDoc; // Deleted data
544 ScRefAddress theFormulaCell;
545 ScRefAddress theFormulaEnd;
546 ScRefAddress theRowCell;
547 ScRefAddress theColCell;
548 ScTabOpParam::Mode meMode;
552 class ScUndoConversion : public ScSimpleUndo
554 public:
555 TYPEINFO();
557 ScUndoConversion( ScDocShell* pNewDocShell, const ScMarkData& rMark,
558 SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScDocument* pNewUndoDoc,
559 SCCOL nNewX, SCROW nNewY, SCTAB nNewZ, ScDocument* pNewRedoDoc,
560 const ScConversionParam& rConvParam );
561 virtual ~ScUndoConversion();
563 virtual void Undo();
564 virtual void Redo();
565 virtual void Repeat(SfxRepeatTarget& rTarget);
566 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
568 virtual OUString GetComment() const;
570 private:
571 ScMarkData aMarkData;
572 ScAddress aCursorPos;
573 ScDocument* pUndoDoc; // Block mark and deleted data
574 ScAddress aNewCursorPos;
575 ScDocument* pRedoDoc; // Block mark and new data
576 sal_uLong nStartChangeAction;
577 sal_uLong nEndChangeAction;
578 ScConversionParam maConvParam; /// Conversion type and parameters.
580 void DoChange( ScDocument* pRefDoc, const ScAddress& rCursorPos );
581 void SetChangeTrack();
584 class ScUndoRefConversion: public ScSimpleUndo
586 public:
587 TYPEINFO();
588 ScUndoRefConversion( ScDocShell* pNewDocShell,
589 const ScRange& aMarkRange, const ScMarkData& rMark,
590 ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc, sal_Bool bNewMulti, sal_uInt16 nNewFlag);
591 virtual ~ScUndoRefConversion();
593 virtual void Undo();
594 virtual void Redo();
595 virtual void Repeat(SfxRepeatTarget& rTarget);
596 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
598 virtual OUString GetComment() const;
600 private:
601 ScMarkData aMarkData;
602 ScDocument* pUndoDoc;
603 ScDocument* pRedoDoc;
604 ScRange aRange;
605 sal_Bool bMulti;
606 sal_uInt16 nFlags;
607 sal_uLong nStartChangeAction;
608 sal_uLong nEndChangeAction;
610 void DoChange( ScDocument* pRefDoc);
611 void SetChangeTrack();
614 class ScUndoListNames: public ScBlockUndo
616 public:
617 TYPEINFO();
618 ScUndoListNames( ScDocShell* pNewDocShell,
619 const ScRange& rRange,
620 ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc );
621 virtual ~ScUndoListNames();
623 virtual void Undo();
624 virtual void Redo();
625 virtual void Repeat(SfxRepeatTarget& rTarget);
626 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
628 virtual OUString GetComment() const;
630 private:
631 ScDocument* pUndoDoc;
632 ScDocument* pRedoDoc;
634 void DoChange( ScDocument* pSrcDoc ) const;
638 class ScUndoUseScenario: public ScSimpleUndo
640 public:
641 TYPEINFO();
642 ScUndoUseScenario( ScDocShell* pNewDocShell,
643 const ScMarkData& rMark,
644 const ScArea& rDestArea, ScDocument* pNewUndoDoc,
645 const OUString& rNewName );
646 virtual ~ScUndoUseScenario();
648 virtual void Undo();
649 virtual void Redo();
650 virtual void Repeat(SfxRepeatTarget& rTarget);
651 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
653 virtual OUString GetComment() const;
655 private:
656 ScDocument* pUndoDoc;
657 ScRange aRange;
658 ScMarkData aMarkData;
659 OUString aName;
663 class ScUndoSelectionStyle: public ScSimpleUndo
665 public:
666 TYPEINFO();
667 ScUndoSelectionStyle( ScDocShell* pNewDocShell,
668 const ScMarkData& rMark,
669 const ScRange& rRange,
670 const OUString& rName,
671 ScDocument* pNewUndoDoc );
672 virtual ~ScUndoSelectionStyle();
674 virtual void Undo();
675 virtual void Redo();
676 virtual void Repeat(SfxRepeatTarget& rTarget);
677 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
679 virtual OUString GetComment() const;
680 virtual sal_uInt16 GetId() const;
682 private:
683 ScMarkData aMarkData;
684 ScDocument* pUndoDoc;
685 OUString aStyleName;
686 ScRange aRange;
688 void DoChange( const sal_Bool bUndo );
692 class ScUndoRefreshLink: public ScSimpleUndo
694 public:
695 TYPEINFO();
696 ScUndoRefreshLink( ScDocShell* pNewDocShell,
697 ScDocument* pNewUndoDoc );
698 virtual ~ScUndoRefreshLink();
700 virtual void Undo();
701 virtual void Redo();
702 virtual void Repeat(SfxRepeatTarget& rTarget);
703 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
705 virtual OUString GetComment() const;
707 private:
708 ScDocument* pUndoDoc;
709 ScDocument* pRedoDoc;
713 class ScUndoEnterMatrix: public ScBlockUndo
715 public:
716 TYPEINFO();
717 ScUndoEnterMatrix( ScDocShell* pNewDocShell,
718 const ScRange& rArea,
719 ScDocument* pNewUndoDoc,
720 const OUString& rForm );
721 virtual ~ScUndoEnterMatrix();
723 virtual void Undo();
724 virtual void Redo();
725 virtual void Repeat(SfxRepeatTarget& rTarget);
726 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
728 virtual OUString GetComment() const;
730 private:
731 ScDocument* pUndoDoc;
732 OUString aFormula;
733 sal_uLong nStartChangeAction;
734 sal_uLong nEndChangeAction;
736 void SetChangeTrack();
740 class ScUndoInsertAreaLink : public ScSimpleUndo
742 public:
743 TYPEINFO();
744 ScUndoInsertAreaLink( ScDocShell* pShell,
745 const OUString& rDocName,
746 const OUString& rFltName, const OUString& rOptions,
747 const OUString& rAreaName, const ScRange& rDestRange,
748 sal_uLong nRefreshDelay );
749 virtual ~ScUndoInsertAreaLink();
751 virtual void Undo();
752 virtual void Redo();
753 virtual void Repeat(SfxRepeatTarget& rTarget);
754 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
756 virtual OUString GetComment() const;
758 private:
759 OUString aDocName;
760 OUString aFltName;
761 OUString aOptions;
762 OUString aAreaName;
763 ScRange aRange;
764 sal_uLong nRefreshDelay;
768 class ScUndoRemoveAreaLink : public ScSimpleUndo
770 public:
771 TYPEINFO();
772 ScUndoRemoveAreaLink( ScDocShell* pShell,
773 const OUString& rDocName,
774 const OUString& rFltName, const OUString& rOptions,
775 const OUString& rAreaName, const ScRange& rDestRange,
776 sal_uLong nRefreshDelay );
777 virtual ~ScUndoRemoveAreaLink();
779 virtual void Undo();
780 virtual void Redo();
781 virtual void Repeat(SfxRepeatTarget& rTarget);
782 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
784 virtual OUString GetComment() const;
786 private:
787 OUString aDocName;
788 OUString aFltName;
789 OUString aOptions;
790 OUString aAreaName;
791 ScRange aRange;
792 sal_uLong nRefreshDelay;
796 class ScUndoUpdateAreaLink : public ScSimpleUndo //! also change BlockUndo?
798 public:
799 TYPEINFO();
800 ScUndoUpdateAreaLink( ScDocShell* pShell,
801 const OUString& rOldD,
802 const OUString& rOldF, const OUString& rOldO,
803 const OUString& rOldA, const ScRange& rOldR,
804 sal_uLong nOldRD,
805 const OUString& rNewD,
806 const OUString& rNewF, const OUString& rNewO,
807 const OUString& rNewA, const ScRange& rNewR,
808 sal_uLong nNewRD,
809 ScDocument* pUndo, ScDocument* pRedo,
810 sal_Bool bDoInsert );
811 virtual ~ScUndoUpdateAreaLink();
813 virtual void Undo();
814 virtual void Redo();
815 virtual void Repeat(SfxRepeatTarget& rTarget);
816 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
818 virtual OUString GetComment() const;
820 private:
821 OUString aOldDoc;
822 OUString aOldFlt;
823 OUString aOldOpt;
824 OUString aOldArea;
825 ScRange aOldRange;
826 OUString aNewDoc;
827 OUString aNewFlt;
828 OUString aNewOpt;
829 OUString aNewArea;
830 ScRange aNewRange;
831 ScDocument* pUndoDoc;
832 ScDocument* pRedoDoc;
833 sal_uLong nOldRefresh;
834 sal_uLong nNewRefresh;
835 sal_Bool bWithInsert;
837 void DoChange( const sal_Bool bUndo ) const;
841 class ScUndoIndent: public ScBlockUndo
843 public:
844 TYPEINFO();
845 ScUndoIndent( ScDocShell* pNewDocShell, const ScMarkData& rMark,
846 ScDocument* pNewUndoDoc, sal_Bool bIncrement );
847 virtual ~ScUndoIndent();
849 virtual void Undo();
850 virtual void Redo();
851 virtual void Repeat(SfxRepeatTarget& rTarget);
852 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
854 virtual OUString GetComment() const;
856 private:
857 ScMarkData aMarkData;
858 ScDocument* pUndoDoc;
859 sal_Bool bIsIncrement;
863 class ScUndoTransliterate: public ScBlockUndo
865 public:
866 TYPEINFO();
867 ScUndoTransliterate( ScDocShell* pNewDocShell, const ScMarkData& rMark,
868 ScDocument* pNewUndoDoc, sal_Int32 nType );
869 virtual ~ScUndoTransliterate();
871 virtual void Undo();
872 virtual void Redo();
873 virtual void Repeat(SfxRepeatTarget& rTarget);
874 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
876 virtual OUString GetComment() const;
878 private:
879 ScMarkData aMarkData;
880 ScDocument* pUndoDoc;
881 sal_Int32 nTransliterationType;
885 class ScUndoClearItems: public ScBlockUndo
887 public:
888 TYPEINFO();
889 ScUndoClearItems( ScDocShell* pNewDocShell, const ScMarkData& rMark,
890 ScDocument* pNewUndoDoc, const sal_uInt16* pW );
891 virtual ~ScUndoClearItems();
893 virtual void Undo();
894 virtual void Redo();
895 virtual void Repeat(SfxRepeatTarget& rTarget);
896 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
898 virtual OUString GetComment() const;
900 private:
901 ScMarkData aMarkData;
902 ScDocument* pUndoDoc;
903 sal_uInt16* pWhich;
907 class ScUndoRemoveBreaks: public ScSimpleUndo
909 public:
910 TYPEINFO();
911 ScUndoRemoveBreaks( ScDocShell* pNewDocShell,
912 SCTAB nNewTab, ScDocument* pNewUndoDoc );
913 virtual ~ScUndoRemoveBreaks();
915 virtual void Undo();
916 virtual void Redo();
917 virtual void Repeat(SfxRepeatTarget& rTarget);
918 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
920 virtual OUString GetComment() const;
922 private:
923 SCTAB nTab;
924 ScDocument* pUndoDoc;
928 class ScUndoRemoveMerge: public ScBlockUndo
930 public:
931 TYPEINFO();
932 ScUndoRemoveMerge( ScDocShell* pNewDocShell,
933 const ScCellMergeOption& rOption,
934 ScDocument* pNewUndoDoc );
935 virtual ~ScUndoRemoveMerge();
937 virtual void Undo();
938 virtual void Redo();
939 virtual void Repeat(SfxRepeatTarget& rTarget);
940 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
942 virtual OUString GetComment() const;
944 private:
945 void SetCurTab();
947 ScCellMergeOption maOption;
948 ScDocument* pUndoDoc;
952 class ScUndoBorder: public ScBlockUndo
954 public:
955 TYPEINFO();
956 ScUndoBorder( ScDocShell* pNewDocShell,
957 const ScRangeList& rRangeList,
958 ScDocument* pNewUndoDoc,
959 const SvxBoxItem& rNewOuter,
960 const SvxBoxInfoItem& rNewInner );
961 virtual ~ScUndoBorder();
963 virtual void Undo();
964 virtual void Redo();
965 virtual void Repeat(SfxRepeatTarget& rTarget);
966 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const;
968 virtual OUString GetComment() const;
970 private:
971 ScDocument* pUndoDoc;
972 ScRangeList* pRanges;
973 SvxBoxItem* pOuter;
974 SvxBoxInfoItem* pInner;
980 #endif
982 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */