diff options
Diffstat (limited to 'connectivity/source/commontools')
41 files changed, 95 insertions, 92 deletions
diff --git a/connectivity/source/commontools/AutoRetrievingBase.cxx b/connectivity/source/commontools/AutoRetrievingBase.cxx index 99bdeee12131..99bdeee12131 100644..100755 --- a/connectivity/source/commontools/AutoRetrievingBase.cxx +++ b/connectivity/source/commontools/AutoRetrievingBase.cxx diff --git a/connectivity/source/commontools/BlobHelper.cxx b/connectivity/source/commontools/BlobHelper.cxx index 48681b61e1f9..48681b61e1f9 100644..100755 --- a/connectivity/source/commontools/BlobHelper.cxx +++ b/connectivity/source/commontools/BlobHelper.cxx diff --git a/connectivity/source/commontools/CommonTools.cxx b/connectivity/source/commontools/CommonTools.cxx index 43c89fb56cfd..43c89fb56cfd 100644..100755 --- a/connectivity/source/commontools/CommonTools.cxx +++ b/connectivity/source/commontools/CommonTools.cxx diff --git a/connectivity/source/commontools/ConnectionWrapper.cxx b/connectivity/source/commontools/ConnectionWrapper.cxx index dc354c24eb9b..dc354c24eb9b 100644..100755 --- a/connectivity/source/commontools/ConnectionWrapper.cxx +++ b/connectivity/source/commontools/ConnectionWrapper.cxx diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx index 531df746045f..cd335987c121 100644..100755 --- a/connectivity/source/commontools/DateConversion.cxx +++ b/connectivity/source/commontools/DateConversion.cxx @@ -44,6 +44,7 @@ #include "diagnose_ex.h" #include <comphelper/numbers.hxx> #include <rtl/ustrbuf.hxx> +#include <tools/diagnose_ex.h> using namespace ::connectivity; @@ -364,56 +365,59 @@ void DBTypeConversion::setValue(const Reference<XColumnUpdate>& xVariant, } //------------------------------------------------------------------------------ -double DBTypeConversion::getValue(const Reference<XColumn>& xVariant, - const Date& rNullDate, - sal_Int16 nKeyType) +double DBTypeConversion::getValue( const Reference< XColumn >& i_column, const Date& i_relativeToNullDate ) { try { - switch (nKeyType & ~NumberFormat::DEFINED) + const Reference< XPropertySet > xProp( i_column, UNO_QUERY_THROW ); + + const sal_Int32 nColumnType = ::comphelper::getINT32( xProp->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex( PROPERTY_ID_TYPE ) ) ); + switch ( nColumnType ) { - case NumberFormat::DATE: - return toDouble( xVariant->getDate(), rNullDate); - case NumberFormat::DATETIME: - return toDouble(xVariant->getTimestamp(),rNullDate); - case NumberFormat::TIME: - return toDouble(xVariant->getTime()); - default: + case DataType::DATE: + return toDouble( i_column->getDate(), i_relativeToNullDate ); + + case DataType::TIME: + return toDouble( i_column->getTime() ); + + case DataType::TIMESTAMP: + return toDouble( i_column->getTimestamp(), i_relativeToNullDate ); + + default: { - Reference<XPropertySet> xProp(xVariant,UNO_QUERY); - if ( xProp.is() - && xProp->getPropertySetInfo()->hasPropertyByName(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISSIGNED)) - && !::comphelper::getBOOL(xProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISSIGNED))) ) + sal_Bool bIsSigned = sal_True; + OSL_VERIFY( xProp->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex( PROPERTY_ID_ISSIGNED ) ) >>= bIsSigned ); + if ( !bIsSigned ) { - switch (::comphelper::getINT32(xProp->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)))) + switch ( nColumnType) { case DataType::TINYINT: - return static_cast<double>(static_cast<sal_uInt8>(xVariant->getByte())); + return static_cast<double>(static_cast<sal_uInt8>(i_column->getByte())); case DataType::SMALLINT: - return static_cast<double>(static_cast<sal_uInt16>(xVariant->getShort())); + return static_cast<double>(static_cast<sal_uInt16>(i_column->getShort())); case DataType::INTEGER: - return static_cast<double>(static_cast<sal_uInt32>(xVariant->getInt())); + return static_cast<double>(static_cast<sal_uInt32>(i_column->getInt())); case DataType::BIGINT: - return static_cast<double>(static_cast<sal_uInt64>(xVariant->getLong())); + return static_cast<double>(static_cast<sal_uInt64>(i_column->getLong())); } } - - return xVariant->getDouble(); } + return i_column->getDouble(); } } - catch(const Exception& ) + catch( const Exception& ) { + DBG_UNHANDLED_EXCEPTION(); return 0.0; } } //------------------------------------------------------------------------------ -::rtl::OUString DBTypeConversion::getValue(const Reference< XPropertySet>& _xColumn, +::rtl::OUString DBTypeConversion::getFormattedValue(const Reference< XPropertySet>& _xColumn, const Reference<XNumberFormatter>& _xFormatter, const ::com::sun::star::lang::Locale& _rLocale, const Date& _rNullDate) { - OSL_ENSURE(_xColumn.is() && _xFormatter.is(), "DBTypeConversion::getValue: invalid arg !"); + OSL_ENSURE(_xColumn.is() && _xFormatter.is(), "DBTypeConversion::getFormattedValue: invalid arg !"); if (!_xColumn.is() || !_xFormatter.is()) return ::rtl::OUString(); @@ -424,7 +428,7 @@ double DBTypeConversion::getValue(const Reference<XColumn>& xVariant, } catch (const Exception& ) { - OSL_ENSURE(false, "DBTypeConversion::getValue: caught an exception while asking for the format key!"); + OSL_ENSURE(false, "DBTypeConversion::getFormattedValue: caught an exception while asking for the format key!"); } if (!nKey) @@ -440,11 +444,11 @@ double DBTypeConversion::getValue(const Reference<XColumn>& xVariant, sal_Int16 nKeyType = getNumberFormatType(_xFormatter, nKey) & ~NumberFormat::DEFINED; - return DBTypeConversion::getValue(Reference< XColumn > (_xColumn, UNO_QUERY), _xFormatter, _rNullDate, nKey, nKeyType); + return DBTypeConversion::getFormattedValue(Reference< XColumn > (_xColumn, UNO_QUERY), _xFormatter, _rNullDate, nKey, nKeyType); } //------------------------------------------------------------------------------ -::rtl::OUString DBTypeConversion::getValue(const Reference<XColumn>& xVariant, +::rtl::OUString DBTypeConversion::getFormattedValue(const Reference<XColumn>& xVariant, const Reference<XNumberFormatter>& xFormatter, const Date& rNullDate, sal_Int32 nKey, @@ -461,23 +465,20 @@ double DBTypeConversion::getValue(const Reference<XColumn>& xVariant, case NumberFormat::DATETIME: { // get a value which represents the given date, relative to the given null date - double fValue = getValue(xVariant, rNullDate, nKeyType); + double fValue = getValue( xVariant, rNullDate ); if ( !xVariant->wasNull() ) { // get the null date of the formatter Date aFormatterNullDate( rNullDate ); try { - Reference< XPropertySet > xFormatterSettings; - Reference< XNumberFormatsSupplier > xSupplier( xFormatter->getNumberFormatsSupplier( ) ); - if ( xSupplier.is() ) - xFormatterSettings = xSupplier->getNumberFormatSettings(); - if ( xFormatterSettings.is() ) - xFormatterSettings->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NullDate" ) ) ) >>= aFormatterNullDate; + Reference< XNumberFormatsSupplier > xSupplier( xFormatter->getNumberFormatsSupplier(), UNO_SET_THROW ); + Reference< XPropertySet > xFormatterSettings( xSupplier->getNumberFormatSettings(), UNO_SET_THROW ); + OSL_VERIFY( xFormatterSettings->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NullDate" ) ) ) >>= aFormatterNullDate ); } catch( const Exception& ) { - OSL_ENSURE( sal_False, "DBTypeConversion::getValue: caught an exception while retrieving the formatter's NullDate!" ); + DBG_UNHANDLED_EXCEPTION(); } // get a value which represents the given date, relative to the null date of the formatter fValue -= toDays( rNullDate, aFormatterNullDate ); diff --git a/connectivity/source/commontools/DriversConfig.cxx b/connectivity/source/commontools/DriversConfig.cxx index cc19bce60abb..cc19bce60abb 100644..100755 --- a/connectivity/source/commontools/DriversConfig.cxx +++ b/connectivity/source/commontools/DriversConfig.cxx diff --git a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx index ad915996e1e7..96ab611142c0 100644..100755 --- a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx +++ b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx @@ -901,11 +901,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const } //--------------------------------------------------------------------------------------- -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(void* serviceManager, com::sun::star::registry::XRegistryKey* registryKey) -{ - return cppu::component_writeInfoHelper(serviceManager, registryKey, entries); -} -//--------------------------------------------------------------------------------------- SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* implName, ::com::sun::star::lang::XMultiServiceFactory* serviceManager, void* registryKey) { return cppu::component_getFactoryHelper(implName, serviceManager, registryKey, entries); diff --git a/connectivity/source/commontools/FDatabaseMetaDataResultSetMetaData.cxx b/connectivity/source/commontools/FDatabaseMetaDataResultSetMetaData.cxx index 0ec2d579337b..0ec2d579337b 100644..100755 --- a/connectivity/source/commontools/FDatabaseMetaDataResultSetMetaData.cxx +++ b/connectivity/source/commontools/FDatabaseMetaDataResultSetMetaData.cxx diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx index c33ad7ff312c..0be8ea3f49f6 100644..100755 --- a/connectivity/source/commontools/FValue.cxx +++ b/connectivity/source/commontools/FValue.cxx @@ -33,7 +33,7 @@ #include "connectivity/FValue.hxx" #include "connectivity/CommonTools.hxx" #include <connectivity/dbconversion.hxx> -#include <cppuhelper/extract.hxx> +#include <comphelper/extract.hxx> #include <com/sun/star/io/XInputStream.hpp> #include <rtl/ustrbuf.hxx> #include <rtl/logfile.hxx> @@ -1754,7 +1754,7 @@ Sequence<sal_Int8> ORowSetValue::getSequence() const } // ----------------------------------------------------------------------------- -::com::sun::star::util::Date ORowSetValue::getDate() const +::com::sun::star::util::Date ORowSetValue::getDate() const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbtools", "Ocke.Janssen@sun.com", "ORowSetValue::getDate" ); ::com::sun::star::util::Date aValue; @@ -1769,8 +1769,6 @@ Sequence<sal_Int8> ORowSetValue::getSequence() const break; case DataType::DECIMAL: case DataType::NUMERIC: - aValue = DBTypeConversion::toDate((double)*this); - break; case DataType::FLOAT: case DataType::DOUBLE: case DataType::REAL: @@ -1788,12 +1786,28 @@ Sequence<sal_Int8> ORowSetValue::getSequence() const aValue.Year = pDateTime->Year; } break; + case DataType::BIT: + case DataType::BOOLEAN: + case DataType::TINYINT: + case DataType::SMALLINT: + case DataType::INTEGER: + case DataType::BIGINT: + aValue = DBTypeConversion::toDate( double( sal_Int64( *this ) ) ); + break; + + case DataType::BLOB: + case DataType::CLOB: + case DataType::OBJECT: default: - { - Any aAnyValue = getAny(); - aAnyValue >>= aValue; - break; - } + OSL_ENSURE( false, "ORowSetValue::getDate: cannot retrieve the data!" ); + // NO break! + + case DataType::BINARY: + case DataType::VARBINARY: + case DataType::LONGVARBINARY: + case DataType::TIME: + aValue = DBTypeConversion::toDate( (double)0 ); + break; } } return aValue; diff --git a/connectivity/source/commontools/ParamterSubstitution.cxx b/connectivity/source/commontools/ParamterSubstitution.cxx index 294c44dc9c23..294c44dc9c23 100644..100755 --- a/connectivity/source/commontools/ParamterSubstitution.cxx +++ b/connectivity/source/commontools/ParamterSubstitution.cxx diff --git a/connectivity/source/commontools/RowFunctionParser.cxx b/connectivity/source/commontools/RowFunctionParser.cxx index 40e119419f2d..40e119419f2d 100644..100755 --- a/connectivity/source/commontools/RowFunctionParser.cxx +++ b/connectivity/source/commontools/RowFunctionParser.cxx diff --git a/connectivity/source/commontools/TColumnsHelper.cxx b/connectivity/source/commontools/TColumnsHelper.cxx index f6b61ffe80a6..f6b61ffe80a6 100644..100755 --- a/connectivity/source/commontools/TColumnsHelper.cxx +++ b/connectivity/source/commontools/TColumnsHelper.cxx diff --git a/connectivity/source/commontools/TConnection.cxx b/connectivity/source/commontools/TConnection.cxx index a0808ae5e852..a0808ae5e852 100644..100755 --- a/connectivity/source/commontools/TConnection.cxx +++ b/connectivity/source/commontools/TConnection.cxx diff --git a/connectivity/source/commontools/TDatabaseMetaDataBase.cxx b/connectivity/source/commontools/TDatabaseMetaDataBase.cxx index 86d89d8698b7..86d89d8698b7 100644..100755 --- a/connectivity/source/commontools/TDatabaseMetaDataBase.cxx +++ b/connectivity/source/commontools/TDatabaseMetaDataBase.cxx diff --git a/connectivity/source/commontools/TIndex.cxx b/connectivity/source/commontools/TIndex.cxx index 87ed49f030ae..87ed49f030ae 100644..100755 --- a/connectivity/source/commontools/TIndex.cxx +++ b/connectivity/source/commontools/TIndex.cxx diff --git a/connectivity/source/commontools/TIndexColumns.cxx b/connectivity/source/commontools/TIndexColumns.cxx index 2580e6d493f8..2580e6d493f8 100644..100755 --- a/connectivity/source/commontools/TIndexColumns.cxx +++ b/connectivity/source/commontools/TIndexColumns.cxx diff --git a/connectivity/source/commontools/TIndexes.cxx b/connectivity/source/commontools/TIndexes.cxx index 796310d36039..796310d36039 100644..100755 --- a/connectivity/source/commontools/TIndexes.cxx +++ b/connectivity/source/commontools/TIndexes.cxx diff --git a/connectivity/source/commontools/TKey.cxx b/connectivity/source/commontools/TKey.cxx index fa67a745f2bb..fa67a745f2bb 100644..100755 --- a/connectivity/source/commontools/TKey.cxx +++ b/connectivity/source/commontools/TKey.cxx diff --git a/connectivity/source/commontools/TKeyColumns.cxx b/connectivity/source/commontools/TKeyColumns.cxx index 791b735dc652..791b735dc652 100644..100755 --- a/connectivity/source/commontools/TKeyColumns.cxx +++ b/connectivity/source/commontools/TKeyColumns.cxx diff --git a/connectivity/source/commontools/TKeys.cxx b/connectivity/source/commontools/TKeys.cxx index 01d2be6d087f..01d2be6d087f 100644..100755 --- a/connectivity/source/commontools/TKeys.cxx +++ b/connectivity/source/commontools/TKeys.cxx diff --git a/connectivity/source/commontools/TPrivilegesResultSet.cxx b/connectivity/source/commontools/TPrivilegesResultSet.cxx index a9e21fb27ec3..a9e21fb27ec3 100644..100755 --- a/connectivity/source/commontools/TPrivilegesResultSet.cxx +++ b/connectivity/source/commontools/TPrivilegesResultSet.cxx diff --git a/connectivity/source/commontools/TSkipDeletedSet.cxx b/connectivity/source/commontools/TSkipDeletedSet.cxx index 99d89b83109d..90dbf8c6487e 100644..100755 --- a/connectivity/source/commontools/TSkipDeletedSet.cxx +++ b/connectivity/source/commontools/TSkipDeletedSet.cxx @@ -155,10 +155,15 @@ sal_Bool OSkipDeletedSet::skipDeleted(IResultSetHelper::Movement _eCursorPositio bDone = sal_False; } - if(bDataFound && bDone ) + if(bDataFound && bDone) { const sal_Int32 nDriverPos = m_pHelper->getDriverPos(); - if ( ::std::find(m_aBookmarksPositions.begin(),m_aBookmarksPositions.end(),nDriverPos) == m_aBookmarksPositions.end() ) + if ( m_bDeletedVisible ) + { + if ( nDriverPos > (sal_Int32)m_aBookmarksPositions.size() ) + m_aBookmarksPositions.push_back(nDriverPos); + } + else if ( ::std::find(m_aBookmarksPositions.begin(),m_aBookmarksPositions.end(),nDriverPos) == m_aBookmarksPositions.end() ) m_aBookmarksPositions.push_back(nDriverPos); /*sal_Int32 nDriverPos = m_pHelper->getDriverPos(); if(m_aBookmarks.find(nDriverPos) == m_aBookmarks.end()) diff --git a/connectivity/source/commontools/TSortIndex.cxx b/connectivity/source/commontools/TSortIndex.cxx index 8c88dabd7099..8c88dabd7099 100644..100755 --- a/connectivity/source/commontools/TSortIndex.cxx +++ b/connectivity/source/commontools/TSortIndex.cxx diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx index 6a8161da314b..6a8161da314b 100644..100755 --- a/connectivity/source/commontools/TTableHelper.cxx +++ b/connectivity/source/commontools/TTableHelper.cxx diff --git a/connectivity/source/commontools/conncleanup.cxx b/connectivity/source/commontools/conncleanup.cxx index acf6324a10f4..acf6324a10f4 100644..100755 --- a/connectivity/source/commontools/conncleanup.cxx +++ b/connectivity/source/commontools/conncleanup.cxx diff --git a/connectivity/source/commontools/dbcharset.cxx b/connectivity/source/commontools/dbcharset.cxx index a51cc0eeef02..a51cc0eeef02 100644..100755 --- a/connectivity/source/commontools/dbcharset.cxx +++ b/connectivity/source/commontools/dbcharset.cxx diff --git a/connectivity/source/commontools/dbconversion.cxx b/connectivity/source/commontools/dbconversion.cxx index 5b759e170f68..5b759e170f68 100644..100755 --- a/connectivity/source/commontools/dbconversion.cxx +++ b/connectivity/source/commontools/dbconversion.cxx diff --git a/connectivity/source/commontools/dbexception.cxx b/connectivity/source/commontools/dbexception.cxx index ea96f9cb0c9e..ea96f9cb0c9e 100644..100755 --- a/connectivity/source/commontools/dbexception.cxx +++ b/connectivity/source/commontools/dbexception.cxx diff --git a/connectivity/source/commontools/dbmetadata.cxx b/connectivity/source/commontools/dbmetadata.cxx index acb995978f5a..acb995978f5a 100644..100755 --- a/connectivity/source/commontools/dbmetadata.cxx +++ b/connectivity/source/commontools/dbmetadata.cxx diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index a0e8534cd60d..9ee1581c5c3b 100644..100755 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -260,7 +260,7 @@ Reference< XDataSource> getDataSource_allowException( const ::rtl::OUString& _rsTitleOrPath, const Reference< XMultiServiceFactory >& _rxFactory ) { - OSL_ENSURE( _rsTitleOrPath.getLength(), "getDataSource_allowException: invalid arg !" ); + ENSURE_OR_RETURN( _rsTitleOrPath.getLength(), "getDataSource_allowException: invalid arg !", NULL ); Reference< XNameAccess> xDatabaseContext( _rxFactory->createInstance( @@ -280,8 +280,9 @@ Reference< XDataSource > getDataSource( { xDS = getDataSource_allowException( _rsTitleOrPath, _rxFactory ); } - catch(Exception) + catch( const Exception& ) { + DBG_UNHANDLED_EXCEPTION(); } return xDS; diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx index 21b17eeec624..0e35af8434b1 100644..100755 --- a/connectivity/source/commontools/dbtools2.cxx +++ b/connectivity/source/commontools/dbtools2.cxx @@ -586,7 +586,6 @@ bool getDataSourceSetting( const Reference< XInterface >& _xChild, const ::rtl:: try { const Reference< XPropertySet> xDataSourceProperties( findDataSource( _xChild ), UNO_QUERY ); - OSL_ENSURE( xDataSourceProperties.is(), "getDataSourceSetting: invalid data source object!" ); if ( !xDataSourceProperties.is() ) return false; diff --git a/connectivity/source/commontools/filtermanager.cxx b/connectivity/source/commontools/filtermanager.cxx index 8c3153a8b974..5e06062b1846 100644..100755 --- a/connectivity/source/commontools/filtermanager.cxx +++ b/connectivity/source/commontools/filtermanager.cxx @@ -36,6 +36,8 @@ #include "TConnection.hxx" #include <osl/diagnose.h> #include "connectivity/dbtools.hxx" +#include <tools/diagnose_ex.h> +#include <rtl/ustrbuf.hxx> //........................................................................ namespace dbtools @@ -93,7 +95,7 @@ namespace dbtools } catch( const Exception& ) { - OSL_ENSURE( sal_False, "FilterManager::setFilterComponent: setting the filter failed!" ); + DBG_UNHANDLED_EXCEPTION(); } } @@ -114,44 +116,30 @@ namespace dbtools } catch( const Exception& ) { - OSL_ENSURE( sal_False, "FilterManager::setApplyPublicFilter: setting the filter failed!" ); + DBG_UNHANDLED_EXCEPTION(); } } //-------------------------------------------------------------------- - namespace + void FilterManager::appendFilterComponent( ::rtl::OUStringBuffer& io_appendTo, const ::rtl::OUString& i_component ) const { - void lcl_ensureBracketed( ::rtl::OUString& /* [inout] */ _rExpression ) + if ( io_appendTo.getLength() > 0 ) { - OSL_ENSURE( _rExpression.getLength(), "lcl_ensureBracketed: expression is empty!" ); - if ( _rExpression.getLength() ) - { - if ( ( _rExpression.getStr()[0] != '(' ) || ( _rExpression.getStr()[ _rExpression.getLength() - 1 ] != ')' ) ) - { - ::rtl::OUString sComposed( RTL_CONSTASCII_USTRINGPARAM( "(" ) ); - sComposed += _rExpression; - sComposed += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ")" ) ); - _rExpression = sComposed; - } - } + io_appendTo.insert( 0, sal_Unicode( '(' ) ); + io_appendTo.insert( 1, sal_Unicode( ' ' ) ); + io_appendTo.appendAscii( " ) AND " ); } - } - //-------------------------------------------------------------------- - void FilterManager::appendFilterComponent( ::rtl::OUString& /* [inout] */ _rAppendTo, const ::rtl::OUString& _rComponent ) const - { - if ( _rAppendTo.getLength() ) - _rAppendTo += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " AND " ) ); - ::rtl::OUString sComponent( _rComponent ); - lcl_ensureBracketed( sComponent ); - _rAppendTo += sComponent; + io_appendTo.appendAscii( "( " ); + io_appendTo.append( i_component ); + io_appendTo.appendAscii( " )" ); } //-------------------------------------------------------------------- - bool FilterManager::isThereAtMostOneComponent( ::rtl::OUString& _rOnlyComponent ) const + bool FilterManager::isThereAtMostOneComponent( ::rtl::OUStringBuffer& o_singleComponent ) const { sal_Int32 nOnlyNonEmpty = -1; - sal_Int32 i; + sal_Int32 i; for ( i = getFirstApplicableFilterIndex(); i < FC_COMPONENT_COUNT; ++i ) { if ( m_aFilterComponents[ i ].getLength() ) @@ -165,14 +153,14 @@ namespace dbtools } if ( nOnlyNonEmpty == -1 ) { - _rOnlyComponent = ::rtl::OUString(); + o_singleComponent.makeStringAndClear(); return true; } if ( i == FC_COMPONENT_COUNT ) { // we found only one non-empty filter component - _rOnlyComponent = m_aFilterComponents[ nOnlyNonEmpty ]; + o_singleComponent = m_aFilterComponents[ nOnlyNonEmpty ]; return true; } return false; @@ -181,17 +169,17 @@ namespace dbtools //-------------------------------------------------------------------- ::rtl::OUString FilterManager::getComposedFilter( ) const { - ::rtl::OUString sComposedFilter; + ::rtl::OUStringBuffer aComposedFilter; // if we have only one non-empty component, then there's no need to compose anything - if ( isThereAtMostOneComponent( sComposedFilter ) ) - return sComposedFilter; - - // append the single components - for ( sal_Int32 i = getFirstApplicableFilterIndex(); i < FC_COMPONENT_COUNT; ++i ) - appendFilterComponent( sComposedFilter, m_aFilterComponents[ i ] ); + if ( !isThereAtMostOneComponent( aComposedFilter ) ) + { + // append the single components + for ( sal_Int32 i = getFirstApplicableFilterIndex(); i < FC_COMPONENT_COUNT; ++i ) + appendFilterComponent( aComposedFilter, m_aFilterComponents[ i ] ); + } - return sComposedFilter; + return aComposedFilter.makeStringAndClear(); } //........................................................................ diff --git a/connectivity/source/commontools/formattedcolumnvalue.cxx b/connectivity/source/commontools/formattedcolumnvalue.cxx index feb45e5d38b4..ef7a06abe2c7 100644..100755 --- a/connectivity/source/commontools/formattedcolumnvalue.cxx +++ b/connectivity/source/commontools/formattedcolumnvalue.cxx @@ -328,7 +328,7 @@ namespace dbtools { if ( m_pData->m_bNumericField ) { - sStringValue = DBTypeConversion::getValue( + sStringValue = DBTypeConversion::getFormattedValue( m_pData->m_xColumn, m_pData->m_xFormatter, m_pData->m_aNullDate, m_pData->m_nFormatKey, m_pData->m_nKeyType ); } diff --git a/connectivity/source/commontools/makefile.mk b/connectivity/source/commontools/makefile.mk index cab216092241..cab216092241 100644..100755 --- a/connectivity/source/commontools/makefile.mk +++ b/connectivity/source/commontools/makefile.mk diff --git a/connectivity/source/commontools/parameters.cxx b/connectivity/source/commontools/parameters.cxx index 09ebd2096b9c..09ebd2096b9c 100644..100755 --- a/connectivity/source/commontools/parameters.cxx +++ b/connectivity/source/commontools/parameters.cxx diff --git a/connectivity/source/commontools/paramwrapper.cxx b/connectivity/source/commontools/paramwrapper.cxx index b652f2662cf9..b652f2662cf9 100644..100755 --- a/connectivity/source/commontools/paramwrapper.cxx +++ b/connectivity/source/commontools/paramwrapper.cxx diff --git a/connectivity/source/commontools/predicateinput.cxx b/connectivity/source/commontools/predicateinput.cxx index 2a95477918c7..2a95477918c7 100644..100755 --- a/connectivity/source/commontools/predicateinput.cxx +++ b/connectivity/source/commontools/predicateinput.cxx diff --git a/connectivity/source/commontools/propertyids.cxx b/connectivity/source/commontools/propertyids.cxx index 09f7328be01f..09f7328be01f 100644..100755 --- a/connectivity/source/commontools/propertyids.cxx +++ b/connectivity/source/commontools/propertyids.cxx diff --git a/connectivity/source/commontools/sqlerror.cxx b/connectivity/source/commontools/sqlerror.cxx index 59abac1d1016..59abac1d1016 100644..100755 --- a/connectivity/source/commontools/sqlerror.cxx +++ b/connectivity/source/commontools/sqlerror.cxx diff --git a/connectivity/source/commontools/statementcomposer.cxx b/connectivity/source/commontools/statementcomposer.cxx index ba8ba3819e47..ba8ba3819e47 100644..100755 --- a/connectivity/source/commontools/statementcomposer.cxx +++ b/connectivity/source/commontools/statementcomposer.cxx diff --git a/connectivity/source/commontools/warningscontainer.cxx b/connectivity/source/commontools/warningscontainer.cxx index f0ed7b0aa7b3..f0ed7b0aa7b3 100644..100755 --- a/connectivity/source/commontools/warningscontainer.cxx +++ b/connectivity/source/commontools/warningscontainer.cxx |