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

Julien Nabet serval2412 at yahoo.fr
Sun Nov 19 08:40:09 UTC 2017


 sc/inc/chart2uno.hxx                                         |    4 -
 sc/source/filter/oox/worksheethelper.cxx                     |    2 
 sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx |   43 ++++-------
 3 files changed, 19 insertions(+), 30 deletions(-)

New commits:
commit 60da185b57f36d48808309d0fa6efb27a587c4e6
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Nov 18 20:48:45 2017 +0100

    Replace list by vector in accessible part of sc
    
    + remove useless typedef following https://cgit.freedesktop.org/libreoffice/core/commit/?id=65e578640f0258768a9253389356dbc63c845b7e
    + use for range loops
    
    Change-Id: I9b69acf4c0b783ee8db34791b1044cbebb68da9f
    Reviewed-on: https://gerrit.libreoffice.org/44919
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/sc/inc/chart2uno.hxx b/sc/inc/chart2uno.hxx
index d9c019dc7a3d..795561b642fa 100644
--- a/sc/inc/chart2uno.hxx
+++ b/sc/inc/chart2uno.hxx
@@ -46,7 +46,6 @@
 #include <rtl/ustring.hxx>
 #include <svl/itemprop.hxx>
 
-#include <list>
 #include <memory>
 #include <unordered_set>
 #include <vector>
@@ -183,8 +182,7 @@ public:
 private:
 
     ScDocument*                 m_pDocument;
-    typedef std::list < css::uno::Reference< css::chart2::data::XLabeledDataSequence > >  LabeledList;
-    LabeledList                 m_aLabeledSequences;
+    std::vector < css::uno::Reference< css::chart2::data::XLabeledDataSequence > > m_aLabeledSequences;
 
 };
 
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index a9d996d968e8..2ef765d932b5 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -21,7 +21,6 @@
 #include <worksheethelper.hxx>
 
 #include <algorithm>
-#include <list>
 #include <utility>
 #include <com/sun/star/awt/Point.hpp>
 #include <com/sun/star/awt/Size.hpp>
@@ -327,7 +326,6 @@ private:
     typedef ::std::map< sal_Int32, ColumnModelRange >   ColumnModelRangeMap;
     typedef ::std::pair< RowModel, sal_Int32 >          RowModelRange;
     typedef ::std::map< sal_Int32, RowModelRange >      RowModelRangeMap;
-    typedef ::std::list< ValidationModel >              ValidationModelList;
 
     /** Inserts all imported hyperlinks into their cell ranges. */
     void finalizeHyperlinkRanges();
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index 87b8e74ef1bb..406d40ed972c 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -58,14 +58,13 @@
 
 #include <utility>
 #include <vector>
-#include <list>
 #include <algorithm>
 #include <memory>
 #include <o3tl/make_unique.hxx>
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::accessibility;
 
-typedef std::list< uno::Reference< XAccessible > > ScXAccList;
+typedef std::vector< uno::Reference< XAccessible > > ScXAccVector;
 
 struct ScAccNote
 {
@@ -110,10 +109,10 @@ private:
     sal_Int32 AddNotes(const ScPreviewLocationData& rData, const tools::Rectangle& rVisRect, bool bMark, ScAccNotes& rNotes);
 
     static sal_Int8 CompareCell(const ScAddress& aCell1, const ScAddress& aCell2);
-    static void CollectChildren(const ScAccNote& rNote, ScXAccList& rList);
+    static void CollectChildren(const ScAccNote& rNote, ScXAccVector& rVector);
     sal_Int32 CheckChanges(const ScPreviewLocationData& rData, const tools::Rectangle& rVisRect,
         bool bMark, ScAccNotes& rOldNotes, ScAccNotes& rNewNotes,
-        ScXAccList& rOldParas, ScXAccList& rNewParas);
+        ScXAccVector& rOldParas, ScXAccVector& rNewParas);
 
     inline ScDocument* GetDocument() const;
 };
@@ -311,16 +310,16 @@ sal_Int8 ScNotesChildren::CompareCell(const ScAddress& aCell1, const ScAddress&
     return nResult;
 }
 
-void ScNotesChildren::CollectChildren(const ScAccNote& rNote, ScXAccList& rList)
+void ScNotesChildren::CollectChildren(const ScAccNote& rNote, ScXAccVector& rVector)
 {
     if (rNote.mpTextHelper)
         for (sal_Int32 i = 0; i < rNote.mnParaCount; ++i)
-            rList.push_back(rNote.mpTextHelper->GetChild(i + rNote.mpTextHelper->GetStartIndex()));
+            rVector.push_back(rNote.mpTextHelper->GetChild(i + rNote.mpTextHelper->GetStartIndex()));
 }
 
 sal_Int32 ScNotesChildren::CheckChanges(const ScPreviewLocationData& rData,
             const tools::Rectangle& rVisRect, bool bMark, ScAccNotes& rOldNotes,
-            ScAccNotes& rNewNotes, ScXAccList& rOldParas, ScXAccList& rNewParas)
+            ScAccNotes& rNewNotes, ScXAccVector& rOldParas, ScXAccVector& rNewParas)
 {
     sal_Int32 nCount = rData.GetNoteCountInRange(rVisRect, bMark);
 
@@ -456,8 +455,8 @@ void ScNotesChildren::DataChanged(const tools::Rectangle& rVisRect)
 {
     if (mpViewShell && mpAccDoc)
     {
-        ScXAccList aNewParas;
-        ScXAccList aOldParas;
+        ScXAccVector aNewParas;
+        ScXAccVector aOldParas;
         ScAccNotes aNewMarks;
         mnParagraphs = CheckChanges(mpViewShell->GetLocationData(), rVisRect, true, maMarks, aNewMarks, aOldParas, aNewParas);
         maMarks = aNewMarks;
@@ -810,15 +809,12 @@ namespace
 
 void ScShapeChildren::VisAreaChanged() const
 {
-    ScShapeRangeVec::const_iterator aEndItr = maShapeRanges.end();
-    ScShapeRangeVec::const_iterator aItr = maShapeRanges.begin();
-    while (aItr != aEndItr)
+    for (auto const& shape : maShapeRanges)
     {
         ScVisAreaChanged aVisAreaChanged;
-        std::for_each(aItr->maBackShapes.begin(), aItr->maBackShapes.end(), aVisAreaChanged);
-        std::for_each(aItr->maControls.begin(), aItr->maControls.end(), aVisAreaChanged);
-        std::for_each(aItr->maForeShapes.begin(), aItr->maForeShapes.end(), aVisAreaChanged);
-        ++aItr;
+        std::for_each(shape.maBackShapes.begin(), shape.maBackShapes.end(), aVisAreaChanged);
+        std::for_each(shape.maControls.begin(), shape.maControls.end(), aVisAreaChanged);
+        std::for_each(shape.maForeShapes.begin(), shape.maForeShapes.end(), aVisAreaChanged);
     }
 }
 
@@ -854,9 +850,8 @@ void ScShapeChildren::Init()
 sal_Int32 ScShapeChildren::GetBackShapeCount() const
 {
     sal_Int32 nCount(0);
-    ScShapeRangeVec::const_iterator aEndItr = maShapeRanges.end();
-    for ( ScShapeRangeVec::const_iterator aItr = maShapeRanges.begin(); aItr != aEndItr; ++aItr )
-        nCount += aItr->maBackShapes.size();
+    for (auto const& shape : maShapeRanges)
+        nCount += shape.maBackShapes.size();
     return nCount;
 }
 
@@ -884,9 +879,8 @@ uno::Reference<XAccessible> ScShapeChildren::GetBackShape(sal_Int32 nIndex) cons
 sal_Int32 ScShapeChildren::GetForeShapeCount() const
 {
     sal_Int32 nCount(0);
-    ScShapeRangeVec::const_iterator aEndItr = maShapeRanges.end();
-    for ( ScShapeRangeVec::const_iterator aItr = maShapeRanges.begin(); aItr != aEndItr; ++aItr )
-        nCount += aItr->maForeShapes.size();
+    for (auto const& shape : maShapeRanges)
+        nCount += shape.maForeShapes.size();
     return nCount;
 }
 
@@ -914,9 +908,8 @@ uno::Reference<XAccessible> ScShapeChildren::GetForeShape(sal_Int32 nIndex) cons
 sal_Int32 ScShapeChildren::GetControlCount() const
 {
     sal_Int32 nCount(0);
-    ScShapeRangeVec::const_iterator aEndItr = maShapeRanges.end();
-    for ( ScShapeRangeVec::const_iterator aItr = maShapeRanges.begin(); aItr != aEndItr; ++aItr )
-        nCount += aItr->maControls.size();
+    for (auto const& shape : maShapeRanges)
+        nCount += shape.maControls.size();
     return nCount;
 }
 


More information about the Libreoffice-commits mailing list