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