diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-09-02 07:15:38 +0200 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-09-02 07:15:38 +0200 |
commit | 24d181f1087569b3c5ad68b7bb2f4e90efbc4094 (patch) | |
tree | 79b763babe9098a1f9e9da0c5672e0f9e7f69900 | |
parent | 3864a0acb6f15c905f6b33565bff7238b914314c (diff) |
dba33i: #i113506# when loading a sub component which is already open, return the existing component instead of NULL
-rw-r--r-- | dbaccess/source/ui/app/AppController.cxx | 11 | ||||
-rw-r--r-- | dbaccess/source/ui/app/subcomponentmanager.cxx | 10 | ||||
-rw-r--r-- | dbaccess/source/ui/app/subcomponentmanager.hxx | 3 |
3 files changed, 18 insertions, 6 deletions
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 94bbb23d7..001105bc1 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -1347,7 +1347,9 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa InvalidateAll(); break; case SID_DB_APP_DSRELDESIGN: - if ( !m_pSubComponentManager->activateSubFrame( ::rtl::OUString(), SID_DB_APP_DSRELDESIGN, E_OPEN_DESIGN ) ) + { + Reference< XComponent > xRelationDesigner; + if ( !m_pSubComponentManager->activateSubFrame( ::rtl::OUString(), SID_DB_APP_DSRELDESIGN, E_OPEN_DESIGN, xRelationDesigner ) ) { SharedConnection xConnection( ensureConnection() ); if ( xConnection.is() ) @@ -1359,7 +1361,8 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa onDocumentOpened( ::rtl::OUString(), SID_DB_APP_DSRELDESIGN, E_OPEN_DESIGN, xComponent, NULL ); } } - break; + } + break; case SID_DB_APP_DSUSERADMIN: { SharedConnection xConnection( ensureConnection() ); @@ -1844,7 +1847,7 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const case E_REPORT: case E_FORM: { - if ( !m_pSubComponentManager->activateSubFrame( _sName, _eType, _eOpenMode ) ) + if ( !m_pSubComponentManager->activateSubFrame( _sName, _eType, _eOpenMode, xRet ) ) { ::std::auto_ptr< OLinkedDocumentsAccess > aHelper = getDocumentsAccess( _eType ); if ( !aHelper->isConnected() ) @@ -1861,7 +1864,7 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const case E_QUERY: case E_TABLE: { - if ( !m_pSubComponentManager->activateSubFrame( _sName, _eType, _eOpenMode ) ) + if ( !m_pSubComponentManager->activateSubFrame( _sName, _eType, _eOpenMode, xRet ) ) { SharedConnection xConnection( ensureConnection() ); if ( !xConnection.is() ) diff --git a/dbaccess/source/ui/app/subcomponentmanager.cxx b/dbaccess/source/ui/app/subcomponentmanager.cxx index 251ba9b8d..ea37fcf96 100644 --- a/dbaccess/source/ui/app/subcomponentmanager.cxx +++ b/dbaccess/source/ui/app/subcomponentmanager.cxx @@ -529,7 +529,8 @@ namespace dbaui } //------------------------------------------------------------------------------------------------------------------ - bool SubComponentManager::activateSubFrame( const ::rtl::OUString& _rName, const sal_Int32 _nComponentType, const ElementOpenMode _eOpenMode ) const + bool SubComponentManager::activateSubFrame( const ::rtl::OUString& _rName, const sal_Int32 _nComponentType, + const ElementOpenMode _eOpenMode, Reference< XComponent >& o_rComponent ) const { ::osl::MutexGuard aGuard( m_pData->getMutex() ); @@ -546,6 +547,13 @@ namespace dbaui const Reference< XTopWindow > xTopWindow( xFrame->getContainerWindow(), UNO_QUERY_THROW ); xTopWindow->toFront(); + if ( pos->xModel.is() ) + o_rComponent = pos->xModel.get(); + else if ( pos->xController.is() ) + o_rComponent = pos->xController.get(); + else + o_rComponent = pos->xFrame.get(); + return true; } diff --git a/dbaccess/source/ui/app/subcomponentmanager.hxx b/dbaccess/source/ui/app/subcomponentmanager.hxx index d84cef286..a0dd80b65 100644 --- a/dbaccess/source/ui/app/subcomponentmanager.hxx +++ b/dbaccess/source/ui/app/subcomponentmanager.hxx @@ -90,7 +90,8 @@ namespace dbaui bool activateSubFrame( const ::rtl::OUString& _rName, const sal_Int32 _nComponentType, - const ElementOpenMode _eOpenMode + const ElementOpenMode _eOpenMode, + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& o_rComponent ) const; /** closes all frames of the given component |