summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-08-15 16:46:11 +0200
committerAndrzej Hunt <andrzej.hunt@collabora.com>2014-08-30 21:37:08 +0200
commit0a9bd8f7c8a9cb20867e51b67730f1b9923b0cb4 (patch)
tree38bb48952f35e9851a41c2aee672c07cc019b443
parent9764a44eaa0c3bcd81deedeeb153034be05cbe44 (diff)
ScOutputData needs ScViewData for scaling.
Change-Id: I14cd3e835ba8233478514d5f6832737aa2c99bf9
-rw-r--r--sc/source/ui/inc/output.hxx7
-rw-r--r--sc/source/ui/view/gridwin.cxx2
-rw-r--r--sc/source/ui/view/gridwin4.cxx2
-rw-r--r--sc/source/ui/view/output.cxx2
-rw-r--r--sc/source/ui/view/printfun.cxx6
5 files changed, 14 insertions, 5 deletions
diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx
index ffb0e1504fa0..dc1fb93c83a7 100644
--- a/sc/source/ui/inc/output.hxx
+++ b/sc/source/ui/inc/output.hxx
@@ -48,6 +48,7 @@ class ScTabViewShell;
class ScPageBreakData;
class FmFormView;
class ScFieldEditEngine;
+class ScViewData;
class SdrPaintWindow;
#define SC_SCENARIO_HSPACE 60
@@ -143,6 +144,11 @@ private:
OutputDevice* mpDev; // Device
OutputDevice* mpRefDevice; // printer if used for preview
OutputDevice* pFmtDevice; // reference for text formatting
+
+ // This may be NULL -- i.e. it should be used when available,
+ // but otherwise ignored.
+ ScViewData* mpViewData;
+
ScTableInfo& mrTabInfo;
RowInfo* pRowInfo; // Info block
SCSIZE nArrCount; // occupied lines in info block
@@ -258,6 +264,7 @@ private:
public:
ScOutputData( OutputDevice* pNewDev, ScOutputType eNewType,
+ ScViewData* pViewData,
ScTableInfo& rTabInfo, ScDocument* pNewDoc,
SCTAB nNewTab, long nNewScrX, long nNewScrY,
SCCOL nNewX1, SCROW nNewY1, SCCOL nNewX2, SCROW nNewY2,
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index e405524aa874..d1e77924bbf5 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -4657,7 +4657,7 @@ void ScGridWindow::UpdateFormulas()
Fraction aZoomX = pViewData->GetZoomX();
Fraction aZoomY = pViewData->GetZoomY();
- ScOutputData aOutputData( this, OUTTYPE_WINDOW, aTabInfo, &rDoc, nTab,
+ ScOutputData aOutputData( this, OUTTYPE_WINDOW, pViewData, aTabInfo, &rDoc, nTab,
nScrX, nScrY, nX1, nY1, nX2, nY2, nPPTX, nPPTY,
&aZoomX, &aZoomY );
aOutputData.SetMirrorWidth( nMirrorWidth );
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 961370a6de99..b446ffef02b5 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -533,7 +533,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
Fraction aZoomX = pViewData->GetZoomX();
Fraction aZoomY = pViewData->GetZoomY();
- ScOutputData aOutputData( pOutDev, OUTTYPE_WINDOW, aTabInfo, &rDoc, nTab,
+ ScOutputData aOutputData( pOutDev, OUTTYPE_WINDOW, pViewData, aTabInfo, &rDoc, nTab,
nScrX, nScrY, nX1, nY1, nX2, nY2, nPPTX, nPPTY,
&aZoomX, &aZoomY );
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 6b19602ec53a..97bb09cdf3dc 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -141,6 +141,7 @@ void ScActionColorChanger::Update( const ScChangeAction& rAction )
}
ScOutputData::ScOutputData( OutputDevice* pNewDev, ScOutputType eNewType,
+ ScViewData* pViewData,
ScTableInfo& rTabInfo, ScDocument* pNewDoc,
SCTAB nNewTab, long nNewScrX, long nNewScrY,
SCCOL nNewX1, SCROW nNewY1, SCCOL nNewX2, SCROW nNewY2,
@@ -149,6 +150,7 @@ ScOutputData::ScOutputData( OutputDevice* pNewDev, ScOutputType eNewType,
mpDev( pNewDev ),
mpRefDevice( pNewDev ), // default is output device
pFmtDevice( pNewDev ), // default is output device
+ mpViewData( pViewData ),
mrTabInfo( rTabInfo ),
pRowInfo( rTabInfo.mpRowInfo ),
nArrCount( rTabInfo.mnArrCount ),
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 129486f07c0b..3ceb6d713780 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -509,7 +509,7 @@ void ScPrintFunc::DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double /* nPr
long nAddY = (long)( aLines.Top() * nScaleY );
nScrY += ( nAddY ? nAddY : 1 );
- ScOutputData aOutputData( pDev, OUTTYPE_PRINTER, aTabInfo, pDoc, nTab,
+ ScOutputData aOutputData( pDev, OUTTYPE_PRINTER, pViewData, aTabInfo, pDoc, nTab,
nScrX, nScrY, nX1, nY1, nX2, nY2, nScaleX, nScaleY );
aOutputData.SetMetaFileMode(bMetaFile);
aOutputData.SetShowNullValues(bNullVal);
@@ -1344,7 +1344,7 @@ void ScPrintFunc::DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH,
aTabInfo.mpRowInfo[0].pCellInfo[1].nWidth =
aTabInfo.mpRowInfo[1].pCellInfo[1].nWidth = (sal_uInt16) nEffWidth;
- ScOutputData aOutputData( pDev, OUTTYPE_PRINTER, aTabInfo, pBorderDoc.get(), 0,
+ ScOutputData aOutputData( pDev, OUTTYPE_PRINTER, 0, aTabInfo, pBorderDoc.get(), 0,
nScrX+nLeft, nScrY+nTop, 0,0, 0,0, nScaleX, nScaleY );
aOutputData.SetUseStyleColor( bUseStyleColor );
@@ -1559,7 +1559,7 @@ void ScPrintFunc::PrintArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
if (bEmbed)
pDoc->SetEmbedded(aERange);
- ScOutputData aOutputData( pDev, OUTTYPE_PRINTER, aTabInfo, pDoc, nPrintTab,
+ ScOutputData aOutputData( pDev, OUTTYPE_PRINTER, 0, aTabInfo, pDoc, nPrintTab,
nScrX, nScrY, nX1, nY1, nX2, nY2, nScaleX, nScaleY );
// #114135#