summaryrefslogtreecommitdiff
path: root/sc/source/filter/xml
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-11-08 00:25:19 +0100
committerJulien Nabet <serval2412@yahoo.fr>2017-11-08 07:01:46 +0100
commitb273aa535cdddd1f10d13551d5330149d3404c3a (patch)
tree59ca1b4413601c89e15a52c7b1f0899ea249b5c0 /sc/source/filter/xml
parent2db44bd017daac8f668393bca24911e95125857a (diff)
Replace list by vector for ScMyToFixupOLEs (sc)
Change-Id: I053e989f2c27ad09986e86df0a18d9ae6e05c160 Reviewed-on: https://gerrit.libreoffice.org/44440 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'sc/source/filter/xml')
-rw-r--r--sc/source/filter/xml/XMLTableShapeResizer.cxx14
-rw-r--r--sc/source/filter/xml/XMLTableShapeResizer.hxx6
2 files changed, 8 insertions, 12 deletions
diff --git a/sc/source/filter/xml/XMLTableShapeResizer.cxx b/sc/source/filter/xml/XMLTableShapeResizer.cxx
index e71445f9a4d9..92bcc9388f10 100644
--- a/sc/source/filter/xml/XMLTableShapeResizer.cxx
+++ b/sc/source/filter/xml/XMLTableShapeResizer.cxx
@@ -121,30 +121,28 @@ void ScMyOLEFixer::FixupOLEs()
if (!aShapes.empty() && rImport.GetModel().is())
{
OUString sPersistName ("PersistName");
- ScMyToFixupOLEs::iterator aItr(aShapes.begin());
- ScMyToFixupOLEs::iterator aEndItr(aShapes.end());
ScDocument* pDoc(rImport.GetDocument());
ScXMLImport::MutexGuard aGuard(rImport);
- while (aItr != aEndItr)
+ for (auto const& shape : aShapes)
{
// #i78086# also call CreateChartListener for invalid position (anchored to sheet)
- if (!IsOLE(aItr->xShape))
+ if (!IsOLE(shape.xShape))
OSL_FAIL("Only OLEs should be in here now");
- if (IsOLE(aItr->xShape))
+ if (IsOLE(shape.xShape))
{
- uno::Reference < beans::XPropertySet > xShapeProps ( aItr->xShape, uno::UNO_QUERY );
+ uno::Reference < beans::XPropertySet > xShapeProps ( shape.xShape, uno::UNO_QUERY );
uno::Reference < beans::XPropertySetInfo > xShapeInfo(xShapeProps->getPropertySetInfo());
OUString sName;
if (pDoc && xShapeProps.is() && xShapeInfo.is() && xShapeInfo->hasPropertyByName(sPersistName) &&
(xShapeProps->getPropertyValue(sPersistName) >>= sName))
- CreateChartListener(pDoc, sName, aItr->sRangeList);
+ CreateChartListener(pDoc, sName, shape.sRangeList);
}
- aItr = aShapes.erase(aItr);
}
+ aShapes.clear();
}
}
diff --git a/sc/source/filter/xml/XMLTableShapeResizer.hxx b/sc/source/filter/xml/XMLTableShapeResizer.hxx
index be6a97b5e812..43401c1a9e6e 100644
--- a/sc/source/filter/xml/XMLTableShapeResizer.hxx
+++ b/sc/source/filter/xml/XMLTableShapeResizer.hxx
@@ -21,7 +21,7 @@
#define INCLUDED_SC_SOURCE_FILTER_XML_XMLTABLESHAPERESIZER_HXX
#include <com/sun/star/drawing/XShape.hpp>
-#include <list>
+#include <vector>
class ScXMLImport;
class ScChartListenerCollection;
@@ -33,12 +33,10 @@ struct ScMyToFixupOLE
OUString sRangeList;
};
-typedef std::list<ScMyToFixupOLE> ScMyToFixupOLEs;
-
class ScMyOLEFixer
{
ScXMLImport& rImport;
- ScMyToFixupOLEs aShapes;
+ std::vector<ScMyToFixupOLE> aShapes;
ScChartListenerCollection* pCollection;
void CreateChartListener(ScDocument* pDoc,