Update ooo320-m1
[ooovba.git] / sc / source / ui / inc / undoblk.hxx
blob424403bf88d7c39d3bf6713edfcf578ded30511d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: undoblk.hxx,v $
10 * $Revision: 1.15.128.3 $
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 ************************************************************************/
30 #ifndef SC_UNDOBLK_HXX
31 #define SC_UNDOBLK_HXX
33 #include "undobase.hxx"
34 #include "markdata.hxx"
35 #include "viewutil.hxx"
36 #include "spellparam.hxx"
37 #include "cellmergeoption.hxx"
39 #include "cell.hxx"
41 #include <boost/shared_ptr.hpp>
43 class ScDocShell;
44 class ScBaseCell;
45 class ScDocument;
46 class ScOutlineTable;
47 class ScRangeName;
48 class ScRangeList;
49 class ScDBCollection;
50 class ScPatternAttr;
51 class SvxBoxItem;
52 class SvxBoxInfoItem;
53 class SvxSearchItem;
54 class SdrUndoAction;
56 //----------------------------------------------------------------------------
58 class ScUndoInsertCells: public ScMoveUndo
60 public:
61 TYPEINFO();
62 ScUndoInsertCells( ScDocShell* pNewDocShell,
63 const ScRange& rRange, SCTAB nNewCount, SCTAB* pNewTabs, SCTAB* pNewScenarios,
64 InsCellCmd eNewCmd, ScDocument* pUndoDocument, ScRefUndoData* pRefData,
65 BOOL bNewPartOfPaste );
66 virtual ~ScUndoInsertCells();
68 virtual void Undo();
69 virtual void Redo();
70 virtual void Repeat( SfxRepeatTarget& rTarget );
71 virtual BOOL CanRepeat( SfxRepeatTarget& rTarget ) const;
73 virtual String GetComment() const;
75 virtual BOOL Merge( SfxUndoAction *pNextAction );
77 private:
78 ScRange aEffRange;
79 SCTAB nCount;
80 SCTAB* pTabs;
81 SCTAB* pScenarios;
82 ULONG nEndChangeAction;
83 InsCellCmd eCmd;
84 BOOL bPartOfPaste;
85 SfxUndoAction* pPasteUndo;
87 void DoChange ( const BOOL bUndo );
88 void SetChangeTrack();
92 class ScUndoDeleteCells: public ScMoveUndo
94 public:
95 TYPEINFO();
96 ScUndoDeleteCells( ScDocShell* pNewDocShell,
97 const ScRange& rRange, SCTAB nNewCount, SCTAB* pNewTabs, SCTAB* pNewScenarios,
98 DelCellCmd eNewCmd, ScDocument* pUndoDocument, ScRefUndoData* pRefData );
99 virtual ~ScUndoDeleteCells();
101 virtual void Undo();
102 virtual void Redo();
103 virtual void Repeat(SfxRepeatTarget& rTarget);
104 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
106 virtual String GetComment() const;
108 private:
109 ScRange aEffRange;
110 SCTAB nCount;
111 SCTAB* pTabs;
112 SCTAB* pScenarios;
113 ULONG nStartChangeAction;
114 ULONG nEndChangeAction;
115 DelCellCmd eCmd;
117 void DoChange ( const BOOL bUndo );
118 void SetChangeTrack();
122 class ScUndoDeleteMulti: public ScMoveUndo
124 public:
125 TYPEINFO();
126 ScUndoDeleteMulti( ScDocShell* pNewDocShell,
127 BOOL bNewRows, BOOL bNeedsRefresh, SCTAB nNewTab,
128 const SCCOLROW* pRng, SCCOLROW nRngCnt,
129 ScDocument* pUndoDocument, ScRefUndoData* pRefData );
130 virtual ~ScUndoDeleteMulti();
132 virtual void Undo();
133 virtual void Redo();
134 virtual void Repeat(SfxRepeatTarget& rTarget);
135 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
137 virtual String GetComment() const;
139 private:
140 BOOL bRows;
141 BOOL bRefresh;
142 SCTAB nTab;
143 SCCOLROW* pRanges;
144 SCCOLROW nRangeCnt;
145 ULONG nStartChangeAction;
146 ULONG nEndChangeAction;
148 void DoChange() const;
149 void SetChangeTrack();
153 class ScUndoCut: public ScBlockUndo
155 public:
156 TYPEINFO();
157 ScUndoCut( ScDocShell* pNewDocShell,
158 ScRange aRange, // adjusted for merged cells
159 ScAddress aOldEnd, // end position without adjustment
160 const ScMarkData& rMark, // selected sheets
161 ScDocument* pNewUndoDoc );
162 virtual ~ScUndoCut();
164 virtual void Undo();
165 virtual void Redo();
166 virtual void Repeat(SfxRepeatTarget& rTarget);
167 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
169 virtual String GetComment() const;
171 private:
172 ScMarkData aMarkData;
173 ScDocument* pUndoDoc;
174 ScRange aExtendedRange;
175 ULONG nStartChangeAction;
176 ULONG nEndChangeAction;
178 void DoChange( const BOOL bUndo );
179 void SetChangeTrack();
183 struct ScUndoPasteOptions
185 USHORT nFunction;
186 BOOL bSkipEmpty;
187 BOOL bTranspose;
188 BOOL bAsLink;
189 InsCellCmd eMoveMode;
191 ScUndoPasteOptions() :
192 nFunction( PASTE_NOFUNC ),
193 bSkipEmpty( FALSE ),
194 bTranspose( FALSE ),
195 bAsLink( FALSE ),
196 eMoveMode( INS_NONE )
200 class ScUndoPaste: public ScBlockUndo
202 public:
203 TYPEINFO();
204 ScUndoPaste( ScDocShell* pNewDocShell,
205 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
206 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
207 const ScMarkData& rMark,
208 ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc,
209 USHORT nNewFlags,
210 ScRefUndoData* pRefData, void* pFill1, void* pFill2, void* pFill3,
211 BOOL bRedoIsFilled = TRUE,
212 const ScUndoPasteOptions* pOptions = NULL );
213 virtual ~ScUndoPaste();
215 virtual void Undo();
216 virtual void Redo();
217 virtual void Repeat(SfxRepeatTarget& rTarget);
218 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
220 virtual String GetComment() const;
222 private:
223 ScMarkData aMarkData;
224 ScDocument* pUndoDoc;
225 ScDocument* pRedoDoc;
226 USHORT nFlags;
227 ScRefUndoData* pRefUndoData;
228 ScRefUndoData* pRefRedoData;
229 ULONG nStartChangeAction;
230 ULONG nEndChangeAction;
231 BOOL bRedoFilled;
232 ScUndoPasteOptions aPasteOptions;
234 void DoChange( const BOOL bUndo );
235 void SetChangeTrack();
239 class ScUndoDragDrop: public ScMoveUndo
241 public:
242 TYPEINFO();
243 ScUndoDragDrop( ScDocShell* pNewDocShell,
244 const ScRange& rRange, ScAddress aNewDestPos, BOOL bNewCut,
245 ScDocument* pUndoDocument, ScRefUndoData* pRefData,
246 BOOL bScenario );
247 virtual ~ScUndoDragDrop();
249 virtual void Undo();
250 virtual void Redo();
251 virtual void Repeat(SfxRepeatTarget& rTarget);
252 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
254 virtual String GetComment() const;
256 private:
257 ScRange aSrcRange;
258 ScRange aDestRange;
259 ULONG nStartChangeAction;
260 ULONG nEndChangeAction;
261 BOOL bCut;
262 BOOL bKeepScenarioFlags;
264 void PaintArea( ScRange aRange, USHORT nExtFlags ) const;
265 void DoUndo( ScRange aRange ) const;
267 void SetChangeTrack();
271 class ScUndoDeleteContents: public ScSimpleUndo
273 public:
274 TYPEINFO();
275 ScUndoDeleteContents( ScDocShell* pNewDocShell,
276 const ScMarkData& rMark,
277 const ScRange& rRange,
278 ScDocument* pNewUndoDoc, BOOL bNewMulti,
279 USHORT nNewFlags, BOOL bObjects );
280 virtual ~ScUndoDeleteContents();
282 virtual void Undo();
283 virtual void Redo();
284 virtual void Repeat(SfxRepeatTarget& rTarget);
285 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
287 virtual String GetComment() const;
289 private:
290 ScRange aRange;
291 ScMarkData aMarkData;
292 ScDocument* pUndoDoc; // Blockmarkierung und geloeschte Daten
293 SdrUndoAction* pDrawUndo; // geloeschte Objekte
294 ULONG nStartChangeAction;
295 ULONG nEndChangeAction;
296 USHORT nFlags;
297 BOOL bMulti; // Mehrfachselektion
299 void DoChange( const BOOL bUndo );
300 void SetChangeTrack();
304 class ScUndoFillTable: public ScSimpleUndo
306 public:
307 TYPEINFO();
308 ScUndoFillTable( ScDocShell* pNewDocShell,
309 const ScMarkData& rMark,
310 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
311 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
312 ScDocument* pNewUndoDoc, BOOL bNewMulti, SCTAB nSrc,
313 USHORT nFlg, USHORT nFunc, BOOL bSkip, BOOL bLink );
314 virtual ~ScUndoFillTable();
316 virtual void Undo();
317 virtual void Redo();
318 virtual void Repeat(SfxRepeatTarget& rTarget);
319 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
321 virtual String GetComment() const;
323 private:
324 ScRange aRange;
325 ScMarkData aMarkData;
326 ScDocument* pUndoDoc; // Blockmarkierung und geloeschte Daten
327 ULONG nStartChangeAction;
328 ULONG nEndChangeAction;
329 USHORT nFlags;
330 USHORT nFunction;
331 SCTAB nSrcTab;
332 BOOL bMulti; // Mehrfachselektion
333 BOOL bSkipEmpty;
334 BOOL bAsLink;
336 void DoChange( const BOOL bUndo );
337 void SetChangeTrack();
341 class ScUndoSelectionAttr: public ScSimpleUndo
343 public:
344 TYPEINFO();
345 ScUndoSelectionAttr( ScDocShell* pNewDocShell,
346 const ScMarkData& rMark,
347 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
348 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
349 ScDocument* pNewUndoDoc, BOOL bNewMulti,
350 const ScPatternAttr* pNewApply,
351 const SvxBoxItem* pNewOuter = NULL,
352 const SvxBoxInfoItem* pNewInner = NULL );
353 virtual ~ScUndoSelectionAttr();
355 virtual void Undo();
356 virtual void Redo();
357 virtual void Repeat(SfxRepeatTarget& rTarget);
358 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
360 virtual String GetComment() const;
362 ScEditDataArray* GetDataArray();
363 private:
364 ScMarkData aMarkData;
365 ScRange aRange;
366 ScEditDataArray aDataArray;
367 ScDocument* pUndoDoc;
368 BOOL bMulti;
369 ScPatternAttr* pApplyPattern;
370 SvxBoxItem* pLineOuter;
371 SvxBoxInfoItem* pLineInner;
373 void DoChange( const BOOL bUndo );
374 void ChangeEditData( const bool bUndo );
378 class ScUndoWidthOrHeight: public ScSimpleUndo
380 public:
381 TYPEINFO();
382 ScUndoWidthOrHeight( ScDocShell* pNewDocShell,
383 const ScMarkData& rMark,
384 SCCOLROW nNewStart, SCTAB nNewStartTab,
385 SCCOLROW nNewEnd, SCTAB nNewEndTab,
386 ScDocument* pNewUndoDoc,
387 SCCOLROW nNewCnt, SCCOLROW* pNewRanges,
388 ScOutlineTable* pNewUndoTab,
389 ScSizeMode eNewMode, USHORT nNewSizeTwips,
390 BOOL bNewWidth );
391 virtual ~ScUndoWidthOrHeight();
393 virtual void Undo();
394 virtual void Redo();
395 virtual void Repeat(SfxRepeatTarget& rTarget);
396 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
398 virtual String GetComment() const;
400 private:
401 ScMarkData aMarkData;
402 SCCOLROW nStart;
403 SCCOLROW nEnd;
404 SCTAB nStartTab;
405 SCTAB nEndTab;
406 ScDocument* pUndoDoc;
407 ScOutlineTable* pUndoTab;
408 SCCOLROW nRangeCnt;
409 SCCOLROW* pRanges;
410 USHORT nNewSize;
411 BOOL bWidth;
412 ScSizeMode eMode;
413 SdrUndoAction* pDrawUndo;
417 class ScUndoAutoFill: public ScBlockUndo
419 public:
420 TYPEINFO();
421 ScUndoAutoFill( ScDocShell* pNewDocShell,
422 const ScRange& rRange, const ScRange& rSourceArea,
423 ScDocument* pNewUndoDoc, const ScMarkData& rMark,
424 FillDir eNewFillDir,
425 FillCmd eNewFillCmd, FillDateCmd eNewFillDateCmd,
426 double fNewStartValue, double fNewStepValue, double fNewMaxValue,
427 USHORT nMaxShIndex );
428 virtual ~ScUndoAutoFill();
430 virtual void Undo();
431 virtual void Redo();
432 virtual void Repeat(SfxRepeatTarget& rTarget);
433 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
435 virtual String GetComment() const;
437 private:
438 ScRange aSource;
439 ScMarkData aMarkData;
440 ScDocument* pUndoDoc;
441 FillDir eFillDir;
442 FillCmd eFillCmd;
443 FillDateCmd eFillDateCmd;
444 double fStartValue;
445 double fStepValue;
446 double fMaxValue;
447 ULONG nStartChangeAction;
448 ULONG nEndChangeAction;
449 USHORT nMaxSharedIndex;
451 void SetChangeTrack();
455 class ScUndoMerge: public ScSimpleUndo
457 public:
458 TYPEINFO();
459 ScUndoMerge( ScDocShell* pNewDocShell, const ScCellMergeOption& rOption,
460 bool bMergeContents, ScDocument* pUndoDoc, SdrUndoAction* pDrawUndo);
461 virtual ~ScUndoMerge();
463 virtual void Undo();
464 virtual void Redo();
465 virtual void Repeat(SfxRepeatTarget& rTarget);
466 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
468 virtual String GetComment() const;
470 private:
471 ScCellMergeOption maOption;
472 bool mbMergeContents; // Merge contents in Redo().
473 ScDocument* mpUndoDoc; // wenn Daten zusammengefasst
474 SdrUndoAction* mpDrawUndo;
476 void DoChange( bool bUndo ) const;
480 class ScUndoAutoFormat: public ScBlockUndo
482 public:
483 TYPEINFO();
484 ScUndoAutoFormat( ScDocShell* pNewDocShell,
485 const ScRange& rRange, ScDocument* pNewUndoDoc,
486 const ScMarkData& rMark,
487 BOOL bNewSize, USHORT nNewFormatNo );
488 virtual ~ScUndoAutoFormat();
490 virtual void Undo();
491 virtual void Redo();
492 virtual void Repeat(SfxRepeatTarget& rTarget);
493 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
495 virtual String GetComment() const;
497 private:
498 ScDocument* pUndoDoc; // geloeschte Daten
499 ScMarkData aMarkData;
500 BOOL bSize;
501 USHORT nFormatNo;
505 class ScUndoReplace: public ScSimpleUndo
507 public:
508 TYPEINFO();
509 ScUndoReplace( ScDocShell* pNewDocShell,
510 const ScMarkData& rMark,
511 SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
512 const String& rNewUndoStr, ScDocument* pNewUndoDoc,
513 const SvxSearchItem* pItem );
514 virtual ~ScUndoReplace();
516 virtual void Undo();
517 virtual void Redo();
518 virtual void Repeat(SfxRepeatTarget& rTarget);
519 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
521 virtual String GetComment() const;
523 private:
524 ScAddress aCursorPos;
525 ScMarkData aMarkData;
526 String aUndoStr; // Daten bei Einfachmarkierung
527 ScDocument* pUndoDoc; // Blockmarkierung und geloeschte Daten
528 SvxSearchItem* pSearchItem;
529 ULONG nStartChangeAction;
530 ULONG nEndChangeAction;
532 void SetChangeTrack();
536 class ScUndoTabOp: public ScSimpleUndo
538 public:
539 TYPEINFO();
540 ScUndoTabOp( ScDocShell* pNewDocShell,
541 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
542 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
543 ScDocument* pNewUndoDoc,
544 const ScRefAddress& rFormulaCell,
545 const ScRefAddress& rFormulaEnd,
546 const ScRefAddress& rRowCell,
547 const ScRefAddress& rColCell,
548 BYTE nMode );
549 virtual ~ScUndoTabOp();
551 virtual void Undo();
552 virtual void Redo();
553 virtual void Repeat(SfxRepeatTarget& rTarget);
554 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
556 virtual String GetComment() const;
558 private:
559 ScRange aRange;
560 ScDocument* pUndoDoc; // geloeschte Daten
561 ScRefAddress theFormulaCell;
562 ScRefAddress theFormulaEnd;
563 ScRefAddress theRowCell;
564 ScRefAddress theColCell;
565 BYTE nMode;
569 class ScUndoConversion : public ScSimpleUndo
571 public:
572 TYPEINFO();
574 ScUndoConversion(
575 ScDocShell* pNewDocShell, const ScMarkData& rMark,
576 SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScDocument* pNewUndoDoc,
577 SCCOL nNewX, SCROW nNewY, SCTAB nNewZ, ScDocument* pNewRedoDoc,
578 const ScConversionParam& rConvParam );
579 virtual ~ScUndoConversion();
581 virtual void Undo();
582 virtual void Redo();
583 virtual void Repeat(SfxRepeatTarget& rTarget);
584 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
586 virtual String GetComment() const;
588 private:
589 ScMarkData aMarkData;
590 ScAddress aCursorPos;
591 ScDocument* pUndoDoc; // Blockmarkierung und geloeschte Daten
592 ScAddress aNewCursorPos;
593 ScDocument* pRedoDoc; // Blockmarkierung und neue Daten
594 ULONG nStartChangeAction;
595 ULONG nEndChangeAction;
596 ScConversionParam maConvParam; /// Conversion type and parameters.
598 void DoChange( ScDocument* pRefDoc, const ScAddress& rCursorPos );
599 void SetChangeTrack();
602 class ScUndoRefConversion: public ScSimpleUndo
604 public:
605 TYPEINFO();
606 ScUndoRefConversion( ScDocShell* pNewDocShell,
607 const ScRange& aMarkRange, const ScMarkData& rMark,
608 ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc, BOOL bNewMulti, USHORT nNewFlag);
609 virtual ~ScUndoRefConversion();
611 virtual void Undo();
612 virtual void Redo();
613 virtual void Repeat(SfxRepeatTarget& rTarget);
614 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
616 virtual String GetComment() const;
618 private:
619 ScMarkData aMarkData;
620 ScDocument* pUndoDoc;
621 ScDocument* pRedoDoc;
622 ScRange aRange;
623 BOOL bMulti;
624 USHORT nFlags;
625 ULONG nStartChangeAction;
626 ULONG nEndChangeAction;
628 void DoChange( ScDocument* pRefDoc);
629 void SetChangeTrack();
632 class ScUndoListNames: public ScBlockUndo
634 public:
635 TYPEINFO();
636 ScUndoListNames( ScDocShell* pNewDocShell,
637 const ScRange& rRange,
638 ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc );
639 virtual ~ScUndoListNames();
641 virtual void Undo();
642 virtual void Redo();
643 virtual void Repeat(SfxRepeatTarget& rTarget);
644 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
646 virtual String GetComment() const;
648 private:
649 ScDocument* pUndoDoc;
650 ScDocument* pRedoDoc;
652 void DoChange( ScDocument* pSrcDoc ) const;
656 class ScUndoUseScenario: public ScSimpleUndo
658 public:
659 TYPEINFO();
660 ScUndoUseScenario( ScDocShell* pNewDocShell,
661 const ScMarkData& rMark,
662 const ScArea& rDestArea, ScDocument* pNewUndoDoc,
663 const String& rNewName );
664 virtual ~ScUndoUseScenario();
666 virtual void Undo();
667 virtual void Redo();
668 virtual void Repeat(SfxRepeatTarget& rTarget);
669 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
671 virtual String GetComment() const;
673 private:
674 ScDocument* pUndoDoc;
675 ScRange aRange;
676 ScMarkData aMarkData;
677 String aName;
681 class ScUndoSelectionStyle: public ScSimpleUndo
683 public:
684 TYPEINFO();
685 ScUndoSelectionStyle( ScDocShell* pNewDocShell,
686 const ScMarkData& rMark,
687 const ScRange& rRange,
688 const String& rName,
689 ScDocument* pNewUndoDoc );
690 virtual ~ScUndoSelectionStyle();
692 virtual void Undo();
693 virtual void Redo();
694 virtual void Repeat(SfxRepeatTarget& rTarget);
695 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
697 virtual String GetComment() const;
698 virtual USHORT GetId() const;
700 private:
701 ScMarkData aMarkData;
702 ScDocument* pUndoDoc;
703 String aStyleName;
704 ScRange aRange;
706 void DoChange( const BOOL bUndo );
710 class ScUndoRefreshLink: public ScSimpleUndo
712 public:
713 TYPEINFO();
714 ScUndoRefreshLink( ScDocShell* pNewDocShell,
715 ScDocument* pNewUndoDoc );
716 virtual ~ScUndoRefreshLink();
718 virtual void Undo();
719 virtual void Redo();
720 virtual void Repeat(SfxRepeatTarget& rTarget);
721 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
723 virtual String GetComment() const;
725 private:
726 ScDocument* pUndoDoc;
727 ScDocument* pRedoDoc;
731 class ScUndoEnterMatrix: public ScBlockUndo
733 public:
734 TYPEINFO();
735 ScUndoEnterMatrix( ScDocShell* pNewDocShell,
736 const ScRange& rArea,
737 ScDocument* pNewUndoDoc,
738 const String& rForm );
739 virtual ~ScUndoEnterMatrix();
741 virtual void Undo();
742 virtual void Redo();
743 virtual void Repeat(SfxRepeatTarget& rTarget);
744 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
746 virtual String GetComment() const;
748 private:
749 ScDocument* pUndoDoc;
750 String aFormula;
751 formula::FormulaGrammar::AddressConvention eConv;
752 ULONG nStartChangeAction;
753 ULONG nEndChangeAction;
755 void SetChangeTrack();
759 class ScUndoInsertAreaLink : public ScSimpleUndo
761 public:
762 TYPEINFO();
763 ScUndoInsertAreaLink( ScDocShell* pShell,
764 const String& rDoc,
765 const String& rFlt, const String& rOpt,
766 const String& rArea, const ScRange& rDestRange,
767 ULONG nRefreshDelay );
768 virtual ~ScUndoInsertAreaLink();
770 virtual void Undo();
771 virtual void Redo();
772 virtual void Repeat(SfxRepeatTarget& rTarget);
773 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
775 virtual String GetComment() const;
777 private:
778 String aDocName;
779 String aFltName;
780 String aOptions;
781 String aAreaName;
782 ScRange aRange;
783 ULONG nRefreshDelay;
787 class ScUndoRemoveAreaLink : public ScSimpleUndo
789 public:
790 TYPEINFO();
791 ScUndoRemoveAreaLink( ScDocShell* pShell,
792 const String& rDoc,
793 const String& rFlt, const String& rOpt,
794 const String& rArea, const ScRange& rDestRange,
795 ULONG nRefreshDelay );
796 virtual ~ScUndoRemoveAreaLink();
798 virtual void Undo();
799 virtual void Redo();
800 virtual void Repeat(SfxRepeatTarget& rTarget);
801 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
803 virtual String GetComment() const;
805 private:
806 String aDocName;
807 String aFltName;
808 String aOptions;
809 String aAreaName;
810 ScRange aRange;
811 ULONG nRefreshDelay;
815 class ScUndoUpdateAreaLink : public ScSimpleUndo //! auch BlockUndo umstellen?
817 public:
818 TYPEINFO();
819 ScUndoUpdateAreaLink( ScDocShell* pShell,
820 const String& rOldD,
821 const String& rOldF, const String& rOldO,
822 const String& rOldA, const ScRange& rOldR,
823 ULONG nOldRD,
824 const String& rNewD,
825 const String& rNewF, const String& rNewO,
826 const String& rNewA, const ScRange& rNewR,
827 ULONG nNewRD,
828 ScDocument* pUndo, ScDocument* pRedo,
829 BOOL bDoInsert );
830 virtual ~ScUndoUpdateAreaLink();
832 virtual void Undo();
833 virtual void Redo();
834 virtual void Repeat(SfxRepeatTarget& rTarget);
835 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
837 virtual String GetComment() const;
839 private:
840 String aOldDoc;
841 String aOldFlt;
842 String aOldOpt;
843 String aOldArea;
844 ScRange aOldRange;
845 String aNewDoc;
846 String aNewFlt;
847 String aNewOpt;
848 String aNewArea;
849 ScRange aNewRange;
850 ScDocument* pUndoDoc;
851 ScDocument* pRedoDoc;
852 ULONG nOldRefresh;
853 ULONG nNewRefresh;
854 BOOL bWithInsert;
856 void DoChange( const BOOL bUndo ) const;
860 class ScUndoIndent: public ScBlockUndo
862 public:
863 TYPEINFO();
864 ScUndoIndent( ScDocShell* pNewDocShell, const ScMarkData& rMark,
865 ScDocument* pNewUndoDoc, BOOL bIncrement );
866 virtual ~ScUndoIndent();
868 virtual void Undo();
869 virtual void Redo();
870 virtual void Repeat(SfxRepeatTarget& rTarget);
871 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
873 virtual String GetComment() const;
875 private:
876 ScMarkData aMarkData;
877 ScDocument* pUndoDoc;
878 BOOL bIsIncrement;
882 class ScUndoTransliterate: public ScBlockUndo
884 public:
885 TYPEINFO();
886 ScUndoTransliterate( ScDocShell* pNewDocShell, const ScMarkData& rMark,
887 ScDocument* pNewUndoDoc, sal_Int32 nType );
888 virtual ~ScUndoTransliterate();
890 virtual void Undo();
891 virtual void Redo();
892 virtual void Repeat(SfxRepeatTarget& rTarget);
893 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
895 virtual String GetComment() const;
897 private:
898 ScMarkData aMarkData;
899 ScDocument* pUndoDoc;
900 sal_Int32 nTransliterationType;
904 class ScUndoClearItems: public ScBlockUndo
906 public:
907 TYPEINFO();
908 ScUndoClearItems( ScDocShell* pNewDocShell, const ScMarkData& rMark,
909 ScDocument* pNewUndoDoc, const USHORT* pW );
910 virtual ~ScUndoClearItems();
912 virtual void Undo();
913 virtual void Redo();
914 virtual void Repeat(SfxRepeatTarget& rTarget);
915 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
917 virtual String GetComment() const;
919 private:
920 ScMarkData aMarkData;
921 ScDocument* pUndoDoc;
922 USHORT* pWhich;
926 class ScUndoRemoveBreaks: public ScSimpleUndo
928 public:
929 TYPEINFO();
930 ScUndoRemoveBreaks( ScDocShell* pNewDocShell,
931 SCTAB nNewTab, ScDocument* pNewUndoDoc );
932 virtual ~ScUndoRemoveBreaks();
934 virtual void Undo();
935 virtual void Redo();
936 virtual void Repeat(SfxRepeatTarget& rTarget);
937 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
939 virtual String GetComment() const;
941 private:
942 SCTAB nTab;
943 ScDocument* pUndoDoc;
947 class ScUndoRemoveMerge: public ScBlockUndo
949 public:
950 TYPEINFO();
951 ScUndoRemoveMerge( ScDocShell* pNewDocShell,
952 const ScCellMergeOption& rOption,
953 ScDocument* pNewUndoDoc );
954 virtual ~ScUndoRemoveMerge();
956 virtual void Undo();
957 virtual void Redo();
958 virtual void Repeat(SfxRepeatTarget& rTarget);
959 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
961 virtual String GetComment() const;
963 private:
964 void SetCurTab();
966 ScCellMergeOption maOption;
967 ScDocument* pUndoDoc;
971 class ScUndoBorder: public ScBlockUndo
973 public:
974 TYPEINFO();
975 ScUndoBorder( ScDocShell* pNewDocShell,
976 const ScRangeList& rRangeList,
977 ScDocument* pNewUndoDoc,
978 const SvxBoxItem& rNewOuter,
979 const SvxBoxInfoItem& rNewInner );
980 virtual ~ScUndoBorder();
982 virtual void Undo();
983 virtual void Redo();
984 virtual void Repeat(SfxRepeatTarget& rTarget);
985 virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const;
987 virtual String GetComment() const;
989 private:
990 ScDocument* pUndoDoc;
991 ScRangeList* pRanges;
992 SvxBoxItem* pOuter;
993 SvxBoxInfoItem* pInner;
999 #endif