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 
40 class ScDocument;
41 class ScFormulaCell;
42 class ScChangeAction;
43 class ScChangeTrack;
44 class ScAppOptions;
45 namespace tools { class JsonWriter; }
46 
48 {
49 private:
51  const std::set<OUString>& rUsers;
52  OUString aLastUserName;
53  sal_uInt16 nLastUserIndex;
55 
56 public:
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 
107 protected:
108 
113 
114 public:
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 )
162  pNext->ppPrev = ppPrev;
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 
177 class SAL_DLLPUBLIC_RTTI ScChangeAction
178 {
179  friend class ScChangeTrack;
180  friend class ScChangeActionIns;
181  friend class ScChangeActionDel;
182  friend class ScChangeActionMove;
183  friend class ScChangeActionContent;
184 
185  ScChangeAction( const ScChangeAction& ) = delete;
186  ScChangeAction& operator=( const ScChangeAction& ) = delete;
187 
188 protected:
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
196  ScChangeActionLinkEntry* pLinkAny; // arbitrary links
197  ScChangeActionLinkEntry* pLinkDeletedIn; // access to insert areas which were
198  // deleted or moved or rejected
199  ScChangeActionLinkEntry* pLinkDeleted; // links to deleted
200  ScChangeActionLinkEntry* pLinkDependent; // links to dependent
205 
207 
208  // only to be used in the XML import
210  const ScBigRange&,
211  const sal_uLong nAction,
212  const sal_uLong nRejectAction,
213  const ScChangeActionState eState,
214  const DateTime& aDateTime,
215  const OUString& aUser,
216  const OUString& aComment );
217 
218  // only to be used in the XML import
219  ScChangeAction( ScChangeActionType, const ScBigRange&, const sal_uLong nAction);
220 
221  OUString GetRefString(
222  const ScBigRange& rRange, const ScDocument& rDoc, bool bFlag3D = false) const;
223 
224  void SetActionNumber( sal_uLong n ) { nAction = n; }
225  void SetRejectAction( sal_uLong n ) { nRejectAction = n; }
226  void SetUser( const OUString& r );
227  void SetType( ScChangeActionType e ) { eType = e; }
228  void SetState( ScChangeActionState e ) { eState = e; }
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* );
246  void SetDeletedIn( ScChangeAction* );
247 
249  {
250  return new ScChangeActionLinkEntry(&pLinkDeleted, p);
251  }
252 
254  {
255  return new ScChangeActionLinkEntry(&pLinkDependent, p);
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*,
266  UpdateRefMode, const ScBigRange&,
267  sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz );
268 
269  void Accept();
270  virtual bool Reject(ScDocument& rDoc) = 0;
271  void RejectRestoreContents( ScChangeTrack*, SCCOL nDx, SCROW nDy );
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 
280 public:
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; }
318  ScChangeActionState GetState() const { return eState; }
319  sal_uLong GetActionNumber() const { return nAction; }
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
364 class SAL_DLLPUBLIC_RTTI ScChangeActionIns final : public ScChangeAction
365 {
366  friend class ScChangeTrack;
367 
368  bool mbEndOfList;
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 
379 public:
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
399 class SAL_DLLPUBLIC_RTTI ScChangeActionMove;
400 
402 {
403  friend class ScChangeActionDel;
404  friend class ScChangeTrack;
405 
406  short nCutOffFrom;
407  short nCutOffTo;
408 
410  ScChangeActionDelMoveEntry** ppPrevP,
411  ScChangeActionMove* pMove,
412  short nFrom, short nTo );
413 
414  inline ScChangeActionMove* GetMove();
415 
416 public:
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 
427 class ScChangeActionDel final : public ScChangeAction
428 {
429  friend class ScChangeTrack;
430  friend void ScChangeAction::Accept();
431 
433  std::vector<ScChangeActionContent*> mvCells;
434  ScChangeActionIns* pCutOff; // cut insert
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*,
449  UpdateRefMode, const ScBigRange&,
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 
456 public:
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 
490  void SetCutOffInsert( ScChangeActionIns* p, short n )
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
500 class ScChangeActionMove final : public ScChangeAction
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; }
531  sal_uLong GetEndLastCut() const { return nEndLastCut; }
532 
533  virtual void UpdateReference( const ScChangeTrack*,
534  UpdateRefMode, const ScBigRange&,
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 
541 protected:
543 
544 public:
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  const 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 
565  ScChangeActionDelMoveEntry** ppPrevP,
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 {
594 };
595 
596 class 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*,
664  UpdateRefMode, const ScBigRange&,
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 
679 protected:
681 
682 public:
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, const ScCellValue& rOldCell,
690  const ScDocument* pDoc, const OUString& sOldValue ); // to use for XML Import
691 
693  const sal_uLong nActionNumber, const ScCellValue& rNewCell,
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;
761  friend class ScChangeActionContent;
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 
770 public:
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
798 typedef std::vector<ScChangeTrackMsgInfo> ScChangeTrackMsgQueue;
799 typedef std::vector<ScChangeTrackMsgInfo> ScChangeTrackMsgStack;
800 typedef std::map<sal_uLong, ScChangeAction*> ScChangeActionMap;
801 
803 {
809 };
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 
815 class SAL_DLLPUBLIC_RTTI ScChangeTrack final : public utl::ConfigurationListener
816 {
818  friend bool ScChangeActionDel::Reject( ScDocument& pDoc );
821  friend bool ScChangeActionMove::Reject( ScDocument& pDoc );
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;
857  bool bInDeleteUndo:1;
858  bool bInDeleteTop:1;
859  bool bInPasteCut:1;
860  bool bUseFixDateTime:1;
861  bool bTimeNanoSeconds:1;
862 
863  ScChangeTrack( const ScChangeTrack& ) = delete;
864  ScChangeTrack& operator=( 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();
942 
943 public:
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 
965  const ScRange& GetInDeleteRange() const
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: */
sal_uLong nStartLastCut
Definition: chgtrack.hxx:852
ScChangeTrackMsgQueue aMsgQueue
Definition: chgtrack.hxx:830
virtual const ScChangeTrack * GetChangeTrack() const override
Definition: chgtrack.hxx:539
ScDocument & GetDocument() const
Definition: chgtrack.hxx:974
ScChangeAction * pLast
Definition: chgtrack.hxx:839
OUString GetRefString(const ScBigRange &rRange, const ScDocument &rDoc, bool bFlag3D=false) const
Definition: chgtrack.cxx:476
ConfigurationHints
const ScCellValue & GetOldCell() const
Definition: chgtrack.hxx:741
sal_uLong nLastMerge
Definition: chgtrack.hxx:854
ScChangeActionState
Definition: chgtrack.hxx:76
void SetLastMerge(sal_uLong nVal)
Definition: chgtrack.hxx:888
virtual OUString GetRefString(ScDocument &rDoc, bool bFlag3D=false) const override
Definition: chgtrack.cxx:1434
ScChangeActionType GetType() const
Definition: chgtrack.hxx:317
bool IsDialogRoot() const
Definition: chgtrack.cxx:232
void SetRejectAction(sal_uLong n)
Definition: chgtrack.hxx:225
void UndoCutOffInsert()
Definition: chgtrack.cxx:1059
void Init()
ScChangeActionContent * GetNextContent() const
Definition: chgtrack.hxx:699
std::vector< ScChangeTrackMsgInfo > ScChangeTrackMsgQueue
Definition: chgtrack.hxx:798
void RemoveAllDeletedIn()
Definition: chgtrack.cxx:334
const ScChangeActionLinkEntry * GetFirstDependentEntry() const
Definition: chgtrack.hxx:332
OUString aLastUserName
Definition: chgtrack.hxx:52
const OUString & GetUser() const
Definition: chgtrack.hxx:972
ScChangeAction * GetNext() const
Definition: chgtrack.hxx:322
void SetDateTimeUTC(const DateTime &rDT)
Definition: chgtrack.hxx:346
ScChangeTrack * pTrack
Definition: chgtrack.hxx:507
virtual void DeleteCellEntries() override
Definition: chgtrack.cxx:804
bool IsMasterDelete() const
Definition: chgtrack.cxx:273
ScChangeAction * GetLast() const
Definition: chgtrack.hxx:954
bool HasLastCut() const
Definition: chgtrack.hxx:1053
sal_uLong GetLastMerge() const
Definition: chgtrack.hxx:889
void SetMergeState(ScChangeTrackMergeState eState)
Definition: chgtrack.hxx:885
virtual void AddContent(ScChangeActionContent *) override
Definition: chgtrack.cxx:1112
void SetProtection(const css::uno::Sequence< sal_Int8 > &rPass)
Definition: chgtrack.hxx:1123
virtual ~ScChangeActionDel() override
Definition: chgtrack.cxx:789
void SetEndLastCut(sal_uLong nVal)
Definition: chgtrack.hxx:530
sal_uLong nActionMax
Definition: chgtrack.hxx:849
virtual void UpdateReference(const ScChangeTrack *, UpdateRefMode, const ScBigRange &, sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz)
Definition: chgtrack.cxx:413
void SetInDeleteRange(const ScRange &rRange)
Definition: chgtrack.hxx:875
ScChangeActionState GetState() const
Definition: chgtrack.hxx:318
friend class ScChangeActionIns
Definition: chgtrack.hxx:180
sal_uIntPtr sal_uLong
const ScChangeActionDelMoveEntry * GetNext() const
Definition: chgtrack.hxx:417
ScChangeActionDelMoveEntry * AddCutOffMove(ScChangeActionMove *pMove, short nFrom, short nTo)
Definition: chgtrack.cxx:845
ScChangeActionLinkEntry * pNext
Definition: chgtrack.hxx:109
OUString aComment
Definition: chgtrack.hxx:193
bool IsDeletedIn() const
Definition: chgtrack.cxx:317
std::unique_ptr< ScChangeActionMove > pLastCutMove
Definition: chgtrack.hxx:842
const ScChangeActionIns * GetCutOffInsert() const
Definition: chgtrack.hxx:484
ScChangeActionLinkEntry * pLinkInsertRow
Definition: chgtrack.hxx:844
sal_uLong nEndLastCut
Definition: chgtrack.hxx:853
bool IsVirgin() const
Definition: chgtrack.cxx:122
void SetComment(const OUString &rStr)
Definition: chgtrack.cxx:536
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:1979
ScCellValue maNewCell
Definition: chgtrack.hxx:601
ScChangeActionLinkEntry(const ScChangeActionLinkEntry &)=delete
ScChangeActionType
Definition: chgtrack.hxx:62
std::vector< ScChangeTrackMsgInfo > ScChangeTrackMsgStack
Definition: chgtrack.hxx:799
ScChangeActionMove(const ScRange &rFromRange, const ScRange &rToRange, ScChangeTrack *pTrackP)
Definition: chgtrack.hxx:512
ScChangeActionContent * pFirstGeneratedDelContent
Definition: chgtrack.hxx:840
bool IsInDeleteTop() const
Definition: chgtrack.hxx:968
bool IsDialogParent() const
Definition: chgtrack.cxx:237
void SetModifiedLink(const Link< ScChangeTrack &, void > &r)
Definition: chgtrack.hxx:1110
bool IsMultiDelete() const
Definition: chgtrack.cxx:822
ScChangeActionIns * pCutOff
Definition: chgtrack.hxx:434
This is very similar to ScCellValue, except that it references the original value instead of copying ...
Definition: cellvalue.hxx:103
ScChangeActionContent * pNextContent
Definition: chgtrack.hxx:605
const ScAppOptions & rOpt
Definition: chgtrack.hxx:50
virtual OUString GetDescription(ScDocument &rDoc, bool bSplitRange=false, bool bWarning=true) const
Definition: chgtrack.cxx:420
bool RemoveDeletedIn(const ScChangeAction *)
Definition: chgtrack.cxx:300
ScChangeActionLinkEntry * AddDeleted(ScChangeAction *p)
Definition: chgtrack.hxx:248
std::optional< ScChangeTrackMsgInfo > xBlockModifyMsg
Definition: chgtrack.hxx:847
sal_uLong GetActionMax() const
Definition: chgtrack.hxx:955
bool IsTimeNanoSeconds() const
Definition: chgtrack.hxx:1133
virtual ~ScChangeActionMove() override
Definition: chgtrack.cxx:1107
void UndoCutOffMoves()
Definition: chgtrack.cxx:1010
DateTime aFixDateTime
Definition: chgtrack.hxx:837
ScChangeAction * GetPrev() const
Definition: chgtrack.hxx:323
bool IsInternalRejectable() const
Definition: chgtrack.cxx:214
Store arbitrary cell value of any kind.
Definition: cellvalue.hxx:35
OUString maUser
Definition: chgtrack.hxx:834
const ScChangeActionLinkEntry * GetNext() const
Definition: chgtrack.hxx:167
friend class ScChangeActionContent
Definition: chgtrack.hxx:183
ScChangeActionLinkEntry * pLinkDeleted
Definition: chgtrack.hxx:199
ScChangeActionContentCellType
Definition: chgtrack.hxx:588
A link/connection/dependency between change actions.
Definition: chgtrack.hxx:102
virtual ScChangeActionLinkEntry * GetDeletedIn() const
Definition: chgtrack.hxx:241
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
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
ScBigRange & GetFromRange()
Definition: chgtrack.hxx:526
void SetInDelete(bool bVal)
Definition: chgtrack.hxx:877
sal_uLong nGeneratedMin
Definition: chgtrack.hxx:850
void SetInPasteCut(bool bVal)
Definition: chgtrack.hxx:883
void RemoveAllDependent()
Definition: chgtrack.cxx:397
ScActionColorChanger(const ScChangeTrack &rTrack)
Definition: output.cxx:81
SCROW mnContentRowsPerSlot
Definition: chgtrack.hxx:823
void SetDeletedInThis(sal_uLong nActionNumber, const ScChangeTrack *pTrack)
Definition: chgtrack.cxx:593
void SetFixDateTimeUTC(const DateTime &rDT)
Definition: chgtrack.hxx:984
ScChangeActionMove * GetMove()
Definition: chgtrack.hxx:576
ScChangeTrackMsgType eMsgType
Definition: chgtrack.hxx:792
ScChangeAction * GetFirst() const
Definition: chgtrack.hxx:953
bool IsTopContent() const
Definition: chgtrack.hxx:702
virtual void DeleteCellEntries() override
Definition: chgtrack.hxx:661
void AddLink(ScChangeAction *p, ScChangeActionLinkEntry *pL)
Definition: chgtrack.hxx:233
bool IsRejectable() const
Definition: chgtrack.cxx:196
void SetActionNumber(sal_uLong n)
Definition: chgtrack.hxx:224
virtual void AddContent(ScChangeActionContent *) override
Definition: chgtrack.hxx:660
virtual const ScChangeTrack * GetChangeTrack() const override
Definition: chgtrack.hxx:669
sal_uLong nEndAction
Definition: chgtrack.hxx:794
sal_uLong nRejectAction
Definition: chgtrack.hxx:202
bool IsTopDelete() const
Definition: chgtrack.cxx:814
const css::uno::Sequence< sal_Int8 > & GetProtection() const
Definition: chgtrack.hxx:1125
bool IsDeleteType() const
Definition: chgtrack.cxx:117
void SetState(ScChangeActionState e)
Definition: chgtrack.hxx:228
bool IsProtected() const
Definition: chgtrack.hxx:1127
sal_uLong nStartLastCut
Definition: chgtrack.hxx:509
SCSIZE mnContentSlots
Definition: chgtrack.hxx:824
bool HasDeleted() const
Definition: chgtrack.cxx:381
ScChangeAction & operator=(const ScChangeAction &)=delete
void SetType(ScChangeActionType e)
Definition: chgtrack.hxx:227
sal_uLong GetStartLastCut() const
Definition: chgtrack.hxx:529
ScChangeActionContent * GetFirstGenerated() const
Definition: chgtrack.hxx:952
virtual const ScChangeTrack * GetChangeTrack() const override
Definition: chgtrack.hxx:454
ScChangeActionContent * GetPrevContent() const
Definition: chgtrack.hxx:700
const ScBigRange & GetFromRange() const
Definition: chgtrack.hxx:555
ScChangeAction * pFirst
Definition: chgtrack.hxx:838
DateTime aDateTime
Definition: chgtrack.hxx:191
ScChangeTrackMergeState
Definition: chgtrack.hxx:802
SC_DLLPUBLIC bool IsAccepted() const
Definition: chgtrack.cxx:127
void InsertInSlot(ScChangeActionContent **pp)
Definition: chgtrack.hxx:610
virtual const ScChangeTrack * GetChangeTrack() const override
Definition: chgtrack.hxx:377
void SetTimeNanoSeconds(bool bVal)
Definition: chgtrack.hxx:1132
Reference< XAnimationNode > Clone(const Reference< XAnimationNode > &xSourceNode, const SdPage *pSource, const SdPage *pTarget)
ScChangeActionLinkEntry * pLinkDeletedIn
Definition: chgtrack.hxx:197
const DateTime & GetDateTimeUTC() const
Definition: chgtrack.hxx:315
ScChangeActionDelMoveEntry * pLinkMove
Definition: chgtrack.hxx:436
ScDocument & rDoc
Definition: chgtrack.hxx:848
bool IsInDeleteUndo() const
Definition: chgtrack.hxx:969
Color GetColor() const
Definition: chgtrack.hxx:59
sal_Int16 SCCOL
Definition: types.hxx:21
ScChangeActionLinkEntry & operator=(const ScChangeActionLinkEntry &)=delete
bool IsTabDeleteCol() const
Definition: chgtrack.cxx:834
const OUString & GetComment() const
Definition: chgtrack.hxx:350
ScChangeAction(const ScChangeAction &)=delete
std::vector< ScChangeActionContent * > mvCells
Definition: chgtrack.hxx:433
ScChangeAction * GetAction()
Definition: chgtrack.hxx:170
ScChangeActionMap aMap
Definition: chgtrack.hxx:827
virtual OUString GetRefString(ScDocument &rDoc, bool bFlag3D=false) const override
Definition: chgtrack.cxx:1166
void SetInDeleteUndo(bool bVal)
Definition: chgtrack.hxx:881
virtual bool Reject(ScDocument &rDoc) override
Definition: chgtrack.cxx:1988
virtual void DeleteCellEntries() override
Definition: chgtrack.hxx:764
ScBigRange & GetBigRange()
Definition: chgtrack.hxx:231
sal_uLong nEndLastCut
Definition: chgtrack.hxx:510
ScChangeActionMap aGeneratedMap
Definition: chgtrack.hxx:828
ScBigRange GetOverAllRange() const
Definition: chgtrack.cxx:890
bool IsDeletedInDelType(ScChangeActionType) const
Definition: chgtrack.cxx:344
ScChangeActionLinkEntry * pLinkInsertTab
Definition: chgtrack.hxx:845
void SetLink(ScChangeActionLinkEntry *pLinkP)
Definition: chgtrack.hxx:138
virtual ~ScChangeAction()
Definition: chgtrack.cxx:107
void ResetLastCut()
Definition: chgtrack.hxx:1048
Link< ScChangeTrack &, void > aModifiedLink
Definition: chgtrack.hxx:835
void Update(const ScChangeAction &rAction)
Definition: output.cxx:89
void SetNextContent(ScChangeActionContent *p)
Definition: chgtrack.hxx:730
void Clear(EHistoryType eHistory)
ScChangeAction * pAction
Definition: chgtrack.hxx:111
ScChangeActionContent * pPrevContent
Definition: chgtrack.hxx:606
ScChangeAction * pPrev
Definition: chgtrack.hxx:195
void SetDeletedIn(ScChangeAction *)
Definition: chgtrack.cxx:386
virtual OUString GetDescription(ScDocument &rDoc, bool bSplitRange=false, bool bWarning=true) const override
Definition: chgtrack.cxx:898
virtual void DeleteCellEntries() override
Definition: chgtrack.hxx:373
bool IsInDelete() const
Definition: chgtrack.hxx:967
bool IsRejected() const
Definition: chgtrack.cxx:132
ScBigRange aBigRange
Definition: chgtrack.hxx:190
ScChangeActionClipMode
Definition: chgtrack.hxx:83
sal_uLong GetActionNumber() const
Definition: chgtrack.hxx:319
virtual bool Reject(ScDocument &rDoc) override
Definition: chgtrack.cxx:1176
std::unique_ptr< ScChangeActionContent *[]> ppContentSlots
Definition: chgtrack.hxx:841
ScChangeActionContent ** ppPrevInSlot
Definition: chgtrack.hxx:608
UpdateRefMode
Definition: global.hxx:297
std::vector< ScChangeActionContent * > mvCells
Definition: chgtrack.hxx:508
short GetCutOffTo() const
Definition: chgtrack.hxx:424
std::map< sal_uLong, ScChangeAction * > ScChangeActionMap
Definition: chgtrack.hxx:800
sal_Int32 SCROW
Definition: types.hxx:17
ScChangeTrackMsgType
Definition: chgtrack.hxx:781
ScChangeTrackMsgStack aMsgStackFinal
Definition: chgtrack.hxx:832
ScChangeActionLinkEntry * AddDependent(ScChangeAction *p)
Definition: chgtrack.hxx:253
ScChangeActionContent * pNextInSlot
Definition: chgtrack.hxx:607
SCCOL GetDx() const
Definition: chgtrack.hxx:478
virtual void AddContent(ScChangeActionContent *) override
Definition: chgtrack.hxx:763
const ScRange & GetInDeleteRange() const
Definition: chgtrack.hxx:965
bool IsBaseDelete() const
Definition: chgtrack.cxx:809
short GetCutOffFrom() const
Definition: chgtrack.hxx:423
virtual void DeleteCellEntries() override
Definition: chgtrack.cxx:1117
ScChangeActionLinkEntry(ScChangeActionLinkEntry **ppPrevP, ScChangeAction *pActionP)
Definition: chgtrack.hxx:116
sal_uLong nAction
Definition: chgtrack.hxx:201
ScChangeActionLinkEntry * pLinkInsertCol
Definition: chgtrack.hxx:843
css::uno::Sequence< sal_Int8 > aProtectPass
Definition: chgtrack.hxx:826
ScChangeActionLinkEntry * pLink
Definition: chgtrack.hxx:112
ScChangeActionLinkEntry * GetNext()
Definition: chgtrack.hxx:168
virtual OUString GetDescription(ScDocument &rDoc, bool bSplitRange=false, bool bWarning=true) const override
Definition: chgtrack.cxx:1139
ScBigRange aFromRange
Definition: chgtrack.hxx:506
virtual void UpdateReference(const ScChangeTrack *, UpdateRefMode, const ScBigRange &, sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz) override
Definition: chgtrack.cxx:1841
std::set< OUString > maUserCollection
Definition: chgtrack.hxx:833
bool IsRejecting() const
Definition: chgtrack.cxx:137
ScChangeTrackMergeState eMergeState
Definition: chgtrack.hxx:855
bool IsVisible() const
Definition: chgtrack.cxx:142
virtual OUString GetDescription(ScDocument &rDoc, bool bSplitRange=false, bool bWarning=true) const override
Definition: chgtrack.cxx:1394
virtual bool Reject(ScDocument &rDoc) override
Definition: chgtrack.cxx:940
void SetInDeleteTop(bool bVal)
Definition: chgtrack.hxx:879
ScChangeActionLinkEntry * pLinkAny
Definition: chgtrack.hxx:196
const ScChangeActionDelMoveEntry * GetFirstMoveEntry() const
Definition: chgtrack.hxx:482
bool HasDependent() const
Definition: chgtrack.cxx:376
void * p
short GetCutOffCount() const
Definition: chgtrack.hxx:485
const ScChangeAction * GetAction() const
Definition: chgtrack.hxx:169
ScChangeActionMap aPasteCutMap
Definition: chgtrack.hxx:829
bool IsInsertType() const
Definition: chgtrack.cxx:112
virtual void AddContent(ScChangeActionContent *) override
Definition: chgtrack.hxx:372
ScChangeActionDel(const ScDocument *pDoc, const ScRange &rRange, SCCOL nDx, SCROW nDy, ScChangeTrack *)
Definition: chgtrack.cxx:734
virtual const ScChangeTrack * GetChangeTrack() const override
Definition: chgtrack.hxx:768
const std::set< OUString > & rUsers
Definition: chgtrack.hxx:51
virtual bool Reject(ScDocument &rDoc) override
Definition: chgtrack.cxx:1467
ScRange aInDeleteRange
Definition: chgtrack.hxx:836
const OUString & GetUser() const
Definition: chgtrack.hxx:349
sal_uInt16 nLastUserIndex
Definition: chgtrack.hxx:53
void SetCutOffInsert(ScChangeActionIns *p, short n)
Definition: chgtrack.hxx:490
sal_uLong GetEndLastCut() const
Definition: chgtrack.hxx:531
ScChangeActionDelMoveEntry(ScChangeActionDelMoveEntry **ppPrevP, ScChangeActionMove *pMove, short nFrom, short nTo)
Definition: chgtrack.hxx:564
const std::set< OUString > & GetUserCollection() const
Definition: chgtrack.hxx:973
void SetUser(const OUString &r)
Definition: chgtrack.cxx:531
ScChangeTrackMergeState GetMergeState() const
Definition: chgtrack.hxx:887
ScChangeActionLinkEntry * pLinkMove
Definition: chgtrack.hxx:846
void SetActionMax(sal_uLong nTempActionMax)
Definition: chgtrack.hxx:1120
virtual void UpdateReference(const ScChangeTrack *, UpdateRefMode, const ScBigRange &, sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz) override
Definition: chgtrack.cxx:1122
virtual bool Reject(ScDocument &rDoc)=0
void SetRejected()
Definition: chgtrack.cxx:555
virtual ScChangeActionLinkEntry ** GetDeletedInAddress()
Definition: chgtrack.hxx:243
void SetUseFixDateTime(bool bVal)
Definition: chgtrack.hxx:981
ScChangeTrackMsgStack aMsgStackTmp
Definition: chgtrack.hxx:831
void SetFixDateTimeLocal(const DateTime &rDT)
Definition: chgtrack.hxx:987
virtual void ConfigurationChanged(ConfigurationBroadcaster *p, ConfigurationHints nHint)=0
ScChangeActionState eState
Definition: chgtrack.hxx:204
const ScCellValue & GetNewCell() const
Definition: chgtrack.hxx:742
ScChangeActionContent * GetNextInSlot()
Definition: chgtrack.hxx:631
virtual void UpdateReference(const ScChangeTrack *, UpdateRefMode, const ScBigRange &, sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz) override
Definition: chgtrack.cxx:851
void ConvertToUTC()
SCROW GetDy() const
Definition: chgtrack.hxx:479
SC_DLLPUBLIC void GetDelta(sal_Int32 &nDx, sal_Int32 &nDy, sal_Int32 &nDz) const
Definition: chgtrack.cxx:1130
virtual ~ScChangeActionLinkEntry()
Definition: chgtrack.hxx:129
ScChangeActionType eType
Definition: chgtrack.hxx:203
const ScChangeActionLinkEntry * GetFirstDeletedEntry() const
Definition: chgtrack.hxx:330
bool IsClickable() const
Definition: chgtrack.cxx:165
sal_uLong nStartAction
Definition: chgtrack.hxx:793
void SetStartLastCut(sal_uLong nVal)
Definition: chgtrack.hxx:528
ScChangeAction * pNext
Definition: chgtrack.hxx:194
OUString aUser
UTC.
Definition: chgtrack.hxx:192
ScChangeTrack * pTrack
Definition: chgtrack.hxx:432
sal_uLong nMarkLastSaved
Definition: chgtrack.hxx:851
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
const ScBigRange & GetBigRange() const
Definition: chgtrack.hxx:313
bool IsInPasteCut() const
Definition: chgtrack.hxx:970
void RemoveAllLinks()
Definition: chgtrack.cxx:281
SC_DLLPUBLIC DateTime GetDateTime() const
Definition: chgtrack.cxx:406
const DateTime & GetFixDateTime() const
Definition: chgtrack.hxx:976
bool IsTouchable() const
Definition: chgtrack.cxx:152
sal_uLong GetRejectAction() const
Definition: chgtrack.hxx:320
ScChangeActionLinkEntry * pLinkDependent
Definition: chgtrack.hxx:200
sal_Int16 SCTAB
Definition: types.hxx:22
virtual void AddContent(ScChangeActionContent *) override
Definition: chgtrack.cxx:799
ScChangeActionLinkEntry ** ppPrev
Definition: chgtrack.hxx:110
ScChangeActionContent ** GetContentSlots() const
Definition: chgtrack.hxx:963
ScCellValue maOldCell
Definition: chgtrack.hxx:600
virtual void SetValue(tools::Long nNew) override
void SetPrevContent(ScChangeActionContent *p)
Definition: chgtrack.hxx:732
void RejectRestoreContents(ScChangeTrack *, SCCOL nDx, SCROW nDy)
Definition: chgtrack.cxx:565