diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-27 16:57:53 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-28 10:21:05 +0200 |
commit | a8e7b4966846dc1005898add66a965eba9409840 (patch) | |
tree | ba4cfded9c83d530c3b1ce5c81f8eabadf657611 | |
parent | 9a492cee4b68ffbc68886a6fa628f9741a29576d (diff) |
Use TriState instead of 0/1/-1
Change-Id: I6f53cd0ee1e7acd724186ab914bde43026ef6708
-rw-r--r-- | connectivity/source/drivers/mork/MResultSet.cxx | 12 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MResultSet.hxx | 3 |
2 files changed, 8 insertions, 7 deletions
diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx index 5fdf9186240e..ff5351a9701f 100644 --- a/connectivity/source/drivers/mork/MResultSet.cxx +++ b/connectivity/source/drivers/mork/MResultSet.cxx @@ -109,7 +109,7 @@ OResultSet::OResultSet(OCommonStatement* pStmt, const ::boost::shared_ptr< conne ,m_nNewRow(0) ,m_nUpdatedRow(0) ,m_RowStates(0) - ,m_bIsReadOnly(-1) + ,m_bIsReadOnly(TRISTATE_INDET) { //m_aQuery.setMaxNrOfReturns(pStmt->getOwnConnection()->getMaxResultRecords()); } @@ -683,7 +683,7 @@ void OResultSet::getFastPropertyValue( break; case PROPERTY_ID_ISBOOKMARKABLE: const_cast< OResultSet* >( this )->determineReadOnly(); - rValue <<= !m_bIsReadOnly; + rValue <<= (m_bIsReadOnly == TRISTATE_FALSE); break; } } @@ -1070,7 +1070,7 @@ void OResultSet::fillRowData() // If the query is a 0=1 then set Row count to 0 and return if ( m_bIsAlwaysFalseQuery ) { - m_bIsReadOnly = 1; + m_bIsReadOnly = TRISTATE_TRUE; return; } @@ -1837,14 +1837,14 @@ bool OResultSet::determineReadOnly() { // OSL_FAIL( "OResultSet::determineReadOnly( ) not implemented" ); - if (m_bIsReadOnly == -1) + if (m_bIsReadOnly == TRISTATE_INDET) { - m_bIsReadOnly = sal_True; + m_bIsReadOnly = TRISTATE_TRUE; // OConnection* xConnection = static_cast<OConnection*>(m_pStatement->getConnection().get()); // m_bIsReadOnly = !m_aQueryHelper.isWritable(xConnection) || m_bIsAlwaysFalseQuery; } - return m_bIsReadOnly != 0; + return m_bIsReadOnly != TRISTATE_FALSE; } void OResultSet::setTable(OTable* _rTable) diff --git a/connectivity/source/drivers/mork/MResultSet.hxx b/connectivity/source/drivers/mork/MResultSet.hxx index d4c930baf1b4..e35fa7927837 100644 --- a/connectivity/source/drivers/mork/MResultSet.hxx +++ b/connectivity/source/drivers/mork/MResultSet.hxx @@ -33,6 +33,7 @@ #include <com/sun/star/sdbc/XRowUpdate.hpp> #include <cppuhelper/compbase12.hxx> #include <comphelper/proparrhlp.hxx> +#include <tools/gen.hxx> #include "MStatement.hxx" #include "MQueryHelper.hxx" #include <connectivity/CommonTools.hxx> @@ -241,7 +242,7 @@ protected: sal_Int32 m_nNewRow; //inserted row sal_Int32 m_nUpdatedRow; //updated row sal_Int32 m_RowStates; - sal_Int32 m_bIsReadOnly; + TriState m_bIsReadOnly; inline void resetParameters() { m_nParamIndex = 0; } ::rtl::Reference<connectivity::OSQLColumns> m_xColumns; // this are the select columns |