diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-01-11 15:33:15 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-01-11 15:51:03 +0000 |
commit | b4bff4a978247e19f2a9ff02718ef87148f78d01 (patch) | |
tree | 82fb66a4abb9fcea2fc384c6b36283184c1385ca /vcl | |
parent | 0d1f724f9645e7ec0da6a4c3a1c22d0dcf785cb6 (diff) |
longparas: shouldn't need to split strings in textview anymore
Change-Id: Ide2d0ba95e4ef8bf1500f086bd03b7a1590a2848
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/edit/textview.cxx | 51 |
1 files changed, 12 insertions, 39 deletions
diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index cd614f1175a3..cd5a9b3907c3 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -1335,43 +1335,22 @@ TextSelection TextView::ImpMoveCursor( const KeyEvent& rKeyEvent ) void TextView::InsertText( const OUString& rStr, sal_Bool bSelect ) { -// HideSelection(); mpImpl->mpTextEngine->UndoActionStart(); - /* #i87633# - break inserted text into chunks that fit into the underlying String - based API (which has a maximum length of 65534 elements + TextSelection aNewSel( mpImpl->maSelection ); + TextPaM aPaM = mpImpl->mpTextEngine->ImpInsertText( mpImpl->maSelection, rStr ); - note: this will of course still cause problems for lines longer than those - 65534 elements, but those cases will hopefully be few. - In the long run someone should switch the TextEngine to OUString instead of String - */ - sal_Int32 nLen = rStr.getLength(); - sal_Int32 nPos = 0; - do + if ( bSelect ) { - sal_Int32 nChunkLen = nLen > 65534 ? 65534 : nLen; - OUString aChunk( rStr.copy( nPos, nChunkLen ) ); - - TextSelection aNewSel( mpImpl->maSelection ); - - TextPaM aPaM = mpImpl->mpTextEngine->ImpInsertText( mpImpl->maSelection, aChunk ); - - if ( bSelect ) - { - aNewSel.Justify(); - aNewSel.GetEnd() = aPaM; - } - else - { - aNewSel = aPaM; - } - - ImpSetSelection( aNewSel ); - nLen -= nChunkLen; - nPos += nChunkLen; + aNewSel.Justify(); + aNewSel.GetEnd() = aPaM; + } + else + { + aNewSel = aPaM; } - while( nLen ); + + ImpSetSelection( aNewSel ); mpImpl->mpTextEngine->UndoActionEnd(); @@ -1952,14 +1931,8 @@ bool TextView::ImplTruncateNewText( OUString& rNewText ) const { bool bTruncated = false; - if( rNewText.getLength() > 65534 ) // limit to String API - { - rNewText = rNewText.copy( 0, 65534 ); - bTruncated = true; - } - sal_uLong nMaxLen = mpImpl->mpTextEngine->GetMaxTextLen(); - // 0 means unlimited, there is just the String API limit handled above + // 0 means unlimited if( nMaxLen != 0 ) { sal_uLong nCurLen = mpImpl->mpTextEngine->GetTextLen(); |