diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-08-14 11:08:31 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-08-14 11:08:31 +0000 |
commit | ea96d88858916668f220cbc4b78376d5394536bb (patch) | |
tree | a0d136d43370f00b27d36c5de535703a0c2c0028 /forms/source | |
parent | 0fce31bc700fe7e2674aa583c903ecc6862bd490 (diff) |
INTEGRATION: CWS dba30h_DEV300 (1.62.2); FILE MERGED
2008/07/28 07:33:10 fs 1.62.2.1: copying the fix for #i90914# herein, to try to get it for 3.0
Diffstat (limited to 'forms/source')
-rw-r--r-- | forms/source/component/FormComponent.cxx | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index 4376c04e0a45..eac296badc39 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: FormComponent.cxx,v $ - * $Revision: 1.62 $ + * $Revision: 1.63 $ * * This file is part of OpenOffice.org. * @@ -1995,6 +1995,21 @@ sal_Bool OBoundControlModel::connectToField(const Reference<XRowSet>& rForm) } //------------------------------------------------------------------------------ +void OBoundControlModel::initFromField( const Reference< XRowSet >& _rxRowSet ) +{ + // but only if the rowset if posisitioned on a valid record + if ( m_xField.is() && _rxRowSet.is() ) + { + if ( !_rxRowSet->isBeforeFirst() && !_rxRowSet->isAfterLast() ) + transferDbValueToControl(); + else + // reset the field if the row set is empty + // #i30661# / 2004-12-16 / frank.schoenheit@sun.com + resetNoBroadcast(); + } +} + +//------------------------------------------------------------------------------ sal_Bool OBoundControlModel::approveDbColumnType(sal_Int32 _nColumnType) { OSL_PRECOND( !hasExternalValueBinding(), "OBoundControlModel::approveDbColumnType: invalid call (have an external binding)!" ); @@ -2039,20 +2054,9 @@ void OBoundControlModel::connectDatabaseColumn( const Reference< XRowSet >& _rxR m_bLoaded = sal_True; onConnectedDbColumn( _rxRowSet ); - // did we successfully connect to a database column? + // initially transfer the db column value to the control, if we successfully connected to a database column if ( m_xField.is() ) - { // initially transfer the db column value to the control - // but only if the rowset if posisitioned on a valid record - if ( _rxRowSet.is() ) - { - if ( !_rxRowSet->isBeforeFirst() && !_rxRowSet->isAfterLast() ) - transferDbValueToControl(); - else - // reset the field if the row set is empty - // #i30661# / 2004-12-16 / frank.schoenheit@sun.com - resetNoBroadcast(); - } - } + initFromField( _rxRowSet ); if ( xOldField != m_xField ) { |