diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-11-16 21:00:53 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-11-17 00:28:17 +0100 |
commit | 314f15bff08b76bf96acf99141776ef64d2f1355 (patch) | |
tree | 842f7b109d9c4a57fa47fc5089f5818b2610368b /sfx2/source | |
parent | 46920005f74edcb70acfb8dd1a0ffb9553e5c2b2 (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 'sfx2/source')
-rw-r--r-- | sfx2/source/control/unoctitm.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 3 |
3 files changed, 12 insertions, 0 deletions
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index f8e1b2821b6b..496ea66b497f 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -82,6 +82,8 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; +namespace { + enum URLTypeId { URLType_BOOL, @@ -95,6 +97,8 @@ enum URLTypeId URLType_COUNT }; +} + const char* const URLTypeNames[URLType_COUNT] = { "bool", diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index e5fad08ec881..c5a350afa608 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -815,7 +815,12 @@ static bool lcl_isSystemFilePicker( const uno::Reference< XFilePicker3 >& _rxFP return false; } +namespace { + enum open_or_save_t {OPEN, SAVE, UNDEFINED}; + +} + static open_or_save_t lcl_OpenOrSave(sal_Int16 const nDialogType) { switch (nDialogType) diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index a0598191f3f7..1c7638349b79 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -298,6 +298,7 @@ static OUString impl_retrieveFilterNameFromTypeAndModule( return aFoundFilterName; } +namespace { /** search for an internal typename, which map to the current app module and map also to a "family" of file formats as e.g. PDF/MS Doc/OOo Doc. @@ -308,6 +309,8 @@ enum ETypeFamily E_OOO_DOC }; +} + static OUString impl_searchFormatTypeForApp(const css::uno::Reference< css::frame::XFrame >& xFrame , ETypeFamily eTypeFamily) { |