[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - sc/source

Marco Cecchetti marco.cecchetti at collabora.com
Mon Dec 5 12:42:14 UTC 2016


 sc/source/ui/view/tabview.cxx  |    3 +++
 sc/source/ui/view/tabview3.cxx |    7 +++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 8410eb14febecfc186674064f276ca61ac4c2325
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date:   Fri Dec 2 17:34:18 2016 +0100

    LOK - Calc: row header message must include less than MAXTILEDROW rows
    
    On the contrary we can have performance issues on the client.
    
    Change-Id: Id9b27c80c3bfc0ada17818ee39ff65da245b3b7a
    Reviewed-on: https://gerrit.libreoffice.org/31567
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index c5895ff..b4b5cea 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -2290,6 +2290,9 @@ OUString ScTabView::getRowColumnHeaders(const Rectangle& rRectangle)
     SCROW nEndRow = 0;
     pDoc->GetTiledRenderingArea(aViewData.GetTabNo(), nEndCol, nEndRow);
 
+    if (nEndCol > MAXCOL) nEndCol = MAXCOL;
+    if (nEndRow >= MAXTILEDROW) nEndRow = MAXTILEDROW - 1;
+
     rtl::OUStringBuffer aBuffer(256 + (50 * nEndRow) + (50 * nEndCol));
 
     aBuffer.append("{ \"commandName\": \".uno:ViewRowColumnHeaders\",\n");
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index e3f5f75..c1e7bbc 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -331,6 +331,9 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew )
 
     //  DeactivateIP only for MarkListHasChanged
 
+    if (comphelper::LibreOfficeKit::isActive())
+        nPosY = std::min(nPosY, MAXTILEDROW);
+
     if ( nPosX != nOldX || nPosY != nOldY || bNew )
     {
         ScTabViewShell* pViewShell = aViewData.GetViewShell();
@@ -360,10 +363,10 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew )
                     aOldSize = pModelObj->getDocumentSize();
 
                 if (nPosX > aViewData.GetMaxTiledCol() - 10)
-                    aViewData.SetMaxTiledCol(std::max(nPosX, aViewData.GetMaxTiledCol()) + 10);
+                    aViewData.SetMaxTiledCol(std::min<SCCOL>(std::max(nPosX, aViewData.GetMaxTiledCol()) + 10, MAXCOL));
 
                 if (nPosY > aViewData.GetMaxTiledRow() - 25)
-                    aViewData.SetMaxTiledRow(std::max(nPosY, aViewData.GetMaxTiledRow()) + 25);
+                    aViewData.SetMaxTiledRow(std::min<SCROW>(std::max(nPosY, aViewData.GetMaxTiledRow()) + 25,  MAXTILEDROW));
 
                 Size aNewSize(0, 0);
                 if (pModelObj)


More information about the Libreoffice-commits mailing list