summaryrefslogtreecommitdiff
path: root/toolkit/source/controls/roadmapcontrol.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/source/controls/roadmapcontrol.cxx')
-rw-r--r--toolkit/source/controls/roadmapcontrol.cxx94
1 files changed, 2 insertions, 92 deletions
diff --git a/toolkit/source/controls/roadmapcontrol.cxx b/toolkit/source/controls/roadmapcontrol.cxx
index acfbee0c5bb6..96f51b39dc72 100644
--- a/toolkit/source/controls/roadmapcontrol.cxx
+++ b/toolkit/source/controls/roadmapcontrol.cxx
@@ -52,27 +52,6 @@ namespace toolkit
// helper
// ----------------------------------------------------
- static void lcl_knitImageComponents( const Reference< XControlModel >& _rxModel,
- const Reference< XWindowPeer >& _rxPeer,
- bool _bAdd )
- {
- Reference< XImageProducer > xProducer( _rxModel, UNO_QUERY );
- if ( xProducer.is() )
- {
- Reference< XImageConsumer > xConsumer( _rxPeer, UNO_QUERY );
- if ( xConsumer.is() )
- {
- if ( _bAdd )
- {
- xProducer->addConsumer( xConsumer );
- xProducer->startProduction();
- }
- else
- xProducer->removeConsumer( xConsumer );
- }
- }
- }
-
static void lcl_throwIllegalArgumentException( )
{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this ....
throw IllegalArgumentException();
@@ -97,6 +76,7 @@ static void lcl_throwIndexOutOfBoundsException( )
ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
ImplRegisterProperty( BASEPROPERTY_HELPURL );
ImplRegisterProperty( BASEPROPERTY_IMAGEURL );
+ ImplRegisterProperty( BASEPROPERTY_GRAPHIC );
ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
ImplRegisterProperty( BASEPROPERTY_COMPLETE );
ImplRegisterProperty( BASEPROPERTY_ACTIVATED );
@@ -135,7 +115,7 @@ static void lcl_throwIndexOutOfBoundsException( )
case BASEPROPERTY_DEFAULTCONTROL:
aReturn <<= ::rtl::OUString( ::rtl::OUString::createFromAscii( szServiceName_UnoControlRoadmap ) );
break;
- default : aReturn = UnoControlModel::ImplGetDefaultValue( nPropId ); break;
+ default : aReturn = UnoControlRoadmapModel_Base::ImplGetDefaultValue( nPropId ); break;
}
return aReturn;
@@ -384,40 +364,6 @@ static void lcl_throwIndexOutOfBoundsException( )
maContainerListeners.removeInterface( xListener );
}
-
- void UnoControlRoadmapModel::addConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException)
- {
- maImageListeners.push_back( xConsumer );
- }
-
-
- void UnoControlRoadmapModel::removeConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException)
- {
- maImageListeners.remove( xConsumer );
- }
-
-
- void UnoControlRoadmapModel::startProduction( ) throw (::com::sun::star::uno::RuntimeException)
- {
- Sequence<Any> aArgs(1);
- aArgs.getArray()[0] = getPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL ) );
- Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- Reference< XImageProducer > xImageProducer( xMSF->createInstanceWithArguments( ::rtl::OUString::createFromAscii( "com.sun.star.awt.ImageProducer" ), aArgs ), UNO_QUERY );
- if ( xImageProducer.is() )
- {
- std::list< Reference< XImageConsumer > >::iterator aIter( maImageListeners.begin() );
- while ( aIter != maImageListeners.end() )
- {
- xImageProducer->addConsumer( *aIter );
- aIter++;
- }
- xImageProducer->startProduction();
- }
- }
-
-
-
-
// ===================================================================
// = UnoRoadmapControl
// ===================================================================
@@ -434,9 +380,6 @@ sal_Bool SAL_CALL UnoRoadmapControl::setModel(const Reference< XControlModel >&
{
- // remove the peer as image consumer from the model
- lcl_knitImageComponents( getModel(), getPeer(), false );
-
Reference< XContainer > xC( getModel(), UNO_QUERY );
if ( xC.is() )
xC->removeContainerListener( this );
@@ -447,9 +390,6 @@ sal_Bool SAL_CALL UnoRoadmapControl::setModel(const Reference< XControlModel >&
if ( xC.is() )
xC->addContainerListener( this );
- // add the peer as image consumer to the model
- lcl_knitImageComponents( getModel(), getPeer(), true );
-
return bReturn;
}
@@ -462,18 +402,6 @@ sal_Bool SAL_CALL UnoRoadmapControl::setModel(const Reference< XControlModel >&
- void SAL_CALL UnoRoadmapControl::createPeer( const Reference<XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer ) throw(RuntimeException)
- {
- // remove the peer as image consumer from the model
- lcl_knitImageComponents( getModel(), getPeer(), false );
-
- UnoControl::createPeer( rxToolkit, rParentPeer );
-
- lcl_knitImageComponents( getModel(), getPeer(), true );
-
- }
-
-
void UnoRoadmapControl::dispose() throw(RuntimeException)
{
EventObject aEvt;
@@ -484,24 +412,6 @@ sal_Bool SAL_CALL UnoRoadmapControl::setModel(const Reference< XControlModel >&
-void UnoRoadmapControl::ImplSetPeerProperty( const ::rtl::OUString& rPropName, const Any& rVal )
-{
- sal_uInt16 nType = GetPropertyId( rPropName );
- if ( getPeer().is() && ( nType == BASEPROPERTY_IMAGEURL ) )
- {
- Reference < XImageProducer > xImgProd( getModel(), UNO_QUERY );
- Reference < XImageConsumer > xImgCons( getPeer(), UNO_QUERY );
-
- if ( xImgProd.is() && xImgCons.is() )
- {
- xImgProd->startProduction();
- }
- }
- else
- UnoControlBase::ImplSetPeerProperty( rPropName, rVal );
-}
-
-
void UnoRoadmapControl::elementInserted( const ContainerEvent& rEvent )throw(RuntimeException)
{
Reference< XInterface > xRoadmapItem;