diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-21 10:26:32 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-21 12:19:13 +0200 |
commit | 794be42bcc89460371d950f1c2922801dcb431f9 (patch) | |
tree | 30e9276a929ccf5f985719d970194763387f7411 | |
parent | 4f974eceb0e49f5e8cdbc8b9990a74811feb1927 (diff) |
flatten maTables in ColumnSpanSet
Change-Id: Ic32e0aa40cd678a7b0b28a7a6d7478250b3b7b3e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119306
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sc/inc/columnspanset.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/columnspanset.cxx | 13 |
2 files changed, 6 insertions, 9 deletions
diff --git a/sc/inc/columnspanset.hxx b/sc/inc/columnspanset.hxx index d889a4da67e4..547861d1c583 100644 --- a/sc/inc/columnspanset.hxx +++ b/sc/inc/columnspanset.hxx @@ -61,7 +61,7 @@ private: typedef std::vector<std::unique_ptr<ColumnType>> TableType; - std::vector<std::unique_ptr<TableType>> maTables; + std::vector<TableType> maTables; ColumnType& getColumn(const ScDocument& rDoc, SCTAB nTab, SCCOL nCol); diff --git a/sc/source/core/data/columnspanset.cxx b/sc/source/core/data/columnspanset.cxx index b400cd651c5a..8d9775e0cbfc 100644 --- a/sc/source/core/data/columnspanset.cxx +++ b/sc/source/core/data/columnspanset.cxx @@ -69,10 +69,7 @@ ColumnSpanSet::ColumnType& ColumnSpanSet::getColumn(const ScDocument& rDoc, SCTA if (o3tl::make_unsigned(nTab) >= maTables.size()) maTables.resize(nTab+1); - if (!maTables[nTab]) - maTables[nTab].reset(new TableType); - - TableType& rTab = *maTables[nTab]; + TableType& rTab = maTables[nTab]; if (o3tl::make_unsigned(nCol) >= rTab.size()) rTab.resize(nCol+1); @@ -149,10 +146,10 @@ void ColumnSpanSet::executeAction(Action& ac) const { for (size_t nTab = 0; nTab < maTables.size(); ++nTab) { - if (!maTables[nTab]) + if (maTables[nTab].empty()) continue; - const TableType& rTab = *maTables[nTab]; + const TableType& rTab = maTables[nTab]; for (size_t nCol = 0; nCol < rTab.size(); ++nCol) { if (!rTab[nCol]) @@ -180,10 +177,10 @@ void ColumnSpanSet::executeColumnAction(ScDocument& rDoc, ColumnAction& ac) cons { for (size_t nTab = 0; nTab < maTables.size(); ++nTab) { - if (!maTables[nTab]) + if (maTables[nTab].empty()) continue; - const TableType& rTab = *maTables[nTab]; + const TableType& rTab = maTables[nTab]; for (SCCOL nCol = 0; nCol < static_cast<SCCOL>(rTab.size()); ++nCol) { if (!rTab[nCol]) |