sc/inc/document.hxx              |    3 +++
 sc/source/core/data/documen2.cxx |   15 +++++++++++++++
 sc/source/ui/unoobj/docuno.cxx   |    2 +-
 sc/source/ui/view/gridwin4.cxx   |    2 +-
 4 files changed, 20 insertions(+), 2 deletions(-)

New commits:
commit 44a534ab8706f78dd812a4cf68123963a52035af
Author: Jan Holesovsky <ke...@collabora.com>
Date:   Mon Jun 22 15:47:44 2015 +0200

    sc tiled rendering: Set some minimal size of the document.
    
    Let's default to 12x36 cells.
    
    Change-Id: Ic39739ec036a6e5867d31b7e05b6da12ce2e46d2
    Reviewed-on: https://gerrit.libreoffice.org/16413
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 7ea90f1..69e6f5b 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1157,6 +1157,9 @@ public:
                                         SCROW& rEndRow, bool bNotes = true ) 
const;
     void            InvalidateTableArea();
 
+    /// Return the number of colums / rows that should be visible for the 
tiled rendering.
+    SC_DLLPUBLIC bool           GetTiledRenderingArea(SCTAB nTab, SCCOL& 
rEndCol, SCROW& rEndRow) const;
+
     SC_DLLPUBLIC bool           GetDataStart( SCTAB nTab, SCCOL& rStartCol, 
SCROW& rStartRow ) const;
 
     /**
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index eeec6ef..8d3e4e3 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -706,6 +706,21 @@ bool ScDocument::GetDataStart( SCTAB nTab, SCCOL& 
rStartCol, SCROW& rStartRow )
     return false;
 }
 
+bool ScDocument::GetTiledRenderingArea(SCTAB nTab, SCCOL& rEndCol, SCROW& 
rEndRow) const
+{
+    if (!GetPrintArea(nTab, rEndCol, rEndRow, false))
+        return false;
+
+    // we need some reasonable minimal document size
+    if (rEndCol < 12)
+        rEndCol = 12;
+
+    if (rEndRow < 36)
+        rEndRow = 36;
+
+    return true;
+}
+
 bool ScDocument::MoveTab( SCTAB nOldPos, SCTAB nNewPos, ScProgress* pProgress )
 {
     if (nOldPos == nNewPos)
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index a195b8a..5375176 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -523,7 +523,7 @@ Size ScModelObj::getDocumentSize()
     SCROW nEndRow = 0;
     const ScDocument& rDoc = pDocShell->GetDocument();
 
-    if (!rDoc.GetPrintArea( nTab, nEndCol, nEndRow, false ))
+    if (!rDoc.GetTiledRenderingArea(nTab, nEndCol, nEndRow))
         return aSize;
 
     // convert to twips
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 3919ca5..ceaf3d8 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -971,7 +971,7 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
     SCROW nStartRow = 0, nEndRow = 0;
 
     // size of the document including drawings, charts, etc.
-    pDoc->GetPrintArea(nTab, nEndCol, nEndRow, false);
+    pDoc->GetTiledRenderingArea(nTab, nEndCol, nEndRow);
 
     double fPPTX = pViewData->GetPPTX();
     double fPPTY = pViewData->GetPPTY();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to