sc/source/ui/view/tabview3.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
New commits: commit 93e031dced1ea68c4bbd93cceb9e31ba9e0b3a3f Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Tue May 11 21:03:19 2021 +0200 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Wed May 12 19:21:56 2021 +0200 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.kagan...@collabora.com> (cherry picked from commit 05f8f239d49bd66145e736b4e2e28ad073ef6f2f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115285 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> (cherry picked from commit 8bdbc928cb2d79e161aaa6a5ac1cd816ab6c591b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115289 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 8c3a74e34b34..ec257e9d8b5f 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 ) ); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits