summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-10-10 13:49:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-10-11 06:15:21 +0000
commit5c84f40ea2e86bf85c0a59201faf1431f16aee40 (patch)
tree43a8b61f71052b4e3202f334fce8c60e52827fed /sc
parentfe82f6fc5cbd638972571a33f04e95971507bba9 (diff)
loplugin:constantfunction
update the plugin similarly to commit 3ee3b36ae0c064fb5c81268d8d63444309d1b970 Author: Stephan Bergmann <sbergman@redhat.com> Date: Fri Oct 7 12:05:49 2016 +0200 loplugin:staticmethods: Don't be fooled by decls starting with macros Change-Id: I98ac3216d5acf89a49a26feb089ae2fd34e6e510 Reviewed-on: https://gerrit.libreoffice.org/29665 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/colorscale.hxx2
-rw-r--r--sc/inc/compiler.hxx4
-rw-r--r--sc/inc/document.hxx2
-rw-r--r--sc/qa/unit/ucalc.cxx1
-rw-r--r--sc/source/core/data/colorscale.cxx13
-rw-r--r--sc/source/core/data/documen8.cxx8
-rw-r--r--sc/source/core/data/validat.cxx4
-rw-r--r--sc/source/core/tool/interpr4.cxx2
-rw-r--r--sc/source/core/tool/odffmap.cxx6
-rw-r--r--sc/source/filter/excel/xecontent.cxx2
-rw-r--r--sc/source/filter/excel/xeextlst.cxx2
-rw-r--r--sc/source/filter/oox/condformatbuffer.cxx2
-rw-r--r--sc/source/filter/xml/xmlcondformat.cxx2
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx2
-rw-r--r--sc/source/ui/condformat/condformatdlgentry.cxx2
15 files changed, 17 insertions, 37 deletions
diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx
index d9a9bd12133e..840b6824963d 100644
--- a/sc/inc/colorscale.hxx
+++ b/sc/inc/colorscale.hxx
@@ -361,7 +361,7 @@ public:
virtual condformat::ScFormatEntryType GetType() const override;
- static ScIconSetMap* getIconSetMap();
+ static const ScIconSetMap g_IconSetMap[];
static BitmapEx& getBitmap(sc::IconSetBitmapMap& rBitmapMap, ScIconSetType eType, sal_Int32 nIndex);
typedef ScIconSetFormatData::Entries_t::iterator iterator;
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 8c6485627cd1..20423ef364fa 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -255,13 +255,13 @@ private:
static CharClass *pCharClassEnglish; // character classification for en_US locale
static const Convention *pConventions[ formula::FormulaGrammar::CONV_LAST ];
- static struct AddInMap
+ static const struct AddInMap
{
const char* pODFF;
const char* pEnglish;
const char* pOriginal; // programmatical name
const char* pUpper; // upper case programmatical name
- } maAddInMap[];
+ } g_aAddInMap[];
static const AddInMap* GetAddInMap();
static size_t GetAddInMapCount();
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 2dbe866a5769..3994b83e9296 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1930,8 +1930,6 @@ public:
bool GetHasMacroFunc() const { return bHasMacroFunc; }
void SetHasMacroFunc(bool bSet) { bHasMacroFunc = bSet; }
- static bool CheckMacroWarn();
-
void SetRangeOverflowType(sal_uInt32 nType) { nRangeOverflowType = nType; }
bool HasRangeOverflow() const { return nRangeOverflowType != 0; }
SC_DLLPUBLIC sal_uInt32 GetRangeOverflowType() const { return nRangeOverflowType; }
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 86e2ed6e7f85..d925b83c6ffb 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -6041,7 +6041,6 @@ void Test::testEmptyCalcDocDefaults()
CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsInVBAMode() );
CPPUNIT_ASSERT_EQUAL( false, m_pDoc->HasNotes() );
CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsCutMode() );
- CPPUNIT_ASSERT_EQUAL( true, ScDocument::CheckMacroWarn() );
CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsUsingEmbededFonts() );
CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsEmbedded() );
diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx
index 25707bfd7a64..5f87b328538a 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -1101,9 +1101,7 @@ double ScIconSetFormat::CalcValue(double nMin, double nMax, ScIconSetFormat::con
return (*itr)->GetValue();
}
-namespace {
-
-ScIconSetMap aIconSetMap[] = {
+const ScIconSetMap ScIconSetFormat::g_IconSetMap[] = {
{ "3Arrows", IconSet_3Arrows, 3 },
{ "3ArrowsGray", IconSet_3ArrowsGray, 3 },
{ "3Flags", IconSet_3Flags, 3 },
@@ -1129,13 +1127,6 @@ ScIconSetMap aIconSetMap[] = {
{ nullptr, IconSet_3Arrows, 0 }
};
-}
-
-ScIconSetMap* ScIconSetFormat::getIconSetMap()
-{
- return aIconSetMap;
-}
-
size_t ScIconSetFormat::size() const
{
return mpFormatData->m_Entries.size();
@@ -1299,7 +1290,7 @@ BitmapEx& ScIconSetFormat::getBitmap(sc::IconSetBitmapMap & rIconSetBitmapMap,
void ScIconSetFormat::EnsureSize()
{
ScIconSetType eType = mpFormatData->eIconSetType;
- for (ScIconSetMap & i : aIconSetMap)
+ for (const ScIconSetMap & i : g_IconSetMap)
{
if (i.eType == eType)
{
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index e99e32f9df70..572d594b3697 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -1162,14 +1162,6 @@ void ScDocument::KeyInput( const KeyEvent& )
apTemporaryChartLock->StartOrContinueLocking();
}
-bool ScDocument::CheckMacroWarn()
-{
- // The check for macro configuration, macro warning and disabling is now handled
- // in SfxObjectShell::AdjustMacroMode, called by SfxObjectShell::CallBasic.
-
- return true;
-}
-
SfxBindings* ScDocument::GetViewBindings()
{
// used to invalidate slots after changes to this document
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index 9eeca6d7a7f9..acc192fcc61e 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -185,7 +185,7 @@ bool ScValidationData::DoScript( const ScAddress& rPos, const OUString& rInput,
{
ScDocument* pDocument = GetDocument();
SfxObjectShell* pDocSh = pDocument->GetDocumentShell();
- if ( !pDocSh || !ScDocument::CheckMacroWarn() )
+ if ( !pDocSh )
return false;
bool bScriptReturnedFalse = false; // default: do not abort
@@ -271,7 +271,7 @@ bool ScValidationData::DoMacro( const ScAddress& rPos, const OUString& rInput,
ScDocument* pDocument = GetDocument();
SfxObjectShell* pDocSh = pDocument->GetDocumentShell();
- if ( !pDocSh || !ScDocument::CheckMacroWarn() )
+ if ( !pDocSh )
return false;
bool bDone = false;
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index f9b2350dda93..4d697f91f5be 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -3137,7 +3137,7 @@ void ScInterpreter::ScMacro()
OUString aMacro( pCur->GetExternal() );
SfxObjectShell* pDocSh = pDok->GetDocumentShell();
- if ( !pDocSh || !ScDocument::CheckMacroWarn() )
+ if ( !pDocSh )
{
PushNoValue(); // without DocShell no CallBasic
return;
diff --git a/sc/source/core/tool/odffmap.cxx b/sc/source/core/tool/odffmap.cxx
index 4a37e2f8bdb4..c97d167be0e4 100644
--- a/sc/source/core/tool/odffmap.cxx
+++ b/sc/source/core/tool/odffmap.cxx
@@ -22,7 +22,7 @@
// ODFF, English, MapDupToInternal when writing ODFF, Programmatical, ODF_11
// functions duplicated to internal when writing ODFF are listed in static const XclFunctionInfo saFuncTable_4[]
-ScCompiler::AddInMap ScCompiler::maAddInMap[] =
+const ScCompiler::AddInMap ScCompiler::g_aAddInMap[] =
{
{ "ORG.OPENOFFICE.WEEKS", "WEEKS", "com.sun.star.sheet.addin.DateFunctions.getDiffWeeks", "COM.SUN.STAR.SHEET.ADDIN.DATEFUNCTIONS.GETDIFFWEEKS" },
{ "ORG.OPENOFFICE.MONTHS", "MONTHS", "com.sun.star.sheet.addin.DateFunctions.getDiffMonths", "COM.SUN.STAR.SHEET.ADDIN.DATEFUNCTIONS.GETDIFFMONTHS" },
@@ -137,12 +137,12 @@ ScCompiler::AddInMap ScCompiler::maAddInMap[] =
const ScCompiler::AddInMap* ScCompiler::GetAddInMap()
{
- return maAddInMap;
+ return g_aAddInMap;
}
size_t ScCompiler::GetAddInMapCount()
{
- return SAL_N_ELEMENTS(maAddInMap);
+ return SAL_N_ELEMENTS(g_aAddInMap);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index cfa6c5abc751..9f2c3641ace7 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -1431,7 +1431,7 @@ namespace {
const char* getIconSetName( ScIconSetType eType )
{
- ScIconSetMap* pMap = ScIconSetFormat::getIconSetMap();
+ const ScIconSetMap* pMap = ScIconSetFormat::g_IconSetMap;
for(; pMap->pName; ++pMap)
{
if(pMap->eType == eType)
diff --git a/sc/source/filter/excel/xeextlst.cxx b/sc/source/filter/excel/xeextlst.cxx
index 921642aa3910..c1b1252e8901 100644
--- a/sc/source/filter/excel/xeextlst.cxx
+++ b/sc/source/filter/excel/xeextlst.cxx
@@ -21,7 +21,7 @@ namespace {
const char* getIconSetName( ScIconSetType eType )
{
- ScIconSetMap* pMap = ScIconSetFormat::getIconSetMap();
+ const ScIconSetMap* pMap = ScIconSetFormat::g_IconSetMap;
for(; pMap->pName; ++pMap)
{
if(pMap->eType == eType)
diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx
index 1ff1d7a25e67..8481d1e53b6f 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -368,7 +368,7 @@ namespace {
ScIconSetType getType(const OUString& rName)
{
ScIconSetType eIconSetType = IconSet_3TrafficLights1;
- ScIconSetMap* pIconSetMap = ScIconSetFormat::getIconSetMap();
+ const ScIconSetMap* pIconSetMap = ScIconSetFormat::g_IconSetMap;
for(size_t i = 0; pIconSetMap[i].pName; ++i)
{
if(OUString::createFromAscii(pIconSetMap[i].pName) == rName)
diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx
index 7e0e0c063ce1..0850bcf6cc68 100644
--- a/sc/source/filter/xml/xmlcondformat.cxx
+++ b/sc/source/filter/xml/xmlcondformat.cxx
@@ -348,7 +348,7 @@ ScXMLIconSetFormatContext::ScXMLIconSetFormatContext(ScXMLImport& rImport, sal_u
}
}
- ScIconSetMap* pMap = ScIconSetFormat::getIconSetMap();
+ const ScIconSetMap* pMap = ScIconSetFormat::g_IconSetMap;
ScIconSetType eType = IconSet_3Arrows;
for(; pMap->pName; ++pMap)
{
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index b7f5a10e3dea..c9aeb29fa3dc 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -4158,7 +4158,7 @@ OUString getCondFormatEntryType(const ScColorScaleEntry& rEntry, bool bFirst = t
OUString getIconSetName(ScIconSetType eType)
{
const char* pName = nullptr;
- ScIconSetMap* pMap = ScIconSetFormat::getIconSetMap();
+ const ScIconSetMap* pMap = ScIconSetFormat::g_IconSetMap;
for(;pMap->pName;++pMap)
{
if(pMap->eType == eType)
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index 921f57899d70..68e25c8e5959 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -1564,7 +1564,7 @@ void ScIconSetFrmtEntry::Init()
IMPL_LINK_NOARG( ScIconSetFrmtEntry, IconSetTypeHdl, ListBox&, void )
{
- ScIconSetMap* pMap = ScIconSetFormat::getIconSetMap();
+ const ScIconSetMap* pMap = ScIconSetFormat::g_IconSetMap;
sal_Int32 nPos = maLbIconSetType->GetSelectEntryPos();
sal_uInt32 nElements = pMap[nPos].nElements;