Remove obsolete overflow check
...which had originally been added with 766d2b65 "INTEGRATION: CWS geordi2q10: #111934#: join CWS os21" as - rInf.Left( KSHORT(Left()) ); - rInf.Right( KSHORT(Right()) ); - rInf.First( short(FirstLeft()) ); + + // Handle overflows: + SwTwips nTmpLeft = Left(); + SwTwips nTmpRight = Right(); + SwTwips nTmpFirst = FirstLeft(); + + if ( nTmpLeft > USHRT_MAX || + nTmpRight > USHRT_MAX || + nTmpFirst > USHRT_MAX ) + { + SWRECTFN( rInf.GetTxtFrm() ) + nTmpLeft = (rInf.GetTxtFrm()->Frm().*fnRect->fnGetLeft)(); + nTmpRight = (rInf.GetTxtFrm()->Frm().*fnRect->fnGetRight)(); + nTmpFirst = nTmpLeft; + } + + rInf.Left( KSHORT( nTmpLeft ) ); + rInf.Right( KSHORT( nTmpRight ) ); + rInf.First( KSHORT( nTmpFirst ) ); But later 2a2f9a30 "INTEGRATION: CWS swqbugfixes10: #i34348# Underflow with negative numbering indent values" had changed the SwTxtFormatInfo members from KSHORT to SwTwips, presumably obviating the need for such an overflow check. Change-Id: Id622d2bbc280e3d825981356e19c7fe9ed23fc5b Reviewed-on: https://gerrit.libreoffice.org/49077Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Showing
Please
register
or
sign in
to comment