summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-08-27 20:44:50 +0200
committerAndrzej Hunt <andrzej.hunt@collabora.com>2014-08-30 21:37:16 +0200
commit74f35e1f7aca1ffa003e78827f4a9acd665f38b8 (patch)
tree9edcbd8587374d016bcc3b060ca9f9594f99096b
parent1d48c84f2d5f3efa9106914add7a5f94c77b64cf (diff)
Ensure we keep our modified OutputDevice origin.
This is needed for TiledRendering which treats the sheet as one continuous area rather than the what's-on-screen assumptions of the usual rendering method. Change-Id: Ibebba72f8b5fcba75a8f78ccfa6473d2de2df5fa
-rw-r--r--sc/source/ui/view/gridwin4.cxx23
1 files changed, 15 insertions, 8 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 140a84273ad2..c6e7168d28c3 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -463,6 +463,9 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
pOutDev = this;
}
+ MapMode aPixelMapMode = MapMode( MAP_PIXEL );
+ aPixelMapMode.SetOrigin( pOutDev->GetMapMode().GetOrigin() );
+
ScModule* pScMod = SC_MOD();
bool bTextWysiwyg = pScMod->GetInputOptions().GetTextWysiwyg();
@@ -648,7 +651,11 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
}
// define drawing layer map mode and paint rectangle
- const MapMode aDrawMode = GetDrawMapMode();
+ MapMode aDrawMode = pViewData->GetPaintMapMode();
+ Point aOrigin = aPixelMapMode.GetOrigin();
+ aDrawMode.SetMapUnit( MAP_100TH_MM );
+ aDrawMode.SetOrigin( pOutDev->PixelToLogic( aOrigin, aDrawMode ) );
+
Rectangle aDrawingRectLogic;
{
@@ -715,7 +722,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
{
// save MapMode and set to pixel
MapMode aCurrentMapMode(pContentDev->GetMapMode());
- pContentDev->SetMapMode(MAP_PIXEL);
+ pContentDev->SetMapMode(aPixelMapMode);
Rectangle aPixRect = Rectangle( Point(), GetOutputSizePixel() );
pContentDev->SetFillColor( rColorCfg.GetColorValue(svtools::APPBACKGROUND).nColor );
@@ -752,7 +759,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
if ( rDoc.HasBackgroundDraw( nTab, aDrawingRectLogic ) )
{
- pContentDev->SetMapMode(MAP_PIXEL);
+ pContentDev->SetMapMode(aPixelMapMode);
aOutputData.DrawClear();
// Drawing Hintergrund
@@ -763,7 +770,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
else
aOutputData.SetSolidBackground(true);
- pContentDev->SetMapMode(MAP_PIXEL);
+ pContentDev->SetMapMode(aPixelMapMode);
aOutputData.DrawDocumentBackground();
if ( bGridFirst && ( bGrid || bPage ) )
@@ -796,7 +803,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
if ( bLogicText )
aOutputData.DrawStrings(true); // in logic MapMode if bTextWysiwyg is set
aOutputData.DrawEdit(true);
- pContentDev->SetMapMode(MAP_PIXEL);
+ pContentDev->SetMapMode(aPixelMapMode);
// Autofilter- und Pivot-Buttons
@@ -858,7 +865,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
}
}
- pContentDev->SetMapMode(MAP_PIXEL);
+ pContentDev->SetMapMode(aPixelMapMode);
if ( pViewData->IsRefMode() && nTab >= pViewData->GetRefStartZ() && nTab <= pViewData->GetRefEndZ() )
{
@@ -919,7 +926,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
if ( bEditMode && (pViewData->GetRefTabNo() == pViewData->GetTabNo()) )
{
//! use pContentDev for EditView?
- SetMapMode(MAP_PIXEL);
+ SetMapMode(aPixelMapMode);
SCCOL nCol1 = pViewData->GetEditStartCol();
SCROW nRow1 = pViewData->GetEditStartRow();
SCCOL nCol2 = pViewData->GetEditEndCol();
@@ -935,7 +942,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
SetMapMode(pViewData->GetLogicMode());
pEditView->Paint( pOutDev->PixelToLogic( Rectangle( Point( nScrX, nScrY ),
Size( aOutputData.GetScrW(), aOutputData.GetScrH() ) ) ) );
- SetMapMode(MAP_PIXEL);
+ SetMapMode(aPixelMapMode);
}
if (pViewData->HasEditView(eWhich))