summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-08-17 16:29:44 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-08-17 18:09:51 +0200
commit633a175914f0ab960965aae7de04dc8d99edb33c (patch)
tree1cd7008a9a9956fc63727ba7e3554641493020cf
parentResolves: tdf#149858 embedded starmath not using correct initial zoom (diff)
downloadcore-633a175914f0ab960965aae7de04dc8d99edb33c.tar.gz
core-633a175914f0ab960965aae7de04dc8d99edb33c.zip
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.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sc/inc/columnspanset.hxx3
-rw-r--r--sc/source/core/data/columnspanset.cxx6
2 files changed, 4 insertions, 5 deletions
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;