[Libreoffice-commits] core.git: sw/inc sw/source
Julien Nabet
serval2412 at yahoo.fr
Sun Oct 8 18:48:30 UTC 2017
sw/inc/dcontact.hxx | 7 ++++---
sw/source/core/draw/dcontact.cxx | 10 +++++-----
sw/source/core/draw/dview.cxx | 2 +-
sw/source/core/inc/flyfrm.hxx | 4 ++--
sw/source/core/layout/fly.cxx | 4 ++--
5 files changed, 14 insertions(+), 13 deletions(-)
New commits:
commit d7a22815e8e7e52702afc3ff418a859194a1af68
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Sun Oct 8 19:35:32 2017 +0200
Replace some lists by vectors (sw)
Change-Id: Ie2f20b05ce987bb907c6f455da57bfc734dcb2da
Reviewed-on: https://gerrit.libreoffice.org/43244
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx
index 80630c5f0464..d91c1cccfc0b 100644
--- a/sw/inc/dcontact.hxx
+++ b/sw/inc/dcontact.hxx
@@ -25,6 +25,7 @@
#include <fmtanchr.hxx>
#include <frmfmt.hxx>
#include <list>
+#include <vector>
#include <memory>
#include "calbck.hxx"
@@ -170,7 +171,7 @@ public:
/** get data collection of anchored objects, handled by with contact
*/
- virtual void GetAnchoredObjs( std::list<SwAnchoredObject*>& _roAnchoredObjs ) const = 0;
+ virtual void GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAnchoredObjs ) const = 0;
/** get minimum order number of anchored objects handled by with contact
@@ -215,7 +216,7 @@ public:
/** get data collection of anchored objects handled by with contact
*/
- virtual void GetAnchoredObjs( std::list<SwAnchoredObject*>& _roAnchoredObjs ) const override;
+ virtual void GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAnchoredObjs ) const override;
};
/** new class for re-direct methods calls at a 'virtual'
@@ -416,7 +417,7 @@ class SwDrawContact final : public SwContact
*/
static void GetTextObjectsFromFormat( std::list<SdrTextObj*>&, SwDoc* );
- virtual void GetAnchoredObjs( std::list<SwAnchoredObject*>& _roAnchoredObjs ) const override;
+ virtual void GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAnchoredObjs ) const override;
};
#endif
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index ce830a7ab527..f71286a7a521 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -353,7 +353,7 @@ sal_uInt32 SwContact::GetMinOrdNum() const
{
sal_uInt32 nMinOrdNum( SAL_MAX_UINT32 );
- std::list< SwAnchoredObject* > aObjs;
+ std::vector< SwAnchoredObject* > aObjs;
GetAnchoredObjs( aObjs );
while ( !aObjs.empty() )
@@ -378,7 +378,7 @@ sal_uInt32 SwContact::GetMaxOrdNum() const
{
sal_uInt32 nMaxOrdNum( 0 );
- std::list< SwAnchoredObject* > aObjs;
+ std::vector< SwAnchoredObject* > aObjs;
GetAnchoredObjs( aObjs );
while ( !aObjs.empty() )
@@ -434,7 +434,7 @@ void SwContact::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
// determine anchored object
SwAnchoredObject* pAnchoredObj(nullptr);
{
- std::list<SwAnchoredObject*> aAnchoredObjs;
+ std::vector<SwAnchoredObject*> aAnchoredObjs;
GetAnchoredObjs(aAnchoredObjs);
if(!aAnchoredObjs.empty())
pAnchoredObj = aAnchoredObjs.front();
@@ -633,7 +633,7 @@ void SwFlyDrawContact::MoveObjToInvisibleLayer( SdrObject* _pDrawObj )
}
/// get data collection of anchored objects, handled by with contact
-void SwFlyDrawContact::GetAnchoredObjs( std::list<SwAnchoredObject*>& _roAnchoredObjs ) const
+void SwFlyDrawContact::GetAnchoredObjs( std::vector<SwAnchoredObject*>& _roAnchoredObjs ) const
{
const SwFrameFormat* pFormat = GetFormat();
SwFlyFrame::GetAnchoredObjects( _roAnchoredObjs, *pFormat );
@@ -1963,7 +1963,7 @@ void SwDrawContact::ChangeMasterObject(SdrObject* pNewMaster)
}
/// get data collection of anchored objects, handled by with contact
-void SwDrawContact::GetAnchoredObjs(std::list<SwAnchoredObject*>& o_rAnchoredObjs) const
+void SwDrawContact::GetAnchoredObjs(std::vector<SwAnchoredObject*>& o_rAnchoredObjs) const
{
o_rAnchoredObjs.push_back(const_cast<SwAnchoredDrawObject*>(&maAnchoredDrawObj));
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index 5bf7304acf39..d7c995ef552e 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -342,7 +342,7 @@ void SwDrawView::MoveRepeatedObjs( const SwAnchoredObject& _rMovedAnchoredObj,
const std::vector<SdrObject*>& _rMovedChildObjs ) const
{
// determine 'repeated' objects of already moved object <_rMovedAnchoredObj>
- std::list<SwAnchoredObject*> aAnchoredObjs;
+ std::vector<SwAnchoredObject*> aAnchoredObjs;
{
const SwContact* pContact = ::GetUserCall( _rMovedAnchoredObj.GetDrawObj() );
assert(pContact && "SwDrawView::MoveRepeatedObjs(..) - missing contact object -> crash.");
diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx
index 1faae2876a74..4f390980dc6d 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/sw/source/core/inc/flyfrm.hxx
@@ -21,7 +21,7 @@
#define INCLUDED_SW_SOURCE_CORE_INC_FLYFRM_HXX
#include "layfrm.hxx"
-#include <list>
+#include <vector>
#include "frmfmt.hxx"
#include <anchoredobject.hxx>
@@ -250,7 +250,7 @@ public:
format isn't possible, if Writer fly frame is locked resp. col-locked.
*/
virtual bool IsFormatPossible() const override;
- static void GetAnchoredObjects( std::list<SwAnchoredObject*>&, const SwFormat& rFormat );
+ static void GetAnchoredObjects( std::vector<SwAnchoredObject*>&, const SwFormat& rFormat );
// overwriting "SwFrameFormat *SwLayoutFrame::GetFormat" to provide the correct derived return type.
// (This is in order to skip on the otherwise necessary casting of the result to
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 02538a9d9f5a..5070eac93604 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -2534,11 +2534,11 @@ bool SwFlyFrame::IsFormatPossible() const
!IsLocked() && !IsColLocked();
}
-void SwFlyFrame::GetAnchoredObjects( std::list<SwAnchoredObject*>& aList, const SwFormat& rFormat )
+void SwFlyFrame::GetAnchoredObjects( std::vector<SwAnchoredObject*>& aVector, const SwFormat& rFormat )
{
SwIterator<SwFlyFrame,SwFormat> aIter( rFormat );
for( SwFlyFrame* pFlyFrame = aIter.First(); pFlyFrame; pFlyFrame = aIter.Next() )
- aList.push_back( pFlyFrame );
+ aVector.push_back( pFlyFrame );
}
const SwFlyFrameFormat * SwFlyFrame::GetFormat() const
More information about the Libreoffice-commits
mailing list