Kaydet (Commit) 60da185b authored tarafından Julien Nabet's avatar Julien Nabet

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/44919Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
üst b904d639
......@@ -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;
};
......
......@@ -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();
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment