sw/inc/calbck.hxx | 191 ++++++++++++++--------- sw/inc/switerator.hxx | 68 -------- sw/source/core/access/accmap.cxx | 2 sw/source/core/attr/calbck.cxx | 26 +-- sw/source/core/attr/cellatr.cxx | 2 sw/source/core/crsr/annotationmark.cxx | 2 sw/source/core/crsr/crstrvl.cxx | 2 sw/source/core/doc/DocumentFieldsManager.cxx | 2 sw/source/core/doc/DocumentStatisticsManager.cxx | 2 sw/source/core/doc/doc.cxx | 2 sw/source/core/doc/docdraw.cxx | 2 sw/source/core/doc/docfld.cxx | 2 sw/source/core/doc/docfly.cxx | 2 sw/source/core/doc/docglbl.cxx | 2 sw/source/core/doc/docnum.cxx | 2 sw/source/core/doc/doctxm.cxx | 2 sw/source/core/doc/fmtcol.cxx | 2 sw/source/core/doc/htmltbl.cxx | 2 sw/source/core/doc/tblrwcl.cxx | 2 sw/source/core/docnode/ndtbl.cxx | 2 sw/source/core/docnode/ndtbl1.cxx | 2 sw/source/core/docnode/node.cxx | 2 sw/source/core/docnode/node2lay.cxx | 2 sw/source/core/docnode/section.cxx | 2 sw/source/core/docnode/swbaslnk.cxx | 2 sw/source/core/draw/dcontact.cxx | 2 sw/source/core/edit/edfld.cxx | 2 sw/source/core/edit/edfldexp.cxx | 2 sw/source/core/edit/editsh.cxx | 2 sw/source/core/fields/authfld.cxx | 2 sw/source/core/fields/dbfld.cxx | 2 sw/source/core/fields/ddefld.cxx | 2 sw/source/core/fields/docufld.cxx | 2 sw/source/core/fields/expfld.cxx | 2 sw/source/core/fields/fldbas.cxx | 2 sw/source/core/fields/fldlst.cxx | 2 sw/source/core/fields/postithelper.cxx | 2 sw/source/core/fields/reffld.cxx | 2 sw/source/core/fields/tblcalc.cxx | 2 sw/source/core/frmedt/feshview.cxx | 2 sw/source/core/frmedt/tblsel.cxx | 2 sw/source/core/layout/atrfrm.cxx | 2 sw/source/core/layout/colfrm.cxx | 2 sw/source/core/layout/findfrm.cxx | 2 sw/source/core/layout/flowfrm.cxx | 2 sw/source/core/layout/fly.cxx | 2 sw/source/core/layout/flypos.cxx | 2 sw/source/core/layout/frmtool.cxx | 2 sw/source/core/layout/ftnfrm.cxx | 2 sw/source/core/layout/movedfwdfrmsbyobjpos.cxx | 2 sw/source/core/layout/pagechg.cxx | 2 sw/source/core/layout/pagedesc.cxx | 2 sw/source/core/layout/paintfrm.cxx | 2 sw/source/core/layout/softpagebreak.cxx | 2 sw/source/core/layout/tabfrm.cxx | 2 sw/source/core/table/swnewtable.cxx | 2 sw/source/core/table/swtable.cxx | 2 sw/source/core/text/EnhancedPDFExportHelper.cxx | 2 sw/source/core/text/itratr.cxx | 2 sw/source/core/text/porlay.cxx | 2 sw/source/core/text/txtdrop.cxx | 2 sw/source/core/text/txtfrm.cxx | 2 sw/source/core/tox/tox.cxx | 2 sw/source/core/txtnode/atrflyin.cxx | 2 sw/source/core/txtnode/atrftn.cxx | 2 sw/source/core/txtnode/ndtxt.cxx | 2 sw/source/core/undo/unattr.cxx | 2 sw/source/core/undo/untbl.cxx | 2 sw/source/core/unocore/unocoll.cxx | 2 sw/source/core/unocore/unodraw.cxx | 2 sw/source/core/unocore/unofield.cxx | 2 sw/source/core/unocore/unoframe.cxx | 2 sw/source/core/unocore/unoobj2.cxx | 2 sw/source/core/unocore/unoportenum.cxx | 2 sw/source/core/unocore/unoredlines.cxx | 2 sw/source/core/unocore/unotbl.cxx | 2 sw/source/core/view/vnew.cxx | 2 sw/source/filter/ww8/ww8atr.cxx | 2 sw/source/filter/xml/xmltexti.cxx | 2 sw/source/ui/fldui/fldpage.cxx | 2 sw/source/uibase/app/docsh.cxx | 2 sw/source/uibase/dochdl/swdtflvr.cxx | 2 sw/source/uibase/docvw/PostItMgr.cxx | 2 sw/source/uibase/shells/textfld.cxx | 2 sw/source/uibase/uno/unotxvw.cxx | 2 85 files changed, 214 insertions(+), 235 deletions(-)
New commits: commit 181feb38d95e25980b96c2f6802cc906410abb13 Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Wed Mar 18 16:23:19 2015 +0100 more privacy tweaks Change-Id: Id0d81d2216692f9b596493b5a424fea656295b71 diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index d3080c7..0275c16 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -247,13 +247,18 @@ namespace sw { class ClientIteratorBase SAL_FINAL : public sw::Ring< ::sw::ClientIteratorBase > { - friend SwModify; + friend SwClient* SwModify::Remove(SwClient*); + friend void SwModify::Add(SwClient*); template<typename E, typename S> friend class ::SwIterator; ///< for typed interation const SwModify& m_rRoot; - // the current object in an iteration SwClient* m_pCurrent; + // in case the current object is already removed, the next object in the list + // is marked down to become the current object in the next step + // this is necessary because iteration requires access to members of the current object + SwClient* m_pPosition; + static SW_DLLPUBLIC ClientIteratorBase* our_pClientIters; ClientIteratorBase( const SwModify& rModify ) : m_rRoot(rModify) @@ -262,10 +267,6 @@ namespace sw our_pClientIters = this; m_pCurrent = m_pPosition = const_cast<SwClient*>(m_rRoot.GetDepends()); } - // in case the current object is already removed, the next object in the list - // is marked down to become the current object in the next step - // this is necessary because iteration requires access to members of the current object - SwClient* m_pPosition; SwClient* GetLeftOfPos() { return static_cast<SwClient*>(m_pPosition->m_pLeft); } SwClient* GetRighOfPos() { return static_cast<SwClient*>(m_pPosition->m_pRight); } SwClient* GoStart() @@ -275,11 +276,6 @@ namespace sw m_pPosition = static_cast<SwClient*>(m_pPosition->m_pLeft); return m_pCurrent = m_pPosition; } - const SwModify& GetModify() const { return m_rRoot; } - - static SW_DLLPUBLIC ClientIteratorBase* our_pClientIters; - - public: ~ClientIteratorBase() SAL_OVERRIDE { assert(our_pClientIters); diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index 86f2d74..ee78693 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -152,7 +152,7 @@ void SwModify::Add( SwClient* pDepend ) { for(auto& rIter : sw::ClientIteratorBase::our_pClientIters->GetRingContainer()) { - OSL_ENSURE( &rIter.GetModify() != pRoot, "Client added to active ClientIter" ); + OSL_ENSURE( &rIter.m_rRoot != pRoot, "Client added to active ClientIter" ); } } #endif commit 3170b41ddcc69a2f65d8ae48352a183937badce9 Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Wed Mar 18 16:14:58 2015 +0100 rename SwClientIter to sw::ClientIteratorBase Change-Id: I31ddba4e4b0020ed8187d67eb69353f81da8bd1c diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index e4b93c8..d3080c7 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -64,11 +64,11 @@ class SfxHint; class SwModify; class SwClient; -class SwClientIter; template<typename E, typename S> class SwIterator; namespace sw { + class ClientIteratorBase; struct LegacyModifyHint SAL_FINAL: SfxHint { LegacyModifyHint(const SfxPoolItem* pOld, const SfxPoolItem* pNew) : m_pOld(pOld), m_pNew(pNew) {}; @@ -80,7 +80,7 @@ namespace sw { friend class ::SwModify; friend class ::SwClient; - friend class ::SwClientIter; + friend class ::sw::ClientIteratorBase; private: WriterListener* m_pLeft; WriterListener* m_pRight; ///< double-linked list of other clients @@ -99,7 +99,7 @@ class SW_DLLPUBLIC SwClient : ::sw::WriterListener { // avoids making the details of the linked list and the callback method public friend class SwModify; - friend class SwClientIter; + friend class sw::ClientIteratorBase; SwModify *pRegisteredIn; ///< event source @@ -243,60 +243,62 @@ protected: { if(m_pToTell) m_pToTell->SwClientNotifyCall(rModify, rHint); } }; -class SwClientIter SAL_FINAL : public sw::Ring<SwClientIter> +namespace sw { - friend SwModify; - //friend SwClient* SwModify::Remove(SwClient*); - template<typename E, typename S> friend class SwIterator; ///< for typed interation - - const SwModify& m_rRoot; - - // the current object in an iteration - SwClient* m_pCurrent; - - SwClientIter( const SwModify& rModify ) - : m_rRoot(rModify) - { - MoveTo(our_pClientIters); - our_pClientIters = this; - m_pCurrent = m_pPosition = const_cast<SwClient*>(m_rRoot.GetDepends()); - } - // in case the current object is already removed, the next object in the list - // is marked down to become the current object in the next step - // this is necessary because iteration requires access to members of the current object - SwClient* m_pPosition; - SwClient* GetLeftOfPos() { return static_cast<SwClient*>(m_pPosition->m_pLeft); } - SwClient* GetRighOfPos() { return static_cast<SwClient*>(m_pPosition->m_pRight); } - SwClient* GoStart() - { - if((m_pPosition = const_cast<SwClient*>(m_rRoot.GetDepends()))) - while( m_pPosition->m_pLeft ) - m_pPosition = static_cast<SwClient*>(m_pPosition->m_pLeft); - return m_pCurrent = m_pPosition; - } - const SwModify& GetModify() const { return m_rRoot; } - - static SW_DLLPUBLIC SwClientIter* our_pClientIters; - -public: - ~SwClientIter() SAL_OVERRIDE + class ClientIteratorBase SAL_FINAL : public sw::Ring< ::sw::ClientIteratorBase > { - assert(our_pClientIters); - if(our_pClientIters == this) - our_pClientIters = unique() ? nullptr : GetNextInRing(); - MoveTo(nullptr); - } - // return "true" if an object was removed from a client chain in iteration - // adding objects to a client chain in iteration is forbidden - // SwModify::Add() asserts this - bool IsChanged() const { return m_pPosition != m_pCurrent; } -}; + friend SwModify; + template<typename E, typename S> friend class ::SwIterator; ///< for typed interation + + const SwModify& m_rRoot; + + // the current object in an iteration + SwClient* m_pCurrent; + + ClientIteratorBase( const SwModify& rModify ) + : m_rRoot(rModify) + { + MoveTo(our_pClientIters); + our_pClientIters = this; + m_pCurrent = m_pPosition = const_cast<SwClient*>(m_rRoot.GetDepends()); + } + // in case the current object is already removed, the next object in the list + // is marked down to become the current object in the next step + // this is necessary because iteration requires access to members of the current object + SwClient* m_pPosition; + SwClient* GetLeftOfPos() { return static_cast<SwClient*>(m_pPosition->m_pLeft); } + SwClient* GetRighOfPos() { return static_cast<SwClient*>(m_pPosition->m_pRight); } + SwClient* GoStart() + { + if((m_pPosition = const_cast<SwClient*>(m_rRoot.GetDepends()))) + while( m_pPosition->m_pLeft ) + m_pPosition = static_cast<SwClient*>(m_pPosition->m_pLeft); + return m_pCurrent = m_pPosition; + } + const SwModify& GetModify() const { return m_rRoot; } + + static SW_DLLPUBLIC ClientIteratorBase* our_pClientIters; + + public: + ~ClientIteratorBase() SAL_OVERRIDE + { + assert(our_pClientIters); + if(our_pClientIters == this) + our_pClientIters = unique() ? nullptr : GetNextInRing(); + MoveTo(nullptr); + } + // return "true" if an object was removed from a client chain in iteration + // adding objects to a client chain in iteration is forbidden + // SwModify::Add() asserts this + bool IsChanged() const { return m_pPosition != m_pCurrent; } + }; +} template< typename TElementType, typename TSource > class SwIterator SAL_FINAL { static_assert(std::is_base_of<SwClient,TElementType>::value, "TElementType needs to be derived from SwClient"); static_assert(std::is_base_of<SwModify,TSource>::value, "TSource needs to be derived from SwModify"); - SwClientIter aClientIter; + sw::ClientIteratorBase aClientIter; public: SwIterator( const TSource& rSrc ) : aClientIter(rSrc) {} @@ -341,7 +343,7 @@ public: template< typename TSource > class SwIterator<SwClient, TSource> { static_assert(std::is_base_of<SwModify,TSource>::value, "TSource needs to be derived from SwModify"); - SwClientIter aClientIter; + sw::ClientIteratorBase aClientIter; public: SwIterator( const TSource& rSrc ) : aClientIter(rSrc) {} SwClient* First() diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index e4eb513..86f2d74 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -148,9 +148,9 @@ void SwModify::Add( SwClient* pDepend ) if(pDepend->pRegisteredIn != this ) { #if OSL_DEBUG_LEVEL > 0 - if(SwClientIter::our_pClientIters) + if(sw::ClientIteratorBase::our_pClientIters) { - for(auto& rIter : SwClientIter::our_pClientIters->GetRingContainer()) + for(auto& rIter : sw::ClientIteratorBase::our_pClientIters->GetRingContainer()) { OSL_ENSURE( &rIter.GetModify() != pRoot, "Client added to active ClientIter" ); } @@ -201,10 +201,10 @@ SwClient* SwModify::Remove( SwClient* pDepend ) if( pR ) pR->m_pLeft = pL; - // update ClientIters - if(SwClientIter::our_pClientIters) + // update ClientIterators + if(sw::ClientIteratorBase::our_pClientIters) { - for(auto& rIter : SwClientIter::our_pClientIters->GetRingContainer()) + for(auto& rIter : sw::ClientIteratorBase::our_pClientIters->GetRingContainer()) { if( rIter.m_pCurrent == pDepend || rIter.m_pPosition == pDepend ) { @@ -259,5 +259,5 @@ void SwModify::CheckCaching( const sal_uInt16 nWhich ) } } -SwClientIter* SwClientIter::our_pClientIters = nullptr; +sw::ClientIteratorBase* sw::ClientIteratorBase::our_pClientIters = nullptr; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 6c58493295547a83aecfc5d69b17316e980f8548 Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Wed Mar 18 15:50:28 2015 +0100 simplify specialized SwIterator::First() Change-Id: I6aac0645939cea0ef8fbfc2796f94cffc56d224e diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index 4bffc7c..e4b93c8 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -345,13 +345,7 @@ template< typename TSource > class SwIterator<SwClient, TSource> public: SwIterator( const TSource& rSrc ) : aClientIter(rSrc) {} SwClient* First() - { - aClientIter.GoStart(); - if(!aClientIter.m_pPosition) - return nullptr; - aClientIter.m_pCurrent = nullptr; - return Next(); - } + { return aClientIter.GoStart(); } SwClient* Last() { if(!aClientIter.m_pPosition) commit a7a0d8f7dd05d3b3e7d989573048495f3e6d5f36 Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Wed Mar 18 15:49:18 2015 +0100 make SwClientIter construcatable only from SwIter Change-Id: I6e203792187311f3d00fd074fd67cbae7680723e diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index 0ee4cf9..4bffc7c 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -245,7 +245,8 @@ protected: class SwClientIter SAL_FINAL : public sw::Ring<SwClientIter> { - friend SwClient* SwModify::Remove(SwClient*); + friend SwModify; + //friend SwClient* SwModify::Remove(SwClient*); template<typename E, typename S> friend class SwIterator; ///< for typed interation const SwModify& m_rRoot; @@ -253,6 +254,13 @@ class SwClientIter SAL_FINAL : public sw::Ring<SwClientIter> // the current object in an iteration SwClient* m_pCurrent; + SwClientIter( const SwModify& rModify ) + : m_rRoot(rModify) + { + MoveTo(our_pClientIters); + our_pClientIters = this; + m_pCurrent = m_pPosition = const_cast<SwClient*>(m_rRoot.GetDepends()); + } // in case the current object is already removed, the next object in the list // is marked down to become the current object in the next step // this is necessary because iteration requires access to members of the current object @@ -271,13 +279,6 @@ class SwClientIter SAL_FINAL : public sw::Ring<SwClientIter> static SW_DLLPUBLIC SwClientIter* our_pClientIters; public: - SwClientIter( const SwModify& rModify ) - : m_rRoot(rModify) - { - MoveTo(our_pClientIters); - our_pClientIters = this; - m_pCurrent = m_pPosition = const_cast<SwClient*>(m_rRoot.GetDepends()); - } ~SwClientIter() SAL_OVERRIDE { assert(our_pClientIters); commit 59665096831ef0e88a3cfbfa4377d09246896f68 Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Wed Mar 18 15:48:44 2015 +0100 limit friendship Change-Id: I217077de4ccc2667a17e34ffcc781f1a6b736210 diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index 0b85f3b..0ee4cf9 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -245,7 +245,7 @@ protected: class SwClientIter SAL_FINAL : public sw::Ring<SwClientIter> { - friend class SwModify; + friend SwClient* SwModify::Remove(SwClient*); template<typename E, typename S> friend class SwIterator; ///< for typed interation const SwModify& m_rRoot; commit 37262d61b395afdd575ddc99c1eab83b414fd082 Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Wed Mar 18 15:28:10 2015 +0100 remove superficial helpers Change-Id: Icd690bf20c47152b00e1f51586471f9fe029c4cf diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index 0059a4c..0b85f3b 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -285,23 +285,6 @@ public: our_pClientIters = unique() ? nullptr : GetNextInRing(); MoveTo(nullptr); } - - SwClient* operator++() - { - if( m_pPosition == m_pCurrent ) - m_pPosition = static_cast<SwClient*>(m_pPosition->m_pRight); - return m_pCurrent = m_pPosition; - } - - // returns the current SwClient object, wether it is still a client or not - SwClient& operator*() const - { return *m_pCurrent; } - // returns the current SwClient object, wether it is still a client or not - SwClient* operator->() const - { return m_pCurrent; } - explicit operator bool() const - { return m_pCurrent!=nullptr; } - // return "true" if an object was removed from a client chain in iteration // adding objects to a client chain in iteration is forbidden // SwModify::Add() asserts this @@ -401,23 +384,19 @@ SwClient::SwClient( SwModify* pToRegisterIn ) void SwModify::ModifyBroadcast( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue, TypeId nType) { - SwClientIter aIter(*this); - aIter.GoStart(); - while(aIter) + SwIterator<SwClient,SwModify> aIter(*this); + for(SwClient* pClient = aIter.First(); pClient; pClient = aIter.Next()) { - if( aIter.m_pPosition == aIter.m_pCurrent ) - aIter.m_pPosition = static_cast<SwClient*>(aIter.m_pPosition->m_pRight); - while(aIter.m_pPosition && !aIter.m_pPosition->IsA( nType ) ) - aIter.m_pPosition = static_cast<SwClient*>(aIter.m_pPosition->m_pRight); - aIter.m_pCurrent = aIter.m_pPosition; - aIter->Modify( pOldValue, pNewValue ); + if(pClient->IsA(nType)) + pClient->Modify( pOldValue, pNewValue ); } } void SwModify::CallSwClientNotify( const SfxHint& rHint ) const { - for(SwClientIter aIter(*this); aIter; ++aIter) - aIter->SwClientNotify( *this, rHint ); + SwIterator<SwClient,SwModify> aIter(*this); + for(SwClient* pClient = aIter.First(); pClient; pClient = aIter.Next()) + pClient->SwClientNotify( *this, rHint ); } #endif diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index a19229d..e4eb513 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -74,9 +74,9 @@ SwModify::~SwModify() // If the document gets destroyed anyway, just tell clients to // forget me so that they don't try to get removed from my list // later when they also get destroyed - SwClientIter aIter( *this ); - for(aIter.GoStart(); aIter; ++aIter) - aIter->pRegisteredIn = nullptr; + SwIterator<SwClient,SwModify> aIter(*this); + for(SwClient* pClient = aIter.First(); pClient; pClient = aIter.Next()) + pClient->pRegisteredIn = nullptr; } else { @@ -134,9 +134,9 @@ bool SwModify::GetInfo( SfxPoolItem& rInfo ) const { if(!pRoot) return true; - SwClientIter aIter( *const_cast<SwModify*>(this) ); - for(aIter.GoStart(); aIter; ++aIter) - if(!aIter->GetInfo( rInfo )) + SwIterator<SwClient,SwModify> aIter(*this); + for(SwClient* pClient = aIter.First(); pClient; pClient = aIter.Next()) + if(!pClient->GetInfo( rInfo )) return false; return true; } commit a5fead9c44e2965587919e675ab5fa5e9c4a6b7f Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Wed Mar 18 15:01:34 2015 +0100 specialize SwIterator<SwClient, T> Change-Id: I6d9457e8f005dffef5ce8969ad895b43e90efadd diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index 8fa3ff5..0059a4c 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -308,9 +308,8 @@ public: bool IsChanged() const { return m_pPosition != m_pCurrent; } }; -template< class TElementType, class TSource > class SwIterator SAL_FINAL +template< typename TElementType, typename TSource > class SwIterator SAL_FINAL { - static_assert(std::is_base_of<SwClient,TElementType>::value, "TElementType needs to be derived from SwClient"); static_assert(std::is_base_of<SwModify,TSource>::value, "TSource needs to be derived from SwModify"); SwClientIter aClientIter; @@ -355,6 +354,44 @@ public: bool IsChanged() { return aClientIter.IsChanged(); } }; +template< typename TSource > class SwIterator<SwClient, TSource> +{ + static_assert(std::is_base_of<SwModify,TSource>::value, "TSource needs to be derived from SwModify"); + SwClientIter aClientIter; +public: + SwIterator( const TSource& rSrc ) : aClientIter(rSrc) {} + SwClient* First() + { + aClientIter.GoStart(); + if(!aClientIter.m_pPosition) + return nullptr; + aClientIter.m_pCurrent = nullptr; + return Next(); + } + SwClient* Last() + { + if(!aClientIter.m_pPosition) + aClientIter.m_pPosition = const_cast<SwClient*>(aClientIter.m_rRoot.GetDepends()); + if(!aClientIter.m_pPosition) + return aClientIter.m_pCurrent = nullptr; + while(aClientIter.GetRighOfPos()) + aClientIter.m_pPosition = aClientIter.GetRighOfPos(); + return aClientIter.m_pCurrent = aClientIter.m_pPosition; + } + SwClient* Next() + { + if( aClientIter.m_pPosition == aClientIter.m_pCurrent ) + aClientIter.m_pPosition = aClientIter.GetRighOfPos(); + return aClientIter.m_pCurrent = aClientIter.m_pPosition; + } + SwClient* Previous() + { + aClientIter.m_pPosition = aClientIter.GetLeftOfPos(); + return aClientIter.m_pCurrent = aClientIter.m_pPosition; + } + bool IsChanged() { return aClientIter.IsChanged(); } +}; + SwClient::SwClient( SwModify* pToRegisterIn ) : pRegisteredIn( nullptr ) { commit 25a99a65e8aa2962ed980ed750c349d7863eb87c Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Wed Mar 18 15:01:09 2015 +0100 make GetModify private Change-Id: I451f2670027eabb692ad2c91f33dfe7c311b8731 diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index 480c05d..8fa3ff5 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -266,6 +266,7 @@ class SwClientIter SAL_FINAL : public sw::Ring<SwClientIter> m_pPosition = static_cast<SwClient*>(m_pPosition->m_pLeft); return m_pCurrent = m_pPosition; } + const SwModify& GetModify() const { return m_rRoot; } static SW_DLLPUBLIC SwClientIter* our_pClientIters; @@ -285,8 +286,6 @@ public: MoveTo(nullptr); } - const SwModify& GetModify() const { return m_rRoot; } - SwClient* operator++() { if( m_pPosition == m_pCurrent ) commit 11b22c3c68a939cb723062ba9e6da279dd14398f Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Wed Mar 18 14:01:29 2015 +0100 more static checks ftw Change-Id: Ic5a459704c6cc60d854ae285543314df063d8926 diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index 024804b..480c05d 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -313,6 +313,7 @@ template< class TElementType, class TSource > class SwIterator SAL_FINAL { static_assert(std::is_base_of<SwClient,TElementType>::value, "TElementType needs to be derived from SwClient"); + static_assert(std::is_base_of<SwModify,TSource>::value, "TSource needs to be derived from SwModify"); SwClientIter aClientIter; public: commit d26725ad0f406069b15e5f1ea722f36d5ac27edd Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Wed Mar 18 13:58:25 2015 +0100 move SwIterator into calbck.hxx Change-Id: Icdcd46d392bbf1dbe45448328c310d9a327ba60d diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index a3bd078..024804b 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -27,6 +27,7 @@ #include <hintids.hxx> #include <hints.hxx> #include <typeinfo> +#include <type_traits> class SwModify; @@ -308,6 +309,52 @@ public: bool IsChanged() const { return m_pPosition != m_pCurrent; } }; +template< class TElementType, class TSource > class SwIterator SAL_FINAL +{ + + static_assert(std::is_base_of<SwClient,TElementType>::value, "TElementType needs to be derived from SwClient"); + SwClientIter aClientIter; +public: + + SwIterator( const TSource& rSrc ) : aClientIter(rSrc) {} + TElementType* First() + { + aClientIter.GoStart(); + if(!aClientIter.m_pPosition) + return nullptr; + aClientIter.m_pCurrent = nullptr; + return Next(); + } + TElementType* Last() + { + if(!aClientIter.m_pPosition) + aClientIter.m_pPosition = const_cast<SwClient*>(aClientIter.m_rRoot.GetDepends()); + if(!aClientIter.m_pPosition) + return PTR_CAST(TElementType,aClientIter.m_pCurrent = nullptr); + while(aClientIter.GetRighOfPos()) + aClientIter.m_pPosition = aClientIter.GetRighOfPos(); + if(aClientIter.m_pPosition->IsA(TYPE(TElementType))) + return PTR_CAST(TElementType,aClientIter.m_pCurrent = aClientIter.m_pPosition); + return Previous(); + } + TElementType* Next() + { + if( aClientIter.m_pPosition == aClientIter.m_pCurrent ) + aClientIter.m_pPosition = aClientIter.GetRighOfPos(); + while(aClientIter.m_pPosition && !aClientIter.m_pPosition->IsA( TYPE(TElementType) ) ) + aClientIter.m_pPosition = aClientIter.GetRighOfPos(); + return PTR_CAST(TElementType,aClientIter.m_pCurrent = aClientIter.m_pPosition); + } + TElementType* Previous() + { + aClientIter.m_pPosition = aClientIter.GetLeftOfPos(); + while(aClientIter.m_pPosition && !aClientIter.m_pPosition->IsA( TYPE(TElementType) ) ) + aClientIter.m_pPosition = aClientIter.GetLeftOfPos(); + return PTR_CAST(TElementType,aClientIter.m_pCurrent = aClientIter.m_pPosition); + } + bool IsChanged() { return aClientIter.IsChanged(); } +}; + SwClient::SwClient( SwModify* pToRegisterIn ) : pRegisteredIn( nullptr ) { diff --git a/sw/inc/switerator.hxx b/sw/inc/switerator.hxx deleted file mode 100644 index 8221642..0000000 --- a/sw/inc/switerator.hxx +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_SW_INC_SWITERATOR_HXX -#define INCLUDED_SW_INC_SWITERATOR_HXX - -#include <type_traits> -#include <calbck.hxx> -#include <sal/log.hxx> - -template< class TElementType, class TSource > class SwIterator SAL_FINAL -{ - - static_assert(std::is_base_of<SwClient,TElementType>::value, "TElementType needs to be derived from SwClient"); - SwClientIter aClientIter; -public: - - SwIterator( const TSource& rSrc ) : aClientIter(rSrc) {} - TElementType* First() - { - aClientIter.GoStart(); - if(!aClientIter.m_pPosition) - return nullptr; - aClientIter.m_pCurrent = nullptr; - return Next(); - } - TElementType* Last() - { - if(!aClientIter.m_pPosition) - aClientIter.m_pPosition = const_cast<SwClient*>(aClientIter.m_rRoot.GetDepends()); - if(!aClientIter.m_pPosition) - return PTR_CAST(TElementType,aClientIter.m_pCurrent = nullptr); - while(aClientIter.GetRighOfPos()) - aClientIter.m_pPosition = aClientIter.GetRighOfPos(); - if(aClientIter.m_pPosition->IsA(TYPE(TElementType))) - return PTR_CAST(TElementType,aClientIter.m_pCurrent = aClientIter.m_pPosition); - return Previous(); - } - TElementType* Next() - { - if( aClientIter.m_pPosition == aClientIter.m_pCurrent ) - aClientIter.m_pPosition = aClientIter.GetRighOfPos(); - while(aClientIter.m_pPosition && !aClientIter.m_pPosition->IsA( TYPE(TElementType) ) ) - aClientIter.m_pPosition = aClientIter.GetRighOfPos(); - return PTR_CAST(TElementType,aClientIter.m_pCurrent = aClientIter.m_pPosition); - } - TElementType* Previous() - { - aClientIter.m_pPosition = aClientIter.GetLeftOfPos(); - while(aClientIter.m_pPosition && !aClientIter.m_pPosition->IsA( TYPE(TElementType) ) ) - aClientIter.m_pPosition = aClientIter.GetLeftOfPos(); - return PTR_CAST(TElementType,aClientIter.m_pCurrent = aClientIter.m_pPosition); - } - bool IsChanged() { return aClientIter.IsChanged(); } -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 0428889..0b5af16 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -70,7 +70,7 @@ #include <ndtxt.hxx> #include <dflyobj.hxx> #include <prevwpage.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <boost/bind.hpp> using namespace ::com::sun::star; diff --git a/sw/source/core/attr/cellatr.cxx b/sw/source/core/attr/cellatr.cxx index 79f2a52..4e56fba 100644 --- a/sw/source/core/attr/cellatr.cxx +++ b/sw/source/core/attr/cellatr.cxx @@ -28,7 +28,7 @@ #include <rolbck.hxx> #include <rtl/math.hxx> #include <rtl/ustring.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <swtable.hxx> SwTblBoxNumFormat::SwTblBoxNumFormat( sal_uInt32 nFormat, bool bFlag ) diff --git a/sw/source/core/crsr/annotationmark.cxx b/sw/source/core/crsr/annotationmark.cxx index f6b81a6..d66427f 100644 --- a/sw/source/core/crsr/annotationmark.cxx +++ b/sw/source/core/crsr/annotationmark.cxx @@ -24,7 +24,7 @@ #include <IDocumentFieldsAccess.hxx> #include <IDocumentState.hxx> #include <fldbas.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <fmtfld.hxx> #include <docufld.hxx> #include <IDocumentUndoRedo.hxx> diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 0d05960..bc86353 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -64,7 +64,7 @@ #include <fmturl.hxx> #include "txtfrm.hxx" #include <wrong.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <vcl/window.hxx> #include <docufld.hxx> diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx index abfc556..8cb4308 100644 --- a/sw/source/core/doc/DocumentFieldsManager.cxx +++ b/sw/source/core/doc/DocumentFieldsManager.cxx @@ -33,7 +33,7 @@ #include <cntfrm.hxx> #include <section.hxx> #include <docufld.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <cellatr.hxx> #include <swtable.hxx> #include <frmfmt.hxx> diff --git a/sw/source/core/doc/DocumentStatisticsManager.cxx b/sw/source/core/doc/DocumentStatisticsManager.cxx index fca66719..908abb4 100644 --- a/sw/source/core/doc/DocumentStatisticsManager.cxx +++ b/sw/source/core/doc/DocumentStatisticsManager.cxx @@ -26,7 +26,7 @@ #include <IDocumentLayoutAccess.hxx> #include <view.hxx> #include <ndtxt.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <fmtfld.hxx> #include <rootfrm.hxx> #include <docufld.hxx> diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 6962da3..e6f5d92 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -134,7 +134,7 @@ #include <osl/diagnose.h> #include <osl/interlck.h> #include <vbahelper/vbaaccesshelper.hxx> -#include "switerator.hxx" +#include <calbck.hxx> /* @@@MAINTAINABILITY-HORROR@@@ Probably unwanted dependency on SwDocShell diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index 3dbc5f7..54eeeb1 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -67,7 +67,7 @@ #include <svx/svditer.hxx> #include <vector> -#include <switerator.hxx> +#include <calbck.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::linguistic2; diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index 69e4966..0bfeee4 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -62,7 +62,7 @@ #include <poolfmt.hrc> #include <SwUndoField.hxx> -#include "switerator.hxx" +#include <calbck.hxx> using namespace ::com::sun::star::uno; diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index 428e758..a7a4adf 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -59,7 +59,7 @@ #include <fmtcnct.hxx> #include <dflyobj.hxx> #include <undoflystrattr.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <boost/scoped_ptr.hpp> //UUUU diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx index 71e5e4f..8c01796 100644 --- a/sw/source/core/doc/docglbl.cxx +++ b/sw/source/core/doc/docglbl.cxx @@ -46,7 +46,7 @@ #include <section.hxx> #include <doctxm.hxx> #include <poolfmt.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <boost/scoped_ptr.hpp> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 4e7812a..c2fe437 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -53,7 +53,7 @@ #include <SwStyleNameMapper.hxx> #include <SwNodeNum.hxx> #include <list.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <comphelper/string.hxx> #include <tools/datetimeutils.hxx> diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 69e578b..2cdccf6 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -68,7 +68,7 @@ #include <breakit.hxx> #include <editsh.hxx> #include <scriptinfo.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <ToxTextGenerator.hxx> #include <ToxTabStopTokenHandler.hxx> #include <tools/datetimeutils.hxx> diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx index 4d9d28e..c700cf4 100644 --- a/sw/source/core/doc/fmtcol.cxx +++ b/sw/source/core/doc/fmtcol.cxx @@ -32,7 +32,7 @@ #include <node.hxx> #include <numrule.hxx> #include <paratr.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <svl/intitem.hxx> TYPEINIT1( SwTxtFmtColl, SwFmtColl ); diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx index 1520adb..3b3ba7f 100644 --- a/sw/source/core/doc/htmltbl.cxx +++ b/sw/source/core/doc/htmltbl.cxx @@ -39,7 +39,7 @@ #include "viewopt.hxx" #include "htmltbl.hxx" #include "ndindex.hxx" -#include "switerator.hxx" +#include <calbck.hxx> #include <o3tl/numeric.hxx> #ifdef DBG_UTIL #include "tblrwcl.hxx" diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index ea2dae7..1e3eaac 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -58,7 +58,7 @@ #include <o3tl/numeric.hxx> #include <boost/shared_ptr.hpp> #include <boost/scoped_ptr.hpp> -#include <switerator.hxx> +#include <calbck.hxx> #include <docary.hxx> using namespace com::sun::star; diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 98a854f..0fc4eae 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -91,7 +91,7 @@ #include <algorithm> #include <rootfrm.hxx> #include <fldupde.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <o3tl/numeric.hxx> #include <tools/datetimeutils.hxx> diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index a116ab2..0031e0e 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -48,7 +48,7 @@ #include "docary.hxx" #include "ndindex.hxx" #include "undobj.hxx" -#include "switerator.hxx" +#include <calbck.hxx> #include <UndoTable.hxx> using ::editeng::SvxBorderLine; diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 5118385..31d6f5a 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -64,7 +64,7 @@ #include <IDocumentLinksAdministration.hxx> #include <IDocumentRedlineAccess.hxx> #include <IDocumentLayoutAccess.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include "ndole.hxx" using namespace ::com::sun::star::i18n; diff --git a/sw/source/core/docnode/node2lay.cxx b/sw/source/core/docnode/node2lay.cxx index 832e9e77..0e10b9d 100644 --- a/sw/source/core/docnode/node2lay.cxx +++ b/sw/source/core/docnode/node2lay.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <switerator.hxx> +#include <calbck.hxx> #include <calbck.hxx> #include <node.hxx> #include <ndindex.hxx> diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index 14ef8d4..cd9eaa9 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -61,7 +61,7 @@ #include <fmteiro.hxx> #include <swerror.h> #include <unosection.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <svl/smplhint.hxx> #include <algorithm> #include <ndsect.hxx> diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx index 70204f3..3cb90bc 100644 --- a/sw/source/core/docnode/swbaslnk.cxx +++ b/sw/source/core/docnode/swbaslnk.cxx @@ -50,7 +50,7 @@ #include <tabfrm.hxx> #include <cntfrm.hxx> #include <htmltbl.hxx> -#include <switerator.hxx> +#include <calbck.hxx> using namespace com::sun::star; diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index 040a498..24e2568 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -66,7 +66,7 @@ #include <drawinglayer/primitive2d/transformprimitive2d.hxx> #include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> #include <com/sun/star/text/WritingMode2.hpp> -#include <switerator.hxx> +#include <calbck.hxx> #include <algorithm> #include <txtfly.hxx> diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx index e2b655b..2adece7 100644 --- a/sw/source/core/edit/edfld.cxx +++ b/sw/source/core/edit/edfld.cxx @@ -36,7 +36,7 @@ #include <dbmgr.hxx> #include <swddetbl.hxx> #include <hints.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <fieldhint.hxx> #include <DocumentSettingManager.hxx> #include <IDocumentContentOperations.hxx> diff --git a/sw/source/core/edit/edfldexp.cxx b/sw/source/core/edit/edfldexp.cxx index 1591cd2..ca14b58 100644 --- a/sw/source/core/edit/edfldexp.cxx +++ b/sw/source/core/edit/edfldexp.cxx @@ -31,7 +31,7 @@ #include <fmtfld.hxx> #include <edimp.hxx> #include <flddat.hxx> -#include <switerator.hxx> +#include <calbck.hxx> using namespace com::sun::star; diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 2f8066e..7e9bb47 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -61,7 +61,7 @@ #include <numrule.hxx> #include <SwNodeNum.hxx> #include <unocrsr.hxx> -#include <switerator.hxx> +#include <calbck.hxx> using namespace com::sun::star; diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx index 56060cd..b78deba 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -39,7 +39,7 @@ #include <IDocumentLayoutAccess.hxx> #include <unofldmid.h> #include <unoprnms.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <unomid.h> using namespace ::com::sun::star::uno; diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx index c81dec1..0d2f01a 100644 --- a/sw/source/core/fields/dbfld.cxx +++ b/sw/source/core/fields/dbfld.cxx @@ -38,7 +38,7 @@ #include <expfld.hxx> #include <txtatr.hxx> #include <unofldmid.h> -#include <switerator.hxx> +#include <calbck.hxx> using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star; diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx index 5d2a2b1..d43a2b3 100644 --- a/sw/source/core/fields/ddefld.cxx +++ b/sw/source/core/fields/ddefld.cxx @@ -33,7 +33,7 @@ #include <swddetbl.hxx> #include <unofldmid.h> #include <hints.hxx> -#include <switerator.hxx> +#include <calbck.hxx> using namespace ::com::sun::star; diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 407b4e7..7da9b37 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -95,7 +95,7 @@ #include <editeng/outliner.hxx> #include <editeng/outlobj.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <docary.hxx> #define URL_DECODE INetURLObject::DECODE_UNAMBIGUOUS diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx index a67a951..24ba569 100644 --- a/sw/source/core/fields/expfld.cxx +++ b/sw/source/core/fields/expfld.cxx @@ -56,7 +56,7 @@ #include <SwStyleNameMapper.hxx> #include <unofldmid.h> #include <numrule.hxx> -#include <switerator.hxx> +#include <calbck.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::text; diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index 8333ad8..dc0e6d5 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -46,7 +46,7 @@ #include <comcore.hrc> #include <docary.hxx> #include <authfld.hxx> -#include <switerator.hxx> +#include <calbck.hxx> using namespace ::com::sun::star; using namespace nsSwDocInfoSubType; diff --git a/sw/source/core/fields/fldlst.cxx b/sw/source/core/fields/fldlst.cxx index 6a13449..72d92c1 100644 --- a/sw/source/core/fields/fldlst.cxx +++ b/sw/source/core/fields/fldlst.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "switerator.hxx" +#include <calbck.hxx> #include "editsh.hxx" #include "doc.hxx" #include <IDocumentFieldsAccess.hxx> diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx index 91aab4c..fdce899 100644 --- a/sw/source/core/fields/postithelper.cxx +++ b/sw/source/core/fields/postithelper.cxx @@ -34,7 +34,7 @@ #include <redline.hxx> #include <scriptinfo.hxx> #include <editeng/charhiddenitem.hxx> -#include <switerator.hxx> +#include <calbck.hxx> class Point; diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index 869950b..18bcf2a 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -56,7 +56,7 @@ #include <comcore.hrc> #include <numrule.hxx> #include <SwNodeNum.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <set> #include <map> diff --git a/sw/source/core/fields/tblcalc.cxx b/sw/source/core/fields/tblcalc.cxx index 2f2087f..738152b 100644 --- a/sw/source/core/fields/tblcalc.cxx +++ b/sw/source/core/fields/tblcalc.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <switerator.hxx> +#include <calbck.hxx> #include <cntfrm.hxx> #include <doc.hxx> #include <pam.hxx> diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 0394e84..4697c92 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -81,7 +81,7 @@ #include <sortedobjs.hxx> #include <HandleAnchorNodeChg.hxx> #include <basegfx/polygon/b2dpolygon.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <com/sun/star/embed/EmbedMisc.hpp> #include <com/sun/star/embed/Aspects.hpp> diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index 22851d5..86d36f7 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -46,7 +46,7 @@ #include <mvsave.hxx> #include <sectfrm.hxx> #include <frmtool.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <deque> // see also swtable.cxx diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index c1d3ae6..c9aa0520 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -73,7 +73,7 @@ #include <svx/svdundo.hxx> #include <sortedobjs.hxx> #include <HandleAnchorNodeChg.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <pagedeschint.hxx> #ifndef NDEBUG #include <ndtxt.hxx> diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx index b0823d3..e139895 100644 --- a/sw/source/core/layout/colfrm.cxx +++ b/sw/source/core/layout/colfrm.cxx @@ -27,7 +27,7 @@ #include "bodyfrm.hxx" #include "rootfrm.hxx" #include "sectfrm.hxx" -#include "switerator.hxx" +#include <calbck.hxx> #include "ftnfrm.hxx" #include <IDocumentState.hxx> #include <IDocumentLayoutAccess.hxx> diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index cdc8baf..6552055 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -30,7 +30,7 @@ #include "txtftn.hxx" #include "fmtftn.hxx" #include <txtfrm.hxx> -#include <switerator.hxx> +#include <calbck.hxx> /// Searches the first CntntFrm in BodyText below the page. SwLayoutFrm *SwFtnBossFrm::FindBodyCont() diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 8c3bf1b..f4a67d4 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -52,7 +52,7 @@ #include <sortedobjs.hxx> #include <layouter.hxx> #include <fmtfollowtextflow.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <IDocumentSettingAccess.hxx> #include <IDocumentDrawModelAccess.hxx> diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 6d98fe8..f8c0db0 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -58,7 +58,7 @@ #include "flyfrms.hxx" #include "sectfrm.hxx" #include <vcl/svapp.hxx> -#include "switerator.hxx" +#include <calbck.hxx> #include <IDocumentSettingAccess.hxx> #include <IDocumentLayoutAccess.hxx> #include <textboxhelper.hxx> diff --git a/sw/source/core/layout/flypos.cxx b/sw/source/core/layout/flypos.cxx index 135e5c3..b0ecb28 100644 --- a/sw/source/core/layout/flypos.cxx +++ b/sw/source/core/layout/flypos.cxx @@ -23,7 +23,7 @@ #include "dcontact.hxx" #include "flyfrm.hxx" #include "dflyobj.hxx" -#include "switerator.hxx" +#include <calbck.hxx> bool SwPosFlyFrmCmp::operator()(const SwPosFlyFrmPtr& rA, const SwPosFlyFrmPtr& rB) const { diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index a964d80..37a7dac 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -60,7 +60,7 @@ #include <paratr.hxx> #include <sortedobjs.hxx> #include <objectformatter.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <DocumentSettingManager.hxx> #include <IDocumentTimerAccess.hxx> #include <IDocumentRedlineAccess.hxx> diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 880cc9b..04a55df 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -32,7 +32,7 @@ #include <sectfrm.hxx> #include <objectformatter.hxx> #include "viewopt.hxx" -#include <switerator.hxx> +#include <calbck.hxx> #define ENDNOTE 0x80000000 diff --git a/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx b/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx index d812aa3..60774d7 100644 --- a/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx +++ b/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx @@ -21,7 +21,7 @@ #include <txtfrm.hxx> #include <rowfrm.hxx> #include <pagefrm.hxx> -#include <switerator.hxx> +#include <calbck.hxx> SwMovedFwdFrmsByObjPos::SwMovedFwdFrmsByObjPos() { diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 62de3e7..ac888b8 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -53,7 +53,7 @@ #include "pagedesc.hxx" #include <editeng/frmdiritem.hxx> #include <sortedobjs.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <txtfly.hxx> using namespace ::com::sun::star; diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx index 0d05037..fffe9df 100644 --- a/sw/source/core/layout/pagedesc.cxx +++ b/sw/source/core/layout/pagedesc.cxx @@ -34,7 +34,7 @@ #include <IDocumentLayoutAccess.hxx> #include <IDocumentStylePoolAccess.hxx> #include <poolfmt.hxx> -#include <switerator.hxx> +#include <calbck.hxx> using namespace ::com::sun::star; diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index d2372ac..dfdf6a3 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -27,7 +27,7 @@ #include <svx/framelink.hxx> #include <drawdoc.hxx> #include <tgrditem.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <fmtsrnd.hxx> #include <fmtclds.hxx> #include <comcore.hrc> diff --git a/sw/source/core/layout/softpagebreak.cxx b/sw/source/core/layout/softpagebreak.cxx index 85fb783..96f9190 100644 --- a/sw/source/core/layout/softpagebreak.cxx +++ b/sw/source/core/layout/softpagebreak.cxx @@ -23,7 +23,7 @@ #include "frmfmt.hxx" #include "rowfrm.hxx" #include "tabfrm.hxx" -#include "switerator.hxx" +#include <calbck.hxx> void SwTxtNode::fillSoftPageBreakList( SwSoftPageBreakList& rBreak ) const { diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 2a6e97a..e5b89cb 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -52,7 +52,7 @@ #include <sortedobjs.hxx> #include <objectformatter.hxx> #include <layouter.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <DocumentSettingManager.hxx> #include <docary.hxx> diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx index 8a10f5d..dbb1d00 100644 --- a/sw/source/core/table/swnewtable.cxx +++ b/sw/source/core/table/swnewtable.cxx @@ -40,7 +40,7 @@ #include <editeng/boxitem.hxx> #include <editeng/protitem.hxx> #include <swtblfmt.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #ifdef DBG_UTIL #define CHECK_TABLE(t) (t).CheckConsistency(); diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index d082e47..100745d 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -58,7 +58,7 @@ #include <viewsh.hxx> #include <redline.hxx> #include <list> -#include <switerator.hxx> +#include <calbck.hxx> #ifdef DBG_UTIL #define CHECK_TABLE(t) (t).CheckConsistency(); diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 6e169d4..0544510 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -72,7 +72,7 @@ #include <IMark.hxx> #include <printdata.hxx> #include <SwNodeNum.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <stack> #include <tools/globname.hxx> diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index cfa3dcb..b16996f 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -54,7 +54,7 @@ #include <com/sun/star/i18n/WordType.hpp> #include <com/sun/star/i18n/ScriptType.hpp> #include <editeng/lrspitem.hxx> -#include <switerator.hxx> +#include <calbck.hxx> using namespace ::com::sun::star::i18n; using namespace ::com::sun::star; diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 4df3cbb..2213428 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -46,7 +46,7 @@ #include <docary.hxx> #include <redline.hxx> #include <section.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <IDocumentRedlineAccess.hxx> #include <IDocumentSettingAccess.hxx> #include <IDocumentContentOperations.hxx> diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx index c684268..ba8a3e3 100644 --- a/sw/source/core/text/txtdrop.cxx +++ b/sw/source/core/text/txtdrop.cxx @@ -36,7 +36,7 @@ #include <editeng/langitem.hxx> #include <charatr.hxx> #include <editeng/fhgtitem.hxx> -#include <switerator.hxx> +#include <calbck.hxx> using namespace ::com::sun::star::i18n; using namespace ::com::sun::star; diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index ddd658b..43947ed 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -74,7 +74,7 @@ #include <swtable.hxx> #include <fldupde.hxx> #include <IGrammarContact.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <ftnidx.hxx> TYPEINIT1( SwTxtFrm, SwCntntFrm ); diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx index 63faef1..66c86db 100644 --- a/sw/source/core/tox/tox.cxx +++ b/sw/source/core/tox/tox.cxx @@ -32,7 +32,7 @@ #include <SwStyleNameMapper.hxx> #include <hints.hxx> #include <functional> -#include <switerator.hxx> +#include <calbck.hxx> #include <boost/optional.hpp> diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx index b5ce09ba..d82afbc 100644 --- a/sw/source/core/txtnode/atrflyin.cxx +++ b/sw/source/core/txtnode/atrflyin.cxx @@ -33,7 +33,7 @@ #include "txtfrm.hxx" #include "flyfrms.hxx" #include <objectformatter.hxx> -#include <switerator.hxx> +#include <calbck.hxx> SwFmtFlyCnt::SwFmtFlyCnt( SwFrmFmt *pFrmFmt ) : SfxPoolItem( RES_TXTATR_FLYCNT ), diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx index a71f11c..5ccaa1f 100644 --- a/sw/source/core/txtnode/atrftn.cxx +++ b/sw/source/core/txtnode/atrftn.cxx @@ -34,7 +34,7 @@ #include <ndindex.hxx> #include <fmtftntx.hxx> #include <section.hxx> -#include <switerator.hxx> +#include <calbck.hxx> namespace { /// Get a sorted list of the used footnote reference numbers. diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index c630288..17b3992 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -83,7 +83,7 @@ #include <svl/intitem.hxx> #include <list.hxx> #include <sortedobjs.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <attrhint.hxx> #include <memory> diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index 1e00de1..837754c 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -57,7 +57,7 @@ #include <redline.hxx> #include <section.hxx> #include <charfmt.hxx> -#include <switerator.hxx> +#include <calbck.hxx> SwUndoFmtAttrHelper::SwUndoFmtAttrHelper( SwFmt& rFmt, bool bSvDrwPt ) : SwClient( &rFmt ) diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 990418e..9bcf55e 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -62,7 +62,7 @@ #include <fmtanchr.hxx> #include <comcore.hrc> #include <unochart.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <memory> #include <vector> diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 4d11509..abff749 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -71,7 +71,7 @@ #include <unorefmark.hxx> #include <unometa.hxx> #include "docsh.hxx" -#include <switerator.hxx> +#include <calbck.hxx> #include <com/sun/star/document/XCodeNameQuery.hpp> #include <com/sun/star/drawing/XDrawPageSupplier.hpp> #include <com/sun/star/form/XFormsSupplier.hpp> diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 375e8c6..d2df9ec 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -65,7 +65,7 @@ #include <com/sun/star/text/TextContentAnchorType.hpp> #include <basegfx/matrix/b2dhommatrixtools.hxx> #include <com/sun/star/drawing/PointSequence.hpp> -#include <switerator.hxx> +#include <calbck.hxx> using namespace ::com::sun::star; diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 75d59a8..92de986 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -93,7 +93,7 @@ #include <editeng/outliner.hxx> #include <docsh.hxx> #include <fmtmeta.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <rtl/strbuf.hxx> #include <vector> diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 39e74f2..6a3ffd1 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -116,7 +116,7 @@ #include <fmtfollowtextflow.hxx> #include <fmtwrapinfluenceonobjpos.hxx> #include <toolkit/helper/vclunohelper.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 4980ed0..58a7101 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -110,7 +110,7 @@ #include <algorithm> #include <iterator> #include <boost/bind.hpp> -#include <switerator.hxx> +#include <calbck.hxx> #include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index 964d1f49..80c1abd 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -54,7 +54,7 @@ #include <unocoll.hxx> #include <redline.hxx> #include <crsskip.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <docufld.hxx> #include <osl/mutex.hxx> #include <txtfld.hxx> diff --git a/sw/source/core/unocore/unoredlines.cxx b/sw/source/core/unocore/unoredlines.cxx index 94891fb..4d15d2c 100644 --- a/sw/source/core/unocore/unoredlines.cxx +++ b/sw/source/core/unocore/unoredlines.cxx @@ -32,7 +32,7 @@ #include <IDocumentStylePoolAccess.hxx> #include <docary.hxx> #include <redline.hxx> -#include <switerator.hxx> +#include <calbck.hxx> using namespace ::com::sun::star; diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index ee4d66f..5b74c2f 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -94,7 +94,7 @@ #include <sortopt.hxx> #include <rtl/math.hxx> #include <editeng/frmdiritem.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <comphelper/servicehelper.hxx> #include <comphelper/string.hxx> #include <cppuhelper/supportsservice.hxx> diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx index 37a17c0..5fdaf05 100644 --- a/sw/source/core/view/vnew.cxx +++ b/sw/source/core/view/vnew.cxx @@ -39,7 +39,7 @@ #include <ndgrf.hxx> #include <ndindex.hxx> #include <accessibilityoptions.hxx> -#include <switerator.hxx> +#include <calbck.hxx> void SwViewShell::Init( const SwViewOption *pNewOpt ) { diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 9b4f78c..95b0010 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -317,7 +317,7 @@ void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool } } -#include "switerator.hxx" +#include <calbck.hxx> void MSWordExportBase::GatherChapterFields() { diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index 9849a90..a12e5ae 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -54,7 +54,7 @@ #include <ndole.hxx> #include <docsh.hxx> #include <sfx2/docfile.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <vcl/svapp.hxx> #include <osl/mutex.hxx> #include <toolkit/helper/vclunohelper.hxx> diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx index 49205e8..a8d2b4a 100644 --- a/sw/source/ui/fldui/fldpage.cxx +++ b/sw/source/ui/fldui/fldpage.cxx @@ -37,7 +37,7 @@ #include <cmdid.h> #include <globals.hrc> #include <sfx2/bindings.hxx> -#include <switerator.hxx> +#include <calbck.hxx> using namespace ::com::sun::star; diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx index 12b4aeb..84c4285 100644 --- a/sw/source/uibase/app/docsh.cxx +++ b/sw/source/uibase/app/docsh.cxx @@ -119,7 +119,7 @@ #include <unotextrange.hxx> #include <sfx2/Metadatable.hxx> -#include <switerator.hxx> +#include <calbck.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 27c2f33..51f8952 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -122,7 +122,7 @@ #include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <swserv.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <vcl/GraphicNativeTransform.hxx> #include <vcl/GraphicNativeMetadata.hxx> diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index fa8f58d..8583401 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -78,7 +78,7 @@ #include "annotsh.hxx" #include "swabstdlg.hxx" #include "swevent.hxx" -#include "switerator.hxx" +#include <calbck.hxx> #include <boost/scoped_ptr.hpp> // distance between Anchor Y and initial note position diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index 8493175..31bbd37 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -69,7 +69,7 @@ #include <app.hrc> #include <edtwin.hxx> #include <PostItMgr.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include <boost/scoped_ptr.hpp> using namespace nsSwDocInfoSubType; diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx index 37b835c..fff7af2 100644 --- a/sw/source/uibase/uno/unotxvw.cxx +++ b/sw/source/uibase/uno/unotxvw.cxx @@ -69,7 +69,7 @@ #include <unocrsrhelper.hxx> #include <unotextrange.hxx> #include <sfx2/docfile.hxx> -#include <switerator.hxx> +#include <calbck.hxx> #include "swdtflvr.hxx" #include <vcl/svapp.hxx> #include <comphelper/processfactory.hxx> commit ce3661d36e08c6cf04abcf258f66a869abc4cdee Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Wed Mar 18 13:42:10 2015 +0100 static checks ftw Change-Id: I73a231a091a84f7c27e3d7e0e32f6042c7ac0df6 diff --git a/sw/inc/switerator.hxx b/sw/inc/switerator.hxx index 4cb3954..8221642 100644 --- a/sw/inc/switerator.hxx +++ b/sw/inc/switerator.hxx @@ -19,15 +19,18 @@ #ifndef INCLUDED_SW_INC_SWITERATOR_HXX #define INCLUDED_SW_INC_SWITERATOR_HXX +#include <type_traits> #include <calbck.hxx> #include <sal/log.hxx> template< class TElementType, class TSource > class SwIterator SAL_FINAL { + + static_assert(std::is_base_of<SwClient,TElementType>::value, "TElementType needs to be derived from SwClient"); SwClientIter aClientIter; public: - SwIterator( const TSource& rSrc ) : aClientIter(rSrc) { assert(TElementType::IsOf( TYPE(SwClient) )); } + SwIterator( const TSource& rSrc ) : aClientIter(rSrc) {} TElementType* First() { aClientIter.GoStart(); commit de1e121daa30ee2c2770c7ad309c73f96fce92db Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Wed Mar 18 12:24:46 2015 +0100 move GoEnd to SwIterator<> Change-Id: I1c50425743d6f5e55eb45b0902e256e17d81cc9e diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index 4113785..a3bd078 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -265,15 +265,6 @@ class SwClientIter SAL_FINAL : public sw::Ring<SwClientIter> m_pPosition = static_cast<SwClient*>(m_pPosition->m_pLeft); return m_pCurrent = m_pPosition; } - SwClient* GoEnd() - { - if(!m_pPosition) - m_pPosition = const_cast<SwClient*>(m_rRoot.GetDepends()); - if(m_pPosition) - while( m_pPosition->m_pRight ) - m_pPosition = static_cast<SwClient*>(m_pPosition->m_pRight); - return m_pCurrent = m_pPosition; - } static SW_DLLPUBLIC SwClientIter* our_pClientIters; diff --git a/sw/inc/switerator.hxx b/sw/inc/switerator.hxx index 693393e..4cb3954 100644 --- a/sw/inc/switerator.hxx +++ b/sw/inc/switerator.hxx @@ -38,11 +38,14 @@ public: } TElementType* Last() { - aClientIter.GoEnd(); if(!aClientIter.m_pPosition) - return nullptr; + aClientIter.m_pPosition = const_cast<SwClient*>(aClientIter.m_rRoot.GetDepends()); + if(!aClientIter.m_pPosition) + return PTR_CAST(TElementType,aClientIter.m_pCurrent = nullptr); + while(aClientIter.GetRighOfPos()) + aClientIter.m_pPosition = aClientIter.GetRighOfPos(); if(aClientIter.m_pPosition->IsA(TYPE(TElementType))) - return PTR_CAST(TElementType,aClientIter.m_pPosition); + return PTR_CAST(TElementType,aClientIter.m_pCurrent = aClientIter.m_pPosition); return Previous(); } TElementType* Next() _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits