diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2007-01-15 12:46:20 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2007-01-15 12:46:20 +0000 |
commit | 7b785beb5479a5b4ff5d992f08c5a7657bf2ab87 (patch) | |
tree | 98aa6bd84bf8ba6b54c72f52727fdc2a7d58bfe8 /forms | |
parent | eef0a39e8b6c0203511f1f143c2b2877dd28bc40 (diff) |
INTEGRATION: CWS dba22b (1.78.4); FILE MERGED
2006/12/18 10:19:39 fs 1.78.4.2: RESYNC: (1.78-1.79); FILE MERGED
2006/12/06 13:25:37 fs 1.78.4.1: #i44891# when the parent form changes from 'new' to 'not new', reload ourself
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/component/DatabaseForm.cxx | 66 |
1 files changed, 50 insertions, 16 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 9a7ce51ac..6a375cedb 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -4,9 +4,9 @@ * * $RCSfile: DatabaseForm.cxx,v $ * - * $Revision: 1.79 $ + * $Revision: 1.80 $ * - * last change: $Author: rt $ $Date: 2006-12-01 16:54:16 $ + * last change: $Author: vg $ $Date: 2007-01-15 13:46:20 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -122,9 +122,8 @@ #include <com/sun/star/util/XURLTransformer.hpp> #endif -#ifndef _TOOLS_DEBUG_HXX #include <tools/debug.hxx> -#endif +#include <tools/diagnose_ex.h> #ifndef _SV_TIMER_HXX #include <vcl/timer.hxx> @@ -2387,12 +2386,21 @@ void SAL_CALL ODatabaseForm::setParent(const InterfaceRef& Parent) throw ( ::com Reference<XForm> xParentForm(getParent(), UNO_QUERY); if (xParentForm.is()) { - Reference<XRowSetApproveBroadcaster> xParentApprBroadcast(xParentForm, UNO_QUERY); - if (xParentApprBroadcast.is()) - xParentApprBroadcast->removeRowSetApproveListener(this); - Reference<XLoadable> xParentLoadable(xParentForm, UNO_QUERY); - if (xParentLoadable.is()) - xParentLoadable->removeLoadListener(this); + try + { + Reference< XRowSetApproveBroadcaster > xParentApprBroadcast( xParentForm, UNO_QUERY_THROW ); + xParentApprBroadcast->removeRowSetApproveListener( this ); + + Reference< XLoadable > xParentLoadable( xParentForm, UNO_QUERY_THROW ); + xParentLoadable->removeLoadListener( this ); + + Reference< XPropertySet > xParentProperties( xParentForm, UNO_QUERY_THROW ); + xParentProperties->removePropertyChangeListener( PROPERTY_ISNEW, this ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } } OFormComponents::setParent(Parent); @@ -2400,12 +2408,21 @@ void SAL_CALL ODatabaseForm::setParent(const InterfaceRef& Parent) throw ( ::com xParentForm.set(getParent(), UNO_QUERY); if ( xParentForm.is() ) { - Reference<XRowSetApproveBroadcaster> xParentApprBroadcast(xParentForm, UNO_QUERY); - if (xParentApprBroadcast.is()) - xParentApprBroadcast->addRowSetApproveListener(this); - Reference<XLoadable> xParentLoadable(xParentForm, UNO_QUERY); - if (xParentLoadable.is()) - xParentLoadable->addLoadListener(this); + try + { + Reference< XRowSetApproveBroadcaster > xParentApprBroadcast( xParentForm, UNO_QUERY_THROW ); + xParentApprBroadcast->addRowSetApproveListener( this ); + + Reference< XLoadable > xParentLoadable( xParentForm, UNO_QUERY_THROW ); + xParentLoadable->addLoadListener( this ); + + Reference< XPropertySet > xParentProperties( xParentForm, UNO_QUERY_THROW ); + xParentProperties->addPropertyChangeListener( PROPERTY_ISNEW, this ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } } Reference< XConnection > xOuterConnection; @@ -3672,6 +3689,23 @@ void SAL_CALL ODatabaseForm::clearParameters() throw( SQLException, RuntimeExcep m_aParameterManager.clearParameters(); } +//------------------------------------------------------------------------------ +void SAL_CALL ODatabaseForm::propertyChange( const PropertyChangeEvent& evt ) throw (RuntimeException) +{ + if ( evt.Source == m_xParent ) + { + if ( evt.PropertyName == PROPERTY_ISNEW ) + { + sal_Bool bCurrentIsNew( sal_False ); + OSL_VERIFY( evt.NewValue >>= bCurrentIsNew ); + if ( !bCurrentIsNew ) + reload_impl( sal_True ); + } + return; + } + OFormComponents::propertyChange( evt ); +} + // com::sun::star::lang::XServiceInfo //------------------------------------------------------------------------------ ::rtl::OUString SAL_CALL ODatabaseForm::getImplementationName_Static() |