summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2016-06-01 14:24:12 -0400
committerJan Holesovsky <kendy@collabora.com>2017-02-09 09:56:50 +0100
commitf5e330abbf3d8cd9625b29fcc228a742b35aa657 (patch)
treea8fa03bf247005fc2903e0a863e39e93fc3ca025 /sc
parent5b19a738ed7aa943cc05a313dbed7b45ec081d95 (diff)
sc lok: Limit number of row with LOK to 1000 rows.
Change-Id: Ic7fe2dec012efb8ba180feb4d3df6f4bfbf6c38a
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/address.hxx2
-rw-r--r--sc/source/ui/view/gridwin.cxx11
-rw-r--r--sc/source/ui/view/tabview3.cxx16
3 files changed, 27 insertions, 2 deletions
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index 7afbfa1d7571..05f62b4d7110 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 2aca621c5878..66c05b54f52d 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 98bdecf322f5..653e47578539 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