summaryrefslogtreecommitdiff
path: root/xmloff/source/draw/XMLImageMapExport.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-08-06 09:02:30 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-08-06 10:28:06 +0200
commit1f1f7b89d20f86a46b14674ad3747cbdb899c6ca (patch)
treeeb65761f2cf59d17f855313fb4cf7e3cc2bf5c0a /xmloff/source/draw/XMLImageMapExport.cxx
parent5633b217a6b5f6e1bb673d468fa8cb7ac66ceb54 (diff)
loplugin:flatten in xmloff/draw
Change-Id: I8eb9afc859727bd4d66d0a4415533d4012ed3c31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100197 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/draw/XMLImageMapExport.cxx')
-rw-r--r--xmloff/source/draw/XMLImageMapExport.cxx46
1 files changed, 23 insertions, 23 deletions
diff --git a/xmloff/source/draw/XMLImageMapExport.cxx b/xmloff/source/draw/XMLImageMapExport.cxx
index 5a9827272836..85b29122f6ad 100644
--- a/xmloff/source/draw/XMLImageMapExport.cxx
+++ b/xmloff/source/draw/XMLImageMapExport.cxx
@@ -92,33 +92,33 @@ void XMLImageMapExport::Export(
void XMLImageMapExport::Export(
const Reference<XIndexContainer> & rContainer)
{
- if (rContainer.is())
+ if (!rContainer.is())
+ return;
+
+ if (!rContainer->hasElements())
+ return;
+
+ // image map container element
+ SvXMLElementExport aImageMapElement(
+ mrExport, XML_NAMESPACE_DRAW, XML_IMAGE_MAP,
+ true/*bWhiteSpace*/, true/*bWhiteSpace*/);
+
+ // iterate over image map elements and call ExportMapEntry(...)
+ // for each
+ sal_Int32 nLength = rContainer->getCount();
+ for(sal_Int32 i = 0; i < nLength; i++)
{
- if (rContainer->hasElements())
+ Any aAny = rContainer->getByIndex(i);
+ Reference<XPropertySet> rElement;
+ aAny >>= rElement;
+
+ DBG_ASSERT(rElement.is(), "Image map element is empty!");
+ if (rElement.is())
{
- // image map container element
- SvXMLElementExport aImageMapElement(
- mrExport, XML_NAMESPACE_DRAW, XML_IMAGE_MAP,
- true/*bWhiteSpace*/, true/*bWhiteSpace*/);
-
- // iterate over image map elements and call ExportMapEntry(...)
- // for each
- sal_Int32 nLength = rContainer->getCount();
- for(sal_Int32 i = 0; i < nLength; i++)
- {
- Any aAny = rContainer->getByIndex(i);
- Reference<XPropertySet> rElement;
- aAny >>= rElement;
-
- DBG_ASSERT(rElement.is(), "Image map element is empty!");
- if (rElement.is())
- {
- ExportMapEntry(rElement);
- }
- }
+ ExportMapEntry(rElement);
}
- // else: container is empty -> nothing to do
}
+ // else: container is empty -> nothing to do
// else: no container -> nothing to do
}