summaryrefslogtreecommitdiff
path: root/sc/source/ui
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 /sc/source/ui
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 'sc/source/ui')
-rw-r--r--sc/source/ui/app/inputwin.cxx4
-rw-r--r--sc/source/ui/dbgui/scuiasciiopt.cxx4
-rw-r--r--sc/source/ui/docshell/impex.cxx12
-rw-r--r--sc/source/ui/unoobj/fielduno.cxx4
-rw-r--r--sc/source/ui/view/gridwin.cxx4
-rw-r--r--sc/source/ui/view/prevloc.cxx4
-rw-r--r--sc/source/ui/view/viewfun2.cxx4
7 files changed, 36 insertions, 0 deletions
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 7d5695a63b9f..dae95abdd797 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -88,6 +88,8 @@ using com::sun::star::uno::UNO_QUERY;
using com::sun::star::frame::XLayoutManager;
using com::sun::star::beans::XPropertySet;
+namespace {
+
enum ScNameInputType
{
SC_NAME_INPUT_CELL,
@@ -102,6 +104,8 @@ enum ScNameInputType
SC_MANAGE_NAMES
};
+}
+
ScTextWndBase::ScTextWndBase( vcl::Window* pParent, WinBits nStyle )
: Window ( pParent, nStyle )
{
diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx
index 75d915438f44..2cc37704d7ac 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -42,6 +42,8 @@ const SCSIZE ASCIIDLG_MAXROWS = MAXROWCOUNT;
using namespace com::sun::star::uno;
+namespace {
+
// Defines - CSV Import Preserve Options
enum CSVImportOptionsIndex
{
@@ -59,6 +61,8 @@ enum CSVImportOptionsIndex
CSVIO_PasteSkipEmptyCells
};
+}
+
const ::std::vector<OUString> CSVImportOptionNames =
{
"MergeDelimiters",
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 7015c16a8fdc..317fc2e0d642 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -85,6 +85,8 @@ namespace
}
}
+namespace {
+
enum class SylkVersion
{
SCALC3, // Wrote wrongly quoted strings and unescaped semicolons.
@@ -93,6 +95,8 @@ enum class SylkVersion
OTHER // Assume that aliens wrote correct strings.
};
+}
+
// Whole document without Undo
ScImportExport::ScImportExport( ScDocument* p )
: pDocSh( dynamic_cast< ScDocShell* >(p->GetDocumentShell()) ), pDoc( p ),
@@ -544,6 +548,8 @@ void ScImportExport::SetNoEndianSwap( SvStream& rStrm )
#endif
}
+namespace {
+
enum QuoteType
{
FIELDSTART_QUOTE,
@@ -553,6 +559,8 @@ enum QuoteType
DONTKNOW_QUOTE
};
+}
+
/** Determine if *p is a quote that ends a quoted field.
Precondition: we are parsing a quoted field already and *p is a quote.
@@ -638,12 +646,16 @@ static bool lcl_appendLineData( OUString& rField, const sal_Unicode* p1, const s
}
}
+namespace {
+
enum class DoubledQuoteMode
{
KEEP_ALL, // both are taken, additionally start and end quote are included in string
ESCAPE, // escaped quote, one is taken, one ignored
};
+}
+
static const sal_Unicode* lcl_ScanString( const sal_Unicode* p, OUString& rString,
const sal_Unicode* pSeps, sal_Unicode cStr, DoubledQuoteMode eMode, bool& rbOverflowCell )
{
diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx
index 61948b461c4f..4e6b6332be89 100644
--- a/sc/source/ui/unoobj/fielduno.cxx
+++ b/sc/source/ui/unoobj/fielduno.cxx
@@ -147,6 +147,8 @@ sal_Int16 lcl_SvxToUnoFileFormat( SvxFileFormat nSvxValue )
SC_SIMPLE_SERVICE_INFO( ScCellFieldsObj, "ScCellFieldsObj", "com.sun.star.text.TextFields" )
SC_SIMPLE_SERVICE_INFO( ScHeaderFieldsObj, "ScHeaderFieldsObj", "com.sun.star.text.TextFields" )
+namespace {
+
enum ScUnoCollectMode
{
SC_UNO_COLLECT_NONE,
@@ -155,6 +157,8 @@ enum ScUnoCollectMode
SC_UNO_COLLECT_FINDPOS
};
+}
+
/**
* This class exists solely to allow searching through field items. TODO:
* Look into providing the same functionality directly in EditEngine, to
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 17c1bc503600..725937aac476 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -140,12 +140,16 @@
using namespace css;
using namespace css::uno;
+namespace {
+
enum class ScFilterBoxMode
{
DataSelect,
Scenario
};
+}
+
struct ScGridWindow::MouseEventState
{
bool mbActivatePart;
diff --git a/sc/source/ui/view/prevloc.cxx b/sc/source/ui/view/prevloc.cxx
index 030f3c7d6436..2c00bf260cd1 100644
--- a/sc/source/ui/view/prevloc.cxx
+++ b/sc/source/ui/view/prevloc.cxx
@@ -23,6 +23,8 @@
#include <osl/diagnose.h>
#include <vcl/outdev.hxx>
+namespace {
+
enum ScPreviewLocationType
{
SC_PLOC_CELLRANGE,
@@ -36,6 +38,8 @@ enum ScPreviewLocationType
SC_PLOC_NOTETEXT
};
+}
+
struct ScPreviewLocationEntry
{
ScPreviewLocationType const eType;
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 0ab2d088b0e7..1f6a66ab8db2 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -229,6 +229,8 @@ bool ScViewFunc::AdjustRowHeight( SCROW nStartRow, SCROW nEndRow )
return bChanged;
}
+namespace {
+
enum ScAutoSum
{
ScAutoSumNone = 0,
@@ -240,6 +242,8 @@ enum ScAutoSum
ScAutoSumCount
};
+}
+
static ScAutoSum lcl_IsAutoSumData( ScDocument* pDoc, SCCOL nCol, SCROW nRow,
SCTAB nTab, ScDirection eDir, SCCOLROW& nExtend )
{