[Libreoffice-commits] core.git: sc/source

Kohei Yoshida kohei.yoshida at gmail.com
Wed Aug 14 07:56:35 PDT 2013


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

New commits:
commit aab7a316dc127f71e530552cebfb34d5b8f5fa19
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Wed Aug 14 10:55:09 2013 -0400

    Revert "Revert "Always disable anti-aliasing for drawing cell borders." fdo#60805"
    
    This reverts commit 46d122d4cc405c4070eb4945abd20cdf3a5fac33.
    
    Unfortunately this re-introduces the previous problem of the cell borders
    drawn too thick when anti-aliasing is enabled.  Also, even with this reverted
    the problem will still persist if the user manually disables anti-aliasing
    in the Options dialog. So, we *do* need to find a way to draw the
    double-borders etc correctly without anti-aliasing.

diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 1e87dc6..37b8c31 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -24,6 +24,7 @@
 #include <editeng/brushitem.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>
@@ -1272,10 +1273,7 @@ void ScOutputData::DrawClear()
     }
 }
 
-
-//
-//  Linien
-//
+namespace {
 
 long lclGetSnappedX( OutputDevice& rDev, long nPosX, bool bSnapPixel )
 {
@@ -1292,8 +1290,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