Kaydet (Commit) 44a534ab authored tarafından Jan Holesovsky's avatar Jan Holesovsky Kaydeden (comit) Miklos Vajna

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/16413Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst 783361da
......@@ -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;
/**
......
......@@ -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)
......
......@@ -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
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment