summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-09-30 16:12:56 +0100
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-01-12 12:29:30 +0900
commitfc8c9d672cf6e60ac298712c191e0714f2cb800d (patch)
tree84c4e7c7f134e7787ab01490b9936e1515f1140c
parent4684a28ed9cf728d83a6c145ae7fe3bdbfdad67d (diff)
Don't render infinitely large document if empty.
Change-Id: I887d8cef0c24b1e5155969a9f571660ca54ef463
-rw-r--r--sc/source/ui/view/gridwin4.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 0ede2696e364..e9fc6332fa55 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -410,6 +410,13 @@ Size ScGridWindow::GetDataAreaSize()
// Actual data area
pDoc->ShrinkToDataArea( nTab,
nStartCol, nStartRow, nEndCol, nEndRow );
+ // We need to ensure we have at least one cell, since a 0x0 document
+ // cannot be rendered. If we have no content then ShrinkToDataArea simply
+ // leaves nEndCol/Row at MAXCOL/ROW.
+ if ( nEndCol == MAXCOL )
+ nEndCol = 1;
+ if ( nEndRow == MAXROW )
+ nEndRow = 1;
// Drawing layer area -- is completely independent of the data area.
ScTabViewShell* pTabViewShell = pViewData->GetViewShell();