From d288ee633d7964cf89a32a96e6e0af8c3c3e0db9 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 25 Nov 2014 16:36:45 +0100 Subject: fdo#85858: svx: fix mouse dragging of table row separators in Writer Add a work-around for Writer's usage of LONG_MAX to SvxColumnDescription: on 64-bit platforms the LONG_MAX added in SwView::StateTabWin() for SID_RULER_ROWS will overflow in vcl's LogicToPixel mapping and that causes wrong positioning of the row highlight lines. Probably Writer should use something other than LONG_MAX (no reason why these types need to be bigger than 32-bit anyway) but that needs a bigger cleanup. (regression from 4c60f722afdc0be5c129ce5f5ed6786d09d0051e) Change-Id: I08147462356368d48959a85a85ef7dd8dcae0943 --- svx/source/dialog/rulritem.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'svx/source/dialog') diff --git a/svx/source/dialog/rulritem.cxx b/svx/source/dialog/rulritem.cxx index 11efac125d22..f993d69b77ae 100644 --- a/svx/source/dialog/rulritem.cxx +++ b/svx/source/dialog/rulritem.cxx @@ -670,8 +670,9 @@ SvxColumnDescription::SvxColumnDescription(long start, long end, long endMin, lo nStart (start), nEnd (end), bVisible (bVis), - nEndMin (endMin), - nEndMax (endMax) + // fdo#85858 hack: clamp these to smaller value to prevent overflow + nEndMin(std::min(endMin, std::numeric_limits::max())), + nEndMax(std::min(endMax, std::numeric_limits::max())) {} bool SvxColumnDescription::operator==(const SvxColumnDescription& rCmp) const -- cgit