From 5089737cf957b64c387e9c2d1f12b9a3783bd0a5 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 9 Nov 2010 12:55:11 +0100 Subject: dba34b: #i115491# don't assume the HID: protocol, but also recognize other formats (in particular: empty URLs) --- svx/source/fmcomp/fmgridif.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'svx/source/fmcomp') diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index d7a264f354..fa54ca7aba 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -1974,10 +1974,12 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V } else if ( 0 == PropertyName.compareTo( FM_PROP_HELPURL ) ) { - INetURLObject aHID( ::comphelper::getString(Value) ); - DBG_ASSERT( aHID.GetProtocol() == INET_PROT_HID, "Wrong HelpURL!" ); + ::rtl::OUString sHelpURL; + OSL_VERIFY( Value >>= sHelpURL ); + INetURLObject aHID( sHelpURL ); if ( aHID.GetProtocol() == INET_PROT_HID ) - pGrid->SetHelpId( rtl::OUStringToOString( aHID.GetURLPath(), RTL_TEXTENCODING_UTF8 ) ); + sHelpURL = aHID.GetURLPath(); + pGrid->SetHelpId( rtl::OUStringToOString( sHelpURL, RTL_TEXTENCODING_UTF8 ) ); } else if ( 0 == PropertyName.compareTo( FM_PROP_DISPLAYSYNCHRON ) ) { -- cgit v1.2.3 From 448cd2de7919401a0a84cd6e5dd5ede276ddf28e Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 23 Nov 2010 11:38:49 +0100 Subject: dba34b: don't case Any::getValue's return type, use Any's public API instead --- svx/source/fmcomp/fmgridif.cxx | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'svx/source/fmcomp') diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index fa54ca7aba..12804b850e 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -2075,25 +2075,28 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V } else if ( 0 == PropertyName.compareTo( FM_PROP_HASNAVIGATION ) ) { - if (Value.getValueType() == ::getBooleanCppuType()) - pGrid->EnableNavigationBar(*(sal_Bool*)Value.getValue()); + sal_Bool bValue( sal_True ); + OSL_VERIFY( Value >>= bValue ); + pGrid->EnableNavigationBar( bValue ); } else if ( 0 == PropertyName.compareTo( FM_PROP_RECORDMARKER ) ) { - if (Value.getValueType() == ::getBooleanCppuType()) - pGrid->EnableHandle(*(sal_Bool*)Value.getValue()); + sal_Bool bValue( sal_True ); + OSL_VERIFY( Value >>= bValue ); + pGrid->EnableHandle( bValue ); } else if ( 0 == PropertyName.compareTo( FM_PROP_ENABLED ) ) { - if (Value.getValueType() == ::getBooleanCppuType()) - { - // Im DesignModus nur das Datenfenster disablen - // Sonst kann das Control nicht mehr konfiguriert werden - if (isDesignMode()) - pGrid->GetDataWindow().Enable(*(sal_Bool*)Value.getValue()); - else - pGrid->Enable(*(sal_Bool*)Value.getValue()); - } + sal_Bool bValue( sal_True ); + OSL_VERIFY( Value >>= bValue ); + pGrid->EnableHandle( bValue ); + + // Im DesignModus nur das Datenfenster disablen + // Sonst kann das Control nicht mehr konfiguriert werden + if (isDesignMode()) + pGrid->GetDataWindow().Enable( bValue ); + else + pGrid->Enable( bValue ); } else VCLXWindow::setProperty( PropertyName, Value ); -- cgit v1.2.3 From 01423981f2f5f6076493b4e379d873749e09179b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 23 Nov 2010 12:50:54 +0100 Subject: dba34b: DBTypeConversion::getValue renamed to getFormattedValue (at least those variants returning a string), which will give us some better control over the changes required for #i115250# --- connectivity/inc/connectivity/dbconversion.hxx | 6 ++++-- connectivity/inc/connectivity/virtualdbtools.hxx | 4 ++-- connectivity/source/commontools/DateConversion.cxx | 12 ++++++------ connectivity/source/commontools/formattedcolumnvalue.cxx | 2 +- connectivity/source/simpledbt/staticdbtools_s.cxx | 10 +++++----- connectivity/source/simpledbt/staticdbtools_s.hxx | 4 ++-- svx/source/fmcomp/gridcell.cxx | 6 +++--- svx/source/inc/typeconversionclient.hxx | 4 ++-- 8 files changed, 25 insertions(+), 23 deletions(-) (limited to 'svx/source/fmcomp') diff --git a/connectivity/inc/connectivity/dbconversion.hxx b/connectivity/inc/connectivity/dbconversion.hxx index f0508a4f32..141c702450 100644 --- a/connectivity/inc/connectivity/dbconversion.hxx +++ b/connectivity/inc/connectivity/dbconversion.hxx @@ -103,12 +103,14 @@ namespace dbtools // get the columnvalue as string with a default format given by the column or a default format // for the type - static ::rtl::OUString getValue(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xColumn, + static ::rtl::OUString getFormattedValue( + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xColumn, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter>& xFormatter, const ::com::sun::star::lang::Locale& _rLocale, const ::com::sun::star::util::Date& rNullDate); - static ::rtl::OUString getValue(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& _xColumn, + static ::rtl::OUString getFormattedValue( + const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& _xColumn, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter>& xFormatter, const ::com::sun::star::util::Date& rNullDate, sal_Int32 nKey, diff --git a/connectivity/inc/connectivity/virtualdbtools.hxx b/connectivity/inc/connectivity/virtualdbtools.hxx index eadf84a61e..c1ff7491c1 100644 --- a/connectivity/inc/connectivity/virtualdbtools.hxx +++ b/connectivity/inc/connectivity/virtualdbtools.hxx @@ -259,14 +259,14 @@ namespace connectivity const ::com::sun::star::util::Date& rNullDate, sal_Int16 nKeyType) const = 0; - virtual ::rtl::OUString getValue( + virtual ::rtl::OUString getFormattedValue( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxColumn, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter, const ::com::sun::star::util::Date& _rNullDate, sal_Int32 _nKey, sal_Int16 _nKeyType) const = 0; - virtual ::rtl::OUString getValue( + virtual ::rtl::OUString getFormattedValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxColumn, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter>& _rxFormatter, const ::com::sun::star::lang::Locale& _rLocale, diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx index afd67bac89..ea0bb69cc9 100644 --- a/connectivity/source/commontools/DateConversion.cxx +++ b/connectivity/source/commontools/DateConversion.cxx @@ -409,12 +409,12 @@ double DBTypeConversion::getValue(const Reference& xVariant, } } //------------------------------------------------------------------------------ -::rtl::OUString DBTypeConversion::getValue(const Reference< XPropertySet>& _xColumn, +::rtl::OUString DBTypeConversion::getFormattedValue(const Reference< XPropertySet>& _xColumn, const Reference& _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(); @@ -425,7 +425,7 @@ double DBTypeConversion::getValue(const Reference& 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) @@ -441,11 +441,11 @@ double DBTypeConversion::getValue(const Reference& 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& xVariant, +::rtl::OUString DBTypeConversion::getFormattedValue(const Reference& xVariant, const Reference& xFormatter, const Date& rNullDate, sal_Int32 nKey, @@ -478,7 +478,7 @@ double DBTypeConversion::getValue(const Reference& xVariant, } catch( const Exception& ) { - OSL_ENSURE( sal_False, "DBTypeConversion::getValue: caught an exception while retrieving the formatter's NullDate!" ); + OSL_ENSURE( sal_False, "DBTypeConversion::getFormattedValue: caught an exception while retrieving the formatter's NullDate!" ); } // 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/formattedcolumnvalue.cxx b/connectivity/source/commontools/formattedcolumnvalue.cxx index 1f39d6dbf7..039a26b391 100644 --- 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/simpledbt/staticdbtools_s.cxx b/connectivity/source/simpledbt/staticdbtools_s.cxx index 25bb960e24..c040dfe11d 100644 --- a/connectivity/source/simpledbt/staticdbtools_s.cxx +++ b/connectivity/source/simpledbt/staticdbtools_s.cxx @@ -29,7 +29,7 @@ #include "precompiled_connectivity.hxx" #include #include "staticdbtools_s.hxx" -#include +#include "connectivity/dbconversion.hxx" #include #include @@ -67,17 +67,17 @@ namespace connectivity } //---------------------------------------------------------------- - ::rtl::OUString ODataAccessStaticTools::getValue(const Reference< XColumn >& _rxColumn, const Reference< XNumberFormatter >& _rxFormatter, + ::rtl::OUString ODataAccessStaticTools::getFormattedValue(const Reference< XColumn >& _rxColumn, const Reference< XNumberFormatter >& _rxFormatter, const Date& _rNullDate, sal_Int32 _nKey, sal_Int16 _nKeyType) const { - return ::dbtools::DBTypeConversion::getValue(_rxColumn, _rxFormatter, _rNullDate, _nKey, _nKeyType); + return ::dbtools::DBTypeConversion::getFormattedValue(_rxColumn, _rxFormatter, _rNullDate, _nKey, _nKeyType); } //---------------------------------------------------------------- - ::rtl::OUString ODataAccessStaticTools::getValue( const Reference< XPropertySet>& _rxColumn, const Reference< XNumberFormatter>& _rxFormatter, + ::rtl::OUString ODataAccessStaticTools::getFormattedValue( const Reference< XPropertySet>& _rxColumn, const Reference< XNumberFormatter>& _rxFormatter, const Locale& _rLocale, const Date& _rNullDate ) const { - return ::dbtools::DBTypeConversion::getValue( _rxColumn, _rxFormatter, _rLocale, _rNullDate ); + return ::dbtools::DBTypeConversion::getFormattedValue( _rxColumn, _rxFormatter, _rLocale, _rNullDate ); } //---------------------------------------------------------------- diff --git a/connectivity/source/simpledbt/staticdbtools_s.hxx b/connectivity/source/simpledbt/staticdbtools_s.hxx index 0197a1edf0..5a862978af 100644 --- a/connectivity/source/simpledbt/staticdbtools_s.hxx +++ b/connectivity/source/simpledbt/staticdbtools_s.hxx @@ -58,7 +58,7 @@ namespace connectivity sal_Int16 nKeyType) const; // ------------------------------------------------ - virtual ::rtl::OUString getValue( + virtual ::rtl::OUString getFormattedValue( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxColumn, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter, const ::com::sun::star::util::Date& _rNullDate, @@ -66,7 +66,7 @@ namespace connectivity sal_Int16 _nKeyType) const; // ------------------------------------------------ - virtual ::rtl::OUString getValue( + virtual ::rtl::OUString getFormattedValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxColumn, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter>& _rxFormatter, const ::com::sun::star::lang::Locale& _rLocale, diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index d6b6d39b52..7411095db4 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -1193,7 +1193,7 @@ String DbTextField::GetFormatText(const Reference< XColumn >& _rxField, const Re if ( _rxField.is() ) try { - aString = getValue( _rxField, xFormatter, m_rColumn.GetParent().getNullDate(), m_rColumn.GetKey(), m_nKeyType); + aString = getFormattedValue( _rxField, xFormatter, m_rColumn.GetParent().getNullDate(), m_rColumn.GetKey(), m_nKeyType); } catch( const Exception& ) { @@ -2553,7 +2553,7 @@ String DbComboBox::GetFormatText(const Reference< ::com::sun::star::sdb::XColumn if (_rxField.is()) try { - aString = getValue( _rxField, xFormatter, m_rColumn.GetParent().getNullDate(), m_rColumn.GetKey(), m_nKeyType ); + aString = getFormattedValue( _rxField, xFormatter, m_rColumn.GetParent().getNullDate(), m_rColumn.GetKey(), m_nKeyType ); } catch( const Exception& ) { @@ -3164,7 +3164,7 @@ void DbFilterField::Update() while (!xListCursor->isAfterLast() && i++ < SHRT_MAX) // max anzahl eintraege { - aStr = getValue(xDataField, xFormatter, aNullDate, nFormatKey, nKeyType); + aStr = getFormattedValue(xDataField, xFormatter, aNullDate, nFormatKey, nKeyType); aStringList.push_back(aStr); xListCursor->next(); } diff --git a/svx/source/inc/typeconversionclient.hxx b/svx/source/inc/typeconversionclient.hxx index 39439ba113..e139fdbccb 100644 --- a/svx/source/inc/typeconversionclient.hxx +++ b/svx/source/inc/typeconversionclient.hxx @@ -70,7 +70,7 @@ namespace svxform } // -------------------------------------------------------- - inline ::rtl::OUString getValue( + inline ::rtl::OUString getFormattedValue( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxColumn, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter, const ::com::sun::star::util::Date& _rNullDate, @@ -79,7 +79,7 @@ namespace svxform { ::rtl::OUString sReturn; if ( ensureLoaded() ) - sReturn = m_xTypeConversion->getValue(_rxColumn, _rxFormatter, _rNullDate, _nKey, _nKeyType); + sReturn = m_xTypeConversion->getFormattedValue(_rxColumn, _rxFormatter, _rNullDate, _nKey, _nKeyType); return sReturn; } }; -- cgit v1.2.3 From 206ba44f4125886befbd5937369cbc0819b83015 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 23 Nov 2010 21:55:13 +0100 Subject: dba34b: #i115250# DBTypeConversion::getValue: do not use the target format to determine how to obtain the column value, instead, use the column type --- connectivity/inc/connectivity/dbconversion.hxx | 3 +- connectivity/inc/connectivity/virtualdbtools.hxx | 3 +- connectivity/source/commontools/DateConversion.cxx | 63 +++++++++++----------- connectivity/source/simpledbt/staticdbtools_s.cxx | 4 +- connectivity/source/simpledbt/staticdbtools_s.hxx | 3 +- svx/source/fmcomp/gridcell.cxx | 4 +- svx/source/inc/typeconversionclient.hxx | 5 +- 7 files changed, 41 insertions(+), 44 deletions(-) (limited to 'svx/source/fmcomp') diff --git a/connectivity/inc/connectivity/dbconversion.hxx b/connectivity/inc/connectivity/dbconversion.hxx index 141c702450..46bd557ff9 100644 --- a/connectivity/inc/connectivity/dbconversion.hxx +++ b/connectivity/inc/connectivity/dbconversion.hxx @@ -98,8 +98,7 @@ namespace dbtools const double& rValue, sal_Int16 nKeyType) throw(::com::sun::star::lang::IllegalArgumentException); - static double getValue(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& xVariant, const ::com::sun::star::util::Date& rNullDate, - sal_Int16 nKeyType); + static double getValue( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& xVariant, const ::com::sun::star::util::Date& rNullDate ); // get the columnvalue as string with a default format given by the column or a default format // for the type diff --git a/connectivity/inc/connectivity/virtualdbtools.hxx b/connectivity/inc/connectivity/virtualdbtools.hxx index c1ff7491c1..7a84187cfd 100644 --- a/connectivity/inc/connectivity/virtualdbtools.hxx +++ b/connectivity/inc/connectivity/virtualdbtools.hxx @@ -256,8 +256,7 @@ namespace connectivity virtual double getValue( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& _rxVariant, - const ::com::sun::star::util::Date& rNullDate, - sal_Int16 nKeyType) const = 0; + const ::com::sun::star::util::Date& rNullDate ) const = 0; virtual ::rtl::OUString getFormattedValue( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxColumn, diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx index ea0bb69cc9..2f741000e4 100644 --- a/connectivity/source/commontools/DateConversion.cxx +++ b/connectivity/source/commontools/DateConversion.cxx @@ -43,6 +43,7 @@ #include "diagnose_ex.h" #include #include +#include using namespace ::connectivity; @@ -365,46 +366,49 @@ void DBTypeConversion::setValue(const Reference& xVariant, } //------------------------------------------------------------------------------ -double DBTypeConversion::getValue(const Reference& 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 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(static_cast(xVariant->getByte())); + return static_cast(static_cast(i_column->getByte())); case DataType::SMALLINT: - return static_cast(static_cast(xVariant->getShort())); + return static_cast(static_cast(i_column->getShort())); case DataType::INTEGER: - return static_cast(static_cast(xVariant->getInt())); + return static_cast(static_cast(i_column->getInt())); case DataType::BIGINT: - return static_cast(static_cast(xVariant->getLong())); + return static_cast(static_cast(i_column->getLong())); } } - - return xVariant->getDouble(); } + return i_column->getDouble(); } } - catch(const Exception& ) + catch( const Exception& ) { + DBG_UNHANDLED_EXCEPTION(); return 0.0; } } @@ -462,23 +466,20 @@ double DBTypeConversion::getValue(const Reference& 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::getFormattedValue: 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/simpledbt/staticdbtools_s.cxx b/connectivity/source/simpledbt/staticdbtools_s.cxx index c040dfe11d..6037a3db59 100644 --- a/connectivity/source/simpledbt/staticdbtools_s.cxx +++ b/connectivity/source/simpledbt/staticdbtools_s.cxx @@ -61,9 +61,9 @@ namespace connectivity } //---------------------------------------------------------------- - double ODataAccessStaticTools::getValue(const Reference< XColumn>& _rxVariant, const Date& rNullDate, sal_Int16 nKeyType) const + double ODataAccessStaticTools::getValue(const Reference< XColumn>& _rxVariant, const Date& rNullDate ) const { - return ::dbtools::DBTypeConversion::getValue(_rxVariant, rNullDate, nKeyType); + return ::dbtools::DBTypeConversion::getValue( _rxVariant, rNullDate ); } //---------------------------------------------------------------- diff --git a/connectivity/source/simpledbt/staticdbtools_s.hxx b/connectivity/source/simpledbt/staticdbtools_s.hxx index 5a862978af..6157cca279 100644 --- a/connectivity/source/simpledbt/staticdbtools_s.hxx +++ b/connectivity/source/simpledbt/staticdbtools_s.hxx @@ -54,8 +54,7 @@ namespace connectivity // ------------------------------------------------ virtual double getValue( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& _rxVariant, - const ::com::sun::star::util::Date& rNullDate, - sal_Int16 nKeyType) const; + const ::com::sun::star::util::Date& rNullDate ) const; // ------------------------------------------------ virtual ::rtl::OUString getFormattedValue( diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 7411095db4..390fa6d266 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -1534,7 +1534,7 @@ String DbFormattedField::GetFormatText(const Reference< ::com::sun::star::sdb::X // ein double-Feld bindet und als Text formatiert, liefert m_rColumn.IsNumeric() sal_True. Das heisst // also einfach, dass ich den Inhalt der Variant mittels getDouble abfragen kann, und dann kann // ich den Rest (die Formatierung) dem FormattedField ueberlassen. - double dValue = getValue(_rxField, m_rColumn.GetParent().getNullDate(), m_nKeyType); + double dValue = getValue( _rxField, m_rColumn.GetParent().getNullDate() ); if (_rxField->wasNull()) return aText; ((FormattedField*)m_pPainter)->SetValue(dValue); @@ -1578,7 +1578,7 @@ void DbFormattedField::UpdateFromField(const Reference< ::com::sun::star::sdb::X // ein double-Feld bindet und als Text formatiert, liefert m_rColumn.IsNumeric() sal_True. Das heisst // also einfach, dass ich den Inhalt der Variant mittels getDouble abfragen kann, und dann kann // ich den Rest (die Formatierung) dem FormattedField ueberlassen. - double dValue = getValue(_rxField, m_rColumn.GetParent().getNullDate(), m_nKeyType); + double dValue = getValue( _rxField, m_rColumn.GetParent().getNullDate() ); if (_rxField->wasNull()) m_pWindow->SetText(String()); else diff --git a/svx/source/inc/typeconversionclient.hxx b/svx/source/inc/typeconversionclient.hxx index e139fdbccb..5ccc7063fb 100644 --- a/svx/source/inc/typeconversionclient.hxx +++ b/svx/source/inc/typeconversionclient.hxx @@ -60,12 +60,11 @@ namespace svxform // -------------------------------------------------------- inline double getValue( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& _rxVariant, - const ::com::sun::star::util::Date& _rNullDate, - sal_Int16 _nKeyType) const + const ::com::sun::star::util::Date& _rNullDate ) const { double nReturn(0); if ( ensureLoaded() ) - nReturn = m_xTypeConversion->getValue(_rxVariant, _rNullDate, _nKeyType); + nReturn = m_xTypeConversion->getValue( _rxVariant, _rNullDate ); return nReturn; } -- cgit v1.2.3