summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-09 16:27:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-22 12:47:37 +0200
commit76dd28afc9c0eb632a5dd20eb51704ee0bbc4b58 (patch)
tree82c51d09721476a1a6fcbf1e4cd4af8189ac55a2
parent78490b45c771a4c9632b324922f2c8e83f06153b (diff)
loplugin:staticvar in various
looks for variables that can be declared const and static i.e. they can be stored in the read-only linker segment and shared between different processes Change-Id: I8ddc6e5fa0f6b10d80c75d5952df8ddd311cf892 Reviewed-on: https://gerrit.libreoffice.org/61591 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--compilerplugins/clang/staticvar.cxx7
-rw-r--r--i18npool/source/inputchecker/inputsequencechecker.cxx2
-rw-r--r--i18npool/source/transliteration/transliterationImpl.cxx2
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx4
-rw-r--r--scripting/source/basprov/basprov.cxx2
-rw-r--r--scripting/source/dlgprov/dlgprov.cxx2
-rw-r--r--testtools/source/bridgetest/constructors.cxx2
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx178
-rw-r--r--toolkit/source/helper/vclunohelper.cxx8
-rw-r--r--tools/source/stream/strmunx.cxx4
-rw-r--r--ucb/source/ucp/ext/ucpext_services.cxx2
-rw-r--r--unotools/source/config/lingucfg.cxx4
-rw-r--r--unotools/source/misc/fontcvt.cxx4
-rw-r--r--writerfilter/source/rtftok/rtfcharsets.cxx2
-rw-r--r--writerfilter/source/rtftok/rtfcharsets.hxx2
-rw-r--r--writerfilter/source/rtftok/rtfcontrolwords.cxx4
-rw-r--r--writerfilter/source/rtftok/rtfcontrolwords.hxx4
17 files changed, 116 insertions, 117 deletions
diff --git a/compilerplugins/clang/staticvar.cxx b/compilerplugins/clang/staticvar.cxx
index a9db2f4dda04..37156a283c33 100644
--- a/compilerplugins/clang/staticvar.cxx
+++ b/compilerplugins/clang/staticvar.cxx
@@ -76,7 +76,10 @@ public:
// aHTMLOptionTab is ordered by useful grouping, so let it sort at runtime
|| fn == SRCDIR "/svtools/source/svhtml/htmlkywd.cxx"
// TODO sorting some of these tables will be a lot of work...
- || fn == SRCDIR "/sw/source/filter/ww8/ww8par6.cxx")
+ || fn == SRCDIR "/sw/source/filter/ww8/ww8par6.cxx"
+ // this only triggers on older versions of clang, not sure why
+ // in any case, it is actually about the array in vcl/inc/units.hrc, which we can't change
+ || fn == SRCDIR "/vcl/source/app/svdata.cxx")
return;
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
}
@@ -198,7 +201,7 @@ bool StaticVar::VisitVarDecl(VarDecl const* varDecl)
return true;
}
-loplugin::Plugin::Registration<StaticVar> X("staticvar", false);
+loplugin::Plugin::Registration<StaticVar> X("staticvar", true);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/i18npool/source/inputchecker/inputsequencechecker.cxx b/i18npool/source/inputchecker/inputsequencechecker.cxx
index 15426db1bc57..17ee82810af3 100644
--- a/i18npool/source/inputchecker/inputsequencechecker.cxx
+++ b/i18npool/source/inputchecker/inputsequencechecker.cxx
@@ -74,7 +74,7 @@ InputSequenceCheckerImpl::correctInputSequence(OUString& Text, sal_Int32 nStartP
return nStartPos;
}
-static ScriptTypeList typeList[] = {
+static ScriptTypeList const typeList[] = {
//{ UnicodeScript_kHebrew, UnicodeScript_kHebrew }, // 10,
//{ UnicodeScript_kArabic, UnicodeScript_kArabic }, // 11,
{ UnicodeScript_kDevanagari, UnicodeScript_kDevanagari, sal_Int16(UnicodeScript_kDevanagari) }, // 14,
diff --git a/i18npool/source/transliteration/transliterationImpl.cxx b/i18npool/source/transliteration/transliterationImpl.cxx
index 900160f2971c..16bcfd3f96b2 100644
--- a/i18npool/source/transliteration/transliterationImpl.cxx
+++ b/i18npool/source/transliteration/transliterationImpl.cxx
@@ -54,7 +54,7 @@ static struct TMlist {
TransliterationModules tm;
TransliterationModulesNew tmn;
const sal_Char *implName;
-} TMlist[] = { // Modules ModulesNew
+} const TMlist[] = { // Modules ModulesNew
TmItem1 (IGNORE_CASE), // 0. (1<<8 256) (7)
TmItem1 (IGNORE_WIDTH), // 1. (1<<9 512) (8)
TmItem1 (IGNORE_KANA), // 2. (1<<10 1024) (9)
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx
index b7a12685d9c4..b6b1f3113545 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx
@@ -35,10 +35,10 @@ struct VendorSupportMapEntry
createInstance_func createFunc;
};
-extern VendorSupportMapEntry gVendorMap[];
+extern VendorSupportMapEntry const gVendorMap[];
#define BEGIN_VENDOR_MAP() \
-VendorSupportMapEntry gVendorMap[] ={
+VendorSupportMapEntry const gVendorMap[] ={
#define VENDOR_MAP_ENTRY(x,y) \
{x, & y::getJavaExePaths, & y::createInstance},
diff --git a/scripting/source/basprov/basprov.cxx b/scripting/source/basprov/basprov.cxx
index 31fa993fcecc..f1805c36a16e 100644
--- a/scripting/source/basprov/basprov.cxx
+++ b/scripting/source/basprov/basprov.cxx
@@ -481,7 +481,7 @@ namespace basprov
}
- static struct ::cppu::ImplementationEntry s_component_entries [] =
+ static struct ::cppu::ImplementationEntry const s_component_entries [] =
{
{
create_BasicProviderImpl, getImplementationName_BasicProviderImpl,
diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx
index c7ae4c93277e..884ba6966d4f 100644
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -736,7 +736,7 @@ namespace dlgprov
}
- static struct ::cppu::ImplementationEntry s_component_entries [] =
+ static struct ::cppu::ImplementationEntry const s_component_entries [] =
{
{create_DialogProviderImpl, getImplementationName_DialogProviderImpl,getSupportedServiceNames_DialogProviderImpl, ::cppu::createSingleComponentFactory,nullptr, 0},
{ &comp_DialogModelProvider::_create,&comp_DialogModelProvider::_getImplementationName,&comp_DialogModelProvider::_getSupportedServiceNames,&::cppu::createSingleComponentFactory, nullptr, 0 },
diff --git a/testtools/source/bridgetest/constructors.cxx b/testtools/source/bridgetest/constructors.cxx
index d1e9c6d5a0da..03b633a54665 100644
--- a/testtools/source/bridgetest/constructors.cxx
+++ b/testtools/source/bridgetest/constructors.cxx
@@ -439,7 +439,7 @@ css::uno::Sequence< OUString > getSupportedServiceNames2() {
return s;
}
-::cppu::ImplementationEntry entries[] = {
+::cppu::ImplementationEntry const entries[] = {
{ &create, &getImplementationName, &getSupportedServiceNames,
&::cppu::createSingleComponentFactory, nullptr, 0 },
{ &create2, &getImplementationName2, &getSupportedServiceNames2,
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 7632a50005c2..622a2981e73a 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -687,87 +687,89 @@ std::pair<WinBits,MessBoxStyle> ImplGetWinBits( sal_uInt32 nComponentAttribs, Wi
struct ComponentInfo
{
- const char* pName;
+ OUStringLiteral sName;
WindowType nWinType;
};
-static ComponentInfo aComponentInfos [] =
-{
- { "buttondialog", WindowType::BUTTONDIALOG },
- { "cancelbutton", WindowType::CANCELBUTTON },
- { "checkbox", WindowType::CHECKBOX },
- { "combobox", WindowType::COMBOBOX },
- { "control", WindowType::CONTROL },
- { "currencybox", WindowType::CURRENCYBOX },
- { "currencyfield", WindowType::CURRENCYFIELD },
- { "datebox", WindowType::DATEBOX },
- { "datefield", WindowType::DATEFIELD },
- { "dialog", WindowType::DIALOG },
- { "dockingarea", WindowType::DOCKINGAREA },
- { "dockingwindow", WindowType::DOCKINGWINDOW },
- { "edit", WindowType::EDIT },
- { "errorbox", WindowType::ERRORBOX },
- { "fixedbitmap", WindowType::FIXEDBITMAP },
- { "fixedimage", WindowType::FIXEDIMAGE },
- { "fixedline", WindowType::FIXEDLINE },
- { "fixedtext", WindowType::FIXEDTEXT },
- { "floatingwindow", WindowType::FLOATINGWINDOW },
- { "framewindow", WindowType::TOOLKIT_FRAMEWINDOW },
- { "groupbox", WindowType::GROUPBOX },
- { "frame", WindowType::GROUPBOX },
- { "helpbutton", WindowType::HELPBUTTON },
- { "imagebutton", WindowType::IMAGEBUTTON },
- { "infobox", WindowType::INFOBOX },
- { "listbox", WindowType::LISTBOX },
- { "longcurrencybox", WindowType::LONGCURRENCYBOX },
- { "longcurrencyfield", WindowType::LONGCURRENCYFIELD },
- { "menubutton", WindowType::MENUBUTTON },
- { "messbox", WindowType::MESSBOX },
- { "metricbox", WindowType::METRICBOX },
- { "metricfield", WindowType::METRICFIELD },
- { "modaldialog", WindowType::MODALDIALOG },
- { "modelessdialog", WindowType::MODELESSDIALOG },
- { "morebutton", WindowType::MOREBUTTON },
- { "multilineedit", WindowType::MULTILINEEDIT },
- { "multilistbox", WindowType::MULTILISTBOX },
- { "numericbox", WindowType::NUMERICBOX },
- { "numericfield", WindowType::NUMERICFIELD },
- { "okbutton", WindowType::OKBUTTON },
- { "patternbox", WindowType::PATTERNBOX },
- { "patternfield", WindowType::PATTERNFIELD },
- { "pushbutton", WindowType::PUSHBUTTON },
- { "querybox", WindowType::QUERYBOX },
- { "radiobutton", WindowType::RADIOBUTTON },
- { "scrollbar", WindowType::SCROLLBAR },
- { "scrollbarbox", WindowType::SCROLLBARBOX },
- { "animatedimages", WindowType::CONTROL },
- { "spinbutton", WindowType::SPINBUTTON },
- { "spinfield", WindowType::SPINFIELD },
- { "splitter", WindowType::SPLITTER },
- { "splitwindow", WindowType::SPLITWINDOW },
- { "statusbar", WindowType::STATUSBAR },
- { "systemchildwindow", WindowType::TOOLKIT_SYSTEMCHILDWINDOW },
- { "tabcontrol", WindowType::TABCONTROL },
- { "tabdialog", WindowType::TABDIALOG },
- { "tabpage", WindowType::TABPAGE },
- { "timebox", WindowType::TIMEBOX },
- { "timefield", WindowType::TIMEFIELD },
- { "toolbox", WindowType::TOOLBOX },
- { "tristatebox", WindowType::TRISTATEBOX },
- { "warningbox", WindowType::WARNINGBOX },
- { "window", WindowType::WINDOW },
- { "workwindow", WindowType::WORKWINDOW },
- { "tabpagecontainer", WindowType::CONTROL },
- { "tabpagemodel", WindowType::TABPAGE }
+static ComponentInfo const aComponentInfos [] =
+{
+ { OUStringLiteral("animatedimages"), WindowType::CONTROL },
+ { OUStringLiteral("buttondialog"), WindowType::BUTTONDIALOG },
+ { OUStringLiteral("cancelbutton"), WindowType::CANCELBUTTON },
+ { OUStringLiteral("checkbox"), WindowType::CHECKBOX },
+ { OUStringLiteral("combobox"), WindowType::COMBOBOX },
+ { OUStringLiteral("control"), WindowType::CONTROL },
+ { OUStringLiteral("currencybox"), WindowType::CURRENCYBOX },
+ { OUStringLiteral("currencyfield"), WindowType::CURRENCYFIELD },
+ { OUStringLiteral("datebox"), WindowType::DATEBOX },
+ { OUStringLiteral("datefield"), WindowType::DATEFIELD },
+ { OUStringLiteral("dialog"), WindowType::DIALOG },
+ { OUStringLiteral("dockingarea"), WindowType::DOCKINGAREA },
+ { OUStringLiteral("dockingwindow"), WindowType::DOCKINGWINDOW },
+ { OUStringLiteral("edit"), WindowType::EDIT },
+ { OUStringLiteral("errorbox"), WindowType::ERRORBOX },
+ { OUStringLiteral("fixedbitmap"), WindowType::FIXEDBITMAP },
+ { OUStringLiteral("fixedimage"), WindowType::FIXEDIMAGE },
+ { OUStringLiteral("fixedline"), WindowType::FIXEDLINE },
+ { OUStringLiteral("fixedtext"), WindowType::FIXEDTEXT },
+ { OUStringLiteral("floatingwindow"), WindowType::FLOATINGWINDOW },
+ { OUStringLiteral("frame"), WindowType::GROUPBOX },
+ { OUStringLiteral("framewindow"), WindowType::TOOLKIT_FRAMEWINDOW },
+ { OUStringLiteral("groupbox"), WindowType::GROUPBOX },
+ { OUStringLiteral("helpbutton"), WindowType::HELPBUTTON },
+ { OUStringLiteral("imagebutton"), WindowType::IMAGEBUTTON },
+ { OUStringLiteral("infobox"), WindowType::INFOBOX },
+ { OUStringLiteral("listbox"), WindowType::LISTBOX },
+ { OUStringLiteral("longcurrencybox"), WindowType::LONGCURRENCYBOX },
+ { OUStringLiteral("longcurrencyfield"), WindowType::LONGCURRENCYFIELD },
+ { OUStringLiteral("menubutton"), WindowType::MENUBUTTON },
+ { OUStringLiteral("messbox"), WindowType::MESSBOX },
+ { OUStringLiteral("metricbox"), WindowType::METRICBOX },
+ { OUStringLiteral("metricfield"), WindowType::METRICFIELD },
+ { OUStringLiteral("modaldialog"), WindowType::MODALDIALOG },
+ { OUStringLiteral("modelessdialog"), WindowType::MODELESSDIALOG },
+ { OUStringLiteral("morebutton"), WindowType::MOREBUTTON },
+ { OUStringLiteral("multilineedit"), WindowType::MULTILINEEDIT },
+ { OUStringLiteral("multilistbox"), WindowType::MULTILISTBOX },
+ { OUStringLiteral("numericbox"), WindowType::NUMERICBOX },
+ { OUStringLiteral("numericfield"), WindowType::NUMERICFIELD },
+ { OUStringLiteral("okbutton"), WindowType::OKBUTTON },
+ { OUStringLiteral("patternbox"), WindowType::PATTERNBOX },
+ { OUStringLiteral("patternfield"), WindowType::PATTERNFIELD },
+ { OUStringLiteral("pushbutton"), WindowType::PUSHBUTTON },
+ { OUStringLiteral("querybox"), WindowType::QUERYBOX },
+ { OUStringLiteral("radiobutton"), WindowType::RADIOBUTTON },
+ { OUStringLiteral("scrollbar"), WindowType::SCROLLBAR },
+ { OUStringLiteral("scrollbarbox"), WindowType::SCROLLBARBOX },
+ { OUStringLiteral("spinbutton"), WindowType::SPINBUTTON },
+ { OUStringLiteral("spinfield"), WindowType::SPINFIELD },
+ { OUStringLiteral("splitter"), WindowType::SPLITTER },
+ { OUStringLiteral("splitwindow"), WindowType::SPLITWINDOW },
+ { OUStringLiteral("statusbar"), WindowType::STATUSBAR },
+ { OUStringLiteral("systemchildwindow"), WindowType::TOOLKIT_SYSTEMCHILDWINDOW },
+ { OUStringLiteral("tabcontrol"), WindowType::TABCONTROL },
+ { OUStringLiteral("tabdialog"), WindowType::TABDIALOG },
+ { OUStringLiteral("tabpage"), WindowType::TABPAGE },
+ { OUStringLiteral("tabpagecontainer"), WindowType::CONTROL },
+ { OUStringLiteral("tabpagemodel"), WindowType::TABPAGE },
+ { OUStringLiteral("timebox"), WindowType::TIMEBOX },
+ { OUStringLiteral("timefield"), WindowType::TIMEFIELD },
+ { OUStringLiteral("toolbox"), WindowType::TOOLBOX },
+ { OUStringLiteral("tristatebox"), WindowType::TRISTATEBOX },
+ { OUStringLiteral("warningbox"), WindowType::WARNINGBOX },
+ { OUStringLiteral("window"), WindowType::WINDOW },
+ { OUStringLiteral("workwindow"), WindowType::WORKWINDOW }
};
-extern "C"
-{
-static int ComponentInfoCompare( const void* pFirst, const void* pSecond)
+bool ComponentInfoCompare( const ComponentInfo & lhs, const ComponentInfo & rhs)
{
- return strcmp( static_cast<ComponentInfo const *>(pFirst)->pName,
- static_cast<ComponentInfo const *>(pSecond)->pName );
+ return rtl_str_compare_WithLength(lhs.sName.data, lhs.sName.size, rhs.sName.data, rhs.sName.size) < 0;
}
+
+bool ComponentInfoFindCompare( const ComponentInfo & lhs, const OUString & s)
+{
+ return rtl_ustr_ascii_compareIgnoreAsciiCase_WithLengths(s.pData->buffer, s.pData->length,
+ lhs.sName.data, lhs.sName.size) > 0;
}
WindowType ImplGetComponentType( const OUString& rServiceName )
@@ -775,28 +777,22 @@ WindowType ImplGetComponentType( const OUString& rServiceName )
static bool bSorted = false;
if( !bSorted )
{
- qsort( static_cast<void*>(aComponentInfos),
- SAL_N_ELEMENTS( aComponentInfos ),
- sizeof( ComponentInfo ),
- ComponentInfoCompare );
+ assert( std::is_sorted( std::begin(aComponentInfos), std::end(aComponentInfos),
+ ComponentInfoCompare ) );
bSorted = true;
}
-
- ComponentInfo aSearch;
- OString aServiceName(OUStringToOString(rServiceName, osl_getThreadTextEncoding()).toAsciiLowerCase());
- if ( !aServiceName.isEmpty() )
- aSearch.pName = aServiceName.getStr();
+ OUString sSearch;
+ if ( !rServiceName.isEmpty() )
+ sSearch = rServiceName;
else
- aSearch.pName = "window";
-
- ComponentInfo* pInf = static_cast<ComponentInfo*>(bsearch( &aSearch,
- static_cast<void*>(aComponentInfos),
- SAL_N_ELEMENTS( aComponentInfos ),
- sizeof( ComponentInfo ),
- ComponentInfoCompare ));
+ sSearch = "window";
- return pInf ? pInf->nWinType : WindowType::NONE;
+ auto it = std::lower_bound( std::begin(aComponentInfos), std::end(aComponentInfos), sSearch,
+ ComponentInfoFindCompare );
+ if (it != std::end(aComponentInfos) && !ComponentInfoFindCompare(*it, sSearch) )
+ return it->nWinType;
+ return WindowType::NONE;
}
struct MessageBoxTypeInfo
diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx
index d7dfe76e162e..6e466468e2f1 100644
--- a/toolkit/source/helper/vclunohelper.cxx
+++ b/toolkit/source/helper/vclunohelper.cxx
@@ -360,10 +360,10 @@ namespace
{
static struct _unit_table
{
- FieldUnit const eFieldUnit;
- sal_Int16 const nMeasurementUnit;
- sal_Int16 const nFieldToMeasureFactor;
- } aUnits[] = {
+ FieldUnit eFieldUnit;
+ sal_Int16 nMeasurementUnit;
+ sal_Int16 nFieldToMeasureFactor;
+ } const aUnits[] = {
{ FUNIT_NONE, -1 , -1},
{ FUNIT_MM, MeasureUnit::MM, 1 }, // must precede MM_10TH
{ FUNIT_MM, MeasureUnit::MM_10TH, 10 },
diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx
index 057ac61f121f..77c30850a1ba 100644
--- a/tools/source/stream/strmunx.cxx
+++ b/tools/source/stream/strmunx.cxx
@@ -179,7 +179,7 @@ public:
static ErrCode GetSvError( int nErrno )
{
- static struct { int nErr; ErrCode sv; } errArr[] =
+ static struct { int nErr; ErrCode sv; } const errArr[] =
{
{ 0, ERRCODE_NONE },
{ EACCES, SVSTREAM_ACCESS_DENIED },
@@ -231,7 +231,7 @@ static ErrCode GetSvError( int nErrno )
static ErrCode GetSvError( oslFileError nErrno )
{
- static struct { oslFileError nErr; ErrCode sv; } errArr[] =
+ static struct { oslFileError nErr; ErrCode sv; } const errArr[] =
{
{ osl_File_E_None, ERRCODE_NONE },
{ osl_File_E_ACCES, SVSTREAM_ACCESS_DENIED },
diff --git a/ucb/source/ucp/ext/ucpext_services.cxx b/ucb/source/ucp/ext/ucpext_services.cxx
index 6f52d6d542b9..a326d9533a43 100644
--- a/ucb/source/ucp/ext/ucpext_services.cxx
+++ b/ucb/source/ucp/ext/ucpext_services.cxx
@@ -30,7 +30,7 @@ namespace ucb { namespace ucp { namespace ext
//= descriptors for the services implemented in this component
- static struct ::cppu::ImplementationEntry s_aServiceEntries[] =
+ static struct ::cppu::ImplementationEntry const s_aServiceEntries[] =
{
{
ContentProvider::Create,
diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx
index 3dfacf08a875..17749604a675 100644
--- a/unotools/source/config/lingucfg.cxx
+++ b/unotools/source/config/lingucfg.cxx
@@ -213,7 +213,7 @@ static struct NamesToHdl
const char *pFullPropName; // full qualified name as used in configuration
const char *pPropName; // property name only (atom) of above
sal_Int32 const nHdl; // numeric handle representing the property
-}aNamesToHdl[] =
+} const aNamesToHdl[] =
{
{/* 0 */ "General/DefaultLocale", UPN_DEFAULT_LOCALE, UPH_DEFAULT_LOCALE},
{/* 1 */ "General/DictionaryList/ActiveDictionaries", UPN_ACTIVE_DICTIONARIES, UPH_ACTIVE_DICTIONARIES},
@@ -281,7 +281,7 @@ bool SvtLinguConfigItem::GetHdlByName(
const OUString &rPropertyName,
bool bFullPropName )
{
- NamesToHdl *pEntry = &aNamesToHdl[0];
+ NamesToHdl const *pEntry = &aNamesToHdl[0];
if (bFullPropName)
{
diff --git a/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx
index 608a424f0f01..ea49af1d0f29 100644
--- a/unotools/source/misc/fontcvt.cxx
+++ b/unotools/source/misc/fontcvt.cxx
@@ -1135,7 +1135,7 @@ StarSymbolToMSMultiFontImpl::StarSymbolToMSMultiFontImpl()
};
//In order of preference
- const ConvertTable aConservativeTable[] =
+ static const ConvertTable aConservativeTable[] =
{
{Symbol, aAdobeSymbolTab},
{Wingdings, aWingDingsTab},
@@ -1173,7 +1173,7 @@ StarSymbolToMSMultiFontImpl::StarSymbolToMSMultiFontImpl()
}
//In order of preference
- const ExtendedConvertTable aAgressiveTable[] =
+ static const ExtendedConvertTable aAgressiveTable[] =
{
ExtendedConvertTable(Symbol, aSymbolExtraTab2,
sizeof(aSymbolExtraTab2)),
diff --git a/writerfilter/source/rtftok/rtfcharsets.cxx b/writerfilter/source/rtftok/rtfcharsets.cxx
index 5168a3627d2f..4309351d9f70 100644
--- a/writerfilter/source/rtftok/rtfcharsets.cxx
+++ b/writerfilter/source/rtftok/rtfcharsets.cxx
@@ -15,7 +15,7 @@ namespace writerfilter
namespace rtftok
{
// See RTF spec v1.9.1, page 19
-RTFEncoding aRTFEncodings[] = {
+RTFEncoding const aRTFEncodings[] = {
// charset codepage Windows / Mac name
{ 0, 1252 }, // ANSI
{ 1, 0 }, // Default
diff --git a/writerfilter/source/rtftok/rtfcharsets.hxx b/writerfilter/source/rtftok/rtfcharsets.hxx
index d2d21aaa8ac5..c0a024def83c 100644
--- a/writerfilter/source/rtftok/rtfcharsets.hxx
+++ b/writerfilter/source/rtftok/rtfcharsets.hxx
@@ -20,7 +20,7 @@ struct RTFEncoding
int const charset;
int const codepage;
};
-extern RTFEncoding aRTFEncodings[];
+extern RTFEncoding const aRTFEncodings[];
extern int nRTFEncodings;
} // namespace rtftok
} // namespace writerfilter
diff --git a/writerfilter/source/rtftok/rtfcontrolwords.cxx b/writerfilter/source/rtftok/rtfcontrolwords.cxx
index b49f356d4b0f..684cedeb5637 100644
--- a/writerfilter/source/rtftok/rtfcontrolwords.cxx
+++ b/writerfilter/source/rtftok/rtfcontrolwords.cxx
@@ -15,7 +15,7 @@ namespace writerfilter
{
namespace rtftok
{
-RTFSymbol aRTFControlWords[] = {
+RTFSymbol const aRTFControlWords[] = {
// sKeyword nControlType nIndex
{ "'", CONTROL_SYMBOL, RTF_HEXCHAR, 0 },
{ "-", CONTROL_SYMBOL, RTF_OPTHYPH, 0 },
@@ -1848,7 +1848,7 @@ bool RTFSymbol::operator<(const RTFSymbol& rOther) const
return std::strcmp(sKeyword, rOther.sKeyword) < 0;
}
-RTFMathSymbol aRTFMathControlWords[] = {
+RTFMathSymbol const aRTFMathControlWords[] = {
// eKeyword nToken eDestination
{ RTF_MOMATH, M_TOKEN(oMath), Destination::MOMATH },
{ RTF_MF, M_TOKEN(f), Destination::MF },
diff --git a/writerfilter/source/rtftok/rtfcontrolwords.hxx b/writerfilter/source/rtftok/rtfcontrolwords.hxx
index ddaf123b4a77..e638d9a9a359 100644
--- a/writerfilter/source/rtftok/rtfcontrolwords.hxx
+++ b/writerfilter/source/rtftok/rtfcontrolwords.hxx
@@ -2001,7 +2001,7 @@ struct RTFSymbol
bool operator<(const RTFSymbol& rOther) const;
};
-extern RTFSymbol aRTFControlWords[];
+extern RTFSymbol const aRTFControlWords[];
extern int nRTFControlWords;
/// Represents an RTF Math Control Word
@@ -2013,7 +2013,7 @@ struct RTFMathSymbol
bool operator<(const RTFMathSymbol& rOther) const;
};
-extern RTFMathSymbol aRTFMathControlWords[];
+extern RTFMathSymbol const aRTFMathControlWords[];
extern int nRTFMathControlWords;
} // namespace rtftok