[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.0' - sc/inc sc/source
Jan Holesovsky
kendy at collabora.com
Mon Jun 22 06:51:29 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 11244e5bbc6eabf9b1402235729024adbbc36f27
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 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 36de586..cfeaf2b 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 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();
More information about the Libreoffice-commits
mailing list