summaryrefslogtreecommitdiff
path: root/svx
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 /svx
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 'svx')
-rw-r--r--svx/source/fmcomp/fmgridcl.cxx4
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanelBase.cxx4
-rw-r--r--svx/source/svdraw/svdibrow.cxx3
-rw-r--r--svx/source/svdraw/svdocapt.cxx3
-rw-r--r--svx/source/table/tablecontroller.cxx5
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx5
-rw-r--r--svx/source/xml/xmlxtimp.cxx3
7 files changed, 27 insertions, 0 deletions
diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx
index ebbe12f2b96f..a96e8d984a5d 100644
--- a/svx/source/fmcomp/fmgridcl.cxx
+++ b/svx/source/fmcomp/fmgridcl.cxx
@@ -777,8 +777,12 @@ void FmGridHeader::PreExecuteColumnContextMenu(sal_uInt16 nColId, PopupMenu& rMe
}
}
+namespace {
+
enum InspectorAction { eOpenInspector, eCloseInspector, eUpdateInspector, eNone };
+}
+
void FmGridHeader::PostExecuteColumnContextMenu(sal_uInt16 nColId, const PopupMenu& rMenu, sal_uInt16 nExecutionResult)
{
Reference< css::container::XIndexContainer > xCols(static_cast<FmGridControl*>(GetParent())->GetPeer()->getColumns());
diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
index a4388ce61232..d83a9a08ae66 100644
--- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
@@ -45,6 +45,8 @@ const char UNO_SIDEBARGRADIENT[] = ".uno:sidebargradient";
namespace svx { namespace sidebar {
+namespace {
+
enum eFillStyle
{
NONE,
@@ -55,6 +57,8 @@ enum eFillStyle
PATTERN
};
+}
+
const sal_Int32 AreaPropertyPanelBase::DEFAULT_CENTERX = 50;
const sal_Int32 AreaPropertyPanelBase::DEFAULT_CENTERY = 50;
const sal_Int32 AreaPropertyPanelBase::DEFAULT_ANGLE = 0;
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index a19219d6f7cb..a08d358530a5 100644
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -74,6 +74,8 @@ using namespace com::sun::star;
#define ITEM_NOT_FOUND std::numeric_limits<std::size_t>::max()
+namespace {
+
enum class ItemType {
DONTKNOW, BYTE, INT16, UINT16, INT32, UINT32,
ENUM, BOOL, FLAG, STRING, POINT, RECT, RANGE,
@@ -83,6 +85,7 @@ enum class ItemType {
FONT, FONTHEIGHT, FONTWIDTH, FIELD
};
+}
class ImpItemListRow
{
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index b4714c9e9ee5..ea96430322c0 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -63,9 +63,12 @@
#include <vcl/canvastools.hxx>
#include <vcl/ptrstyle.hxx>
+namespace {
enum EscDir {LKS,RTS,OBN,UNT};
+}
+
class ImpCaptParams
{
public:
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index ffd6ca9f1e90..d4c5ab1ad43b 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -88,6 +88,8 @@ using namespace ::com::sun::star::container;
using namespace ::com::sun::star::text;
using namespace ::com::sun::star::style;
+namespace {
+
enum class CellPosFlag // signals the relative position of a cell to a selection
{
NONE = 0x0000, // not set or inside
@@ -102,6 +104,9 @@ enum class CellPosFlag // signals the relative position of a cell to a selectio
Bottom = 0x0040,
Lower = 0x0080
};
+
+}
+
namespace o3tl
{ template<> struct typed_flags<CellPosFlag> : is_typed_flags<CellPosFlag, 0xff> {}; }
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 1b8d6fe09092..782dd2cc16cb 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2427,6 +2427,8 @@ void SvxFrameWindow_Impl::DataChanged( const DataChangedEvent& rDCEvt )
}
}
+namespace {
+
enum class FrmValidFlags {
NONE = 0x00,
Left = 0x01,
@@ -2437,6 +2439,9 @@ enum class FrmValidFlags {
VInner = 0x20,
AllMask = 0x3f,
};
+
+}
+
namespace o3tl {
template<> struct typed_flags<FrmValidFlags> : is_typed_flags<FrmValidFlags, 0x3f> {};
}
diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx
index c9b5ecf6481a..4fbed121ddc5 100644
--- a/svx/source/xml/xmlxtimp.cxx
+++ b/svx/source/xml/xmlxtimp.cxx
@@ -66,8 +66,11 @@ using namespace com::sun::star::xml::sax;
using namespace ::xmloff::token;
using namespace cppu;
+namespace {
+
enum class SvxXMLTableImportContextEnum { Color, Marker, Dash, Hatch, Gradient, Bitmap };
+}
class SvxXMLTableImportContext : public SvXMLImportContext
{