sw/source/filter/ww8/docxattributeoutput.cxx | 4 ++-- sw/source/filter/ww8/docxtableexport.cxx | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-)
New commits: commit 8d00f6c851b7680f18f602b10ca19a1c9223d276 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Mar 30 11:06:19 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Mar 30 14:13:53 2023 +0000 no need to make copies of the GrabBag map Change-Id: I5cd697d0cfaf65a9ad581d4d7571a69e6214cbb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149757 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 60f93917117e..dadd4125c0fe 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -385,9 +385,9 @@ static void checkAndWriteFloatingTables(DocxAttributeOutput& rDocxAttributeOutpu SwTable& rTable = pTableNode->GetTable(); SwFrameFormat* pTableFormat = rTable.GetFrameFormat(); const SfxGrabBagItem* pTableGrabBag = pTableFormat->GetAttrSet().GetItem<SfxGrabBagItem>(RES_FRMATR_GRABBAG); - std::map<OUString, css::uno::Any> aTableGrabBag = pTableGrabBag->GetGrabBag(); + const std::map<OUString, css::uno::Any> & rTableGrabBag = pTableGrabBag->GetGrabBag(); // no grabbag? - if (aTableGrabBag.find("TablePosition") == aTableGrabBag.end()) + if (rTableGrabBag.find("TablePosition") == rTableGrabBag.end()) { if (pFrameFormat->GetFlySplit().GetValue()) { diff --git a/sw/source/filter/ww8/docxtableexport.cxx b/sw/source/filter/ww8/docxtableexport.cxx index 1f4f06a41aa3..2ac6e2db0597 100644 --- a/sw/source/filter/ww8/docxtableexport.cxx +++ b/sw/source/filter/ww8/docxtableexport.cxx @@ -263,7 +263,7 @@ void DocxAttributeOutput::TableDefinition( m_pSerializer->singleElementNS(XML_w, XML_tblLayout, FSNS(XML_w, XML_type), "fixed"); // Look for the table style property in the table grab bag - std::map<OUString, css::uno::Any> aGrabBag + const std::map<OUString, css::uno::Any>& rGrabBag = pTableFormat->GetAttrSet().GetItem<SfxGrabBagItem>(RES_FRMATR_GRABBAG)->GetGrabBag(); // We should clear the TableStyle map. In case of Table inside multiple tables it contains the @@ -284,7 +284,7 @@ void DocxAttributeOutput::TableDefinition( } // Extract properties from grab bag - for (const auto& rGrabBagElement : aGrabBag) + for (const auto& rGrabBagElement : rGrabBag) { if (rGrabBagElement.first == "TableStyleName") { @@ -564,14 +564,14 @@ void DocxAttributeOutput::TableBackgrounds( const OString sColor = msfilter::util::ConvertColor(aColor); - std::map<OUString, css::uno::Any> aGrabBag + const std::map<OUString, css::uno::Any>& rGrabBag = pFormat->GetAttrSet().GetItem<SfxGrabBagItem>(RES_FRMATR_GRABBAG)->GetGrabBag(); OString sOriginalColor; - std::map<OUString, css::uno::Any>::iterator aGrabBagElement = aGrabBag.find("originalColor"); - if (aGrabBagElement != aGrabBag.end()) + auto aGrabBagIt = rGrabBag.find("originalColor"); + if (aGrabBagIt != rGrabBag.end()) sOriginalColor - = OUStringToOString(aGrabBagElement->second.get<OUString>(), RTL_TEXTENCODING_UTF8); + = OUStringToOString(aGrabBagIt->second.get<OUString>(), RTL_TEXTENCODING_UTF8); if (sOriginalColor != sColor) { @@ -586,7 +586,7 @@ void DocxAttributeOutput::TableBackgrounds( { rtl::Reference<sax_fastparser::FastAttributeList> pAttrList; - for (const auto& rGrabBagElement : aGrabBag) + for (const auto& rGrabBagElement : rGrabBag) { if (!rGrabBagElement.second.has<OUString>()) continue;