[Libreoffice-commits] core.git: sc/inc sc/source

Henry Castro hcastro at collabora.com
Thu Feb 9 08:58:03 UTC 2017


 sc/inc/address.hxx             |    2 ++
 sc/source/ui/view/gridwin.cxx  |   11 +++++++++++
 sc/source/ui/view/tabview3.cxx |   16 ++++++++++++++--
 3 files changed, 27 insertions(+), 2 deletions(-)

New commits:
commit f5e330abbf3d8cd9625b29fcc228a742b35aa657
Author: Henry Castro <hcastro at collabora.com>
Date:   Wed Jun 1 14:24:12 2016 -0400

    sc lok: Limit number of row with LOK to 1000 rows.
    
    Change-Id: Ic7fe2dec012efb8ba180feb4d3df6f4bfbf6c38a

diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index 7afbfa1..05f62b4 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -70,6 +70,8 @@ const SCROW       MAXROW         = MAXROWCOUNT - 1;
 const SCCOL       MAXCOL         = MAXCOLCOUNT - 1;
 const SCTAB       MAXTAB         = MAXTABCOUNT - 1;
 const SCCOLROW    MAXCOLROW      = MAXROW;
+// Maximun tiled rendering values
+const SCROW       MAXTILEDROW    = 1000;
 // Limit the initial tab count to prevent users to set the count too high,
 // which could cause the memory usage of blank documents to exceed the
 // available system memory.
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 2aca621..66c05b5 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -141,6 +141,7 @@
 #include <sfx2/lokhelper.hxx>
 
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <comphelper/lok.hxx>
 
 #include <memory>
 #include <vector>
@@ -1834,6 +1835,16 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt, MouseEventSta
     pViewData->GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
     SCTAB nTab = pViewData->GetTabNo();
 
+    // FIXME: this is to limit the number of rows handled in the Online
+    // to 1000; this will be removed again when the performance
+    // bottlenecks are sorted out
+    if ( comphelper::LibreOfficeKit::isActive() && nPosY > MAXTILEDROW - 1 )
+    {
+        nButtonDown = 0;
+        nMouseStatus = SC_GM_NONE;
+        return;
+    }
+
     // Auto filter / pivot table / data select popup.  This shouldn't activate the part.
 
     if ( !bDouble && !bFormulaMode && rMEvt.IsLeft() )
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 98bdecf..653e475 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -333,6 +333,12 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew )
 
     //  DeactivateIP only for MarkListHasChanged
 
+    // FIXME: this is to limit the number of rows handled in the Online
+    // to 1000; this will be removed again when the performance
+    // bottlenecks are sorted out
+    if (comphelper::LibreOfficeKit::isActive())
+        nPosY = std::min(nPosY, MAXTILEDROW);
+
     if ( nPosX != nOldX || nPosY != nOldY || bNew )
     {
         ScTabViewShell* pViewShell = aViewData.GetViewShell();
@@ -362,10 +368,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)
@@ -1121,6 +1127,12 @@ void ScTabView::MoveCursorAbs( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
     if (nCurX > MAXCOL) nCurX = MAXCOL;
     if (nCurY > MAXROW) nCurY = MAXROW;
 
+    // FIXME: this is to limit the number of rows handled in the Online
+    // to 1000; this will be removed again when the performance
+    // bottlenecks are sorted out
+    if (comphelper::LibreOfficeKit::isActive())
+        nCurY = std::min(nCurY, MAXTILEDROW);
+
     HideAllCursors();
 
     // switch of active now in AlignToCursor


More information about the Libreoffice-commits mailing list