Kaydet (Commit) 032517ba authored tarafından Stephan Bergmann's avatar Stephan Bergmann

More overflowing InvalidateWindows(SwRect(0, 0, MAX, MAX))

...cf. 52ce5239 "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
üst c5f6fd36
...@@ -452,7 +452,7 @@ void SwRedlineTbl::Remove( sal_uInt16 nP ) ...@@ -452,7 +452,7 @@ void SwRedlineTbl::Remove( sal_uInt16 nP )
SwViewShell* pSh; SwViewShell* pSh;
if( pDoc && !pDoc->IsInDtor() && if( pDoc && !pDoc->IsInDtor() &&
0 != ( pSh = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()) ) 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() void SwRedlineTbl::DeleteAndDestroyAll()
...@@ -473,7 +473,7 @@ void SwRedlineTbl::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL ) ...@@ -473,7 +473,7 @@ void SwRedlineTbl::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL )
SwViewShell* pSh; SwViewShell* pSh;
if( pDoc && !pDoc->IsInDtor() && if( pDoc && !pDoc->IsInDtor() &&
0 != ( pSh = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() ) ) 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. /// Find the next or preceding Redline with the same seq.no.
...@@ -1627,7 +1627,7 @@ void SwExtraRedlineTbl::DeleteAndDestroy( sal_uInt16 nPos, sal_uInt16 nLen ) ...@@ -1627,7 +1627,7 @@ void SwExtraRedlineTbl::DeleteAndDestroy( sal_uInt16 nPos, sal_uInt16 nLen )
SwViewShell* pSh; SwViewShell* pSh;
if( pDoc && !pDoc->IsInDtor() && if( pDoc && !pDoc->IsInDtor() &&
0 != ( pSh = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() ) ) 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 ) );
*/ */
} }
......
...@@ -2162,7 +2162,7 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi ...@@ -2162,7 +2162,7 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
pSh->SetFirstVisPageInvalid(); pSh->SetFirstVisPageInvalid();
if (bOldCallbackActionEnabled) 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)); pSh->GetDoc()->GetDocShell()->Broadcast(SfxSimpleHint(SFX_HINT_DOCCHANGED));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment