diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-20 16:10:46 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-22 17:53:29 +0000 |
commit | a887bed580a3e6388f8da0c5a19fd87888e11e95 (patch) | |
tree | 43ec6b7239a964266cf1e059a1082ae15cf0d89b /connectivity | |
parent | Convert DragMode to scoped enum (diff) | |
download | core-a887bed580a3e6388f8da0c5a19fd87888e11e95.tar.gz core-a887bed580a3e6388f8da0c5a19fd87888e11e95.zip |
convert TAscendingOrder to scoped enum
Change-Id: Idd88c08df47c4175702cea0e0a36c6b3e031469f
Reviewed-on: https://gerrit.libreoffice.org/25212
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 | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/dbase/DResultSet.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/file/FResultSet.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/file/FStatement.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MResultSet.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MStatement.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/inc/TSortIndex.hxx | 9 |
7 files changed, 11 insertions, 10 deletions
diff --git a/connectivity/source/commontools/TSortIndex.cxx b/connectivity/source/commontools/TSortIndex.cxx index 59d170d1b564..2af3810bed57 100644 --- a/connectivity/source/commontools/TSortIndex.cxx +++ b/connectivity/source/commontools/TSortIndex.cxx @@ -39,7 +39,7 @@ struct TKeyValueFunc : ::std::binary_function<OSortIndex::TIntValuePairVector::v ::std::vector<OKeyType>::const_iterator aIter = aKeyType.begin(); for (::std::vector<sal_Int16>::size_type i=0;aIter != aKeyType.end(); ++aIter,++i) { - const bool bGreater = pIndex->getAscending(i) != SQL_ASC; + const bool bGreater = pIndex->getAscending(i) != TAscendingOrder::ASC; const bool bLess = !bGreater; // compare depending for type diff --git a/connectivity/source/drivers/dbase/DResultSet.cxx b/connectivity/source/drivers/dbase/DResultSet.cxx index 6c3f4a2a8ad0..40060a3c3d17 100644 --- a/connectivity/source/drivers/dbase/DResultSet.cxx +++ b/connectivity/source/drivers/dbase/DResultSet.cxx @@ -170,7 +170,7 @@ bool ODbaseResultSet::fillIndexValues(const Reference< XColumnsSupplier> &_xInde sal_uInt32 nRec = pIter->First(); while (nRec != NODE_NOTFOUND) { - if (m_aOrderbyAscending[0]) + if (m_aOrderbyAscending[0] != TAscendingOrder::NONE) m_pFileSet->get().push_back(nRec); else m_pFileSet->get().insert(m_pFileSet->get().begin(),nRec); diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx index 1903d5895c11..9b130c98a11e 100644 --- a/connectivity/source/drivers/file/FResultSet.cxx +++ b/connectivity/source/drivers/file/FResultSet.cxx @@ -1274,7 +1274,7 @@ bool OResultSet::OpenImpl() { m_aOrderbyColumnNumber.push_back(i); // ASC or DESC doesn't matter - m_aOrderbyAscending.push_back(SQL_ASC); + m_aOrderbyAscending.push_back(TAscendingOrder::ASC); } } bDistinct = true; diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx index f374b827a179..d37f1576a067 100644 --- a/connectivity/source/drivers/file/FStatement.cxx +++ b/connectivity/source/drivers/file/FStatement.cxx @@ -382,7 +382,7 @@ void OStatement_Base::setOrderbyColumn( OSQLParseNode* pColumnRef, m_aOrderbyColumnNumber.push_back((aFind - aSelectColumns->get().begin()) + 1); // Ascending or Descending? - m_aOrderbyAscending.push_back((SQL_ISTOKEN(pAscendingDescending,DESC)) ? SQL_DESC : SQL_ASC); + m_aOrderbyAscending.push_back((SQL_ISTOKEN(pAscendingDescending,DESC)) ? TAscendingOrder::DESC : TAscendingOrder::ASC); } diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx index ca0e94420fdf..9d9c97517677 100644 --- a/connectivity/source/drivers/mork/MResultSet.cxx +++ b/connectivity/source/drivers/mork/MResultSet.cxx @@ -1148,7 +1148,7 @@ void SAL_CALL OResultSet::executeQuery() throw( ::com::sun::star::sdbc::SQLExcep if(!IsSorted()) { m_aOrderbyColumnNumber.push_back(m_aColMapping[1]); - m_aOrderbyAscending.push_back(SQL_DESC); + m_aOrderbyAscending.push_back(TAscendingOrder::DESC); } bDistinct = true; } diff --git a/connectivity/source/drivers/mork/MStatement.cxx b/connectivity/source/drivers/mork/MStatement.cxx index f8b04da0eea6..f2aeba6d72a1 100644 --- a/connectivity/source/drivers/mork/MStatement.cxx +++ b/connectivity/source/drivers/mork/MStatement.cxx @@ -496,7 +496,7 @@ void OCommonStatement::setOrderbyColumn( OSQLParseNode* pColumnRef, m_aOrderbyColumnNumber.push_back(xColLocate->findColumn(aColumnName)); // Ascending or Descending? - m_aOrderbyAscending.push_back((SQL_ISTOKEN(pAscendingDescending,DESC)) ? SQL_DESC : SQL_ASC); + m_aOrderbyAscending.push_back((SQL_ISTOKEN(pAscendingDescending,DESC)) ? TAscendingOrder::DESC : TAscendingOrder::ASC); } diff --git a/connectivity/source/inc/TSortIndex.hxx b/connectivity/source/inc/TSortIndex.hxx index 07442209b809..328dbccd0625 100644 --- a/connectivity/source/inc/TSortIndex.hxx +++ b/connectivity/source/inc/TSortIndex.hxx @@ -31,11 +31,12 @@ namespace connectivity SQL_ORDERBYKEY_STRING // String Key } OKeyType; - typedef enum + enum class TAscendingOrder { - SQL_ASC = 1, // ascending - SQL_DESC = -1 // otherwise - } TAscendingOrder; + ASC = 1, // ascending + NONE = 0, + DESC = -1 // otherwise + }; class OKeySet; class OKeyValue; // simple class which holds a sal_Int32 and a ::std::vector<ORowSetValueDecoratorRef> |