diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-06-17 19:55:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-18 08:23:06 +0200 |
commit | 20b8c7f38ae1c03dc0405a2da006ab6b2dbf3627 (patch) | |
tree | dbdef33c3fe95d50f969690d7755ae2b0a02567e /sc/source/filter/xml | |
parent | ca47989ad60b1414f92be22a1fbf4c1d1a92dd97 (diff) |
create getter for ScCellValue::mpFormula
so we can assert that it has the correct tag type
Change-Id: Iab13a6d6ea1783c69395f06f28732769e5fe8b18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136059
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/filter/xml')
-rw-r--r-- | sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx | 12 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlcelli.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlexprt.cxx | 6 |
4 files changed, 12 insertions, 12 deletions
diff --git a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx index c3356ea79dff..1a3b22e6aad0 100644 --- a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx @@ -295,7 +295,7 @@ void ScChangeTrackingExportHelper::WriteFormulaCell(const ScCellValue& rCell, co { assert(rCell.getType() == CELLTYPE_FORMULA); - ScFormulaCell* pFormulaCell = rCell.mpFormula; + ScFormulaCell* pFormulaCell = rCell.getFormula(); OUString sAddress; const ScDocument* pDoc = rExport.GetDocument(); ScRangeStringConverter::GetStringFromAddress(sAddress, pFormulaCell->aPos, pDoc, ::formula::FormulaGrammar::CONV_OOO); diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx index 13d5a4906375..26e4acbf80ce 100644 --- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx @@ -60,7 +60,7 @@ const ScCellValue& ScMyCellInfo::CreateCell(ScDocument& rDoc) sal_Int32 nOffset(0); ScRangeStringConverter::GetAddressFromString(aPos, sFormulaAddress, rDoc, ::formula::FormulaGrammar::CONV_OOO, nOffset); maCell.set(new ScFormulaCell(rDoc, aPos, sFormula, eGrammar, nMatrixFlag)); - maCell.mpFormula->SetMatColsRows(static_cast<SCCOL>(nMatrixCols), static_cast<SCROW>(nMatrixRows)); + maCell.getFormula()->SetMatColsRows(static_cast<SCCOL>(nMatrixCols), static_cast<SCROW>(nMatrixRows)); } if ((nType == css::util::NumberFormat::DATE || nType == css::util::NumberFormat::TIME) && sInputString.isEmpty()) @@ -671,12 +671,12 @@ void ScXMLChangeTrackingImportHelper::SetNewCell(const ScMyContentAction* pActio } else { - ScMatrixMode nMatrixFlag = aCell.mpFormula->GetMatrixFlag(); + ScMatrixMode nMatrixFlag = aCell.getFormula()->GetMatrixFlag(); // With GRAM_ODFF reference detection is faster on compilation. /* FIXME: new cell should be created with a clone * of the token array instead. Any reason why this * wasn't done? */ - OUString sFormula = aCell.mpFormula->GetFormula(formula::FormulaGrammar::GRAM_ODFF); + OUString sFormula = aCell.getFormula()->GetFormula(formula::FormulaGrammar::GRAM_ODFF); // #i87826# [Collaboration] Rejected move destroys formulas // FIXME: adjust ScFormulaCell::GetFormula(), so that the right formula string @@ -696,10 +696,10 @@ void ScXMLChangeTrackingImportHelper::SetNewCell(const ScMyContentAction* pActio { SCCOL nCols; SCROW nRows; - aCell.mpFormula->GetMatColsRows(nCols, nRows); - aNewCell.mpFormula->SetMatColsRows(nCols, nRows); + aCell.getFormula()->GetMatColsRows(nCols, nRows); + aNewCell.getFormula()->SetMatColsRows(nCols, nRows); } - aNewCell.mpFormula->SetInChangeTrack(true); + aNewCell.getFormula()->SetInChangeTrack(true); pChangeActionContent->SetNewCell(aNewCell, &rDoc, OUString()); // #i40704# don't overwrite the formula string via SetNewValue() } diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index ea5a463b9ab5..1ee22c93e9b5 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -1029,7 +1029,7 @@ void ScXMLTableRowCellContext::PutTextCell( const ScAddress& rCurrentPos, bDoIncrement = aCell.getType() == CELLTYPE_FORMULA; if ( bDoIncrement ) { - ScFormulaCell* pFCell = aCell.mpFormula; + ScFormulaCell* pFCell = aCell.getFormula(); OUString aCellString; if (maStringValue) aCellString = *maStringValue; @@ -1122,7 +1122,7 @@ void ScXMLTableRowCellContext::PutValueCell( const ScAddress& rCurrentPos ) ScRefCellValue aCell(*rXMLImport.GetDocument(), rCurrentPos); if (aCell.getType() == CELLTYPE_FORMULA) { - ScFormulaCell* pFCell = aCell.mpFormula; + ScFormulaCell* pFCell = aCell.getFormula(); SetFormulaCell(pFCell); if (pFCell) pFCell->SetNeedNumberFormat( true ); diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 7c69587ddb46..57c041f7f5ee 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -3169,7 +3169,7 @@ void ScXMLExport::WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount) if (aCell.maBaseCell.getType() == CELLTYPE_FORMULA) { const bool bIsMatrix(bIsFirstMatrixCell || aCell.bIsMatrixCovered); - ScFormulaCell* pFormulaCell = aCell.maBaseCell.mpFormula; + ScFormulaCell* pFormulaCell = aCell.maBaseCell.getFormula(); if (!bIsMatrix || bIsFirstMatrixCell) { if (!mpCompileFormulaCxt) @@ -3262,9 +3262,9 @@ void ScXMLExport::WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount) { WriteEditCell(aCell.maBaseCell.getEditText()); } - else if (aCell.maBaseCell.getType() == CELLTYPE_FORMULA && aCell.maBaseCell.mpFormula->IsMultilineResult()) + else if (aCell.maBaseCell.getType() == CELLTYPE_FORMULA && aCell.maBaseCell.getFormula()->IsMultilineResult()) { - WriteMultiLineFormulaResult(aCell.maBaseCell.mpFormula); + WriteMultiLineFormulaResult(aCell.maBaseCell.getFormula()); } else { |