diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-02-19 15:22:05 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-02-25 23:58:04 +0100 |
commit | 250ef02bd80e15bdc7fe86ba149b8c838b363114 (patch) | |
tree | 457481e59c036b60838c9cd598ee660360963e5b /connectivity | |
parent | 86796f127b15fd33374f2a18344dc944b7b8314d (diff) |
connectivity: replace magic numbers with constants from CompareBookmark
Change-Id: Ifcd5766ce10de44f38d5c383cd7dc35b75152e88
Diffstat (limited to 'connectivity')
5 files changed, 15 insertions, 13 deletions
diff --git a/connectivity/source/drivers/calc/CResultSet.cxx b/connectivity/source/drivers/calc/CResultSet.cxx index 236c1702d27a..25f810ea64fd 100644 --- a/connectivity/source/drivers/calc/CResultSet.cxx +++ b/connectivity/source/drivers/calc/CResultSet.cxx @@ -110,7 +110,7 @@ sal_Bool SAL_CALL OCalcResultSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 SAL_CALL OCalcResultSet::compareBookmarks( const Any& lhs, const Any& rhs ) throw( SQLException, RuntimeException, std::exception) { - return (lhs == rhs) ? 0 : 2; + return (lhs == rhs) ? CompareBookmark::EQUAL : CompareBookmark::NOT_EQUAL; } sal_Bool SAL_CALL OCalcResultSet::hasOrderedBookmarks( ) throw( SQLException, RuntimeException, std::exception) diff --git a/connectivity/source/drivers/dbase/DResultSet.cxx b/connectivity/source/drivers/dbase/DResultSet.cxx index 148b6baecc2d..af7e9b96812e 100644 --- a/connectivity/source/drivers/dbase/DResultSet.cxx +++ b/connectivity/source/drivers/dbase/DResultSet.cxx @@ -122,14 +122,12 @@ sal_Int32 SAL_CALL ODbaseResultSet::compareBookmarks( const Any& lhs, const Any& ::dbtools::throwGenericSQLException(sMessage ,*this); } // if ( !( lhs >>= nFirst ) || !( rhs >>= nSecond ) ) - // have a look at CompareBookmark - // we can't use the names there because we already have defines with the same name from the parser if(nFirst < nSecond) - nResult = -1; + nResult = CompareBookmark::LESS; else if(nFirst > nSecond) - nResult = 1; + nResult = CompareBookmark::GREATER; else - nResult = 0; + nResult = CompareBookmark::EQUAL; return nResult; } diff --git a/connectivity/source/drivers/flat/EResultSet.cxx b/connectivity/source/drivers/flat/EResultSet.cxx index 84a3a078fe1f..1501766597e6 100644 --- a/connectivity/source/drivers/flat/EResultSet.cxx +++ b/connectivity/source/drivers/flat/EResultSet.cxx @@ -129,7 +129,7 @@ sal_Bool SAL_CALL OFlatResultSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 SAL_CALL OFlatResultSet::compareBookmarks( const Any& lhs, const Any& rhs ) throw( SQLException, RuntimeException, std::exception) { - return (lhs == rhs) ? 0 : 2; + return (lhs == rhs) ? CompareBookmark::EQUAL : CompareBookmark::NOT_EQUAL; } sal_Bool SAL_CALL OFlatResultSet::hasOrderedBookmarks( ) throw( SQLException, RuntimeException, std::exception) diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx index e9817f0ec1d9..1b355cbcc793 100644 --- a/connectivity/source/drivers/mork/MResultSet.cxx +++ b/connectivity/source/drivers/mork/MResultSet.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/sdbc/ResultSetType.hpp> #include <com/sun/star/sdbc/FetchDirection.hpp> #include <com/sun/star/sdbc/ResultSetConcurrency.hpp> +#include <com/sun/star/sdbcx/CompareBookmark.hpp> #include <comphelper/types.hxx> #include <connectivity/dbexception.hxx> #include <connectivity/dbtools.hxx> @@ -57,6 +58,7 @@ using namespace com::sun::star::uno; using namespace com::sun::star::lang; using namespace com::sun::star::beans; using namespace com::sun::star::sdbc; +using namespace com::sun::star::sdbcx; using namespace com::sun::star::container; using namespace com::sun::star::io; using namespace com::sun::star::util; @@ -1610,11 +1612,11 @@ sal_Int32 OResultSet::compareBookmarks( const ::com::sun::star::uno::Any& lhs, c } if(nFirst < nSecond) - nResult = -1; + nResult = CompareBookmark::LESS; else if(nFirst > nSecond) - nResult = 1; + nResult = CompareBookmark::GREATER; else - nResult = 0; + nResult = CompareBookmark::EQUAL; return nResult; } diff --git a/connectivity/source/drivers/mozab/MResultSet.cxx b/connectivity/source/drivers/mozab/MResultSet.cxx index 11c6a4bf34f6..77474f8caae2 100644 --- a/connectivity/source/drivers/mozab/MResultSet.cxx +++ b/connectivity/source/drivers/mozab/MResultSet.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/sdbc/ResultSetType.hpp> #include <com/sun/star/sdbc/FetchDirection.hpp> #include <com/sun/star/sdbc/ResultSetConcurrency.hpp> +#include <com/sun/star/sdbcx/CompareBookmark.hpp> #include <comphelper/types.hxx> #include <connectivity/dbexception.hxx> #include <connectivity/dbtools.hxx> @@ -56,6 +57,7 @@ using namespace com::sun::star::uno; using namespace com::sun::star::lang; using namespace com::sun::star::beans; using namespace com::sun::star::sdbc; +using namespace com::sun::star::sdbcx; using namespace com::sun::star::container; using namespace com::sun::star::io; using namespace com::sun::star::util; @@ -1619,11 +1621,11 @@ sal_Int32 OResultSet::compareBookmarks( const ::com::sun::star::uno::Any& lhs, c m_pStatement->getOwnConnection()->throwSQLException( STR_INVALID_BOOKMARK, *this ); if(nFirst < nSecond) - nResult = -1; + nResult = CompareBookmark::LESS; else if(nFirst > nSecond) - nResult = 1; + nResult = CompareBookmark::GREATER; else - nResult = 0; + nResult = CompareBookmark::EQUAL; return nResult; } |