summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-09-04 20:55:29 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-05 14:56:21 +0200
commitdbae39115963f63be1befe407ff9ed8c1c4a9b62 (patch)
tree666525cc7622e1cc9f569139a3356622de4cf62a /sc
parent8a60780dddf4a2d043b7152514f251d480f3be7e (diff)
no need to allocate ColumnSpanSet with unique_ptr
Change-Id: If3aaa2a4bc556dad41f56054890dc07f96d42dda Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121651 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/columnspanset.hxx4
-rw-r--r--sc/source/core/data/bcaslot.cxx13
-rw-r--r--sc/source/core/inc/bcaslot.hxx2
3 files changed, 9 insertions, 10 deletions
diff --git a/sc/inc/columnspanset.hxx b/sc/inc/columnspanset.hxx
index a5fed2d3f25a..926f0520e8a1 100644
--- a/sc/inc/columnspanset.hxx
+++ b/sc/inc/columnspanset.hxx
@@ -85,7 +85,9 @@ public:
ColumnSpanSet();
ColumnSpanSet(const ColumnSpanSet&) = delete;
- const ColumnSpanSet& operator=(const ColumnSpanSet&) = delete;
+ ColumnSpanSet& operator=(const ColumnSpanSet&) = delete;
+ ColumnSpanSet(ColumnSpanSet&&) = default;
+ ColumnSpanSet& operator=(ColumnSpanSet&&) = default;
~ColumnSpanSet();
void set(const ScDocument& rDoc, SCTAB nTab, SCCOL nCol, SCROW nRow, bool bVal);
diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx
index bbca9dda93ae..9a9940445b7a 100644
--- a/sc/source/core/data/bcaslot.cxx
+++ b/sc/source/core/data/bcaslot.cxx
@@ -1077,12 +1077,11 @@ void ScBroadcastAreaSlotMachine::InsertBulkGroupArea( ScBroadcastArea* pArea, co
if (it == m_BulkGroupAreas.end() || m_BulkGroupAreas.key_comp()(pArea, it->first))
{
// Insert a new one.
- it = m_BulkGroupAreas.insert(it, std::make_pair(pArea, std::make_unique<sc::ColumnSpanSet>()));
+ it = m_BulkGroupAreas.insert(it, std::make_pair(pArea, sc::ColumnSpanSet()));
}
- sc::ColumnSpanSet *const pSet = it->second.get();
- assert(pSet);
- pSet->set(*pDoc, rRange, true);
+ sc::ColumnSpanSet& rSet = it->second;
+ rSet.set(*pDoc, rRange, true);
}
bool ScBroadcastAreaSlotMachine::BulkBroadcastGroupAreas( SfxHintId nHintId )
@@ -1093,7 +1092,7 @@ bool ScBroadcastAreaSlotMachine::BulkBroadcastGroupAreas( SfxHintId nHintId )
sc::BulkDataHint aHint( *pDoc, nHintId);
bool bBroadcasted = false;
- for (const auto& [pArea, rxSpans] : m_BulkGroupAreas)
+ for (const auto& [pArea, rSpans] : m_BulkGroupAreas)
{
assert(pArea);
SvtBroadcaster& rBC = pArea->GetBroadcaster();
@@ -1105,9 +1104,7 @@ bool ScBroadcastAreaSlotMachine::BulkBroadcastGroupAreas( SfxHintId nHintId )
}
else
{
- const sc::ColumnSpanSet *const pSpans = rxSpans.get();
- assert(pSpans);
- aHint.setSpans(pSpans);
+ aHint.setSpans(&rSpans);
rBC.Broadcast(aHint);
bBroadcasted = true;
}
diff --git a/sc/source/core/inc/bcaslot.hxx b/sc/source/core/inc/bcaslot.hxx
index 2c85229b1feb..56d49e698835 100644
--- a/sc/source/core/inc/bcaslot.hxx
+++ b/sc/source/core/inc/bcaslot.hxx
@@ -245,7 +245,7 @@ public:
class ScBroadcastAreaSlotMachine
{
private:
- typedef std::map<ScBroadcastArea*, std::unique_ptr<sc::ColumnSpanSet>> BulkGroupAreasType;
+ typedef std::map<ScBroadcastArea*, sc::ColumnSpanSet> BulkGroupAreasType;
/**
Slot offset arrangement of columns and rows, once per sheet.