[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - sc/source

Eike Rathke erack at redhat.com
Thu Feb 15 01:07:50 UTC 2018


 sc/source/core/data/documentimport.cxx |   20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

New commits:
commit c9cfcd5f56fb2395a281df7466e5a2d9a2cf309e
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Feb 13 18:08:28 2018 +0100

    CheckLinkFormulaNeedingCheck() for ScDocumentImport::setFormulaCell()
    
    and ScDocumentImport::setMatrixCells()
    
     This is a combination of 2 commits.
    
    CheckLinkFormulaNeedingCheck() for ScDocumentImport::setFormulaCell()
    
    (cherry picked from commit bcd62f2050336951ad56892d6e0a42f63c59a674)
    
     Conflicts:
            sc/source/core/data/documentimport.cxx
    
    More CheckLinkFormulaNeedingCheck() for ScDocumentImport::setFormulaCell()
    
    and ScDocumentImport::setMatrixCells()
    
    (cherry picked from commit f41c14706c6bf8aa5c3df220c706669f1ec6e1f6)
    
     Conflicts:
            sc/source/core/data/documentimport.cxx
    
    d3303fb71889c760424459daa79feca0f2510a3c
    
    Change-Id: I1587be914b390b2597185dd5af870d1d785010a4
    Reviewed-on: https://gerrit.libreoffice.org/49735
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx
index 95d38ee08f51..c0e4d3c9e60f 100644
--- a/sc/source/core/data/documentimport.cxx
+++ b/sc/source/core/data/documentimport.cxx
@@ -25,6 +25,7 @@
 
 #include <svl/sharedstringpool.hxx>
 #include <svl/languageoptions.hxx>
+#include <o3tl/make_unique.hxx>
 
 #include <memory>
 #include <vector>
@@ -276,9 +277,14 @@ void ScDocumentImport::setFormulaCell(
     if (!pBlockPos)
         return;
 
+    std::unique_ptr<ScFormulaCell> pFC =
+        o3tl::make_unique<ScFormulaCell>(&mpImpl->mrDoc, rPos, rFormula, eGrammar);
+
+    mpImpl->mrDoc.CheckLinkFormulaNeedingCheck( *pFC->GetCode());
+
     sc::CellStoreType& rCells = pTab->aCol[rPos.Col()].maCells;
     pBlockPos->miCellPos =
-        rCells.set(pBlockPos->miCellPos, rPos.Row(), new ScFormulaCell(&mpImpl->mrDoc, rPos, rFormula, eGrammar));
+        rCells.set(pBlockPos->miCellPos, rPos.Row(), pFC.release());
 }
 
 void ScDocumentImport::setFormulaCell(const ScAddress& rPos, ScTokenArray* pArray)
@@ -292,9 +298,14 @@ void ScDocumentImport::setFormulaCell(const ScAddress& rPos, ScTokenArray* pArra
     if (!pBlockPos)
         return;
 
+    std::unique_ptr<ScFormulaCell> pFC =
+        o3tl::make_unique<ScFormulaCell>(&mpImpl->mrDoc, rPos, pArray);
+
+    mpImpl->mrDoc.CheckLinkFormulaNeedingCheck( *pFC->GetCode());
+
     sc::CellStoreType& rCells = pTab->aCol[rPos.Col()].maCells;
     pBlockPos->miCellPos =
-        rCells.set(pBlockPos->miCellPos, rPos.Row(), new ScFormulaCell(&mpImpl->mrDoc, rPos, pArray));
+        rCells.set(pBlockPos->miCellPos, rPos.Row(), pFC.release());
 }
 
 void ScDocumentImport::setFormulaCell(const ScAddress& rPos, ScFormulaCell* pCell)
@@ -308,6 +319,9 @@ void ScDocumentImport::setFormulaCell(const ScAddress& rPos, ScFormulaCell* pCel
     if (!pBlockPos)
         return;
 
+    if (pCell)
+        mpImpl->mrDoc.CheckLinkFormulaNeedingCheck( *pCell->GetCode());
+
     sc::CellStoreType& rCells = pTab->aCol[rPos.Col()].maCells;
     pBlockPos->miCellPos =
         rCells.set(pBlockPos->miCellPos, rPos.Row(), pCell);
@@ -332,6 +346,8 @@ void ScDocumentImport::setMatrixCells(
     // Set the master cell.
     ScFormulaCell* pCell = new ScFormulaCell(&mpImpl->mrDoc, rBasePos, rArray, eGram, ScMatrixMode::Formula);
 
+    mpImpl->mrDoc.CheckLinkFormulaNeedingCheck( *pCell->GetCode());
+
     pBlockPos->miCellPos =
         rCells.set(pBlockPos->miCellPos, rBasePos.Row(), pCell);
 


More information about the Libreoffice-commits mailing list