summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-09-30 15:24:25 +0100
committerAndrzej Hunt <andrzej.hunt@collabora.com>2014-09-30 15:24:25 +0100
commit50933a27ca77d753d80b1bf47e2adc30b0e655e5 (patch)
tree176dbedf6055f029adbe20ffd7dc04b869bedfda
parentc03104e7e62d8ec9cfe3ee05fa9824b46260f8d6 (diff)
Adjust MapModes for gridwin tiled rendering.
Change-Id: I8d31521d6b22f375c6de413f2070746f4758a431
-rw-r--r--sc/source/ui/view/gridwin4.cxx29
1 files changed, 21 insertions, 8 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 8816e648db14..b8d36f9a44f1 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -643,8 +643,21 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
bEditMode = false;
}
+ // For tiled rendering we have already prepared the pixel map mode in PaintTile, and need
+ // to make sure that we don't overwrite the origin (however for normal rendering
+ // we specifically need to make sure that we do set this mode).
+ const MapMode aPixelMode = (pOutDev == this ) ? MapMode(MAP_PIXEL) : pOutDev->GetMapMode();
+
+
// define drawing layer map mode and paint rectangle
- const MapMode aDrawMode = GetDrawMapMode();
+ MapMode aDrawModeInitial = GetDrawMapMode();
+ if ( pOutDev != this )
+ {
+ aDrawModeInitial.SetOrigin( Point() );
+ aDrawModeInitial.SetOrigin( pOutDev->PixelToLogic( aPixelMode.GetOrigin(),
+ aDrawModeInitial ) );
+ }
+ const MapMode aDrawMode = aDrawModeInitial;
Rectangle aDrawingRectLogic;
{
@@ -711,7 +724,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(aPixelMode);
Rectangle aPixRect = Rectangle( Point(), GetOutputSizePixel() );
pContentDev->SetFillColor( rColorCfg.GetColorValue(svtools::APPBACKGROUND).nColor );
@@ -748,7 +761,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
if ( rDoc.HasBackgroundDraw( nTab, aDrawingRectLogic ) )
{
- pContentDev->SetMapMode(MAP_PIXEL);
+ pContentDev->SetMapMode(aPixelMode);
aOutputData.DrawClear();
// Drawing Hintergrund
@@ -759,7 +772,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
else
aOutputData.SetSolidBackground(true);
- pContentDev->SetMapMode(MAP_PIXEL);
+ pContentDev->SetMapMode(aPixelMode);
aOutputData.DrawDocumentBackground();
if ( bGridFirst && ( bGrid || bPage ) )
@@ -792,7 +805,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(aPixelMode);
// Autofilter- und Pivot-Buttons
@@ -854,7 +867,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
}
}
- pContentDev->SetMapMode(MAP_PIXEL);
+ pContentDev->SetMapMode(aPixelMode);
if ( pViewData->IsRefMode() && nTab >= pViewData->GetRefStartZ() && nTab <= pViewData->GetRefEndZ() )
{
@@ -915,7 +928,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(aPixelMode);
SCCOL nCol1 = pViewData->GetEditStartCol();
SCROW nRow1 = pViewData->GetEditStartRow();
SCCOL nCol2 = pViewData->GetEditEndCol();
@@ -931,7 +944,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(aPixelMode);
}
if (pViewData->HasEditView(eWhich))