diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-24 13:22:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-25 09:05:10 +0200 |
commit | c2775560ab2fa6166b2ce6fa2811ab10a0ffebe8 (patch) | |
tree | e46b2fd5354b57a5781270ea53ecb683ba61a8e2 /l10ntools | |
parent | 63a6de2cab00e949751fcb35f4814844fc4ec71e (diff) |
convert STRING_TYP to scoped enum
Change-Id: If0bcc6e13864fd534eb65eda06b1bc2b5498cee9
Diffstat (limited to 'l10ntools')
-rw-r--r-- | l10ntools/inc/export.hxx | 10 | ||||
-rw-r--r-- | l10ntools/source/cfgmerge.cxx | 2 | ||||
-rw-r--r-- | l10ntools/source/export.cxx | 10 | ||||
-rw-r--r-- | l10ntools/source/helpmerge.cxx | 2 | ||||
-rw-r--r-- | l10ntools/source/lngmerge.cxx | 4 | ||||
-rw-r--r-- | l10ntools/source/merge.cxx | 8 | ||||
-rw-r--r-- | l10ntools/source/propmerge.cxx | 2 | ||||
-rw-r--r-- | l10ntools/source/treemerge.cxx | 2 | ||||
-rw-r--r-- | l10ntools/source/uimerge.cxx | 2 | ||||
-rw-r--r-- | l10ntools/source/xrmmerge.cxx | 4 |
10 files changed, 23 insertions, 23 deletions
diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx index 8e8f57439bbe..220259c02528 100644 --- a/l10ntools/inc/export.hxx +++ b/l10ntools/inc/export.hxx @@ -103,9 +103,9 @@ enum class ExportListType { NONE, String, Filter, Item, Paired }; -#define STRING_TYP_TEXT 0x0010 -#define STRING_TYP_QUICKHELPTEXT 0x0040 -#define STRING_TYP_TITLE 0x0080 +enum class StringType { + Text, QuickHelpText, Title +}; typedef ::std::vector< ResData* > ResStack; @@ -152,7 +152,7 @@ private: static void CleanValue( OString &rValue ); static OString GetText(const OString &rSource, int nToken); - void ResData2Output( MergeEntrys *pEntry, sal_uInt16 nType, const OString& rTextType ); + void ResData2Output( MergeEntrys *pEntry, StringType nType, const OString& rTextType ); void MergeRest( ResData *pResData ); static void ConvertMergeContent( OString &rText ); static void ConvertExportContent( OString &rText ); @@ -204,7 +204,7 @@ public: sTitle[ rId ] = rTitle; bTitleFirst[ rId ] = true; } - bool GetText( OString &rReturn, sal_uInt16 nTyp, const OString &nLangIndex, bool bDel = false ); + bool GetText( OString &rReturn, StringType nTyp, const OString &nLangIndex, bool bDel = false ); /** Generate QTZ string with ResData diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx index 20a6f0deac47..240650ca0f53 100644 --- a/l10ntools/source/cfgmerge.cxx +++ b/l10ntools/source/cfgmerge.cxx @@ -471,7 +471,7 @@ void CfgMerge::WorkOnResourceEnd() sCur = aLanguages[ i ]; OString sContent; - pEntrys->GetText( sContent, STRING_TYP_TEXT, sCur , true ); + pEntrys->GetText( sContent, StringType::Text, sCur , true ); if ( ( !sCur.equalsIgnoreAsciiCase("en-US") ) && !sContent.isEmpty()) { diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx index 5a29d8d9a265..47f46a8b92df 100644 --- a/l10ntools/source/export.cxx +++ b/l10ntools/source/export.cxx @@ -996,7 +996,7 @@ void Export::ConvertExportContent( OString& rText ) rText = helper::unEscapeAll(rText,"\\n""\\t""\\\\""\\\"","\n""\t""\\""\""); } -void Export::ResData2Output( MergeEntrys *pEntry, sal_uInt16 nType, const OString& rTextType ) +void Export::ResData2Output( MergeEntrys *pEntry, StringType nType, const OString& rTextType ) { bool bAddSemicolon = false; bool bFirst = true; @@ -1058,13 +1058,13 @@ void Export::MergeRest( ResData *pResData ) if ( pEntry ) { if ( pResData->bText ) - ResData2Output( pEntry, STRING_TYP_TEXT, pResData->sTextTyp ); + ResData2Output( pEntry, StringType::Text, pResData->sTextTyp ); if ( pResData->bQuickHelpText ) - ResData2Output( pEntry, STRING_TYP_QUICKHELPTEXT, OString("QuickHelpText") ); + ResData2Output( pEntry, StringType::QuickHelpText, OString("QuickHelpText") ); if ( pResData->bTitle ) - ResData2Output( pEntry, STRING_TYP_TITLE, OString("Title") ); + ResData2Output( pEntry, StringType::Title, OString("Title") ); } // Merge Lists @@ -1143,7 +1143,7 @@ void Export::MergeRest( ResData *pResData ) if( pEntrys ) { OString sText; - pEntrys->GetText( sText, STRING_TYP_TEXT, sCur ); + pEntrys->GetText( sText, StringType::Text, sCur ); if( !sText.isEmpty()) { ConvertMergeContent( sText ); diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index d6ad3af727c0..3cd2d9dab20c 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -243,7 +243,7 @@ void HelpParser::ProcessHelp( LangHashMap* aLangHM , const OString& sCur , ResDa pEntrys = pMergeDataFile->GetMergeEntrys( pResData ); if( pEntrys != nullptr) { - pEntrys->GetText( sNewText, STRING_TYP_TEXT, sCur, true ); + pEntrys->GetText( sNewText, StringType::Text, sCur, true ); if (helper::isWellFormedXML(XMLUtil::QuotHTML(sNewText))) { sNewdata = sSourceText.copy(0,nPreSpaces) + sNewText; diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx index 1d33c929278a..a1de58d879f1 100644 --- a/l10ntools/source/lngmerge.cxx +++ b/l10ntools/source/lngmerge.cxx @@ -241,7 +241,7 @@ bool LngParser::Merge( if( !sLang.isEmpty() ) { OString sNewText; - pEntrys->GetText( sNewText, STRING_TYP_TEXT, sLang, true ); + pEntrys->GetText( sNewText, StringType::Text, sLang, true ); if( sLang == "qtz" ) continue; @@ -279,7 +279,7 @@ bool LngParser::Merge( { OString sNewText; - pEntrys->GetText( sNewText, STRING_TYP_TEXT, sCur, true ); + pEntrys->GetText( sNewText, StringType::Text, sCur, true ); if( sCur == "qtz" ) continue; if ( !sNewText.isEmpty() && sCur != "x-comment") diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx index f927420fb30d..a4a887c33d41 100644 --- a/l10ntools/source/merge.cxx +++ b/l10ntools/source/merge.cxx @@ -92,25 +92,25 @@ ResData::ResData( const OString &rGId, const OString &rFilename) bool MergeEntrys::GetText( OString &rReturn, - sal_uInt16 nTyp, const OString &nLangIndex, bool bDel ) + StringType nTyp, const OString &nLangIndex, bool bDel ) { bool bReturn = true; switch ( nTyp ) { - case STRING_TYP_TEXT : + case StringType::Text : rReturn = sText[ nLangIndex ]; if ( bDel ) sText[ nLangIndex ] = ""; bReturn = bTextFirst[ nLangIndex ]; bTextFirst[ nLangIndex ] = false; break; - case STRING_TYP_QUICKHELPTEXT : + case StringType::QuickHelpText : rReturn = sQuickHelpText[ nLangIndex ]; if ( bDel ) sQuickHelpText[ nLangIndex ] = ""; bReturn = bQuickHelpTextFirst[ nLangIndex ]; bQuickHelpTextFirst[ nLangIndex ] = false; break; - case STRING_TYP_TITLE : + case StringType::Title : rReturn = sTitle[ nLangIndex ]; if ( bDel ) sTitle[ nLangIndex ] = ""; diff --git a/l10ntools/source/propmerge.cxx b/l10ntools/source/propmerge.cxx index 78680e844165..e4e75f648f33 100644 --- a/l10ntools/source/propmerge.cxx +++ b/l10ntools/source/propmerge.cxx @@ -205,7 +205,7 @@ void PropParser::Merge( const OString &rMergeSrc, const OString &rDestinationFil MergeEntrys* pEntrys = pMergeDataFile->GetMergeEntrys( &aResData ); if( pEntrys ) { - pEntrys->GetText( sNewText, STRING_TYP_TEXT, m_sLang ); + pEntrys->GetText( sNewText, StringType::Text, m_sLang ); } } if( !sNewText.isEmpty() ) diff --git a/l10ntools/source/treemerge.cxx b/l10ntools/source/treemerge.cxx index 978d393854c0..a0c738cc0782 100644 --- a/l10ntools/source/treemerge.cxx +++ b/l10ntools/source/treemerge.cxx @@ -168,7 +168,7 @@ namespace pMergeDataFile->GetMergeEntrys( &aResData ); if( pEntrys ) { - pEntrys->GetText( sNewText, STRING_TYP_TEXT, rLang ); + pEntrys->GetText( sNewText, StringType::Text, rLang ); } } else if( rLang == "qtz" ) diff --git a/l10ntools/source/uimerge.cxx b/l10ntools/source/uimerge.cxx index 5a53f49c9918..5b05dc9afec8 100644 --- a/l10ntools/source/uimerge.cxx +++ b/l10ntools/source/uimerge.cxx @@ -108,7 +108,7 @@ namespace MergeEntrys* pEntrys = aI->second->GetMergeEntries(); OString sOut; - pEntrys->GetText( sOut, STRING_TYP_TEXT, rLanguage ); + pEntrys->GetText( sOut, StringType::Text, rLanguage ); if (sOut.isEmpty()) continue; diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx index 457c4f28db91..0feb4e023815 100644 --- a/l10ntools/source/xrmmerge.cxx +++ b/l10ntools/source/xrmmerge.cxx @@ -411,7 +411,7 @@ void XRMResMerge::WorkOnDesc( OString sContent; if ( !sCur.equalsIgnoreAsciiCase("en-US") && ( pEntrys->GetText( - sContent, STRING_TYP_TEXT, sCur, true )) && + sContent, StringType::Text, sCur, true )) && !sContent.isEmpty()) { OString sText( sContent ); @@ -499,7 +499,7 @@ void XRMResMerge::EndOfText( OString sContent; if (!sCur.equalsIgnoreAsciiCase("en-US") && ( pEntrys->GetText( - sContent, STRING_TYP_TEXT, sCur, true )) && + sContent, StringType::Text, sCur, true )) && !sContent.isEmpty() && helper::isWellFormedXML( sContent )) { |