LibreOffice Module sc (master)  1
XMLChangeTrackingExportHelper.cxx
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 
21 #include "xmlexprt.hxx"
22 #include "XMLConverter.hxx"
23 #include <document.hxx>
24 #include <chgtrack.hxx>
25 #include <formulacell.hxx>
26 #include <textuno.hxx>
27 #include <rangeutl.hxx>
28 #include <cellvalue.hxx>
29 #include <editutil.hxx>
30 
31 #include <xmloff/xmlnamespace.hxx>
32 #include <xmloff/namespacemap.hxx>
33 #include <xmloff/xmluconv.hxx>
34 #include <sax/tools/converter.hxx>
35 #include <svl/numformat.hxx>
36 #include <svl/zforlist.hxx>
37 #include <svl/sharedstring.hxx>
38 #include <sal/log.hxx>
39 
40 using namespace ::com::sun::star;
41 using namespace xmloff::token;
42 
44  : rExport(rTempExport),
45  pChangeTrack(nullptr)
46 {
48 }
49 
51 {
52 }
53 
54 OUString ScChangeTrackingExportHelper::GetChangeID(const sal_uInt32 nActionNumber)
55 {
56  return "ct" + OUString::number(nActionNumber);
57 }
58 
60 {
61  if (pAction->IsRejected())
63  else if (pAction->IsAccepted())
65 }
66 
68 {
69  sal_Int64 nStartColumn;
70  sal_Int64 nEndColumn;
71  sal_Int64 nStartRow;
72  sal_Int64 nEndRow;
73  sal_Int64 nStartSheet;
74  sal_Int64 nEndSheet;
75  rBigRange.GetVars(nStartColumn, nStartRow, nStartSheet,
76  nEndColumn, nEndRow, nEndSheet);
77  if ((nStartColumn == nEndColumn) && (nStartRow == nEndRow) && (nStartSheet == nEndSheet))
78  {
79  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_COLUMN, OUString::number(nStartColumn));
80  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_ROW, OUString::number(nStartRow));
81  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE, OUString::number(nStartSheet));
82  }
83  else
84  {
85  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_START_COLUMN, OUString::number(nStartColumn));
86  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_START_ROW, OUString::number(nStartRow));
87  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_START_TABLE, OUString::number(nStartSheet));
88  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_END_COLUMN, OUString::number(nEndColumn));
89  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_END_ROW, OUString::number(nEndRow));
90  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_END_TABLE, OUString::number(nEndSheet));
91  }
92  SvXMLElementExport aBigRangeElem(rExport, XML_NAMESPACE_TABLE, aName, true, true);
93 }
94 
96 {
98 
99  {
101  XML_CREATOR, true,
102  false );
103  rExport.Characters(pAction->GetUser());
104  }
105 
106  {
107  OUStringBuffer sDate;
110  XML_DATE, true,
111  false );
112  rExport.Characters(sDate.makeStringAndClear());
113  }
114 
115  const OUString& sComment(pAction->GetComment());
116  if (!sComment.isEmpty())
117  {
118  SvXMLElementExport aElemC(rExport, XML_NAMESPACE_TEXT, XML_P, true, false);
119  bool bPrevCharWasSpace(true);
120  rExport.GetTextParagraphExport()->exportCharacterData(sComment, bPrevCharWasSpace);
121  }
122 }
123 
125 {
126 #if OSL_DEBUG_LEVEL > 0
127  sal_uInt32 nActionNumber(pGeneratedAction->GetActionNumber());
128  OSL_ENSURE(pChangeTrack->IsGenerated(nActionNumber), "a not generated action found");
129 #endif
131  WriteBigRange(pGeneratedAction->GetBigRange(), XML_CELL_ADDRESS);
132  OUString sValue = static_cast<const ScChangeActionContent*>(pGeneratedAction)->GetNewString(rExport.GetDocument());
133  WriteCell(static_cast<const ScChangeActionContent*>(pGeneratedAction)->GetNewCell(), sValue);
134 }
135 
137 {
138  sal_uInt32 nActionNumber(pDeletedAction->GetActionNumber());
139  if (pDeletedAction->GetType() == SC_CAT_CONTENT)
140  {
141  const ScChangeActionContent* pContentAction = static_cast<const ScChangeActionContent*>(pDeletedAction);
142  if (pContentAction)
143  {
144  if (!pChangeTrack->IsGenerated(nActionNumber))
145  {
148  if (static_cast<const ScChangeActionContent*>(pDeletedAction)->IsTopContent() && pDeletedAction->IsDeletedIn())
149  {
150  OUString sValue = pContentAction->GetNewString(rExport.GetDocument());
151  WriteCell(pContentAction->GetNewCell(), sValue);
152  }
153  }
154  else
155  WriteGenerated(pContentAction);
156  }
157  }
158  else
159  {
162  }
163 }
164 
166 {
167  sal_uInt32 nActionNumber(pDependAction->GetActionNumber());
169 
171  XML_DEPENDENCY, true, true);
172 }
173 
175 {
176  if (pAction->HasDependent())
177  {
178  SvXMLElementExport aDependingsElem (rExport, XML_NAMESPACE_TABLE, XML_DEPENDENCIES, true, true);
179  const ScChangeActionLinkEntry* pEntry = pAction->GetFirstDependentEntry();
180  while (pEntry)
181  {
182  WriteDepending(pEntry->GetAction());
183  pEntry = pEntry->GetNext();
184  }
185  }
186  if (pAction->HasDeleted())
187  {
188  SvXMLElementExport aDependingsElem (rExport, XML_NAMESPACE_TABLE, XML_DELETIONS, true, true);
189  const ScChangeActionLinkEntry* pEntry = pAction->GetFirstDeletedEntry();
190  while (pEntry)
191  {
192  WriteDeleted(pEntry->GetAction());
193  pEntry = pEntry->GetNext();
194  }
195  }
196 }
197 
199 {
201 }
202 
203 void ScChangeTrackingExportHelper::SetValueAttributes(const double& fValue, const OUString& sValue)
204 {
205  bool bSetAttributes(false);
206  if (!sValue.isEmpty())
207  {
208  sal_uInt32 nIndex = 0;
209  double fTempValue = 0.0;
210  if (rExport.GetDocument() && rExport.GetDocument()->GetFormatTable()->IsNumberFormat(sValue, nIndex, fTempValue))
211  {
213  if (nType & SvNumFormatType::DEFINED)
214  nType &= ~SvNumFormatType::DEFINED;
215  switch(nType)
216  {
217  case SvNumFormatType::DATE:
218  {
220  {
222  OUStringBuffer sBuffer;
223  rExport.GetMM100UnitConverter().convertDateTime(sBuffer, fTempValue);
224  rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_DATE_VALUE, sBuffer.makeStringAndClear());
225  bSetAttributes = true;
226  }
227  }
228  break;
229  case SvNumFormatType::TIME:
230  {
232  OUStringBuffer sBuffer;
233  ::sax::Converter::convertDuration(sBuffer, fTempValue);
234  rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_TIME_VALUE, sBuffer.makeStringAndClear());
235  bSetAttributes = true;
236  }
237  break;
238  default: break;
239  }
240  }
241  }
242  if (!bSetAttributes)
243  {
245  OUStringBuffer sBuffer;
246  ::sax::Converter::convertDouble(sBuffer, fValue);
247  OUString sNumValue(sBuffer.makeStringAndClear());
248  if (!sNumValue.isEmpty())
250  }
251 }
252 
253 void ScChangeTrackingExportHelper::WriteValueCell(const ScCellValue& rCell, const OUString& sValue)
254 {
255  assert(rCell.getType() == CELLTYPE_VALUE);
256 
257  SetValueAttributes(rCell.getDouble(), sValue);
259 }
260 
262 {
263  assert(rCell.getType() == CELLTYPE_STRING);
264 
267  if (!rCell.getSharedString()->isEmpty())
268  {
269  SvXMLElementExport aElemP(rExport, XML_NAMESPACE_TEXT, XML_P, true, false);
270  bool bPrevCharWasSpace(true);
271  rExport.GetTextParagraphExport()->exportCharacterData(rCell.getSharedString()->getString(), bPrevCharWasSpace);
272  }
273 }
274 
276 {
277  assert(rCell.getType() == CELLTYPE_EDIT);
278 
279  OUString sString;
280  if (rCell.getEditText())
281  sString = ScEditUtil::GetString(*rCell.getEditText(), rExport.GetDocument());
282 
285  if (rCell.getEditText() && !sString.isEmpty())
286  {
287  if (!pEditTextObj)
289  pEditTextObj->SetText(*rCell.getEditText());
290  rExport.GetTextParagraphExport()->exportText(pEditTextObj, false, false);
291  }
292 }
293 
294 void ScChangeTrackingExportHelper::WriteFormulaCell(const ScCellValue& rCell, const OUString& sValue)
295 {
296  assert(rCell.getType() == CELLTYPE_FORMULA);
297 
298  ScFormulaCell* pFormulaCell = rCell.getFormula();
299  OUString sAddress;
300  const ScDocument* pDoc = rExport.GetDocument();
303  const formula::FormulaGrammar::Grammar eGrammar = pDoc->GetStorageGrammar();
304  sal_uInt16 nNamespacePrefix = (eGrammar == formula::FormulaGrammar::GRAM_ODFF ? XML_NAMESPACE_OF : XML_NAMESPACE_OOOC);
305  OUString sFormula = pFormulaCell->GetFormula(eGrammar);
306  ScMatrixMode nMatrixFlag(pFormulaCell->GetMatrixFlag());
307  if (nMatrixFlag != ScMatrixMode::NONE)
308  {
309  if (nMatrixFlag == ScMatrixMode::Formula)
310  {
311  SCCOL nColumns;
312  SCROW nRows;
313  pFormulaCell->GetMatColsRows(nColumns, nRows);
316  }
317  else
318  {
320  }
321  OUString sMatrixFormula = sFormula.copy(1, sFormula.getLength() - 2);
322  OUString sQValue = rExport.GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sMatrixFormula, false );
324  }
325  else
326  {
327  OUString sQValue = rExport.GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sFormula, false );
329  }
330  if (pFormulaCell->IsValue())
331  {
332  SetValueAttributes(pFormulaCell->GetValue(), sValue);
334  }
335  else
336  {
338  OUString sCellValue = pFormulaCell->GetString().getString();
340  if (!sCellValue.isEmpty())
341  {
342  SvXMLElementExport aElemP(rExport, XML_NAMESPACE_TEXT, XML_P, true, false);
343  bool bPrevCharWasSpace(true);
344  rExport.GetTextParagraphExport()->exportCharacterData(sCellValue, bPrevCharWasSpace);
345  }
346  }
347 }
348 
349 void ScChangeTrackingExportHelper::WriteCell(const ScCellValue& rCell, const OUString& sValue)
350 {
351  if (rCell.isEmpty())
352  {
353  WriteEmptyCell();
354  return;
355  }
356 
357  switch (rCell.getType())
358  {
359  case CELLTYPE_VALUE:
360  WriteValueCell(rCell, sValue);
361  break;
362  case CELLTYPE_STRING:
363  WriteStringCell(rCell);
364  break;
365  case CELLTYPE_EDIT:
366  WriteEditCell(rCell);
367  break;
368  case CELLTYPE_FORMULA:
369  WriteFormulaCell(rCell, sValue);
370  break;
371  default:
372  WriteEmptyCell();
373  }
374 }
375 
377 {
379  const ScChangeAction* pConstAction = pAction;
380  WriteBigRange(pConstAction->GetBigRange(), XML_CELL_ADDRESS);
381  WriteChangeInfo(pAction);
382  WriteDependings(pAction);
383  {
384  const ScChangeActionContent* pPrevAction = static_cast<const ScChangeActionContent*>(pAction)->GetPrevContent();
385  if (pPrevAction)
388  OUString sValue = static_cast<const ScChangeActionContent*>(pAction)->GetOldString(rExport.GetDocument());
389  WriteCell(static_cast<const ScChangeActionContent*>(pAction)->GetOldCell(), sValue);
390  }
391 }
392 
394 {
395  sal_Int64 nPosition(0);
396  sal_Int64 nCount(0);
397  sal_Int64 nStartPosition(0);
398  sal_Int64 nEndPosition(0);
399  sal_Int64 nStartColumn;
400  sal_Int64 nEndColumn;
401  sal_Int64 nStartRow;
402  sal_Int64 nEndRow;
403  sal_Int64 nStartSheet;
404  sal_Int64 nEndSheet;
405  const ScBigRange& rBigRange = pConstAction->GetBigRange();
406  rBigRange.GetVars(nStartColumn, nStartRow, nStartSheet,
407  nEndColumn, nEndRow, nEndSheet);
408  switch (pConstAction->GetType())
409  {
410  case SC_CAT_INSERT_COLS :
411  {
413  nStartPosition = nStartColumn;
414  nEndPosition = nEndColumn;
415  }
416  break;
417  case SC_CAT_INSERT_ROWS :
418  {
420  nStartPosition = nStartRow;
421  nEndPosition = nEndRow;
422  }
423  break;
424  case SC_CAT_INSERT_TABS :
425  {
427  nStartPosition = nStartSheet;
428  nEndPosition = nEndSheet;
429  }
430  break;
431  default :
432  {
433  OSL_FAIL("wrong insertion type");
434  }
435  break;
436  }
437  nPosition = nStartPosition;
438  nCount = nEndPosition - nStartPosition + 1;
439  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, OUString::number(nPosition));
440  OSL_ENSURE(nCount > 0, "wrong insertion count");
441  if (nCount > 1)
442  {
443  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_COUNT, OUString::number(nCount));
444  }
445  if (pConstAction->GetType() != SC_CAT_INSERT_TABS)
446  {
447  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE, OUString::number(nStartSheet));
448  }
449 }
450 
452 {
453  AddInsertionAttributes(pAction);
454  SvXMLElementExport aElemChange(rExport, XML_NAMESPACE_TABLE, XML_INSERTION, true, true);
455  WriteChangeInfo(pAction);
456  WriteDependings(pAction);
457 }
458 
460 {
461  sal_Int32 nPosition(0);
462  const ScBigRange& rBigRange = pDelAction->GetBigRange();
463  sal_Int64 nStartColumn(0);
464  sal_Int64 nEndColumn(0);
465  sal_Int64 nStartRow(0);
466  sal_Int64 nEndRow(0);
467  sal_Int64 nStartSheet(0);
468  sal_Int64 nEndSheet(0);
469  rBigRange.GetVars(nStartColumn, nStartRow, nStartSheet,
470  nEndColumn, nEndRow, nEndSheet);
471  switch (pDelAction->GetType())
472  {
473  case SC_CAT_DELETE_COLS :
474  {
476  nPosition = nStartColumn;
477  }
478  break;
479  case SC_CAT_DELETE_ROWS :
480  {
482  nPosition = nStartRow;
483  }
484  break;
485  case SC_CAT_DELETE_TABS :
486  {
488  nPosition = nStartSheet;
489  }
490  break;
491  default :
492  {
493  OSL_FAIL("wrong deletion type");
494  }
495  break;
496  }
497  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, OUString::number(nPosition));
498  if (pDelAction->GetType() == SC_CAT_DELETE_TABS)
499  return;
500 
501  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE, OUString::number(nStartSheet));
502  if (!pDelAction->IsMultiDelete() || pDelAction->GetDx() || pDelAction->GetDy())
503  return;
504 
505  const ScChangeAction* p = pDelAction->GetNext();
506  sal_Int32 nSlavesCount (1);
507  while (p)
508  {
509  if (p->GetType() != pDelAction->GetType())
510  break;
511  else
512  {
513  const ScChangeActionDel* pDel = static_cast<const ScChangeActionDel*>(p);
514  if ( (pDel->GetDx() > pDelAction->GetDx() || pDel->GetDy() > pDelAction->GetDy()) &&
515  pDel->GetBigRange() == pDelAction->GetBigRange() )
516  {
517  ++nSlavesCount;
518  p = p->GetNext();
519  }
520  else
521  break;
522  }
523  }
524 
525  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_MULTI_DELETION_SPANNED, OUString::number(nSlavesCount));
526 }
527 
529 {
530  const ScChangeActionIns* pCutOffIns = pAction->GetCutOffInsert();
531  const ScChangeActionDelMoveEntry* pLinkMove = pAction->GetFirstMoveEntry();
532  if (!(pCutOffIns || pLinkMove))
533  return;
534 
535  SvXMLElementExport aCutOffsElem (rExport, XML_NAMESPACE_TABLE, XML_CUT_OFFS, true, true);
536  if (pCutOffIns)
537  {
539  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, OUString::number(pAction->GetCutOffCount()));
540  SvXMLElementExport aInsertCutOffElem (rExport, XML_NAMESPACE_TABLE, XML_INSERTION_CUT_OFF, true, true);
541  }
542  while (pLinkMove)
543  {
545  if (pLinkMove->GetCutOffFrom() == pLinkMove->GetCutOffTo())
546  {
547  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, OUString::number(pLinkMove->GetCutOffFrom()));
548  }
549  else
550  {
551  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_START_POSITION, OUString::number(pLinkMove->GetCutOffFrom()));
552  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_END_POSITION, OUString::number(pLinkMove->GetCutOffTo()));
553  }
554  SvXMLElementExport aMoveCutOffElem (rExport, XML_NAMESPACE_TABLE, XML_MOVEMENT_CUT_OFF, true, true);
555  pLinkMove = pLinkMove->GetNext();
556  }
557 }
558 
560 {
561  ScChangeActionDel* pDelAction = static_cast<ScChangeActionDel*> (pAction);
562  AddDeletionAttributes(pDelAction);
563  SvXMLElementExport aElemChange(rExport, XML_NAMESPACE_TABLE, XML_DELETION, true, true);
564  WriteChangeInfo(pDelAction);
565  WriteDependings(pDelAction);
566  WriteCutOffs(pDelAction);
567 }
568 
570 {
571  const ScChangeActionMove* pMoveAction = static_cast<const ScChangeActionMove*> (pAction);
572  SvXMLElementExport aElemChange(rExport, XML_NAMESPACE_TABLE, XML_MOVEMENT, true, true);
575  WriteChangeInfo(pAction);
576  WriteDependings(pAction);
577 }
578 
580 {
581  SvXMLElementExport aElemChange(rExport, XML_NAMESPACE_TABLE, XML_REJECTION, true, true);
582  WriteChangeInfo(pAction);
583  WriteDependings(pAction);
584 }
585 
587 {
588  if (rCell.getType() != CELLTYPE_EDIT)
589  return;
590 
591  if (!pEditTextObj)
593 
594  pEditTextObj->SetText(*rCell.getEditText());
595  rExport.GetTextParagraphExport()->collectTextAutoStyles(pEditTextObj, false, false);
596 }
597 
599 {
600  if (pAction->GetType() != SC_CAT_CONTENT)
601  return;
602 
603  if (pChangeTrack->IsGenerated(pAction->GetActionNumber()))
604  CollectCellAutoStyles(static_cast<const ScChangeActionContent*>(pAction)->GetNewCell());
605  else
606  {
607  CollectCellAutoStyles(static_cast<const ScChangeActionContent*>(pAction)->GetOldCell());
608  if (static_cast<const ScChangeActionContent*>(pAction)->IsTopContent() && pAction->IsDeletedIn())
609  CollectCellAutoStyles(static_cast<const ScChangeActionContent*>(pAction)->GetNewCell());
610  }
611 }
612 
614 {
615  if (pAction->GetType() == SC_CAT_NONE)
616  {
617  SAL_WARN("sc.filter", "WorkWithChangeAction: type is not writable");
618  return;
619  }
621  GetAcceptanceState(pAction);
622  if (pAction->IsRejecting())
624  if (pAction->GetType() == SC_CAT_CONTENT)
625  WriteContentChange(pAction);
626  else if (pAction->IsInsertType())
627  WriteInsertion(pAction);
628  else if (pAction->IsDeleteType())
629  WriteDeletion(pAction);
630  else if (pAction->GetType() == SC_CAT_MOVE)
631  WriteMovement(pAction);
632  else if (pAction->GetType() == SC_CAT_REJECT)
633  WriteRejection(pAction);
634  else
635  {
636  assert(false); // tdf#73335 this would create duplicate attributes
637  }
639 }
640 
642 {
643  if (!pChangeTrack)
644  return;
645 
646  sal_uInt32 nCount (pChangeTrack->GetActionMax());
647  if (!nCount)
648  return;
649 
650  ScChangeAction* pAction = pChangeTrack->GetFirst();
651  CollectActionAutoStyles(pAction);
652  ScChangeAction* pLastAction = pChangeTrack->GetLast();
653  while (pAction != pLastAction)
654  {
655  pAction = pAction->GetNext();
656  CollectActionAutoStyles(pAction);
657  }
658  pAction = pChangeTrack->GetFirstGenerated();
659  while (pAction)
660  {
661  CollectActionAutoStyles(pAction);
662  pAction = pAction->GetNext();
663  }
664 }
665 
667 {
668  if (!pChangeTrack)
669  return;
670 
672  {
673  ScChangeAction* pAction = pChangeTrack->GetFirst();
674  if (pAction)
675  {
676  WorkWithChangeAction(pAction);
677  ScChangeAction* pLastAction = pChangeTrack->GetLast();
678  while (pAction != pLastAction)
679  {
680  pAction = pAction->GetNext();
681  WorkWithChangeAction(pAction);
682  }
683  }
684  }
685 }
686 
687 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void CollectCellAutoStyles(const ScCellValue &rCell)
bool IsGenerated(sal_uLong nAction) const
Definition: chgtrack.cxx:2109
XML_END_POSITION
void CollectActionAutoStyles(const ScChangeAction *pAction)
sal_Int32 nIndex
OUString getString() const
void GetAcceptanceState(const ScChangeAction *pAction)
void AddInsertionAttributes(const ScChangeAction *pAction)
constexpr sal_uInt16 XML_NAMESPACE_OFFICE
ScChangeActionType GetType() const
Definition: chgtrack.hxx:317
XML_DEPENDENCIES
const ScChangeActionLinkEntry * GetFirstDependentEntry() const
Definition: chgtrack.hxx:332
XML_INSERTION_CUT_OFF
ScChangeAction * GetNext() const
Definition: chgtrack.hxx:322
ScChangeAction * GetLast() const
Definition: chgtrack.hxx:954
static void ConvertDateTimeToString(const DateTime &aDateTime, OUStringBuffer &sDate)
XML_POSITION
OString sFormula
constexpr sal_uInt16 XML_NAMESPACE_OOOC
XML_START_POSITION
XML_NUMBER_MATRIX_ROWS_SPANNED
rtl::Reference< XMLTextParagraphExport > const & GetTextParagraphExport()
const SvXMLUnitConverter & GetMM100UnitConverter() const
XML_CELL_ADDRESS
void CheckAttrList()
const ScChangeActionDelMoveEntry * GetNext() const
Definition: chgtrack.hxx:417
CellType getType() const
Definition: cellvalue.cxx:291
XML_INSERTION
bool IsDeletedIn() const
Definition: chgtrack.cxx:316
const ScChangeActionIns * GetCutOffInsert() const
Definition: chgtrack.hxx:484
void AddDeletionAttributes(const ScChangeActionDel *pAction)
XML_MOVEMENT
const svl::SharedString * getSharedString() const
Definition: cellvalue.hxx:58
SvNumFormatType GetType(sal_uInt32 nFIndex) const
XML_VALUE_TYPE
XML_VALUE
bool IsMultiDelete() const
Definition: chgtrack.cxx:821
void WriteInsertion(const ScChangeAction *pAction)
XML_DELETIONS
sal_uLong GetActionMax() const
Definition: chgtrack.hxx:955
EditTextObject * getEditText() const
Definition: cellvalue.hxx:59
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.
XML_START_ROW
static void convertDouble(OUStringBuffer &rBuffer, double fNumber, bool bWriteUnits, sal_Int16 nSourceUnit, sal_Int16 nTargetUnit)
XML_COLUMN
XML_REJECTING_CHANGE_ID
Store arbitrary cell value of any kind.
Definition: cellvalue.hxx:31
void WriteValueCell(const ScCellValue &rCell, const OUString &sValue)
void WriteContentChange(const ScChangeAction *pAction)
const ScChangeActionLinkEntry * GetNext() const
Definition: chgtrack.hxx:167
const css::uno::Reference< css::frame::XModel > & GetModel() const
rtl::Reference< ScEditEngineTextObj > pEditTextObj
XML_FORMULA
A link/connection/dependency between change actions.
Definition: chgtrack.hxx:102
ScBigRange & GetFromRange()
Definition: chgtrack.hxx:526
int nCount
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
ScChangeAction * GetFirst() const
Definition: chgtrack.hxx:953
double getDouble() const
Definition: cellvalue.hxx:56
OUString GetNewString(const ScDocument *pDoc) const
Definition: chgtrack.cxx:1387
ScChangeTrack * GetChangeTrack() const
Definition: document.hxx:2486
XML_REJECTION
bool IsDeleteType() const
Definition: chgtrack.cxx:116
XML_FLOAT
XML_COUNT
ScFormulaCell * getFormula() const
Definition: cellvalue.hxx:57
XML_ACCEPTANCE_STATE
bool HasDeleted() const
Definition: chgtrack.cxx:380
ScChangeActionContent * GetFirstGenerated() const
Definition: chgtrack.hxx:952
void WriteCell(const ScCellValue &rCell, const OUString &sValue)
static OUString GetChangeID(const sal_uInt32 nActionNumber)
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
Definition: documen2.cxx:460
XML_CELL_CONTENT_CHANGE
SC_DLLPUBLIC bool IsAccepted() const
Definition: chgtrack.cxx:126
XML_P
XML_CREATOR
bool isEmpty() const
const DateTime & GetDateTimeUTC() const
Definition: chgtrack.hxx:315
constexpr sal_uInt16 XML_NAMESPACE_TEXT
void GetVars(sal_Int64 &nCol1, sal_Int64 &nRow1, sal_Int64 &nTab1, sal_Int64 &nCol2, sal_Int64 &nRow2, sal_Int64 &nTab2) const
Definition: bigrange.hxx:127
sal_Int16 SCCOL
Definition: types.hxx:21
const OUString & GetComment() const
Definition: chgtrack.hxx:350
XML_TABLE
void convertDateTime(OUStringBuffer &rBuffer, const double &fDateTime, bool const bAddTimeIf0AM=false)
XML_ACCEPTED
XML_DATE
bool IsNumberFormat(const OUString &sString, sal_uInt32 &F_Index, double &fOutNumber, SvNumInputOptions eInputOptions=SvNumInputOptions::NONE)
void WriteCutOffs(const ScChangeActionDel *pAction)
bool setNullDate(const css::uno::Reference< css::frame::XModel > &xModel)
SvNumFormatType
void WriteStringCell(const ScCellValue &rCell)
ScBigRange & GetBigRange()
Definition: chgtrack.hxx:231
void WriteGenerated(const ScChangeAction *pDependAction)
static void convertDuration(OUStringBuffer &rBuffer, const double fTime)
XML_START_COLUMN
formula::FormulaGrammar::Grammar GetStorageGrammar() const
Definition: document.hxx:2533
XML_END_COLUMN
XML_DEPENDENCY
XML_TARGET_RANGE_ADDRESS
OUString GetQNameByKey(sal_uInt16 nKey, const OUString &rLocalName, bool bCache=true) const
XML_CHANGE_DELETION
constexpr sal_uInt16 XML_NAMESPACE_DC
XML_MULTI_DELETION_SPANNED
void WriteDependings(const ScChangeAction *pAction)
const SvXMLNamespaceMap & GetNamespaceMap() const
XML_MATRIX_COVERED
XML_CELL_CONTENT_DELETION
void WriteDeletion(ScChangeAction *pAction)
XML_PREVIOUS
bool IsRejected() const
Definition: chgtrack.cxx:131
void SetValueAttributes(const double &fValue, const OUString &sValue)
sal_uLong GetActionNumber() const
Definition: chgtrack.hxx:319
XML_TRUE
short GetCutOffTo() const
Definition: chgtrack.hxx:424
ScDocument * GetDocument()
Definition: xmlexprt.hxx:240
sal_Int32 SCROW
Definition: types.hxx:17
SCCOL GetDx() const
Definition: chgtrack.hxx:478
XML_ID
constexpr sal_uInt16 XML_NAMESPACE_TABLE
XML_MOVEMENT_CUT_OFF
short GetCutOffFrom() const
Definition: chgtrack.hxx:423
bool isEmpty() const
Definition: cellvalue.cxx:514
XML_ROW
XML_TYPE
bool IsRejecting() const
Definition: chgtrack.cxx:136
void Characters(const OUString &rChars)
void WriteEditCell(const ScCellValue &rCell)
const ScChangeActionDelMoveEntry * GetFirstMoveEntry() const
Definition: chgtrack.hxx:482
bool HasDependent() const
Definition: chgtrack.cxx:375
XML_TRACKED_CHANGES
void * p
short GetCutOffCount() const
Definition: chgtrack.hxx:485
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:398
const ScChangeAction * GetAction() const
Definition: chgtrack.hxx:169
XMLTokenEnum
bool IsInsertType() const
Definition: chgtrack.cxx:111
constexpr sal_uInt16 XML_NAMESPACE_OF
XML_END_ROW
XML_START_TABLE
XML_DELETION
ScMatrixMode
XML_END_TABLE
XML_CUT_OFFS
const OUString & GetUser() const
Definition: chgtrack.hxx:349
XML_NUMBER_MATRIX_COLUMNS_SPANNED
void WriteRejection(const ScChangeAction *pAction)
XML_DATE_VALUE
static SC_DLLPUBLIC OUString GetString(const EditTextObject &rEditText, const ScDocument *pDoc)
Retrieves string with paragraphs delimited by new lines (' ').
Definition: editutil.cxx:119
XML_STRING
void WriteBigRange(const ScBigRange &rBigRange, xmloff::token::XMLTokenEnum aName)
#define SAL_WARN(area, stream)
XML_CHANGE_INFO
XML_TIME_VALUE
void WriteMovement(const ScChangeAction *pAction)
void WriteDeleted(const ScChangeAction *pDependAction)
const ScCellValue & GetNewCell() const
Definition: chgtrack.hxx:742
SCROW GetDy() const
Definition: chgtrack.hxx:479
const ScChangeActionLinkEntry * GetFirstDeletedEntry() const
Definition: chgtrack.hxx:330
XML_TIME
XML_REJECTED
void WriteDepending(const ScChangeAction *pDependAction)
void WriteChangeInfo(const ScChangeAction *pAction)
void WriteFormulaCell(const ScCellValue &rCell, const OUString &sValue)
sal_uLong GetRejectAction() const
Definition: chgtrack.hxx:320
XML_SOURCE_RANGE_ADDRESS
XML_CHANGE_TRACK_TABLE_CELL