diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-05-02 23:38:44 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-05-04 08:43:03 +0200 |
commit | e4f72f84661fba50937891e28f73f6661edaa21e (patch) | |
tree | 180a862b6c36703c3fa32c70a45af056c3a34ecb /drawinglayer | |
parent | a57a6d145f7c91cc1ba51f73ea7be217f5837be7 (diff) |
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@gmail.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/processor2d/helperwrongspellrenderer.cxx | 65 | ||||
-rw-r--r-- | drawinglayer/source/processor2d/helperwrongspellrenderer.hxx | 21 |
2 files changed, 45 insertions, 41 deletions
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 |