summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/inc/columnspanset.hxx3
-rw-r--r--sc/source/core/data/columnspanset.cxx6
2 files changed, 5 insertions, 4 deletions
diff --git a/sc/inc/columnspanset.hxx b/sc/inc/columnspanset.hxx
index 547861d1c583..a5fed2d3f25a 100644
--- a/sc/inc/columnspanset.hxx
+++ b/sc/inc/columnspanset.hxx
@@ -11,6 +11,7 @@
#include "address.hxx"
+#include <optional>
#include <vector>
#include <mdds/flat_segment_tree.hpp>
@@ -59,7 +60,7 @@ private:
ColumnType(SCROW nStart, SCROW nEnd, bool bInit);
};
- typedef std::vector<std::unique_ptr<ColumnType>> TableType;
+ typedef std::vector<std::optional<ColumnType>> TableType;
std::vector<TableType> maTables;
diff --git a/sc/source/core/data/columnspanset.cxx b/sc/source/core/data/columnspanset.cxx
index 8d9775e0cbfc..a38ea7fffe35 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].reset(new ColumnType(0, rDoc.MaxRow(), /*bInit*/false));
+ rTab[nCol].emplace(0, rDoc.MaxRow(), /*bInit*/false);
return *rTab[nCol];
}
@@ -156,7 +156,7 @@ void ColumnSpanSet::executeAction(Action& ac) const
continue;
ac.startColumn(nTab, nCol);
- ColumnType& rCol = *rTab[nCol];
+ const 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);
- ColumnType& rCol = *rTab[nCol];
+ const ColumnType& rCol = *rTab[nCol];
ColumnSpansType::const_iterator it = rCol.maSpans.begin(), itEnd = rCol.maSpans.end();
SCROW nRow1, nRow2;
nRow1 = it->first;