LibreOffice Module sc (master) 1
chgtrack.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <map>
23#include <memory>
24#include <set>
25#include <stack>
26#include <vector>
27
28#include <com/sun/star/uno/Sequence.hxx>
29#include <tools/color.hxx>
30#include <tools/datetime.hxx>
31#include <tools/link.hxx>
32#include <tools/solar.h>
33#include <unotools/options.hxx>
34#include <optional>
35#include "global.hxx"
36#include "bigrange.hxx"
37#include "scdllapi.h"
38#include "cellvalue.hxx"
39
40class ScDocument;
41class ScFormulaCell;
42class ScChangeAction;
43class ScChangeTrack;
44class ScAppOptions;
45namespace tools { class JsonWriter; }
46
48{
49private:
51 const std::set<OUString>& rUsers;
52 OUString aLastUserName;
53 sal_uInt16 nLastUserIndex;
55
56public:
57 ScActionColorChanger( const ScChangeTrack& rTrack );
58 void Update( const ScChangeAction& rAction );
59 Color GetColor() const { return nColor; }
60};
61
63{
74};
75
77{
81};
82
84{
88};
89
103{
106
107protected:
108
113
114public:
115
117 ScChangeActionLinkEntry** ppPrevP,
118 ScChangeAction* pActionP )
119 : pNext( *ppPrevP ),
120 ppPrev( ppPrevP ),
121 pAction( pActionP ),
122 pLink( nullptr )
123 {
124 if ( pNext )
125 pNext->ppPrev = &pNext;
126 *ppPrevP = this;
127 }
128
130 {
132 UnLink();
133 Remove();
134 if ( p )
135 delete p;
136 }
137
139 {
140 UnLink();
141 if ( pLinkP )
142 {
143 pLink = pLinkP;
144 pLinkP->pLink = this;
145 }
146 }
147
148 void UnLink()
149 {
150 if ( pLink )
151 {
152 pLink->pLink = nullptr;
153 pLink = nullptr;
154 }
155 }
156
157 void Remove()
158 {
159 if ( ppPrev )
160 {
161 if ( ( *ppPrev = pNext ) != nullptr )
163 ppPrev = nullptr; // not inserted
164 }
165 }
166
167 const ScChangeActionLinkEntry* GetNext() const { return pNext; }
169 const ScChangeAction* GetAction() const { return pAction; }
171};
172
173// ScChangeActionCellListEntry
174// this is only for the XML Export in the hxx
176
177class SAL_DLLPUBLIC_RTTI ScChangeAction
178{
179 friend class ScChangeTrack;
180 friend class ScChangeActionIns;
181 friend class ScChangeActionDel;
182 friend class ScChangeActionMove;
184
185 ScChangeAction( const ScChangeAction& ) = delete;
187
188protected:
189
190 ScBigRange aBigRange; // Ins/Del/MoveTo/ContentPos
192 OUString aUser; // who?
193 OUString aComment; // user comment
194 ScChangeAction* pNext; // next in linked list
195 ScChangeAction* pPrev; // previous in linked list
197 ScChangeActionLinkEntry* pLinkDeletedIn; // access to insert areas which were
198 // deleted or moved or rejected
205
207
208 // only to be used in the XML import
210 ScBigRange ,
211 const sal_uLong nAction,
214 const DateTime& aDateTime,
215 OUString aUser,
216 OUString aComment );
217
218 // only to be used in the XML import
220
221 OUString GetRefString(
222 const ScBigRange& rRange, const ScDocument& rDoc, bool bFlag3D = false) const;
223
226 void SetUser( const OUString& r );
229 void SetRejected();
230
232
234 {
237 &pLinkAny, p );
238 pLnk->SetLink( pL );
239 }
240
242 { return pLinkDeletedIn; }
244 { return &pLinkDeletedIn; }
245 bool RemoveDeletedIn( const ScChangeAction* );
247
249 {
251 }
252
254 {
256 }
257
258 void RemoveAllDependent();
259
260 void RemoveAllLinks();
261
262 virtual void AddContent( ScChangeActionContent* ) = 0;
263 virtual void DeleteCellEntries() = 0;
264
265 virtual void UpdateReference( const ScChangeTrack*,
267 sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz );
268
269 void Accept();
270 virtual bool Reject(ScDocument& rDoc) = 0;
272
273 // used in Reject() instead of IsRejectable()
274 bool IsInternalRejectable() const;
275
276 // Derived classes that hold a pointer to the
277 // ChangeTrack must return that. Otherwise NULL.
278 virtual const ScChangeTrack* GetChangeTrack() const = 0;
279
280public:
281 virtual ~ScChangeAction();
282
283 bool IsInsertType() const;
284 bool IsDeleteType() const;
285 bool IsVirgin() const;
286 SC_DLLPUBLIC bool IsAccepted() const;
287 bool IsRejected() const;
288
289 // Action rejects another Action
290 bool IsRejecting() const;
291
292 // if action is visible in the document
293 bool IsVisible() const;
294
295 // if action if touchable
296 bool IsTouchable() const;
297
298 // if action is an entry in dialog root
299 bool IsDialogRoot() const;
300
301 // if an entry in a dialog shall be a drop down entry
302 bool IsDialogParent() const;
303
304 // if action is a delete with subdeletes (aufgeklappt = open ?)
305 bool IsMasterDelete() const;
306
307 // if action is acceptable/selectable/rejectable
308 bool IsClickable() const;
309
310 // if action is rejectable
311 bool IsRejectable() const;
312
313 const ScBigRange& GetBigRange() const { return aBigRange; }
314 SC_DLLPUBLIC DateTime GetDateTime() const; // local time
315 const DateTime& GetDateTimeUTC() const // UTC time
316 { return aDateTime; }
317 ScChangeActionType GetType() const { return eType; }
321
322 ScChangeAction* GetNext() const { return pNext; }
323 ScChangeAction* GetPrev() const { return pPrev; }
324
325 bool IsDeletedIn() const;
326 bool IsDeletedIn( const ScChangeAction* ) const;
328 void RemoveAllDeletedIn();
329
331 { return pLinkDeleted; }
333 { return pLinkDependent; }
334 bool HasDependent() const;
335 bool HasDeleted() const;
336 // description will be appended to string
337 // with bSplitRange only one column/row will be considered for delete
338 // (for a listing of entries)
339 virtual OUString GetDescription(
340 ScDocument& rDoc, bool bSplitRange = false, bool bWarning = true ) const;
341
342 virtual OUString GetRefString( ScDocument& rDoc, bool bFlag3D = false ) const;
343
344 // for DocumentMerge set old date of the other
345 // action, fetched by GetDateTimeUTC
346 void SetDateTimeUTC( const DateTime& rDT )
347 { aDateTime = rDT; }
348
349 const OUString& GetUser() const { return aUser;}
350 const OUString& GetComment() const { return aComment;}
351
352 // set user comment
353 void SetComment( const OUString& rStr );
354
355 // only to be used in the XML import
356 void SetDeletedInThis( sal_uLong nActionNumber,
357 const ScChangeTrack* pTrack );
358 // only to be used in the XML import
359 void AddDependent( sal_uLong nActionNumber,
360 const ScChangeTrack* pTrack );
361};
362
363// ScChangeActionIns
364class SAL_DLLPUBLIC_RTTI ScChangeActionIns final : public ScChangeAction
365{
366 friend class ScChangeTrack;
367
369
370 ScChangeActionIns( const ScDocument* pDoc, const ScRange& rRange, bool bEndOfList = false );
371
372 virtual void AddContent( ScChangeActionContent* ) override {}
373 virtual void DeleteCellEntries() override {}
374
375 virtual bool Reject(ScDocument& rDoc) override;
376
377 virtual const ScChangeTrack* GetChangeTrack() const override { return nullptr; }
378
379public:
380 virtual ~ScChangeActionIns() override;
382 const sal_uLong nActionNumber,
383 const ScChangeActionState eState,
384 const sal_uLong nRejectingNumber,
385 const ScBigRange& aBigRange,
386 const OUString& aUser,
387 const DateTime& aDateTime,
388 const OUString &sComment,
389 const ScChangeActionType eType,
390 bool bEndOfList = false );
391
392 virtual OUString GetDescription(
393 ScDocument& rDoc, bool bSplitRange = false, bool bWarning = true) const override;
394
395 SC_DLLPUBLIC bool IsEndOfList() const;
396};
397
398// ScChangeActionDel
399class SAL_DLLPUBLIC_RTTI ScChangeActionMove;
400
402{
403 friend class ScChangeActionDel;
404 friend class ScChangeTrack;
405
408
411 ScChangeActionMove* pMove,
412 short nFrom, short nTo );
413
414 inline ScChangeActionMove* GetMove();
415
416public:
418 {
419 return static_cast<const ScChangeActionDelMoveEntry*>(
421 }
422 inline const ScChangeActionMove* GetMove() const;
423 short GetCutOffFrom() const { return nCutOffFrom; }
424 short GetCutOffTo() const { return nCutOffTo; }
425};
426
428{
429 friend class ScChangeTrack;
431
433 std::vector<ScChangeActionContent*> mvCells;
435 short nCutOff; // +: start -: end
439
440 ScChangeActionDel( const ScDocument* pDoc, const ScRange& rRange, SCCOL nDx, SCROW nDy, ScChangeTrack* );
441
442 virtual void AddContent( ScChangeActionContent* ) override;
443 virtual void DeleteCellEntries() override;
444
445 void UndoCutOffMoves();
446 void UndoCutOffInsert();
447
448 virtual void UpdateReference( const ScChangeTrack*,
450 sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz ) override;
451
452 virtual bool Reject(ScDocument& rDoc) override;
453
454 virtual const ScChangeTrack* GetChangeTrack() const override { return pTrack; }
455
456public:
458 const sal_uLong nActionNumber, const ScChangeActionState eState,
459 const sal_uLong nRejectingNumber, const ScBigRange& aBigRange,
460 const OUString& aUser, const DateTime& aDateTime,
461 const OUString &sComment, const ScChangeActionType eType,
462 const SCCOLROW nD, ScChangeTrack* pTrack); // only to use in the XML import
463 // which of nDx and nDy is set is dependent on the type
464 virtual ~ScChangeActionDel() override;
465
466 // is the last in a row (or single)
467 bool IsBaseDelete() const;
468
469 // is the first in a row (or single)
470 bool IsTopDelete() const;
471
472 // is part of a row
473 bool IsMultiDelete() const;
474
475 // is col, belonging to a TabDelete
476 bool IsTabDeleteCol() const;
477
478 SCCOL GetDx() const { return nDx; }
479 SCROW GetDy() const { return nDy; }
480 ScBigRange GetOverAllRange() const; // BigRange + (nDx, nDy)
481
483 { return pLinkMove; }
484 const ScChangeActionIns* GetCutOffInsert() const { return pCutOff; }
485 short GetCutOffCount() const { return nCutOff; }
486
487 virtual OUString GetDescription(
488 ScDocument& rDoc, bool bSplitRange = false, bool bWarning = true ) const override;
489
491 { pCutOff = p; nCutOff = n; } // only to use in the XML import
492 // this should be protected, but for the XML import it is public
493 // only to use in the XML import
494 // this should be protected, but for the XML import it is public
496 ScChangeActionMove* pMove, short nFrom, short nTo );
497};
498
499// ScChangeActionMove
501{
502 friend class ScChangeTrack;
503 friend struct std::default_delete<ScChangeActionMove>; // for std::unique_ptr
504 friend class ScChangeActionDel;
505
508 std::vector<ScChangeActionContent*> mvCells;
509 sal_uLong nStartLastCut; // for PasteCut undo
511
512 ScChangeActionMove( const ScRange& rFromRange,
513 const ScRange& rToRange,
514 ScChangeTrack* pTrackP )
515 : ScChangeAction( SC_CAT_MOVE, rToRange ),
516 aFromRange( rFromRange ),
517 pTrack( pTrackP ),
518 nStartLastCut(0),
519 nEndLastCut(0)
520 {}
521 virtual ~ScChangeActionMove() override;
522
523 virtual void AddContent( ScChangeActionContent* ) override;
524 virtual void DeleteCellEntries() override;
525
527
528 void SetStartLastCut( sal_uLong nVal ) { nStartLastCut = nVal; }
530 void SetEndLastCut( sal_uLong nVal ) { nEndLastCut = nVal; }
532
533 virtual void UpdateReference( const ScChangeTrack*,
535 sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz ) override;
536
537 virtual bool Reject(ScDocument& rDoc) override;
538
539 virtual const ScChangeTrack* GetChangeTrack() const override { return pTrack; }
540
541protected:
543
544public:
545 ScChangeActionMove(const sal_uLong nActionNumber,
547 const sal_uLong nRejectingNumber,
548 const ScBigRange& aToBigRange,
549 const OUString& aUser,
550 const DateTime& aDateTime,
551 const OUString &sComment,
552 ScBigRange aFromBigRange,
553 ScChangeTrack* pTrack); // only to use in the XML import
554
555 const ScBigRange& GetFromRange() const { return aFromRange; }
556 SC_DLLPUBLIC void GetDelta( sal_Int32& nDx, sal_Int32& nDy, sal_Int32& nDz ) const;
557
558 virtual OUString GetDescription(
559 ScDocument& rDoc, bool bSplitRange = false, bool bWarning = true ) const override;
560
561 virtual OUString GetRefString( ScDocument& rDoc, bool bFlag3D = false ) const override;
562};
563
566 ScChangeActionMove* pMove,
567 short nFrom, short nTo )
569 reinterpret_cast<ScChangeActionLinkEntry**>(
570 ppPrevP),
571 static_cast<ScChangeAction*>(pMove) ),
572 nCutOffFrom( nFrom ),
573 nCutOffTo( nTo )
574{}
575
577 {
578 return static_cast<ScChangeActionMove*>(
580 }
581
583 {
584 return static_cast<const ScChangeActionMove*>(
586 }
587// ScChangeActionContent
589{
595
596class SAL_DLLPUBLIC_RTTI ScChangeActionContent final : public ScChangeAction
597{
598 friend class ScChangeTrack;
599
602
603 OUString maOldValue;
604 OUString maNewValue;
605 ScChangeActionContent* pNextContent; // at the same position
607 ScChangeActionContent* pNextInSlot; // in the same slot
609
611 {
612 if ( !ppPrevInSlot )
613 {
614 ppPrevInSlot = pp;
615 if ( ( pNextInSlot = *pp ) != nullptr )
616 pNextInSlot->ppPrevInSlot = &pNextInSlot;
617 *pp = this;
618 }
619 }
620
622 {
623 if ( ppPrevInSlot )
624 {
625 if ( ( *ppPrevInSlot = pNextInSlot ) != nullptr )
626 pNextInSlot->ppPrevInSlot = ppPrevInSlot;
627 ppPrevInSlot = nullptr; // not inserted
628 }
629 }
630
631 ScChangeActionContent* GetNextInSlot() { return pNextInSlot; }
632
633 void ClearTrack();
634
635 static OUString GetStringOfCell(
636 const ScCellValue& rCell, const ScDocument* pDoc, const ScAddress& rPos );
637
638 static OUString GetStringOfCell(
639 const ScCellValue& rCell, const ScDocument* pDoc, sal_uLong nFormat );
640
641 static void SetValue( OUString& rStr, ScCellValue& rCell, const ScAddress& rPos,
642 const ScCellValue& rOrgCell, const ScDocument* pFromDoc,
643 ScDocument* pToDoc );
644
645 static void SetValue( OUString& rStr, ScCellValue& rCell, sal_uLong nFormat,
646 const ScCellValue& rOrgCell, const ScDocument* pFromDoc,
647 ScDocument* pToDoc );
648
649 static void SetCell( OUString& rStr, ScCellValue& rCell, sal_uLong nFormat, const ScDocument* pDoc );
650
651 static bool NeedsNumberFormat( const ScCellValue& rVal );
652
653 void SetValueString( OUString& rValue, ScCellValue& rCell, const OUString& rStr, ScDocument* pDoc );
654
655 OUString GetValueString( const OUString& rValue, const ScCellValue& rCell,
656 const ScDocument* pDoc ) const;
657
658 OUString GetFormulaString( const ScFormulaCell* pCell ) const;
659
660 virtual void AddContent( ScChangeActionContent* ) override {}
661 virtual void DeleteCellEntries() override {}
662
663 virtual void UpdateReference( const ScChangeTrack*,
665 sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz ) override;
666
667 virtual bool Reject(ScDocument& rDoc) override;
668
669 virtual const ScChangeTrack* GetChangeTrack() const override { return nullptr; }
670
671 // pRejectActions!=NULL: reject actions get
672 // stacked, no SetNewValue, no Append
674 bool bOldest, ::std::stack<ScChangeActionContent*>* pRejectActions );
675
676 void PutValueToDoc(
677 const ScCellValue& rCell, const OUString& rValue, ScDocument* pDoc, SCCOL nDx, SCROW nDy ) const;
678
679protected:
681
682public:
683 ScChangeActionContent( const ScRange& rRange );
684
686 const sal_uLong nActionNumber, const ScChangeActionState eState,
687 const sal_uLong nRejectingNumber, const ScBigRange& aBigRange,
688 const OUString& aUser, const DateTime& aDateTime,
689 const OUString &sComment, ScCellValue aOldCell,
690 const ScDocument* pDoc, const OUString& sOldValue ); // to use for XML Import
691
693 const sal_uLong nActionNumber, ScCellValue aNewCell,
694 const ScBigRange& aBigRange, const ScDocument* pDoc,
695 const OUString& sNewValue ); // to use for XML Import of Generated Actions
696
697 virtual ~ScChangeActionContent() override;
698
699 ScChangeActionContent* GetNextContent() const { return pNextContent; }
700 ScChangeActionContent* GetPrevContent() const { return pPrevContent; }
701 ScChangeActionContent* GetTopContent() const;
702 bool IsTopContent() const { return pNextContent == nullptr; }
703
704 virtual ScChangeActionLinkEntry* GetDeletedIn() const override;
705 virtual ScChangeActionLinkEntry** GetDeletedInAddress() override;
706
707 void PutOldValueToDoc( ScDocument*,
708 SCCOL nDx, SCROW nDy ) const;
709 void PutNewValueToDoc( ScDocument*,
710 SCCOL nDx, SCROW nDy ) const;
711
712 void SetOldValue( const ScCellValue& rCell, const ScDocument* pFromDoc, ScDocument* pToDoc, sal_uLong nFormat );
713
714 void SetOldValue( const ScCellValue& rCell, const ScDocument* pFromDoc, ScDocument* pToDoc );
715
716 void SetNewValue( const ScCellValue& rCell, ScDocument* pDoc );
717
718 // Used in import filter AppendContentOnTheFly,
719 void SetOldNewCells(
720 const ScCellValue& rOldCell, sal_uLong nOldFormat,
721 const ScCellValue& rNewCell, sal_uLong nNewFormat, const ScDocument* pDoc );
722
723 // Use this only in the XML import,
724 // takes ownership of cell.
725 void SetNewCell(
726 const ScCellValue& rCell, const ScDocument* pDoc, const OUString& rFormatted );
727
728 // These functions should be protected but for
729 // the XML import they are public.
731 { pNextContent = p; }
733 { pPrevContent = p; }
734
735 // don't use:
736 // assigns string / creates formula cell
737 void SetOldValue( const OUString& rOld, ScDocument* pDoc );
738
739 OUString GetOldString( const ScDocument* pDoc ) const;
740 OUString GetNewString( const ScDocument* pDoc ) const;
741 const ScCellValue& GetOldCell() const { return maOldCell;}
742 const ScCellValue& GetNewCell() const { return maNewCell;}
743 virtual OUString GetDescription(
744 ScDocument& rDoc, bool bSplitRange = false, bool bWarning = true ) const override;
745
746 virtual OUString GetRefString( ScDocument& rDoc, bool bFlag3D = false ) const override;
747
748 static ScChangeActionContentCellType GetContentCellType( const ScCellValue& rCell );
749 static ScChangeActionContentCellType GetContentCellType( const ScRefCellValue& rIter );
750
751 // NewCell
752 bool IsMatrixOrigin() const;
753 // OldCell
754 bool IsOldMatrixReference() const;
755};
756
757// ScChangeActionReject
759{
760 friend class ScChangeTrack;
762
763 virtual void AddContent( ScChangeActionContent* ) override {}
764 virtual void DeleteCellEntries() override {}
765
766 virtual bool Reject(ScDocument& rDoc) override;
767
768 virtual const ScChangeTrack* GetChangeTrack() const override { return nullptr; }
769
770public:
771 ScChangeActionReject(const sal_uLong nActionNumber,
773 const sal_uLong nRejectingNumber,
774 const ScBigRange& aBigRange,
775 const OUString& aUser,
776 const DateTime& aDateTime,
777 const OUString &sComment); // only to use in the XML import
778};
779
780// ScChangeTrack
782{
783 NONE,
784 Append, // Actions appended
785 Remove, // Actions removed
786 Change, // Actions changed
787 Parent // became a parent (and wasn't before)
788};
789
791{
795};
796
797// MsgQueue for notification via ModifiedLink
798typedef std::vector<ScChangeTrackMsgInfo> ScChangeTrackMsgQueue;
799typedef std::vector<ScChangeTrackMsgInfo> ScChangeTrackMsgStack;
800typedef std::map<sal_uLong, ScChangeAction*> ScChangeActionMap;
801
803{
810
811// Internally generated actions start at this value (nearly all bits set)
812// and are decremented, to keep values in a table separated from "normal" actions.
813#define SC_CHGTRACK_GENERATED_START (sal_uInt32(0xfffffff0))
814
815class SAL_DLLPUBLIC_RTTI ScChangeTrack final : public utl::ConfigurationListener
816{
822
825
826 css::uno::Sequence< sal_Int8 > aProtectPass;
833 std::set<OUString> maUserCollection;
834 OUString maUser;
841 std::unique_ptr<ScChangeActionContent*[]> ppContentSlots;
842 std::unique_ptr<ScChangeActionMove> pLastCutMove;
847 std::optional<ScChangeTrackMsgInfo> xBlockModifyMsg;
856 bool bInDelete:1;
862
863 ScChangeTrack( const ScChangeTrack& ) = delete;
865
866 SCROW InitContentRowsPerSlot();
867
868 // true if one is ScMatrixMode::Formula and the other is
869 // not, or if both are and range differs
870 static bool IsMatrixFormulaRangeDifferent(
871 const ScCellValue& rOldCell, const ScCellValue& rNewCell );
872
873 void Init();
874 void DtorClear();
875 void SetInDeleteRange( const ScRange& rRange )
876 { aInDeleteRange = rRange; }
877 void SetInDelete( bool bVal )
878 { bInDelete = bVal; }
879 void SetInDeleteTop( bool bVal )
880 { bInDeleteTop = bVal; }
881 void SetInDeleteUndo( bool bVal )
882 { bInDeleteUndo = bVal; }
883 void SetInPasteCut( bool bVal )
884 { bInPasteCut = bVal; }
886 { eMergeState = eState; }
887 ScChangeTrackMergeState GetMergeState() const { return eMergeState; }
888 void SetLastMerge( sal_uLong nVal ) { nLastMerge = nVal; }
889 sal_uLong GetLastMerge() const { return nLastMerge; }
890
891 void SetLastCutMoveRange( const ScRange&, ScDocument* );
892
893 // create block of ModifyMsg
894 void StartBlockModify( ScChangeTrackMsgType,
895 sal_uLong nStartAction );
896 void EndBlockModify( sal_uLong nEndAction );
897
898 void AddDependentWithNotify( ScChangeAction* pParent,
899 ScChangeAction* pDependent );
900
901 void Dependencies( ScChangeAction* );
902 void UpdateReference( ScChangeAction*, bool bUndo );
903 void UpdateReference( ScChangeAction** ppFirstAction, ScChangeAction* pAct, bool bUndo );
904 void Append( ScChangeAction* pAppend, sal_uLong nAction );
905 SC_DLLPUBLIC void AppendDeleteRange( const ScRange&,
906 ScDocument* pRefDoc, SCTAB nDz,
907 sal_uLong nRejectingInsert );
908 void AppendOneDeleteRange( const ScRange& rOrgRange,
909 ScDocument* pRefDoc,
910 SCCOL nDx, SCROW nDy, SCTAB nDz,
911 sal_uLong nRejectingInsert );
912 void LookUpContents( const ScRange& rOrgRange,
913 ScDocument* pRefDoc,
914 SCCOL nDx, SCROW nDy, SCTAB nDz );
915 void Remove( ScChangeAction* );
916 void MasterLinks( ScChangeAction* );
917
918 // Content on top at Position
919 ScChangeActionContent* SearchContentAt( const ScBigAddress&,
920 const ScChangeAction* pButNotThis ) const;
921 void DeleteGeneratedDelContent(
923
924 ScChangeActionContent* GenerateDelContent(
925 const ScAddress& rPos, const ScCellValue& rCell, const ScDocument* pFromDoc );
926
927 void DeleteCellEntries(
928 std::vector<ScChangeActionContent*>&,
929 const ScChangeAction* pDeletor );
930
931 // Reject action and all dependent actions,
932 // Table stems from previous GetDependents,
933 // only needed for Insert and Move (MasterType),
934 // is NULL otherwise.
935 // bRecursion == called from reject with table
936 bool Reject( ScChangeAction*, ScChangeActionMap*, bool bRecursion );
937
938 bool IsLastAction( sal_uLong nNum ) const;
939
940 void ClearMsgQueue();
941 virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, ConfigurationHints ) override;
942
943public:
944
945 SCSIZE ComputeContentSlot( sal_Int32 nRow ) const;
946
948 ScChangeTrack(ScDocument& rDocP, std::set<OUString>&& aTempUserCollection); // only to use in the XML import
949 SC_DLLPUBLIC virtual ~ScChangeTrack() override;
950 void Clear();
951
952 ScChangeActionContent* GetFirstGenerated() const { return pFirstGeneratedDelContent; }
953 ScChangeAction* GetFirst() const { return pFirst; }
954 ScChangeAction* GetLast() const { return pLast; }
955 sal_uLong GetActionMax() const { return nActionMax; }
956 bool IsGenerated( sal_uLong nAction ) const;
957 SC_DLLPUBLIC ScChangeAction* GetAction( sal_uLong nAction ) const;
958 ScChangeAction* GetGenerated( sal_uLong nGenerated ) const;
959 ScChangeAction* GetActionOrGenerated( sal_uLong nAction ) const;
960 sal_uLong GetLastSavedActionNumber() const;
961 void SetLastSavedActionNumber(sal_uLong nNew);
962 ScChangeAction* GetLastSaved() const;
963 ScChangeActionContent** GetContentSlots() const { return ppContentSlots.get(); }
964
966 { return aInDeleteRange; }
967 bool IsInDelete() const { return bInDelete; }
968 bool IsInDeleteTop() const { return bInDeleteTop; }
969 bool IsInDeleteUndo() const { return bInDeleteUndo; }
970 bool IsInPasteCut() const { return bInPasteCut; }
971 SC_DLLPUBLIC void SetUser( const OUString& rUser );
972 const OUString& GetUser() const { return maUser;}
973 const std::set<OUString>& GetUserCollection() const { return maUserCollection;}
974 ScDocument& GetDocument() const { return rDoc; }
975 // for import filter
976 const DateTime& GetFixDateTime() const { return aFixDateTime; }
977
978 // set this if the date/time set with
979 // SetFixDateTime...() shall be applied to
980 // appended actions
981 void SetUseFixDateTime( bool bVal )
982 { bUseFixDateTime = bVal; }
983 // for MergeDocument, apply original date/time as UTC
984 void SetFixDateTimeUTC( const DateTime& rDT )
985 { aFixDateTime = rDT; }
986 // for import filter, apply original date/time as local time
987 void SetFixDateTimeLocal( const DateTime& rDT )
988 { aFixDateTime = rDT; aFixDateTime.ConvertToUTC(); }
989
990 void Append( ScChangeAction* );
991
992 // pRefDoc may be NULL => no lookup of contents
993 // => no generation of deleted contents
994 SC_DLLPUBLIC void AppendDeleteRange( const ScRange&,
995 ScDocument* pRefDoc,
996 sal_uLong& nStartAction, sal_uLong& nEndAction,
997 SCTAB nDz = 0 );
998 // nDz: multi TabDel, LookUpContent must be searched
999 // with an offset of -nDz
1000
1001 // after new value was set in the document,
1002 // old value from RefDoc/UndoDoc
1003 void AppendContent( const ScAddress& rPos,
1004 const ScDocument* pRefDoc );
1005 // after new values were set in the document,
1006 // old values from RefDoc/UndoDoc
1007 void AppendContentRange( const ScRange& rRange,
1008 ScDocument* pRefDoc,
1009 sal_uLong& nStartAction, sal_uLong& nEndAction,
1011 // after new value was set in the document,
1012 // old value from pOldCell, nOldFormat,
1013 // RefDoc==NULL => Doc
1014 void AppendContent( const ScAddress& rPos, const ScCellValue& rOldCell,
1015 sal_uLong nOldFormat, ScDocument* pRefDoc = nullptr );
1016 // after new value was set in the document,
1017 // old value from pOldCell, format from Doc
1018 SC_DLLPUBLIC void AppendContent( const ScAddress& rPos, const ScCellValue& rOldCell );
1019 // after new values were set in the document,
1020 // old values from RefDoc/UndoDoc.
1021 // All contents with a cell in RefDoc
1022 void AppendContentsIfInRefDoc( ScDocument& rRefDoc,
1023 sal_uLong& nStartAction, sal_uLong& nEndAction );
1024
1025 // Meant for import filter, creates and inserts
1026 // an unconditional content action of the two
1027 // cells without querying the document, not
1028 // even for number formats (though the number
1029 // formatter of the document may be used).
1030 // The action is returned and may be used to
1031 // set user name, description, date/time et al.
1032 // Takes ownership of the cells!
1033 SC_DLLPUBLIC ScChangeActionContent* AppendContentOnTheFly(
1034 const ScAddress& rPos, const ScCellValue& rOldCell, const ScCellValue& rNewCell,
1035 sal_uLong nOldFormat = 0, sal_uLong nNewFormat = 0 );
1036
1037 // Only use the following two if there is no different solution! (Assign
1038 // string for NewValue or creation of a formula respectively)
1039
1040 SC_DLLPUBLIC void AppendInsert( const ScRange& rRange, bool bEndOfList = false );
1041
1042 // pRefDoc may be NULL => no lookup of contents
1043 // => no generation of deleted contents
1044 SC_DLLPUBLIC void AppendMove( const ScRange& rFromRange, const ScRange& rToRange,
1045 ScDocument* pRefDoc );
1046
1047 // Cut to Clipboard
1049 {
1050 nStartLastCut = nEndLastCut = 0;
1051 pLastCutMove.reset();
1052 }
1053 bool HasLastCut() const
1054 {
1055 return nEndLastCut > 0 &&
1056 nStartLastCut <= nEndLastCut &&
1057 pLastCutMove;
1058 }
1059
1060 SC_DLLPUBLIC void Undo( sal_uLong nStartAction, sal_uLong nEndAction, bool bMerge = false );
1061
1062 // adjust references for MergeDocument
1065 void MergePrepare( const ScChangeAction* pFirstMerge, bool bShared );
1066 void MergeOwn( ScChangeAction* pAct, sal_uLong nFirstMerge, bool bShared );
1067 static bool MergeIgnore( const ScChangeAction&, sal_uLong nFirstMerge );
1068
1069 // This comment was already really strange in German.
1070 // Tried to structure it a little. Hope no information got lost...
1071 //
1072 // Insert dependents into table.
1073 // ScChangeAction is
1074 // - "Insert": really dependents
1075 // - "Move": dependent contents in FromRange /
1076 // deleted contents in ToRange
1077 // OR inserts in FromRange or ToRange
1078 // - "Delete": a list of deleted (what?)
1079 // OR for content, different contents at the same position
1080 // OR MatrixReferences belonging to MatrixOrigin
1081
1082 // With bListMasterDelete (==TRUE ?) all Deletes of a row belonging
1083 // to a MasterDelete are listed (possibly it is
1084 // "all Deletes belonging...are listed in a row?)
1085
1086 // With bAllFlat (==TRUE ?) all dependents of dependents
1087 // will be inserted flatly.
1088
1089 SC_DLLPUBLIC void GetDependents(
1090 ScChangeAction*, ScChangeActionMap&, bool bListMasterDelete = false, bool bAllFlat = false ) const;
1091
1092 // Reject visible action (and dependents)
1093 bool Reject( ScChangeAction*, bool bShared = false );
1094
1095 // Accept visible action (and dependents)
1096 SC_DLLPUBLIC bool Accept( ScChangeAction* );
1097
1098 void AcceptAll(); // all Virgins
1099 bool RejectAll(); // all Virgins
1100
1101 // Selects a content of several contents at the same
1102 // position and accepts this one and
1103 // the older ones, rejects the more recent ones.
1104 // If bOldest==TRUE then the first OldValue
1105 // of a Virgin-Content-List will be restored.
1106 bool SelectContent( ScChangeAction*, bool bOldest = false );
1107
1108 // If ModifiedLink is set, changes go to
1109 // ScChangeTrackMsgQueue
1111 { aModifiedLink = r; ClearMsgQueue(); }
1112 ScChangeTrackMsgQueue& GetMsgQueue();
1113
1114 void NotifyModified( ScChangeTrackMsgType eMsgType,
1115 sal_uLong nStartAction, sal_uLong nEndAction );
1116
1117 sal_uLong AddLoadedGenerated( const ScCellValue& rNewCell,
1118 const ScBigRange& aBigRange, const OUString& sNewValue ); // only to use in the XML import
1119 void AppendLoaded( std::unique_ptr<ScChangeAction> pAppend ); // this is only for the XML import public, it should be protected
1120 void SetActionMax(sal_uLong nTempActionMax)
1121 { nActionMax = nTempActionMax; } // only to use in the XML import
1122
1123 void SetProtection( const css::uno::Sequence< sal_Int8 >& rPass )
1124 { aProtectPass = rPass; }
1125 const css::uno::Sequence< sal_Int8 >& GetProtection() const
1126 { return aProtectPass; }
1127 bool IsProtected() const { return aProtectPass.hasElements(); }
1128
1129 // If time stamps of actions of this
1130 // ChangeTrack and a second one are to be
1131 // compared including nanoseconds.
1132 void SetTimeNanoSeconds( bool bVal ) { bTimeNanoSeconds = bVal; }
1133 bool IsTimeNanoSeconds() const { return bTimeNanoSeconds; }
1134
1135 void AppendCloned( ScChangeAction* pAppend );
1136 SC_DLLPUBLIC ScChangeTrack* Clone( ScDocument* pDocument ) const;
1137 static void MergeActionState( ScChangeAction* pAct, const ScChangeAction* pOtherAct );
1139 void GetChangeTrackInfo(tools::JsonWriter&);
1140};
1141
1142/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
size_t SCSIZE
size_t typedef to be able to find places where code was changed from USHORT to size_t and is used to ...
Definition: address.hxx:44
ScChangeActionClipMode
Definition: chgtrack.hxx:84
@ SC_CACM_PASTE
Definition: chgtrack.hxx:87
@ SC_CACM_NONE
Definition: chgtrack.hxx:85
@ SC_CACM_CUT
Definition: chgtrack.hxx:86
std::vector< ScChangeTrackMsgInfo > ScChangeTrackMsgStack
Definition: chgtrack.hxx:799
std::map< sal_uLong, ScChangeAction * > ScChangeActionMap
Definition: chgtrack.hxx:800
std::vector< ScChangeTrackMsgInfo > ScChangeTrackMsgQueue
Definition: chgtrack.hxx:798
ScChangeTrackMsgType
Definition: chgtrack.hxx:782
ScChangeActionType
Definition: chgtrack.hxx:63
@ SC_CAT_NONE
Definition: chgtrack.hxx:64
@ SC_CAT_MOVE
Definition: chgtrack.hxx:71
@ SC_CAT_DELETE_TABS
Definition: chgtrack.hxx:70
@ SC_CAT_INSERT_TABS
Definition: chgtrack.hxx:67
@ SC_CAT_DELETE_ROWS
Definition: chgtrack.hxx:69
@ SC_CAT_CONTENT
Definition: chgtrack.hxx:72
@ SC_CAT_REJECT
Definition: chgtrack.hxx:73
@ SC_CAT_DELETE_COLS
Definition: chgtrack.hxx:68
@ SC_CAT_INSERT_ROWS
Definition: chgtrack.hxx:66
@ SC_CAT_INSERT_COLS
Definition: chgtrack.hxx:65
ScChangeTrackMergeState
Definition: chgtrack.hxx:803
@ SC_CTMS_OTHER
Definition: chgtrack.hxx:808
@ SC_CTMS_UNDO
Definition: chgtrack.hxx:807
@ SC_CTMS_OWN
Definition: chgtrack.hxx:806
@ SC_CTMS_PREPARE
Definition: chgtrack.hxx:805
@ SC_CTMS_NONE
Definition: chgtrack.hxx:804
ScChangeActionState
Definition: chgtrack.hxx:77
@ SC_CAS_REJECTED
Definition: chgtrack.hxx:80
@ SC_CAS_VIRGIN
Definition: chgtrack.hxx:78
@ SC_CAS_ACCEPTED
Definition: chgtrack.hxx:79
ScChangeActionContentCellType
Definition: chgtrack.hxx:589
@ SC_CACCT_MATORG
Definition: chgtrack.hxx:592
@ SC_CACCT_NONE
Definition: chgtrack.hxx:590
@ SC_CACCT_MATREF
Definition: chgtrack.hxx:593
@ SC_CACCT_NORMAL
Definition: chgtrack.hxx:591
void ConvertToUTC()
Color GetColor() const
Definition: chgtrack.hxx:59
const ScAppOptions & rOpt
Definition: chgtrack.hxx:50
void Update(const ScChangeAction &rAction)
Definition: output.cxx:94
ScActionColorChanger(const ScChangeTrack &rTrack)
Definition: output.cxx:86
OUString aLastUserName
Definition: chgtrack.hxx:52
const std::set< OUString > & rUsers
Definition: chgtrack.hxx:51
sal_uInt16 nLastUserIndex
Definition: chgtrack.hxx:53
bool IsTopContent() const
Definition: chgtrack.hxx:702
ScChangeActionContent * GetNextContent() const
Definition: chgtrack.hxx:699
void InsertInSlot(ScChangeActionContent **pp)
Definition: chgtrack.hxx:610
ScChangeActionContent * GetPrevContent() const
Definition: chgtrack.hxx:700
virtual OUString GetRefString(ScDocument &rDoc, bool bFlag3D=false) const override
Definition: chgtrack.cxx:1433
ScChangeActionContent * pNextContent
Definition: chgtrack.hxx:605
ScChangeActionContent ** ppPrevInSlot
Definition: chgtrack.hxx:608
virtual const ScChangeTrack * GetChangeTrack() const override
Definition: chgtrack.hxx:669
virtual void UpdateReference(const ScChangeTrack *, UpdateRefMode, const ScBigRange &, sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz) override
Definition: chgtrack.cxx:1840
virtual void AddContent(ScChangeActionContent *) override
Definition: chgtrack.hxx:660
void SetPrevContent(ScChangeActionContent *p)
Definition: chgtrack.hxx:732
const ScCellValue & GetNewCell() const
Definition: chgtrack.hxx:742
virtual OUString GetDescription(ScDocument &rDoc, bool bSplitRange=false, bool bWarning=true) const override
Definition: chgtrack.cxx:1393
void SetNextContent(ScChangeActionContent *p)
Definition: chgtrack.hxx:730
virtual void DeleteCellEntries() override
Definition: chgtrack.hxx:661
const ScCellValue & GetOldCell() const
Definition: chgtrack.hxx:741
ScCellValue maOldCell
Definition: chgtrack.hxx:600
ScCellValue maNewCell
Definition: chgtrack.hxx:601
ScChangeActionContent * pNextInSlot
Definition: chgtrack.hxx:607
ScChangeActionContent * GetNextInSlot()
Definition: chgtrack.hxx:631
ScChangeActionContent * pPrevContent
Definition: chgtrack.hxx:606
const ScChangeActionDelMoveEntry * GetNext() const
Definition: chgtrack.hxx:417
short GetCutOffTo() const
Definition: chgtrack.hxx:424
short GetCutOffFrom() const
Definition: chgtrack.hxx:423
ScChangeActionMove * GetMove()
Definition: chgtrack.hxx:576
ScChangeActionDelMoveEntry(ScChangeActionDelMoveEntry **ppPrevP, ScChangeActionMove *pMove, short nFrom, short nTo)
Definition: chgtrack.hxx:564
bool IsBaseDelete() const
Definition: chgtrack.cxx:809
bool IsMultiDelete() const
Definition: chgtrack.cxx:822
virtual void UpdateReference(const ScChangeTrack *, UpdateRefMode, const ScBigRange &, sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz) override
Definition: chgtrack.cxx:851
ScChangeTrack * pTrack
Definition: chgtrack.hxx:432
ScChangeActionDelMoveEntry * AddCutOffMove(ScChangeActionMove *pMove, short nFrom, short nTo)
Definition: chgtrack.cxx:845
SCROW GetDy() const
Definition: chgtrack.hxx:479
virtual void AddContent(ScChangeActionContent *) override
Definition: chgtrack.cxx:799
std::vector< ScChangeActionContent * > mvCells
Definition: chgtrack.hxx:433
void SetCutOffInsert(ScChangeActionIns *p, short n)
Definition: chgtrack.hxx:490
virtual void DeleteCellEntries() override
Definition: chgtrack.cxx:804
const ScChangeActionDelMoveEntry * GetFirstMoveEntry() const
Definition: chgtrack.hxx:482
bool IsTabDeleteCol() const
Definition: chgtrack.cxx:834
ScChangeActionDelMoveEntry * pLinkMove
Definition: chgtrack.hxx:436
virtual const ScChangeTrack * GetChangeTrack() const override
Definition: chgtrack.hxx:454
SCCOL GetDx() const
Definition: chgtrack.hxx:478
virtual ~ScChangeActionDel() override
Definition: chgtrack.cxx:789
short GetCutOffCount() const
Definition: chgtrack.hxx:485
void UndoCutOffInsert()
Definition: chgtrack.cxx:1059
ScBigRange GetOverAllRange() const
Definition: chgtrack.cxx:890
bool IsTopDelete() const
Definition: chgtrack.cxx:814
void UndoCutOffMoves()
Definition: chgtrack.cxx:1010
const ScChangeActionIns * GetCutOffInsert() const
Definition: chgtrack.hxx:484
virtual bool Reject(ScDocument &rDoc) override
Definition: chgtrack.cxx:940
virtual OUString GetDescription(ScDocument &rDoc, bool bSplitRange=false, bool bWarning=true) const override
Definition: chgtrack.cxx:898
ScChangeActionIns * pCutOff
Definition: chgtrack.hxx:434
virtual const ScChangeTrack * GetChangeTrack() const override
Definition: chgtrack.hxx:377
virtual void DeleteCellEntries() override
Definition: chgtrack.hxx:373
virtual void AddContent(ScChangeActionContent *) override
Definition: chgtrack.hxx:372
A link/connection/dependency between change actions.
Definition: chgtrack.hxx:103
const ScChangeAction * GetAction() const
Definition: chgtrack.hxx:169
virtual ~ScChangeActionLinkEntry()
Definition: chgtrack.hxx:129
ScChangeActionLinkEntry * GetNext()
Definition: chgtrack.hxx:168
ScChangeActionLinkEntry & operator=(const ScChangeActionLinkEntry &)=delete
ScChangeActionLinkEntry * pLink
Definition: chgtrack.hxx:112
ScChangeActionLinkEntry * pNext
Definition: chgtrack.hxx:109
ScChangeActionLinkEntry(const ScChangeActionLinkEntry &)=delete
ScChangeAction * GetAction()
Definition: chgtrack.hxx:170
const ScChangeActionLinkEntry * GetNext() const
Definition: chgtrack.hxx:167
ScChangeAction * pAction
Definition: chgtrack.hxx:111
ScChangeActionLinkEntry ** ppPrev
Definition: chgtrack.hxx:110
ScChangeActionLinkEntry(ScChangeActionLinkEntry **ppPrevP, ScChangeAction *pActionP)
Definition: chgtrack.hxx:116
void SetLink(ScChangeActionLinkEntry *pLinkP)
Definition: chgtrack.hxx:138
const ScBigRange & GetFromRange() const
Definition: chgtrack.hxx:555
virtual ~ScChangeActionMove() override
Definition: chgtrack.cxx:1107
virtual void UpdateReference(const ScChangeTrack *, UpdateRefMode, const ScBigRange &, sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz) override
Definition: chgtrack.cxx:1122
ScChangeTrack * pTrack
Definition: chgtrack.hxx:507
sal_uLong nEndLastCut
Definition: chgtrack.hxx:510
std::vector< ScChangeActionContent * > mvCells
Definition: chgtrack.hxx:508
virtual void AddContent(ScChangeActionContent *) override
Definition: chgtrack.cxx:1112
sal_uLong nStartLastCut
Definition: chgtrack.hxx:509
void SetEndLastCut(sal_uLong nVal)
Definition: chgtrack.hxx:530
sal_uLong GetEndLastCut() const
Definition: chgtrack.hxx:531
void SetStartLastCut(sal_uLong nVal)
Definition: chgtrack.hxx:528
ScBigRange & GetFromRange()
Definition: chgtrack.hxx:526
virtual bool Reject(ScDocument &rDoc) override
Definition: chgtrack.cxx:1176
virtual OUString GetDescription(ScDocument &rDoc, bool bSplitRange=false, bool bWarning=true) const override
Definition: chgtrack.cxx:1139
ScChangeActionMove(const ScRange &rFromRange, const ScRange &rToRange, ScChangeTrack *pTrackP)
Definition: chgtrack.hxx:512
virtual const ScChangeTrack * GetChangeTrack() const override
Definition: chgtrack.hxx:539
SC_DLLPUBLIC void GetDelta(sal_Int32 &nDx, sal_Int32 &nDy, sal_Int32 &nDz) const
Definition: chgtrack.cxx:1130
sal_uLong GetStartLastCut() const
Definition: chgtrack.hxx:529
ScBigRange aFromRange
Definition: chgtrack.hxx:506
virtual OUString GetRefString(ScDocument &rDoc, bool bFlag3D=false) const override
Definition: chgtrack.cxx:1166
virtual void DeleteCellEntries() override
Definition: chgtrack.cxx:1117
virtual void DeleteCellEntries() override
Definition: chgtrack.hxx:764
virtual void AddContent(ScChangeActionContent *) override
Definition: chgtrack.hxx:763
virtual const ScChangeTrack * GetChangeTrack() const override
Definition: chgtrack.hxx:768
virtual bool Reject(ScDocument &rDoc) override
Definition: chgtrack.cxx:1987
ScChangeActionReject(const sal_uLong nActionNumber, const ScChangeActionState eState, const sal_uLong nRejectingNumber, const ScBigRange &aBigRange, const OUString &aUser, const DateTime &aDateTime, const OUString &sComment)
Definition: chgtrack.cxx:1978
DateTime aDateTime
Definition: chgtrack.hxx:191
ScChangeActionLinkEntry * pLinkDeleted
Definition: chgtrack.hxx:199
void SetDeletedInThis(sal_uLong nActionNumber, const ScChangeTrack *pTrack)
Definition: chgtrack.cxx:593
void SetDeletedIn(ScChangeAction *)
Definition: chgtrack.cxx:386
ScChangeActionLinkEntry * pLinkDependent
Definition: chgtrack.hxx:200
ScChangeAction * pPrev
Definition: chgtrack.hxx:195
sal_uLong nRejectAction
Definition: chgtrack.hxx:202
ScChangeAction(const ScChangeAction &)=delete
void SetRejectAction(sal_uLong n)
Definition: chgtrack.hxx:225
const OUString & GetComment() const
Definition: chgtrack.hxx:350
virtual ScChangeActionLinkEntry ** GetDeletedInAddress()
Definition: chgtrack.hxx:243
void SetComment(const OUString &rStr)
Definition: chgtrack.cxx:536
ScBigRange & GetBigRange()
Definition: chgtrack.hxx:231
friend class ScChangeActionMove
Definition: chgtrack.hxx:182
void SetUser(const OUString &r)
Definition: chgtrack.cxx:531
bool IsDeletedIn() const
Definition: chgtrack.cxx:317
bool IsRejected() const
Definition: chgtrack.cxx:132
ScChangeActionLinkEntry * AddDeleted(ScChangeAction *p)
Definition: chgtrack.hxx:248
ScChangeAction & operator=(const ScChangeAction &)=delete
virtual const ScChangeTrack * GetChangeTrack() const =0
bool IsClickable() const
Definition: chgtrack.cxx:165
bool IsVisible() const
Definition: chgtrack.cxx:142
bool IsMasterDelete() const
Definition: chgtrack.cxx:273
void RemoveAllLinks()
Definition: chgtrack.cxx:281
void SetActionNumber(sal_uLong n)
Definition: chgtrack.hxx:224
bool IsDialogRoot() const
Definition: chgtrack.cxx:232
sal_uLong GetRejectAction() const
Definition: chgtrack.hxx:320
ScChangeAction * pNext
Definition: chgtrack.hxx:194
OUString aUser
UTC.
Definition: chgtrack.hxx:192
bool IsTouchable() const
Definition: chgtrack.cxx:152
ScBigRange aBigRange
Definition: chgtrack.hxx:190
bool IsDialogParent() const
Definition: chgtrack.cxx:237
bool IsRejecting() const
Definition: chgtrack.cxx:137
sal_uLong GetActionNumber() const
Definition: chgtrack.hxx:319
void AddLink(ScChangeAction *p, ScChangeActionLinkEntry *pL)
Definition: chgtrack.hxx:233
const DateTime & GetDateTimeUTC() const
Definition: chgtrack.hxx:315
virtual ~ScChangeAction()
Definition: chgtrack.cxx:107
const ScBigRange & GetBigRange() const
Definition: chgtrack.hxx:313
void SetDateTimeUTC(const DateTime &rDT)
Definition: chgtrack.hxx:346
void SetType(ScChangeActionType e)
Definition: chgtrack.hxx:227
ScChangeActionType GetType() const
Definition: chgtrack.hxx:317
ScChangeActionLinkEntry * pLinkAny
Definition: chgtrack.hxx:196
const ScChangeActionLinkEntry * GetFirstDependentEntry() const
Definition: chgtrack.hxx:332
bool HasDeleted() const
Definition: chgtrack.cxx:381
void SetRejected()
Definition: chgtrack.cxx:555
virtual ScChangeActionLinkEntry * GetDeletedIn() const
Definition: chgtrack.hxx:241
bool RemoveDeletedIn(const ScChangeAction *)
Definition: chgtrack.cxx:300
friend class ScChangeActionDel
Definition: chgtrack.hxx:181
bool HasDependent() const
Definition: chgtrack.cxx:376
void RejectRestoreContents(ScChangeTrack *, SCCOL nDx, SCROW nDy)
Definition: chgtrack.cxx:565
virtual void AddContent(ScChangeActionContent *)=0
bool IsDeleteType() const
Definition: chgtrack.cxx:117
void SetState(ScChangeActionState e)
Definition: chgtrack.hxx:228
sal_uLong nAction
Definition: chgtrack.hxx:201
const ScChangeActionLinkEntry * GetFirstDeletedEntry() const
Definition: chgtrack.hxx:330
bool IsRejectable() const
Definition: chgtrack.cxx:196
bool IsDeletedInDelType(ScChangeActionType) const
Definition: chgtrack.cxx:344
bool IsInsertType() const
Definition: chgtrack.cxx:112
ScChangeAction * GetNext() const
Definition: chgtrack.hxx:322
ScChangeAction * GetPrev() const
Definition: chgtrack.hxx:323
bool IsInternalRejectable() const
Definition: chgtrack.cxx:214
void RemoveAllDependent()
Definition: chgtrack.cxx:397
bool IsVirgin() const
Definition: chgtrack.cxx:122
ScChangeActionState eState
Definition: chgtrack.hxx:204
ScChangeActionType eType
Definition: chgtrack.hxx:203
SC_DLLPUBLIC DateTime GetDateTime() const
Definition: chgtrack.cxx:406
virtual bool Reject(ScDocument &rDoc)=0
OUString GetRefString(const ScBigRange &rRange, const ScDocument &rDoc, bool bFlag3D=false) const
Definition: chgtrack.cxx:476
virtual void DeleteCellEntries()=0
ScChangeActionState GetState() const
Definition: chgtrack.hxx:318
ScChangeActionLinkEntry * pLinkDeletedIn
Definition: chgtrack.hxx:197
const OUString & GetUser() const
Definition: chgtrack.hxx:349
SC_DLLPUBLIC bool IsAccepted() const
Definition: chgtrack.cxx:127
void RemoveAllDeletedIn()
Definition: chgtrack.cxx:334
OUString aComment
Definition: chgtrack.hxx:193
ScChangeActionLinkEntry * AddDependent(ScChangeAction *p)
Definition: chgtrack.hxx:253
DateTime aFixDateTime
Definition: chgtrack.hxx:837
const std::set< OUString > & GetUserCollection() const
Definition: chgtrack.hxx:973
sal_uLong nEndLastCut
Definition: chgtrack.hxx:853
ScDocument & GetDocument() const
Definition: chgtrack.hxx:974
std::optional< ScChangeTrackMsgInfo > xBlockModifyMsg
Definition: chgtrack.hxx:847
ScChangeTrackMsgStack aMsgStackFinal
Definition: chgtrack.hxx:832
ScChangeAction * GetLast() const
Definition: chgtrack.hxx:954
bool bUseFixDateTime
Definition: chgtrack.hxx:860
ScChangeActionMap aPasteCutMap
Definition: chgtrack.hxx:829
SCROW mnContentRowsPerSlot
Definition: chgtrack.hxx:823
sal_uLong nActionMax
Definition: chgtrack.hxx:849
bool IsInDelete() const
Definition: chgtrack.hxx:967
void SetMergeState(ScChangeTrackMergeState eState)
Definition: chgtrack.hxx:885
const DateTime & GetFixDateTime() const
Definition: chgtrack.hxx:976
ScChangeAction * pFirst
Definition: chgtrack.hxx:838
ScChangeAction * pLast
Definition: chgtrack.hxx:839
bool bTimeNanoSeconds
Definition: chgtrack.hxx:861
std::set< OUString > maUserCollection
Definition: chgtrack.hxx:833
ScChangeActionLinkEntry * pLinkInsertTab
Definition: chgtrack.hxx:845
OUString maUser
Definition: chgtrack.hxx:834
void SetInDeleteRange(const ScRange &rRange)
Definition: chgtrack.hxx:875
void SetModifiedLink(const Link< ScChangeTrack &, void > &r)
Definition: chgtrack.hxx:1110
void SetInDeleteTop(bool bVal)
Definition: chgtrack.hxx:879
css::uno::Sequence< sal_Int8 > aProtectPass
Definition: chgtrack.hxx:826
sal_uLong nLastMerge
Definition: chgtrack.hxx:854
void UpdateReference(ScChangeAction *, bool bUndo)
Definition: chgtrack.cxx:3190
sal_uLong GetActionMax() const
Definition: chgtrack.hxx:955
ScChangeActionContent ** GetContentSlots() const
Definition: chgtrack.hxx:963
bool IsProtected() const
Definition: chgtrack.hxx:1127
SCSIZE mnContentSlots
Definition: chgtrack.hxx:824
bool IsInPasteCut() const
Definition: chgtrack.hxx:970
ScChangeActionLinkEntry * pLinkInsertRow
Definition: chgtrack.hxx:844
void SetProtection(const css::uno::Sequence< sal_Int8 > &rPass)
Definition: chgtrack.hxx:1123
ScRange aInDeleteRange
Definition: chgtrack.hxx:836
ScChangeTrack(const ScChangeTrack &)=delete
bool bInDeleteUndo
Definition: chgtrack.hxx:857
ScChangeTrackMsgQueue aMsgQueue
Definition: chgtrack.hxx:830
void SetLastMerge(sal_uLong nVal)
Definition: chgtrack.hxx:888
ScDocument & rDoc
Definition: chgtrack.hxx:848
void SetFixDateTimeUTC(const DateTime &rDT)
Definition: chgtrack.hxx:984
bool HasLastCut() const
Definition: chgtrack.hxx:1053
void ResetLastCut()
Definition: chgtrack.hxx:1048
sal_uLong GetLastMerge() const
Definition: chgtrack.hxx:889
bool bInPasteCut
Definition: chgtrack.hxx:859
bool IsInDeleteUndo() const
Definition: chgtrack.hxx:969
ScChangeTrackMergeState GetMergeState() const
Definition: chgtrack.hxx:887
void SetInDelete(bool bVal)
Definition: chgtrack.hxx:877
sal_uLong nMarkLastSaved
Definition: chgtrack.hxx:851
void SetTimeNanoSeconds(bool bVal)
Definition: chgtrack.hxx:1132
ScChangeActionContent * pFirstGeneratedDelContent
Definition: chgtrack.hxx:840
const css::uno::Sequence< sal_Int8 > & GetProtection() const
Definition: chgtrack.hxx:1125
std::unique_ptr< ScChangeActionContent *[]> ppContentSlots
Definition: chgtrack.hxx:841
const ScRange & GetInDeleteRange() const
Definition: chgtrack.hxx:965
ScChangeTrack & operator=(const ScChangeTrack &)=delete
ScChangeActionMap aGeneratedMap
Definition: chgtrack.hxx:828
void SetFixDateTimeLocal(const DateTime &rDT)
Definition: chgtrack.hxx:987
bool Reject(ScChangeAction *, ScChangeActionMap *, bool bRecursion)
Definition: chgtrack.cxx:4129
bool IsTimeNanoSeconds() const
Definition: chgtrack.hxx:1133
Link< ScChangeTrack &, void > aModifiedLink
Definition: chgtrack.hxx:835
void SetUseFixDateTime(bool bVal)
Definition: chgtrack.hxx:981
ScChangeActionContent * GetFirstGenerated() const
Definition: chgtrack.hxx:952
bool IsInDeleteTop() const
Definition: chgtrack.hxx:968
const OUString & GetUser() const
Definition: chgtrack.hxx:972
void SetActionMax(sal_uLong nTempActionMax)
Definition: chgtrack.hxx:1120
std::unique_ptr< ScChangeActionMove > pLastCutMove
Definition: chgtrack.hxx:842
ScChangeActionLinkEntry * pLinkMove
Definition: chgtrack.hxx:846
sal_uLong nStartLastCut
Definition: chgtrack.hxx:852
void SetInDeleteUndo(bool bVal)
Definition: chgtrack.hxx:881
ScChangeActionMap aMap
Definition: chgtrack.hxx:827
ScChangeActionLinkEntry * pLinkInsertCol
Definition: chgtrack.hxx:843
void SetInPasteCut(bool bVal)
Definition: chgtrack.hxx:883
bool bInDeleteTop
Definition: chgtrack.hxx:858
ScChangeTrackMergeState eMergeState
Definition: chgtrack.hxx:855
ScChangeAction * GetFirst() const
Definition: chgtrack.hxx:953
ScChangeTrackMsgStack aMsgStackTmp
Definition: chgtrack.hxx:831
sal_uLong nGeneratedMin
Definition: chgtrack.hxx:850
void Init()
virtual void GetDescription(OUString &rName) override
virtual void SetValue(tools::Long nNew) override
UpdateRefMode
Definition: global.hxx:300
void * p
sal_Int64 n
void Clear(EHistoryType eHistory)
NONE
css::uno::Reference< css::animations::XAnimationNode > Clone(const css::uno::Reference< css::animations::XAnimationNode > &xSourceNode, const SdPage *pSource=nullptr, const SdPage *pTarget=nullptr)
ConfigurationHints
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
sal_uIntPtr sal_uLong
Store arbitrary cell value of any kind.
Definition: cellvalue.hxx:32
ScChangeTrackMsgType eMsgType
Definition: chgtrack.hxx:792
sal_uLong nStartAction
Definition: chgtrack.hxx:793
sal_uLong nEndAction
Definition: chgtrack.hxx:794
This is very similar to ScCellValue, except that it references the original value instead of copying ...
Definition: cellvalue.hxx:108
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17