From a8e7b4966846dc1005898add66a965eba9409840 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 27 Apr 2015 16:57:53 +0200 Subject: Use TriState instead of 0/1/-1 Change-Id: I6f53cd0ee1e7acd724186ab914bde43026ef6708 --- connectivity/source/drivers/mork/MResultSet.cxx | 12 ++++++------ 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(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 #include #include +#include #include "MStatement.hxx" #include "MQueryHelper.hxx" #include @@ -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 m_xColumns; // this are the select columns -- cgit