Remove presumably dead < USHRT_MAX checks
The original code of 84a3db80 "initial import" read + long nBoxOffset = lcl_GetLongBoxNum( sGetName ) + nSttBox; + long nLineOffset = lcl_GetLongBoxNum( sGetName ) + nSttLine; + + if( nBoxOffset < 0 || nBoxOffset >= USHRT_MAX || + nLineOffset < 0 || nLineOffset >= USHRT_MAX ) + return 0; + + if( nLineOffset >= long(pLines->Count()) ) + return 0; + + pLine = (*pLines)[ USHORT(nLineOffset) ]; + + // dann suche die Box + pBoxes = &pLine->GetTabBoxes(); + if( nBoxOffset >= long(pBoxes->Count()) ) + return 0; + pBox = (*pBoxes)[ USHORT(nBoxOffset) ]; casting nBox/LineOffset to USHORT, while the current code looks like it should work fine for larger values. Change-Id: I47bdf3963be6e84568a589711ce688b66f325db8 Reviewed-on: https://gerrit.libreoffice.org/48451Tested-by:Jenkins <ci@libreoffice.org> Reviewed-by:
Stephan Bergmann <sbergman@redhat.com>
Showing
Please
register
or
sign in
to comment