[Libreoffice-commits] core.git: drawinglayer/source solenv/clang-format

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Mon May 4 06:43:40 UTC 2020


 drawinglayer/source/processor2d/helperwrongspellrenderer.cxx |   65 +++++------
 drawinglayer/source/processor2d/helperwrongspellrenderer.hxx |   21 +--
 solenv/clang-format/blacklist                                |    2 
 3 files changed, 45 insertions(+), 43 deletions(-)

New commits:
commit e4f72f84661fba50937891e28f73f6661edaa21e
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat May 2 23:38:44 2020 +0200
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon May 4 08:43:03 2020 +0200

    remove helperwrongspellrenderer.{cxx,hxx} from clang-format blacklist
    
    Change-Id: Ib0b1f389189012ab27dd061481737ac6a6a1a84e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93388
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/drawinglayer/source/processor2d/helperwrongspellrenderer.cxx b/drawinglayer/source/processor2d/helperwrongspellrenderer.cxx
index c359b3485bc6..83fdba7cc1f5 100644
--- a/drawinglayer/source/processor2d/helperwrongspellrenderer.cxx
+++ b/drawinglayer/source/processor2d/helperwrongspellrenderer.cxx
@@ -28,43 +28,46 @@ using namespace css;
 
 namespace drawinglayer
 {
-    bool renderWrongSpellPrimitive2D(
-        const primitive2d::WrongSpellPrimitive2D& rWrongSpellCandidate,
-        OutputDevice& rOutputDevice,
-        const basegfx::B2DHomMatrix& rObjectToViewTransformation,
-        const basegfx::BColorModifierStack& rBColorModifierStack)
-    {
-        const basegfx::B2DHomMatrix aLocalTransform(rObjectToViewTransformation * rWrongSpellCandidate.getTransformation());
-        const basegfx::B2DVector aFontVectorPixel(aLocalTransform * basegfx::B2DVector(0.0, 1.0));
-        const sal_uInt32 nFontPixelHeight(basegfx::fround(aFontVectorPixel.getLength()));
-
-        static const sal_uInt32 nMinimumFontHeight(5); // #define WRONG_SHOW_MIN         5
+bool renderWrongSpellPrimitive2D(const primitive2d::WrongSpellPrimitive2D& rWrongSpellCandidate,
+                                 OutputDevice& rOutputDevice,
+                                 const basegfx::B2DHomMatrix& rObjectToViewTransformation,
+                                 const basegfx::BColorModifierStack& rBColorModifierStack)
+{
+    const basegfx::B2DHomMatrix aLocalTransform(rObjectToViewTransformation
+                                                * rWrongSpellCandidate.getTransformation());
+    const basegfx::B2DVector aFontVectorPixel(aLocalTransform * basegfx::B2DVector(0.0, 1.0));
+    const sal_uInt32 nFontPixelHeight(basegfx::fround(aFontVectorPixel.getLength()));
 
-        if(nFontPixelHeight > nMinimumFontHeight)
-        {
-            const basegfx::B2DPoint aStart(aLocalTransform * basegfx::B2DPoint(rWrongSpellCandidate.getStart(), 0.0));
-            const basegfx::B2DPoint aStop(aLocalTransform * basegfx::B2DPoint(rWrongSpellCandidate.getStop(), 0.0));
-            const Point aVclStart(basegfx::fround(aStart.getX()), basegfx::fround(aStart.getY()));
-            const Point aVclStop(basegfx::fround(aStop.getX()), basegfx::fround(aStop.getY()));
+    static const sal_uInt32 nMinimumFontHeight(5); // #define WRONG_SHOW_MIN 5
 
-            // #i101075# draw it. Do not forget to use the evtl. offsetted origin of the target device,
-            // e.g. when used with mask/transparence buffer device
-            const Point aOrigin(rOutputDevice.GetMapMode().GetOrigin());
+    if (nFontPixelHeight > nMinimumFontHeight)
+    {
+        const basegfx::B2DPoint aStart(aLocalTransform
+                                       * basegfx::B2DPoint(rWrongSpellCandidate.getStart(), 0.0));
+        const basegfx::B2DPoint aStop(aLocalTransform
+                                      * basegfx::B2DPoint(rWrongSpellCandidate.getStop(), 0.0));
+        const Point aVclStart(basegfx::fround(aStart.getX()), basegfx::fround(aStart.getY()));
+        const Point aVclStop(basegfx::fround(aStop.getX()), basegfx::fround(aStop.getY()));
 
-            const basegfx::BColor aProcessedColor(rBColorModifierStack.getModifiedColor(rWrongSpellCandidate.getColor()));
-            const bool bMapModeEnabledState(rOutputDevice.IsMapModeEnabled());
+        // #i101075# draw it. Do not forget to use the evtl. offsetted origin of the target device,
+        // e.g. when used with mask/transparence buffer device
+        const Point aOrigin(rOutputDevice.GetMapMode().GetOrigin());
 
-            vcl::ScopedAntialiasing a(rOutputDevice, true);
-            rOutputDevice.EnableMapMode(false);
-            rOutputDevice.SetLineColor(Color(aProcessedColor));
-            rOutputDevice.SetFillColor();
-            rOutputDevice.DrawWaveLine(aOrigin + aVclStart, aOrigin + aVclStop);
-            rOutputDevice.EnableMapMode(bMapModeEnabledState);
-        }
+        const basegfx::BColor aProcessedColor(
+            rBColorModifierStack.getModifiedColor(rWrongSpellCandidate.getColor()));
+        const bool bMapModeEnabledState(rOutputDevice.IsMapModeEnabled());
 
-        // cannot really go wrong
-        return true;
+        vcl::ScopedAntialiasing a(rOutputDevice, true);
+        rOutputDevice.EnableMapMode(false);
+        rOutputDevice.SetLineColor(Color(aProcessedColor));
+        rOutputDevice.SetFillColor();
+        rOutputDevice.DrawWaveLine(aOrigin + aVclStart, aOrigin + aVclStop);
+        rOutputDevice.EnableMapMode(bMapModeEnabledState);
     }
+
+    // cannot really go wrong
+    return true;
+}
 } // end of namespace drawinglayer
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/source/processor2d/helperwrongspellrenderer.hxx b/drawinglayer/source/processor2d/helperwrongspellrenderer.hxx
index 9ca43f705c1f..886ce99bb7ff 100644
--- a/drawinglayer/source/processor2d/helperwrongspellrenderer.hxx
+++ b/drawinglayer/source/processor2d/helperwrongspellrenderer.hxx
@@ -21,13 +21,15 @@
 
 class OutputDevice;
 
-namespace drawinglayer::primitive2d {
-    class WrongSpellPrimitive2D;
+namespace drawinglayer::primitive2d
+{
+class WrongSpellPrimitive2D;
 }
 
-namespace basegfx {
-    class B2DHomMatrix;
-    class BColorModifierStack;
+namespace basegfx
+{
+class B2DHomMatrix;
+class BColorModifierStack;
 }
 
 // support WrongSpell rendering using VCL from primitives due to VCLs nice
@@ -35,11 +37,10 @@ namespace basegfx {
 
 namespace drawinglayer
 {
-    bool renderWrongSpellPrimitive2D(
-        const primitive2d::WrongSpellPrimitive2D& rWrongSpellCandidate,
-        OutputDevice& rOutputDevice,
-        const basegfx::B2DHomMatrix& rObjectToViewTransformation,
-        const basegfx::BColorModifierStack& rBColorModifierStack);
+bool renderWrongSpellPrimitive2D(const primitive2d::WrongSpellPrimitive2D& rWrongSpellCandidate,
+                                 OutputDevice& rOutputDevice,
+                                 const basegfx::B2DHomMatrix& rObjectToViewTransformation,
+                                 const basegfx::BColorModifierStack& rBColorModifierStack);
 
 } // end of namespace drawinglayer
 
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index 298745b86375..db09c4a5d8a9 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -3744,8 +3744,6 @@ drawinglayer/source/processor2d/baseprocessor2d.cxx
 drawinglayer/source/processor2d/contourextractor2d.cxx
 drawinglayer/source/processor2d/getdigitlanguage.cxx
 drawinglayer/source/processor2d/getdigitlanguage.hxx
-drawinglayer/source/processor2d/helperwrongspellrenderer.cxx
-drawinglayer/source/processor2d/helperwrongspellrenderer.hxx
 drawinglayer/source/processor2d/hittestprocessor2d.cxx
 drawinglayer/source/processor2d/linegeometryextractor2d.cxx
 drawinglayer/source/processor2d/objectinfoextractor2d.cxx


More information about the Libreoffice-commits mailing list