summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-13 15:06:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-14 19:14:19 +0200
commit22e08a3d8b043ce0ff2424d3fa0a704804afc567 (patch)
tree1ec23cb9304c2b6e074c3adfbdd5bb2873ae3267 /sw
parent2a274f47ee5759b17ab22497dbe64ef6135d4cd6 (diff)
tdf#121740 cache hashcode in SequenceAsHashMap
shaves 2% off load time Change-Id: I5bd4eabf61205df21a27d2822acd2676a7732a3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134315 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx24
1 files changed, 14 insertions, 10 deletions
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index 5e323ee6b937..69dbd4c29091 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -802,15 +802,17 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons
if (it != aGrabBag.end())
{
comphelper::SequenceAsHashMap aAnchorDistDiff(it->second);
- for (const std::pair<const OUString, uno::Any>& rDiff : aAnchorDistDiff)
+ for (const std::pair<const comphelper::OUStringAndHashCode, uno::Any>& rDiff :
+ aAnchorDistDiff)
{
- if (rDiff.first == "distTDiff" && rDiff.second.has<sal_Int32>())
+ const OUString& rName = rDiff.first.maString;
+ if (rName == "distTDiff" && rDiff.second.has<sal_Int32>())
nDistT -= round(rDiff.second.get<sal_Int32>());
- else if (rDiff.first == "distBDiff" && rDiff.second.has<sal_Int32>())
+ else if (rName == "distBDiff" && rDiff.second.has<sal_Int32>())
nDistB -= round(rDiff.second.get<sal_Int32>());
- else if (rDiff.first == "distLDiff" && rDiff.second.has<sal_Int32>())
+ else if (rName == "distLDiff" && rDiff.second.has<sal_Int32>())
nDistL -= rDiff.second.get<sal_Int32>();
- else if (rDiff.first == "distRDiff" && rDiff.second.has<sal_Int32>())
+ else if (rName == "distRDiff" && rDiff.second.has<sal_Int32>())
nDistR -= rDiff.second.get<sal_Int32>();
}
}
@@ -1159,15 +1161,17 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons
sal_Int64 nTopExtGrabBag(0);
sal_Int64 nRightExtGrabBag(0);
sal_Int64 nBottomExtGrabBag(0);
- for (const std::pair<const OUString, uno::Any>& rDirection : aEffectExtent)
+ for (const std::pair<const comphelper::OUStringAndHashCode, uno::Any>& rDirection :
+ aEffectExtent)
{
- if (rDirection.first == "l" && rDirection.second.has<sal_Int32>())
+ const OUString& rName = rDirection.first.maString;
+ if (rName == "l" && rDirection.second.has<sal_Int32>())
nLeftExtGrabBag = rDirection.second.get<sal_Int32>();
- else if (rDirection.first == "t" && rDirection.second.has<sal_Int32>())
+ else if (rName == "t" && rDirection.second.has<sal_Int32>())
nTopExtGrabBag = rDirection.second.get<sal_Int32>();
- else if (rDirection.first == "r" && rDirection.second.has<sal_Int32>())
+ else if (rName == "r" && rDirection.second.has<sal_Int32>())
nRightExtGrabBag = rDirection.second.get<sal_Int32>();
- else if (rDirection.first == "b" && rDirection.second.has<sal_Int32>())
+ else if (rName == "b" && rDirection.second.has<sal_Int32>())
nBottomExtGrabBag = rDirection.second.get<sal_Int32>();
}
if (abs(nLeftExtEMU - nLeftExtGrabBag) <= 635 && abs(nTopExtEMU - nTopExtGrabBag) <= 635