From 682d5eab3068a7889590b86120a6cfdec87f6d1f Mon Sep 17 00:00:00 2001 From: Krisztian Pinter Date: Fri, 29 May 2015 20:03:33 +0100 Subject: calc mapmode: Refactor DrawDocumentBackground to use logic units Change-Id: I316e51bac78981263bfbee55ea5b684a40b44afa --- sc/source/ui/view/gridwin4.cxx | 3 ++- sc/source/ui/view/output.cxx | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'sc/source/ui') diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index bfda05af7464..de5411635391 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -718,9 +718,10 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI else aOutputData.SetSolidBackground(true); - pContentDev->SetMapMode(MAP_PIXEL); aOutputData.DrawDocumentBackground(); + pContentDev->SetMapMode(MAP_PIXEL); + if ( bGridFirst && ( bGrid || bPage ) ) aOutputData.DrawGrid( bGrid, bPage ); diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 9dfc3b7eb4d8..4b33d2e80716 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -767,13 +767,14 @@ void ScOutputData::DrawDocumentBackground() if ( !bSolidBackground ) return; - Size aOnePixel = mpDev->PixelToLogic(Size(1,1)); - long nOneX = aOnePixel.Width(); - long nOneY = aOnePixel.Height(); - Rectangle aRect(nScrX - nOneX, nScrY - nOneY, nScrX + nScrW, nScrY + nScrH); Color aBgColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor ); + mpDev->SetLineColor(aBgColor); mpDev->SetFillColor(aBgColor); - mpDev->DrawRect(aRect); + + Point aScreenPos = mpDev->PixelToLogic(Point(nScrX, nScrY)); + Size aScreenSize = mpDev->PixelToLogic(Size(nScrW - 1,nScrH - 1)); + + mpDev->DrawRect(Rectangle(aScreenPos, aScreenSize)); } namespace { -- cgit