diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2012-06-02 14:11:21 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-06-08 22:52:31 +0200 |
commit | 52c8cec6daeb24a95e09e6435304cfbdc9fb0dac (patch) | |
tree | c36caf8f252ceee4903753f1bab5951f6c02fb30 /svtools/source | |
parent | 341e6fba343bd90a8d2572b23a4c0b03141ef7f6 (diff) |
Convert SV_DECL_PTRARR_DEL(TextLines) to std::vector
Change-Id: I31d228d4f4a1165e38d95c16a8f6309cae410c70
Diffstat (limited to 'svtools/source')
-rw-r--r-- | svtools/source/edit/textdat2.hxx | 3 | ||||
-rw-r--r-- | svtools/source/edit/textdata.cxx | 10 | ||||
-rw-r--r-- | svtools/source/edit/texteng.cxx | 85 | ||||
-rw-r--r-- | svtools/source/edit/textview.cxx | 22 |
4 files changed, 63 insertions, 57 deletions
diff --git a/svtools/source/edit/textdat2.hxx b/svtools/source/edit/textdat2.hxx index c34f5ec42ab3..cdbff9059685 100644 --- a/svtools/source/edit/textdat2.hxx +++ b/svtools/source/edit/textdat2.hxx @@ -177,8 +177,7 @@ public: inline sal_Bool operator != ( const TextLine& rLine ) const; }; -typedef TextLine* TextLinePtr; - SV_DECL_PTRARR_DEL( TextLines, TextLinePtr, 1 ) +typedef std::vector<TextLine*> TextLines; inline sal_Bool TextLine::operator == ( const TextLine& rLine ) const { diff --git a/svtools/source/edit/textdata.cxx b/svtools/source/edit/textdata.cxx index 6d61ee1232eb..a5f9aa1afe4a 100644 --- a/svtools/source/edit/textdata.cxx +++ b/svtools/source/edit/textdata.cxx @@ -32,8 +32,6 @@ #include <tools/debug.hxx> -SV_IMPL_PTRARR( TextLines, TextLinePtr ); - // ------------------------------------------------------------------------- // (+) class TextSelection @@ -186,9 +184,9 @@ void TEParaPortion::MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 /*nEnd*/ sal_uInt16 TEParaPortion::GetLineNumber( sal_uInt16 nChar, sal_Bool bInclEnd ) { - for ( sal_uInt16 nLine = 0; nLine < maLines.Count(); nLine++ ) + for ( sal_uInt16 nLine = 0; nLine < maLines.size(); nLine++ ) { - TextLine* pLine = maLines.GetObject( nLine ); + TextLine* pLine = maLines[ nLine ]; if ( ( bInclEnd && ( pLine->GetEnd() >= nChar ) ) || ( pLine->GetEnd() > nChar ) ) { @@ -199,13 +197,13 @@ sal_uInt16 TEParaPortion::GetLineNumber( sal_uInt16 nChar, sal_Bool bInclEnd ) // Dann sollte es am Ende der letzten Zeile sein! DBG_ASSERT( nChar == maLines[ maLines.Count() - 1 ]->GetEnd(), "Index voll daneben!" ); DBG_ASSERT( !bInclEnd, "Zeile nicht gefunden: FindLine" ); - return ( maLines.Count() - 1 ); + return ( maLines.size() - 1 ); } void TEParaPortion::CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormattedLine ) { - sal_uInt16 nLines = maLines.Count(); + sal_uInt16 nLines = maLines.size(); DBG_ASSERT( nLines, "CorrectPortionNumbersFromLine: Leere Portion?" ); if ( nLastFormattedLine < ( nLines - 1 ) ) { diff --git a/svtools/source/edit/texteng.cxx b/svtools/source/edit/texteng.cxx index 9fc4de968f96..1a8d64b43238 100644 --- a/svtools/source/edit/texteng.cxx +++ b/svtools/source/edit/texteng.cxx @@ -65,6 +65,7 @@ #include <set> #include <vector> +#include <boost/foreach.hpp> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -283,7 +284,7 @@ String TextEngine::GetTextLines( LineEnd aSeparator ) const { TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nP ); - sal_uInt16 nLines = pTEParaPortion->GetLines().Count(); + sal_uInt16 nLines = pTEParaPortion->GetLines().size(); for ( sal_uInt16 nL = 0; nL < nLines; nL++ ) { TextLine* pLine = pTEParaPortion->GetLines()[nL]; @@ -903,7 +904,7 @@ Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, sal_Bool bSpecial ) for ( sal_uLong nPortion = 0; nPortion < rPaM.GetPara(); nPortion++ ) { TEParaPortion* pPortion = mpTEParaPortions->GetObject(nPortion); - nY += pPortion->GetLines().Count() * mnCharHeight; + nY += pPortion->GetLines().size() * mnCharHeight; } } @@ -936,9 +937,9 @@ Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, sal_Bool bSpecial, sal long nY = 0; sal_uInt16 nCurIndex = 0; TextLine* pLine = 0; - for ( sal_uInt16 nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ ) + for ( sal_uInt16 nLine = 0; nLine < pPortion->GetLines().size(); nLine++ ) { - TextLine* pTmpLine = pPortion->GetLines().GetObject( nLine ); + TextLine* pTmpLine = pPortion->GetLines()[ nLine ]; if ( ( pTmpLine->GetStart() == rPaM.GetIndex() ) || ( pTmpLine->IsIn( rPaM.GetIndex(), bSpecial ) ) ) { pLine = pTmpLine; @@ -953,7 +954,7 @@ Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, sal_Bool bSpecial, sal // Cursor am Ende des Absatzes. DBG_ASSERT( rPaM.GetIndex() == nCurIndex, "Index voll daneben in GetEditCursor!" ); - pLine = pPortion->GetLines().GetObject( pPortion->GetLines().Count()-1 ); + pLine = pPortion->GetLines().back(); nY -= mnCharHeight; nCurIndex = nCurIndex - pLine->GetLen(); } @@ -1088,7 +1089,7 @@ TextPaM TextEngine::GetPaM( const Point& rDocPos, sal_Bool bSmart ) for ( sal_uLong nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ ) { TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion ); - long nTmpHeight = pPortion->GetLines().Count() * mnCharHeight; + long nTmpHeight = pPortion->GetLines().size() * mnCharHeight; nY += nTmpHeight; if ( nY > rDocPos.Y() ) { @@ -1118,9 +1119,9 @@ sal_uInt16 TextEngine::ImpFindIndex( sal_uLong nPortion, const Point& rPosInPara long nY = 0; TextLine* pLine = 0; sal_uInt16 nLine; - for ( nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ ) + for ( nLine = 0; nLine < pPortion->GetLines().size(); nLine++ ) { - TextLine* pTmpLine = pPortion->GetLines().GetObject( nLine ); + TextLine* pTmpLine = pPortion->GetLines()[ nLine ]; nY += mnCharHeight; if ( nY > rPosInPara.Y() ) // das war 'se { @@ -1133,7 +1134,7 @@ sal_uInt16 TextEngine::ImpFindIndex( sal_uLong nPortion, const Point& rPosInPara nCurIndex = GetCharPos( nPortion, nLine, rPosInPara.X(), bSmart ); if ( nCurIndex && ( nCurIndex == pLine->GetEnd() ) && - ( pLine != pPortion->GetLines().GetObject( pPortion->GetLines().Count()-1) ) ) + ( pLine != pPortion->GetLines().back() ) ) { uno::Reference < i18n::XBreakIterator > xBI = GetBreakIterator(); sal_Int32 nCount = 1; @@ -1146,7 +1147,7 @@ sal_uInt16 TextEngine::GetCharPos( sal_uLong nPortion, sal_uInt16 nLine, long nX { TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion ); - TextLine* pLine = pPortion->GetLines().GetObject( nLine ); + TextLine* pLine = pPortion->GetLines()[ nLine ]; sal_uInt16 nCurIndex = pLine->GetStart(); @@ -1206,10 +1207,10 @@ sal_uLong TextEngine::CalcTextWidth( sal_uLong nPara ) { sal_uLong nParaWidth = 0; TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara ); - for ( sal_uInt16 nLine = pPortion->GetLines().Count(); nLine; ) + for ( sal_uInt16 nLine = pPortion->GetLines().size(); nLine; ) { sal_uLong nLineWidth = 0; - TextLine* pLine = pPortion->GetLines().GetObject( --nLine ); + TextLine* pLine = pPortion->GetLines()[ --nLine ]; for ( sal_uInt16 nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ ) { TETextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( nTP ); @@ -1286,7 +1287,7 @@ sal_uInt16 TextEngine::GetLineCount( sal_uLong nParagraph ) const TEParaPortion* pPPortion = mpTEParaPortions->GetObject( nParagraph ); if ( pPPortion ) - return pPPortion->GetLines().Count(); + return pPPortion->GetLines().size(); return 0xFFFF; } @@ -1296,9 +1297,9 @@ sal_uInt16 TextEngine::GetLineLen( sal_uLong nParagraph, sal_uInt16 nLine ) cons DBG_ASSERT( nParagraph < mpTEParaPortions->Count(), "GetLineCount: Out of range" ); TEParaPortion* pPPortion = mpTEParaPortions->GetObject( nParagraph ); - if ( pPPortion && ( nLine < pPPortion->GetLines().Count() ) ) + if ( pPPortion && ( nLine < pPPortion->GetLines().size() ) ) { - TextLine* pLine = pPPortion->GetLines().GetObject( nLine ); + TextLine* pLine = pPPortion->GetLines()[ nLine ]; return pLine->GetLen(); } @@ -1312,7 +1313,7 @@ sal_uLong TextEngine::CalcParaHeight( sal_uLong nParagraph ) const TEParaPortion* pPPortion = mpTEParaPortions->GetObject( nParagraph ); DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetParaHeight" ); if ( pPPortion ) - nHeight = pPPortion->GetLines().Count() * mnCharHeight; + nHeight = pPPortion->GetLines().size() * mnCharHeight; return nHeight; } @@ -1324,12 +1325,12 @@ void TextEngine::UpdateSelections() Range TextEngine::GetInvalidYOffsets( sal_uLong nPortion ) { TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPortion ); - sal_uInt16 nLines = pTEParaPortion->GetLines().Count(); + sal_uInt16 nLines = pTEParaPortion->GetLines().size(); sal_uInt16 nLastInvalid, nFirstInvalid = 0; sal_uInt16 nLine; for ( nLine = 0; nLine < nLines; nLine++ ) { - TextLine* pL = pTEParaPortion->GetLines().GetObject( nLine ); + TextLine* pL = pTEParaPortion->GetLines()[ nLine ]; if ( pL->IsInvalid() ) { nFirstInvalid = nLine; @@ -1339,7 +1340,7 @@ Range TextEngine::GetInvalidYOffsets( sal_uLong nPortion ) for ( nLastInvalid = nFirstInvalid; nLastInvalid < nLines; nLastInvalid++ ) { - TextLine* pL = pTEParaPortion->GetLines().GetObject( nLine ); + TextLine* pL = pTEParaPortion->GetLines()[ nLine ]; if ( pL->IsValid() ) break; } @@ -1637,7 +1638,7 @@ void TextEngine::FormatDoc() maInvalidRec.Bottom() = nY + CalcParaHeight( nPara ); } nY += CalcParaHeight( nPara ); - if ( !mbHasMultiLineParas && pTEParaPortion->GetLines().Count() > 1 ) + if ( !mbHasMultiLineParas && pTEParaPortion->GetLines().size() > 1 ) mbHasMultiLineParas = sal_True; } @@ -1679,7 +1680,7 @@ void TextEngine::CreateAndInsertEmptyLine( sal_uLong nPara ) TextLine* pTmpLine = new TextLine; pTmpLine->SetStart( pNode->GetText().Len() ); pTmpLine->SetEnd( pTmpLine->GetStart() ); - pTEParaPortion->GetLines().Insert( pTmpLine, pTEParaPortion->GetLines().Count() ); + pTEParaPortion->GetLines().push_back( pTmpLine ); if ( ImpGetAlign() == TXTALIGN_CENTER ) pTmpLine->SetStartX( (short)(mnMaxTextWidth / 2) ); @@ -2017,11 +2018,11 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan // -------------------------------------------------- // Ueber die Zeilen des Absatzes... // -------------------------------------------------- - sal_uInt16 nLines = pPortion->GetLines().Count(); + sal_uInt16 nLines = pPortion->GetLines().size(); sal_uInt16 nIndex = 0; for ( sal_uInt16 nLine = 0; nLine < nLines; nLine++ ) { - TextLine* pLine = pPortion->GetLines().GetObject(nLine); + TextLine* pLine = pPortion->GetLines()[nLine]; Point aTmpPos( rStartPos.X() + pLine->GetStartX(), nY ); if ( ( !pPaintArea || ( ( nY + mnCharHeight ) > pPaintArea->Top() ) ) @@ -2196,7 +2197,7 @@ sal_Bool TextEngine::CreateLines( sal_uLong nPara ) TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara ); DBG_ASSERT( pTEParaPortion->IsInvalid(), "CreateLines: Portion nicht invalid!" ); - sal_uInt16 nOldLineCount = pTEParaPortion->GetLines().Count(); + sal_uInt16 nOldLineCount = pTEParaPortion->GetLines().size(); // --------------------------------------------------------------- // Schnelle Sonderbehandlung fuer leere Absaetze... @@ -2206,21 +2207,25 @@ sal_Bool TextEngine::CreateLines( sal_uLong nPara ) // schnelle Sonderbehandlung... if ( pTEParaPortion->GetTextPortions().Count() ) pTEParaPortion->GetTextPortions().Reset(); - if ( pTEParaPortion->GetLines().Count() ) - pTEParaPortion->GetLines().DeleteAndDestroy( 0, pTEParaPortion->GetLines().Count() ); + if ( !pTEParaPortion->GetLines().empty() ) + { + BOOST_FOREACH(TextLine* pLine, pTEParaPortion->GetLines()) + delete pLine; + pTEParaPortion->GetLines().clear(); + } CreateAndInsertEmptyLine( nPara ); pTEParaPortion->SetValid(); - return nOldLineCount != pTEParaPortion->GetLines().Count(); + return nOldLineCount != pTEParaPortion->GetLines().size(); } // --------------------------------------------------------------- // Initialisierung...... // --------------------------------------------------------------- - if ( pTEParaPortion->GetLines().Count() == 0 ) + if ( pTEParaPortion->GetLines().empty() ) { TextLine* pL = new TextLine; - pTEParaPortion->GetLines().Insert( pL, 0 ); + pTEParaPortion->GetLines().push_back( pL ); } const short nInvalidDiff = pTEParaPortion->GetInvalidDiff(); @@ -2269,10 +2274,10 @@ sal_Bool TextEngine::CreateLines( sal_uLong nPara ) // Zeilen flaggen => nicht removen ! // --------------------------------------------------------------- - sal_uInt16 nLine = pTEParaPortion->GetLines().Count()-1; + sal_uInt16 nLine = pTEParaPortion->GetLines().size()-1; for ( sal_uInt16 nL = 0; nL <= nLine; nL++ ) { - TextLine* pLine = pTEParaPortion->GetLines().GetObject( nL ); + TextLine* pLine = pTEParaPortion->GetLines()[ nL ]; if ( pLine->GetEnd() > nInvalidStart ) { nLine = nL; @@ -2285,7 +2290,7 @@ sal_Bool TextEngine::CreateLines( sal_uLong nPara ) if ( nLine && ( !pTEParaPortion->IsSimpleInvalid() || ( nInvalidEnd < pNode->GetText().Len() ) || ( nInvalidDiff <= 0 ) ) ) nLine--; - TextLine* pLine = pTEParaPortion->GetLines().GetObject( nLine ); + TextLine* pLine = pTEParaPortion->GetLines()[ nLine ]; // --------------------------------------------------------------- // Ab hier alle Zeilen durchformatieren... @@ -2484,8 +2489,8 @@ sal_Bool TextEngine::CreateLines( sal_uLong nPara ) // Naechste Zeile oder ggf. neue Zeile.... pLine = 0; - if ( nLine < pTEParaPortion->GetLines().Count()-1 ) - pLine = pTEParaPortion->GetLines().GetObject( ++nLine ); + if ( nLine < pTEParaPortion->GetLines().size()-1 ) + pLine = pTEParaPortion->GetLines()[ ++nLine ]; if ( pLine && ( nIndex >= pNode->GetText().Len() ) ) { nDelFromLine = nLine; @@ -2494,7 +2499,7 @@ sal_Bool TextEngine::CreateLines( sal_uLong nPara ) if ( !pLine && ( nIndex < pNode->GetText().Len() ) ) { pLine = new TextLine; - pTEParaPortion->GetLines().Insert( pLine, ++nLine ); + pTEParaPortion->GetLines().insert( pTEParaPortion->GetLines().begin() + ++nLine, pLine ); } if ( pLine ) { @@ -2507,16 +2512,20 @@ sal_Bool TextEngine::CreateLines( sal_uLong nPara ) } // while ( Index < Len ) if ( nDelFromLine != 0xFFFF ) - pTEParaPortion->GetLines().DeleteAndDestroy( nDelFromLine, pTEParaPortion->GetLines().Count() - nDelFromLine ); + for( TextLines::iterator it = pTEParaPortion->GetLines().begin() + nDelFromLine; + it != pTEParaPortion->GetLines().end(); ++it ) + delete *it; + pTEParaPortion->GetLines().erase( pTEParaPortion->GetLines().begin() + nDelFromLine, + pTEParaPortion->GetLines().end() ); - DBG_ASSERT( pTEParaPortion->GetLines().Count(), "Keine Zeile nach CreateLines!" ); + DBG_ASSERT( pTEParaPortion->GetLines().size(), "Keine Zeile nach CreateLines!" ); if ( bLineBreak == sal_True ) CreateAndInsertEmptyLine( nPara ); pTEParaPortion->SetValid(); - return nOldLineCount != pTEParaPortion->GetLines().Count(); + return nOldLineCount != pTEParaPortion->GetLines().size(); } String TextEngine::GetWord( const TextPaM& rCursorPos, TextPaM* pStartOfWord ) diff --git a/svtools/source/edit/textview.cxx b/svtools/source/edit/textview.cxx index 75dbb5f77539..12e3e882803d 100644 --- a/svtools/source/edit/textview.cxx +++ b/svtools/source/edit/textview.cxx @@ -424,7 +424,7 @@ void TextView::ImpHighlight( const TextSelection& rSel ) { TEParaPortion* pTEParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( nPara ); sal_uInt16 nStartLine = 0; - sal_uInt16 nEndLine = pTEParaPortion->GetLines().Count() -1; + sal_uInt16 nEndLine = pTEParaPortion->GetLines().size() -1; if ( nPara == nStartPara ) nStartLine = pTEParaPortion->GetLineNumber( aSel.GetStart().GetIndex(), sal_False ); if ( nPara == nEndPara ) @@ -433,7 +433,7 @@ void TextView::ImpHighlight( const TextSelection& rSel ) // ueber die Zeilen iterieren.... for ( sal_uInt16 nLine = nStartLine; nLine <= nEndLine; nLine++ ) { - TextLine* pLine = pTEParaPortion->GetLines().GetObject( nLine ); + TextLine* pLine = pTEParaPortion->GetLines()[ nLine ]; sal_uInt16 nStartIndex = pLine->GetStart(); sal_uInt16 nEndIndex = pLine->GetEnd(); if ( ( nPara == nStartPara ) && ( nLine == nStartLine ) ) @@ -1032,7 +1032,7 @@ void TextView::Command( const CommandEvent& rCEvt ) TEParaPortion* pParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() ); sal_uInt16 nLine = pParaPortion->GetLineNumber( aPaM.GetIndex(), sal_True ); - TextLine* pLine = pParaPortion->GetLines().GetObject( nLine ); + TextLine* pLine = pParaPortion->GetLines()[ nLine ]; if ( pLine && ( nInputEnd > pLine->GetEnd() ) ) nInputEnd = pLine->GetEnd(); Rectangle aR2 = mpImpl->mpTextEngine->PaMtoEditCursor( TextPaM( aPaM.GetPara(), nInputEnd ) ); @@ -1571,7 +1571,7 @@ TextPaM TextView::CursorUp( const TextPaM& rPaM ) // Wenn davor eine autom.Umgebrochene Zeile, und ich muss genau an das // Ende dieser Zeile, landet der Cursor in der aktuellen Zeile am Anfang // Siehe Problem: Letztes Zeichen einer autom.umgebr. Zeile = Cursor - TextLine* pLine = pPPortion->GetLines().GetObject( nLine - 1 ); + TextLine* pLine = pPPortion->GetLines()[ nLine - 1 ]; if ( aPaM.GetIndex() && ( aPaM.GetIndex() == pLine->GetEnd() ) ) aPaM.GetIndex()--; } @@ -1579,7 +1579,7 @@ TextPaM TextView::CursorUp( const TextPaM& rPaM ) { aPaM.GetPara()--; pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() ); - sal_uInt16 nL = pPPortion->GetLines().Count() - 1; + sal_uInt16 nL = pPPortion->GetLines().size() - 1; sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), nL, nX+1 ); aPaM.GetIndex() = nCharPos; } @@ -1602,13 +1602,13 @@ TextPaM TextView::CursorDown( const TextPaM& rPaM ) TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() ); sal_uInt16 nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), sal_False ); - if ( nLine < ( pPPortion->GetLines().Count() - 1 ) ) + if ( nLine < ( pPPortion->GetLines().size() - 1 ) ) { sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine+1, nX ); aPaM.GetIndex() = nCharPos; // Sonderbehandlung siehe CursorUp... - TextLine* pLine = pPPortion->GetLines().GetObject( nLine + 1 ); + TextLine* pLine = pPPortion->GetLines()[ nLine + 1 ]; if ( ( aPaM.GetIndex() == pLine->GetEnd() ) && ( aPaM.GetIndex() > pLine->GetStart() ) && aPaM.GetIndex() < pPPortion->GetNode()->GetText().Len() ) aPaM.GetIndex()--; } @@ -1618,8 +1618,8 @@ TextPaM TextView::CursorDown( const TextPaM& rPaM ) pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() ); sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), 0, nX+1 ); aPaM.GetIndex() = nCharPos; - TextLine* pLine = pPPortion->GetLines().GetObject( 0 ); - if ( ( aPaM.GetIndex() == pLine->GetEnd() ) && ( aPaM.GetIndex() > pLine->GetStart() ) && ( pPPortion->GetLines().Count() > 1 ) ) + TextLine* pLine = pPPortion->GetLines().front(); + if ( ( aPaM.GetIndex() == pLine->GetEnd() ) && ( aPaM.GetIndex() > pLine->GetStart() ) && ( pPPortion->GetLines().size() > 1 ) ) aPaM.GetIndex()--; } @@ -1632,7 +1632,7 @@ TextPaM TextView::CursorStartOfLine( const TextPaM& rPaM ) TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() ); sal_uInt16 nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), sal_False ); - TextLine* pLine = pPPortion->GetLines().GetObject( nLine ); + TextLine* pLine = pPPortion->GetLines()[ nLine ]; aPaM.GetIndex() = pLine->GetStart(); return aPaM; @@ -1644,7 +1644,7 @@ TextPaM TextView::CursorEndOfLine( const TextPaM& rPaM ) TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() ); sal_uInt16 nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), sal_False ); - TextLine* pLine = pPPortion->GetLines().GetObject( nLine ); + TextLine* pLine = pPPortion->GetLines()[ nLine ]; aPaM.GetIndex() = pLine->GetEnd(); if ( pLine->GetEnd() > pLine->GetStart() ) // Leerzeile |