summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-11-16 21:00:53 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-11-17 00:28:17 +0100
commit314f15bff08b76bf96acf99141776ef64d2f1355 (patch)
tree842f7b109d9c4a57fa47fc5089f5818b2610368b /drawinglayer
parent46920005f74edcb70acfb8dd1a0ffb9553e5c2b2 (diff)
Extend loplugin:external to warn about enums
To mitigate the dangers of silently breaking ADL when moving enums into unnamed namespaces (see the commit message of 206b5b2661be37efdff3c6aedb6f248c4636be79 "New loplugin:external"), note all functions that are affected. (The plan is to extend loplugin:external further to also warn about classes and class templates, and the code to identify affected functions already takes that into account, so some parts of that code are not actually relevant for enums.) But it appears that none of the functions that are actually affected by the changes in this commit relied on being found through ADL, so no adaptions were necessary for them. (clang::DeclContext::collectAllContexts is non-const, which recursively means that External's Visit... functions must take non-const Decl*. Which required compilerplugins/clang/sharedvisitor/analyzer.cxx to be generalized to support such Visit... functions with non-const Decl* parameters.) Change-Id: Ia215291402bf850d43defdab3cff4db5b270d1bd Reviewed-on: https://gerrit.libreoffice.org/83001 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/tools/emfphelperdata.cxx4
-rw-r--r--drawinglayer/source/tools/emfppen.cxx4
2 files changed, 8 insertions, 0 deletions
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx
index b72c026bc6fe..debbf5c0add1 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -104,6 +104,8 @@ namespace emfplushelper
{
}
+ namespace {
+
typedef enum
{
StringAlignmentNear = 0x00000000,
@@ -111,6 +113,8 @@ namespace emfplushelper
StringAlignmentFar = 0x00000002
} StringAlignment;
+ }
+
float EmfPlusHelperData::getUnitToPixelMultiplier(const UnitType aUnitType)
{
switch (aUnitType)
diff --git a/drawinglayer/source/tools/emfppen.cxx b/drawinglayer/source/tools/emfppen.cxx
index 039a5c02d612..85a5e176c1f3 100644
--- a/drawinglayer/source/tools/emfppen.cxx
+++ b/drawinglayer/source/tools/emfppen.cxx
@@ -28,6 +28,8 @@ using namespace ::basegfx;
namespace emfplushelper
{
+ namespace {
+
enum EmfPlusPenData
{
PenDataTransform = 0x00000001,
@@ -45,6 +47,8 @@ namespace emfplushelper
PenDataCustomEndCap = 0x00001000
};
+ }
+
EMFPPen::EMFPPen()
: EMFPBrush()
, penDataFlags(0)