summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-09-30 16:12:56 +0100
committerAndrzej Hunt <andrzej.hunt@collabora.com>2014-09-30 16:12:56 +0100
commit7f947e2eec8ee34086924734396e2b0910bb1808 (patch)
tree5ffd7a1f2c552654859a5a9a480d561bde92c236
parent48df6684d55f1565cd107638ef9ccab96150ce72 (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 302bcee0ca3f..6811de48a1b8 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();