28#include <com/sun/star/uno/Sequence.hxx>
30#include <tools/datetime.hxx>
45namespace tools {
class JsonWriter; }
142 pLinkP->
pLink =
this;
224 void SetUser(
const OUString& r );
265 sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz );
338 ScDocument& rDoc,
bool bSplitRange =
false,
bool bWarning =
true )
const;
384 const OUString& aUser,
386 const OUString &sComment,
388 bool bEndOfList =
false );
391 ScDocument&
rDoc,
bool bSplitRange =
false,
bool bWarning =
true)
const override;
410 short nFrom,
short nTo );
448 sal_Int32
nDx, sal_Int32
nDy, sal_Int32 nDz )
override;
486 ScDocument&
rDoc,
bool bSplitRange =
false,
bool bWarning =
true )
const override;
533 sal_Int32
nDx, sal_Int32
nDy, sal_Int32 nDz )
override;
547 const OUString&
aUser,
549 const OUString &sComment,
557 ScDocument& rDoc,
bool bSplitRange =
false,
bool bWarning =
true )
const override;
565 short nFrom,
short nTo )
570 nCutOffFrom( nFrom ),
613 if ( ( pNextInSlot = *pp ) !=
nullptr )
623 if ( ( *ppPrevInSlot = pNextInSlot ) !=
nullptr )
625 ppPrevInSlot =
nullptr;
633 static OUString GetStringOfCell(
636 static OUString GetStringOfCell(
649 static bool NeedsNumberFormat(
const ScCellValue& rVal );
653 OUString GetValueString(
const OUString& rValue,
const ScCellValue& rCell,
656 OUString GetFormulaString(
const ScFormulaCell* pCell )
const;
663 sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz )
override;
672 bool bOldest, ::std::stack<ScChangeActionContent*>* pRejectActions );
686 const OUString& aUser,
const DateTime& aDateTime,
688 const ScDocument* pDoc,
const OUString& sOldValue );
693 const OUString& sNewValue );
729 { pNextContent =
p; }
731 { pPrevContent =
p; }
735 void SetOldValue(
const OUString& rOld,
ScDocument* pDoc );
737 OUString GetOldString(
const ScDocument* pDoc )
const;
738 OUString GetNewString(
const ScDocument* pDoc )
const;
742 ScDocument&
rDoc,
bool bSplitRange =
false,
bool bWarning =
true )
const override;
744 virtual OUString GetRefString(
ScDocument&
rDoc,
bool bFlag3D =
false )
const override;
750 bool IsMatrixOrigin()
const;
752 bool IsOldMatrixReference()
const;
773 const OUString&
aUser,
775 const OUString &sComment);
811#define SC_CHGTRACK_GENERATED_START (sal_uInt32(0xfffffff0))
864 SCROW InitContentRowsPerSlot();
868 static bool IsMatrixFormulaRangeDifferent(
874 { aInDeleteRange = rRange; }
876 { bInDelete = bVal; }
878 { bInDeleteTop = bVal; }
880 { bInDeleteUndo = bVal; }
882 { bInPasteCut = bVal; }
884 { eMergeState = eState; }
894 void EndBlockModify(
sal_uLong nEndAction );
906 void AppendOneDeleteRange(
const ScRange& rOrgRange,
910 void LookUpContents(
const ScRange& rOrgRange,
919 void DeleteGeneratedDelContent(
925 void DeleteCellEntries(
926 std::vector<ScChangeActionContent*>&,
936 bool IsLastAction(
sal_uLong nNum )
const;
938 void ClearMsgQueue();
943 SCSIZE ComputeContentSlot( sal_Int32 nRow )
const;
954 bool IsGenerated(
sal_uLong nAction )
const;
958 sal_uLong GetLastSavedActionNumber()
const;
959 void SetLastSavedActionNumber(
sal_uLong nNew);
964 {
return aInDeleteRange; }
969 void CreateAuthorName();
971 const OUString&
GetUser()
const {
return maUser;}
981 { bUseFixDateTime = bVal; }
984 { aFixDateTime = rDT; }
1002 void AppendContent(
const ScAddress& rPos,
1006 void AppendContentRange(
const ScRange& rRange,
1021 void AppendContentsIfInRefDoc(
ScDocument& rRefDoc,
1049 nStartLastCut = nEndLastCut = 0;
1050 pLastCutMove.reset();
1054 return nEndLastCut > 0 &&
1055 nStartLastCut <= nEndLastCut &&
1064 void MergePrepare(
const ScChangeAction* pFirstMerge,
bool bShared );
1110 { aModifiedLink = r; ClearMsgQueue(); }
1117 const ScBigRange& aBigRange,
const OUString& sNewValue );
1118 void AppendLoaded( std::unique_ptr<ScChangeAction> pAppend );
1120 { nActionMax = nTempActionMax; }
1123 { aProtectPass = rPass; }
1125 {
return aProtectPass; }
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 ...
std::vector< ScChangeTrackMsgInfo > ScChangeTrackMsgStack
std::map< sal_uLong, ScChangeAction * > ScChangeActionMap
std::vector< ScChangeTrackMsgInfo > ScChangeTrackMsgQueue
ScChangeActionContentCellType
const ScAppOptions & rOpt
void Update(const ScChangeAction &rAction)
ScActionColorChanger(const ScChangeTrack &rTrack)
const std::set< OUString > & rUsers
sal_uInt16 nLastUserIndex
bool IsTopContent() const
ScChangeActionContent * GetNextContent() const
void InsertInSlot(ScChangeActionContent **pp)
ScChangeActionContent * GetPrevContent() const
virtual OUString GetRefString(ScDocument &rDoc, bool bFlag3D=false) const override
ScChangeActionContent * pNextContent
ScChangeActionContent ** ppPrevInSlot
virtual const ScChangeTrack * GetChangeTrack() const override
virtual void UpdateReference(const ScChangeTrack *, UpdateRefMode, const ScBigRange &, sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz) override
virtual void AddContent(ScChangeActionContent *) override
void SetPrevContent(ScChangeActionContent *p)
const ScCellValue & GetNewCell() const
virtual OUString GetDescription(ScDocument &rDoc, bool bSplitRange=false, bool bWarning=true) const override
void SetNextContent(ScChangeActionContent *p)
virtual void DeleteCellEntries() override
const ScCellValue & GetOldCell() const
ScChangeActionContent * pNextInSlot
ScChangeActionContent * GetNextInSlot()
ScChangeActionContent * pPrevContent
const ScChangeActionDelMoveEntry * GetNext() const
short GetCutOffTo() const
short GetCutOffFrom() const
ScChangeActionMove * GetMove()
ScChangeActionDelMoveEntry(ScChangeActionDelMoveEntry **ppPrevP, ScChangeActionMove *pMove, short nFrom, short nTo)
bool IsBaseDelete() const
bool IsMultiDelete() const
virtual void UpdateReference(const ScChangeTrack *, UpdateRefMode, const ScBigRange &, sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz) override
ScChangeActionDelMoveEntry * AddCutOffMove(ScChangeActionMove *pMove, short nFrom, short nTo)
virtual void AddContent(ScChangeActionContent *) override
std::vector< ScChangeActionContent * > mvCells
void SetCutOffInsert(ScChangeActionIns *p, short n)
virtual void DeleteCellEntries() override
const ScChangeActionDelMoveEntry * GetFirstMoveEntry() const
bool IsTabDeleteCol() const
ScChangeActionDelMoveEntry * pLinkMove
virtual const ScChangeTrack * GetChangeTrack() const override
virtual ~ScChangeActionDel() override
short GetCutOffCount() const
ScBigRange GetOverAllRange() const
const ScChangeActionIns * GetCutOffInsert() const
virtual bool Reject(ScDocument &rDoc) override
virtual OUString GetDescription(ScDocument &rDoc, bool bSplitRange=false, bool bWarning=true) const override
ScChangeActionIns * pCutOff
virtual const ScChangeTrack * GetChangeTrack() const override
virtual void DeleteCellEntries() override
virtual void AddContent(ScChangeActionContent *) override
A link/connection/dependency between change actions.
const ScChangeAction * GetAction() const
virtual ~ScChangeActionLinkEntry()
ScChangeActionLinkEntry * GetNext()
ScChangeActionLinkEntry & operator=(const ScChangeActionLinkEntry &)=delete
ScChangeActionLinkEntry * pLink
ScChangeActionLinkEntry * pNext
ScChangeActionLinkEntry(const ScChangeActionLinkEntry &)=delete
ScChangeAction * GetAction()
const ScChangeActionLinkEntry * GetNext() const
ScChangeActionLinkEntry ** ppPrev
ScChangeActionLinkEntry(ScChangeActionLinkEntry **ppPrevP, ScChangeAction *pActionP)
void SetLink(ScChangeActionLinkEntry *pLinkP)
const ScBigRange & GetFromRange() const
virtual ~ScChangeActionMove() override
virtual void UpdateReference(const ScChangeTrack *, UpdateRefMode, const ScBigRange &, sal_Int32 nDx, sal_Int32 nDy, sal_Int32 nDz) override
std::vector< ScChangeActionContent * > mvCells
virtual void AddContent(ScChangeActionContent *) override
void SetEndLastCut(sal_uLong nVal)
sal_uLong GetEndLastCut() const
void SetStartLastCut(sal_uLong nVal)
ScBigRange & GetFromRange()
virtual bool Reject(ScDocument &rDoc) override
virtual OUString GetDescription(ScDocument &rDoc, bool bSplitRange=false, bool bWarning=true) const override
ScChangeActionMove(const ScRange &rFromRange, const ScRange &rToRange, ScChangeTrack *pTrackP)
virtual const ScChangeTrack * GetChangeTrack() const override
SC_DLLPUBLIC void GetDelta(sal_Int32 &nDx, sal_Int32 &nDy, sal_Int32 &nDz) const
sal_uLong GetStartLastCut() const
virtual OUString GetRefString(ScDocument &rDoc, bool bFlag3D=false) const override
virtual void DeleteCellEntries() override
virtual void DeleteCellEntries() override
virtual void AddContent(ScChangeActionContent *) override
virtual const ScChangeTrack * GetChangeTrack() const override
virtual bool Reject(ScDocument &rDoc) override
ScChangeActionReject(const sal_uLong nActionNumber, const ScChangeActionState eState, const sal_uLong nRejectingNumber, const ScBigRange &aBigRange, const OUString &aUser, const DateTime &aDateTime, const OUString &sComment)
ScChangeActionLinkEntry * pLinkDeleted
void SetDeletedInThis(sal_uLong nActionNumber, const ScChangeTrack *pTrack)
void SetDeletedIn(ScChangeAction *)
ScChangeActionLinkEntry * pLinkDependent
ScChangeAction(const ScChangeAction &)=delete
void SetRejectAction(sal_uLong n)
const OUString & GetComment() const
virtual ScChangeActionLinkEntry ** GetDeletedInAddress()
void SetComment(const OUString &rStr)
ScBigRange & GetBigRange()
friend class ScChangeActionMove
void SetUser(const OUString &r)
ScChangeActionLinkEntry * AddDeleted(ScChangeAction *p)
ScChangeAction & operator=(const ScChangeAction &)=delete
virtual const ScChangeTrack * GetChangeTrack() const =0
bool IsMasterDelete() const
void SetActionNumber(sal_uLong n)
bool IsDialogRoot() const
sal_uLong GetRejectAction() const
bool IsDialogParent() const
sal_uLong GetActionNumber() const
void AddLink(ScChangeAction *p, ScChangeActionLinkEntry *pL)
const DateTime & GetDateTimeUTC() const
virtual ~ScChangeAction()
const ScBigRange & GetBigRange() const
void SetDateTimeUTC(const DateTime &rDT)
void SetType(ScChangeActionType e)
ScChangeActionType GetType() const
ScChangeActionLinkEntry * pLinkAny
const ScChangeActionLinkEntry * GetFirstDependentEntry() const
virtual ScChangeActionLinkEntry * GetDeletedIn() const
bool RemoveDeletedIn(const ScChangeAction *)
friend class ScChangeActionDel
bool HasDependent() const
void RejectRestoreContents(ScChangeTrack *, SCCOL nDx, SCROW nDy)
virtual void AddContent(ScChangeActionContent *)=0
bool IsDeleteType() const
void SetState(ScChangeActionState e)
const ScChangeActionLinkEntry * GetFirstDeletedEntry() const
bool IsRejectable() const
bool IsDeletedInDelType(ScChangeActionType) const
bool IsInsertType() const
ScChangeAction * GetNext() const
ScChangeAction * GetPrev() const
bool IsInternalRejectable() const
void RemoveAllDependent()
ScChangeActionState eState
SC_DLLPUBLIC DateTime GetDateTime() const
virtual bool Reject(ScDocument &rDoc)=0
OUString GetRefString(const ScBigRange &rRange, const ScDocument &rDoc, bool bFlag3D=false) const
virtual void DeleteCellEntries()=0
ScChangeActionState GetState() const
ScChangeActionLinkEntry * pLinkDeletedIn
const OUString & GetUser() const
SC_DLLPUBLIC bool IsAccepted() const
void RemoveAllDeletedIn()
ScChangeActionLinkEntry * AddDependent(ScChangeAction *p)
const std::set< OUString > & GetUserCollection() const
ScDocument & GetDocument() const
std::optional< ScChangeTrackMsgInfo > xBlockModifyMsg
ScChangeTrackMsgStack aMsgStackFinal
ScChangeAction * GetLast() const
ScChangeActionMap aPasteCutMap
SCROW mnContentRowsPerSlot
void SetMergeState(ScChangeTrackMergeState eState)
const DateTime & GetFixDateTime() const
std::set< OUString > maUserCollection
ScChangeActionLinkEntry * pLinkInsertTab
void SetInDeleteRange(const ScRange &rRange)
void SetModifiedLink(const Link< ScChangeTrack &, void > &r)
void SetInDeleteTop(bool bVal)
css::uno::Sequence< sal_Int8 > aProtectPass
void UpdateReference(ScChangeAction *, bool bUndo)
sal_uLong GetActionMax() const
ScChangeActionContent ** GetContentSlots() const
bool IsInPasteCut() const
ScChangeActionLinkEntry * pLinkInsertRow
void SetProtection(const css::uno::Sequence< sal_Int8 > &rPass)
ScChangeTrack(const ScChangeTrack &)=delete
ScChangeTrackMsgQueue aMsgQueue
void SetLastMerge(sal_uLong nVal)
void SetFixDateTimeUTC(const DateTime &rDT)
sal_uLong GetLastMerge() const
bool IsInDeleteUndo() const
ScChangeTrackMergeState GetMergeState() const
void SetInDelete(bool bVal)
void SetTimeNanoSeconds(bool bVal)
ScChangeActionContent * pFirstGeneratedDelContent
const css::uno::Sequence< sal_Int8 > & GetProtection() const
std::unique_ptr< ScChangeActionContent *[]> ppContentSlots
const ScRange & GetInDeleteRange() const
ScChangeTrack & operator=(const ScChangeTrack &)=delete
ScChangeActionMap aGeneratedMap
void SetFixDateTimeLocal(const DateTime &rDT)
bool Reject(ScChangeAction *, ScChangeActionMap *, bool bRecursion)
bool IsTimeNanoSeconds() const
Link< ScChangeTrack &, void > aModifiedLink
void SetUseFixDateTime(bool bVal)
ScChangeActionContent * GetFirstGenerated() const
bool IsInDeleteTop() const
const OUString & GetUser() const
void SetActionMax(sal_uLong nTempActionMax)
std::unique_ptr< ScChangeActionMove > pLastCutMove
ScChangeActionLinkEntry * pLinkMove
void SetInDeleteUndo(bool bVal)
ScChangeActionLinkEntry * pLinkInsertCol
void SetInPasteCut(bool bVal)
ScChangeTrackMergeState eMergeState
ScChangeAction * GetFirst() const
ScChangeTrackMsgStack aMsgStackTmp
virtual void GetDescription(OUString &rName) override
virtual void SetValue(tools::Long nNew) override
void Clear(EHistoryType eHistory)
css::uno::Reference< css::animations::XAnimationNode > Clone(const css::uno::Reference< css::animations::XAnimationNode > &xSourceNode, const SdPage *pSource=nullptr, const SdPage *pTarget=nullptr)
Store arbitrary cell value of any kind.
ScChangeTrackMsgType eMsgType
This is very similar to ScCellValue, except that it references the original value instead of copying ...
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW