The code had been introduced with bd837fcbae7662bd127cb214f1497e4bf750cab0 "#92085# GetRulerState(): setting of SID_RULER_LR_MIN_MAX corrected" (where the referenced bug is apparently from the lost Sun-internal bug tracker), at a time when Size was presumably based on signed long, so ULONG_MAX presumably already effectively meant -1 back then.
I don't understand what this code does, but when using a
instead, in a 64-bit Linux UBSan build I got
> include/tools/gen.hxx:527:37: runtime error: signed integer overflow: 11767 + 9223372036854775806 cannot be represented in type 'long' > #0 in tools::Rectangle::Rectangle(Point const&, Size const&) at include/tools/gen.hxx:527:37 > #1 in sd::DrawViewShell::GetRulerState(SfxItemSet&) at sd/source/ui/view/drviews3.cxx:915:28 > #2 in SfxStubGraphicViewShellGetRulerState(SfxShell*, SfxItemSet&) at workdir/SdiTarget/sd/sdi/sdgslots.hxx:1540:1 > #3 in SfxShell::CallState(void (*)(SfxShell*, SfxItemSet&), SfxItemSet&) at include/sfx2/shell.hxx:199:35 > #4 in SfxDispatcher::FillState_(SfxSlotServer const&, SfxItemSet&, SfxSlot const*) at sfx2/source/control/dispatch.cxx:1657:14 > #5 in SfxBindings::Update_Impl(SfxStateCache&) at sfx2/source/control/bindings.cxx:260:22 > #6 in SfxBindings::NextJob_Impl(Timer const*) at sfx2/source/control/bindings.cxx:1274:17 > #7 in SfxBindings::NextJob(Timer*) at sfx2/source/control/bindings.cxx:1219:5 > #8 in SfxBindings::LinkStubNextJob(void*, Timer*) at sfx2/source/control/bindings.cxx:1217:1 > #9 in Link
when creating a rectangle in Draw and clicking around in it. Whereas with
things appear to work fine.
Change-Id: I7368b510113a34fec5c1cabfc35a369cac2fcda1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106187
528a3afa2497 This presumably wants to be Size(-1, -1)
sd/source/ui/view/drviews3.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)