[Libreoffice-commits] core.git: 2 commits - vcl/source

Noel Grandin noel at peralex.com
Mon Aug 12 05:59:25 PDT 2013


 vcl/source/edit/texteng.cxx |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit 3a16cb8b8e08d84f4a6cab39bfba6481918b169c
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Aug 12 14:58:06 2013 +0200

    fix for "signed overflow is undefined" warning
    
    introduced by my String->OUString conversions
    
    Change-Id: I237c8fcf655d6f39f04512d1a386d0b6631f53c3

diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index d7cced4..65660ec 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -809,10 +809,10 @@ TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const OUString&
         if ( nEnd < aText.getLength() )
             aPaM = ImpInsertParaBreak( aPaM );
 
-        nStart = nEnd+1;
-
-        if ( nStart < nEnd )    // #108611# overflow
+        if ( nEnd == aText.getLength() )    // #108611# prevent overflow in "nStart = nEnd+1" calculation
             break;
+
+        nStart = nEnd+1;
     }
 
     UndoActionEnd();
commit aeed216756083eaf9b883025491d137800938f33
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Aug 12 14:55:41 2013 +0200

    remove dead variable
    
    Change-Id: I5129c1df5a5525824ec4b3cf941c9270b50b2441

diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index 37813db..d7cced4 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -793,9 +793,6 @@ TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const OUString&
         // Start == End => empty line
         if ( nEnd > nStart )
         {
-            sal_uLong nL = aPaM.GetIndex();
-            nL += ( nEnd-nStart );
-
             OUString aLine(aText.copy(nStart, nEnd-nStart));
             if ( IsUndoEnabled() && !IsInUndo() )
                 InsertUndo( new TextUndoInsertChars( this, aPaM, aLine ) );


More information about the Libreoffice-commits mailing list