sc/inc/column.hxx                |    3 --
 sc/inc/document.hxx              |    3 --
 sc/source/core/data/column3.cxx  |   46 ---------------------------------------
 sc/source/core/data/column4.cxx  |    2 -
 sc/source/core/data/document.cxx |    4 +--
 sc/source/core/data/table2.cxx   |    2 -
 6 files changed, 7 insertions(+), 53 deletions(-)

New commits:
commit f8334fedbd92da41932ed5c4875fda9fdc19aaad
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Mar 24 13:06:50 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Mar 25 09:58:48 2022 +0100

    loplugin:constantparam
    
    Change-Id: Id89c74fcd6c6332f5da9f57986bfc2fe075d71c5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132087
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 689f0c0ccbd0..f04d54aca739 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -721,8 +721,7 @@ public:
                              std::vector<SCROW>* pNewSharedRows );
 
     void AttachFormulaCells( sc::StartListeningContext& rCxt, SCROW nRow1, 
SCROW nRow2 );
-    void DetachFormulaCells( sc::EndListeningContext& rCxt, SCROW nRow1, SCROW 
nRow2,
-                             std::vector<SCROW>* pNewSharedRows );
+    void DetachFormulaCells( sc::EndListeningContext& rCxt, SCROW nRow1, SCROW 
nRow2 );
 
     /**
      * Regroup formula cells for the entire column.
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index d5df933e1cfc..cd7138b3e945 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1210,8 +1210,7 @@ public:
                                                   { 
mbFormulaGroupCxtBlockDiscard = block; }
 
     // Note that if pShared is set and a value is returned that way, the 
returned OUString is empty.
-    SC_DLLPUBLIC OUString                     GetInputString( SCCOL nCol, 
SCROW nRow, SCTAB nTab,
-                                                  const svl::SharedString** 
pShared = nullptr ) const;
+    SC_DLLPUBLIC OUString                     GetInputString( SCCOL nCol, 
SCROW nRow, SCTAB nTab ) const;
     FormulaError                              GetStringForFormula( const 
ScAddress& rPos, OUString& rString );
     SC_DLLPUBLIC double                       GetValue( const ScAddress& rPos 
) const;
     SC_DLLPUBLIC double                       GetValue( SCCOL nCol, SCROW 
nRow, SCTAB nTab ) const;
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 2f4b7a2c0774..4aa91b89d919 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -495,59 +495,15 @@ void ScColumn::AttachFormulaCells( 
sc::StartListeningContext& rCxt, SCROW nRow1,
     sc::ProcessFormula(it, maCells, nRow1, nRow2, aFunc);
 }
 
-void ScColumn::DetachFormulaCells( sc::EndListeningContext& rCxt, SCROW nRow1, 
SCROW nRow2,
-        std::vector<SCROW>* pNewSharedRows )
+void ScColumn::DetachFormulaCells( sc::EndListeningContext& rCxt, SCROW nRow1, 
SCROW nRow2 )
 {
     sc::CellStoreType::position_type aPos = maCells.position(nRow1);
     sc::CellStoreType::iterator it = aPos.first;
 
-    bool bLowerSplitOff = false;
-    if (pNewSharedRows && !GetDoc().IsClipOrUndo())
-    {
-        const ScFormulaCell* pFC = 
sc::SharedFormulaUtil::getSharedTopFormulaCell(aPos);
-        if (pFC)
-        {
-            const SCROW nTopRow = pFC->GetSharedTopRow();
-            const SCROW nBotRow = nTopRow + pFC->GetSharedLength() - 1;
-            // nTopRow <= nRow1 <= nBotRow, because otherwise pFC would not 
exist.
-            if (nTopRow < nRow1)
-            {
-                // Upper part will be split off.
-                pNewSharedRows->push_back(nTopRow);
-                pNewSharedRows->push_back(nRow1 - 1);
-            }
-            if (nRow2 < nBotRow)
-            {
-                // Lower part will be split off.
-                pNewSharedRows->push_back(nRow2 + 1);
-                pNewSharedRows->push_back(nBotRow);
-                bLowerSplitOff = true;
-            }
-        }
-    }
-
     // Split formula grouping at the top and bottom boundaries.
     sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, &rCxt);
     if (GetDoc().ValidRow(nRow2+1))
     {
-        if (pNewSharedRows && !bLowerSplitOff && !GetDoc().IsClipOrUndo())
-        {
-            sc::CellStoreType::position_type aPos2 = 
maCells.position(aPos.first, nRow2);
-            const ScFormulaCell* pFC = 
sc::SharedFormulaUtil::getSharedTopFormulaCell(aPos2);
-            if (pFC)
-            {
-                const SCROW nTopRow = pFC->GetSharedTopRow();
-                const SCROW nBotRow = nTopRow + pFC->GetSharedLength() - 1;
-                // nRow1 < nTopRow <= nRow2 < nBotRow
-                if (nRow2 < nBotRow)
-                {
-                    // Lower part will be split off.
-                    pNewSharedRows->push_back(nRow2 + 1);
-                    pNewSharedRows->push_back(nBotRow);
-                }
-            }
-        }
-
         aPos = maCells.position(it, nRow2+1);
         sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, &rCxt);
     }
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index 3a7145608de8..8bf1e0af8321 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -484,7 +484,7 @@ void ScColumn::ConvertFormulaToValue(
         // No formula cells encountered.
         return;
 
-    DetachFormulaCells(rCxt, nRow1, nRow2, nullptr);
+    DetachFormulaCells(rCxt, nRow1, nRow2);
 
     // Undo storage to hold static values which will get swapped to the cell 
storage later.
     sc::CellValues aUndoCells;
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index d520c0be5a7a..1750ae956b52 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -3567,10 +3567,10 @@ void ScDocument::DiscardFormulaGroupContext()
         mpFormulaGroupCxt.reset();
 }
 
-OUString ScDocument::GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, const 
svl::SharedString** pShared ) const
+OUString ScDocument::GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab ) const
 {
     if ( ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && 
maTabs[nTab] )
-        return maTabs[nTab]->GetInputString( nCol, nRow, pShared );
+        return maTabs[nTab]->GetInputString( nCol, nRow, nullptr );
     else
         return OUString();
 }
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 8fdee0a9f414..27ceaddf4097 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1272,7 +1272,7 @@ void ScTable::DetachFormulaCells(
 {
     nCol2 = ClampToAllocatedColumns(nCol2);
     for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
-        aCol[nCol].DetachFormulaCells(rCxt, nRow1, nRow2, nullptr);
+        aCol[nCol].DetachFormulaCells(rCxt, nRow1, nRow2);
 }
 
 void ScTable::SetDirtyFromClip(

Reply via email to