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

Noel Grandin noel.grandin at collabora.co.uk
Thu Dec 1 21:52:08 UTC 2016


 connectivity/source/drivers/mork/MorkParser.cxx |   14 +++++++-------
 connectivity/source/drivers/mork/MorkParser.hxx |    2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 036603d72fd74607a6033118a7d395c4ad7f4907
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Dec 1 13:52:46 2016 +0200

    convert nowParsing_ constants to scoped enum
    
    Change-Id: I8df9ca0e9317a4d969f492699be926044415f68c
    Reviewed-on: https://gerrit.libreoffice.org/31483
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/connectivity/source/drivers/mork/MorkParser.cxx b/connectivity/source/drivers/mork/MorkParser.cxx
index 9a4b895..c2b931e 100644
--- a/connectivity/source/drivers/mork/MorkParser.cxx
+++ b/connectivity/source/drivers/mork/MorkParser.cxx
@@ -62,7 +62,7 @@ MorkParser::MorkParser() :
     morkPos_(0),
     nextAddValueId_(0x7fffffff),
     defaultTableId_(1),
-    nowParsing_(NPValues)
+    nowParsing_(NP::Values)
 {
 }
 
@@ -91,7 +91,7 @@ void MorkParser::initVars()
 {
     error_ = NoError;
     morkPos_ = 0;
-    nowParsing_ = NPValues;
+    nowParsing_ = NP::Values;
     currentCells_ = nullptr;
     nextAddValueId_ = 0x7fffffff;
 }
@@ -185,7 +185,7 @@ bool MorkParser::parseDict()
 {
     char cur = nextChar();
     bool Result = true;
-    nowParsing_ = NPValues;
+    nowParsing_ = NP::Values;
 
     while ( Result && cur != '>' && cur )
     {
@@ -198,7 +198,7 @@ bool MorkParser::parseDict()
 
                 if ( morkData_.substr( morkPos_ - 1, strlen( MorkDictColumnMeta ) ) == MorkDictColumnMeta )
                 {
-                    nowParsing_ = NPColumns;
+                    nowParsing_ = NP::Columns;
                     morkPos_ += strlen( MorkDictColumnMeta ) - 1;
                 }
 
@@ -324,12 +324,12 @@ bool MorkParser::parseCell()
     // Apply column and text
     int ColumnId = strtoul(Column.c_str(), nullptr, 16);
 
-    if ( NPRows != nowParsing_ )
+    if ( NP::Rows != nowParsing_ )
     {
         // Dicts
         if ( "" != Text )
         {
-            if ( nowParsing_ == NPColumns )
+            if ( nowParsing_ == NP::Columns )
             {
                 columns_[ ColumnId ] = Text;
             }
@@ -488,7 +488,7 @@ bool MorkParser::parseRow( int TableId, int TableScope )
     bool Result = true;
     std::string TextId;
     int Id = 0, Scope = 0;
-    nowParsing_ = NPRows;
+    nowParsing_ = NP::Rows;
 
     char cur = nextChar();
 
diff --git a/connectivity/source/drivers/mork/MorkParser.hxx b/connectivity/source/drivers/mork/MorkParser.hxx
index 6b5088c..fcbdd6a 100644
--- a/connectivity/source/drivers/mork/MorkParser.hxx
+++ b/connectivity/source/drivers/mork/MorkParser.hxx
@@ -141,7 +141,7 @@ protected: // Data
     int defaultTableId_;
 
     // Indicates entity is being parsed
-    enum { NPColumns, NPValues, NPRows } nowParsing_;
+    enum class NP { Columns, Values, Rows } nowParsing_;
 
 private:
     MorkParser(const MorkParser &) = delete;


More information about the Libreoffice-commits mailing list