diff options
Diffstat (limited to 'toolkit/source/controls/stdtabcontroller.cxx')
-rw-r--r-- | toolkit/source/controls/stdtabcontroller.cxx | 207 |
1 files changed, 119 insertions, 88 deletions
diff --git a/toolkit/source/controls/stdtabcontroller.cxx b/toolkit/source/controls/stdtabcontroller.cxx index c67d05545f1f..a7223974a81c 100644 --- a/toolkit/source/controls/stdtabcontroller.cxx +++ b/toolkit/source/controls/stdtabcontroller.cxx @@ -2,9 +2,9 @@ * * $RCSfile: stdtabcontroller.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: mt $ $Date: 2001-09-04 08:06:31 $ + * last change: $Author: hr $ $Date: 2003-03-27 17:03:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -81,6 +81,12 @@ #include <comphelper/sequence.hxx> #endif +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::beans; + // ---------------------------------------------------- // class StdTabController // ---------------------------------------------------- @@ -92,7 +98,12 @@ StdTabController::~StdTabController() { } -sal_Bool StdTabController::ImplCreateComponentSequence( ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > >& rControls, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& rModels, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > >& rComponents, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any>* pTabStops, sal_Bool bPeerComponent ) const +sal_Bool StdTabController::ImplCreateComponentSequence( + Sequence< Reference< XControl > >& rControls, + const Sequence< Reference< XControlModel > >& rModels, + Sequence< Reference< XWindow > >& rComponents, + Sequence< Any>* pTabStops, + sal_Bool bPeerComponent ) const { sal_Bool bOK = sal_True; @@ -100,56 +111,70 @@ sal_Bool StdTabController::ImplCreateComponentSequence( ::com::sun::star::uno::S sal_Int32 nModels = rModels.getLength(); if (nModels != rControls.getLength()) { - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > > aSeq = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > >(nModels); - const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > * pModels = rModels.getConstArray(); - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > xCurrentModel; - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > xCurrentControl; + Sequence< Reference< XControl > > aSeq = Sequence< Reference< XControl > >(nModels); + const Reference< XControlModel > * pModels = rModels.getConstArray(); + Reference< XControl > xCurrentControl; sal_Int32 nRealControls = 0; - for (sal_Int32 n = 0; n < nModels; ++n) + for (sal_Int32 n = 0; n < nModels; ++n, ++pModels) { - xCurrentModel = pModels[n]; - xCurrentControl = FindControl(rControls, xCurrentModel); + xCurrentControl = FindControl(rControls, *pModels); if (xCurrentControl.is()) aSeq.getArray()[nRealControls++] = xCurrentControl; } aSeq.realloc(nRealControls); rControls = aSeq; } +#ifdef DBG_UTIL + { + sal_Int32 nControls = rControls.getLength(); + sal_Int32 nModels = rModels.getLength(); + DBG_ASSERT( nControls == nModels, "StdTabController:ImplCreateComponentSequence: inconsistence!" ); + if ( nControls == nModels ) + { + for ( sal_Int32 i = 0; i < nControls; ++i ) + { + Reference< XControl > xControl = rControls[ i ]; + DBG_ASSERT( xControl.is() && ( xControl->getModel().get() == rModels[i].get() ), + "StdTabController:ImplCreateComponentSequence: inconsistence (elements)!" ); + } + } + } +#endif - const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > * pControls = rControls.getConstArray(); + const Reference< XControl > * pControls = rControls.getConstArray(); sal_uInt32 nCtrls = rControls.getLength(); - rComponents = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > >( nCtrls ); - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > * pComps = rComponents.getArray(); - ::com::sun::star::uno::Any* pTabs = NULL; + rComponents.realloc( nCtrls ); + Reference< XWindow > * pComps = rComponents.getArray(); + Any* pTabs = NULL; if ( pTabStops ) { - *pTabStops = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any>( nCtrls ); + *pTabStops = Sequence< Any>( nCtrls ); pTabs = pTabStops->getArray(); } for ( sal_uInt32 n = 0; bOK && ( n < nCtrls ); n++ ) { // Zum Model passendes Control suchen - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > xCtrl(pControls[n]); + Reference< XControl > xCtrl(pControls[n]); if ( xCtrl.is() ) { if (bPeerComponent) - pComps[n] = ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > (xCtrl->getPeer(), ::com::sun::star::uno::UNO_QUERY); + pComps[n] = Reference< XWindow > (xCtrl->getPeer(), UNO_QUERY); else - pComps[n] = ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > (xCtrl, ::com::sun::star::uno::UNO_QUERY); + pComps[n] = Reference< XWindow > (xCtrl, UNO_QUERY); - // TabStop-::com::sun::star::beans::Property + // TabStop-Property if ( pTabs ) { // opt: String fuer TabStop als Konstante static const ::rtl::OUString aTabStopName( ::rtl::OUString::createFromAscii( "Tabstop" ) ); - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xPSet( xCtrl->getModel(), ::com::sun::star::uno::UNO_QUERY ); - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > xInfo = xPSet->getPropertySetInfo(); + Reference< XPropertySet > xPSet( xCtrl->getModel(), UNO_QUERY ); + Reference< XPropertySetInfo > xInfo = xPSet->getPropertySetInfo(); if( xInfo->hasPropertyByName( aTabStopName ) ) pTabs[n] = xPSet->getPropertyValue( aTabStopName ); } @@ -166,18 +191,18 @@ sal_Bool StdTabController::ImplCreateComponentSequence( ::com::sun::star::uno::S void StdTabController::ImplActivateControl( sal_Bool bFirst ) const { // HACK wegen #53688#, muss auf ein Interface abgebildet werden, wenn Controls Remote liegen koennen. - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > xTabController(const_cast< ::cppu::OWeakObject* >(static_cast< const ::cppu::OWeakObject* >(this)), ::com::sun::star::uno::UNO_QUERY); - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > > aCtrls = xTabController->getControls(); - const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > * pControls = aCtrls.getConstArray(); + Reference< XTabController > xTabController(const_cast< ::cppu::OWeakObject* >(static_cast< const ::cppu::OWeakObject* >(this)), UNO_QUERY); + Sequence< Reference< XControl > > aCtrls = xTabController->getControls(); + const Reference< XControl > * pControls = aCtrls.getConstArray(); sal_uInt32 nCount = aCtrls.getLength(); for ( sal_uInt32 n = bFirst ? 0 : nCount; bFirst ? ( n < nCount ) : n; ) { sal_uInt32 nCtrl = bFirst ? n++ : --n; - DBG_ASSERT( pControls[nCtrl].is(), "Control nicht im ::com::sun::star::sdbcx::Container!" ); + DBG_ASSERT( pControls[nCtrl].is(), "Control nicht im Container!" ); if ( pControls[nCtrl].is() ) { - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xCP = pControls[nCtrl]->getPeer(); + Reference< XWindowPeer > xCP = pControls[nCtrl]->getPeer(); if ( xCP.is() ) { VCLXWindow* pC = VCLXWindow::GetImplementation( xCP ); @@ -191,77 +216,77 @@ void StdTabController::ImplActivateControl( sal_Bool bFirst ) const } } -// ::com::sun::star::uno::XInterface -::com::sun::star::uno::Any StdTabController::queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) +// XInterface +Any StdTabController::queryAggregation( const Type & rType ) throw(RuntimeException) { - ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType, - SAL_STATIC_CAST( ::com::sun::star::awt::XTabController*, this ), - SAL_STATIC_CAST( ::com::sun::star::lang::XServiceInfo*, this ), - SAL_STATIC_CAST( ::com::sun::star::lang::XTypeProvider*, this ) ); + Any aRet = ::cppu::queryInterface( rType, + SAL_STATIC_CAST( XTabController*, this ), + SAL_STATIC_CAST( XServiceInfo*, this ), + SAL_STATIC_CAST( XTypeProvider*, this ) ); return (aRet.hasValue() ? aRet : OWeakAggObject::queryAggregation( rType )); } -// ::com::sun::star::lang::XTypeProvider +// XTypeProvider IMPL_XTYPEPROVIDER_START( StdTabController ) - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController>* ) NULL ), - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo>* ) NULL ) + getCppuType( ( Reference< XTabController>* ) NULL ), + getCppuType( ( Reference< XServiceInfo>* ) NULL ) IMPL_XTYPEPROVIDER_END -void StdTabController::setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabControllerModel >& Model ) throw(::com::sun::star::uno::RuntimeException) +void StdTabController::setModel( const Reference< XTabControllerModel >& Model ) throw(RuntimeException) { ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); mxModel = Model; } -::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabControllerModel > StdTabController::getModel( ) throw(::com::sun::star::uno::RuntimeException) +Reference< XTabControllerModel > StdTabController::getModel( ) throw(RuntimeException) { ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); return mxModel; } -void StdTabController::setContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& Container ) throw(::com::sun::star::uno::RuntimeException) +void StdTabController::setContainer( const Reference< XControlContainer >& Container ) throw(RuntimeException) { ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); mxControlContainer = Container; } -::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > StdTabController::getContainer( ) throw(::com::sun::star::uno::RuntimeException) +Reference< XControlContainer > StdTabController::getContainer( ) throw(RuntimeException) { ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); return mxControlContainer; } -::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > > StdTabController::getControls( ) throw(::com::sun::star::uno::RuntimeException) +Sequence< Reference< XControl > > StdTabController::getControls( ) throw(RuntimeException) { ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > > aSeq; + Sequence< Reference< XControl > > aSeq; if ( mxControlContainer.is() ) { - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > > aModels = mxModel->getControlModels(); - const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > * pModels = aModels.getConstArray(); + Sequence< Reference< XControlModel > > aModels = mxModel->getControlModels(); + const Reference< XControlModel > * pModels = aModels.getConstArray(); - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > > xCtrls = mxControlContainer->getControls(); + Sequence< Reference< XControl > > xCtrls = mxControlContainer->getControls(); sal_uInt32 nCtrls = aModels.getLength(); - aSeq = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > >( nCtrls ); + aSeq = Sequence< Reference< XControl > >( nCtrls ); for ( sal_uInt32 n = 0; n < nCtrls; n++ ) { - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > xCtrlModel = pModels[n]; + Reference< XControlModel > xCtrlModel = pModels[n]; // Zum Model passendes Control suchen - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > xCtrl = FindControl( xCtrls, xCtrlModel ); + Reference< XControl > xCtrl = FindControl( xCtrls, xCtrlModel ); aSeq.getArray()[n] = xCtrl; } } return aSeq; } -void StdTabController::autoTabOrder( ) throw(::com::sun::star::uno::RuntimeException) +void StdTabController::autoTabOrder( ) throw(RuntimeException) { ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); @@ -269,30 +294,30 @@ void StdTabController::autoTabOrder( ) throw(::com::sun::star::uno::RuntimeExce if ( !mxControlContainer.is() ) return; - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > > aSeq = mxModel->getControlModels(); - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > > aCompSeq; + Sequence< Reference< XControlModel > > aSeq = mxModel->getControlModels(); + Sequence< Reference< XWindow > > aCompSeq; // vieleicht erhalte ich hier einen TabController, // der schneller die Liste meiner Controls ermittelt - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > xTabController(static_cast< ::cppu::OWeakObject* >(this), ::com::sun::star::uno::UNO_QUERY); - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > > aControls = xTabController->getControls(); + Reference< XTabController > xTabController(static_cast< ::cppu::OWeakObject* >(this), UNO_QUERY); + Sequence< Reference< XControl > > aControls = xTabController->getControls(); - // #58317# Es sind ggf. noch nicht alle Controls fuer die Models im ::com::sun::star::sdbcx::Container, + // #58317# Es sind ggf. noch nicht alle Controls fuer die Models im Container, // dann kommt spaeter nochmal ein autoTabOrder... if( !ImplCreateComponentSequence( aControls, aSeq, aCompSeq, NULL, sal_False ) ) return; sal_uInt32 nCtrls = aCompSeq.getLength(); - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > * pComponents = aCompSeq.getArray(); + Reference< XWindow > * pComponents = aCompSeq.getArray(); ComponentEntryList aCtrls; sal_uInt32 n; for ( n = 0; n < nCtrls; n++ ) { - ::com::sun::star::awt::XWindow* pC = (::com::sun::star::awt::XWindow*)pComponents[n].get(); + XWindow* pC = (XWindow*)pComponents[n].get(); ComponentEntry* pE = new ComponentEntry; pE->pComponent = pC; - ::com::sun::star::awt::Rectangle aPosSize = pC->getPosSize(); + awt::Rectangle aPosSize = pC->getPosSize(); pE->aPos.X() = aPosSize.X; pE->aPos.Y() = aPosSize.Y; @@ -313,11 +338,11 @@ void StdTabController::autoTabOrder( ) throw(::com::sun::star::uno::RuntimeExce aCtrls.Insert( pE, nPos ); } - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > > aNewSeq( nCtrls ); + Sequence< Reference< XControlModel > > aNewSeq( nCtrls ); for ( n = 0; n < nCtrls; n++ ) { ComponentEntry* pE = aCtrls.GetObject( n ); - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > xUC( pE->pComponent, ::com::sun::star::uno::UNO_QUERY ); + Reference< XControl > xUC( pE->pComponent, UNO_QUERY ); aNewSeq.getArray()[n] = xUC->getModel(); delete pE; } @@ -326,62 +351,68 @@ void StdTabController::autoTabOrder( ) throw(::com::sun::star::uno::RuntimeExce mxModel->setControlModels( aNewSeq ); } -void StdTabController::activateTabOrder( ) throw(::com::sun::star::uno::RuntimeException) +void StdTabController::activateTabOrder( ) throw(RuntimeException) { ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); - // Am ::com::sun::star::sdbcx::Container die Tab-Reihenfolge aktivieren... + // Am Container die Tab-Reihenfolge aktivieren... - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > xC( mxControlContainer, ::com::sun::star::uno::UNO_QUERY ); + Reference< XControl > xC( mxControlContainer, UNO_QUERY ); if ( !xC.is() || !xC->getPeer().is() ) return; // vieleicht erhalte ich hier einen TabController, // der schneller die Liste meiner Controls ermittelt - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > xTabController(static_cast< ::cppu::OWeakObject* >(this), ::com::sun::star::uno::UNO_QUERY); + Reference< XTabController > xTabController(static_cast< ::cppu::OWeakObject* >(this), UNO_QUERY); // Flache Liste besorgen... - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > > aSeq = mxModel->getControlModels(); - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > > aCompSeq; - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any> aTabSeq; + Sequence< Reference< XControlModel > > aSeq = mxModel->getControlModels(); + Sequence< Reference< XWindow > > aCompSeq; + Sequence< Any> aTabSeq; // DG: Aus Optimierungsgruenden werden die Controls mittels getControls() geholt, // dieses hoert sich zwar wiedersinning an, fuehrt aber im konkreten Fall (Forms) zu sichtbaren // Geschwindigkeitsvorteilen - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > > aCtrls = xTabController->getControls(); + Sequence< Reference< XControl > > aControls = xTabController->getControls(); - // #58317# Es sind ggf. noch nicht alle Controls fuer die Models im ::com::sun::star::sdbcx::Container, + // #58317# Es sind ggf. noch nicht alle Controls fuer die Models im Container, // dann kommt spaeter nochmal ein activateTabOrder... - if( !ImplCreateComponentSequence( aCtrls, aSeq, aCompSeq, &aTabSeq, sal_True ) ) + if( !ImplCreateComponentSequence( aControls, aSeq, aCompSeq, &aTabSeq, sal_True ) ) return; - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XVclContainerPeer > xVclContainerPeer( xC->getPeer(), ::com::sun::star::uno::UNO_QUERY ); - + Reference< XVclContainerPeer > xVclContainerPeer( xC->getPeer(), UNO_QUERY ); xVclContainerPeer->setTabOrder( aCompSeq, aTabSeq, mxModel->getGroupControl() ); - // Gruppen... - aCtrls = xTabController->getControls(); - ::rtl::OUString aName; - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > > aGroupSeq; + Sequence< Reference< XControlModel > > aThisGroupModels; + Sequence< Reference< XWindow > > aControlComponents; + sal_uInt32 nGroups = mxModel->getGroupCount(); for ( sal_uInt32 nG = 0; nG < nGroups; nG++ ) { - mxModel->getGroup( nG, aGroupSeq, aName ); - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > > aCompSeq; - ImplCreateComponentSequence( aCtrls, aGroupSeq, aCompSeq, NULL, sal_True ); - xVclContainerPeer->setGroup( aCompSeq ); + mxModel->getGroup( nG, aThisGroupModels, aName ); + + aControls = xTabController->getControls(); + // ImplCreateComponentSequence has a really strange semantics regarding it's first parameter: + // upon method entry, it expects a super set of the controls which it returns + // this means we need to completely fill this sequence with all available controls before + // calling into ImplCreateComponentSequence + + aControlComponents.realloc( 0 ); + + ImplCreateComponentSequence( aControls, aThisGroupModels, aControlComponents, NULL, sal_True ); + xVclContainerPeer->setGroup( aControlComponents ); } } -void StdTabController::activateFirst( ) throw(::com::sun::star::uno::RuntimeException) +void StdTabController::activateFirst( ) throw(RuntimeException) { ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); ImplActivateControl( sal_True ); } -void StdTabController::activateLast( ) throw(::com::sun::star::uno::RuntimeException) +void StdTabController::activateLast( ) throw(RuntimeException) { ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() ); @@ -389,8 +420,8 @@ void StdTabController::activateLast( ) throw(::com::sun::star::uno::RuntimeExce } -::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > StdTabController::FindControl( ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > >& rCtrls, - const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > & rxCtrlModel ) +Reference< XControl > StdTabController::FindControl( Sequence< Reference< XControl > >& rCtrls, + const Reference< XControlModel > & rxCtrlModel ) { /* @@ -413,7 +444,7 @@ void StdTabController::activateLast( ) throw(::com::sun::star::uno::RuntimeExce while( aIt.hasMoreElements() ) { XEventListener* pL = aIt.next(); - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > xC( pL, ::com::sun::star::uno::UNO_QUERY ); + Reference< XControl > xC( pL, UNO_QUERY ); if ( xC.is() ) { if( xC->getContext() == mxControlContainer ) @@ -428,17 +459,17 @@ void StdTabController::activateLast( ) throw(::com::sun::star::uno::RuntimeExce */ DBG_ASSERT( rxCtrlModel.is(), "ImplFindControl - welches ?!" ); - const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > * pCtrls = rCtrls.getConstArray(); + const Reference< XControl > * pCtrls = rCtrls.getConstArray(); sal_Int32 nCtrls = rCtrls.getLength(); for ( sal_Int32 n = 0; n < nCtrls; n++ ) { - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > xModel(pCtrls[n].is() ? pCtrls[n]->getModel() : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > ()); - if ( (::com::sun::star::awt::XControlModel*)xModel.get() == (::com::sun::star::awt::XControlModel*)rxCtrlModel.get() ) + Reference< XControlModel > xModel(pCtrls[n].is() ? pCtrls[n]->getModel() : Reference< XControlModel > ()); + if ( (XControlModel*)xModel.get() == (XControlModel*)rxCtrlModel.get() ) { - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > xCtrl( pCtrls[n] ); + Reference< XControl > xCtrl( pCtrls[n] ); ::comphelper::removeElementAt( rCtrls, n ); return xCtrl; } } - return ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > (); + return Reference< XControl > (); } |