1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
41 class ScEditDataArray
;
43 class ScUndoInsertCells
: public ScMoveUndo
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
;
67 sal_uLong nEndChangeAction
;
70 SfxUndoAction
* pPasteUndo
;
72 void DoChange ( const bool bUndo
);
73 void SetChangeTrack();
76 class ScUndoDeleteCells
: public ScMoveUndo
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
;
97 sal_uLong nStartChangeAction
;
98 sal_uLong nEndChangeAction
;
101 void DoChange ( const bool bUndo
);
102 void SetChangeTrack();
105 class ScUndoDeleteMulti
: public ScMoveUndo
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
;
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
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
;
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
;
171 InsCellCmd eMoveMode
;
173 ScUndoPasteOptions() :
174 nFunction( PASTE_NOFUNC
),
178 eMoveMode( INS_NONE
)
182 class ScUndoPaste
: public ScMultiBlockUndo
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
;
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
;
212 ScUndoPasteOptions aPasteOptions
;
214 void DoChange(bool bUndo
);
215 void SetChangeTrack();
218 class ScUndoDragDrop
: public ScMoveUndo
222 ScUndoDragDrop( ScDocShell
* pNewDocShell
,
223 const ScRange
& rRange
, ScAddress aNewDestPos
, bool bNewCut
,
224 ScDocument
* pUndoDocument
, ScRefUndoData
* pRefData
,
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
;
236 sal_uInt16 mnPaintExtFlags
;
237 ScRangeList maPaintRanges
;
241 sal_uLong nStartChangeAction
;
242 sal_uLong nEndChangeAction
;
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
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
);
273 boost::shared_ptr
<DataSpansType
> mpDataSpans
; // Spans of non-empty cells.
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
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
;
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
;
316 bool bMulti
; // Multi selection
320 void DoChange( const bool bUndo
);
321 void SetChangeTrack();
324 class ScUndoSelectionAttr
: public ScSimpleUndo
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();
347 ScMarkData aMarkData
;
349 boost::scoped_ptr
<ScEditDataArray
> mpDataArray
;
350 ScDocument
* pUndoDoc
;
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
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
,
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
;
383 ScMarkData aMarkData
;
388 ScDocument
* pUndoDoc
;
389 ScOutlineTable
* pUndoTab
;
390 std::vector
<sc::ColRowSpan
> maRanges
;
394 SdrUndoAction
* pDrawUndo
;
397 class ScUndoAutoFill
: public ScBlockUndo
401 ScUndoAutoFill( ScDocShell
* pNewDocShell
,
402 const ScRange
& rRange
, const ScRange
& rSourceArea
,
403 ScDocument
* pNewUndoDoc
, const ScMarkData
& rMark
,
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
;
418 ScMarkData aMarkData
;
419 ScDocument
* pUndoDoc
;
422 FillDateCmd eFillDateCmd
;
426 sal_uLong nStartChangeAction
;
427 sal_uLong nEndChangeAction
;
429 void SetChangeTrack();
432 class ScUndoMerge
: public ScSimpleUndo
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
;
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
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
;
474 ScDocument
* pUndoDoc
; // deleted data
475 ScMarkData aMarkData
;
477 sal_uInt16 nFormatNo
;
480 class ScUndoReplace
: public ScSimpleUndo
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
;
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
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
;
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
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
;
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
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
;
591 ScMarkData aMarkData
;
592 ScDocument
* pUndoDoc
;
593 ScDocument
* pRedoDoc
;
596 InsertDeleteFlags nFlags
;
597 sal_uLong nStartChangeAction
;
598 sal_uLong nEndChangeAction
;
600 void DoChange( ScDocument
* pRefDoc
);
601 void SetChangeTrack();
604 class ScUndoListNames
: public ScBlockUndo
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
;
621 ScDocument
* pUndoDoc
;
622 ScDocument
* pRedoDoc
;
624 void DoChange( ScDocument
* pSrcDoc
) const;
627 class ScUndoConditionalFormat
: public ScSimpleUndo
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
;
643 void DoChange(ScDocument
* pDoc
);
644 boost::scoped_ptr
<ScDocument
> mpUndoDoc
;
645 boost::scoped_ptr
<ScDocument
> mpRedoDoc
;
649 class ScUndoUseScenario
: public ScSimpleUndo
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
;
667 ScDocument
* pUndoDoc
;
669 ScMarkData aMarkData
;
673 class ScUndoSelectionStyle
: public ScSimpleUndo
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
;
693 ScMarkData aMarkData
;
694 ScDocument
* pUndoDoc
;
698 void DoChange( const bool bUndo
);
701 class ScUndoRefreshLink
: public ScSimpleUndo
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
;
717 ScDocument
* pUndoDoc
;
718 ScDocument
* pRedoDoc
;
721 class ScUndoEnterMatrix
: public ScBlockUndo
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
;
739 ScDocument
* pUndoDoc
;
741 sal_uLong nStartChangeAction
;
742 sal_uLong nEndChangeAction
;
744 void SetChangeTrack();
747 class ScUndoInsertAreaLink
: public ScSimpleUndo
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
;
771 sal_uLong nRefreshDelay
;
774 class ScUndoRemoveAreaLink
: public ScSimpleUndo
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
;
798 sal_uLong nRefreshDelay
;
801 class ScUndoUpdateAreaLink
: public ScSimpleUndo
//! also change BlockUndo?
805 ScUndoUpdateAreaLink( ScDocShell
* pShell
,
806 const OUString
& rOldD
,
807 const OUString
& rOldF
, const OUString
& rOldO
,
808 const OUString
& rOldA
, const ScRange
& rOldR
,
810 const OUString
& rNewD
,
811 const OUString
& rNewF
, const OUString
& rNewO
,
812 const OUString
& rNewA
, const ScRange
& rNewR
,
814 ScDocument
* pUndo
, ScDocument
* pRedo
,
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
;
836 ScDocument
* pUndoDoc
;
837 ScDocument
* pRedoDoc
;
838 sal_uLong nOldRefresh
;
839 sal_uLong nNewRefresh
;
842 void DoChange( const bool bUndo
) const;
845 class ScUndoIndent
: public ScBlockUndo
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
;
861 ScMarkData aMarkData
;
862 ScDocument
* pUndoDoc
;
866 class ScUndoTransliterate
: public ScBlockUndo
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
;
882 ScMarkData aMarkData
;
883 ScDocument
* pUndoDoc
;
884 sal_Int32 nTransliterationType
;
887 class ScUndoClearItems
: public ScBlockUndo
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
;
903 ScMarkData aMarkData
;
904 ScDocument
* pUndoDoc
;
908 class ScUndoRemoveBreaks
: public ScSimpleUndo
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
;
925 ScDocument
* pUndoDoc
;
928 class ScUndoRemoveMerge
: public ScBlockUndo
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
;
947 ScCellMergeOption maOption
;
948 ScDocument
* pUndoDoc
;
951 class ScUndoBorder
: public ScBlockUndo
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
;
970 ScDocument
* pUndoDoc
;
971 ScRangeList
* pRanges
;
973 SvxBoxInfoItem
* pInner
;
978 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */