diff options
author | Krisztian Pinter <pin.terminator@gmail.com> | 2015-05-29 20:03:33 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2015-06-03 17:41:08 +0200 |
commit | 682d5eab3068a7889590b86120a6cfdec87f6d1f (patch) | |
tree | 4a8a7e37a5dba1373e2f45b1994e68f3f31f7a80 /sc/source | |
parent | 9eb16c85d6af4b73de9a75716c3ff34f929f26b2 (diff) |
calc mapmode: Refactor DrawDocumentBackground to use logic units
Change-Id: I316e51bac78981263bfbee55ea5b684a40b44afa
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/view/output.cxx | 11 |
2 files changed, 8 insertions, 6 deletions
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 { |