Fix the -Werror=strict-overflow correctly
...from 2bf2dee0 "Werror=strict-overflow." The warning (generated e.g. by --disable-debug --disable-dbgutil builds with GCC 4.8.2) orginates from the call to InvalidateRange( SwCharRange( GetOfst(), COMPLETE_STRING ) ); in SwTxtFrm::Prepare further down in txtfrm.cxx, which inlines the IsIdxInside code to if( GetOfst() > GetOfst() + COMPLETE_STRING ) where COMPLETE_STRING is SAL_MAX_INT32. The problem is that before ba27366f "Resolves: #i17171# Writer paragraph cannot be longer than 65534 characters" that code would inline to if( GetOfst() > GetOfst() + STRING_LEN ) where STRING_LEN was 0xFFFF, so the calculation on effectively 16-bit quantities stayed nicely in the bounds of (32-bit) int. Change-Id: I958514e52e9102236844eefa4fe92a401be6ab01
Showing
Please
register
or
sign in
to comment