summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2006-10-18 12:16:59 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2006-10-18 12:16:59 +0000
commitb9fc8acc7a0c46e25a26f1862a41260151bbc42a (patch)
tree764840b74e07fe659cec02310f74023e472178d3
parenta0241799bc3592ddee1daa22f4183775a7ea6a6e (diff)
INTEGRATION: CWS dba205b (1.49.14); FILE MERGED
2006/09/04 11:21:38 oj 1.49.14.3: RESYNC: (1.49-1.50); FILE MERGED 2006/08/08 06:50:49 fs 1.49.14.2: removed unused template function 2006/08/03 14:41:31 fs 1.49.14.1: #i64593# +m_aWindowStateGuard/impl_resetStateGuard_nothrow: ensure that our control is disabled as long as the model property requires this
-rw-r--r--forms/source/component/FormComponent.cxx49
1 files changed, 29 insertions, 20 deletions
diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx
index b0c09c41e057..d63da3759238 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: FormComponent.cxx,v $
*
- * $Revision: 1.52 $
+ * $Revision: 1.53 $
*
- * last change: $Author: obo $ $Date: 2006-10-12 11:11:08 $
+ * last change: $Author: ihi $ $Date: 2006-10-18 13:16:59 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -244,6 +244,8 @@ void OControl::disposing()
{
OComponentHelper::disposing();
+ m_aWindowStateGuard.attach( NULL, NULL );
+
Reference<com::sun::star::lang::XComponent> xComp;
if (query_aggregation(m_xAggregate, xComp))
xComp->dispose();
@@ -318,6 +320,23 @@ InterfaceRef SAL_CALL OControl::getContext() throw (RuntimeException)
}
//------------------------------------------------------------------------------
+void OControl::impl_resetStateGuard_nothrow()
+{
+ Reference< XWindow2 > xWindow;
+ Reference< XControlModel > xModel;
+ try
+ {
+ xWindow.set( getPeer(), UNO_QUERY );
+ xModel.set( getModel(), UNO_QUERY );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ m_aWindowStateGuard.attach( xWindow, xModel );
+}
+
+//------------------------------------------------------------------------------
void SAL_CALL OControl::createPeer(const Reference<XToolkit>& _rxToolkit, const Reference<XWindowPeer>& _rxParent) throw (RuntimeException)
{
if ( m_xControl.is() )
@@ -331,6 +350,8 @@ void SAL_CALL OControl::createPeer(const Reference<XToolkit>& _rxToolkit, const
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WheelWithoutFocus" ) ),
makeAny( (sal_Bool)sal_False )
);
+
+ impl_resetStateGuard_nothrow();
}
}
@@ -343,7 +364,12 @@ Reference<XWindowPeer> SAL_CALL OControl::getPeer() throw ( RuntimeException)
//------------------------------------------------------------------------------
sal_Bool SAL_CALL OControl::setModel(const Reference<XControlModel>& Model) throw ( RuntimeException)
{
- return m_xControl.is() ? m_xControl->setModel( Model ) : sal_False;
+ if ( !m_xControl.is() )
+ return sal_False;
+
+ sal_Bool bSuccess = m_xControl->setModel( Model );
+ impl_resetStateGuard_nothrow();
+ return bSuccess;
}
//------------------------------------------------------------------------------
@@ -1261,23 +1287,6 @@ void OBoundControlModel::resumeValueListening( )
}
//-----------------------------------------------------------------------------
-namespace
-{
- template< class T >
- void appendSequence( Sequence< T >& _rInOut, const Sequence< T >& _rAppend )
- {
- sal_Int32 nLengthBefore = _rInOut.getLength();
- sal_Int32 nLengthAppend = _rAppend.getLength();
- _rInOut.realloc( nLengthBefore + nLengthAppend );
- ::std::copy(
- _rAppend.getConstArray(),
- _rAppend.getConstArray() + nLengthAppend,
- _rInOut.getArray() + nLengthBefore
- );
- }
-}
-
-//-----------------------------------------------------------------------------
Sequence< Type > OBoundControlModel::_getTypes()
{
TypeBag aTypes(