• Stephan Bergmann's avatar
    Revert overflow checks in O[U]String::toInt{32,64} again · 9bf6c833
    Stephan Bergmann yazdı
    ...originally introduced with bd60d411 "Handle
    oveflow in O(U)String::toInt() functions."  As pointed out by Noel Power, there
    is existing code using toInt32(16) to read an effectively unsigned hex string
    into a sal_Int32, which used to work fine with the wrap-around overflow but now
    fails when toInt32 explicitly returns 0 for large values.  See, e.g., use of
    oox::AttributeList::getIntegerHex (indirectly calling OUString::toInt32) in
    ColorScaleRule::importColor (sc/source/filter/oox/condformatbuffer.cxx).
    
    To prevent any regressions in LO 4.1, remove the explicit checks from
    toInt{32,64} again for now.  (They were "merely" added as a general safety
    measure, not to address some specific problem, IIRC.)  On master, the approach
    will rather be to introduce toUInt32 and adapt client code as necessary.
    
    Change-Id: Id332cff18a99b8bd2dcccd7988b7aad3a9e98c4c
    9bf6c833
test_strings_toint.cxx 2.03 KB