diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-23 10:20:13 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-24 06:53:50 +0000 |
commit | 5785d6022bff839dc930f5d20b79afcc79808ac5 (patch) | |
tree | fcedfa983f5e47fd70ee85ce015c48afb587284f /connectivity | |
parent | 93e61f9663df7e3986d88d6cb7db795af96a11b4 (diff) |
Convert OKeyType to scoped enum
Change-Id: Ic604991cdc0bf3e6dc5604a4a2b33f62b92f0915
Reviewed-on: https://gerrit.libreoffice.org/25355
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/commontools/TSortIndex.cxx | 8 | ||||
-rw-r--r-- | connectivity/source/drivers/file/FResultSet.cxx | 6 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MResultSet.cxx | 6 | ||||
-rw-r--r-- | connectivity/source/inc/TSortIndex.hxx | 10 |
4 files changed, 15 insertions, 15 deletions
diff --git a/connectivity/source/commontools/TSortIndex.cxx b/connectivity/source/commontools/TSortIndex.cxx index 2af3810bed57..2bb5541d0d6d 100644 --- a/connectivity/source/commontools/TSortIndex.cxx +++ b/connectivity/source/commontools/TSortIndex.cxx @@ -45,7 +45,7 @@ struct TKeyValueFunc : ::std::binary_function<OSortIndex::TIntValuePairVector::v // compare depending for type switch (*aIter) { - case SQL_ORDERBYKEY_STRING: + case OKeyType::String: { sal_Int32 nRes = lhs.second->getKeyString(i).compareTo(rhs.second->getKeyString(i)); if (nRes < 0) @@ -54,7 +54,7 @@ struct TKeyValueFunc : ::std::binary_function<OSortIndex::TIntValuePairVector::v return bGreater; } break; - case SQL_ORDERBYKEY_DOUBLE: + case OKeyType::Double: { double d1 = lhs.second->getKeyDouble(i); double d2 = rhs.second->getKeyDouble(i); @@ -65,7 +65,7 @@ struct TKeyValueFunc : ::std::binary_function<OSortIndex::TIntValuePairVector::v return bGreater; } break; - case SQL_ORDERBYKEY_NONE: + case OKeyType::NONE: break; } } @@ -118,7 +118,7 @@ void OSortIndex::Freeze() { OSL_ENSURE(! m_bFrozen,"OSortIndex::Freeze: already frozen!"); // Sortierung: - if (m_aKeyType[0] != SQL_ORDERBYKEY_NONE) + if (m_aKeyType[0] != OKeyType::NONE) // we will sort ourself when the first keyType say so ::std::sort(m_aKeyValues.begin(),m_aKeyValues.end(),TKeyValueFunc(this)); diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx index 9b130c98a11e..baa6cca0117c 100644 --- a/connectivity/source/drivers/file/FResultSet.cxx +++ b/connectivity/source/drivers/file/FResultSet.cxx @@ -1131,7 +1131,7 @@ void OResultSet::sortRows() case DataType::CHAR: case DataType::VARCHAR: case DataType::LONGVARCHAR: - eKeyType[i] = SQL_ORDERBYKEY_STRING; + eKeyType[i] = OKeyType::String; break; case DataType::OTHER: @@ -1146,12 +1146,12 @@ void OResultSet::sortRows() case DataType::TIME: case DataType::TIMESTAMP: case DataType::BIT: - eKeyType[i] = SQL_ORDERBYKEY_DOUBLE; + eKeyType[i] = OKeyType::Double; break; // Other types aren't implemented (so they are always FALSE) default: - eKeyType[i] = SQL_ORDERBYKEY_NONE; + eKeyType[i] = OKeyType::NONE; SAL_WARN( "connectivity.drivers","OFILECursor::Execute: Datentyp nicht implementiert"); break; } diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx index 9d9c97517677..5511274c0966 100644 --- a/connectivity/source/drivers/mork/MResultSet.cxx +++ b/connectivity/source/drivers/mork/MResultSet.cxx @@ -1162,7 +1162,7 @@ void SAL_CALL OResultSet::executeQuery() throw( ::com::sun::star::sdbc::SQLExcep { case DataType::CHAR: case DataType::VARCHAR: - eKeyType[i] = SQL_ORDERBYKEY_STRING; + eKeyType[i] = OKeyType::String; break; case DataType::OTHER: @@ -1177,12 +1177,12 @@ void SAL_CALL OResultSet::executeQuery() throw( ::com::sun::star::sdbc::SQLExcep case DataType::TIME: case DataType::TIMESTAMP: case DataType::BIT: - eKeyType[i] = SQL_ORDERBYKEY_DOUBLE; + eKeyType[i] = OKeyType::Double; break; // Other types aren't implemented (so they are always FALSE) default: - eKeyType[i] = SQL_ORDERBYKEY_NONE; + eKeyType[i] = OKeyType::NONE; OSL_FAIL("MResultSet::executeQuery: Order By Data Type not implemented"); break; } diff --git a/connectivity/source/inc/TSortIndex.hxx b/connectivity/source/inc/TSortIndex.hxx index 328dbccd0625..4db3fbd60566 100644 --- a/connectivity/source/inc/TSortIndex.hxx +++ b/connectivity/source/inc/TSortIndex.hxx @@ -24,12 +24,12 @@ namespace connectivity { - typedef enum + enum class OKeyType { - SQL_ORDERBYKEY_NONE, // do not sort - SQL_ORDERBYKEY_DOUBLE, // numeric key - SQL_ORDERBYKEY_STRING // String Key - } OKeyType; + NONE, // do not sort + Double, // numeric key + String // String Key + }; enum class TAscendingOrder { |