summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-01-12 13:12:09 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-01-12 13:15:12 +0100
commit032517ba36c328a4df36cd9f2ea54ad13c316721 (patch)
treec812a30a3da8d695fc2cf09287146d7fbb3bae53
parentc5f6fd36b21c233d46a5fe8f8c411366150999c7 (diff)
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
-rw-r--r--sw/source/core/doc/docredln.cxx6
-rw-r--r--sw/source/core/layout/pagechg.cxx2
2 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 62b1f7d6ad2b..960a15dd997f 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 062d7c5ea453..6ca018361753 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));
}
}