22#include <document.hxx>
24#include <tools/datetime.hxx>
25#include <osl/diagnose.h>
34 ScCellValue aCell, OUString aFormulaAddress, OUString aFormula,
36 const double& rValue,
const sal_uInt16 nTempType,
const ScMatrixMode nTempMatrixFlag,
const sal_Int32 nTempMatrixCols,
37 const sal_Int32 nTempMatrixRows ) :
38 maCell(
std::move(aCell)),
39 sFormulaAddress(
std::move(aFormulaAddress)),
41 sInputString(
std::move(aInputString)),
43 nMatrixCols(nTempMatrixCols),
44 nMatrixRows(nTempMatrixRows),
45 eGrammar( eTempGrammar),
47 nMatrixFlag(nTempMatrixFlag)
69 sal_uInt32 nFormat(0);
72 else if (
nType == css::util::NumberFormat::TIME)
84 nActionType(nTempActionType),
142 nMultiSpannedSlaveCount(0)
193 sal_uInt32 nResult(0);
200 OSL_ENSURE(
nValue > 0,
"wrong change action ID");
205 OSL_FAIL(
"wrong change action ID");
231 OSL_ENSURE(
nCount > 0,
"wrong count");
269 pCurrentAction->aDeletedList.emplace_back( nID, std::move(pCellInfo) );
274 if (nTempMultiSpanned)
292 OSL_FAIL(
"wrong action type");
305 OSL_FAIL(
"wrong action type");
317 OSL_FAIL(
"wrong action type");
339 OSL_FAIL(
"wrong action type");
345 ScMyGenerated aGenerated { aBigRange, 0, std::move(pCellInfo) };
357 OSL_FAIL(
"try to insert a generated action to a wrong action");
365 OSL_FAIL(
"no current action");
377 OSL_FAIL(
"no current action");
392 std::set<OUString>::const_iterator it = rUsers.find(aInfo.
sUser);
393 if (it != rUsers.end())
428 OSL_ENSURE(pAction->
pMoveRanges,
"no move ranges");
452 pAction->
aBigRange, aUser, aDateTime, sComment);
458 OUString sInputString;
461 aCell = pAction->
pCellInfo->CreateCell(rDoc);
462 sInputString = pAction->
pCellInfo->sInputString;
472 pAction->
aBigRange, aUser, aDateTime, sComment, aCell, &rDoc, sInputString);
479 if (rGenerated.nID != 0)
481 if (!rGenerated.pCellInfo)
483 ScCellValue aCell = rGenerated.pCellInfo->CreateCell(rDoc);
487 OSL_ENSURE(rGenerated.nID,
"could not insert generated action");
502 OSL_ENSURE(rGenerated.
nID,
"a not inserted generated action");
522 OSL_FAIL(
"no cut off insert action");
544 OSL_FAIL(
"no cut off move action");
561 OSL_ENSURE(rGenerated.
nID,
"a not inserted generated action");
587 pPrevActContent->
SetNewCell(rOldCell, &rDoc, OUString());
635 OSL_FAIL(
"could not find the action");
650 sal_Int64 nCol, nRow, nTab, nCol2, nRow2, nTab2;
652 if ((nCol >= 0) && (nCol <= rDoc.
MaxCol()) &&
653 (nRow >= 0) && (nRow <= rDoc.
MaxRow()) &&
654 (nTab >= 0) && (nTab <=
MAXTAB))
657 static_cast<SCROW>(nRow),
658 static_cast<SCTAB>(nTab));
660 aCell.
assign(rDoc, aAddress);
667 pChangeActionContent->
SetNewCell(aNewCell, &rDoc, OUString());
701 pChangeActionContent->
SetNewCell(aNewCell, &rDoc, OUString());
708 OSL_FAIL(
"wrong cell position");
721 for (
const auto & rAction :
aActions)
723 std::unique_ptr<ScChangeAction> pAction;
725 switch (rAction->nActionType)
770 OSL_FAIL(
"no action");
787 for (
const auto& rxAction :
aActions)
789 OSL_ENSURE(rxAction->nActionType ==
SC_CAT_CONTENT,
"wrong action type");
constexpr OStringLiteral SC_CHANGE_ID_PREFIX
static constexpr sal_Int64 nRangeMin
static constexpr sal_Int64 nRangeMax
void GetVars(sal_Int64 &nCol1, sal_Int64 &nRow1, sal_Int64 &nTab1, sal_Int64 &nCol2, sal_Int64 &nRow2, sal_Int64 &nTab2) const
bool IsTopContent() const
void SetNewValue(const ScCellValue &rCell, ScDocument *pDoc)
void SetPrevContent(ScChangeActionContent *p)
const ScCellValue & GetNewCell() const
void SetNextContent(ScChangeActionContent *p)
void SetNewCell(const ScCellValue &rCell, const ScDocument *pDoc, const OUString &rFormatted)
const ScCellValue & GetOldCell() const
ScChangeActionDelMoveEntry * AddCutOffMove(ScChangeActionMove *pMove, short nFrom, short nTo)
void SetCutOffInsert(ScChangeActionIns *p, short n)
void SetDeletedInThis(sal_uLong nActionNumber, const ScChangeTrack *pTrack)
sal_uLong GetActionNumber() const
ScChangeActionType GetType() const
bool IsInsertType() const
ScChangeActionLinkEntry * AddDependent(ScChangeAction *p)
const std::set< OUString > & GetUserCollection() const
void AppendLoaded(std::unique_ptr< ScChangeAction > pAppend)
ScChangeAction * GetLast() const
void SetLastSavedActionNumber(sal_uLong nNew)
SC_DLLPUBLIC ScChangeAction * GetAction(sal_uLong nAction) const
void SetProtection(const css::uno::Sequence< sal_Int8 > &rPass)
sal_uLong AddLoadedGenerated(const ScCellValue &rNewCell, const ScBigRange &aBigRange, const OUString &sNewValue)
void SetTimeNanoSeconds(bool bVal)
const css::uno::Sequence< sal_Int8 > & GetProtection() const
void SetActionMax(sal_uLong nTempActionMax)
SC_DLLPUBLIC void SetChangeTrack(std::unique_ptr< ScChangeTrack > pTrack)
only for import filter, deletes any existing ChangeTrack via EndChangeTracking() and takes ownership ...
SC_DLLPUBLIC SCCOL MaxCol() const
SC_DLLPUBLIC SCROW MaxRow() const
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
ScChangeTrack * GetChangeTrack() const
static SC_DLLPUBLIC LanguageType eLnge
static bool GetAddressFromString(ScAddress &rAddress, std::u16string_view rAddressStr, const ScDocument &rDocument, formula::FormulaGrammar::AddressConvention eConv, sal_Int32 &nOffset, sal_Unicode cSeparator=' ', sal_Unicode cQuote='\'')
String to Range core.
std::set< OUString > aUsers
void SetMovementDependencies(ScMyMoveAction *pAction, ScChangeActionMove *pMoveAct)
std::unique_ptr< ScChangeAction > CreateMoveAction(const ScMyMoveAction *pAction)
void SetMultiSpanned(const sal_Int16 nMultiSpanned)
void SetNewCell(const ScMyContentAction *pAction, ScDocument &rDoc)
std::unique_ptr< ScChangeAction > CreateContentAction(const ScMyContentAction *pAction, ScDocument &rDoc)
static sal_uInt32 GetIDFromString(std::string_view sID)
void CreateChangeTrack(ScDocument *pDoc)
void GetMultiSpannedRange()
std::unique_ptr< ScChangeAction > CreateDeleteAction(const ScMyDelAction *pAction)
void StartChangeAction(const ScChangeActionType nActionType)
std::unique_ptr< ScMyBaseAction > pCurrentAction
void SetActionInfo(const ScMyActionInfo &aInfo)
void AddDeleted(const sal_uInt32 nID)
void AddMoveCutOff(const sal_uInt32 nID, const sal_Int32 nStartPosition, const sal_Int32 nEndPosition)
~ScXMLChangeTrackingImportHelper()
void SetDependencies(ScMyBaseAction *pAction, ScDocument &rDoc)
void SetPreviousChange(const sal_uInt32 nPreviousAction, ScMyCellInfo *pCellInfo)
void CreateGeneratedActions(std::vector< ScMyGenerated > &rList, ScDocument &rDoc)
void SetMoveRanges(const ScBigRange &aSourceRange, const ScBigRange &aTargetRange)
std::vector< std::unique_ptr< ScMyBaseAction > > aActions
std::unique_ptr< ScChangeAction > CreateRejectionAction(const ScMyRejAction *pAction)
void AddGenerated(std::unique_ptr< ScMyCellInfo > pCellInfo, const ScBigRange &aBigRange)
css::uno::Sequence< sal_Int8 > aProtect
ScXMLChangeTrackingImportHelper()
sal_Int16 nMultiSpannedSlaveCount
void SetDeletionDependencies(ScMyDelAction *pAction, ScChangeActionDel *pDelAct)
void ConvertInfo(const ScMyActionInfo &aInfo, OUString &rUser, DateTime &aDateTime)
void SetContentDependencies(const ScMyContentAction *pAction, ScChangeActionContent *pActContent, const ScDocument &rDoc)
void SetPosition(const sal_Int32 nPosition, const sal_Int32 nCount, const sal_Int32 nTable)
std::unique_ptr< ScChangeAction > CreateInsertAction(const ScMyInsAction *pAction)
void SetInsertionCutOff(const sal_uInt32 nID, const sal_Int32 nPosition)
static bool convertNumber(sal_Int32 &rValue, std::u16string_view aString, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32)
Store arbitrary cell value of any kind.
void assign(const ScDocument &rDoc, const ScAddress &rPos)
Take cell value from specified position in specified document.
bool equalsWithoutFormat(const ScCellValue &r) const
ScFormulaCell * getFormula() const
css::util::DateTime aDateTime
sal_uInt32 nRejectingNumber
std::vector< sal_uInt32 > aDependencies
std::vector< ScMyDeleted > aDeletedList
ScMyBaseAction(const ScChangeActionType nActionType)
virtual ~ScMyBaseAction()
ScChangeActionState nActionState
sal_uInt32 nPreviousAction
ScChangeActionType nActionType
formula::FormulaGrammar::Grammar eGrammar
const ScCellValue & CreateCell(ScDocument &rDoc)
ScMyCellInfo(ScCellValue aCell, OUString sFormulaAddress, OUString sFormula, const formula::FormulaGrammar::Grammar eGrammar, OUString sInputString, const double &fValue, const sal_uInt16 nType, const ScMatrixMode nMatrixFlag, const sal_Int32 nMatrixCols, const sal_Int32 nMatrixRows)
virtual ~ScMyContentAction() override
std::unique_ptr< ScMyCellInfo > pCellInfo
virtual ~ScMyDelAction() override
std::optional< ScMyInsertionCutOff > moInsCutOff
std::vector< ScMyMoveCutOff > aMoveCutOffs
ScMyDelAction(const ScChangeActionType nActionType)
std::vector< ScMyGenerated > aGeneratedList
std::unique_ptr< ScMyCellInfo > pCellInfo
ScMyInsAction(const ScChangeActionType nActionType)
virtual ~ScMyInsAction() override
std::vector< ScMyGenerated > aGeneratedList
std::unique_ptr< ScMyMoveRanges > pMoveRanges
virtual ~ScMyMoveAction() override
virtual ~ScMyRejAction() override