diff options
author | Noel Grandin <noel@peralex.com> | 2012-05-16 10:38:38 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-05-25 00:17:04 +0200 |
commit | 39f5e66eadc66272fca566643bcf9577f3b6e9fe (patch) | |
tree | b7c281acde89bc6fb30f434df9dcbba783f3960b /sw | |
parent | f2e528072ef2bfec30795b1ba05905b39f5dc893 (diff) |
Convert SV_DECL_PTRARR_DEL(SwRubyList) to boost::ptr_vector
Change-Id: Ib983bf7517a35392c0468cb763de67d5b45f4673
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/rubylist.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/docruby.cxx | 18 | ||||
-rw-r--r-- | sw/source/ui/uno/unotxvw.cxx | 6 |
3 files changed, 13 insertions, 15 deletions
diff --git a/sw/inc/rubylist.hxx b/sw/inc/rubylist.hxx index 414d57c8e80d..793a43916afc 100644 --- a/sw/inc/rubylist.hxx +++ b/sw/inc/rubylist.hxx @@ -31,6 +31,7 @@ #include <svl/svarray.hxx> #include <swtypes.hxx> #include <fmtruby.hxx> +#include <boost/ptr_container/ptr_vector.hpp> class SwRubyListEntry { @@ -48,8 +49,7 @@ public: void SetRubyAttr( const SwFmtRuby& rAttr ) { aRubyAttr = rAttr; } }; -typedef SwRubyListEntry* SwRubyListEntryPtr; -SV_DECL_PTRARR_DEL( SwRubyList, SwRubyListEntryPtr, 0 ) +class SwRubyList : public boost::ptr_vector<SwRubyListEntry> {}; #endif //_RUBYLIST_HXX diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx index baea7a78ee6d..924a01fca145 100644 --- a/sw/source/core/doc/docruby.cxx +++ b/sw/source/core/doc/docruby.cxx @@ -47,8 +47,6 @@ #include <breakit.hxx> #include <crsskip.hxx> -SV_IMPL_PTRARR( SwRubyList, SwRubyListEntryPtr ) - using namespace ::com::sun::star::i18n; @@ -82,7 +80,7 @@ sal_uInt16 SwDoc::FillRubyList( const SwPaM& rPam, SwRubyList& rList, } if( _SelectNextRubyChars( aPam, *pNew, nMode )) { - rList.Insert( pNew, rList.Count() ); + rList.push_back( pNew ); aPam.DeleteMark(); } else @@ -97,12 +95,12 @@ sal_uInt16 SwDoc::FillRubyList( const SwPaM& rPam, SwRubyList& rList, else break; } - } while( 30 > rList.Count() && *aPam.GetPoint() < *pEnd ); + } while( 30 > rList.size() && *aPam.GetPoint() < *pEnd ); } - } while( 30 > rList.Count() && + } while( 30 > rList.size() && (_pStartCrsr=(SwPaM *)_pStartCrsr->GetNext()) != __pStartCrsr ); - return rList.Count(); + return rList.size(); } sal_uInt16 SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList, @@ -135,7 +133,7 @@ sal_uInt16 SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList, } if( _SelectNextRubyChars( aPam, aCheckEntry, nMode )) { - const SwRubyListEntry* pEntry = rList[ nListEntry++ ]; + const SwRubyListEntry* pEntry = &rList[ nListEntry++ ]; if( aCheckEntry.GetRubyAttr() != pEntry->GetRubyAttr() ) { // set/reset the attribut @@ -167,7 +165,7 @@ sal_uInt16 SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList, } else { - const SwRubyListEntry* pEntry = rList[ nListEntry++ ]; + const SwRubyListEntry* pEntry = &rList[ nListEntry++ ]; // set/reset the attribut if( pEntry->GetRubyAttr().GetText().Len() && @@ -184,9 +182,9 @@ sal_uInt16 SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList, aPam.DeleteMark(); } } - } while( nListEntry < rList.Count() && *aPam.GetPoint() < *pEnd ); + } while( nListEntry < rList.size() && *aPam.GetPoint() < *pEnd ); } - } while( 30 > rList.Count() && + } while( 30 > rList.size() && (_pStartCrsr=(SwPaM *)_pStartCrsr->GetNext()) != __pStartCrsr ); GetIDocumentUndoRedo().EndUndo( UNDO_SETRUBYATTR, NULL ); diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index fb080296bb45..da2da34bcf72 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -720,7 +720,7 @@ Sequence< Sequence< PropertyValue > > SwXTextView::getRubyList( sal_Bool /*bAuto String aString; for(sal_uInt16 n = 0; n < nCount; n++) { - const SwRubyListEntryPtr pEntry = aList[n]; + const SwRubyListEntry* pEntry = &aList[n]; const String& rEntryText = pEntry->GetText(); const SwFmtRuby& rAttr = pEntry->GetRubyAttr(); @@ -764,7 +764,7 @@ void SAL_CALL SwXTextView::setRubyList( const Sequence<PropertyValue>* pRubyList = rRubyList.getConstArray(); for(sal_Int32 nPos = 0; nPos < rRubyList.getLength(); nPos++) { - SwRubyListEntryPtr pEntry = new SwRubyListEntry; + SwRubyListEntry* pEntry = new SwRubyListEntry; const PropertyValue* pProperties = pRubyList[nPos].getConstArray(); OUString sTmp; for(sal_Int32 nProp = 0; nProp < pRubyList[nPos].getLength(); nProp++) @@ -810,7 +810,7 @@ void SAL_CALL SwXTextView::setRubyList( pEntry->GetRubyAttr().SetPosition(bValue ? 0 : 1); } } - aList.Insert(pEntry, (sal_uInt16)nPos); + aList.insert(aList.begin() + nPos, pEntry); } SwDoc* pDoc = m_pView->GetDocShell()->GetDoc(); pDoc->SetRubyList( *rSh.GetCrsr(), aList, 0 ); |