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/zforlist.hxx>
36 #include <svl/sharedstring.hxx>
37 #include <sal/log.hxx>
38 
39 using namespace ::com::sun::star;
40 using namespace xmloff::token;
41 
43  : rExport(rTempExport),
44  pChangeTrack(nullptr),
45  pEditTextObj(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_Int32 nStartColumn;
70  sal_Int32 nEndColumn;
71  sal_Int32 nStartRow;
72  sal_Int32 nEndRow;
73  sal_Int32 nStartSheet;
74  sal_Int32 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;
133  static_cast<const ScChangeActionContent*>(pGeneratedAction)->GetNewString(sValue, rExport.GetDocument());
134  WriteCell(static_cast<const ScChangeActionContent*>(pGeneratedAction)->GetNewCell(), sValue);
135 }
136 
138 {
139  sal_uInt32 nActionNumber(pDeletedAction->GetActionNumber());
140  if (pDeletedAction->GetType() == SC_CAT_CONTENT)
141  {
142  const ScChangeActionContent* pContentAction = static_cast<const ScChangeActionContent*>(pDeletedAction);
143  if (pContentAction)
144  {
145  if (!pChangeTrack->IsGenerated(nActionNumber))
146  {
149  if (static_cast<const ScChangeActionContent*>(pDeletedAction)->IsTopContent() && pDeletedAction->IsDeletedIn())
150  {
151  OUString sValue;
152  pContentAction->GetNewString(sValue, rExport.GetDocument());
153  WriteCell(pContentAction->GetNewCell(), sValue);
154  }
155  }
156  else
157  WriteGenerated(pContentAction);
158  }
159  }
160  else
161  {
164  }
165 }
166 
168 {
169  sal_uInt32 nActionNumber(pDependAction->GetActionNumber());
171 
173  XML_DEPENDENCY, true, true);
174 }
175 
177 {
178  if (pAction->HasDependent())
179  {
180  SvXMLElementExport aDependingsElem (rExport, XML_NAMESPACE_TABLE, XML_DEPENDENCIES, true, true);
181  const ScChangeActionLinkEntry* pEntry = pAction->GetFirstDependentEntry();
182  while (pEntry)
183  {
184  WriteDepending(pEntry->GetAction());
185  pEntry = pEntry->GetNext();
186  }
187  }
188  if (pAction->HasDeleted())
189  {
190  SvXMLElementExport aDependingsElem (rExport, XML_NAMESPACE_TABLE, XML_DELETIONS, true, true);
191  const ScChangeActionLinkEntry* pEntry = pAction->GetFirstDeletedEntry();
192  while (pEntry)
193  {
194  WriteDeleted(pEntry->GetAction());
195  pEntry = pEntry->GetNext();
196  }
197  }
198 }
199 
201 {
203 }
204 
205 void ScChangeTrackingExportHelper::SetValueAttributes(const double& fValue, const OUString& sValue)
206 {
207  bool bSetAttributes(false);
208  if (!sValue.isEmpty())
209  {
210  sal_uInt32 nIndex = 0;
211  double fTempValue = 0.0;
212  if (rExport.GetDocument() && rExport.GetDocument()->GetFormatTable()->IsNumberFormat(sValue, nIndex, fTempValue))
213  {
215  if (nType & SvNumFormatType::DEFINED)
216  nType &= ~SvNumFormatType::DEFINED;
217  switch(nType)
218  {
219  case SvNumFormatType::DATE:
220  {
222  {
224  OUStringBuffer sBuffer;
225  rExport.GetMM100UnitConverter().convertDateTime(sBuffer, fTempValue);
226  rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_DATE_VALUE, sBuffer.makeStringAndClear());
227  bSetAttributes = true;
228  }
229  }
230  break;
231  case SvNumFormatType::TIME:
232  {
234  OUStringBuffer sBuffer;
235  ::sax::Converter::convertDuration(sBuffer, fTempValue);
236  rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_TIME_VALUE, sBuffer.makeStringAndClear());
237  bSetAttributes = true;
238  }
239  break;
240  default: break;
241  }
242  }
243  }
244  if (!bSetAttributes)
245  {
247  OUStringBuffer sBuffer;
248  ::sax::Converter::convertDouble(sBuffer, fValue);
249  OUString sNumValue(sBuffer.makeStringAndClear());
250  if (!sNumValue.isEmpty())
252  }
253 }
254 
255 void ScChangeTrackingExportHelper::WriteValueCell(const ScCellValue& rCell, const OUString& sValue)
256 {
257  assert(rCell.meType == CELLTYPE_VALUE);
258 
259  SetValueAttributes(rCell.mfValue, sValue);
261 }
262 
264 {
265  assert(rCell.meType == CELLTYPE_STRING);
266 
269  if (!rCell.mpString->isEmpty())
270  {
271  SvXMLElementExport aElemP(rExport, XML_NAMESPACE_TEXT, XML_P, true, false);
272  bool bPrevCharWasSpace(true);
273  rExport.GetTextParagraphExport()->exportCharacterData(rCell.mpString->getString(), bPrevCharWasSpace);
274  }
275 }
276 
278 {
279  assert(rCell.meType == CELLTYPE_EDIT);
280 
281  OUString sString;
282  if (rCell.mpEditText)
284 
287  if (rCell.mpEditText && !sString.isEmpty())
288  {
289  if (!pEditTextObj)
290  {
292  xText.set(pEditTextObj);
293  }
295  if (xText.is())
296  rExport.GetTextParagraphExport()->exportText(xText, false, false);
297  }
298 }
299 
300 void ScChangeTrackingExportHelper::WriteFormulaCell(const ScCellValue& rCell, const OUString& sValue)
301 {
302  assert(rCell.meType == CELLTYPE_FORMULA);
303 
304  ScFormulaCell* pFormulaCell = rCell.mpFormula;
305  OUString sAddress;
306  const ScDocument* pDoc = rExport.GetDocument();
309  const formula::FormulaGrammar::Grammar eGrammar = pDoc->GetStorageGrammar();
310  sal_uInt16 nNamespacePrefix = (eGrammar == formula::FormulaGrammar::GRAM_ODFF ? XML_NAMESPACE_OF : XML_NAMESPACE_OOOC);
311  OUString sFormula;
312  pFormulaCell->GetFormula(sFormula, eGrammar);
313  ScMatrixMode nMatrixFlag(pFormulaCell->GetMatrixFlag());
314  if (nMatrixFlag != ScMatrixMode::NONE)
315  {
316  if (nMatrixFlag == ScMatrixMode::Formula)
317  {
318  SCCOL nColumns;
319  SCROW nRows;
320  pFormulaCell->GetMatColsRows(nColumns, nRows);
323  }
324  else
325  {
327  }
328  OUString sMatrixFormula = sFormula.copy(1, sFormula.getLength() - 2);
329  OUString sQValue = rExport.GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sMatrixFormula, false );
331  }
332  else
333  {
334  OUString sQValue = rExport.GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sFormula, false );
336  }
337  if (pFormulaCell->IsValue())
338  {
339  SetValueAttributes(pFormulaCell->GetValue(), sValue);
341  }
342  else
343  {
345  OUString sCellValue = pFormulaCell->GetString().getString();
347  if (!sCellValue.isEmpty())
348  {
349  SvXMLElementExport aElemP(rExport, XML_NAMESPACE_TEXT, XML_P, true, false);
350  bool bPrevCharWasSpace(true);
351  rExport.GetTextParagraphExport()->exportCharacterData(sCellValue, bPrevCharWasSpace);
352  }
353  }
354 }
355 
356 void ScChangeTrackingExportHelper::WriteCell(const ScCellValue& rCell, const OUString& sValue)
357 {
358  if (rCell.isEmpty())
359  {
360  WriteEmptyCell();
361  return;
362  }
363 
364  switch (rCell.meType)
365  {
366  case CELLTYPE_VALUE:
367  WriteValueCell(rCell, sValue);
368  break;
369  case CELLTYPE_STRING:
370  WriteStringCell(rCell);
371  break;
372  case CELLTYPE_EDIT:
373  WriteEditCell(rCell);
374  break;
375  case CELLTYPE_FORMULA:
376  WriteFormulaCell(rCell, sValue);
377  break;
378  default:
379  WriteEmptyCell();
380  }
381 }
382 
384 {
386  const ScChangeAction* pConstAction = pAction;
387  WriteBigRange(pConstAction->GetBigRange(), XML_CELL_ADDRESS);
388  WriteChangeInfo(pAction);
389  WriteDependings(pAction);
390  {
391  const ScChangeActionContent* pPrevAction = static_cast<const ScChangeActionContent*>(pAction)->GetPrevContent();
392  if (pPrevAction)
395  OUString sValue;
396  static_cast<const ScChangeActionContent*>(pAction)->GetOldString(sValue, rExport.GetDocument());
397  WriteCell(static_cast<const ScChangeActionContent*>(pAction)->GetOldCell(), sValue);
398  }
399 }
400 
402 {
403  sal_Int32 nPosition(0);
404  sal_Int32 nCount(0);
405  sal_Int32 nStartPosition(0);
406  sal_Int32 nEndPosition(0);
407  sal_Int32 nStartColumn;
408  sal_Int32 nEndColumn;
409  sal_Int32 nStartRow;
410  sal_Int32 nEndRow;
411  sal_Int32 nStartSheet;
412  sal_Int32 nEndSheet;
413  const ScBigRange& rBigRange = pConstAction->GetBigRange();
414  rBigRange.GetVars(nStartColumn, nStartRow, nStartSheet,
415  nEndColumn, nEndRow, nEndSheet);
416  switch (pConstAction->GetType())
417  {
418  case SC_CAT_INSERT_COLS :
419  {
421  nStartPosition = nStartColumn;
422  nEndPosition = nEndColumn;
423  }
424  break;
425  case SC_CAT_INSERT_ROWS :
426  {
428  nStartPosition = nStartRow;
429  nEndPosition = nEndRow;
430  }
431  break;
432  case SC_CAT_INSERT_TABS :
433  {
435  nStartPosition = nStartSheet;
436  nEndPosition = nEndSheet;
437  }
438  break;
439  default :
440  {
441  OSL_FAIL("wrong insertion type");
442  }
443  break;
444  }
445  nPosition = nStartPosition;
446  nCount = nEndPosition - nStartPosition + 1;
447  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, OUString::number(nPosition));
448  OSL_ENSURE(nCount > 0, "wrong insertion count");
449  if (nCount > 1)
450  {
451  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_COUNT, OUString::number(nCount));
452  }
453  if (pConstAction->GetType() != SC_CAT_INSERT_TABS)
454  {
455  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE, OUString::number(nStartSheet));
456  }
457 }
458 
460 {
461  AddInsertionAttributes(pAction);
462  SvXMLElementExport aElemChange(rExport, XML_NAMESPACE_TABLE, XML_INSERTION, true, true);
463  WriteChangeInfo(pAction);
464  WriteDependings(pAction);
465 }
466 
468 {
469  sal_Int32 nPosition(0);
470  const ScBigRange& rBigRange = pDelAction->GetBigRange();
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);
479  switch (pDelAction->GetType())
480  {
481  case SC_CAT_DELETE_COLS :
482  {
484  nPosition = nStartColumn;
485  }
486  break;
487  case SC_CAT_DELETE_ROWS :
488  {
490  nPosition = nStartRow;
491  }
492  break;
493  case SC_CAT_DELETE_TABS :
494  {
496  nPosition = nStartSheet;
497  }
498  break;
499  default :
500  {
501  OSL_FAIL("wrong deletion type");
502  }
503  break;
504  }
505  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, OUString::number(nPosition));
506  if (pDelAction->GetType() == SC_CAT_DELETE_TABS)
507  return;
508 
509  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE, OUString::number(nStartSheet));
510  if (!pDelAction->IsMultiDelete() || pDelAction->GetDx() || pDelAction->GetDy())
511  return;
512 
513  const ScChangeAction* p = pDelAction->GetNext();
514  sal_Int32 nSlavesCount (1);
515  while (p)
516  {
517  if (p->GetType() != pDelAction->GetType())
518  break;
519  else
520  {
521  const ScChangeActionDel* pDel = static_cast<const ScChangeActionDel*>(p);
522  if ( (pDel->GetDx() > pDelAction->GetDx() || pDel->GetDy() > pDelAction->GetDy()) &&
523  pDel->GetBigRange() == pDelAction->GetBigRange() )
524  {
525  ++nSlavesCount;
526  p = p->GetNext();
527  }
528  else
529  break;
530  }
531  }
532 
533  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_MULTI_DELETION_SPANNED, OUString::number(nSlavesCount));
534 }
535 
537 {
538  const ScChangeActionIns* pCutOffIns = pAction->GetCutOffInsert();
539  const ScChangeActionDelMoveEntry* pLinkMove = pAction->GetFirstMoveEntry();
540  if (!(pCutOffIns || pLinkMove))
541  return;
542 
543  SvXMLElementExport aCutOffsElem (rExport, XML_NAMESPACE_TABLE, XML_CUT_OFFS, true, true);
544  if (pCutOffIns)
545  {
547  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, OUString::number(pAction->GetCutOffCount()));
548  SvXMLElementExport aInsertCutOffElem (rExport, XML_NAMESPACE_TABLE, XML_INSERTION_CUT_OFF, true, true);
549  }
550  while (pLinkMove)
551  {
553  if (pLinkMove->GetCutOffFrom() == pLinkMove->GetCutOffTo())
554  {
555  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, OUString::number(pLinkMove->GetCutOffFrom()));
556  }
557  else
558  {
559  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_START_POSITION, OUString::number(pLinkMove->GetCutOffFrom()));
560  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_END_POSITION, OUString::number(pLinkMove->GetCutOffTo()));
561  }
562  SvXMLElementExport aMoveCutOffElem (rExport, XML_NAMESPACE_TABLE, XML_MOVEMENT_CUT_OFF, true, true);
563  pLinkMove = pLinkMove->GetNext();
564  }
565 }
566 
568 {
569  ScChangeActionDel* pDelAction = static_cast<ScChangeActionDel*> (pAction);
570  AddDeletionAttributes(pDelAction);
571  SvXMLElementExport aElemChange(rExport, XML_NAMESPACE_TABLE, XML_DELETION, true, true);
572  WriteChangeInfo(pDelAction);
573  WriteDependings(pDelAction);
574  WriteCutOffs(pDelAction);
575 }
576 
578 {
579  const ScChangeActionMove* pMoveAction = static_cast<const ScChangeActionMove*> (pAction);
580  SvXMLElementExport aElemChange(rExport, XML_NAMESPACE_TABLE, XML_MOVEMENT, true, true);
583  WriteChangeInfo(pAction);
584  WriteDependings(pAction);
585 }
586 
588 {
589  SvXMLElementExport aElemChange(rExport, XML_NAMESPACE_TABLE, XML_REJECTION, true, true);
590  WriteChangeInfo(pAction);
591  WriteDependings(pAction);
592 }
593 
595 {
596  if (rCell.meType != CELLTYPE_EDIT)
597  return;
598 
599  if (!pEditTextObj)
600  {
602  xText.set(pEditTextObj);
603  }
604 
606  if (xText.is())
607  rExport.GetTextParagraphExport()->collectTextAutoStyles(xText, false, false);
608 }
609 
611 {
612  if (pAction->GetType() != SC_CAT_CONTENT)
613  return;
614 
615  if (pChangeTrack->IsGenerated(pAction->GetActionNumber()))
616  CollectCellAutoStyles(static_cast<const ScChangeActionContent*>(pAction)->GetNewCell());
617  else
618  {
619  CollectCellAutoStyles(static_cast<const ScChangeActionContent*>(pAction)->GetOldCell());
620  if (static_cast<const ScChangeActionContent*>(pAction)->IsTopContent() && pAction->IsDeletedIn())
621  CollectCellAutoStyles(static_cast<const ScChangeActionContent*>(pAction)->GetNewCell());
622  }
623 }
624 
626 {
627  if (pAction->GetType() == SC_CAT_NONE)
628  {
629  SAL_WARN("sc.filter", "WorkWithChangeAction: type is not writable");
630  return;
631  }
633  GetAcceptanceState(pAction);
634  if (pAction->IsRejecting())
636  if (pAction->GetType() == SC_CAT_CONTENT)
637  WriteContentChange(pAction);
638  else if (pAction->IsInsertType())
639  WriteInsertion(pAction);
640  else if (pAction->IsDeleteType())
641  WriteDeletion(pAction);
642  else if (pAction->GetType() == SC_CAT_MOVE)
643  WriteMovement(pAction);
644  else if (pAction->GetType() == SC_CAT_REJECT)
645  WriteRejection(pAction);
646  else
647  {
648  assert(false); // tdf#73335 this would create duplicate attributes
649  }
651 }
652 
654 {
655  if (!pChangeTrack)
656  return;
657 
658  sal_uInt32 nCount (pChangeTrack->GetActionMax());
659  if (!nCount)
660  return;
661 
662  ScChangeAction* pAction = pChangeTrack->GetFirst();
663  CollectActionAutoStyles(pAction);
664  ScChangeAction* pLastAction = pChangeTrack->GetLast();
665  while (pAction != pLastAction)
666  {
667  pAction = pAction->GetNext();
668  CollectActionAutoStyles(pAction);
669  }
670  pAction = pChangeTrack->GetFirstGenerated();
671  while (pAction)
672  {
673  CollectActionAutoStyles(pAction);
674  pAction = pAction->GetNext();
675  }
676 }
677 
679 {
680  if (!pChangeTrack)
681  return;
682 
684  {
685  ScChangeAction* pAction = pChangeTrack->GetFirst();
686  if (pAction)
687  {
688  WorkWithChangeAction(pAction);
689  ScChangeAction* pLastAction = pChangeTrack->GetLast();
690  while (pAction != pLastAction)
691  {
692  pAction = pAction->GetNext();
693  WorkWithChangeAction(pAction);
694  }
695  }
696  }
697 }
698 
699 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void CollectCellAutoStyles(const ScCellValue &rCell)
bool IsGenerated(sal_uLong nAction) const
Definition: chgtrack.cxx:2161
XML_CUT_OFFS
void CollectActionAutoStyles(const ScChangeAction *pAction)
sal_Int32 nIndex
CellType meType
Definition: cellvalue.hxx:38
OUString getString() const
XML_REJECTING_CHANGE_ID
void GetAcceptanceState(const ScChangeAction *pAction)
void AddInsertionAttributes(const ScChangeAction *pAction)
constexpr sal_uInt16 XML_NAMESPACE_OFFICE
XML_VALUE_TYPE
ScChangeActionType GetType() const
Definition: chgtrack.hxx:318
XML_CHANGE_TRACK_TABLE_CELL
const ScChangeActionLinkEntry * GetFirstDependentEntry() const
Definition: chgtrack.hxx:333
XML_STRING
ScChangeAction * GetNext() const
Definition: chgtrack.hxx:323
XML_ID
ScChangeAction * GetLast() const
Definition: chgtrack.hxx:960
static void ConvertDateTimeToString(const DateTime &aDateTime, OUStringBuffer &sDate)
XML_COLUMN
constexpr sal_uInt16 XML_NAMESPACE_OOOC
rtl::Reference< XMLTextParagraphExport > const & GetTextParagraphExport()
void GetFormula(OUString &rFormula, const formula::FormulaGrammar::Grammar=formula::FormulaGrammar::GRAM_DEFAULT, const ScInterpreterContext *pContext=nullptr) const
const SvXMLUnitConverter & GetMM100UnitConverter() const
void CheckAttrList()
const ScChangeActionDelMoveEntry * GetNext() const
Definition: chgtrack.hxx:420
bool IsDeletedIn() const
Definition: chgtrack.cxx:324
const ScChangeActionIns * GetCutOffInsert() const
Definition: chgtrack.hxx:487
XML_DELETION
XML_POSITION
void AddDeletionAttributes(const ScChangeActionDel *pAction)
XML_VALUE
XML_REJECTED
SvNumFormatType GetType(sal_uInt32 nFIndex) const
double mfValue
Definition: cellvalue.hxx:40
bool IsMultiDelete() const
Definition: chgtrack.cxx:854
XML_END_COLUMN
void WriteInsertion(const ScChangeAction *pAction)
XML_CHANGE_INFO
sal_uLong GetActionMax() const
Definition: chgtrack.hxx:961
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)
XML_REJECTION
XML_END_POSITION
Store arbitrary cell value of any kind.
Definition: cellvalue.hxx:36
void WriteValueCell(const ScCellValue &rCell, const OUString &sValue)
void WriteContentChange(const ScChangeAction *pAction)
const ScChangeActionLinkEntry * GetNext() const
Definition: chgtrack.hxx:168
const css::uno::Reference< css::frame::XModel > & GetModel() const
XML_CELL_CONTENT_CHANGE
XML_ROW
A link/connection/dependency between change actions.
Definition: chgtrack.hxx:103
ScFormulaCell * mpFormula
Definition: cellvalue.hxx:43
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
XML_TABLE
double GetValue()
ScBigRange & GetFromRange()
Definition: chgtrack.hxx:529
int nCount
XML_TYPE
XML_ACCEPTED
void AddAttribute(sal_uInt16 nPrefix, const char *pName, const OUString &rValue)
ScChangeAction * GetFirst() const
Definition: chgtrack.hxx:959
ScAddress aPos
XML_END_ROW
XML_DEPENDENCY
ScChangeTrack * GetChangeTrack() const
Definition: document.hxx:2398
XML_CREATOR
XMLTokenEnum
bool IsDeleteType() const
Definition: chgtrack.cxx:124
XML_MOVEMENT
bool HasDeleted() const
Definition: chgtrack.cxx:388
ScChangeActionContent * GetFirstGenerated() const
Definition: chgtrack.hxx:958
void WriteCell(const ScCellValue &rCell, const OUString &sValue)
XML_FLOAT
static OUString GetChangeID(const sal_uInt32 nActionNumber)
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
Definition: documen2.cxx:438
SC_DLLPUBLIC bool IsAccepted() const
Definition: chgtrack.cxx:134
XML_DATE
bool isEmpty() const
const DateTime & GetDateTimeUTC() const
Definition: chgtrack.hxx:316
XML_DELETIONS
constexpr sal_uInt16 XML_NAMESPACE_TEXT
XML_TIME
XML_PREVIOUS
sal_Int16 SCCOL
Definition: types.hxx:22
XML_CELL_ADDRESS
const OUString & GetComment() const
Definition: chgtrack.hxx:353
svl::SharedString * mpString
Definition: cellvalue.hxx:41
void convertDateTime(OUStringBuffer &rBuffer, const double &fDateTime, bool const bAddTimeIf0AM=false)
bool IsNumberFormat(const OUString &sString, sal_uInt32 &F_Index, double &fOutNumber, SvNumInputOptions eInputOptions=SvNumInputOptions::NONE)
XML_DEPENDENCIES
void GetNewString(OUString &rStr, const ScDocument *pDoc) const
Definition: chgtrack.cxx:1428
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:232
void WriteGenerated(const ScChangeAction *pDependAction)
static void convertDuration(OUStringBuffer &rBuffer, const double fTime)
formula::FormulaGrammar::Grammar GetStorageGrammar() const
Definition: document.hxx:2445
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)
XML_END_TABLE
bool IsRejected() const
Definition: chgtrack.cxx:139
void SetValueAttributes(const double &fValue, const OUString &sValue)
sal_uLong GetActionNumber() const
Definition: chgtrack.hxx:320
XML_NUMBER_MATRIX_ROWS_SPANNED
XML_MOVEMENT_CUT_OFF
XML_TRACKED_CHANGES
svl::SharedString GetString()
short GetCutOffTo() const
Definition: chgtrack.hxx:427
ScDocument * GetDocument()
Definition: xmlexprt.hxx:240
void SetText(const EditTextObject &rTextObject)
Definition: textuno.cxx:742
sal_Int32 SCROW
Definition: types.hxx:18
XML_NUMBER_MATRIX_COLUMNS_SPANNED
SCCOL GetDx() const
Definition: chgtrack.hxx:481
constexpr sal_uInt16 XML_NAMESPACE_TABLE
XML_CELL_CONTENT_DELETION
short GetCutOffFrom() const
Definition: chgtrack.hxx:426
bool isEmpty() const
Definition: cellvalue.cxx:499
XML_MULTI_DELETION_SPANNED
XML_START_ROW
void GetMatColsRows(SCCOL &nCols, SCROW &nRows) const
bool IsRejecting() const
Definition: chgtrack.cxx:144
void Characters(const OUString &rChars)
XML_P
void WriteEditCell(const ScCellValue &rCell)
const ScChangeActionDelMoveEntry * GetFirstMoveEntry() const
Definition: chgtrack.hxx:485
bool HasDependent() const
Definition: chgtrack.cxx:383
void * p
short GetCutOffCount() const
Definition: chgtrack.hxx:488
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:401
const ScChangeAction * GetAction() const
Definition: chgtrack.hxx:170
bool IsInsertType() const
Definition: chgtrack.cxx:119
constexpr sal_uInt16 XML_NAMESPACE_OF
XML_TARGET_RANGE_ADDRESS
ScMatrixMode
EditTextObject * mpEditText
Definition: cellvalue.hxx:42
const OUString & GetUser() const
Definition: chgtrack.hxx:352
XML_TRUE
void WriteRejection(const ScChangeAction *pAction)
static SC_DLLPUBLIC OUString GetString(const EditTextObject &rEditText, const ScDocument *pDoc)
Retrieves string with paragraphs delimited by new lines (' ').
Definition: editutil.cxx:115
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
Definition: bigrange.hxx:130
XML_COUNT
XML_ACCEPTANCE_STATE
void WriteMovement(const ScChangeAction *pAction)
void WriteDeleted(const ScChangeAction *pDependAction)
const ScCellValue & GetNewCell() const
Definition: chgtrack.hxx:747
XML_INSERTION_CUT_OFF
XML_DATE_VALUE
XML_START_COLUMN
SCROW GetDy() const
Definition: chgtrack.hxx:482
XML_CHANGE_DELETION
XML_TIME_VALUE
ScMatrixMode GetMatrixFlag() const
const ScChangeActionLinkEntry * GetFirstDeletedEntry() const
Definition: chgtrack.hxx:331
XML_START_TABLE
css::uno::Any const SvXMLExport & rExport
XML_MATRIX_COVERED
void WriteDepending(const ScChangeAction *pDependAction)
void WriteChangeInfo(const ScChangeAction *pAction)
XML_SOURCE_RANGE_ADDRESS
XML_INSERTION
void WriteFormulaCell(const ScCellValue &rCell, const OUString &sValue)
sal_uLong GetRejectAction() const
Definition: chgtrack.hxx:321
css::uno::Reference< css::text::XText > xText
XML_START_POSITION
XML_FORMULA