diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-05-11 21:03:19 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-05-11 21:49:36 +0200 |
commit | 05f8f239d49bd66145e736b4e2e28ad073ef6f2f (patch) | |
tree | d8e75c4a40fdfb7340ac03f56ee05aed03501f23 /sc | |
parent | b74fe262d889705ea6c27267bd7e6d57279367b9 (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>
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 4bca2a4d92f8..3273999128d2 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -66,6 +66,8 @@ #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <output.hxx> +#include <utility> + #include <com/sun/star/chart2/data/HighlightedRange.hpp> namespace @@ -2686,9 +2688,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 ) ); } @@ -2739,9 +2743,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 ) ); } |