sc/source/ui/view/gridwin4.cxx |    3 ++-
 sc/source/ui/view/output.cxx   |   11 ++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 682d5eab3068a7889590b86120a6cfdec87f6d1f
Author: Krisztian Pinter <pin.termina...@gmail.com>
Date:   Fri May 29 20:03:33 2015 +0100

    calc mapmode: Refactor DrawDocumentBackground to use logic units
    
    Change-Id: I316e51bac78981263bfbee55ea5b684a40b44afa

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index bfda05a..de54116 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 9dfc3b7..4b33d2e 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 {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to