Kaydet (Commit) 39f5e66e authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Stahl

Convert SV_DECL_PTRARR_DEL(SwRubyList) to boost::ptr_vector

Change-Id: Ib983bf7517a35392c0468cb763de67d5b45f4673
üst f2e52807
......@@ -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
......
......@@ -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 );
......
......@@ -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 );
......
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