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

Stephan Bergmann sbergman at redhat.com
Mon Jan 12 04:15:45 PST 2015


 sw/source/core/doc/docredln.cxx   |    6 +++---
 sw/source/core/layout/pagechg.cxx |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 032517ba36c328a4df36cd9f2ea54ad13c316721
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Jan 12 13:12:09 2015 +0100

    More overflowing InvalidateWindows(SwRect(0, 0, MAX, MAX))
    
    ...cf. 52ce5239b43bf6b9ce1ceddfe90227920aa57657 "vcl: assert when LogicToPixel
    overflows."  Looks safest to use platform-independent SAL_MAX_INT32 rather than
    INT_MAX.  Detected when running CppunitTest_sw_uiwriter with
    -fsanitize=singed-integer-overflow.
    
    Change-Id: I7df98237811a304e475d6b2db8805bc390ca6232

diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 62b1f7d..960a15d 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -452,7 +452,7 @@ void SwRedlineTbl::Remove( sal_uInt16 nP )
     SwViewShell* pSh;
     if( pDoc && !pDoc->IsInDtor() &&
         0 != ( pSh = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()) )
-        pSh->InvalidateWindows( SwRect( 0, 0, LONG_MAX, LONG_MAX ) );
+        pSh->InvalidateWindows( SwRect( 0, 0, SAL_MAX_INT32, SAL_MAX_INT32 ) );
 }
 
 void SwRedlineTbl::DeleteAndDestroyAll()
@@ -473,7 +473,7 @@ void SwRedlineTbl::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL )
     SwViewShell* pSh;
     if( pDoc && !pDoc->IsInDtor() &&
         0 != ( pSh = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() ) )
-        pSh->InvalidateWindows( SwRect( 0, 0, LONG_MAX, LONG_MAX ) );
+        pSh->InvalidateWindows( SwRect( 0, 0, SAL_MAX_INT32, SAL_MAX_INT32 ) );
 }
 
 /// Find the next or preceding Redline with the same seq.no.
@@ -1627,7 +1627,7 @@ void SwExtraRedlineTbl::DeleteAndDestroy( sal_uInt16 nPos, sal_uInt16 nLen )
     SwViewShell* pSh;
     if( pDoc && !pDoc->IsInDtor() &&
         0 != ( pSh = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() ) )
-        pSh->InvalidateWindows( SwRect( 0, 0, LONG_MAX, LONG_MAX ) );
+        pSh->InvalidateWindows( SwRect( 0, 0, SAL_MAX_INT32, SAL_MAX_INT32 ) );
     */
 }
 
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 062d7c5..6ca0183 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -2162,7 +2162,7 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
             pSh->SetFirstVisPageInvalid();
             if (bOldCallbackActionEnabled)
             {
-                pSh->InvalidateWindows( SwRect( 0, 0, INT_MAX, INT_MAX ) );
+                pSh->InvalidateWindows( SwRect( 0, 0, SAL_MAX_INT32, SAL_MAX_INT32 ) );
                 pSh->GetDoc()->GetDocShell()->Broadcast(SfxSimpleHint(SFX_HINT_DOCCHANGED));
             }
         }


More information about the Libreoffice-commits mailing list