summaryrefslogtreecommitdiff
path: root/l10ntools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-19 15:41:27 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-20 07:56:07 +0000
commitfd6e86572abf570c7b8f0618ff4779f213d7b279 (patch)
treeafd4cbe3891b623a12577239210e89171ed1f137 /l10ntools
parent9bbd828f81b9139dfeaf5e211d476f1b2f72e7c2 (diff)
Convert ID_LEVEL to scoped enum
Change-Id: Icdb5f39329ddb94fc1a51e59c8ac99d2684f9cbc Reviewed-on: https://gerrit.libreoffice.org/25164 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'l10ntools')
-rw-r--r--l10ntools/inc/export.hxx8
-rw-r--r--l10ntools/source/export.cxx8
-rw-r--r--l10ntools/source/merge.cxx4
3 files changed, 9 insertions, 11 deletions
diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index c9f0b8bf6ec8..52d0ea179c22 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -59,9 +59,7 @@ typedef std::unordered_map<OString, bool, OStringHash>
// class ResData
-#define ID_LEVEL_NULL 0x0000
-#define ID_LEVEL_TEXT 0x0002
-#define ID_LEVEL_IDENTIFIER 0x0005
+enum class IdLevel { Null=0, Text=2, Identifier=5 };
typedef std::vector< OString > ExportList;
@@ -71,9 +69,9 @@ class ResData
public:
ResData( const OString &rGId );
ResData( const OString &rGId , const OString &rFilename );
- bool SetId(const OString &rId, sal_uInt16 nLevel);
+ bool SetId(const OString &rId, IdLevel nLevel);
- sal_uInt16 nIdLevel;
+ IdLevel nIdLevel;
bool bChild;
bool bChildWithText;
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index 269a4f22afa1..f9f4199b9fa3 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -143,7 +143,7 @@ int GetError()
// class ResData
-bool ResData::SetId( const OString& rId, sal_uInt16 nLevel )
+bool ResData::SetId( const OString& rId, IdLevel nLevel )
{
if ( nLevel > nIdLevel )
{
@@ -412,7 +412,7 @@ void Export::Execute( int nToken, const char * pToken )
sId = sId.getToken(0, '/');
CleanValue( sId );
sId = sId.replaceAll("\t", OString());
- pResData->SetId( sId, ID_LEVEL_IDENTIFIER );
+ pResData->SetId( sId, IdLevel::Identifier );
if (!sCondition.isEmpty())
{
Execute( CONDITION, ""); // execute the precomp. condition
@@ -505,7 +505,7 @@ void Export::Execute( int nToken, const char * pToken )
OString sId(
sValue.replaceAll("\t", OString()).
replaceAll(" ", OString()));
- pResData->SetId(sId, ID_LEVEL_IDENTIFIER);
+ pResData->SetId(sId, IdLevel::Identifier);
}
else if (sKey =="STRINGLIST")
{
@@ -602,7 +602,7 @@ void Export::Execute( int nToken, const char * pToken )
{
SetChildWithText();
if ( sLangIndex.equalsIgnoreAsciiCase("en-US") )
- pResData->SetId( sText, ID_LEVEL_TEXT );
+ pResData->SetId( sText, IdLevel::Text );
pResData->bText = true;
pResData->sTextTyp = sOrigKey;
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index 7ee23603c6bf..133f8f3f8c57 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -60,7 +60,7 @@ namespace
ResData::ResData( const OString &rGId )
:
- nIdLevel( ID_LEVEL_NULL ),
+ nIdLevel( IdLevel::Null ),
bChild( false ),
bChildWithText( false ),
bText( false ),
@@ -74,7 +74,7 @@ ResData::ResData( const OString &rGId )
ResData::ResData( const OString &rGId, const OString &rFilename)
:
- nIdLevel( ID_LEVEL_NULL ),
+ nIdLevel( IdLevel::Null ),
bChild( false ),
bChildWithText( false ),
bText( false ),