summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-08-14 10:55:09 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-08-14 10:55:09 -0400
commitaab7a316dc127f71e530552cebfb34d5b8f5fa19 (patch)
treef0022dc484998012ec7f9e8b2a16671fe3387c9b
parentdde3a753cead04915259d3fde0e913096f1a3922 (diff)
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.
-rw-r--r--sc/source/ui/view/output.cxx30
1 files changed, 26 insertions, 4 deletions
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 1e87dc6e4e51..37b8c3166c03 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;