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 void GetDescription(
340  OUString& rStr, ScDocument& rDoc,
341  bool bSplitRange = false, bool bWarning = true ) const;
342 
343  virtual void GetRefString(
344  OUString& rStr, ScDocument& rDoc, bool bFlag3D = false ) const;
345 
346  // for DocumentMerge set old date of the other
347  // action, fetched by GetDateTimeUTC
348  void SetDateTimeUTC( const DateTime& rDT )
349  { aDateTime = rDT; }
350 
351  const OUString& GetUser() const { return aUser;}
352  const OUString& GetComment() const { return aComment;}
353 
354  // set user comment
355  void SetComment( const OUString& rStr );
356 
357  // only to be used in the XML import
358  void SetDeletedInThis( sal_uLong nActionNumber,
359  const ScChangeTrack* pTrack );
360  // only to be used in the XML import
361  void AddDependent( sal_uLong nActionNumber,
362  const ScChangeTrack* pTrack );
363 };
364 
365 // ScChangeActionIns
366 class SAL_DLLPUBLIC_RTTI ScChangeActionIns : public ScChangeAction
367 {
368  friend class ScChangeTrack;
369 
370  bool mbEndOfList;
371 
372  ScChangeActionIns( const ScDocument* pDoc, const ScRange& rRange, bool bEndOfList = false );
373 
374  virtual void AddContent( ScChangeActionContent* ) override {}
375  virtual void DeleteCellEntries() override {}
376 
377  virtual bool Reject(ScDocument& rDoc) override;
378 
379  virtual const ScChangeTrack* GetChangeTrack() const override { return nullptr; }
380 
381 public:
382  virtual ~ScChangeActionIns() override;
384  const sal_uLong nActionNumber,
385  const ScChangeActionState eState,
386  const sal_uLong nRejectingNumber,
387  const ScBigRange& aBigRange,
388  const OUString& aUser,
389  const DateTime& aDateTime,
390  const OUString &sComment,
391  const ScChangeActionType eType,
392  bool bEndOfList = false );
393 
394  virtual void GetDescription(
395  OUString& rStr, ScDocument& rDoc, bool bSplitRange = false, bool bWarning = true) const override;
396 
397  SC_DLLPUBLIC bool IsEndOfList() const;
398 };
399 
400 // ScChangeActionDel
401 class SAL_DLLPUBLIC_RTTI ScChangeActionMove;
402 
404 {
405  friend class ScChangeActionDel;
406  friend class ScChangeTrack;
407 
408  short nCutOffFrom;
409  short nCutOffTo;
410 
412  ScChangeActionDelMoveEntry** ppPrevP,
413  ScChangeActionMove* pMove,
414  short nFrom, short nTo );
415 
416  inline ScChangeActionMove* GetMove();
417 
418 public:
420  {
421  return static_cast<const ScChangeActionDelMoveEntry*>(
423  }
424  inline const ScChangeActionMove* GetMove() const;
425  short GetCutOffFrom() const { return nCutOffFrom; }
426  short GetCutOffTo() const { return nCutOffTo; }
427 };
428 
429 class ScChangeActionDel final : public ScChangeAction
430 {
431  friend class ScChangeTrack;
432  friend void ScChangeAction::Accept();
433 
435  std::vector<ScChangeActionContent*> mvCells;
436  ScChangeActionIns* pCutOff; // cut insert
437  short nCutOff; // +: start -: end
441 
442  ScChangeActionDel( const ScDocument* pDoc, const ScRange& rRange, SCCOL nDx, SCROW nDy, ScChangeTrack* );
443 
444  virtual void AddContent( ScChangeActionContent* ) override;
445  virtual void DeleteCellEntries() override;
446 
447  void UndoCutOffMoves();
448  void UndoCutOffInsert();
449 
450  virtual void UpdateReference( const ScChangeTrack*,
451  UpdateRefMode, const ScBigRange&,
452  sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz ) override;
453 
454  virtual bool Reject(ScDocument& rDoc) override;
455 
456  virtual const ScChangeTrack* GetChangeTrack() const override { return pTrack; }
457 
458 public:
460  const sal_uLong nActionNumber, const ScChangeActionState eState,
461  const sal_uLong nRejectingNumber, const ScBigRange& aBigRange,
462  const OUString& aUser, const DateTime& aDateTime,
463  const OUString &sComment, const ScChangeActionType eType,
464  const SCCOLROW nD, ScChangeTrack* pTrack); // only to use in the XML import
465  // which of nDx and nDy is set is dependent on the type
466  virtual ~ScChangeActionDel() override;
467 
468  // is the last in a row (or single)
469  bool IsBaseDelete() const;
470 
471  // is the first in a row (or single)
472  bool IsTopDelete() const;
473 
474  // is part of a row
475  bool IsMultiDelete() const;
476 
477  // is col, belonging to a TabDelete
478  bool IsTabDeleteCol() const;
479 
480  SCCOL GetDx() const { return nDx; }
481  SCROW GetDy() const { return nDy; }
482  ScBigRange GetOverAllRange() const; // BigRange + (nDx, nDy)
483 
485  { return pLinkMove; }
486  const ScChangeActionIns* GetCutOffInsert() const { return pCutOff; }
487  short GetCutOffCount() const { return nCutOff; }
488 
489  virtual void GetDescription(
490  OUString& rStr, ScDocument& rDoc, bool bSplitRange = false, bool bWarning = true ) const override;
491 
492  void SetCutOffInsert( ScChangeActionIns* p, short n )
493  { pCutOff = p; nCutOff = n; } // only to use in the XML import
494  // this should be protected, but for the XML import it is public
495  // only to use in the XML import
496  // this should be protected, but for the XML import it is public
498  ScChangeActionMove* pMove, short nFrom, short nTo );
499 };
500 
501 // ScChangeActionMove
502 class ScChangeActionMove final : public ScChangeAction
503 {
504  friend class ScChangeTrack;
505  friend struct std::default_delete<ScChangeActionMove>; // for std::unique_ptr
506  friend class ScChangeActionDel;
507 
510  std::vector<ScChangeActionContent*> mvCells;
511  sal_uLong nStartLastCut; // for PasteCut undo
513 
514  ScChangeActionMove( const ScRange& rFromRange,
515  const ScRange& rToRange,
516  ScChangeTrack* pTrackP )
517  : ScChangeAction( SC_CAT_MOVE, rToRange ),
518  aFromRange( rFromRange ),
519  pTrack( pTrackP ),
520  nStartLastCut(0),
521  nEndLastCut(0)
522  {}
523  virtual ~ScChangeActionMove() override;
524 
525  virtual void AddContent( ScChangeActionContent* ) override;
526  virtual void DeleteCellEntries() override;
527 
529 
530  void SetStartLastCut( sal_uLong nVal ) { nStartLastCut = nVal; }
532  void SetEndLastCut( sal_uLong nVal ) { nEndLastCut = nVal; }
533  sal_uLong GetEndLastCut() const { return nEndLastCut; }
534 
535  virtual void UpdateReference( const ScChangeTrack*,
536  UpdateRefMode, const ScBigRange&,
537  sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz ) override;
538 
539  virtual bool Reject(ScDocument& rDoc) override;
540 
541  virtual const ScChangeTrack* GetChangeTrack() const override { return pTrack; }
542 
543 protected:
545 
546 public:
547  ScChangeActionMove(const sal_uLong nActionNumber,
549  const sal_uLong nRejectingNumber,
550  const ScBigRange& aToBigRange,
551  const OUString& aUser,
552  const DateTime& aDateTime,
553  const OUString &sComment,
554  const ScBigRange& aFromBigRange,
555  ScChangeTrack* pTrack); // only to use in the XML import
556 
557  const ScBigRange& GetFromRange() const { return aFromRange; }
558  SC_DLLPUBLIC void GetDelta( sal_Int32& nDx, sal_Int32& nDy, sal_Int32& nDz ) const;
559 
560  virtual void GetDescription(
561  OUString& rStr, ScDocument& rDoc, bool bSplitRange = false,
562  bool bWarning = true ) const override;
563 
564  virtual void GetRefString(
565  OUString& rStr, ScDocument& rDoc, bool bFlag3D = false ) const override;
566 };
567 
569  ScChangeActionDelMoveEntry** ppPrevP,
570  ScChangeActionMove* pMove,
571  short nFrom, short nTo )
573  reinterpret_cast<ScChangeActionLinkEntry**>(
574  ppPrevP),
575  static_cast<ScChangeAction*>(pMove) ),
576  nCutOffFrom( nFrom ),
577  nCutOffTo( nTo )
578 {}
579 
581  {
582  return static_cast<ScChangeActionMove*>(
584  }
585 
587  {
588  return static_cast<const ScChangeActionMove*>(
590  }
591 // ScChangeActionContent
593 {
598 };
599 
600 class SAL_DLLPUBLIC_RTTI ScChangeActionContent : public ScChangeAction
601 {
602  friend class ScChangeTrack;
603 
606 
607  OUString maOldValue;
608  OUString maNewValue;
609  ScChangeActionContent* pNextContent; // at the same position
611  ScChangeActionContent* pNextInSlot; // in the same slot
613 
615  {
616  if ( !ppPrevInSlot )
617  {
618  ppPrevInSlot = pp;
619  if ( ( pNextInSlot = *pp ) != nullptr )
620  pNextInSlot->ppPrevInSlot = &pNextInSlot;
621  *pp = this;
622  }
623  }
624 
626  {
627  if ( ppPrevInSlot )
628  {
629  if ( ( *ppPrevInSlot = pNextInSlot ) != nullptr )
630  pNextInSlot->ppPrevInSlot = ppPrevInSlot;
631  ppPrevInSlot = nullptr; // not inserted
632  }
633  }
634 
635  ScChangeActionContent* GetNextInSlot() { return pNextInSlot; }
636 
637  void ClearTrack();
638 
639  static void GetStringOfCell(
640  OUString& rStr, const ScCellValue& rCell, const ScDocument* pDoc, const ScAddress& rPos );
641 
642  static void GetStringOfCell(
643  OUString& rStr, const ScCellValue& rCell, const ScDocument* pDoc, sal_uLong nFormat );
644 
645  static void SetValue( OUString& rStr, ScCellValue& rCell, const ScAddress& rPos,
646  const ScCellValue& rOrgCell, const ScDocument* pFromDoc,
647  ScDocument* pToDoc );
648 
649  static void SetValue( OUString& rStr, ScCellValue& rCell, sal_uLong nFormat,
650  const ScCellValue& rOrgCell, const ScDocument* pFromDoc,
651  ScDocument* pToDoc );
652 
653  static void SetCell( OUString& rStr, ScCellValue& rCell, sal_uLong nFormat, const ScDocument* pDoc );
654 
655  static bool NeedsNumberFormat( const ScCellValue& rVal );
656 
657  void SetValueString( OUString& rValue, ScCellValue& rCell, const OUString& rStr, ScDocument* pDoc );
658 
659  void GetValueString( OUString& rStr, const OUString& rValue, const ScCellValue& rCell,
660  const ScDocument* pDoc ) const;
661 
662  void GetFormulaString( OUString& rStr, const ScFormulaCell* pCell ) const;
663 
664  virtual void AddContent( ScChangeActionContent* ) override {}
665  virtual void DeleteCellEntries() override {}
666 
667  virtual void UpdateReference( const ScChangeTrack*,
668  UpdateRefMode, const ScBigRange&,
669  sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz ) override;
670 
671  virtual bool Reject(ScDocument& rDoc) override;
672 
673  virtual const ScChangeTrack* GetChangeTrack() const override { return nullptr; }
674 
675  // pRejectActions!=NULL: reject actions get
676  // stacked, no SetNewValue, no Append
678  bool bOldest, ::std::stack<ScChangeActionContent*>* pRejectActions );
679 
680  void PutValueToDoc(
681  const ScCellValue& rCell, const OUString& rValue, ScDocument* pDoc, SCCOL nDx, SCROW nDy ) const;
682 
683 protected:
685 
686 public:
687  ScChangeActionContent( const ScRange& rRange );
688 
690  const sal_uLong nActionNumber, const ScChangeActionState eState,
691  const sal_uLong nRejectingNumber, const ScBigRange& aBigRange,
692  const OUString& aUser, const DateTime& aDateTime,
693  const OUString &sComment, const ScCellValue& rOldCell,
694  const ScDocument* pDoc, const OUString& sOldValue ); // to use for XML Import
695 
697  const sal_uLong nActionNumber, const ScCellValue& rNewCell,
698  const ScBigRange& aBigRange, const ScDocument* pDoc,
699  const OUString& sNewValue ); // to use for XML Import of Generated Actions
700 
701  virtual ~ScChangeActionContent() override;
702 
703  ScChangeActionContent* GetNextContent() const { return pNextContent; }
704  ScChangeActionContent* GetPrevContent() const { return pPrevContent; }
705  ScChangeActionContent* GetTopContent() const;
706  bool IsTopContent() const { return pNextContent == nullptr; }
707 
708  virtual ScChangeActionLinkEntry* GetDeletedIn() const override;
709  virtual ScChangeActionLinkEntry** GetDeletedInAddress() override;
710 
711  void PutOldValueToDoc( ScDocument*,
712  SCCOL nDx, SCROW nDy ) const;
713  void PutNewValueToDoc( ScDocument*,
714  SCCOL nDx, SCROW nDy ) const;
715 
716  void SetOldValue( const ScCellValue& rCell, const ScDocument* pFromDoc, ScDocument* pToDoc, sal_uLong nFormat );
717 
718  void SetOldValue( const ScCellValue& rCell, const ScDocument* pFromDoc, ScDocument* pToDoc );
719 
720  void SetNewValue( const ScCellValue& rCell, ScDocument* pDoc );
721 
722  // Used in import filter AppendContentOnTheFly,
723  void SetOldNewCells(
724  const ScCellValue& rOldCell, sal_uLong nOldFormat,
725  const ScCellValue& rNewCell, sal_uLong nNewFormat, const ScDocument* pDoc );
726 
727  // Use this only in the XML import,
728  // takes ownership of cell.
729  void SetNewCell(
730  const ScCellValue& rCell, const ScDocument* pDoc, const OUString& rFormatted );
731 
732  // These functions should be protected but for
733  // the XML import they are public.
735  { pNextContent = p; }
737  { pPrevContent = p; }
738 
739  // don't use:
740  // assigns string / creates formula cell
741  void SetOldValue( const OUString& rOld, ScDocument* pDoc );
742 
743  void GetOldString( OUString& rStr, const ScDocument* pDoc ) const;
744  void GetNewString( OUString& rStr, const ScDocument* pDoc ) const;
745  const ScCellValue& GetOldCell() const { return maOldCell;}
746  const ScCellValue& GetNewCell() const { return maNewCell;}
747  virtual void GetDescription(
748  OUString& rStr, ScDocument& rDoc, bool bSplitRange = false, bool bWarning = true ) const override;
749 
750  virtual void GetRefString(
751  OUString& rStr, ScDocument& rDoc, bool bFlag3D = false ) const override;
752 
753  static ScChangeActionContentCellType GetContentCellType( const ScCellValue& rCell );
754  static ScChangeActionContentCellType GetContentCellType( const ScRefCellValue& rIter );
755 
756  // NewCell
757  bool IsMatrixOrigin() const;
758  // OldCell
759  bool IsOldMatrixReference() const;
760 };
761 
762 // ScChangeActionReject
764 {
765  friend class ScChangeTrack;
766  friend class ScChangeActionContent;
767 
768  virtual void AddContent( ScChangeActionContent* ) override {}
769  virtual void DeleteCellEntries() override {}
770 
771  virtual bool Reject(ScDocument& rDoc) override;
772 
773  virtual const ScChangeTrack* GetChangeTrack() const override { return nullptr; }
774 
775 public:
776  ScChangeActionReject(const sal_uLong nActionNumber,
778  const sal_uLong nRejectingNumber,
779  const ScBigRange& aBigRange,
780  const OUString& aUser,
781  const DateTime& aDateTime,
782  const OUString &sComment); // only to use in the XML import
783 };
784 
785 // ScChangeTrack
787 {
788  NONE,
789  Append, // Actions appended
790  Remove, // Actions removed
791  Change, // Actions changed
792  Parent // became a parent (and wasn't before)
793 };
794 
796 {
800 };
801 
802 // MsgQueue for notification via ModifiedLink
803 typedef std::vector<ScChangeTrackMsgInfo> ScChangeTrackMsgQueue;
804 typedef std::vector<ScChangeTrackMsgInfo> ScChangeTrackMsgStack;
805 typedef std::map<sal_uLong, ScChangeAction*> ScChangeActionMap;
806 
808 {
814 };
815 
816 // Internally generated actions start at this value (nearly all bits set)
817 // and are decremented, to keep values in a table separated from "normal" actions.
818 #define SC_CHGTRACK_GENERATED_START (sal_uInt32(0xfffffff0))
819 
820 class SAL_DLLPUBLIC_RTTI ScChangeTrack : public utl::ConfigurationListener
821 {
823  friend bool ScChangeActionDel::Reject( ScDocument& pDoc );
826  friend bool ScChangeActionMove::Reject( ScDocument& pDoc );
827 
830 
831  css::uno::Sequence< sal_Int8 > aProtectPass;
838  std::set<OUString> maUserCollection;
839  OUString maUser;
846  std::unique_ptr<ScChangeActionContent*[]> ppContentSlots;
847  std::unique_ptr<ScChangeActionMove> pLastCutMove;
852  std::optional<ScChangeTrackMsgInfo> xBlockModifyMsg;
861  bool bInDelete:1;
862  bool bInDeleteUndo:1;
863  bool bInDeleteTop:1;
864  bool bInPasteCut:1;
865  bool bUseFixDateTime:1;
866  bool bTimeNanoSeconds:1;
867 
868  ScChangeTrack( const ScChangeTrack& ) = delete;
869  ScChangeTrack& operator=( const ScChangeTrack& ) = delete;
870 
871  SCROW InitContentRowsPerSlot();
872 
873  // true if one is ScMatrixMode::Formula and the other is
874  // not, or if both are and range differs
875  static bool IsMatrixFormulaRangeDifferent(
876  const ScCellValue& rOldCell, const ScCellValue& rNewCell );
877 
878  void Init();
879  void DtorClear();
880  void SetInDeleteRange( const ScRange& rRange )
881  { aInDeleteRange = rRange; }
882  void SetInDelete( bool bVal )
883  { bInDelete = bVal; }
884  void SetInDeleteTop( bool bVal )
885  { bInDeleteTop = bVal; }
886  void SetInDeleteUndo( bool bVal )
887  { bInDeleteUndo = bVal; }
888  void SetInPasteCut( bool bVal )
889  { bInPasteCut = bVal; }
891  { eMergeState = eState; }
892  ScChangeTrackMergeState GetMergeState() const { return eMergeState; }
893  void SetLastMerge( sal_uLong nVal ) { nLastMerge = nVal; }
894  sal_uLong GetLastMerge() const { return nLastMerge; }
895 
896  void SetLastCutMoveRange( const ScRange&, ScDocument* );
897 
898  // create block of ModifyMsg
899  void StartBlockModify( ScChangeTrackMsgType,
900  sal_uLong nStartAction );
901  void EndBlockModify( sal_uLong nEndAction );
902 
903  void AddDependentWithNotify( ScChangeAction* pParent,
904  ScChangeAction* pDependent );
905 
906  void Dependencies( ScChangeAction* );
907  void UpdateReference( ScChangeAction*, bool bUndo );
908  void UpdateReference( ScChangeAction** ppFirstAction, ScChangeAction* pAct, bool bUndo );
909  void Append( ScChangeAction* pAppend, sal_uLong nAction );
910  SC_DLLPUBLIC void AppendDeleteRange( const ScRange&,
911  ScDocument* pRefDoc, SCTAB nDz,
912  sal_uLong nRejectingInsert );
913  void AppendOneDeleteRange( const ScRange& rOrgRange,
914  ScDocument* pRefDoc,
915  SCCOL nDx, SCROW nDy, SCTAB nDz,
916  sal_uLong nRejectingInsert );
917  void LookUpContents( const ScRange& rOrgRange,
918  ScDocument* pRefDoc,
919  SCCOL nDx, SCROW nDy, SCTAB nDz );
920  void Remove( ScChangeAction* );
921  void MasterLinks( ScChangeAction* );
922 
923  // Content on top at Position
924  ScChangeActionContent* SearchContentAt( const ScBigAddress&,
925  const ScChangeAction* pButNotThis ) const;
926  void DeleteGeneratedDelContent(
928 
929  ScChangeActionContent* GenerateDelContent(
930  const ScAddress& rPos, const ScCellValue& rCell, const ScDocument* pFromDoc );
931 
932  void DeleteCellEntries(
933  std::vector<ScChangeActionContent*>&,
934  const ScChangeAction* pDeletor );
935 
936  // Reject action and all dependent actions,
937  // Table stems from previous GetDependents,
938  // only needed for Insert and Move (MasterType),
939  // is NULL otherwise.
940  // bRecursion == called from reject with table
941  bool Reject( ScChangeAction*, ScChangeActionMap*, bool bRecursion );
942 
943  bool IsLastAction( sal_uLong nNum ) const;
944 
945  void ClearMsgQueue();
947 
948 public:
949 
950  SCSIZE ComputeContentSlot( sal_Int32 nRow ) const;
951 
953  ScChangeTrack(ScDocument& rDocP, const std::set<OUString>& aTempUserCollection); // only to use in the XML import
954  SC_DLLPUBLIC virtual ~ScChangeTrack() override;
955  void Clear();
956 
957  ScChangeActionContent* GetFirstGenerated() const { return pFirstGeneratedDelContent; }
958  ScChangeAction* GetFirst() const { return pFirst; }
959  ScChangeAction* GetLast() const { return pLast; }
960  sal_uLong GetActionMax() const { return nActionMax; }
961  bool IsGenerated( sal_uLong nAction ) const;
962  SC_DLLPUBLIC ScChangeAction* GetAction( sal_uLong nAction ) const;
963  ScChangeAction* GetGenerated( sal_uLong nGenerated ) const;
964  ScChangeAction* GetActionOrGenerated( sal_uLong nAction ) const;
965  sal_uLong GetLastSavedActionNumber() const;
966  void SetLastSavedActionNumber(sal_uLong nNew);
967  ScChangeAction* GetLastSaved() const;
968  ScChangeActionContent** GetContentSlots() const { return ppContentSlots.get(); }
969 
970  const ScRange& GetInDeleteRange() const
971  { return aInDeleteRange; }
972  bool IsInDelete() const { return bInDelete; }
973  bool IsInDeleteTop() const { return bInDeleteTop; }
974  bool IsInDeleteUndo() const { return bInDeleteUndo; }
975  bool IsInPasteCut() const { return bInPasteCut; }
976  SC_DLLPUBLIC void SetUser( const OUString& rUser );
977  const OUString& GetUser() const { return maUser;}
978  const std::set<OUString>& GetUserCollection() const { return maUserCollection;}
979  ScDocument& GetDocument() const { return rDoc; }
980  // for import filter
981  const DateTime& GetFixDateTime() const { return aFixDateTime; }
982 
983  // set this if the date/time set with
984  // SetFixDateTime...() shall be applied to
985  // appended actions
986  void SetUseFixDateTime( bool bVal )
987  { bUseFixDateTime = bVal; }
988  // for MergeDocument, apply original date/time as UTC
989  void SetFixDateTimeUTC( const DateTime& rDT )
990  { aFixDateTime = rDT; }
991  // for import filter, apply original date/time as local time
992  void SetFixDateTimeLocal( const DateTime& rDT )
993  { aFixDateTime = rDT; aFixDateTime.ConvertToUTC(); }
994 
995  void Append( ScChangeAction* );
996 
997  // pRefDoc may be NULL => no lookup of contents
998  // => no generation of deleted contents
999  SC_DLLPUBLIC void AppendDeleteRange( const ScRange&,
1000  ScDocument* pRefDoc,
1001  sal_uLong& nStartAction, sal_uLong& nEndAction,
1002  SCTAB nDz = 0 );
1003  // nDz: multi TabDel, LookUpContent must be searched
1004  // with an offset of -nDz
1005 
1006  // after new value was set in the document,
1007  // old value from RefDoc/UndoDoc
1008  void AppendContent( const ScAddress& rPos,
1009  const ScDocument* pRefDoc );
1010  // after new values were set in the document,
1011  // old values from RefDoc/UndoDoc
1012  void AppendContentRange( const ScRange& rRange,
1013  ScDocument* pRefDoc,
1014  sal_uLong& nStartAction, sal_uLong& nEndAction,
1016  // after new value was set in the document,
1017  // old value from pOldCell, nOldFormat,
1018  // RefDoc==NULL => Doc
1019  void AppendContent( const ScAddress& rPos, const ScCellValue& rOldCell,
1020  sal_uLong nOldFormat, ScDocument* pRefDoc = nullptr );
1021  // after new value was set in the document,
1022  // old value from pOldCell, format from Doc
1023  SC_DLLPUBLIC void AppendContent( const ScAddress& rPos, const ScCellValue& rOldCell );
1024  // after new values were set in the document,
1025  // old values from RefDoc/UndoDoc.
1026  // All contents with a cell in RefDoc
1027  void AppendContentsIfInRefDoc( ScDocument& rRefDoc,
1028  sal_uLong& nStartAction, sal_uLong& nEndAction );
1029 
1030  // Meant for import filter, creates and inserts
1031  // an unconditional content action of the two
1032  // cells without querying the document, not
1033  // even for number formats (though the number
1034  // formatter of the document may be used).
1035  // The action is returned and may be used to
1036  // set user name, description, date/time et al.
1037  // Takes ownership of the cells!
1038  SC_DLLPUBLIC ScChangeActionContent* AppendContentOnTheFly(
1039  const ScAddress& rPos, const ScCellValue& rOldCell, const ScCellValue& rNewCell,
1040  sal_uLong nOldFormat = 0, sal_uLong nNewFormat = 0 );
1041 
1042  // Only use the following two if there is no different solution! (Assign
1043  // string for NewValue or creation of a formula respectively)
1044 
1045  SC_DLLPUBLIC void AppendInsert( const ScRange& rRange, bool bEndOfList = false );
1046 
1047  // pRefDoc may be NULL => no lookup of contents
1048  // => no generation of deleted contents
1049  SC_DLLPUBLIC void AppendMove( const ScRange& rFromRange, const ScRange& rToRange,
1050  ScDocument* pRefDoc );
1051 
1052  // Cut to Clipboard
1054  {
1055  nStartLastCut = nEndLastCut = 0;
1056  pLastCutMove.reset();
1057  }
1058  bool HasLastCut() const
1059  {
1060  return nEndLastCut > 0 &&
1061  nStartLastCut <= nEndLastCut &&
1062  pLastCutMove;
1063  }
1064 
1065  SC_DLLPUBLIC void Undo( sal_uLong nStartAction, sal_uLong nEndAction, bool bMerge = false );
1066 
1067  // adjust references for MergeDocument
1070  void MergePrepare( const ScChangeAction* pFirstMerge, bool bShared );
1071  void MergeOwn( ScChangeAction* pAct, sal_uLong nFirstMerge, bool bShared );
1072  static bool MergeIgnore( const ScChangeAction&, sal_uLong nFirstMerge );
1073 
1074  // This comment was already really strange in German.
1075  // Tried to structure it a little. Hope no information got lost...
1076  //
1077  // Insert dependents into table.
1078  // ScChangeAction is
1079  // - "Insert": really dependents
1080  // - "Move": dependent contents in FromRange /
1081  // deleted contents in ToRange
1082  // OR inserts in FromRange or ToRange
1083  // - "Delete": a list of deleted (what?)
1084  // OR for content, different contents at the same position
1085  // OR MatrixReferences belonging to MatrixOrigin
1086 
1087  // With bListMasterDelete (==TRUE ?) all Deletes of a row belonging
1088  // to a MasterDelete are listed (possibly it is
1089  // "all Deletes belonging...are listed in a row?)
1090 
1091  // With bAllFlat (==TRUE ?) all dependents of dependents
1092  // will be inserted flatly.
1093 
1094  SC_DLLPUBLIC void GetDependents(
1095  ScChangeAction*, ScChangeActionMap&, bool bListMasterDelete = false, bool bAllFlat = false ) const;
1096 
1097  // Reject visible action (and dependents)
1098  bool Reject( ScChangeAction*, bool bShared = false );
1099 
1100  // Accept visible action (and dependents)
1101  SC_DLLPUBLIC bool Accept( ScChangeAction* );
1102 
1103  void AcceptAll(); // all Virgins
1104  bool RejectAll(); // all Virgins
1105 
1106  // Selects a content of several contents at the same
1107  // position and accepts this one and
1108  // the older ones, rejects the more recent ones.
1109  // If bOldest==TRUE then the first OldValue
1110  // of a Virgin-Content-List will be restored.
1111  bool SelectContent( ScChangeAction*, bool bOldest = false );
1112 
1113  // If ModifiedLink is set, changes go to
1114  // ScChangeTrackMsgQueue
1116  { aModifiedLink = r; ClearMsgQueue(); }
1117  ScChangeTrackMsgQueue& GetMsgQueue();
1118 
1119  void NotifyModified( ScChangeTrackMsgType eMsgType,
1120  sal_uLong nStartAction, sal_uLong nEndAction );
1121 
1122  sal_uLong AddLoadedGenerated( const ScCellValue& rNewCell,
1123  const ScBigRange& aBigRange, const OUString& sNewValue ); // only to use in the XML import
1124  void AppendLoaded( std::unique_ptr<ScChangeAction> pAppend ); // this is only for the XML import public, it should be protected
1125  void SetActionMax(sal_uLong nTempActionMax)
1126  { nActionMax = nTempActionMax; } // only to use in the XML import
1127 
1128  void SetProtection( const css::uno::Sequence< sal_Int8 >& rPass )
1129  { aProtectPass = rPass; }
1130  const css::uno::Sequence< sal_Int8 >& GetProtection() const
1131  { return aProtectPass; }
1132  bool IsProtected() const { return aProtectPass.hasElements(); }
1133 
1134  // If time stamps of actions of this
1135  // ChangeTrack and a second one are to be
1136  // compared including nanoseconds.
1137  void SetTimeNanoSeconds( bool bVal ) { bTimeNanoSeconds = bVal; }
1138  bool IsTimeNanoSeconds() const { return bTimeNanoSeconds; }
1139 
1140  void AppendCloned( ScChangeAction* pAppend );
1141  SC_DLLPUBLIC ScChangeTrack* Clone( ScDocument* pDocument ) const;
1142  static void MergeActionState( ScChangeAction* pAct, const ScChangeAction* pOtherAct );
1144  void GetChangeTrackInfo(tools::JsonWriter&);
1145 };
1146 
1147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uLong nStartLastCut
Definition: chgtrack.hxx:857
ScChangeTrackMsgQueue aMsgQueue
Definition: chgtrack.hxx:835
virtual const ScChangeTrack * GetChangeTrack() const override
Definition: chgtrack.hxx:541
ScDocument & GetDocument() const
Definition: chgtrack.hxx:979
ScChangeAction * pLast
Definition: chgtrack.hxx:844
OUString GetRefString(const ScBigRange &rRange, const ScDocument &rDoc, bool bFlag3D=false) const
Definition: chgtrack.cxx:496
ConfigurationHints
const ScCellValue & GetOldCell() const
Definition: chgtrack.hxx:745
sal_uLong nLastMerge
Definition: chgtrack.hxx:859
ScChangeActionState
Definition: chgtrack.hxx:76
virtual void GetRefString(OUString &rStr, ScDocument &rDoc, bool bFlag3D=false) const override
Definition: chgtrack.cxx:1195
void SetLastMerge(sal_uLong nVal)
Definition: chgtrack.hxx:893
ScChangeActionType GetType() const
Definition: chgtrack.hxx:317
bool IsDialogRoot() const
Definition: chgtrack.cxx:231
void SetRejectAction(sal_uLong n)
Definition: chgtrack.hxx:225
void UndoCutOffInsert()
Definition: chgtrack.cxx:1088
void Init()
ScChangeActionContent * GetNextContent() const
Definition: chgtrack.hxx:703
std::vector< ScChangeTrackMsgInfo > ScChangeTrackMsgQueue
Definition: chgtrack.hxx:803
void RemoveAllDeletedIn()
Definition: chgtrack.cxx:333
const ScChangeActionLinkEntry * GetFirstDependentEntry() const
Definition: chgtrack.hxx:332
OUString aLastUserName
Definition: chgtrack.hxx:52
const OUString & GetUser() const
Definition: chgtrack.hxx:977
ScChangeAction * GetNext() const
Definition: chgtrack.hxx:322
void SetDateTimeUTC(const DateTime &rDT)
Definition: chgtrack.hxx:348
ScChangeTrack * pTrack
Definition: chgtrack.hxx:509
virtual void DeleteCellEntries() override
Definition: chgtrack.cxx:828
bool IsMasterDelete() const
Definition: chgtrack.cxx:272
ScChangeAction * GetLast() const
Definition: chgtrack.hxx:959
bool HasLastCut() const
Definition: chgtrack.hxx:1058
sal_uLong GetLastMerge() const
Definition: chgtrack.hxx:894
void SetMergeState(ScChangeTrackMergeState eState)
Definition: chgtrack.hxx:890
virtual void AddContent(ScChangeActionContent *) override
Definition: chgtrack.cxx:1141
void SetProtection(const css::uno::Sequence< sal_Int8 > &rPass)
Definition: chgtrack.hxx:1128
virtual ~ScChangeActionDel() override
Definition: chgtrack.cxx:813
void SetEndLastCut(sal_uLong nVal)
Definition: chgtrack.hxx:532
sal_uLong nActionMax
Definition: chgtrack.hxx:854
virtual void UpdateReference(const ScChangeTrack *, UpdateRefMode, const ScBigRange &, sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz)
Definition: chgtrack.cxx:412
void SetInDeleteRange(const ScRange &rRange)
Definition: chgtrack.hxx:880
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:419
ScChangeActionDelMoveEntry * AddCutOffMove(ScChangeActionMove *pMove, short nFrom, short nTo)
Definition: chgtrack.cxx:869
ScChangeActionLinkEntry * pNext
Definition: chgtrack.hxx:109
OUString aComment
Definition: chgtrack.hxx:193
bool IsDeletedIn() const
Definition: chgtrack.cxx:316
std::unique_ptr< ScChangeActionMove > pLastCutMove
Definition: chgtrack.hxx:847
const ScChangeActionIns * GetCutOffInsert() const
Definition: chgtrack.hxx:486
ScChangeActionLinkEntry * pLinkInsertRow
Definition: chgtrack.hxx:849
sal_uLong nEndLastCut
Definition: chgtrack.hxx:858
bool IsVirgin() const
Definition: chgtrack.cxx:121
void SetComment(const OUString &rStr)
Definition: chgtrack.cxx:556
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:2017
ScCellValue maNewCell
Definition: chgtrack.hxx:605
ScChangeActionLinkEntry(const ScChangeActionLinkEntry &)=delete
ScChangeActionType
Definition: chgtrack.hxx:62
std::vector< ScChangeTrackMsgInfo > ScChangeTrackMsgStack
Definition: chgtrack.hxx:804
ScChangeActionMove(const ScRange &rFromRange, const ScRange &rToRange, ScChangeTrack *pTrackP)
Definition: chgtrack.hxx:514
ScChangeActionContent * pFirstGeneratedDelContent
Definition: chgtrack.hxx:845
bool IsInDeleteTop() const
Definition: chgtrack.hxx:973
bool IsDialogParent() const
Definition: chgtrack.cxx:236
void SetModifiedLink(const Link< ScChangeTrack &, void > &r)
Definition: chgtrack.hxx:1115
bool IsMultiDelete() const
Definition: chgtrack.cxx:846
ScChangeActionIns * pCutOff
Definition: chgtrack.hxx:436
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:609
const ScAppOptions & rOpt
Definition: chgtrack.hxx:50
bool RemoveDeletedIn(const ScChangeAction *)
Definition: chgtrack.cxx:299
ScChangeActionLinkEntry * AddDeleted(ScChangeAction *p)
Definition: chgtrack.hxx:248
std::optional< ScChangeTrackMsgInfo > xBlockModifyMsg
Definition: chgtrack.hxx:852
sal_uLong GetActionMax() const
Definition: chgtrack.hxx:960
bool IsTimeNanoSeconds() const
Definition: chgtrack.hxx:1138
virtual ~ScChangeActionMove() override
Definition: chgtrack.cxx:1136
void UndoCutOffMoves()
Definition: chgtrack.cxx:1039
DateTime aFixDateTime
Definition: chgtrack.hxx:842
ScChangeAction * GetPrev() const
Definition: chgtrack.hxx:323
bool IsInternalRejectable() const
Definition: chgtrack.cxx:213
Store arbitrary cell value of any kind.
Definition: cellvalue.hxx:35
virtual void GetDescription(OUString &rStr, ScDocument &rDoc, bool bSplitRange=false, bool bWarning=true) const
Definition: chgtrack.cxx:419
OUString maUser
Definition: chgtrack.hxx:839
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:592
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:528
void SetInDelete(bool bVal)
Definition: chgtrack.hxx:882
sal_uLong nGeneratedMin
Definition: chgtrack.hxx:855
void SetInPasteCut(bool bVal)
Definition: chgtrack.hxx:888
void RemoveAllDependent()
Definition: chgtrack.cxx:396
ScActionColorChanger(const ScChangeTrack &rTrack)
Definition: output.cxx:81
SCROW mnContentRowsPerSlot
Definition: chgtrack.hxx:828
void SetDeletedInThis(sal_uLong nActionNumber, const ScChangeTrack *pTrack)
Definition: chgtrack.cxx:614
void SetFixDateTimeUTC(const DateTime &rDT)
Definition: chgtrack.hxx:989
ScChangeActionMove * GetMove()
Definition: chgtrack.hxx:580
ScChangeTrackMsgType eMsgType
Definition: chgtrack.hxx:797
ScChangeAction * GetFirst() const
Definition: chgtrack.hxx:958
bool IsTopContent() const
Definition: chgtrack.hxx:706
virtual void DeleteCellEntries() override
Definition: chgtrack.hxx:665
void AddLink(ScChangeAction *p, ScChangeActionLinkEntry *pL)
Definition: chgtrack.hxx:233
bool IsRejectable() const
Definition: chgtrack.cxx:195
virtual void GetDescription(OUString &rStr, ScDocument &rDoc, bool bSplitRange=false, bool bWarning=true) const override
Definition: chgtrack.cxx:1425
void SetActionNumber(sal_uLong n)
Definition: chgtrack.hxx:224
virtual void AddContent(ScChangeActionContent *) override
Definition: chgtrack.hxx:664
virtual const ScChangeTrack * GetChangeTrack() const override
Definition: chgtrack.hxx:673
sal_uLong nEndAction
Definition: chgtrack.hxx:799
sal_uLong nRejectAction
Definition: chgtrack.hxx:202
bool IsTopDelete() const
Definition: chgtrack.cxx:838
const css::uno::Sequence< sal_Int8 > & GetProtection() const
Definition: chgtrack.hxx:1130
bool IsDeleteType() const
Definition: chgtrack.cxx:116
void SetState(ScChangeActionState e)
Definition: chgtrack.hxx:228
bool IsProtected() const
Definition: chgtrack.hxx:1132
sal_uLong nStartLastCut
Definition: chgtrack.hxx:511
SCSIZE mnContentSlots
Definition: chgtrack.hxx:829
bool HasDeleted() const
Definition: chgtrack.cxx:380
ScChangeAction & operator=(const ScChangeAction &)=delete
void SetType(ScChangeActionType e)
Definition: chgtrack.hxx:227
sal_uLong GetStartLastCut() const
Definition: chgtrack.hxx:531
ScChangeActionContent * GetFirstGenerated() const
Definition: chgtrack.hxx:957
virtual const ScChangeTrack * GetChangeTrack() const override
Definition: chgtrack.hxx:456
ScChangeActionContent * GetPrevContent() const
Definition: chgtrack.hxx:704
const ScBigRange & GetFromRange() const
Definition: chgtrack.hxx:557
ScChangeAction * pFirst
Definition: chgtrack.hxx:843
DateTime aDateTime
Definition: chgtrack.hxx:191
ScChangeTrackMergeState
Definition: chgtrack.hxx:807
SC_DLLPUBLIC bool IsAccepted() const
Definition: chgtrack.cxx:126
void InsertInSlot(ScChangeActionContent **pp)
Definition: chgtrack.hxx:614
virtual const ScChangeTrack * GetChangeTrack() const override
Definition: chgtrack.hxx:379
void SetTimeNanoSeconds(bool bVal)
Definition: chgtrack.hxx:1137
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:438
ScDocument & rDoc
Definition: chgtrack.hxx:853
bool IsInDeleteUndo() const
Definition: chgtrack.hxx:974
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:858
const OUString & GetComment() const
Definition: chgtrack.hxx:352
ScChangeAction(const ScChangeAction &)=delete
std::vector< ScChangeActionContent * > mvCells
Definition: chgtrack.hxx:435
ScChangeAction * GetAction()
Definition: chgtrack.hxx:170
ScChangeActionMap aMap
Definition: chgtrack.hxx:832
void SetInDeleteUndo(bool bVal)
Definition: chgtrack.hxx:886
virtual bool Reject(ScDocument &rDoc) override
Definition: chgtrack.cxx:2026
virtual void DeleteCellEntries() override
Definition: chgtrack.hxx:769
ScBigRange & GetBigRange()
Definition: chgtrack.hxx:231
sal_uLong nEndLastCut
Definition: chgtrack.hxx:512
ScChangeActionMap aGeneratedMap
Definition: chgtrack.hxx:833
ScBigRange GetOverAllRange() const
Definition: chgtrack.cxx:914
bool IsDeletedInDelType(ScChangeActionType) const
Definition: chgtrack.cxx:343
ScChangeActionLinkEntry * pLinkInsertTab
Definition: chgtrack.hxx:850
void SetLink(ScChangeActionLinkEntry *pLinkP)
Definition: chgtrack.hxx:138
virtual void GetDescription(OUString &rStr, ScDocument &rDoc, bool bSplitRange=false, bool bWarning=true) const override
Definition: chgtrack.cxx:922
virtual ~ScChangeAction()
Definition: chgtrack.cxx:106
void ResetLastCut()
Definition: chgtrack.hxx:1053
Link< ScChangeTrack &, void > aModifiedLink
Definition: chgtrack.hxx:840
void Update(const ScChangeAction &rAction)
Definition: output.cxx:89
void SetNextContent(ScChangeActionContent *p)
Definition: chgtrack.hxx:734
ScChangeAction * pAction
Definition: chgtrack.hxx:111
virtual void GetRefString(OUString &rStr, ScDocument &rDoc, bool bFlag3D=false) const override
Definition: chgtrack.cxx:1466
ScChangeActionContent * pPrevContent
Definition: chgtrack.hxx:610
ScChangeAction * pPrev
Definition: chgtrack.hxx:195
void SetDeletedIn(ScChangeAction *)
Definition: chgtrack.cxx:385
virtual void DeleteCellEntries() override
Definition: chgtrack.hxx:375
bool IsInDelete() const
Definition: chgtrack.hxx:972
bool IsRejected() const
Definition: chgtrack.cxx:131
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:1207
std::unique_ptr< ScChangeActionContent *[]> ppContentSlots
Definition: chgtrack.hxx:846
ScChangeActionContent ** ppPrevInSlot
Definition: chgtrack.hxx:612
UpdateRefMode
Definition: global.hxx:309
std::vector< ScChangeActionContent * > mvCells
Definition: chgtrack.hxx:510
short GetCutOffTo() const
Definition: chgtrack.hxx:426
std::map< sal_uLong, ScChangeAction * > ScChangeActionMap
Definition: chgtrack.hxx:805
sal_Int32 SCROW
Definition: types.hxx:17
ScChangeTrackMsgType
Definition: chgtrack.hxx:786
ScChangeTrackMsgStack aMsgStackFinal
Definition: chgtrack.hxx:837
ScChangeActionLinkEntry * AddDependent(ScChangeAction *p)
Definition: chgtrack.hxx:253
ScChangeActionContent * pNextInSlot
Definition: chgtrack.hxx:611
SCCOL GetDx() const
Definition: chgtrack.hxx:480
virtual void AddContent(ScChangeActionContent *) override
Definition: chgtrack.hxx:768
const ScRange & GetInDeleteRange() const
Definition: chgtrack.hxx:970
bool IsBaseDelete() const
Definition: chgtrack.cxx:833
short GetCutOffFrom() const
Definition: chgtrack.hxx:425
virtual void DeleteCellEntries() override
Definition: chgtrack.cxx:1146
ScChangeActionLinkEntry(ScChangeActionLinkEntry **ppPrevP, ScChangeAction *pActionP)
Definition: chgtrack.hxx:116
virtual void GetDescription(OUString &rStr, ScDocument &rDoc, bool bSplitRange=false, bool bWarning=true) const override
Definition: chgtrack.cxx:1168
sal_uLong nAction
Definition: chgtrack.hxx:201
ScChangeActionLinkEntry * pLinkInsertCol
Definition: chgtrack.hxx:848
css::uno::Sequence< sal_Int8 > aProtectPass
Definition: chgtrack.hxx:831
ScChangeActionLinkEntry * pLink
Definition: chgtrack.hxx:112
ScChangeActionLinkEntry * GetNext()
Definition: chgtrack.hxx:168
ScBigRange aFromRange
Definition: chgtrack.hxx:508
virtual void UpdateReference(const ScChangeTrack *, UpdateRefMode, const ScBigRange &, sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz) override
Definition: chgtrack.cxx:1879
std::set< OUString > maUserCollection
Definition: chgtrack.hxx:838
bool IsRejecting() const
Definition: chgtrack.cxx:136
ScChangeTrackMergeState eMergeState
Definition: chgtrack.hxx:860
bool IsVisible() const
Definition: chgtrack.cxx:141
virtual bool Reject(ScDocument &rDoc) override
Definition: chgtrack.cxx:969
void SetInDeleteTop(bool bVal)
Definition: chgtrack.hxx:884
ScChangeActionLinkEntry * pLinkAny
Definition: chgtrack.hxx:196
const ScChangeActionDelMoveEntry * GetFirstMoveEntry() const
Definition: chgtrack.hxx:484
bool HasDependent() const
Definition: chgtrack.cxx:375
void * p
short GetCutOffCount() const
Definition: chgtrack.hxx:487
const ScChangeAction * GetAction() const
Definition: chgtrack.hxx:169
ScChangeActionMap aPasteCutMap
Definition: chgtrack.hxx:834
bool IsInsertType() const
Definition: chgtrack.cxx:111
virtual void AddContent(ScChangeActionContent *) override
Definition: chgtrack.hxx:374
ScChangeActionDel(const ScDocument *pDoc, const ScRange &rRange, SCCOL nDx, SCROW nDy, ScChangeTrack *)
Definition: chgtrack.cxx:758
virtual const ScChangeTrack * GetChangeTrack() const override
Definition: chgtrack.hxx:773
const std::set< OUString > & rUsers
Definition: chgtrack.hxx:51
virtual bool Reject(ScDocument &rDoc) override
Definition: chgtrack.cxx:1500
ScRange aInDeleteRange
Definition: chgtrack.hxx:841
const OUString & GetUser() const
Definition: chgtrack.hxx:351
sal_uInt16 nLastUserIndex
Definition: chgtrack.hxx:53
void SetCutOffInsert(ScChangeActionIns *p, short n)
Definition: chgtrack.hxx:492
sal_uLong GetEndLastCut() const
Definition: chgtrack.hxx:533
ScChangeActionDelMoveEntry(ScChangeActionDelMoveEntry **ppPrevP, ScChangeActionMove *pMove, short nFrom, short nTo)
Definition: chgtrack.hxx:568
const std::set< OUString > & GetUserCollection() const
Definition: chgtrack.hxx:978
void SetUser(const OUString &r)
Definition: chgtrack.cxx:551
ScChangeTrackMergeState GetMergeState() const
Definition: chgtrack.hxx:892
ScChangeActionLinkEntry * pLinkMove
Definition: chgtrack.hxx:851
void SetActionMax(sal_uLong nTempActionMax)
Definition: chgtrack.hxx:1125
virtual void UpdateReference(const ScChangeTrack *, UpdateRefMode, const ScBigRange &, sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz) override
Definition: chgtrack.cxx:1151
virtual bool Reject(ScDocument &rDoc)=0
void SetRejected()
Definition: chgtrack.cxx:576
virtual ScChangeActionLinkEntry ** GetDeletedInAddress()
Definition: chgtrack.hxx:243
void SetUseFixDateTime(bool bVal)
Definition: chgtrack.hxx:986
ScChangeTrackMsgStack aMsgStackTmp
Definition: chgtrack.hxx:836
void SetFixDateTimeLocal(const DateTime &rDT)
Definition: chgtrack.hxx:992
virtual void ConfigurationChanged(ConfigurationBroadcaster *p, ConfigurationHints nHint)=0
ScChangeActionState eState
Definition: chgtrack.hxx:204
const ScCellValue & GetNewCell() const
Definition: chgtrack.hxx:746
ScChangeActionContent * GetNextInSlot()
Definition: chgtrack.hxx:635
virtual void UpdateReference(const ScChangeTrack *, UpdateRefMode, const ScBigRange &, sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz) override
Definition: chgtrack.cxx:875
void ConvertToUTC()
SCROW GetDy() const
Definition: chgtrack.hxx:481
SC_DLLPUBLIC void GetDelta(sal_Int32 &nDx, sal_Int32 &nDy, sal_Int32 &nDz) const
Definition: chgtrack.cxx:1159
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:164
sal_uLong nStartAction
Definition: chgtrack.hxx:798
void SetStartLastCut(sal_uLong nVal)
Definition: chgtrack.hxx:530
ScChangeAction * pNext
Definition: chgtrack.hxx:194
OUString aUser
UTC.
Definition: chgtrack.hxx:192
ScChangeTrack * pTrack
Definition: chgtrack.hxx:434
sal_uLong nMarkLastSaved
Definition: chgtrack.hxx:856
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
const ScBigRange & GetBigRange() const
Definition: chgtrack.hxx:313
bool IsInPasteCut() const
Definition: chgtrack.hxx:975
void RemoveAllLinks()
Definition: chgtrack.cxx:280
SC_DLLPUBLIC DateTime GetDateTime() const
Definition: chgtrack.cxx:405
const DateTime & GetFixDateTime() const
Definition: chgtrack.hxx:981
bool IsTouchable() const
Definition: chgtrack.cxx:151
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:823
ScChangeActionLinkEntry ** ppPrev
Definition: chgtrack.hxx:110
ScChangeActionContent ** GetContentSlots() const
Definition: chgtrack.hxx:968
ScCellValue maOldCell
Definition: chgtrack.hxx:604
void SetPrevContent(ScChangeActionContent *p)
Definition: chgtrack.hxx:736
void RejectRestoreContents(ScChangeTrack *, SCCOL nDx, SCROW nDy)
Definition: chgtrack.cxx:586