[Libreoffice-commits] core.git: l10ntools/source

Noel Grandin noel at peralex.com
Fri May 20 11:20:14 UTC 2016


 l10ntools/source/export.cxx |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit 1e470313b81ba5249181c3d8ad7429b06dd7bd53
Author: Noel Grandin <noel at peralex.com>
Date:   Fri May 20 13:18:58 2016 +0200

    Convert TEXT_STATE to scoped enum
    
    Change-Id: I86822b99c81f1e6f2cd6a117f15fdc3d20d18495

diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index f9f4199..57fdd43 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -879,8 +879,7 @@ void Export::CleanValue( OString &rValue )
     }
 }
 
-#define TXT_STATE_TEXT  0x001
-#define TXT_STATE_MACRO 0x002
+enum class TextState { Text=1, Macro };
 
 OString Export::GetText(const OString &rSource, int nToken)
 {
@@ -899,14 +898,14 @@ OString Export::GetText(const OString &rSource, int nToken)
                 replaceAll("\\", "-=<[0x7F]>=-").
                 replaceAll("\\0x7F", "-=<[0x7F]>=-");
 
-            sal_uInt16 nState = TXT_STATE_TEXT;
+            TextState nState = TextState::Text;
             for (sal_Int32 i = 1; i <= lcl_countOccurrences(sTmp, '"'); ++i)
             {
                 OString sToken(sTmp.getToken(i, '"'));
                 if (!sToken.isEmpty()) {
-                    if ( nState == TXT_STATE_TEXT ) {
+                    if ( nState == TextState::Text ) {
                         sReturn += sToken;
-                        nState = TXT_STATE_MACRO;
+                        nState = TextState::Macro;
                     }
                     else {
                         sToken = sToken.replace('\t', ' ');
@@ -923,7 +922,7 @@ OString Export::GetText(const OString &rSource, int nToken)
                             sReturn += sToken;
                             sReturn += " \\\"";
                         }
-                        nState = TXT_STATE_TEXT;
+                        nState = TextState::Text;
                     }
                 }
             }


More information about the Libreoffice-commits mailing list