diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-05-11 21:03:19 +0200 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2021-05-12 02:42:48 +0200 |
commit | 8bdbc928cb2d79e161aaa6a5ac1cd816ab6c591b (patch) | |
tree | 95091824989cbfdb32ba498971fb183a88f3a086 /sc | |
parent | 2a416c0c4a1635af8be5b1167fd1f06bdc4a2466 (diff) |
tdf#139241: partially revert 059f07f9f33460c809a93e0fda1165f5c6f6d805
And instead normalize the start and end values before creating
rectangle.
Change-Id: Ib9921f1a537ca88a70cedf989d2f696180ad68e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115284
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 05f8f239d49bd66145e736b4e2e28ad073ef6f2f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115285
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/tabview3.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 214f5a02ca3d..bdb78e9c2e98 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -65,6 +65,8 @@ #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <output.hxx> +#include <utility> + #include <com/sun/star/chart2/data/HighlightedRange.hpp> namespace @@ -2684,9 +2686,11 @@ void ScTabView::PaintTopArea( SCCOL nStartCol, SCCOL nEndCol ) tools::Long nStartX = aViewData.GetScrPos( nStartCol, 0, eWhich ).X(); tools::Long nEndX; if (nEndCol >= rDoc.MaxCol()) - nEndX = nStartX + (bLayoutRTL ? 0 : ( aWinSize.Width()-1 )); + nEndX = bLayoutRTL ? 0 : ( aWinSize.Width()-1 ); else nEndX = aViewData.GetScrPos( nEndCol+1, 0, eWhich ).X() - nLayoutSign; + if (nStartX > nEndX) + std::swap(nStartX, nEndX); pColBar[eWhich]->Invalidate( tools::Rectangle( nStartX, 0, nEndX, aWinSize.Height()-1 ) ); } @@ -2737,9 +2741,11 @@ void ScTabView::PaintLeftArea( SCROW nStartRow, SCROW nEndRow ) tools::Long nStartY = aViewData.GetScrPos( 0, nStartRow, eWhich ).Y(); tools::Long nEndY; if (nEndRow >= rDoc.MaxRow()) - nEndY = nStartY + aWinSize.Height() - 1; + nEndY = aWinSize.Height() - 1; else nEndY = aViewData.GetScrPos( 0, nEndRow+1, eWhich ).Y() - 1; + if (nStartY > nEndY) + std::swap(nStartY, nEndY); pRowBar[eWhich]->Invalidate( tools::Rectangle( 0, nStartY, aWinSize.Width()-1, nEndY ) ); } |