summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-11 14:20:23 +0200
committerNoel Grandin <noel@peralex.com>2015-11-12 08:01:35 +0200
commit6cc4118a1014acad34f29901eebc1be7a9208112 (patch)
treec8f5241ab3a3aa4ac875dff22339358b9da519ec
parent6e1c20b9949eebdb5e52d076d87157ca7f237f64 (diff)
vcl: boost::ptr_vector->std::vector
Change-Id: I21f90c8d4b3d52b7119d664cb7af471b33f27649
-rw-r--r--vcl/source/edit/textdat2.hxx26
-rw-r--r--vcl/source/edit/texteng.cxx26
2 files changed, 26 insertions, 26 deletions
diff --git a/vcl/source/edit/textdat2.hxx b/vcl/source/edit/textdat2.hxx
index ff36df78431f..7abb7f079aa8 100644
--- a/vcl/source/edit/textdat2.hxx
+++ b/vcl/source/edit/textdat2.hxx
@@ -25,7 +25,7 @@
#include <vcl/cursor.hxx>
#include <vcl/idle.hxx>
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
class TextNode;
class TextView;
@@ -105,9 +105,9 @@ private:
sal_uInt16 mnStartPortion;
sal_uInt16 mnEndPortion;
- short mnStartX;
+ short mnStartX;
- bool mbInvalid; // fuer geschickte Formatierung/Ausgabe
+ bool mbInvalid; // fuer geschickte Formatierung/Ausgabe
public:
TextLine()
@@ -131,12 +131,12 @@ public:
sal_Int32& GetEnd() { return mnEnd; }
void SetStartPortion( sal_uInt16 n ) { mnStartPortion = n; }
- sal_uInt16 GetStartPortion() const { return mnStartPortion; }
- sal_uInt16& GetStartPortion() { return mnStartPortion; }
+ sal_uInt16 GetStartPortion() const { return mnStartPortion; }
+ sal_uInt16& GetStartPortion() { return mnStartPortion; }
void SetEndPortion( sal_uInt16 n ) { mnEndPortion = n; }
- sal_uInt16 GetEndPortion() const { return mnEndPortion; }
- sal_uInt16& GetEndPortion() { return mnEndPortion; }
+ sal_uInt16 GetEndPortion() const { return mnEndPortion; }
+ sal_uInt16& GetEndPortion() { return mnEndPortion; }
sal_Int32 GetLen() const { return mnEnd - mnStart; }
@@ -170,15 +170,15 @@ class TEParaPortion
private:
TextNode* mpNode;
- boost::ptr_vector<TextLine> maLines;
+ std::vector<TextLine> maLines;
TETextPortionList maTextPortions;
std::vector<TEWritingDirectionInfo> maWritingDirectionInfos;
- sal_Int32 mnInvalidPosStart;
- sal_Int32 mnInvalidDiff;
+ sal_Int32 mnInvalidPosStart;
+ sal_Int32 mnInvalidDiff;
- bool mbInvalid;
- bool mbSimple; // only type linearly
+ bool mbInvalid;
+ bool mbSimple; // only type linearly
TEParaPortion( const TEParaPortion& ) {;}
@@ -198,7 +198,7 @@ public:
sal_Int32 GetInvalidDiff() const { return mnInvalidDiff; }
TextNode* GetNode() const { return mpNode; }
- boost::ptr_vector<TextLine>& GetLines() { return maLines; }
+ std::vector<TextLine>& GetLines() { return maLines; }
TETextPortionList& GetTextPortions() { return maTextPortions; }
std::vector<TEWritingDirectionInfo>& GetWritingDirectionInfos() { return maWritingDirectionInfos; }
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index 5eeded23a498..58e0bc9581ef 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -1620,17 +1620,16 @@ void TextEngine::CreateAndInsertEmptyLine( sal_uInt32 nPara )
TextNode* pNode = mpDoc->GetNodes()[ nPara ];
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
- TextLine* pTmpLine = new TextLine;
- pTmpLine->SetStart( pNode->GetText().getLength() );
- pTmpLine->SetEnd( pTmpLine->GetStart() );
- pTEParaPortion->GetLines().push_back( pTmpLine );
+ TextLine aTmpLine;
+ aTmpLine.SetStart( pNode->GetText().getLength() );
+ aTmpLine.SetEnd( aTmpLine.GetStart() );
if ( ImpGetAlign() == TXTALIGN_CENTER )
- pTmpLine->SetStartX( (short)(mnMaxTextWidth / 2) );
+ aTmpLine.SetStartX( (short)(mnMaxTextWidth / 2) );
else if ( ImpGetAlign() == TXTALIGN_RIGHT )
- pTmpLine->SetStartX( (short)mnMaxTextWidth );
+ aTmpLine.SetStartX( (short)mnMaxTextWidth );
else
- pTmpLine->SetStartX( mpDoc->GetLeftMargin() );
+ aTmpLine.SetStartX( mpDoc->GetLeftMargin() );
bool bLineBreak = !pNode->GetText().isEmpty();
@@ -1642,9 +1641,10 @@ void TextEngine::CreateAndInsertEmptyLine( sal_uInt32 nPara )
{
// -2: The new one is already inserted.
sal_uInt16 nPos = (sal_uInt16) pTEParaPortion->GetTextPortions().size() - 1 ;
- pTmpLine->SetStartPortion( nPos );
- pTmpLine->SetEndPortion( nPos );
+ aTmpLine.SetStartPortion( nPos );
+ aTmpLine.SetEndPortion( nPos );
}
+ pTEParaPortion->GetLines().push_back( aTmpLine );
}
void TextEngine::ImpBreakLine( sal_uInt32 nPara, TextLine* pLine, TETextPortion*, sal_Int32 nPortionStart, long nRemainingWidth )
@@ -2142,8 +2142,7 @@ bool TextEngine::CreateLines( sal_uInt32 nPara )
// initialization
if ( pTEParaPortion->GetLines().empty() )
{
- TextLine* pL = new TextLine;
- pTEParaPortion->GetLines().push_back( pL );
+ pTEParaPortion->GetLines().push_back( TextLine() );
}
const sal_Int32 nInvalidDiff = pTEParaPortion->GetInvalidDiff();
@@ -2394,8 +2393,9 @@ bool TextEngine::CreateLines( sal_uInt32 nPara )
{
if ( nIndex < pNode->GetText().getLength() )
{
- pLine = new TextLine;
- pTEParaPortion->GetLines().insert( pTEParaPortion->GetLines().begin() + ++nLine, pLine );
+ ++nLine;
+ pTEParaPortion->GetLines().insert( pTEParaPortion->GetLines().begin() + nLine, TextLine() );
+ pLine = &pTEParaPortion->GetLines()[nLine];
}
else
{