diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-09-03 19:00:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-09-04 13:58:30 +0200 |
commit | fd24739199fc1d5d3a0487886735737461fb5328 (patch) | |
tree | d8cb8b7656f2f20995a3b828a04463ac4c0aeb8e /sc | |
parent | dc9f3e074b7139382500be0887caceffb646eed8 (diff) |
no need to allocate ScMyLabelRanges with unique_ptr
Change-Id: I87564621a24737df74ad7475910250fde8dbe4fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121621
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/xmlimprt.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlimprt.hxx | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index e0ff318fca37..bc480798e215 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -392,7 +392,7 @@ ScXMLImport::~ScXMLImport() noexcept pStylesImportHelper.reset(); m_aMyNamedExpressions.clear(); - pMyLabelRanges.reset(); + maMyLabelRanges.clear(); pValidations.reset(); pDetectiveOpArray.reset(); @@ -1218,7 +1218,7 @@ sal_Int32 ScXMLImport::GetRangeType(const OUString& sRangeType) void ScXMLImport::SetLabelRanges() { - if (!pMyLabelRanges) + if (maMyLabelRanges.empty()) return; uno::Reference <beans::XPropertySet> xPropertySet (GetModel(), uno::UNO_QUERY); @@ -1237,7 +1237,7 @@ void ScXMLImport::SetLabelRanges() table::CellRangeAddress aLabelRange; table::CellRangeAddress aDataRange; - for (const auto& rxLabelRange : *pMyLabelRanges) + for (const auto& rxLabelRange : maMyLabelRanges) { sal_Int32 nOffset1(0); sal_Int32 nOffset2(0); @@ -1254,7 +1254,7 @@ void ScXMLImport::SetLabelRanges() } } - pMyLabelRanges->clear(); + maMyLabelRanges.clear(); } namespace { diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx index c585e4b0131d..efc5d3bacd4c 100644 --- a/sc/source/filter/xml/xmlimprt.hxx +++ b/sc/source/filter/xml/xmlimprt.hxx @@ -143,7 +143,7 @@ class ScXMLImport: public SvXMLImport ScMyNamedExpressions m_aMyNamedExpressions; SheetNamedExpMap m_SheetNamedExpressions; - std::unique_ptr<ScMyLabelRanges> pMyLabelRanges; + ScMyLabelRanges maMyLabelRanges; std::unique_ptr<ScMyImportValidations> pValidations; std::unique_ptr<ScMyImpDetectiveOpArray> pDetectiveOpArray; std::unique_ptr<SolarMutexGuard> pSolarMutexGuard; @@ -230,10 +230,10 @@ public: void AddNamedExpression(SCTAB nTab, ScMyNamedExpression* pNamedExp); - void AddLabelRange(std::unique_ptr<const ScMyLabelRange> pMyLabelRange) { - if (!pMyLabelRanges) - pMyLabelRanges.reset(new ScMyLabelRanges); - pMyLabelRanges->push_back(std::move(pMyLabelRange)); } + void AddLabelRange(std::unique_ptr<const ScMyLabelRange> pMyLabelRange) + { + maMyLabelRanges.push_back(std::move(pMyLabelRange)); + } void AddValidation(const ScMyImportValidation& rValidation) { if (!pValidations) |