Kaydet (Commit) 85d26ef9 authored tarafından Noel Grandin's avatar Noel Grandin

sd: boost::ptr_vector->std::vector<std::unique_ptr>

Change-Id: Ib22556bc6af1700e62d1710ac32068c541c72f86
üst 1c0371a5
...@@ -796,9 +796,9 @@ void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj ) ...@@ -796,9 +796,9 @@ void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj )
for ( sal_uInt32 i = 0; i < rTextObj.ParagraphCount(); ++i ) for ( sal_uInt32 i = 0; i < rTextObj.ParagraphCount(); ++i )
{ {
ParagraphObj* pPara = rTextObj.GetParagraph(i); ParagraphObj* pPara = rTextObj.GetParagraph(i);
for ( boost::ptr_vector<PortionObj>::const_iterator it = pPara->begin(); it != pPara->end(); ++it ) for ( std::vector<std::unique_ptr<PortionObj> >::const_iterator it = pPara->begin(); it != pPara->end(); ++it )
{ {
const PortionObj& rPortion = *it; const PortionObj& rPortion = *(*it).get();
nPropertyFlags = 0; nPropertyFlags = 0;
sal_uInt32 nCharAttr = rPortion.mnCharAttr; sal_uInt32 nCharAttr = rPortion.mnCharAttr;
sal_uInt32 nCharColor = rPortion.mnCharColor; sal_uInt32 nCharColor = rPortion.mnCharColor;
...@@ -1094,9 +1094,9 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u ...@@ -1094,9 +1094,9 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u
for ( sal_uInt32 i = 0; i < aTextObj.ParagraphCount(); ++i ) for ( sal_uInt32 i = 0; i < aTextObj.ParagraphCount(); ++i )
{ {
pPara = aTextObj.GetParagraph(i); pPara = aTextObj.GetParagraph(i);
for ( boost::ptr_vector<PortionObj>::const_iterator it = pPara->begin(); it != pPara->end(); ++it ) for ( std::vector<std::unique_ptr<PortionObj> >::const_iterator it = pPara->begin(); it != pPara->end(); ++it )
{ {
const PortionObj& rPortion = *it; const PortionObj& rPortion = *(*it).get();
if ( rPortion.mpFieldEntry ) if ( rPortion.mpFieldEntry )
{ {
const FieldEntry* pFieldEntry = rPortion.mpFieldEntry; const FieldEntry* pFieldEntry = rPortion.mpFieldEntry;
...@@ -3864,9 +3864,9 @@ void TextObjBinary::WriteTextSpecInfo( SvStream* pStrm ) ...@@ -3864,9 +3864,9 @@ void TextObjBinary::WriteTextSpecInfo( SvStream* pStrm )
for ( sal_uInt32 i = 0; nCharactersLeft && i < ParagraphCount(); ++i ) for ( sal_uInt32 i = 0; nCharactersLeft && i < ParagraphCount(); ++i )
{ {
ParagraphObj* pPtr = GetParagraph(i); ParagraphObj* pPtr = GetParagraph(i);
for ( boost::ptr_vector<PortionObj>::const_iterator it = pPtr->begin(); nCharactersLeft && it != pPtr->end(); ++it ) for ( std::vector<std::unique_ptr<PortionObj> >::const_iterator it = pPtr->begin(); nCharactersLeft && it != pPtr->end(); ++it )
{ {
const PortionObj& rPortion = *it; const PortionObj& rPortion = *(*it).get();
sal_Int32 nPortionSize = rPortion.mnTextSize >= nCharactersLeft ? nCharactersLeft : rPortion.mnTextSize; sal_Int32 nPortionSize = rPortion.mnTextSize >= nCharactersLeft ? nCharactersLeft : rPortion.mnTextSize;
sal_Int32 nFlags = 7; sal_Int32 nFlags = 7;
nCharactersLeft -= nPortionSize; nCharactersLeft -= nPortionSize;
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include <vcl/metric.hxx> #include <vcl/metric.hxx>
#include <vcl/outdev.hxx> #include <vcl/outdev.hxx>
#include <vcl/virdev.hxx> #include <vcl/virdev.hxx>
#include <o3tl/make_unique.hxx>
css::uno::Reference< css::i18n::XBreakIterator > xPPTBreakIter; css::uno::Reference< css::i18n::XBreakIterator > xPPTBreakIter;
...@@ -725,7 +726,7 @@ ParagraphObj::ParagraphObj(css::uno::Reference< css::text::XTextContent > & rXTe ...@@ -725,7 +726,7 @@ ParagraphObj::ParagraphObj(css::uno::Reference< css::text::XTextContent > & rXTe
{ {
PortionObj* pPortionObj = new PortionObj( aXCursorText, !aXTextPortionE->hasMoreElements(), rFontCollection ); PortionObj* pPortionObj = new PortionObj( aXCursorText, !aXTextPortionE->hasMoreElements(), rFontCollection );
if ( pPortionObj->Count() ) if ( pPortionObj->Count() )
mvPortions.push_back( pPortionObj ); mvPortions.push_back( std::unique_ptr<PortionObj>(pPortionObj) );
else else
delete pPortionObj; delete pPortionObj;
} }
...@@ -751,8 +752,8 @@ ParagraphObj::~ParagraphObj() ...@@ -751,8 +752,8 @@ ParagraphObj::~ParagraphObj()
void ParagraphObj::Write( SvStream* pStrm ) void ParagraphObj::Write( SvStream* pStrm )
{ {
for ( boost::ptr_vector<PortionObj>::iterator it = mvPortions.begin(); it != mvPortions.end(); ++it ) for ( std::vector<std::unique_ptr<PortionObj> >::iterator it = mvPortions.begin(); it != mvPortions.end(); ++it )
it->Write( pStrm, mbLastParagraph ); (*it)->Write( pStrm, mbLastParagraph );
} }
void ParagraphObj::ImplClear() void ParagraphObj::ImplClear()
...@@ -916,7 +917,7 @@ void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider* pBuProv, sal_Int1 ...@@ -916,7 +917,7 @@ void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider* pBuProv, sal_Int1
} }
} }
CalculateGraphicBulletSize( ( mvPortions.empty() ) ? 24 : mvPortions.front().mnCharHeight ); CalculateGraphicBulletSize( ( mvPortions.empty() ) ? 24 : mvPortions.front()->mnCharHeight );
switch( nNumberingType ) switch( nNumberingType )
{ {
...@@ -1228,8 +1229,8 @@ void ParagraphObj::ImplConstruct( const ParagraphObj& rParagraphObj ) ...@@ -1228,8 +1229,8 @@ void ParagraphObj::ImplConstruct( const ParagraphObj& rParagraphObj )
mbForbiddenRules = rParagraphObj.mbForbiddenRules; mbForbiddenRules = rParagraphObj.mbForbiddenRules;
mnBiDi = rParagraphObj.mnBiDi; mnBiDi = rParagraphObj.mnBiDi;
for ( boost::ptr_vector<PortionObj>::const_iterator it = rParagraphObj.begin(); it != rParagraphObj.end(); ++it ) for ( std::vector<std::unique_ptr<PortionObj> >::const_iterator it = rParagraphObj.begin(); it != rParagraphObj.end(); ++it )
mvPortions.push_back( new PortionObj( *it ) ); mvPortions.push_back( o3tl::make_unique<PortionObj>( **it ) );
maTabStop = rParagraphObj.maTabStop; maTabStop = rParagraphObj.maTabStop;
bExtendedParameters = rParagraphObj.bExtendedParameters; bExtendedParameters = rParagraphObj.bExtendedParameters;
...@@ -1257,8 +1258,8 @@ void ParagraphObj::ImplConstruct( const ParagraphObj& rParagraphObj ) ...@@ -1257,8 +1258,8 @@ void ParagraphObj::ImplConstruct( const ParagraphObj& rParagraphObj )
sal_uInt32 ParagraphObj::ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition ) sal_uInt32 ParagraphObj::ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition )
{ {
mnTextSize = 0; mnTextSize = 0;
for ( boost::ptr_vector<PortionObj>::iterator it = mvPortions.begin(); it != mvPortions.end(); ++it ) for ( std::vector<std::unique_ptr<PortionObj> >::iterator it = mvPortions.begin(); it != mvPortions.end(); ++it )
mnTextSize += it->ImplCalculateTextPositions( nCurrentTextPosition + mnTextSize ); mnTextSize += (*it)->ImplCalculateTextPositions( nCurrentTextPosition + mnTextSize );
return mnTextSize; return mnTextSize;
} }
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <com/sun/star/awt/FontDescriptor.hpp> #include <com/sun/star/awt/FontDescriptor.hpp>
#include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/lang/Locale.hpp>
#include <editeng/svxenum.hxx> #include <editeng/svxenum.hxx>
#include <boost/ptr_container/ptr_vector.hpp> #include <vector>
#include <memory> #include <memory>
namespace com { namespace sun { namespace star { namespace com { namespace sun { namespace star {
...@@ -177,7 +177,7 @@ class ParagraphObj : public PropStateValue, public SOParagraph ...@@ -177,7 +177,7 @@ class ParagraphObj : public PropStateValue, public SOParagraph
friend class TextObj; friend class TextObj;
friend struct PPTExParaSheet; friend struct PPTExParaSheet;
boost::ptr_vector<PortionObj> mvPortions; std::vector<std::unique_ptr<PortionObj> > mvPortions;
MapMode maMapModeSrc; MapMode maMapModeSrc;
MapMode maMapModeDest; MapMode maMapModeDest;
...@@ -226,10 +226,10 @@ class ParagraphObj : public PropStateValue, public SOParagraph ...@@ -226,10 +226,10 @@ class ParagraphObj : public PropStateValue, public SOParagraph
bool empty() const { return mvPortions.empty(); } bool empty() const { return mvPortions.empty(); }
const PortionObj& front() const { return mvPortions.front(); } const PortionObj& front() const { return *mvPortions.front().get(); }
boost::ptr_vector<PortionObj>::const_iterator begin() const { return mvPortions.begin(); } std::vector<std::unique_ptr<PortionObj> >::const_iterator begin() const { return mvPortions.begin(); }
boost::ptr_vector<PortionObj>::const_iterator end() const { return mvPortions.end(); } std::vector<std::unique_ptr<PortionObj> >::const_iterator end() const { return mvPortions.end(); }
void CalculateGraphicBulletSize( sal_uInt16 nFontHeight ); void CalculateGraphicBulletSize( sal_uInt16 nFontHeight );
~ParagraphObj(); ~ParagraphObj();
......
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