[Libreoffice-commits] core.git: sc/source

Julien Nabet serval2412 at yahoo.fr
Wed Nov 8 06:02:15 UTC 2017


 sc/source/filter/xml/XMLTableShapeResizer.cxx |   14 ++++++--------
 sc/source/filter/xml/XMLTableShapeResizer.hxx |    6 ++----
 2 files changed, 8 insertions(+), 12 deletions(-)

New commits:
commit b273aa535cdddd1f10d13551d5330149d3404c3a
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Wed Nov 8 00:25:19 2017 +0100

    Replace list by vector for ScMyToFixupOLEs (sc)
    
    Change-Id: I053e989f2c27ad09986e86df0a18d9ae6e05c160
    Reviewed-on: https://gerrit.libreoffice.org/44440
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

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,


More information about the Libreoffice-commits mailing list