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>
diff --git a/sc/source/filter/xml/XMLTableShapeResizer.cxx b/sc/source/filter/xml/XMLTableShapeResizer.cxx
index e71445f..92bcc93 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 be6a97b5..43401c1 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,