summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-11-19 21:23:05 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-11-20 08:04:29 +0100
commit528a3afa2497aa8bc0fcfda21b3a66c2fa014bda (patch)
tree739314cfcf9430c8d372be8705a740634b168084 /sd
parent9dbfecaee0ab804b393e40e4399a0e4b87433b80 (diff)
This presumably wants to be Size(-1, -1)
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 Size(std::numeric_limits<::tools::Long>::max(), std::numeric_limits<::tools::Long>::max()) 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<Timer*, void>::Call(Timer*) const at include/tools/link.hxx:111:45 > #10 in Timer::Invoke() at vcl/source/app/timer.cxx:75:21 > #11 in Scheduler::ProcessTaskScheduling() at vcl/source/app/scheduler.cxx:486:20 > #12 in Scheduler::CallbackTaskScheduling() at vcl/source/app/scheduler.cxx:288:5 > #13 in SalTimer::CallCallback() at vcl/inc/saltimer.hxx:54:13 when creating a rectangle in Draw and clicking around in it. Whereas with Size(-1, -1) things appear to work fine. Change-Id: I7368b510113a34fec5c1cabfc35a369cac2fcda1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106187 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/drviews3.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx
index 18ec833b160f..ed28a4370ebc 100644
--- a/sd/source/ui/view/drviews3.cxx
+++ b/sd/source/ui/view/drviews3.cxx
@@ -911,7 +911,7 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet)
if( mpDrawView->IsTextEdit() )
{
Point aPnt1 = GetActiveWindow()->GetWinViewPos();
- ::tools::Rectangle aMinMaxRect( aPnt1, Size(ULONG_MAX, ULONG_MAX) );
+ ::tools::Rectangle aMinMaxRect( aPnt1, Size(-1, -1) );
rSet.Put( SfxRectangleItem(SID_RULER_LR_MIN_MAX, aMinMaxRect) );
}
else