summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2013-06-23 23:46:05 +0200
committerBjörn Michaelsen <bjoern.michaelsen@canonical.com>2013-07-15 14:53:40 +0000
commit02c1f4128b2011ceea6e4a0ceb054ec74315ec54 (patch)
tree18537bd4712e10b83dec291a7c03b9b03b9b8ef9
parent5f3d88a1f151e12061421751831b5588495199bb (diff)
Reduce scope of global array and make in constant
Change-Id: I914aff27234e3acede7ae6ade72530dc0fea9dc9 Reviewed-on: https://gerrit.libreoffice.org/4922 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
-rw-r--r--sw/inc/fldbas.hxx2
-rw-r--r--sw/source/core/fields/fldbas.cxx7
2 files changed, 6 insertions, 3 deletions
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index 06e3f80976d7..53ab8266538a 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -218,8 +218,6 @@ enum SwDateTimeSubType
};
-extern sal_uInt16 aTypeTab[];
-
/// General tools.
String GetResult(double nVal, sal_uInt32 nNumFmt, sal_uInt16 nLang = LANGUAGE_SYSTEM);
void SetErrorStr(const String& rStr);
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index d6bdb926b147..524e1855774a 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -70,7 +70,10 @@ static sal_uInt16 lcl_GetLanguageOfFormat( sal_uInt16 nLng, sal_uLong nFmt,
/// field names
std::vector<String>* SwFieldType::pFldNames = 0;
- sal_uInt16 aTypeTab[] = {
+namespace
+{
+
+ const sal_uInt16 aTypeTab[] = {
/* RES_DBFLD */ TYP_DBFLD,
/* RES_USERFLD */ TYP_USERFLD,
/* RES_FILENAMEFLD */ TYP_FILENAMEFLD,
@@ -113,6 +116,8 @@ std::vector<String>* SwFieldType::pFldNames = 0;
/* RES_DROPDOWN */ TYP_DROPDOWN
};
+}
+
const String& SwFieldType::GetTypeStr(sal_uInt16 nTypeId)
{
if( !pFldNames )