Kaydet (Commit) 6cc4118a authored tarafından Noel Grandin's avatar Noel Grandin

vcl: boost::ptr_vector->std::vector

Change-Id: I21f90c8d4b3d52b7119d664cb7af471b33f27649
üst 6e1c20b9
......@@ -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; }
......
......@@ -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
{
......
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