summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-11-15 10:48:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-11-15 12:04:31 +0100
commitd0e848dab096160b16c4778ba25a40d1e5ff82af (patch)
treefec4a155c91994a19aa3b13599749a2563329685 /oox
parentdef8f7699661f3ca9d763b6bd5e81759cf5b4e12 (diff)
avoid double map lookup
Change-Id: I02018eaaf220c7835756eba6215425bac9cbc6f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159432 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx5
-rw-r--r--oox/source/export/vmlexport.cxx5
-rw-r--r--oox/source/ole/oleobjecthelper.cxx5
3 files changed, 9 insertions, 6 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index ebe1df3a72d8..4bce89943ba3 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -4320,8 +4320,9 @@ void DrawingML::WritePresetShape( const OString& pShape, MSO_SPT eShapeType, boo
static std::map< OString, std::vector<OString> > aAdjMap = lcl_getAdjNames();
// If there are predefined adj names for this shape type, look them up now.
std::vector<OString> aAdjustments;
- if (aAdjMap.find(pShape) != aAdjMap.end())
- aAdjustments = aAdjMap[pShape];
+ auto it = aAdjMap.find(pShape);
+ if (it != aAdjMap.end())
+ aAdjustments = it->second;
mpFS->startElementNS(XML_a, XML_prstGeom, XML_prst, pShape);
mpFS->startElementNS(XML_a, XML_avLst);
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index 2ed2903bfe27..cfaa815aa964 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -1236,8 +1236,9 @@ static OUString lcl_getAnchorIdFromGrabBag(const SdrObject* pSdrObject)
if (xShape->getPropertySetInfo()->hasPropertyByName("InteropGrabBag"))
{
comphelper::SequenceAsHashMap aInteropGrabBag(xShape->getPropertyValue("InteropGrabBag"));
- if (aInteropGrabBag.find("AnchorId") != aInteropGrabBag.end())
- aInteropGrabBag["AnchorId"] >>= aResult;
+ auto it = aInteropGrabBag.find("AnchorId");
+ if (it != aInteropGrabBag.end())
+ it->second >>= aResult;
}
return aResult;
diff --git a/oox/source/ole/oleobjecthelper.cxx b/oox/source/ole/oleobjecthelper.cxx
index 1816773db82d..f99e4a897ec0 100644
--- a/oox/source/ole/oleobjecthelper.cxx
+++ b/oox/source/ole/oleobjecthelper.cxx
@@ -100,8 +100,9 @@ void SaveInteropProperties(uno::Reference<frame::XModel> const& xModel,
// get EmbeddedObjects property inside grab bag
comphelper::SequenceAsHashMap objectsList;
- if (aGrabBag.find(sEmbeddingsPropName) != aGrabBag.end())
- objectsList << aGrabBag[sEmbeddingsPropName];
+ auto grabIt = aGrabBag.find(sEmbeddingsPropName);
+ if (grabIt != aGrabBag.end())
+ objectsList << grabIt->second;
uno::Sequence< beans::PropertyValue > aGrabBagAttribute{ comphelper::makePropertyValue("ProgID",
rProgId) };