[Libreoffice-commits] core.git: sc/inc sc/source
Jan Holesovsky
kendy at collabora.com
Mon Jun 22 06:50:49 PDT 2015
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 418c6167cea2bc89743fecaf7d36ec99c81891cb
Author: Jan Holesovsky <kendy at 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
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 79ea555..0e6c7e3 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1161,6 +1161,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 2ee2f0f..6083452 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -518,7 +518,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 1457d9f..3523a62 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -976,7 +976,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();
More information about the Libreoffice-commits
mailing list