[Libreoffice-commits] .: sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Oct 12 08:12:20 PDT 2012


 sc/source/ui/view/output.cxx |   30 ++++++++++++++++++++++++++----
 1 file changed, 26 insertions(+), 4 deletions(-)

New commits:
commit a551cad4e35b6b664167d65dfc25e5a0f6990687
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Fri Oct 12 11:07:13 2012 -0400

    Always disable anti-aliasing for drawing cell borders.
    
    It looks better that way & that's the way it was before.
    
    Change-Id: Iedb5234f4b032d4362f91f811bb9131824267704

diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 1922a08..24b4fca 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -33,6 +33,7 @@
 #include <editeng/brshitem.hxx>
 #include <editeng/editdata.hxx>
 #include <svtools/colorcfg.hxx>
+#include "svtools/optionsdrawinglayer.hxx"
 #include <svx/rotmodit.hxx>
 #include <editeng/shaditem.hxx>
 #include <editeng/svxfont.hxx>
@@ -1237,10 +1238,7 @@ void ScOutputData::DrawClear()
     }
 }
 
-
-//
-//  Linien
-//
+namespace {
 
 long lclGetSnappedX( OutputDevice& rDev, long nPosX, bool bSnapPixel )
 {
@@ -1257,8 +1255,32 @@ size_t lclGetArrayColFromCellInfoX( sal_uInt16 nCellInfoX, sal_uInt16 nCellInfoF
     return static_cast< size_t >( bRTL ? (nCellInfoLastX + 2 - nCellInfoX) : (nCellInfoX - nCellInfoFirstX) );
 }
 
+/**
+ * Temporarily turn off antialiasing.
+ */
+class AntiAliasingSwitch
+{
+    SvtOptionsDrawinglayer maDrawOpt;
+    bool mbOldSetting;
+public:
+    AntiAliasingSwitch(bool bOn) : mbOldSetting(maDrawOpt.IsAntiAliasing())
+    {
+        maDrawOpt.SetAntiAliasing(bOn);
+    }
+
+    ~AntiAliasingSwitch()
+    {
+        maDrawOpt.SetAntiAliasing(mbOldSetting);
+    }
+};
+
+}
+
 void ScOutputData::DrawFrame()
 {
+    // No anti-aliasing for drawing cell borders.
+    AntiAliasingSwitch aAASwitch(false);
+
     sal_uLong nOldDrawMode = mpDev->GetDrawMode();
 
     Color aSingleColor;


More information about the Libreoffice-commits mailing list