23 #include <document.hxx>
44 pChangeTrack(nullptr),
56 return "ct" + OUString::number(nActionNumber);
69 sal_Int32 nStartColumn;
73 sal_Int32 nStartSheet;
75 rBigRange.
GetVars(nStartColumn, nStartRow, nStartSheet,
76 nEndColumn, nEndRow, nEndSheet);
77 if ((nStartColumn == nEndColumn) && (nStartRow == nEndRow) && (nStartSheet == nEndSheet))
107 OUStringBuffer sDate;
115 const OUString& sComment(pAction->
GetComment());
116 if (!sComment.isEmpty())
119 bool bPrevCharWasSpace(
true);
126 #if OSL_DEBUG_LEVEL > 0
134 WriteCell(static_cast<const ScChangeActionContent*>(pGeneratedAction)->GetNewCell(), sValue);
149 if (static_cast<const ScChangeActionContent*>(pDeletedAction)->IsTopContent() && pDeletedAction->
IsDeletedIn())
207 bool bSetAttributes(
false);
208 if (!sValue.isEmpty())
211 double fTempValue = 0.0;
215 if (nType & SvNumFormatType::DEFINED)
219 case SvNumFormatType::DATE:
224 OUStringBuffer sBuffer;
227 bSetAttributes =
true;
231 case SvNumFormatType::TIME:
234 OUStringBuffer sBuffer;
237 bSetAttributes =
true;
247 OUStringBuffer sBuffer;
249 OUString sNumValue(sBuffer.makeStringAndClear());
250 if (!sNumValue.isEmpty())
272 bool bPrevCharWasSpace(
true);
328 OUString sMatrixFormula = sFormula.copy(1, sFormula.getLength() - 2);
347 if (!sCellValue.isEmpty())
350 bool bPrevCharWasSpace(
true);
397 WriteCell(static_cast<const ScChangeActionContent*>(pAction)->GetOldCell(), sValue);
403 sal_Int32 nPosition(0);
405 sal_Int32 nStartPosition(0);
406 sal_Int32 nEndPosition(0);
407 sal_Int32 nStartColumn;
408 sal_Int32 nEndColumn;
411 sal_Int32 nStartSheet;
414 rBigRange.
GetVars(nStartColumn, nStartRow, nStartSheet,
415 nEndColumn, nEndRow, nEndSheet);
416 switch (pConstAction->
GetType())
421 nStartPosition = nStartColumn;
422 nEndPosition = nEndColumn;
428 nStartPosition = nStartRow;
429 nEndPosition = nEndRow;
435 nStartPosition = nStartSheet;
436 nEndPosition = nEndSheet;
441 OSL_FAIL(
"wrong insertion type");
445 nPosition = nStartPosition;
446 nCount = nEndPosition - nStartPosition + 1;
448 OSL_ENSURE(nCount > 0,
"wrong insertion count");
469 sal_Int32 nPosition(0);
471 sal_Int32 nStartColumn(0);
472 sal_Int32 nEndColumn(0);
473 sal_Int32 nStartRow(0);
474 sal_Int32 nEndRow(0);
475 sal_Int32 nStartSheet(0);
476 sal_Int32 nEndSheet(0);
477 rBigRange.
GetVars(nStartColumn, nStartRow, nStartSheet,
478 nEndColumn, nEndRow, nEndSheet);
484 nPosition = nStartColumn;
490 nPosition = nStartRow;
496 nPosition = nStartSheet;
501 OSL_FAIL(
"wrong deletion type");
514 sal_Int32 nSlavesCount (1);
540 if (!(pCutOffIns || pLinkMove))
563 pLinkMove = pLinkMove->
GetNext();
620 if (static_cast<const ScChangeActionContent*>(pAction)->IsTopContent() && pAction->
IsDeletedIn())
629 SAL_WARN(
"sc.filter",
"WorkWithChangeAction: type is not writable");
665 while (pAction != pLastAction)
690 while (pAction != pLastAction)
void CollectCellAutoStyles(const ScCellValue &rCell)
bool IsGenerated(sal_uLong nAction) const
void CollectActionAutoStyles(const ScChangeAction *pAction)
OUString getString() const
void GetAcceptanceState(const ScChangeAction *pAction)
void AddInsertionAttributes(const ScChangeAction *pAction)
constexpr sal_uInt16 XML_NAMESPACE_OFFICE
ScChangeActionType GetType() const
XML_CHANGE_TRACK_TABLE_CELL
const ScChangeActionLinkEntry * GetFirstDependentEntry() const
ScChangeAction * GetNext() const
ScChangeAction * GetLast() const
static void ConvertDateTimeToString(const DateTime &aDateTime, OUStringBuffer &sDate)
constexpr sal_uInt16 XML_NAMESPACE_OOOC
rtl::Reference< XMLTextParagraphExport > const & GetTextParagraphExport()
const SvXMLUnitConverter & GetMM100UnitConverter() const
const ScChangeActionDelMoveEntry * GetNext() const
const ScChangeActionIns * GetCutOffInsert() const
void AddDeletionAttributes(const ScChangeActionDel *pAction)
bool IsMultiDelete() const
void WriteInsertion(const ScChangeAction *pAction)
sal_uLong GetActionMax() const
void WorkWithChangeAction(ScChangeAction *pAction)
static void GetStringFromAddress(OUString &rString, const ScAddress &rAddress, const ScDocument *pDocument, formula::FormulaGrammar::AddressConvention eConv, sal_Unicode cSeparator= ' ', bool bAppendStr=false, ScRefFlags nFormatFlags=ScRefFlags::VALID|ScRefFlags::TAB_3D)
Range to String core.
static void convertDouble(OUStringBuffer &rBuffer, double fNumber, bool bWriteUnits, sal_Int16 nSourceUnit, sal_Int16 nTargetUnit)
Store arbitrary cell value of any kind.
void WriteValueCell(const ScCellValue &rCell, const OUString &sValue)
void WriteContentChange(const ScChangeAction *pAction)
const ScChangeActionLinkEntry * GetNext() const
const css::uno::Reference< css::frame::XModel > & GetModel() const
A link/connection/dependency between change actions.
ScFormulaCell * mpFormula
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
ScBigRange & GetFromRange()
void AddAttribute(sal_uInt16 nPrefix, const char *pName, const OUString &rValue)
ScChangeAction * GetFirst() const
ScChangeTrack * GetChangeTrack() const
bool IsDeleteType() const
ScChangeActionContent * GetFirstGenerated() const
void WriteCell(const ScCellValue &rCell, const OUString &sValue)
static OUString GetChangeID(const sal_uInt32 nActionNumber)
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
SC_DLLPUBLIC bool IsAccepted() const
const DateTime & GetDateTimeUTC() const
constexpr sal_uInt16 XML_NAMESPACE_TEXT
ScEditEngineTextObj * pEditTextObj
const OUString & GetComment() const
svl::SharedString * mpString
void convertDateTime(OUStringBuffer &rBuffer, const double &fDateTime, bool const bAddTimeIf0AM=false)
void GetNewString(OUString &rStr, const ScDocument *pDoc) const
void WriteCutOffs(const ScChangeActionDel *pAction)
bool setNullDate(const css::uno::Reference< css::frame::XModel > &xModel)
void WriteStringCell(const ScCellValue &rCell)
ScBigRange & GetBigRange()
void WriteGenerated(const ScChangeAction *pDependAction)
static void convertDuration(OUStringBuffer &rBuffer, const double fTime)
formula::FormulaGrammar::Grammar GetStorageGrammar() const
OUString GetQNameByKey(sal_uInt16 nKey, const OUString &rLocalName, bool bCache=true) const
constexpr sal_uInt16 XML_NAMESPACE_DC
void WriteDependings(const ScChangeAction *pAction)
const SvXMLNamespaceMap & GetNamespaceMap() const
void WriteDeletion(ScChangeAction *pAction)
void SetValueAttributes(const double &fValue, const OUString &sValue)
sal_uLong GetActionNumber() const
XML_NUMBER_MATRIX_ROWS_SPANNED
short GetCutOffTo() const
ScDocument * GetDocument()
void SetText(const EditTextObject &rTextObject)
XML_NUMBER_MATRIX_COLUMNS_SPANNED
~ScChangeTrackingExportHelper()
constexpr sal_uInt16 XML_NAMESPACE_TABLE
XML_CELL_CONTENT_DELETION
short GetCutOffFrom() const
XML_MULTI_DELETION_SPANNED
void Characters(const OUString &rChars)
void WriteEditCell(const ScCellValue &rCell)
const ScChangeActionDelMoveEntry * GetFirstMoveEntry() const
bool HasDependent() const
short GetCutOffCount() const
const ScChangeAction * GetAction() const
bool IsInsertType() const
constexpr sal_uInt16 XML_NAMESPACE_OF
ScChangeTrack * pChangeTrack
EditTextObject * mpEditText
const OUString & GetUser() const
void WriteRejection(const ScChangeAction *pAction)
static SC_DLLPUBLIC OUString GetString(const EditTextObject &rEditText, const ScDocument *pDoc)
Retrieves string with paragraphs delimited by new lines (' ').
void WriteBigRange(const ScBigRange &rBigRange, xmloff::token::XMLTokenEnum aName)
#define SAL_WARN(area, stream)
void GetVars(sal_Int32 &nCol1, sal_Int32 &nRow1, sal_Int32 &nTab1, sal_Int32 &nCol2, sal_Int32 &nRow2, sal_Int32 &nTab2) const
void WriteMovement(const ScChangeAction *pAction)
void WriteDeleted(const ScChangeAction *pDependAction)
const ScCellValue & GetNewCell() const
const ScChangeActionLinkEntry * GetFirstDeletedEntry() const
css::uno::Any const SvXMLExport & rExport
void WriteDepending(const ScChangeAction *pDependAction)
ScChangeTrackingExportHelper(ScXMLExport &rExport)
void WriteChangeInfo(const ScChangeAction *pAction)
void WriteFormulaCell(const ScCellValue &rCell, const OUString &sValue)
sal_uLong GetRejectAction() const
css::uno::Reference< css::text::XText > xText
void CollectAndWriteChanges()