summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/app
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-02-17 15:39:54 +0000
committerOliver Bolte <obo@openoffice.org>2009-02-17 15:39:54 +0000
commit598010191ab80a67f12399c9db49ff519882b898 (patch)
treec42644ad6ac38c8549d97f5093dd2c70fd8b767c /dbaccess/source/ui/app
parent55866efd92b9444e8c66abd67b8d46a9453d84ea (diff)
CWS-TOOLING: integrate CWS dba31h
2009-01-29 10:47:07 +0100 oj r267102 : decl OpCodeMap as friend 2009-01-26 09:41:21 +0100 fs r266905 : #i97137# 2009-01-26 09:10:39 +0100 fs r266903 : #i10000 2009-01-26 09:00:17 +0100 fs r266901 : re-enable user admin for MySQL native 2009-01-23 21:56:08 +0100 fs r266851 : #i97137# 2009-01-23 21:32:40 +0100 fs r266850 : #i97042# 2009-01-23 11:23:59 +0100 msc r266800 : #i98387# 2009-01-23 11:17:05 +0100 msc r266798 : #i98387# 2009-01-23 10:56:33 +0100 fs r266795 : for the moment, disable user administration for MySQL native 2009-01-21 15:08:54 +0100 fs r266672 : removed some advanced settings for MySQL native - letting the user control them does not make sense for this particular type 2009-01-21 13:55:13 +0100 oj r266668 : #i98317# wrong var set 2009-01-21 13:41:22 +0100 fs r266664 : #i98315# 2009-01-21 13:13:09 +0100 oj r266661 : #i97032# enable locking for OOo 2009-01-21 13:11:26 +0100 oj r266660 : #i97032# enable locking for OOo 2009-01-21 10:10:50 +0100 oj r266634 : #i98174# merge conflict resolved 2009-01-21 08:48:58 +0100 fs r266628 : CWS-TOOLING: rebase CWS dba31h to trunk@266428 (milestone: DEV300:m39) 2009-01-20 12:54:32 +0100 fs r266570 : #i98277# 2009-01-19 10:46:31 +0100 fs r266480 : #i97995# 2009-01-19 08:42:09 +0100 fs r266470 : #i97042# provided my mod@openoffice.org: support more SQL comment styles 2009-01-19 07:55:43 +0100 oj r266468 : #i98115# check function name as well 2009-01-16 10:21:28 +0100 oj r266404 : #i97861# remove invalid assertion 2009-01-16 10:18:31 +0100 oj r266403 : #i97861# ini var with false 2009-01-15 14:09:50 +0100 oj r266371 : #i97810# saveas fix 2009-01-15 11:54:18 +0100 oj r266360 : remove : from mysql 2009-01-15 11:07:46 +0100 oj r266355 : insert JNI fixes for method names 2009-01-15 10:54:44 +0100 oj r266351 : fix for parameter subst 2009-01-14 14:41:34 +0100 oj r266308 : parameter subst 2009-01-14 14:40:20 +0100 oj r266307 : add missing try catch 2009-01-14 14:38:34 +0100 oj r266306 : new service for parameter subst 2009-01-14 14:37:52 +0100 oj r266305 : missing types for hyper 2009-01-09 15:28:36 +0100 fs r266090 : #i97889# 2009-01-09 14:16:15 +0100 fs r266082 : #i97892# provided by npower: when reading the xlink:href attrib, use the graphic resolver only if appropriate 2009-01-08 21:31:21 +0100 fs r266041 : #i97346# 2009-01-08 14:51:56 +0100 fs r266012 : #i97871# showPreviewFor: bail out if preview is disabled
Diffstat (limited to 'dbaccess/source/ui/app')
-rw-r--r--dbaccess/source/ui/app/AppController.cxx7
-rw-r--r--dbaccess/source/ui/app/subcomponentmanager.cxx51
-rw-r--r--dbaccess/source/ui/app/subcomponentmanager.hxx4
3 files changed, 53 insertions, 9 deletions
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index 004622e00..e8a1b36ef 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -409,7 +409,7 @@ DBG_NAME(OApplicationController)
OApplicationController::OApplicationController(const Reference< XMultiServiceFactory >& _rxORB)
:OApplicationController_CBASE( _rxORB )
,m_aContextMenuInterceptors( getMutex() )
- ,m_pSubComponentManager( new SubComponentManager( getSharedMutex() ) )
+ ,m_pSubComponentManager( new SubComponentManager( *this, getSharedMutex() ) )
,m_aTableCopyHelper(this)
,m_pClipbordNotifier(NULL)
,m_nAsyncDrop(0)
@@ -942,7 +942,7 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const
case SID_DB_APP_DSUSERADMIN:
{
::dbaccess::DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL)));
- aReturn.bEnabled = ::dbaccess::DST_EMBEDDED_HSQLDB != eType;
+ aReturn.bEnabled = ( ::dbaccess::DST_EMBEDDED_HSQLDB != eType );
}
break;
case SID_DB_APP_DSRELDESIGN:
@@ -2322,6 +2322,9 @@ void OApplicationController::onSelectionChanged()
// -----------------------------------------------------------------------------
void OApplicationController::showPreviewFor(const ElementType _eType,const ::rtl::OUString& _sName)
{
+ if ( m_ePreviewMode == E_PREVIEWNONE )
+ return;
+
OApplicationView* pView = getContainer();
if ( !pView )
return;
diff --git a/dbaccess/source/ui/app/subcomponentmanager.cxx b/dbaccess/source/ui/app/subcomponentmanager.cxx
index 5794670c2..32de57d29 100644
--- a/dbaccess/source/ui/app/subcomponentmanager.cxx
+++ b/dbaccess/source/ui/app/subcomponentmanager.cxx
@@ -28,6 +28,7 @@
************************************************************************/
#include "subcomponentmanager.hxx"
+#include "AppController.hxx"
/** === begin UNO includes === **/
#include <com/sun/star/frame/XFrame.hpp>
@@ -35,6 +36,7 @@
#include <com/sun/star/frame/XModel2.hpp>
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
+#include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
/** === end UNO includes === **/
#include <tools/diagnose_ex.h>
@@ -71,6 +73,7 @@ namespace dbaui
using ::com::sun::star::container::XEnumeration;
using ::com::sun::star::util::XCloseable;
using ::com::sun::star::awt::XTopWindow;
+ using ::com::sun::star::document::XDocumentEventBroadcaster;
/** === end UNO using === **/
//==============================================================================
@@ -116,6 +119,8 @@ namespace dbaui
if ( !xModel.is() )
xModel.set( xController->getModel() );
}
+
+ inline bool is() const { return xFrame.is(); }
};
struct SelectSubComponent : public ::std::unary_function< SubComponentDescriptor, Reference< XComponent > >
@@ -180,11 +185,13 @@ namespace dbaui
//==============================================================================
struct SubComponentManager_Data
{
- SubComponentManager_Data( const ::comphelper::SharedMutex& _rMutex )
- :m_aMutex( _rMutex )
+ SubComponentManager_Data( OApplicationController& _rController, const ::comphelper::SharedMutex& _rMutex )
+ :m_rController( _rController )
+ ,m_aMutex( _rMutex )
{
}
+ OApplicationController& m_rController;
mutable ::comphelper::SharedMutex m_aMutex;
SubComponentMap m_aComponents;
@@ -195,8 +202,8 @@ namespace dbaui
//= SubComponentManager
//====================================================================
//--------------------------------------------------------------------
- SubComponentManager::SubComponentManager( const ::comphelper::SharedMutex& _rMutex )
- :m_pData( new SubComponentManager_Data( _rMutex ) )
+ SubComponentManager::SubComponentManager( OApplicationController& _rController, const ::comphelper::SharedMutex& _rMutex )
+ :m_pData( new SubComponentManager_Data( _rController, _rMutex ) )
{
}
@@ -276,12 +283,33 @@ namespace dbaui
}
return bSuccess;
}
+
+ // -----------------------------------------------------------------------------
+ void lcl_notifySubComponentEvent( const SubComponentManager_Data& _rData, const sal_Char* _pAsciiEventName,
+ const SubComponentDescriptor& _rComponent )
+ {
+ try
+ {
+ Reference< XDocumentEventBroadcaster > xBroadcaster( _rData.m_rController.getModel(), UNO_QUERY_THROW );
+ xBroadcaster->notifyDocumentEvent(
+ ::rtl::OUString::createFromAscii( _pAsciiEventName ),
+ &_rData.m_rController,
+ makeAny( _rComponent.xFrame )
+ );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
}
//--------------------------------------------------------------------
void SAL_CALL SubComponentManager::disposing( const EventObject& _rSource ) throw (RuntimeException)
{
- ::osl::MutexGuard aGuard( m_pData->getMutex() );
+ ::osl::ClearableMutexGuard aGuard( m_pData->getMutex() );
+
+ SubComponentDescriptor aClosedComponent;
for ( SubComponentMap::iterator comp = m_pData->m_aComponents.begin();
comp != m_pData->m_aComponents.end();
@@ -312,10 +340,17 @@ namespace dbaui
if ( bRemove )
{
+ aClosedComponent = comp->second;
m_pData->m_aComponents.erase( comp );
break;
}
}
+
+ if ( aClosedComponent.is() )
+ {
+ aGuard.clear();
+ lcl_notifySubComponentEvent( *m_pData, "OnSubComponentClosed", aClosedComponent );
+ }
}
//--------------------------------------------------------------------
@@ -372,7 +407,7 @@ namespace dbaui
void SubComponentManager::onSubComponentOpened( const ::rtl::OUString& _rName, const sal_Int32 _nComponentType,
const ElementOpenMode _eOpenMode, const Reference< XComponent >& _rxComponent )
{
- ::osl::MutexGuard aGuard( m_pData->getMutex() );
+ ::osl::ClearableMutexGuard aGuard( m_pData->getMutex() );
// put into map
SubComponentAccessor aKey( _rName, _nComponentType, _eOpenMode );
@@ -386,6 +421,10 @@ namespace dbaui
aElement.xController->addEventListener( this );
if ( aElement.xModel.is() )
aElement.xModel->addEventListener( this );
+
+ // notify this to interested parties
+ aGuard.clear();
+ lcl_notifySubComponentEvent( *m_pData, "OnSubComponentOpened", aElement );
}
// -----------------------------------------------------------------------------
diff --git a/dbaccess/source/ui/app/subcomponentmanager.hxx b/dbaccess/source/ui/app/subcomponentmanager.hxx
index af0aa3441..8348fdfb6 100644
--- a/dbaccess/source/ui/app/subcomponentmanager.hxx
+++ b/dbaccess/source/ui/app/subcomponentmanager.hxx
@@ -48,6 +48,8 @@ namespace dbaui
//........................................................................
struct SubComponentManager_Data;
+ class OApplicationController;
+
//====================================================================
//= SubComponentManager
//====================================================================
@@ -56,7 +58,7 @@ namespace dbaui
class SubComponentManager : public SubComponentManager_Base
{
public:
- SubComponentManager( const ::comphelper::SharedMutex& _rMutex );
+ SubComponentManager( OApplicationController& _rController, const ::comphelper::SharedMutex& _rMutex );
virtual ~SubComponentManager();
void disposing();