[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - 2 commits - drawinglayer/source solenv/clang-format
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Sat May 2 21:39:41 UTC 2020
drawinglayer/source/processor2d/helperwrongspellrenderer.cxx | 65 +++++------
drawinglayer/source/processor2d/helperwrongspellrenderer.hxx | 33 ++---
solenv/clang-format/blacklist | 2
3 files changed, 47 insertions(+), 53 deletions(-)
New commits:
commit 6221733197ee13ea4792d3f7004322b0e0df43c1
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat May 2 23:38:44 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat May 2 23:38:44 2020 +0200
remove helperwrongspellrenderer.{cxx,hxx} from clang-format blacklist
Change-Id: Ib0b1f389189012ab27dd061481737ac6a6a1a84e
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
commit 5000e596bc6734ac3974e7c46c666cf2b90528ec
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat May 2 23:35:27 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat May 2 23:35:27 2020 +0200
pragma once in helperwrongspellrenderer.hxx
Change-Id: I25aac069b9212824fee50240a1b6682bf7e6f0f7
diff --git a/drawinglayer/source/processor2d/helperwrongspellrenderer.hxx b/drawinglayer/source/processor2d/helperwrongspellrenderer.hxx
index 08210a4b02d7..9ca43f705c1f 100644
--- a/drawinglayer/source/processor2d/helperwrongspellrenderer.hxx
+++ b/drawinglayer/source/processor2d/helperwrongspellrenderer.hxx
@@ -17,24 +17,19 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_DRAWINGLAYER_SOURCE_PROCESSOR2D_HELPERWRONGSPELLRENDERER_HXX
-#define INCLUDED_DRAWINGLAYER_SOURCE_PROCESSOR2D_HELPERWRONGSPELLRENDERER_HXX
-
-
-// predefines
+#pragma once
class OutputDevice;
-namespace drawinglayer { namespace primitive2d {
+namespace drawinglayer::primitive2d {
class WrongSpellPrimitive2D;
-}}
+}
namespace basegfx {
class B2DHomMatrix;
class BColorModifierStack;
}
-
// support WrongSpell rendering using VCL from primitives due to VCLs nice
// and fast solution with wavelines
@@ -48,7 +43,4 @@ namespace drawinglayer
} // end of namespace drawinglayer
-
-#endif // INCLUDED_DRAWINGLAYER_SOURCE_PROCESSOR2D_HELPERWRONGSPELLRENDERER_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list