diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-01-28 19:56:39 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-01-28 20:24:39 +0100 |
commit | ead15254172d7d1f9f838cf21b4e5c246bfc7ca3 (patch) | |
tree | 7e4d7621d602b76b133f04c2cad8572ab778dada /connectivity/source/drivers | |
parent | 1b574435a591695fac694f7129631312b05ef06e (diff) |
bool improvements
Change-Id: If35c939adede6a912dee14714a7ceeab84ac977e
Diffstat (limited to 'connectivity/source/drivers')
-rw-r--r-- | connectivity/source/drivers/dbase/DIndex.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/dbase/DTable.cxx | 10 | ||||
-rw-r--r-- | connectivity/source/drivers/dbase/dindexnode.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/evoab2/NResultSet.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/file/FResultSet.cxx | 24 | ||||
-rw-r--r-- | connectivity/source/drivers/file/FStatement.cxx | 16 | ||||
-rw-r--r-- | connectivity/source/drivers/file/fcode.cxx | 8 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/Connection.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/flat/ETable.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MResultSet.cxx | 6 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MStatement.cxx | 6 | ||||
-rw-r--r-- | connectivity/source/drivers/mysql/YCatalog.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/postgresql/pq_databasemetadata.cxx | 4 | ||||
-rw-r--r-- | connectivity/source/drivers/postgresql/pq_tools.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/postgresql/pq_xcontainer.cxx | 4 |
15 files changed, 46 insertions, 46 deletions
diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx index 46237e707723..d51fa57767cf 100644 --- a/connectivity/source/drivers/dbase/DIndex.cxx +++ b/connectivity/source/drivers/dbase/DIndex.cxx @@ -195,7 +195,7 @@ sal_Bool ODbaseIndex::ConvertToKey(ONDXKey* rKey, sal_uInt32 nRec, const ORowSet } catch (Exception&) { - OSL_ASSERT(0); + OSL_ASSERT(false); return sal_False; } return sal_True; diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index a90a63e4d4b7..dc0ba14ed1dc 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -645,7 +645,7 @@ OUString ODbaseTable::getEntry(OConnection* _pConnection,const OUString& _sName } catch(const Exception&) { - OSL_ASSERT(0); + OSL_ASSERT(false); } return sURL; } @@ -2514,15 +2514,15 @@ void ODbaseTable::copyData(ODbaseTable* _pNewTable,sal_Int32 _nPos) if(_nPos) { aInsertRow = new OValueRefVector(_pNewTable->m_pColumns->getCount()); - ::std::for_each(aInsertRow->get().begin(),aInsertRow->get().end(),TSetRefBound(sal_True)); + ::std::for_each(aInsertRow->get().begin(),aInsertRow->get().end(),TSetRefBound(true)); } else aInsertRow = aRow; // we only have to bind the values which we need to copy into the new table - ::std::for_each(aRow->get().begin(),aRow->get().end(),TSetRefBound(sal_True)); + ::std::for_each(aRow->get().begin(),aRow->get().end(),TSetRefBound(true)); if(_nPos && (_nPos < (sal_Int32)aRow->get().size())) - (aRow->get())[nPos]->setBound(sal_False); + (aRow->get())[nPos]->setBound(false); sal_Bool bOk = sal_True; @@ -2558,7 +2558,7 @@ void ODbaseTable::copyData(ODbaseTable* _pNewTable,sal_Int32 _nPos) } else { - OSL_ASSERT(0); + OSL_ASSERT(false); } } // for(sal_uInt32 nRowPos = 0; nRowPos < m_aHeader.db_anz;++nRowPos) } diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx index 963a4009b008..b795ea869098 100644 --- a/connectivity/source/drivers/dbase/dindexnode.cxx +++ b/connectivity/source/drivers/dbase/dindexnode.cxx @@ -52,7 +52,7 @@ ONDXKey::ONDXKey(const OUString& aStr, sal_uInt32 nRec) if (!aStr.isEmpty()) { xValue = aStr; - xValue.setBound(sal_True); + xValue.setBound(true); } } // ----------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx index 4bff96debd98..2cc664bcfb0d 100644 --- a/connectivity/source/drivers/evoab2/NResultSet.cxx +++ b/connectivity/source/drivers/evoab2/NResultSet.cxx @@ -615,7 +615,7 @@ OEvoabResultSet::OEvoabResultSet( OCommonStatement* pStmt, OEvoabConnection *pCo ,m_pStatement(pStmt) ,m_pConnection(pConnection) ,m_xMetaData(NULL) - ,m_bWasNull(sal_True) + ,m_bWasNull(true) ,m_nFetchSize(0) ,m_nResultSetType(ResultSetType::SCROLL_INSENSITIVE) ,m_nFetchDirection(FetchDirection::FORWARD) diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx index 11da82b290b0..add766d87e25 100644 --- a/connectivity/source/drivers/file/FResultSet.cxx +++ b/connectivity/source/drivers/file/FResultSet.cxx @@ -672,7 +672,7 @@ void SAL_CALL OResultSet::deleteRow() throw(SQLException, RuntimeException) m_bRowDeleted = m_pTable->DeleteRow(*m_xColumns); if(m_bRowDeleted && m_pFileSet.is()) { - m_aRow->setDeleted(sal_True); + m_aRow->setDeleted(true); // don't touch the m_pFileSet member here m_aSkipDeletedSet.deletePosition(nPos); } @@ -695,7 +695,7 @@ void SAL_CALL OResultSet::cancelRowUpdates( ) throw(SQLException, RuntimeExcept OValueRefVector::Vector::iterator aIter = m_aInsertRow->get().begin()+1; for(;aIter != m_aInsertRow->get().end();++aIter) { - (*aIter)->setBound(sal_False); + (*aIter)->setBound(false); (*aIter)->setNull(); } } @@ -716,7 +716,7 @@ void SAL_CALL OResultSet::moveToInsertRow( ) throw(SQLException, RuntimeExcepti OValueRefVector::Vector::iterator aIter = m_aInsertRow->get().begin()+1; for(;aIter != m_aInsertRow->get().end();++aIter) { - (*aIter)->setBound(sal_False); + (*aIter)->setBound(false); (*aIter)->setNull(); } } @@ -736,7 +736,7 @@ void OResultSet::updateValue(sal_Int32 columnIndex ,const ORowSetValue& x) throw checkIndex(columnIndex ); columnIndex = mapColumn(columnIndex); - (m_aInsertRow->get())[columnIndex]->setBound(sal_True); + (m_aInsertRow->get())[columnIndex]->setBound(true); *(m_aInsertRow->get())[columnIndex] = x; } // ----------------------------------------------------------------------------- @@ -1184,7 +1184,7 @@ sal_Bool OResultSet::Move(IResultSetHelper::Movement eCursorPosition, sal_Int32 { *(m_aRow->get())[1] = m_nRowCountResult; *(m_aRow->get())[0] = sal_Int32(1); - (m_aRow->get())[1]->setBound(sal_True); + (m_aRow->get())[1]->setBound(true); (m_aSelectRow->get())[1] = (m_aRow->get())[1]; } } @@ -1300,7 +1300,7 @@ void OResultSet::sortRows() SAL_WARN( "connectivity.drivers","OFILECursor::Execute: Datentyp nicht implementiert"); break; } - (m_aSelectRow->get())[*aOrderByIter]->setBound(sal_True); + (m_aSelectRow->get())[*aOrderByIter]->setBound(true); } m_pSortIndex = new OSortIndex(eKeyType,m_aOrderbyAscending); @@ -1651,7 +1651,7 @@ void OResultSet::setBoundedColumns(const OValueRefRow& _rRow, ++i, ++aRowIter ) { - (*aRowIter)->setBound(sal_False); + (*aRowIter)->setBound(false); try { // get the table column and it's name @@ -1687,7 +1687,7 @@ void OResultSet::setBoundedColumns(const OValueRefRow& _rRow, (_rSelectRow->get())[nSelectColumnPos] = *aRowIter; } - (*aRowIter)->setBound(sal_True); + (*aRowIter)->setBound(true); sal_Int32 nType = DataType::OTHER; if (xTableColumn.is()) xTableColumn->getPropertyValue(sType) >>= nType; @@ -1775,7 +1775,7 @@ void OResultSet::doTableSpecials(const OSQLTable& _xTable) void OResultSet::clearInsertRow() { SAL_INFO( "connectivity.drivers", "file Ocke.Janssen@sun.com OResultSet::clearInsertRow" ); - m_aRow->setDeleted(sal_False); // set to false here because this is the new row + m_aRow->setDeleted(false); // set to false here because this is the new row OValueRefVector::Vector::iterator aIter = m_aInsertRow->get().begin(); const OValueRefVector::Vector::iterator aEnd = m_aInsertRow->get().end(); for(sal_Int32 nPos = 0;aIter != aEnd;++aIter,++nPos) @@ -1786,7 +1786,7 @@ void OResultSet::clearInsertRow() (m_aRow->get())[nPos]->setValue( (*aIter)->getValue() ); } rValue->setBound(nPos == 0); - rValue->setModified(sal_False); + rValue->setModified(false); rValue->setNull(); } } @@ -1797,8 +1797,8 @@ void OResultSet::initializeRow(OValueRefRow& _rRow,sal_Int32 _nColumnCount) if(!_rRow.is()) { _rRow = new OValueRefVector(_nColumnCount); - (_rRow->get())[0]->setBound(sal_True); - ::std::for_each(_rRow->get().begin()+1,_rRow->get().end(),TSetRefBound(sal_False)); + (_rRow->get())[0]->setBound(true); + ::std::for_each(_rRow->get().begin()+1,_rRow->get().end(),TSetRefBound(false)); } } // ----------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx index 44e6b2f0c812..984a806c6636 100644 --- a/connectivity/source/drivers/file/FStatement.cxx +++ b/connectivity/source/drivers/file/FStatement.cxx @@ -365,7 +365,7 @@ void OStatement_Base::setOrderbyColumn( OSQLParseNode* pColumnRef, aColumnName = pColumnRef->getChild(0)->getTokenValue(); else if (pColumnRef->count() == 3) { - pColumnRef->getChild(2)->parseNodeToStr( aColumnName, getOwnConnection(), NULL, sal_False, sal_False ); + pColumnRef->getChild(2)->parseNodeToStr( aColumnName, getOwnConnection(), NULL, false, false ); } else { @@ -440,18 +440,18 @@ void OStatement_Base::construct(const OUString& sql) throw(SQLException, Runtim Reference<XIndexAccess> xNames(m_xColNames,UNO_QUERY); // set the binding of the resultrow m_aRow = new OValueRefVector(xNames->getCount()); - (m_aRow->get())[0]->setBound(sal_True); - ::std::for_each(m_aRow->get().begin()+1,m_aRow->get().end(),TSetRefBound(sal_False)); + (m_aRow->get())[0]->setBound(true); + ::std::for_each(m_aRow->get().begin()+1,m_aRow->get().end(),TSetRefBound(false)); // set the binding of the resultrow m_aEvaluateRow = new OValueRefVector(xNames->getCount()); - (m_aEvaluateRow->get())[0]->setBound(sal_True); - ::std::for_each(m_aEvaluateRow->get().begin()+1,m_aEvaluateRow->get().end(),TSetRefBound(sal_False)); + (m_aEvaluateRow->get())[0]->setBound(true); + ::std::for_each(m_aEvaluateRow->get().begin()+1,m_aEvaluateRow->get().end(),TSetRefBound(false)); // set the select row m_aSelectRow = new OValueRefVector(m_aSQLIterator.getSelectColumns()->get().size()); - ::std::for_each(m_aSelectRow->get().begin(),m_aSelectRow->get().end(),TSetRefBound(sal_True)); + ::std::for_each(m_aSelectRow->get().begin(),m_aSelectRow->get().end(),TSetRefBound(true)); // create the column mapping createColumnMapping(); @@ -521,7 +521,7 @@ void OStatement_Base::GetAssignValues() sal_Int32 nCount = Reference<XIndexAccess>(m_xColNames,UNO_QUERY)->getCount(); m_aAssignValues = new OAssignValues(nCount); // unbound all - ::std::for_each(m_aAssignValues->get().begin()+1,m_aAssignValues->get().end(),TSetRefBound(sal_False)); + ::std::for_each(m_aAssignValues->get().begin()+1,m_aAssignValues->get().end(),TSetRefBound(false)); m_aParameterIndexes.resize(nCount+1,SQL_NO_PARAMETER); @@ -609,7 +609,7 @@ void OStatement_Base::GetAssignValues() sal_Int32 nCount = Reference<XIndexAccess>(m_xColNames,UNO_QUERY)->getCount(); m_aAssignValues = new OAssignValues(nCount); // unbound all - ::std::for_each(m_aAssignValues->get().begin()+1,m_aAssignValues->get().end(),TSetRefBound(sal_False)); + ::std::for_each(m_aAssignValues->get().begin()+1,m_aAssignValues->get().end(),TSetRefBound(false)); m_aParameterIndexes.resize(nCount+1,SQL_NO_PARAMETER); diff --git a/connectivity/source/drivers/file/fcode.cxx b/connectivity/source/drivers/file/fcode.cxx index fb3883cb572b..ba787a7cc8e4 100644 --- a/connectivity/source/drivers/file/fcode.cxx +++ b/connectivity/source/drivers/file/fcode.cxx @@ -86,7 +86,7 @@ void OOperandRow::bindValue(const OValueRefRow& _pRow) OSL_ENSURE(_pRow.is(),"NO EMPTY row allowed!"); m_pRow = _pRow; OSL_ENSURE(m_pRow.is() && m_nRowPos < m_pRow->get().size(),"Invalid RowPos is >= vector.size()"); - (m_pRow->get())[m_nRowPos]->setBound(sal_True); + (m_pRow->get())[m_nRowPos]->setBound(true); } // ----------------------------------------------------------------------------- void OOperandRow::setValue(const ORowSetValue& _rVal) @@ -160,13 +160,13 @@ OOperandConst::OOperandConst(const OSQLParseNode& rColumnRef, const OUString& aS case SQL_NODE_STRING: m_aValue = aStrValue; m_eDBType = DataType::VARCHAR; - m_aValue.setBound(sal_True); + m_aValue.setBound(true); return; case SQL_NODE_INTNUM: case SQL_NODE_APPROXNUM: m_aValue = aStrValue.toDouble(); m_eDBType = DataType::DOUBLE; - m_aValue.setBound(sal_True); + m_aValue.setBound(true); return; default: break; @@ -186,7 +186,7 @@ OOperandConst::OOperandConst(const OSQLParseNode& rColumnRef, const OUString& aS { SAL_WARN( "connectivity.drivers", "Parse Error"); } - m_aValue.setBound(sal_True); + m_aValue.setBound(true); } ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx index f555e2f4a3a2..ce5ef145cddf 100644 --- a/connectivity/source/drivers/firebird/Connection.cxx +++ b/connectivity/source/drivers/firebird/Connection.cxx @@ -82,7 +82,7 @@ Connection::Connection(FirebirdDriver* _pDriver) , m_sFirebirdURL() , m_bIsEmbedded(sal_False) , m_xEmbeddedStorage(0) - , m_bIsFile(sal_False) + , m_bIsFile(false) , m_sUser() , m_bIsAutoCommit(sal_False) , m_bIsReadOnly(sal_False) diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx index bcc866d48795..e7c2e23abc3a 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -511,7 +511,7 @@ OUString OFlatTable::getEntry() } catch(const Exception&) { - OSL_ASSERT(0); + OSL_ASSERT(false); } return sURL; } diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx index 5ccb98d4e38e..7baac6653c6e 100644 --- a/connectivity/source/drivers/mork/MResultSet.cxx +++ b/connectivity/source/drivers/mork/MResultSet.cxx @@ -1405,7 +1405,7 @@ void OResultSet::setBoundedColumns(const OValueRow& _rRow, _rColMapping[nSelectColumnPos] = nTableColumnPos; } - aRowIter->setBound(sal_True); + aRowIter->setBound(true); aRowIter->setTypeKind(DataType::VARCHAR); } } @@ -1672,7 +1672,7 @@ void OResultSet::updateValue(sal_Int32 columnIndex ,const ORowSetValue& x) throw checkIndex(columnIndex ); columnIndex = mapColumn(columnIndex); - (m_aRow->get())[columnIndex].setBound(sal_True); + (m_aRow->get())[columnIndex].setBound(true); (m_aRow->get())[columnIndex] = x; m_nUpdatedRow = getCurrentCardNumber(); // m_RowStates = m_RowStates | RowStates_Updated; @@ -1690,7 +1690,7 @@ void SAL_CALL OResultSet::updateNull( sal_Int32 columnIndex ) throw(SQLException checkIndex(columnIndex ); columnIndex = mapColumn(columnIndex); - (m_aRow->get())[columnIndex].setBound(sal_True); + (m_aRow->get())[columnIndex].setBound(true); (m_aRow->get())[columnIndex].setNull(); m_nUpdatedRow = getCurrentCardNumber(); // m_RowStates = m_RowStates | RowStates_Updated; diff --git a/connectivity/source/drivers/mork/MStatement.cxx b/connectivity/source/drivers/mork/MStatement.cxx index 2418877570dc..0d719b591efb 100644 --- a/connectivity/source/drivers/mork/MStatement.cxx +++ b/connectivity/source/drivers/mork/MStatement.cxx @@ -239,8 +239,8 @@ OCommonStatement::StatementType OCommonStatement::parseSql( const OUString& sql xNames = Reference<XIndexAccess>(m_xColNames,UNO_QUERY); // set the binding of the resultrow m_aRow = new OValueVector(xNames->getCount()); - (m_aRow->get())[0].setBound(sal_True); - ::std::for_each(m_aRow->get().begin()+1,m_aRow->get().end(),TSetBound(sal_False)); + (m_aRow->get())[0].setBound(true); + ::std::for_each(m_aRow->get().begin()+1,m_aRow->get().end(),TSetBound(false)); // create the column mapping createColumnMapping(); @@ -560,7 +560,7 @@ void OCommonStatement::setOrderbyColumn( OSQLParseNode* pColumnRef, aColumnName = pColumnRef->getChild(0)->getTokenValue(); else if (pColumnRef->count() == 3) { - pColumnRef->getChild(2)->parseNodeToStr( aColumnName, getOwnConnection(), NULL, sal_False, sal_False ); + pColumnRef->getChild(2)->parseNodeToStr( aColumnName, getOwnConnection(), NULL, false, false ); } else { diff --git a/connectivity/source/drivers/mysql/YCatalog.cxx b/connectivity/source/drivers/mysql/YCatalog.cxx index e8d1d3323641..3541ea8dd3e5 100644 --- a/connectivity/source/drivers/mysql/YCatalog.cxx +++ b/connectivity/source/drivers/mysql/YCatalog.cxx @@ -80,7 +80,7 @@ void OMySQLCatalog::refreshViews() // as of this writing might not return the proper information in getTableTypes, so // don't rely on it. // during #73245# / 2007-10-26 / frank.schoenheit@sun.com - bool bSupportsViews = sal_True; + bool bSupportsViews = true; TStringVector aVector; if ( bSupportsViews ) diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx index 11e36b3851c6..f15021b15511 100644 --- a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx +++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx @@ -2167,9 +2167,9 @@ struct TypeInfoByDataTypeSorter a[0 /*TYPE_NAME*/] >>= nameA; b[0 /*TYPE_NAME*/] >>= nameB; if( nameA.startsWith( "int4" ) ) - return 1; + return true; if( nameB.startsWith( "int4" ) ) - return 0; + return false; return nameA.compareTo( nameB ) < 0; } diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx index afb296565898..f79a0979af9a 100644 --- a/connectivity/source/drivers/postgresql/pq_tools.cxx +++ b/connectivity/source/drivers/postgresql/pq_tools.cxx @@ -345,7 +345,7 @@ OUString extractTableFromInsert( const OUString & sql ) { // the second part of the table name does not use quotes // parse on - quote = 0; + quote = false; } } else diff --git a/connectivity/source/drivers/postgresql/pq_xcontainer.cxx b/connectivity/source/drivers/postgresql/pq_xcontainer.cxx index 3ff17784aa4b..6843d97c06e1 100644 --- a/connectivity/source/drivers/postgresql/pq_xcontainer.cxx +++ b/connectivity/source/drivers/postgresql/pq_xcontainer.cxx @@ -465,13 +465,13 @@ void Container::fire( const EventBroadcastHelper &helper ) } catch ( com::sun::star::uno::RuntimeException & ) { - OSL_ENSURE( 0, "exception catched" ); + OSL_ENSURE( false, "exception catched" ); // loose coupling, a runtime exception shall not break anything // TODO: log away as warning ! } catch( com::sun::star::uno::Exception & ) { - OSL_ENSURE( 0, "exception from listener flying through" ); + OSL_ENSURE( false, "exception from listener flying through" ); throw; } } |