sc/inc/columnspanset.hxx              |    3 +--
 sc/source/core/data/columnspanset.cxx |    6 +++---
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 633a175914f0ab960965aae7de04dc8d99edb33c
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Wed Aug 17 16:29:44 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Aug 17 18:09:51 2022 +0200

    tdf#150170: Revert "flatten TableType in ColumnSpanSet"
    
    This reverts commit 99cd1d8834bb708afc81c825ff2b7992b7acb37d.
    
    This commit is only reverted in libreoffice-7-3 branch.
    In master and libreoffice-7-4 the issue is not reproducible
    after the default Calc number of columns was increased to 16384
    
    Change-Id: I28dcc1c56c803d49ea101dbb0ace7085f7a78820
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138445
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/inc/columnspanset.hxx b/sc/inc/columnspanset.hxx
index 926f0520e8a1..214bd90db16d 100644
--- a/sc/inc/columnspanset.hxx
+++ b/sc/inc/columnspanset.hxx
@@ -11,7 +11,6 @@
 
 #include "address.hxx"
 
-#include <optional>
 #include <vector>
 #include <mdds/flat_segment_tree.hpp>
 
@@ -60,7 +59,7 @@ private:
         ColumnType(SCROW nStart, SCROW nEnd, bool bInit);
     };
 
-    typedef std::vector<std::optional<ColumnType>> TableType;
+    typedef std::vector<std::unique_ptr<ColumnType>> TableType;
 
     std::vector<TableType> maTables;
 
diff --git a/sc/source/core/data/columnspanset.cxx 
b/sc/source/core/data/columnspanset.cxx
index a38ea7fffe35..8d9775e0cbfc 100644
--- a/sc/source/core/data/columnspanset.cxx
+++ b/sc/source/core/data/columnspanset.cxx
@@ -74,7 +74,7 @@ ColumnSpanSet::ColumnType& ColumnSpanSet::getColumn(const 
ScDocument& rDoc, SCTA
         rTab.resize(nCol+1);
 
     if (!rTab[nCol])
-        rTab[nCol].emplace(0, rDoc.MaxRow(), /*bInit*/false);
+        rTab[nCol].reset(new ColumnType(0, rDoc.MaxRow(), /*bInit*/false));
 
     return *rTab[nCol];
 }
@@ -156,7 +156,7 @@ void ColumnSpanSet::executeAction(Action& ac) const
                 continue;
 
             ac.startColumn(nTab, nCol);
-            const ColumnType& rCol = *rTab[nCol];
+            ColumnType& rCol = *rTab[nCol];
             ColumnSpansType::const_iterator it = rCol.maSpans.begin(), itEnd = 
rCol.maSpans.end();
             SCROW nRow1, nRow2;
             nRow1 = it->first;
@@ -199,7 +199,7 @@ void ColumnSpanSet::executeColumnAction(ScDocument& rDoc, 
ColumnAction& ac) cons
 
             ScColumn& rColumn = pTab->aCol[nCol];
             ac.startColumn(&rColumn);
-            const ColumnType& rCol = *rTab[nCol];
+            ColumnType& rCol = *rTab[nCol];
             ColumnSpansType::const_iterator it = rCol.maSpans.begin(), itEnd = 
rCol.maSpans.end();
             SCROW nRow1, nRow2;
             nRow1 = it->first;

Reply via email to