[Libreoffice-commits] core.git: sw/source

Stephan Bergmann sbergman at redhat.com
Tue Nov 11 04:53:32 PST 2014


 sw/source/core/inc/wrong.hxx  |    2 +-
 sw/source/core/text/wrong.cxx |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 22db613f4ed4ea72a3679b8dd094cbea302e136a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Nov 11 13:52:42 2014 +0100

    More nEndInvalid/COMPLETE_STRING fixes
    
    ...to fix -fsanitize=signed-integer-overflow
    
    Change-Id: Ib8dad09f1ed088c51fb417efecf662e76b2e495a

diff --git a/sw/source/core/inc/wrong.hxx b/sw/source/core/inc/wrong.hxx
index f2a8831..4d31b9a 100644
--- a/sw/source/core/inc/wrong.hxx
+++ b/sw/source/core/inc/wrong.hxx
@@ -211,7 +211,7 @@ public:
     inline bool InsideInvalid( sal_Int32 nChk ) const
         { return nChk >= nBeginInvalid && nChk <= nEndInvalid; }
     void SetInvalid( sal_Int32 nBegin, sal_Int32 nEnd );
-    inline void Validate(){ nBeginInvalid = COMPLETE_STRING; }
+    inline void Validate(){ nBeginInvalid = nEndInvalid = COMPLETE_STRING; }
     void Invalidate( sal_Int32 nBegin, sal_Int32 nEnd );
     bool InvalidateWrong();
     bool Fresh( sal_Int32 &rStart, sal_Int32 &rEnd, sal_Int32 nPos,
diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx
index a9d500f..680c6d0 100644
--- a/sw/source/core/text/wrong.cxx
+++ b/sw/source/core/text/wrong.cxx
@@ -313,7 +313,7 @@ void SwWrongList::Move( sal_Int32 nPos, sal_Int32 nDiff )
         {
             if( nBeginInvalid > nPos )
                 nBeginInvalid += nDiff;
-            if( nEndInvalid >= nPos )
+            if( nEndInvalid >= nPos && nEndInvalid != COMPLETE_STRING )
                 nEndInvalid += nDiff;
         }
         // If the pointer is in the middle of a wrong word,


More information about the Libreoffice-commits mailing list