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_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)
291  pEditTextObj->SetText(*rCell.mpEditText);
292  rExport.GetTextParagraphExport()->exportText(pEditTextObj, false, false);
293  }
294 }
295 
296 void ScChangeTrackingExportHelper::WriteFormulaCell(const ScCellValue& rCell, const OUString& sValue)
297 {
298  assert(rCell.meType == CELLTYPE_FORMULA);
299 
300  ScFormulaCell* pFormulaCell = rCell.mpFormula;
301  OUString sAddress;
302  const ScDocument* pDoc = rExport.GetDocument();
305  const formula::FormulaGrammar::Grammar eGrammar = pDoc->GetStorageGrammar();
306  sal_uInt16 nNamespacePrefix = (eGrammar == formula::FormulaGrammar::GRAM_ODFF ? XML_NAMESPACE_OF : XML_NAMESPACE_OOOC);
307  OUString sFormula;
308  pFormulaCell->GetFormula(sFormula, eGrammar);
309  ScMatrixMode nMatrixFlag(pFormulaCell->GetMatrixFlag());
310  if (nMatrixFlag != ScMatrixMode::NONE)
311  {
312  if (nMatrixFlag == ScMatrixMode::Formula)
313  {
314  SCCOL nColumns;
315  SCROW nRows;
316  pFormulaCell->GetMatColsRows(nColumns, nRows);
319  }
320  else
321  {
323  }
324  OUString sMatrixFormula = sFormula.copy(1, sFormula.getLength() - 2);
325  OUString sQValue = rExport.GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sMatrixFormula, false );
327  }
328  else
329  {
330  OUString sQValue = rExport.GetNamespaceMap().GetQNameByKey( nNamespacePrefix, sFormula, false );
332  }
333  if (pFormulaCell->IsValue())
334  {
335  SetValueAttributes(pFormulaCell->GetValue(), sValue);
337  }
338  else
339  {
341  OUString sCellValue = pFormulaCell->GetString().getString();
343  if (!sCellValue.isEmpty())
344  {
345  SvXMLElementExport aElemP(rExport, XML_NAMESPACE_TEXT, XML_P, true, false);
346  bool bPrevCharWasSpace(true);
347  rExport.GetTextParagraphExport()->exportCharacterData(sCellValue, bPrevCharWasSpace);
348  }
349  }
350 }
351 
352 void ScChangeTrackingExportHelper::WriteCell(const ScCellValue& rCell, const OUString& sValue)
353 {
354  if (rCell.isEmpty())
355  {
356  WriteEmptyCell();
357  return;
358  }
359 
360  switch (rCell.meType)
361  {
362  case CELLTYPE_VALUE:
363  WriteValueCell(rCell, sValue);
364  break;
365  case CELLTYPE_STRING:
366  WriteStringCell(rCell);
367  break;
368  case CELLTYPE_EDIT:
369  WriteEditCell(rCell);
370  break;
371  case CELLTYPE_FORMULA:
372  WriteFormulaCell(rCell, sValue);
373  break;
374  default:
375  WriteEmptyCell();
376  }
377 }
378 
380 {
382  const ScChangeAction* pConstAction = pAction;
383  WriteBigRange(pConstAction->GetBigRange(), XML_CELL_ADDRESS);
384  WriteChangeInfo(pAction);
385  WriteDependings(pAction);
386  {
387  const ScChangeActionContent* pPrevAction = static_cast<const ScChangeActionContent*>(pAction)->GetPrevContent();
388  if (pPrevAction)
391  OUString sValue;
392  static_cast<const ScChangeActionContent*>(pAction)->GetOldString(sValue, rExport.GetDocument());
393  WriteCell(static_cast<const ScChangeActionContent*>(pAction)->GetOldCell(), sValue);
394  }
395 }
396 
398 {
399  sal_Int32 nPosition(0);
400  sal_Int32 nCount(0);
401  sal_Int32 nStartPosition(0);
402  sal_Int32 nEndPosition(0);
403  sal_Int32 nStartColumn;
404  sal_Int32 nEndColumn;
405  sal_Int32 nStartRow;
406  sal_Int32 nEndRow;
407  sal_Int32 nStartSheet;
408  sal_Int32 nEndSheet;
409  const ScBigRange& rBigRange = pConstAction->GetBigRange();
410  rBigRange.GetVars(nStartColumn, nStartRow, nStartSheet,
411  nEndColumn, nEndRow, nEndSheet);
412  switch (pConstAction->GetType())
413  {
414  case SC_CAT_INSERT_COLS :
415  {
417  nStartPosition = nStartColumn;
418  nEndPosition = nEndColumn;
419  }
420  break;
421  case SC_CAT_INSERT_ROWS :
422  {
424  nStartPosition = nStartRow;
425  nEndPosition = nEndRow;
426  }
427  break;
428  case SC_CAT_INSERT_TABS :
429  {
431  nStartPosition = nStartSheet;
432  nEndPosition = nEndSheet;
433  }
434  break;
435  default :
436  {
437  OSL_FAIL("wrong insertion type");
438  }
439  break;
440  }
441  nPosition = nStartPosition;
442  nCount = nEndPosition - nStartPosition + 1;
443  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, OUString::number(nPosition));
444  OSL_ENSURE(nCount > 0, "wrong insertion count");
445  if (nCount > 1)
446  {
447  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_COUNT, OUString::number(nCount));
448  }
449  if (pConstAction->GetType() != SC_CAT_INSERT_TABS)
450  {
451  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE, OUString::number(nStartSheet));
452  }
453 }
454 
456 {
457  AddInsertionAttributes(pAction);
458  SvXMLElementExport aElemChange(rExport, XML_NAMESPACE_TABLE, XML_INSERTION, true, true);
459  WriteChangeInfo(pAction);
460  WriteDependings(pAction);
461 }
462 
464 {
465  sal_Int32 nPosition(0);
466  const ScBigRange& rBigRange = pDelAction->GetBigRange();
467  sal_Int32 nStartColumn(0);
468  sal_Int32 nEndColumn(0);
469  sal_Int32 nStartRow(0);
470  sal_Int32 nEndRow(0);
471  sal_Int32 nStartSheet(0);
472  sal_Int32 nEndSheet(0);
473  rBigRange.GetVars(nStartColumn, nStartRow, nStartSheet,
474  nEndColumn, nEndRow, nEndSheet);
475  switch (pDelAction->GetType())
476  {
477  case SC_CAT_DELETE_COLS :
478  {
480  nPosition = nStartColumn;
481  }
482  break;
483  case SC_CAT_DELETE_ROWS :
484  {
486  nPosition = nStartRow;
487  }
488  break;
489  case SC_CAT_DELETE_TABS :
490  {
492  nPosition = nStartSheet;
493  }
494  break;
495  default :
496  {
497  OSL_FAIL("wrong deletion type");
498  }
499  break;
500  }
501  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, OUString::number(nPosition));
502  if (pDelAction->GetType() == SC_CAT_DELETE_TABS)
503  return;
504 
505  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE, OUString::number(nStartSheet));
506  if (!pDelAction->IsMultiDelete() || pDelAction->GetDx() || pDelAction->GetDy())
507  return;
508 
509  const ScChangeAction* p = pDelAction->GetNext();
510  sal_Int32 nSlavesCount (1);
511  while (p)
512  {
513  if (p->GetType() != pDelAction->GetType())
514  break;
515  else
516  {
517  const ScChangeActionDel* pDel = static_cast<const ScChangeActionDel*>(p);
518  if ( (pDel->GetDx() > pDelAction->GetDx() || pDel->GetDy() > pDelAction->GetDy()) &&
519  pDel->GetBigRange() == pDelAction->GetBigRange() )
520  {
521  ++nSlavesCount;
522  p = p->GetNext();
523  }
524  else
525  break;
526  }
527  }
528 
529  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_MULTI_DELETION_SPANNED, OUString::number(nSlavesCount));
530 }
531 
533 {
534  const ScChangeActionIns* pCutOffIns = pAction->GetCutOffInsert();
535  const ScChangeActionDelMoveEntry* pLinkMove = pAction->GetFirstMoveEntry();
536  if (!(pCutOffIns || pLinkMove))
537  return;
538 
539  SvXMLElementExport aCutOffsElem (rExport, XML_NAMESPACE_TABLE, XML_CUT_OFFS, true, true);
540  if (pCutOffIns)
541  {
543  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, OUString::number(pAction->GetCutOffCount()));
544  SvXMLElementExport aInsertCutOffElem (rExport, XML_NAMESPACE_TABLE, XML_INSERTION_CUT_OFF, true, true);
545  }
546  while (pLinkMove)
547  {
549  if (pLinkMove->GetCutOffFrom() == pLinkMove->GetCutOffTo())
550  {
551  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_POSITION, OUString::number(pLinkMove->GetCutOffFrom()));
552  }
553  else
554  {
555  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_START_POSITION, OUString::number(pLinkMove->GetCutOffFrom()));
556  rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_END_POSITION, OUString::number(pLinkMove->GetCutOffTo()));
557  }
558  SvXMLElementExport aMoveCutOffElem (rExport, XML_NAMESPACE_TABLE, XML_MOVEMENT_CUT_OFF, true, true);
559  pLinkMove = pLinkMove->GetNext();
560  }
561 }
562 
564 {
565  ScChangeActionDel* pDelAction = static_cast<ScChangeActionDel*> (pAction);
566  AddDeletionAttributes(pDelAction);
567  SvXMLElementExport aElemChange(rExport, XML_NAMESPACE_TABLE, XML_DELETION, true, true);
568  WriteChangeInfo(pDelAction);
569  WriteDependings(pDelAction);
570  WriteCutOffs(pDelAction);
571 }
572 
574 {
575  const ScChangeActionMove* pMoveAction = static_cast<const ScChangeActionMove*> (pAction);
576  SvXMLElementExport aElemChange(rExport, XML_NAMESPACE_TABLE, XML_MOVEMENT, true, true);
579  WriteChangeInfo(pAction);
580  WriteDependings(pAction);
581 }
582 
584 {
585  SvXMLElementExport aElemChange(rExport, XML_NAMESPACE_TABLE, XML_REJECTION, true, true);
586  WriteChangeInfo(pAction);
587  WriteDependings(pAction);
588 }
589 
591 {
592  if (rCell.meType != CELLTYPE_EDIT)
593  return;
594 
595  if (!pEditTextObj)
597 
598  pEditTextObj->SetText(*rCell.mpEditText);
599  rExport.GetTextParagraphExport()->collectTextAutoStyles(pEditTextObj, false, false);
600 }
601 
603 {
604  if (pAction->GetType() != SC_CAT_CONTENT)
605  return;
606 
607  if (pChangeTrack->IsGenerated(pAction->GetActionNumber()))
608  CollectCellAutoStyles(static_cast<const ScChangeActionContent*>(pAction)->GetNewCell());
609  else
610  {
611  CollectCellAutoStyles(static_cast<const ScChangeActionContent*>(pAction)->GetOldCell());
612  if (static_cast<const ScChangeActionContent*>(pAction)->IsTopContent() && pAction->IsDeletedIn())
613  CollectCellAutoStyles(static_cast<const ScChangeActionContent*>(pAction)->GetNewCell());
614  }
615 }
616 
618 {
619  if (pAction->GetType() == SC_CAT_NONE)
620  {
621  SAL_WARN("sc.filter", "WorkWithChangeAction: type is not writable");
622  return;
623  }
625  GetAcceptanceState(pAction);
626  if (pAction->IsRejecting())
628  if (pAction->GetType() == SC_CAT_CONTENT)
629  WriteContentChange(pAction);
630  else if (pAction->IsInsertType())
631  WriteInsertion(pAction);
632  else if (pAction->IsDeleteType())
633  WriteDeletion(pAction);
634  else if (pAction->GetType() == SC_CAT_MOVE)
635  WriteMovement(pAction);
636  else if (pAction->GetType() == SC_CAT_REJECT)
637  WriteRejection(pAction);
638  else
639  {
640  assert(false); // tdf#73335 this would create duplicate attributes
641  }
643 }
644 
646 {
647  if (!pChangeTrack)
648  return;
649 
650  sal_uInt32 nCount (pChangeTrack->GetActionMax());
651  if (!nCount)
652  return;
653 
654  ScChangeAction* pAction = pChangeTrack->GetFirst();
655  CollectActionAutoStyles(pAction);
656  ScChangeAction* pLastAction = pChangeTrack->GetLast();
657  while (pAction != pLastAction)
658  {
659  pAction = pAction->GetNext();
660  CollectActionAutoStyles(pAction);
661  }
662  pAction = pChangeTrack->GetFirstGenerated();
663  while (pAction)
664  {
665  CollectActionAutoStyles(pAction);
666  pAction = pAction->GetNext();
667  }
668 }
669 
671 {
672  if (!pChangeTrack)
673  return;
674 
676  {
677  ScChangeAction* pAction = pChangeTrack->GetFirst();
678  if (pAction)
679  {
680  WorkWithChangeAction(pAction);
681  ScChangeAction* pLastAction = pChangeTrack->GetLast();
682  while (pAction != pLastAction)
683  {
684  pAction = pAction->GetNext();
685  WorkWithChangeAction(pAction);
686  }
687  }
688  }
689 }
690 
691 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void CollectCellAutoStyles(const ScCellValue &rCell)
bool IsGenerated(sal_uLong nAction) const
Definition: chgtrack.cxx:2131
XML_END_POSITION
void CollectActionAutoStyles(const ScChangeAction *pAction)
sal_Int32 nIndex
CellType meType
Definition: cellvalue.hxx:37
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:959
static void ConvertDateTimeToString(const DateTime &aDateTime, OUStringBuffer &sDate)
XML_POSITION
constexpr sal_uInt16 XML_NAMESPACE_OOOC
XML_START_POSITION
XML_NUMBER_MATRIX_ROWS_SPANNED
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
XML_CELL_ADDRESS
void CheckAttrList()
const ScChangeActionDelMoveEntry * GetNext() const
Definition: chgtrack.hxx:419
XML_INSERTION
bool IsDeletedIn() const
Definition: chgtrack.cxx:317
const ScChangeActionIns * GetCutOffInsert() const
Definition: chgtrack.hxx:486
void AddDeletionAttributes(const ScChangeActionDel *pAction)
XML_MOVEMENT
SvNumFormatType GetType(sal_uInt32 nFIndex) const
XML_VALUE_TYPE
double mfValue
Definition: cellvalue.hxx:39
XML_VALUE
bool IsMultiDelete() const
Definition: chgtrack.cxx:828
void WriteInsertion(const ScChangeAction *pAction)
XML_DELETIONS
sal_uLong GetActionMax() const
Definition: chgtrack.hxx:960
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:35
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
ScFormulaCell * mpFormula
Definition: cellvalue.hxx:42
double GetValue()
ScBigRange & GetFromRange()
Definition: chgtrack.hxx:528
int nCount
void AddAttribute(sal_uInt16 nPrefix, const char *pName, const OUString &rValue)
ScChangeAction * GetFirst() const
Definition: chgtrack.hxx:958
ScAddress aPos
ScChangeTrack * GetChangeTrack() const
Definition: document.hxx:2405
XML_REJECTION
bool IsDeleteType() const
Definition: chgtrack.cxx:117
XML_FLOAT
XML_COUNT
XML_ACCEPTANCE_STATE
bool HasDeleted() const
Definition: chgtrack.cxx:381
ScChangeActionContent * GetFirstGenerated() const
Definition: chgtrack.hxx:957
void WriteCell(const ScCellValue &rCell, const OUString &sValue)
static OUString GetChangeID(const sal_uInt32 nActionNumber)
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
Definition: documen2.cxx:441
XML_CELL_CONTENT_CHANGE
SC_DLLPUBLIC bool IsAccepted() const
Definition: chgtrack.cxx:127
XML_P
XML_CREATOR
bool isEmpty() const
const DateTime & GetDateTimeUTC() const
Definition: chgtrack.hxx:315
constexpr sal_uInt16 XML_NAMESPACE_TEXT
sal_Int16 SCCOL
Definition: types.hxx:21
const OUString & GetComment() const
Definition: chgtrack.hxx:352
svl::SharedString * mpString
Definition: cellvalue.hxx:40
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 GetNewString(OUString &rStr, const ScDocument *pDoc) const
Definition: chgtrack.cxx:1398
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:2452
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
const svl::SharedString & GetString()
XML_CELL_CONTENT_DELETION
void WriteDeletion(ScChangeAction *pAction)
XML_PREVIOUS
bool IsRejected() const
Definition: chgtrack.cxx:132
void SetValueAttributes(const double &fValue, const OUString &sValue)
sal_uLong GetActionNumber() const
Definition: chgtrack.hxx:319
XML_TRUE
short GetCutOffTo() const
Definition: chgtrack.hxx:426
ScDocument * GetDocument()
Definition: xmlexprt.hxx:239
sal_Int32 SCROW
Definition: types.hxx:17
SCCOL GetDx() const
Definition: chgtrack.hxx:480
XML_ID
constexpr sal_uInt16 XML_NAMESPACE_TABLE
XML_MOVEMENT_CUT_OFF
short GetCutOffFrom() const
Definition: chgtrack.hxx:425
bool isEmpty() const
Definition: cellvalue.cxx:499
XML_ROW
void GetMatColsRows(SCCOL &nCols, SCROW &nRows) const
XML_TYPE
bool IsRejecting() const
Definition: chgtrack.cxx:137
void Characters(const OUString &rChars)
void WriteEditCell(const ScCellValue &rCell)
const ScChangeActionDelMoveEntry * GetFirstMoveEntry() const
Definition: chgtrack.hxx:484
bool HasDependent() const
Definition: chgtrack.cxx:376
XML_TRACKED_CHANGES
void * p
short GetCutOffCount() const
Definition: chgtrack.hxx:487
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:398
const ScChangeAction * GetAction() const
Definition: chgtrack.hxx:169
XMLTokenEnum
bool IsInsertType() const
Definition: chgtrack.cxx:112
constexpr sal_uInt16 XML_NAMESPACE_OF
XML_END_ROW
XML_START_TABLE
XML_DELETION
ScMatrixMode
EditTextObject * mpEditText
Definition: cellvalue.hxx:41
XML_END_TABLE
XML_CUT_OFFS
const OUString & GetUser() const
Definition: chgtrack.hxx:351
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:113
XML_STRING
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:129
XML_CHANGE_INFO
XML_TIME_VALUE
void WriteMovement(const ScChangeAction *pAction)
void WriteDeleted(const ScChangeAction *pDependAction)
const ScCellValue & GetNewCell() const
Definition: chgtrack.hxx:746
SCROW GetDy() const
Definition: chgtrack.hxx:481
ScMatrixMode GetMatrixFlag() const
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