diff options
Diffstat (limited to 'dbaccess/source/ui/browser')
-rw-r--r-- | dbaccess/source/ui/browser/brwctrlr.cxx | 517 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/exsrcbrw.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/sbagrid.cxx | 46 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/unodatbr.cxx | 307 |
4 files changed, 465 insertions, 408 deletions
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 91b0fd968afb..8db327fb8b85 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -32,187 +32,72 @@ #include "precompiled_dbaccess.hxx" -#ifndef _SBA_BWRCTRLR_HXX + +#include "browserids.hxx" #include "brwctrlr.hxx" -#endif -#ifndef _SBX_BRWVIEW_HXX #include "brwview.hxx" -#endif -#ifndef _OSL_MUTEX_HXX_ //autogen wg. MutexGuard -#include <osl/mutex.hxx> -#endif -#ifndef _SFXAPP_HXX //autogen wg. SFX_APP -#include <sfx2/app.hxx> -#endif -#ifndef _COM_SUN_STAR_UNO_TYPECLASS_HPP_ -#include <com/sun/star/uno/TypeClass.hpp> -#endif -#ifndef _DBAUI_SQLMESSAGE_HXX_ +#include "dbu_brw.hrc" +#include "dbustrings.hrc" +#include "queryfilter.hxx" +#include "queryorder.hxx" #include "sqlmessage.hxx" -#endif -#ifndef _COM_SUN_STAR_FORM_XFORMCONTROLLER_HPP_ -#include <com/sun/star/form/XFormController.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_COMMANDTYPE_HPP_ -#include <com/sun/star/sdb/CommandType.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBC_XROWSETLISTENER_HPP_ -#include <com/sun/star/sdbc/XRowSetListener.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_ -#include <com/sun/star/sdbc/XConnection.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBCX_XROWLOCATE_HPP_ -#include <com/sun/star/sdbcx/XRowLocate.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBC_XRESULTSETUPDATE_HPP_ -#include <com/sun/star/sdbc/XResultSetUpdate.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_XSQLERRORBROADCASTER_HPP_ -#include <com/sun/star/sdb/XSQLErrorBroadcaster.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_XSINGLESELECTQUERYCOMPOSER_HPP_ -#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XLOADABLE_HPP_ -#include <com/sun/star/form/XLoadable.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_SQLCONTEXT_HPP_ -#include <com/sun/star/sdb/SQLContext.hpp> -#endif -#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ + +/** === begin UNO includes === **/ #include <com/sun/star/beans/PropertyAttribute.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_FORMBUTTONTYPE_HPP_ +#include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/container/XNamed.hpp> #include <com/sun/star/form/FormButtonType.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XCHANGELISTENER_HPP_ -#include <com/sun/star/form/XChangeListener.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_FORMSUBMITENCODING_HPP_ #include <com/sun/star/form/FormSubmitEncoding.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_FORMSUBMITMETHOD_HPP_ #include <com/sun/star/form/FormSubmitMethod.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XSUBMITLISTENER_HPP_ -#include <com/sun/star/form/XSubmitListener.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XRESET_HPP_ -#include <com/sun/star/form/XReset.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XSUBMIT_HPP_ -#include <com/sun/star/form/XSubmit.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XAPPROVEACTIONBROADCASTER_HPP_ #include <com/sun/star/form/XApproveActionBroadcaster.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XCHANGEBROADCASTER_HPP_ +#include <com/sun/star/form/XBoundControl.hpp> #include <com/sun/star/form/XChangeBroadcaster.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XRESETLISTENER_HPP_ -#include <com/sun/star/form/XResetListener.hpp> -#endif -#ifndef _COM_SUN_STAR_UTIL_XCANCELLABLE_HPP_ -#include <com/sun/star/util/XCancellable.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XDATABASEPARAMETERBROADCASTER_HPP_ +#include <com/sun/star/form/XChangeListener.hpp> #include <com/sun/star/form/XDatabaseParameterBroadcaster.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XBOUNDCONTROL_HPP_ -#include <com/sun/star/form/XBoundControl.hpp> -#endif -#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_ -#include <com/sun/star/container/XNameContainer.hpp> -#endif -#ifndef _COM_SUN_STAR_CONTAINER_XNAMED_HPP_ -#include <com/sun/star/container/XNamed.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBCX_PRIVILEGE_HPP_ +#include <com/sun/star/form/XLoadable.hpp> +#include <com/sun/star/form/XReset.hpp> +#include <com/sun/star/form/XResetListener.hpp> +#include <com/sun/star/form/XSubmit.hpp> +#include <com/sun/star/form/XSubmitListener.hpp> +#include <com/sun/star/form/runtime/XFormController.hpp> +#include <com/sun/star/sdb/CommandType.hpp> +#include <com/sun/star/sdb/ErrorCondition.hpp> +#include <com/sun/star/sdb/ParametersRequest.hpp> +#include <com/sun/star/sdb/SQLContext.hpp> +#include <com/sun/star/sdb/XInteractionSupplyParameters.hpp> +#include <com/sun/star/sdb/XSQLErrorBroadcaster.hpp> +#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp> +#include <com/sun/star/sdbc/XConnection.hpp> +#include <com/sun/star/sdbc/XResultSetUpdate.hpp> +#include <com/sun/star/sdbc/XRowSetListener.hpp> +#include <com/sun/star/sdbc/XWarningsSupplier.hpp> #include <com/sun/star/sdbcx/Privilege.hpp> -#endif -#ifndef _CPPUHELPER_TYPEPROVIDER_HXX_ -#include <cppuhelper/typeprovider.hxx> -#endif -#ifndef _CPPUHELPER_EXC_HLP_HXX_ -#include <cppuhelper/exc_hlp.hxx> -#endif -#ifndef _SV_MSGBOX_HXX //autogen -#include <vcl/msgbox.hxx> -#endif -#ifndef _FMSEARCH_HXX -#include <svx/fmsearch.hxx> -#endif -#ifndef _SV_WAITOBJ_HXX -#include <vcl/waitobj.hxx> -#endif -#ifndef _TOOLS_COLOR_HXX -#include <tools/color.hxx> -#endif -#ifndef TOOLS_DIAGNOSE_EX_H -#include <tools/diagnose_ex.h> -#endif -#ifndef _COMPHELPER_SEQUENCE_HXX_ -#include <comphelper/sequence.hxx> -#endif -#ifndef _CONNECTIVITY_DBTOOLS_HXX_ -#include <connectivity/dbtools.hxx> -#endif -#ifndef _DBHELPER_DBEXCEPTION_HXX_ -#include <connectivity/dbexception.hxx> -#endif -#ifndef _CPPUHELPER_IMPLBASE2_HXX_ -#include <cppuhelper/implbase2.hxx> -#endif -#ifndef _DBU_BRW_HRC_ -#include "dbu_brw.hrc" -#endif -#ifndef _SFX_HRC -#include <sfx2/sfx.hrc> -#endif -#ifndef DBACCESS_UI_BROWSER_ID_HXX -#include "browserids.hxx" -#endif -#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC -#include "dbustrings.hrc" -#endif -#ifndef _COMPHELPER_INTERACTION_HXX_ +#include <com/sun/star/sdbcx/XRowLocate.hpp> +#include <com/sun/star/task/XInteractionHandler.hpp> +#include <com/sun/star/uno/TypeClass.hpp> +#include <com/sun/star/util/XCancellable.hpp> +/** === end UNO includes === **/ + +#include <comphelper/enumhelper.hxx> +#include <comphelper/extract.hxx> #include <comphelper/interaction.hxx> -#endif -#ifndef _DBHELPER_DBEXCEPTION_HXX_ +#include <comphelper/sequence.hxx> #include <connectivity/dbexception.hxx> -#endif -#ifndef CONNECTIVITY_SQLERROR_HXX +#include <connectivity/dbtools.hxx> #include <connectivity/sqlerror.hxx> -#endif -#ifndef _COMPHELPER_EXTRACT_HXX_ -#include <comphelper/extract.hxx> -#endif -#ifndef _COM_SUN_STAR_SDB_XINTERACTIONSUPPLYPARAMETERS_HPP_ -#include <com/sun/star/sdb/XInteractionSupplyParameters.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_PARAMETERSREQUEST_HPP_ -#include <com/sun/star/sdb/ParametersRequest.hpp> -#endif -#ifndef _COM_SUN_STAR_TASK_XINTERACTIONHANDLER_HPP_ -#include <com/sun/star/task/XInteractionHandler.hpp> -#endif -#ifndef INCLUDED_COM_SUN_STAR_SDBC_XWARNINGSSUPPLIER_HPP -#include <com/sun/star/sdbc/XWarningsSupplier.hpp> -#endif -#ifndef INCLUDED_COM_SUN_STAR_SDB_ERRORCONDITION_HPP -#include <com/sun/star/sdb/ErrorCondition.hpp> -#endif -#ifndef DBAUI_QUERYFILTER_HXX -#include "queryfilter.hxx" -#endif -#ifndef DBAUI_QUERYORDER_HXX -#include "queryorder.hxx" -#endif +#include <cppuhelper/exc_hlp.hxx> +#include <cppuhelper/implbase2.hxx> +#include <cppuhelper/typeprovider.hxx> +#include <osl/mutex.hxx> #include <rtl/logfile.hxx> - -#include <svx/svxdlg.hxx> //CHINA001 -//#include <svx/fmresids.hrc> //CHINA001 +#include <sfx2/app.hxx> +#include <sfx2/sfx.hrc> +#include <svx/fmsearch.hxx> +#include <svx/svxdlg.hxx> +#include <tools/color.hxx> +#include <tools/diagnose_ex.h> +#include <vcl/msgbox.hxx> +#include <vcl/waitobj.hxx> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::awt; @@ -280,12 +165,12 @@ void SAL_CALL OParameterContinuation::setParameters( const Sequence< PropertyVal //============================================================================== -// a helper class implementing a ::com::sun::star::form::XFormController, will be aggregated by SbaXDataBrowserController -// (we can't derive from ::com::sun::star::form::XFormController as it's base class is ::com::sun::star::awt::XTabController and the ::com::sun::star::awt::XTabController::getModel collides -// with the ::com::sun::star::frame::XController::getModel implemented in our base class SbaXDataBrowserController) +// a helper class implementing a runtime::XFormController, will be aggregated by SbaXDataBrowserController +// (we can't derive from XFormController as it's base class is XTabController and the XTabController::getModel collides +// with the XController::getModel implemented in our base class SbaXDataBrowserController) class SbaXDataBrowserController::FormControllerImpl - : public ::cppu::WeakAggImplHelper2< ::com::sun::star::form::XFormController, - ::com::sun::star::frame::XFrameActionListener> + : public ::cppu::WeakAggImplHelper2< ::com::sun::star::form::runtime::XFormController, + ::com::sun::star::frame::XFrameActionListener > { friend class SbaXDataBrowserController; ::cppu::OInterfaceContainerHelper m_aActivateListeners; @@ -294,12 +179,68 @@ class SbaXDataBrowserController::FormControllerImpl public: FormControllerImpl(SbaXDataBrowserController* pOwner); - // ::com::sun::star::form::XFormController + // XFormController + virtual ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormOperations > SAL_CALL getFormOperations() throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > SAL_CALL getCurrentControl(void) throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL addActivateListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormControllerListener > & l) throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL removeActivateListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormControllerListener > & l) throw( ::com::sun::star::uno::RuntimeException ); - - // ::com::sun::star::awt::XTabController + virtual void SAL_CALL addChildController( const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController >& _ChildController ) throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormControllerContext > SAL_CALL getContext() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setContext( const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormControllerContext >& _context ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler > SAL_CALL getInteractionHandler() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setInteractionHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _interactionHandler ) throw (::com::sun::star::uno::RuntimeException); + + // XChild, base of XFormController + virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); + + // XComponent, base of XFormController + virtual void SAL_CALL dispose( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + + // XIndexAccess, base of XFormController + virtual ::sal_Int32 SAL_CALL getCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + // XElementAccess, base of XIndexAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException); + + // XEnumerationAccess, base of XElementAccess + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration( ) throw (::com::sun::star::uno::RuntimeException); + + // XModifyBroadcaster, base of XFormController + virtual void SAL_CALL addModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + + // XConfirmDeleteBroadcaster, base of XFormController + virtual void SAL_CALL addConfirmDeleteListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XConfirmDeleteListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeConfirmDeleteListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XConfirmDeleteListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + + // XSQLErrorBroadcaster, base of XFormController + virtual void SAL_CALL addSQLErrorListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLErrorListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeSQLErrorListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLErrorListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); + + // XRowSetApproveBroadcaster, base of XFormController + virtual void SAL_CALL addRowSetApproveListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XRowSetApproveListener >& listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeRowSetApproveListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XRowSetApproveListener >& listener ) throw (::com::sun::star::uno::RuntimeException); + + // XDatabaseParameterBroadcaster2, base of XFormController + virtual void SAL_CALL addDatabaseParameterListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XDatabaseParameterListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeDatabaseParameterListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XDatabaseParameterListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + + // XDatabaseParameterBroadcaster, base of XDatabaseParameterBroadcaster2 + virtual void SAL_CALL addParameterListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XDatabaseParameterListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeParameterListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XDatabaseParameterListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + + // XModeSelector, base of XFormController + virtual void SAL_CALL setMode( const ::rtl::OUString& aMode ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getMode( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedModes( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL supportsMode( const ::rtl::OUString& aMode ) throw (::com::sun::star::uno::RuntimeException); + + // XTabController, base of XFormController virtual void SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabControllerModel > & Model) throw( ::com::sun::star::uno::RuntimeException ); virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabControllerModel > SAL_CALL getModel(void) throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL setContainer(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > & _Container) throw( ::com::sun::star::uno::RuntimeException ); @@ -310,10 +251,10 @@ public: virtual void SAL_CALL activateFirst(void) throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL activateLast(void) throw( ::com::sun::star::uno::RuntimeException ); - // ::com::sun::star::frame::XFrameActionListener + // XFrameActionListener virtual void SAL_CALL frameAction(const ::com::sun::star::frame::FrameActionEvent& aEvent) throw( ::com::sun::star::uno::RuntimeException ); - // ::com::sun::star::lang::XEventListener + // XEventListener virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException ); protected: @@ -340,6 +281,13 @@ SbaXDataBrowserController::FormControllerImpl::~FormControllerImpl() } //------------------------------------------------------------------ +Reference< runtime::XFormOperations > SAL_CALL SbaXDataBrowserController::FormControllerImpl::getFormOperations() throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::getFormOperations: not supported!" ); + return NULL; +} + +//------------------------------------------------------------------ Reference< ::com::sun::star::awt::XControl > SbaXDataBrowserController::FormControllerImpl::getCurrentControl(void) throw( RuntimeException ) { return m_pOwner->getBrowserView() ? m_pOwner->getBrowserView()->getGridControl() : Reference< ::com::sun::star::awt::XControl > (); @@ -358,6 +306,202 @@ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeActivateListe } //------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addChildController( const Reference< runtime::XFormController >& /*_ChildController*/ ) throw( RuntimeException, IllegalArgumentException ) +{ + // not supported + throw IllegalArgumentException( ::rtl::OUString(), *this, 1 ); +} + +//------------------------------------------------------------------ +Reference< runtime::XFormControllerContext > SAL_CALL SbaXDataBrowserController::FormControllerImpl::getContext() throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::getContext: no support!!" ); + return NULL; +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setContext( const Reference< runtime::XFormControllerContext >& /*_context*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::setContext: no support!!" ); +} + +//------------------------------------------------------------------ +Reference< XInteractionHandler > SAL_CALL SbaXDataBrowserController::FormControllerImpl::getInteractionHandler() throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::getInteractionHandler: no support!!" ); + return NULL; +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setInteractionHandler( const Reference< XInteractionHandler >& /*_interactionHandler*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::setInteractionHandler: no support!!" ); +} + +//------------------------------------------------------------------ +Reference< XInterface > SAL_CALL SbaXDataBrowserController::FormControllerImpl::getParent( ) throw (RuntimeException) +{ + // don't have any parent form controllers + return NULL; +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setParent( const Reference< XInterface >& /*Parent*/ ) throw (NoSupportException, RuntimeException) +{ + throw NoSupportException( ::rtl::OUString(), *this ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::dispose( ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::dispose: no, you do *not* want to do this!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addEventListener( const Reference< XEventListener >& /*xListener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addEventListener: no support!!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeEventListener( const Reference< XEventListener >& /*aListener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::removeEventListener: no support!!" ); +} + +//------------------------------------------------------------------ +::sal_Int32 SAL_CALL SbaXDataBrowserController::FormControllerImpl::getCount( ) throw (RuntimeException) +{ + // no sub controllers, never + return 0; +} + +//------------------------------------------------------------------ +Any SAL_CALL SbaXDataBrowserController::FormControllerImpl::getByIndex( ::sal_Int32 /*Index*/ ) throw (IndexOutOfBoundsException, WrappedTargetException, RuntimeException) +{ + // no sub controllers, never + throw IndexOutOfBoundsException( ::rtl::OUString(), *this ); +} + +//------------------------------------------------------------------ +Type SAL_CALL SbaXDataBrowserController::FormControllerImpl::getElementType( ) throw (RuntimeException) +{ + return ::cppu::UnoType< runtime::XFormController >::get(); +} + +//------------------------------------------------------------------ +::sal_Bool SAL_CALL SbaXDataBrowserController::FormControllerImpl::hasElements( ) throw (RuntimeException) +{ + // no sub controllers, never + return false; +} + +//------------------------------------------------------------------ +Reference< XEnumeration > SAL_CALL SbaXDataBrowserController::FormControllerImpl::createEnumeration( ) throw (RuntimeException) +{ + return new ::comphelper::OEnumerationByIndex( this ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addModifyListener( const Reference< XModifyListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addModifyListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeModifyListener( const Reference< XModifyListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::removeModifyListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addConfirmDeleteListener( const Reference< XConfirmDeleteListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addConfirmDeleteListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeConfirmDeleteListener( const Reference< XConfirmDeleteListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::removeConfirmDeleteListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addSQLErrorListener( const Reference< XSQLErrorListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addSQLErrorListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeSQLErrorListener( const Reference< XSQLErrorListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::removeSQLErrorListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addRowSetApproveListener( const Reference< XRowSetApproveListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addRowSetApproveListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeRowSetApproveListener( const Reference< XRowSetApproveListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::removeRowSetApproveListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addDatabaseParameterListener( const Reference< XDatabaseParameterListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addDatabaseParameterListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeDatabaseParameterListener( const Reference< XDatabaseParameterListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::removeDatabaseParameterListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addParameterListener( const Reference< XDatabaseParameterListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addParameterListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeParameterListener( const Reference< XDatabaseParameterListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::removeParameterListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setMode( const ::rtl::OUString& _rMode ) throw (NoSupportException, RuntimeException) +{ + if ( !supportsMode( _rMode ) ) + throw NoSupportException(); +} + +//------------------------------------------------------------------ +::rtl::OUString SAL_CALL SbaXDataBrowserController::FormControllerImpl::getMode( ) throw (RuntimeException) +{ + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataMode" ) ); +} + +//------------------------------------------------------------------ +Sequence< ::rtl::OUString > SAL_CALL SbaXDataBrowserController::FormControllerImpl::getSupportedModes( ) throw (RuntimeException) +{ + Sequence< ::rtl::OUString > aModes(1); + aModes[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataMode" ) ); + return aModes; +} + +//------------------------------------------------------------------ +::sal_Bool SAL_CALL SbaXDataBrowserController::FormControllerImpl::supportsMode( const ::rtl::OUString& aMode ) throw (RuntimeException) +{ + return aMode.compareToAscii( "DataMode" ) == 0; +} + +//------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setModel(const Reference< ::com::sun::star::awt::XTabControllerModel > & /*Model*/) throw( RuntimeException ) { OSL_ENSURE(sal_False, "SbaXDataBrowserController::FormControllerImpl::setModel : invalid call, can't change my model !"); @@ -465,19 +609,12 @@ Sequence< sal_Int8 > SAL_CALL SbaXDataBrowserController::getImplementationId( ) //------------------------------------------------------------------ Any SAL_CALL SbaXDataBrowserController::queryInterface(const Type& _rType) throw (RuntimeException) { - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::queryInterface" ); // check for our additional interfaces Any aRet = SbaXDataBrowserController_Base::queryInterface(_rType); - // check for the base controllers interfaces + // check for our aggregate (implementing the XFormController) if (!aRet.hasValue()) - { - // check for our aggregate (implementing the XFormController) - if (!aRet.hasValue()) - { - aRet = m_xFormControllerImpl->queryAggregation(_rType); - } - } + aRet = m_xFormControllerImpl->queryAggregation(_rType); // no more to offer return aRet; @@ -1206,16 +1343,6 @@ sal_Bool SbaXDataBrowserController::suspend(sal_Bool /*bSuspend*/) throw( Runtim // ----------------------------------------------------------------------- void SbaXDataBrowserController::disposing() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::disposing" ); - // and dispose the aggregate - if (m_xFormControllerImpl.is()) - { - Reference< XComponent > xAggComp; - m_xFormControllerImpl->queryAggregation(::getCppuType(&xAggComp)) >>= xAggComp; - if (xAggComp.is()) - xAggComp->dispose(); - } - // the base class SbaXDataBrowserController_Base::OGenericUnoController::disposing(); diff --git a/dbaccess/source/ui/browser/exsrcbrw.cxx b/dbaccess/source/ui/browser/exsrcbrw.cxx index 01475f549a14..da1b0968f2e9 100644 --- a/dbaccess/source/ui/browser/exsrcbrw.cxx +++ b/dbaccess/source/ui/browser/exsrcbrw.cxx @@ -43,9 +43,6 @@ #ifndef _COM_SUN_STAR_FORM_XGRIDCOLUMNFACTORY_HPP_ #include <com/sun/star/form/XGridColumnFactory.hpp> #endif -#ifndef _COM_SUN_STAR_FORM_XFORMCONTROLLER_HPP_ -#include <com/sun/star/form/XFormController.hpp> -#endif #ifndef _COM_SUN_STAR_FORM_XLOADABLE_HPP_ #include <com/sun/star/form/XLoadable.hpp> #endif diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 5440be1b5046..46f6c576c022 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -985,13 +985,13 @@ void SbaGridControl::PreExecuteRowContextMenu(sal_uInt16 nRow, PopupMenu& rMenu) rMenu.SetHelpId(ID_BROWSER_ROWHEIGHT, aNewItems.GetHelpId(ID_BROWSER_ROWHEIGHT)); rMenu.InsertSeparator(nPos++); } // if (!IsReadOnlyDB()) -
- if ( GetSelectRowCount() > 0 )
- {
- rMenu.InsertItem(ID_BROWSER_COPY, aNewItems.GetItemText(SID_COPY), 0, nPos++);
- rMenu.SetHelpId(ID_BROWSER_COPY, aNewItems.GetHelpId(SID_COPY));
-
- rMenu.InsertSeparator(nPos++);
+ + if ( GetSelectRowCount() > 0 ) + { + rMenu.InsertItem(ID_BROWSER_COPY, aNewItems.GetItemText(SID_COPY), 0, nPos++); + rMenu.SetHelpId(ID_BROWSER_COPY, aNewItems.GetHelpId(SID_COPY)); + + rMenu.InsertSeparator(nPos++); } } @@ -1428,20 +1428,20 @@ void SbaGridControl::DoColumnDrag(sal_uInt16 nColumnPos) } // ----------------------------------------------------------------------- -void SbaGridControl::CopySelectedRowsToClipboard()
-{
- DBG_ASSERT( GetSelectRowCount() > 0, "SbaGridControl::CopySelectedRowsToClipboard: invalid call!" );
- implTransferSelectedRows( (sal_Int16)FirstSelectedRow(), true );
-}
-
-// -----------------------------------------------------------------------
-void SbaGridControl::DoRowDrag( sal_Int16 nRowPos )
-{
- implTransferSelectedRows( nRowPos, false );
-}
-
-// -----------------------------------------------------------------------
-void SbaGridControl::implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfClipboardFalseIfDrag )
+void SbaGridControl::CopySelectedRowsToClipboard() +{ + DBG_ASSERT( GetSelectRowCount() > 0, "SbaGridControl::CopySelectedRowsToClipboard: invalid call!" ); + implTransferSelectedRows( (sal_Int16)FirstSelectedRow(), true ); +} + +// ----------------------------------------------------------------------- +void SbaGridControl::DoRowDrag( sal_Int16 nRowPos ) +{ + implTransferSelectedRows( nRowPos, false ); +} + +// ----------------------------------------------------------------------- +void SbaGridControl::implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfClipboardFalseIfDrag ) { Reference< XPropertySet > xDataSource(getDataSource(), UNO_QUERY); DBG_ASSERT(xDataSource.is(), "SbaGridControl::implTransferSelectedRows : invalid data source !"); @@ -1478,8 +1478,8 @@ void SbaGridControl::implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfC ODataClipboard* pTransfer = new ODataClipboard(xDataSource, aSelectedRows,xRowSetClone, getServiceManager()); Reference< XTransferable > xEnsureDelete = pTransfer; - if ( _bTrueIfClipboardFalseIfDrag )
- pTransfer->CopyToClipboard( this );
+ if ( _bTrueIfClipboardFalseIfDrag ) + pTransfer->CopyToClipboard( this ); else pTransfer->StartDrag(this, DND_ACTION_COPY | DND_ACTION_LINK); } diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 3e37fe1fc75a..b63383e47c0e 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -77,6 +77,7 @@ #include <com/sun/star/sdb/SQLContext.hpp> #include <com/sun/star/sdb/XBookmarksSupplier.hpp> #include <com/sun/star/sdb/XCompletedConnection.hpp> +#include <com/sun/star/sdb/XDatabaseRegistrations.hpp> #include <com/sun/star/sdb/XDocumentDataSource.hpp> #include <com/sun/star/sdb/XParametersSupplier.hpp> #include <com/sun/star/sdb/XQueriesSupplier.hpp> @@ -109,6 +110,7 @@ #include <comphelper/sequence.hxx> #include <comphelper/types.hxx> #include <connectivity/dbexception.hxx> +#include <cppuhelper/exc_hlp.hxx> #include <cppuhelper/implbase2.hxx> #include <cppuhelper/typeprovider.hxx> #include <sfx2/app.hxx> @@ -197,25 +199,21 @@ void SafeRemovePropertyListener(const Reference< XPropertySet > & xSet, const :: //------------------------------------------------------------------------- ::rtl::OUString SAL_CALL SbaTableQueryBrowser::getImplementationName() throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getImplementationName" ); return getImplementationName_Static(); } //------------------------------------------------------------------------- ::comphelper::StringSequence SAL_CALL SbaTableQueryBrowser::getSupportedServiceNames() throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getSupportedServiceNames" ); return getSupportedServiceNames_Static(); } // ------------------------------------------------------------------------- ::rtl::OUString SbaTableQueryBrowser::getImplementationName_Static() throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getImplementationName_Static" ); return ::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.ODatasourceBrowser"); } //------------------------------------------------------------------------- ::comphelper::StringSequence SbaTableQueryBrowser::getSupportedServiceNames_Static() throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getSupportedServiceNames_Static" ); ::comphelper::StringSequence aSupported(1); aSupported.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdb.DataSourceBrowser"); return aSupported; @@ -223,7 +221,6 @@ void SafeRemovePropertyListener(const Reference< XPropertySet > & xSet, const :: //------------------------------------------------------------------------- Reference< XInterface > SAL_CALL SbaTableQueryBrowser::Create(const Reference<XMultiServiceFactory >& _rxFactory) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::Create" ); ::vos::OGuard aGuard(Application::GetSolarMutex()); return *(new SbaTableQueryBrowser(_rxFactory)); } @@ -246,7 +243,6 @@ SbaTableQueryBrowser::SbaTableQueryBrowser(const Reference< XMultiServiceFactory ,m_bInSuspend(sal_False) ,m_bEnableBrowser(sal_True) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::SbaTableQueryBrowser" ); DBG_CTOR(SbaTableQueryBrowser,NULL); } @@ -266,7 +262,6 @@ SbaTableQueryBrowser::~SbaTableQueryBrowser() //------------------------------------------------------------------------------ Any SAL_CALL SbaTableQueryBrowser::queryInterface(const Type& _rType) throw (RuntimeException) { - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::queryInterface" ); if ( _rType.equals( XScriptInvocationContext::static_type() ) ) { OSL_PRECOND( !!m_aDocScriptSupport, "SbaTableQueryBrowser::queryInterface: did not initialize this, yet!" ); @@ -284,7 +279,6 @@ Any SAL_CALL SbaTableQueryBrowser::queryInterface(const Type& _rType) throw (Run //------------------------------------------------------------------------------ Sequence< Type > SAL_CALL SbaTableQueryBrowser::getTypes( ) throw (RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getTypes" ); Sequence< Type > aTypes( ::comphelper::concatSequences( SbaXDataBrowserController::getTypes(), SbaTableQueryBrowser_Base::getTypes() @@ -308,7 +302,6 @@ Sequence< Type > SAL_CALL SbaTableQueryBrowser::getTypes( ) throw (RuntimeExcep //------------------------------------------------------------------------------ Sequence< sal_Int8 > SAL_CALL SbaTableQueryBrowser::getImplementationId( ) throw (RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getImplementationId" ); static ::cppu::OImplementationId * pId = 0; if (! pId) { @@ -325,7 +318,6 @@ Sequence< sal_Int8 > SAL_CALL SbaTableQueryBrowser::getImplementationId( ) thro //------------------------------------------------------------------------------ void SAL_CALL SbaTableQueryBrowser::disposing() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::disposing" ); ::vos::OGuard aGuard(Application::GetSolarMutex()); // doin' a lot of VCL stuff here -> lock the SolarMutex @@ -350,9 +342,15 @@ void SAL_CALL SbaTableQueryBrowser::disposing() implRemoveStatusListeners(); // remove the container listener from the database context - Reference< XContainer > xDatasourceContainer(m_xDatabaseContext, UNO_QUERY); - if (xDatasourceContainer.is()) - xDatasourceContainer->removeContainerListener(this); + try + { + Reference< XDatabaseRegistrations > xDatabaseRegistrations( m_xDatabaseContext, UNO_QUERY_THROW ); + xDatabaseRegistrations->removeDatabaseRegistrationsListener( this ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } // check out from all the objects we are listening // the frame @@ -364,23 +362,17 @@ void SAL_CALL SbaTableQueryBrowser::disposing() //------------------------------------------------------------------------------ sal_Bool SbaTableQueryBrowser::Construct(Window* pParent) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::Construct" ); - if (!SbaXDataBrowserController::Construct(pParent)) + if ( !SbaXDataBrowserController::Construct( pParent ) ) return sal_False; try { - Reference< XContainer > xDatasourceContainer(m_xDatabaseContext, UNO_QUERY); - if (xDatasourceContainer.is()) - xDatasourceContainer->addContainerListener(this); - else { - DBG_ERROR("SbaTableQueryBrowser::Construct: the DatabaseContext should allow us to be a listener!"); - } + Reference< XDatabaseRegistrations > xDatabaseRegistrations( m_xDatabaseContext, UNO_QUERY_THROW ); + xDatabaseRegistrations->addDatabaseRegistrationsListener( this ); // the collator for the string compares - m_xCollator = Reference< XCollator >(getORB()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.i18n.Collator")), UNO_QUERY); - if (m_xCollator.is()) - m_xCollator->loadDefaultCollator(Application::GetSettings().GetLocale(), 0); + m_xCollator = Reference< XCollator >( getORB()->createInstance(::rtl::OUString::createFromAscii( "com.sun.star.i18n.Collator" ) ), UNO_QUERY_THROW ); + m_xCollator->loadDefaultCollator( Application::GetSettings().GetLocale(), 0 ); } catch(Exception&) { @@ -433,7 +425,6 @@ sal_Bool SbaTableQueryBrowser::Construct(Window* pParent) // ------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::InitializeForm(const Reference< ::com::sun::star::sdbc::XRowSet > & _rxForm) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::InitializeForm" ); if(!m_pCurrentlyDisplayed) return sal_True; @@ -490,7 +481,6 @@ sal_Bool SbaTableQueryBrowser::InitializeForm(const Reference< ::com::sun::star: //------------------------------------------------------------------------------ void SbaTableQueryBrowser::initializePreviewMode() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::initializePreviewMode" ); if ( getBrowserView() && getBrowserView()->getVclControl() ) { getBrowserView()->getVclControl()->AlwaysEnableInput( FALSE ); @@ -509,7 +499,6 @@ void SbaTableQueryBrowser::initializePreviewMode() //------------------------------------------------------------------------------ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun::star::form::XFormComponent > & xGrid) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::InitializeGridModel" ); try { Reference< ::com::sun::star::form::XGridColumnFactory > xColFactory(xGrid, UNO_QUERY); @@ -633,6 +622,7 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun:: break; case DataType::LONGVARCHAR: + case DataType::CLOB: aInitialValues.push_back( NamedValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiLine" ) ), makeAny( (sal_Bool)sal_True ) ) ); // NO break! case DataType::BINARY: @@ -750,7 +740,6 @@ Reference<XPropertySet> getColumnHelper(SvLBoxEntry* _pCurrentlyDisplayed,const // ----------------------------------------------------------------------- void SbaTableQueryBrowser::transferChangedControlProperty(const ::rtl::OUString& _rProperty, const Any& _rNewValue) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::transferChangedControlProperty" ); if(m_pCurrentlyDisplayed) { DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(m_pCurrentlyDisplayed->GetUserData()); @@ -764,7 +753,6 @@ void SbaTableQueryBrowser::transferChangedControlProperty(const ::rtl::OUString& // ----------------------------------------------------------------------- void SbaTableQueryBrowser::propertyChange(const PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::propertyChange" ); SbaXDataBrowserController::propertyChange(evt); try @@ -873,7 +861,6 @@ void SbaTableQueryBrowser::propertyChange(const PropertyChangeEvent& evt) throw( // ----------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::suspend(sal_Bool bSuspend) throw( RuntimeException ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::suspend" ); vos::OGuard aSolarGuard( Application::GetSolarMutex() ); ::osl::MutexGuard aGuard( getMutex() ); if ( getView() && getView()->IsInModalMode() ) @@ -898,7 +885,6 @@ sal_Bool SbaTableQueryBrowser::suspend(sal_Bool bSuspend) throw( RuntimeExceptio // ------------------------------------------------------------------------- void SAL_CALL SbaTableQueryBrowser::statusChanged( const FeatureStateEvent& _rEvent ) throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::statusChanged" ); // search the external dispatcher causing this call Reference< XDispatch > xSource(_rEvent.Source, UNO_QUERY); ExternalFeaturesMap::iterator aLoop; @@ -953,7 +939,6 @@ void SAL_CALL SbaTableQueryBrowser::statusChanged( const FeatureStateEvent& _rEv // ------------------------------------------------------------------------- void SbaTableQueryBrowser::checkDocumentDataSource() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::checkDocumentDataSource" ); SvLBoxEntry* pDataSourceEntry = NULL; SvLBoxEntry* pContainerEntry = NULL; SvLBoxEntry* pObjectEntry = getObjectEntry( m_aDocumentDataSource, &pDataSourceEntry, &pContainerEntry, sal_False ); @@ -991,7 +976,6 @@ void SbaTableQueryBrowser::checkDocumentDataSource() // ------------------------------------------------------------------------- void SbaTableQueryBrowser::extractDescriptorProps(const ::svx::ODataAccessDescriptor& _rDescriptor, ::rtl::OUString& _rDataSource, ::rtl::OUString& _rCommand, sal_Int32& _rCommandType, sal_Bool& _rEscapeProcessing) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::extractDescriptorProps" ); _rDataSource = _rDescriptor.getDataSource(); if ( _rDescriptor.has(daCommand) ) _rDescriptor[daCommand] >>= _rCommand; @@ -1043,7 +1027,6 @@ namespace // ------------------------------------------------------------------------- String SbaTableQueryBrowser::getDataSourceAcessor( SvLBoxEntry* _pDataSourceEntry ) const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getDataSourceAcessor" ); DBG_ASSERT( _pDataSourceEntry, "SbaTableQueryBrowser::getDataSourceAcessor: invalid entry!" ); DBTreeListUserData* pData = static_cast< DBTreeListUserData* >( _pDataSourceEntry->GetUserData() ); @@ -1057,7 +1040,6 @@ SvLBoxEntry* SbaTableQueryBrowser::getObjectEntry(const ::rtl::OUString& _rDataS SvLBoxEntry** _ppDataSourceEntry, SvLBoxEntry** _ppContainerEntry, sal_Bool _bExpandAncestors, const SharedConnection& _rxConnection ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getObjectEntry" ); if (_ppDataSourceEntry) *_ppDataSourceEntry = NULL; if (_ppContainerEntry) @@ -1080,9 +1062,7 @@ SvLBoxEntry* SbaTableQueryBrowser::getObjectEntry(const ::rtl::OUString& _rDataS { // special case, the data source is a URL // add new entries to the list box model - Image a, b, c; // not interested in reusing them - String e, f; - implAddDatasource( _rDataSource, a, e, b, f, c, _rxConnection ); + implAddDatasource( _rDataSource, _rxConnection ); pDataSource = m_pTreeView->getListBox().GetEntryPosByName( sDisplayName, NULL, &aFilter ); DBG_ASSERT( pDataSource, "SbaTableQueryBrowser::getObjectEntry: hmm - did not find it again!" ); } @@ -1132,7 +1112,6 @@ SvLBoxEntry* SbaTableQueryBrowser::getObjectEntry(const ::svx::ODataAccessDescri SvLBoxEntry** _ppDataSourceEntry, SvLBoxEntry** _ppContainerEntry, sal_Bool _bExpandAncestors) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getObjectEntry" ); // extract the props from the descriptor ::rtl::OUString sDataSource; ::rtl::OUString sCommand; @@ -1146,7 +1125,6 @@ SvLBoxEntry* SbaTableQueryBrowser::getObjectEntry(const ::svx::ODataAccessDescri // ------------------------------------------------------------------------- void SbaTableQueryBrowser::connectExternalDispatches() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::connectExternalDispatches" ); Reference< XDispatchProvider > xProvider( getFrame(), UNO_QUERY ); DBG_ASSERT(xProvider.is(), "SbaTableQueryBrowser::connectExternalDispatches: no DispatchProvider !"); if (xProvider.is()) @@ -1213,7 +1191,6 @@ void SbaTableQueryBrowser::connectExternalDispatches() // ------------------------------------------------------------------------- void SbaTableQueryBrowser::implCheckExternalSlot( sal_uInt16 _nId ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::implCheckExternalSlot" ); if ( !m_xMainToolbar.is() ) return; @@ -1236,7 +1213,6 @@ void SbaTableQueryBrowser::implCheckExternalSlot( sal_uInt16 _nId ) // ------------------------------------------------------------------------- void SAL_CALL SbaTableQueryBrowser::disposing( const EventObject& _rSource ) throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::disposing" ); // our frame ? Reference< ::com::sun::star::frame::XFrame > xSourceFrame(_rSource.Source, UNO_QUERY); if (m_xCurrentFrameParent.is() && (xSourceFrame == m_xCurrentFrameParent)) @@ -1299,7 +1275,6 @@ void SAL_CALL SbaTableQueryBrowser::disposing( const EventObject& _rSource ) thr // ------------------------------------------------------------------------- void SbaTableQueryBrowser::implRemoveStatusListeners() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::implRemoveStatusListeners" ); // clear all old dispatches for ( ExternalFeaturesMap::const_iterator aLoop = m_aExternalFeatures.begin(); aLoop != m_aExternalFeatures.end(); @@ -1324,7 +1299,6 @@ void SbaTableQueryBrowser::implRemoveStatusListeners() // ------------------------------------------------------------------------- sal_Bool SAL_CALL SbaTableQueryBrowser::select( const Any& _rSelection ) throw (IllegalArgumentException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::select" ); ::vos::OGuard aGuard(Application::GetSolarMutex()); // doin' a lot of VCL stuff here -> lock the SolarMutex @@ -1354,7 +1328,6 @@ sal_Bool SAL_CALL SbaTableQueryBrowser::select( const Any& _rSelection ) throw ( // ------------------------------------------------------------------------- Any SAL_CALL SbaTableQueryBrowser::getSelection( ) throw (RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getSelection" ); Any aReturn; try @@ -1382,21 +1355,18 @@ Any SAL_CALL SbaTableQueryBrowser::getSelection( ) throw (RuntimeException) // ------------------------------------------------------------------------- void SAL_CALL SbaTableQueryBrowser::addSelectionChangeListener( const Reference< XSelectionChangeListener >& _rxListener ) throw (RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::addSelectionChangeListener" ); m_aSelectionListeners.addInterface(_rxListener); } // ------------------------------------------------------------------------- void SAL_CALL SbaTableQueryBrowser::removeSelectionChangeListener( const Reference< XSelectionChangeListener >& _rxListener ) throw (RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::removeSelectionChangeListener" ); m_aSelectionListeners.removeInterface(_rxListener); } // ------------------------------------------------------------------------- void SbaTableQueryBrowser::attachFrame(const Reference< ::com::sun::star::frame::XFrame > & _xFrame) throw( RuntimeException ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::attachFrame" ); implRemoveStatusListeners(); if (m_xCurrentFrameParent.is()) @@ -1441,7 +1411,6 @@ void SbaTableQueryBrowser::attachFrame(const Reference< ::com::sun::star::frame: // ------------------------------------------------------------------------- void SbaTableQueryBrowser::addModelListeners(const Reference< ::com::sun::star::awt::XControlModel > & _xGridControlModel) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::addModelListeners" ); SbaXDataBrowserController::addModelListeners(_xGridControlModel); Reference< XPropertySet > xSourceSet(_xGridControlModel, UNO_QUERY); if (xSourceSet.is()) @@ -1459,7 +1428,6 @@ void SbaTableQueryBrowser::addModelListeners(const Reference< ::com::sun::star:: // ------------------------------------------------------------------------- void SbaTableQueryBrowser::removeModelListeners(const Reference< ::com::sun::star::awt::XControlModel > & _xGridControlModel) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::removeModelListeners" ); SbaXDataBrowserController::removeModelListeners(_xGridControlModel); Reference< XPropertySet > xSourceSet(_xGridControlModel, UNO_QUERY); if (xSourceSet.is()) @@ -1475,7 +1443,6 @@ void SbaTableQueryBrowser::removeModelListeners(const Reference< ::com::sun::sta // ------------------------------------------------------------------------- void SbaTableQueryBrowser::RowChanged() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::RowChanged" ); if(getBrowserView()) { SbaGridControl* pControl = getBrowserView()->getVclControl(); @@ -1488,7 +1455,6 @@ void SbaTableQueryBrowser::RowChanged() // ------------------------------------------------------------------------- void SbaTableQueryBrowser::ColumnChanged() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::ColumnChanged" ); if(getBrowserView()) { SbaGridControl* pControl = getBrowserView()->getVclControl(); @@ -1500,7 +1466,6 @@ void SbaTableQueryBrowser::ColumnChanged() //------------------------------------------------------------------------------ void SbaTableQueryBrowser::AddColumnListener(const Reference< XPropertySet > & xCol) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::AddColumnListener" ); SbaXDataBrowserController::AddColumnListener(xCol); SafeAddPropertyListener(xCol, PROPERTY_WIDTH, static_cast<XPropertyChangeListener*>(this)); SafeAddPropertyListener(xCol, PROPERTY_HIDDEN, static_cast<XPropertyChangeListener*>(this)); @@ -1511,7 +1476,6 @@ void SbaTableQueryBrowser::AddColumnListener(const Reference< XPropertySet > & x //------------------------------------------------------------------------------ void SbaTableQueryBrowser::RemoveColumnListener(const Reference< XPropertySet > & xCol) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::RemoveColumnListener" ); SbaXDataBrowserController::RemoveColumnListener(xCol); SafeRemovePropertyListener(xCol, PROPERTY_WIDTH, static_cast<XPropertyChangeListener*>(this)); SafeRemovePropertyListener(xCol, PROPERTY_HIDDEN, static_cast<XPropertyChangeListener*>(this)); @@ -1522,7 +1486,6 @@ void SbaTableQueryBrowser::RemoveColumnListener(const Reference< XPropertySet > //------------------------------------------------------------------------------ void SbaTableQueryBrowser::criticalFail() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::criticalFail" ); SbaXDataBrowserController::criticalFail(); unloadAndCleanup( sal_False ); } @@ -1530,7 +1493,6 @@ void SbaTableQueryBrowser::criticalFail() //------------------------------------------------------------------------------ void SbaTableQueryBrowser::LoadFinished(sal_Bool _bWasSynch) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::LoadFinished" ); SbaXDataBrowserController::LoadFinished(_bWasSynch); m_sQueryCommand = ::rtl::OUString(); @@ -1552,7 +1514,6 @@ void SbaTableQueryBrowser::LoadFinished(sal_Bool _bWasSynch) //------------------------------------------------------------------------------ sal_Bool SbaTableQueryBrowser::getExternalSlotState( sal_uInt16 _nId ) const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getExternalSlotState" ); sal_Bool bEnabled = sal_False; ExternalFeaturesMap::const_iterator aPos = m_aExternalFeatures.find( _nId ); if ( ( m_aExternalFeatures.end() != aPos ) && aPos->second.xDispatcher.is() ) @@ -1563,7 +1524,6 @@ sal_Bool SbaTableQueryBrowser::getExternalSlotState( sal_uInt16 _nId ) const //------------------------------------------------------------------------------ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::GetState" ); FeatureState aReturn; // (disabled automatically) @@ -1765,7 +1725,6 @@ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const //------------------------------------------------------------------------------ void SbaTableQueryBrowser::Execute(sal_uInt16 nId, const Sequence< PropertyValue >& aArgs) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::Execute" ); switch (nId) { default: @@ -1951,12 +1910,20 @@ void SbaTableQueryBrowser::Execute(sal_uInt16 nId, const Sequence< PropertyValue break; } } + +// ------------------------------------------------------------------------- +void SbaTableQueryBrowser::implAddDatasource( const String& _rDataSourceName, const SharedConnection& _rxConnection ) +{ + Image a, b, c; + String d, e; + implAddDatasource( _rDataSourceName, a, d, b, e, c, _rxConnection ); +} + // ------------------------------------------------------------------------- void SbaTableQueryBrowser::implAddDatasource(const String& _rDbName, Image& _rDbImage, String& _rQueryName, Image& _rQueryImage, String& _rTableName, Image& _rTableImage, const SharedConnection& _rxConnection) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::implAddDatasource" ); vos::OGuard aGuard( Application::GetSolarMutex() ); // initialize the names/images if necessary if (!_rQueryName.Len()) @@ -2010,7 +1977,6 @@ void SbaTableQueryBrowser::implAddDatasource(const String& _rDbName, Image& _rDb // ------------------------------------------------------------------------- void SbaTableQueryBrowser::initializeTreeModel() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::initializeTreeModel" ); if (m_xDatabaseContext.is()) { Image aDBImage, aQueriesImage, aTablesImage; @@ -2029,7 +1995,6 @@ sal_Bool SbaTableQueryBrowser::populateTree(const Reference<XNameAccess>& _xName SvLBoxEntry* _pParent, EntryType _eEntryType) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::populateTree" ); DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(_pParent->GetUserData()); if(pData) // don't ask if the nameaccess is already set see OnExpandEntry views and tables pData->xContainer = _xNameAccess; @@ -2060,7 +2025,6 @@ sal_Bool SbaTableQueryBrowser::populateTree(const Reference<XNameAccess>& _xName //------------------------------------------------------------------------------ void SbaTableQueryBrowser::implAppendEntry( SvLBoxEntry* _pParent, const String& _rName, void* _pUserData, EntryType _eEntryType ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::implAppendEntry" ); ::std::auto_ptr< ImageProvider > pImageProvider( getImageProviderFor( _pParent ) ); Image aImage, aImageHC; @@ -2077,7 +2041,6 @@ void SbaTableQueryBrowser::implAppendEntry( SvLBoxEntry* _pParent, const String& //------------------------------------------------------------------------------ IMPL_LINK(SbaTableQueryBrowser, OnExpandEntry, SvLBoxEntry*, _pParent) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::OnExpandEntry" ); if (_pParent->HasChilds()) // nothing to to ... return 1L; @@ -2180,7 +2143,6 @@ IMPL_LINK(SbaTableQueryBrowser, OnExpandEntry, SvLBoxEntry*, _pParent) //------------------------------------------------------------------------------ sal_Bool SbaTableQueryBrowser::ensureEntryObject( SvLBoxEntry* _pEntry ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::ensureEntryObject" ); DBG_ASSERT(_pEntry, "SbaTableQueryBrowser::ensureEntryObject: invalid argument!"); if (!_pEntry) return sal_False; @@ -2240,7 +2202,6 @@ sal_Bool SbaTableQueryBrowser::ensureEntryObject( SvLBoxEntry* _pEntry ) //------------------------------------------------------------------------------ sal_Bool SbaTableQueryBrowser::implSelect(const ::svx::ODataAccessDescriptor& _rDescriptor,sal_Bool _bSelectDirect) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::implSelect(_rDescriptor,_bSelectDirect)" ); // extract the props ::rtl::OUString sDataSource; ::rtl::OUString sCommand; @@ -2256,7 +2217,6 @@ sal_Bool SbaTableQueryBrowser::implSelect(const ::svx::ODataAccessDescriptor& _r sal_Bool SbaTableQueryBrowser::implLoadAnything(const ::rtl::OUString& _rDataSourceName, const ::rtl::OUString& _rCommand, const sal_Int32 _nCommandType, const sal_Bool _bEscapeProcessing, const SharedConnection& _rxConnection) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::implLoadAnything" ); Reference<XPropertySet> xProp(getRowSet(),UNO_QUERY); if(xProp.is()) { @@ -2274,8 +2234,6 @@ sal_Bool SbaTableQueryBrowser::implLoadAnything(const ::rtl::OUString& _rDataSou xProp->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, ::cppu::bool2any(_bEscapeProcessing)); if ( m_bPreview ) { - // this be undone by the grid control in DbGridControl::RecalcRows - // xProp->setPropertyValue(PROPERTY_FETCHSIZE, makeAny(sal_Int32(20))); xProp->setPropertyValue(PROPERTY_FETCHDIRECTION, makeAny(FetchDirection::FORWARD)); } @@ -2310,21 +2268,24 @@ sal_Bool SbaTableQueryBrowser::implLoadAnything(const ::rtl::OUString& _rDataSou InvalidateAll(); return bSuccess; } - catch(SQLException& e) + catch( const SQLException& e ) { - showError(SQLExceptionInfo(e)); + Any aException( ::cppu::getCaughtException() ); + showError( SQLExceptionInfo( aException ) ); } - catch(WrappedTargetException& e) + catch( const WrappedTargetException& e ) { SQLException aSql; - if(e.TargetException >>= aSql) - showError(SQLExceptionInfo(aSql)); + if ( e.TargetException.isExtractableTo( ::cppu::UnoType< SQLException >::get() ) ) + showError( SQLExceptionInfo( e.TargetException ) ); else - OSL_ENSURE(sal_False, "SbaTableQueryBrowser::implLoadAnything: something strange happended!"); + { + DBG_UNHANDLED_EXCEPTION(); + } } catch(Exception&) { - OSL_ENSURE(sal_False, "SbaTableQueryBrowser::implLoadAnything: something strange happended!"); + DBG_UNHANDLED_EXCEPTION(); } } @@ -2338,7 +2299,6 @@ sal_Bool SbaTableQueryBrowser::implSelect(const ::rtl::OUString& _rDataSourceNam const SharedConnection& _rxConnection ,sal_Bool _bSelectDirect) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::implSelect(_rDataSourceName,_rCommand,...)" ); if (_rDataSourceName.getLength() && _rCommand.getLength() && (-1 != _nCommandType)) { SvLBoxEntry* pDataSource = NULL; @@ -2387,7 +2347,6 @@ IMPL_LINK(SbaTableQueryBrowser, OnSelectionChange, void*, /*NOINTERESTEDIN*/) //------------------------------------------------------------------------------ bool SbaTableQueryBrowser::implSelect( SvLBoxEntry* _pEntry ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::implSelect(_pEntry)" ); if ( !_pEntry ) return false; @@ -2581,7 +2540,6 @@ bool SbaTableQueryBrowser::implSelect( SvLBoxEntry* _pEntry ) // ----------------------------------------------------------------------------- SvLBoxEntry* SbaTableQueryBrowser::getEntryFromContainer(const Reference<XNameAccess>& _rxNameAccess) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getEntryFromContainer" ); DBTreeListBox& rListBox = m_pTreeView->getListBox(); SvLBoxEntry* pContainer = NULL; SvLBoxEntry* pDSLoop = rListBox.FirstChild(NULL); @@ -2606,7 +2564,6 @@ SvLBoxEntry* SbaTableQueryBrowser::getEntryFromContainer(const Reference<XNameAc // ------------------------------------------------------------------------- void SAL_CALL SbaTableQueryBrowser::elementInserted( const ContainerEvent& _rEvent ) throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::elementInserted" ); vos::OGuard aSolarGuard( Application::GetSolarMutex() ); Reference< XNameAccess > xNames(_rEvent.Source, UNO_QUERY); @@ -2638,24 +2595,12 @@ void SAL_CALL SbaTableQueryBrowser::elementInserted( const ContainerEvent& _rEve } implAppendEntry( pEntry, ::comphelper::getString( _rEvent.Accessor ), pNewData, pNewData->eType ); } - else if (xNames.get() == m_xDatabaseContext.get()) - { // a new datasource has been added to the context - // the name of the new ds - ::rtl::OUString sNewDS; - _rEvent.Accessor >>= sNewDS; - - // add new entries to the list box model - Image a, b, c; // not interested in reusing them - String e, f; - implAddDatasource( sNewDS, a, e, b, f, c, SharedConnection() ); - } else SbaXDataBrowserController::elementInserted(_rEvent); } // ------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::isCurrentlyDisplayedChanged(const String& _sName,SvLBoxEntry* _pContainer) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::isCurrentlyDisplayedChanged" ); return m_pCurrentlyDisplayed && getEntryType(m_pCurrentlyDisplayed) == getChildType(_pContainer) && m_pTreeView->getListBox().GetParent(m_pCurrentlyDisplayed) == _pContainer @@ -2664,7 +2609,6 @@ sal_Bool SbaTableQueryBrowser::isCurrentlyDisplayedChanged(const String& _sName, // ------------------------------------------------------------------------- void SAL_CALL SbaTableQueryBrowser::elementRemoved( const ContainerEvent& _rEvent ) throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::elementRemoved" ); ::vos::OGuard aSolarGuard(Application::GetSolarMutex()); Reference< XNameAccess > xNames(_rEvent.Source, UNO_QUERY); @@ -2711,62 +2655,6 @@ void SAL_CALL SbaTableQueryBrowser::elementRemoved( const ContainerEvent& _rEven // maybe the object which is part of the document data source has been removed checkDocumentDataSource(); } - else if (xNames.get() == m_xDatabaseContext.get()) - { // a datasource has been removed from the context - - // the name - ::rtl::OUString sNewDS; - _rEvent.Accessor >>= sNewDS; - String sNewDatasource = sNewDS; - - // get the top-level representing the removed data source - SvLBoxEntry* pDSLoop = m_pTreeView->getListBox().FirstChild(NULL); - while (pDSLoop) - { - if (m_pTreeView->getListBox().GetEntryText(pDSLoop) == sNewDatasource) - break; - - pDSLoop = m_pTreeView->getListBox().NextSibling(pDSLoop); - } - - if (pDSLoop) - { - if (isSelected(pDSLoop)) - { // a table or query belonging to the deleted data source is currently beeing displayed. - OSL_ENSURE(m_pTreeView->getListBox().GetRootLevelParent(m_pCurrentlyDisplayed) == pDSLoop, "SbaTableQueryBrowser::elementRemoved: inconsistence (1)!"); - unloadAndCleanup( sal_True ); - } - else - OSL_ENSURE( - (NULL == m_pCurrentlyDisplayed) - || (m_pTreeView->getListBox().GetRootLevelParent(m_pCurrentlyDisplayed) != pDSLoop), "SbaTableQueryBrowser::elementRemoved: inconsistence (2)!"); - - // look for user data to delete - SvTreeEntryList* pList = m_pTreeModel->GetChildList(pDSLoop); - if(pList) - { - SvLBoxEntry* pEntryLoop = static_cast<SvLBoxEntry*>(pList->First()); - while (pEntryLoop) - { - DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(pEntryLoop->GetUserData()); - pEntryLoop->SetUserData(NULL); - delete pData; - pEntryLoop = static_cast<SvLBoxEntry*>(pList->Next()); - } - } - // remove the entry. This should remove all children, too. - DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(pDSLoop->GetUserData()); - pDSLoop->SetUserData(NULL); - delete pData; - m_pTreeModel->Remove(pDSLoop); - } - else { - DBG_ERROR("SbaTableQueryBrowser::elementRemoved: unknown datasource name!"); - } - - // maybe the object which is part of the document data source has been removed - checkDocumentDataSource(); - } else SbaXDataBrowserController::elementRemoved(_rEvent); } @@ -2774,7 +2662,6 @@ void SAL_CALL SbaTableQueryBrowser::elementRemoved( const ContainerEvent& _rEven // ------------------------------------------------------------------------- void SAL_CALL SbaTableQueryBrowser::elementReplaced( const ContainerEvent& _rEvent ) throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::elementReplaced" ); ::vos::OGuard aSolarGuard(Application::GetSolarMutex()); Reference< XNameAccess > xNames(_rEvent.Source, UNO_QUERY); @@ -2847,7 +2734,6 @@ void SAL_CALL SbaTableQueryBrowser::elementReplaced( const ContainerEvent& _rEve // ------------------------------------------------------------------------- void SbaTableQueryBrowser::impl_releaseConnection( SharedConnection& _rxConnection ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::impl_releaseConnection" ); // remove as event listener Reference< XComponent > xComponent( _rxConnection, UNO_QUERY ); if ( xComponent.is() ) @@ -2876,7 +2762,6 @@ void SbaTableQueryBrowser::impl_releaseConnection( SharedConnection& _rxConnecti // ------------------------------------------------------------------------- void SbaTableQueryBrowser::disposeConnection( SvLBoxEntry* _pDSEntry ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::disposeConnection" ); DBG_ASSERT( _pDSEntry, "SbaTableQueryBrowser::disposeConnection: invalid entry (NULL)!" ); DBG_ASSERT( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::disposeConnection: invalid entry (not top-level)!" ); @@ -2891,7 +2776,6 @@ void SbaTableQueryBrowser::disposeConnection( SvLBoxEntry* _pDSEntry ) // ------------------------------------------------------------------------- void SbaTableQueryBrowser::closeConnection(SvLBoxEntry* _pDSEntry,sal_Bool _bDisposeConnection) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::closeConnection" ); DBG_ASSERT(_pDSEntry, "SbaTableQueryBrowser::closeConnection: invalid entry (NULL)!"); DBG_ASSERT( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::closeConnection: invalid entry (not top-level)!"); @@ -2928,7 +2812,6 @@ void SbaTableQueryBrowser::closeConnection(SvLBoxEntry* _pDSEntry,sal_Bool _bDis // ------------------------------------------------------------------------- void SbaTableQueryBrowser::unloadAndCleanup( sal_Bool _bDisposeConnection ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::unloadAndCleanup" ); if (!m_pCurrentlyDisplayed) // nothing to do return; @@ -3016,7 +2899,6 @@ namespace // ------------------------------------------------------------------------- void SbaTableQueryBrowser::impl_initialize() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::impl_initialize" ); ::vos::OGuard aGuard(Application::GetSolarMutex()); // doin' a lot of VCL stuff here -> lock the SolarMutex @@ -3150,12 +3032,7 @@ void SbaTableQueryBrowser::impl_initialize() } } - Image aDBImage, aQueriesImage, aTablesImage; - String sQueriesName, sTablesName; - - implAddDatasource( sInitialDataSourceName, - aDBImage, sQueriesName, aQueriesImage, sTablesName, aTablesImage, xConnection - ); + implAddDatasource( sInitialDataSourceName, xConnection ); m_pTreeView->getListBox().Expand( m_pTreeView->getListBox().First() ); } else @@ -3196,14 +3073,12 @@ void SbaTableQueryBrowser::impl_initialize() // ------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::haveExplorer() const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::haveExplorer" ); return m_pTreeView && m_pTreeView->IsVisible(); } // ------------------------------------------------------------------------- void SbaTableQueryBrowser::hideExplorer() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::hideExplorer" ); if (!haveExplorer()) return; if (!getBrowserView()) @@ -3219,7 +3094,6 @@ void SbaTableQueryBrowser::hideExplorer() // ------------------------------------------------------------------------- void SbaTableQueryBrowser::showExplorer() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::showExplorer" ); if (haveExplorer()) return; @@ -3236,7 +3110,6 @@ void SbaTableQueryBrowser::showExplorer() // ----------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::ensureConnection(SvLBoxEntry* _pAnyEntry, SharedConnection& _rConnection) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::ensureConnection" ); SvLBoxEntry* pDSEntry = m_pTreeView->getListBox().GetRootLevelParent(_pAnyEntry); DBTreeListUserData* pDSData = pDSEntry @@ -3249,7 +3122,6 @@ sal_Bool SbaTableQueryBrowser::ensureConnection(SvLBoxEntry* _pAnyEntry, SharedC // ----------------------------------------------------------------------------- ::std::auto_ptr< ImageProvider > SbaTableQueryBrowser::getImageProviderFor( SvLBoxEntry* _pAnyEntry ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getImageProviderFor" ); ::std::auto_ptr< ImageProvider > pImageProvider( new ImageProvider ); SharedConnection xConnection; if ( getExistentConnectionFor( _pAnyEntry, xConnection ) ) @@ -3260,7 +3132,6 @@ sal_Bool SbaTableQueryBrowser::ensureConnection(SvLBoxEntry* _pAnyEntry, SharedC // ----------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::getExistentConnectionFor( SvLBoxEntry* _pAnyEntry, SharedConnection& _rConnection ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getExistentConnectionFor" ); SvLBoxEntry* pDSEntry = m_pTreeView->getListBox().GetRootLevelParent( _pAnyEntry ); DBTreeListUserData* pDSData = pDSEntry @@ -3275,7 +3146,6 @@ sal_Bool SbaTableQueryBrowser::getExistentConnectionFor( SvLBoxEntry* _pAnyEntry // ----------------------------------------------------------------------------- bool SbaTableQueryBrowser::impl_isDataSourceEntry( SvLBoxEntry* _pEntry ) const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::impl_isDataSourceEntry" ); return m_pTreeModel->GetRootLevelParent( _pEntry ) == _pEntry; } #endif @@ -3283,7 +3153,6 @@ bool SbaTableQueryBrowser::impl_isDataSourceEntry( SvLBoxEntry* _pEntry ) const // ----------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::ensureConnection( SvLBoxEntry* _pDSEntry, void* pDSData, SharedConnection& _rConnection ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::ensureConnection" ); DBG_ASSERT( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::ensureConnection: this entry does not denote a data source!" ); if(_pDSEntry) { @@ -3386,7 +3255,6 @@ IMPL_LINK( SbaTableQueryBrowser, OnTreeEntryCompare, const SvSortData*, _pSortDa // ----------------------------------------------------------------------------- void SbaTableQueryBrowser::implAdministrate( SvLBoxEntry* _pApplyTo ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::implAdministrate" ); OSL_PRECOND( _pApplyTo, "SbaTableQueryBrowser::implAdministrate: illegal entry!" ); if ( !_pApplyTo ) return; @@ -3444,7 +3312,6 @@ void SbaTableQueryBrowser::implAdministrate( SvLBoxEntry* _pApplyTo ) // ----------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::requestQuickHelp( const SvLBoxEntry* _pEntry, String& _rText ) const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::requestQuickHelp" ); const DBTreeListUserData* pData = static_cast< const DBTreeListUserData* >( _pEntry->GetUserData() ); if ( ( pData->eType == etDatasource ) && pData->sAccessor.Len() ) { @@ -3457,7 +3324,6 @@ sal_Bool SbaTableQueryBrowser::requestQuickHelp( const SvLBoxEntry* _pEntry, Str // ----------------------------------------------------------------------------- PopupMenu* SbaTableQueryBrowser::getContextMenu( Control& _rControl ) const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getContextMenu" ); OSL_PRECOND( &m_pTreeView->getListBox() == &_rControl, "SbaTableQueryBrowser::getContextMenu: where does this come from?" ); if ( &m_pTreeView->getListBox() != &_rControl ) @@ -3469,21 +3335,18 @@ PopupMenu* SbaTableQueryBrowser::getContextMenu( Control& _rControl ) const // ----------------------------------------------------------------------------- IController& SbaTableQueryBrowser::getCommandController() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getCommandController" ); return *this; } // ----------------------------------------------------------------------------- ::cppu::OInterfaceContainerHelper* SbaTableQueryBrowser::getContextMenuInterceptors() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getContextMenuInterceptors" ); return &m_aContextMenuInterceptors; } // ----------------------------------------------------------------------------- Any SbaTableQueryBrowser::getCurrentSelection( Control& _rControl ) const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getCurrentSelection" ); OSL_PRECOND( &m_pTreeView->getListBox() == &_rControl, "SbaTableQueryBrowser::getCurrentSelection: where does this come from?" ); @@ -3525,7 +3388,6 @@ Any SbaTableQueryBrowser::getCurrentSelection( Control& _rControl ) const // ----------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::implGetQuerySignature( ::rtl::OUString& _rCommand, sal_Bool& _bEscapeProcessing ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::implGetQuerySignature" ); _rCommand = ::rtl::OUString(); _bEscapeProcessing = sal_False; @@ -3574,7 +3436,6 @@ sal_Bool SbaTableQueryBrowser::implGetQuerySignature( ::rtl::OUString& _rCommand //------------------------------------------------------------------------------ void SbaTableQueryBrowser::frameAction(const ::com::sun::star::frame::FrameActionEvent& aEvent) throw( RuntimeException ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::frameAction" ); if (aEvent.Frame == m_xCurrentFrameParent) { if(aEvent.Action == FrameAction_COMPONENT_DETACHING) @@ -3589,7 +3450,6 @@ void SbaTableQueryBrowser::frameAction(const ::com::sun::star::frame::FrameActio // ----------------------------------------------------------------------------- void SbaTableQueryBrowser::clearGridColumns(const Reference< XNameContainer >& _xColContainer) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::clearGridColumns" ); // first we have to clear the grid Sequence< ::rtl::OUString > aNames = _xColContainer->getElementNames(); const ::rtl::OUString* pIter = aNames.getConstArray(); @@ -3605,7 +3465,6 @@ void SbaTableQueryBrowser::clearGridColumns(const Reference< XNameContainer >& _ // ----------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::isHiContrast() const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::isHiContrast" ); sal_Bool bRet = sal_False; if ( m_pTreeView ) bRet = m_pTreeView->getListBox().GetSettings().GetStyleSettings().GetHighContrastMode(); @@ -3614,7 +3473,6 @@ sal_Bool SbaTableQueryBrowser::isHiContrast() const // ----------------------------------------------------------------------------- void SbaTableQueryBrowser::loadMenu(const Reference< XFrame >& _xFrame) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::loadMenu" ); if ( m_bShowMenu ) { OGenericUnoController::loadMenu(_xFrame); @@ -3636,7 +3494,6 @@ void SbaTableQueryBrowser::loadMenu(const Reference< XFrame >& _xFrame) // ----------------------------------------------------------------------------- ::rtl::OUString SbaTableQueryBrowser::getPrivateTitle() const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getPrivateTitle" ); ::rtl::OUString sTitle; if ( m_pCurrentlyDisplayed ) { @@ -3661,7 +3518,6 @@ void SbaTableQueryBrowser::loadMenu(const Reference< XFrame >& _xFrame) // ----------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::preReloadForm() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::preReloadForm" ); sal_Bool bIni = sal_False; if ( !m_pCurrentlyDisplayed ) { @@ -3690,7 +3546,6 @@ sal_Bool SbaTableQueryBrowser::preReloadForm() // ----------------------------------------------------------------------------- void SbaTableQueryBrowser::postReloadForm() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::postReloadForm" ); InitializeGridModel(getFormComponent()); LoadFinished(sal_True); //updateTitle(); @@ -3699,7 +3554,6 @@ void SbaTableQueryBrowser::postReloadForm() //------------------------------------------------------------------------------ Reference< XEmbeddedScripts > SAL_CALL SbaTableQueryBrowser::getScriptContainer() throw (RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getScriptContainer" ); // update our database document Reference< XModel > xDocument; try @@ -3726,7 +3580,6 @@ Reference< XEmbeddedScripts > SAL_CALL SbaTableQueryBrowser::getScriptContainer( //------------------------------------------------------------------------------ void SAL_CALL SbaTableQueryBrowser::registerContextMenuInterceptor( const Reference< XContextMenuInterceptor >& _Interceptor ) throw (RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::registerContextMenuInterceptor" ); if ( _Interceptor.is() ) m_aContextMenuInterceptors.addInterface( _Interceptor ); } @@ -3734,10 +3587,90 @@ void SAL_CALL SbaTableQueryBrowser::registerContextMenuInterceptor( const Refere //------------------------------------------------------------------------------ void SAL_CALL SbaTableQueryBrowser::releaseContextMenuInterceptor( const Reference< XContextMenuInterceptor >& _Interceptor ) throw (RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::releaseContextMenuInterceptor" ); - m_aContextMenuInterceptors.removeInterface( _Interceptor ); + if ( _Interceptor.is() ) + m_aContextMenuInterceptors.removeInterface( _Interceptor ); +} + +//------------------------------------------------------------------------------ +void SAL_CALL SbaTableQueryBrowser::registeredDatabaseLocation( const DatabaseRegistrationEvent& _Event ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( Application::GetSolarMutex() ); + implAddDatasource( _Event.Name, SharedConnection() ); } +//------------------------------------------------------------------------------ +void SbaTableQueryBrowser::impl_cleanupDataSourceEntry( const String& _rDataSourceName ) +{ + // get the top-level representing the removed data source + SvLBoxEntry* pDataSourceEntry = m_pTreeView->getListBox().FirstChild( NULL ); + while ( pDataSourceEntry ) + { + if ( m_pTreeView->getListBox().GetEntryText( pDataSourceEntry ) == _rDataSourceName ) + break; + + pDataSourceEntry = m_pTreeView->getListBox().NextSibling( pDataSourceEntry ); + } + + OSL_ENSURE( pDataSourceEntry, "SbaTableQueryBrowser::impl_cleanupDataSourceEntry: do not know this data source!" ); + if ( !pDataSourceEntry ) + return; + + if ( isSelected( pDataSourceEntry ) ) + { // a table or query belonging to the deleted data source is currently beeing displayed. + OSL_ENSURE( m_pTreeView->getListBox().GetRootLevelParent( m_pCurrentlyDisplayed ) == pDataSourceEntry, + "SbaTableQueryBrowser::impl_cleanupDataSourceEntry: inconsistence (1)!" ); + unloadAndCleanup( sal_True ); + } + else + OSL_ENSURE( + ( NULL == m_pCurrentlyDisplayed ) + || ( m_pTreeView->getListBox().GetRootLevelParent( m_pCurrentlyDisplayed ) != pDataSourceEntry ), + "SbaTableQueryBrowser::impl_cleanupDataSourceEntry: inconsistence (2)!"); + + // delete any user data of the child entries of the to-be-removed entry + SvTreeEntryList* pList = m_pTreeModel->GetChildList( pDataSourceEntry ); + if ( pList ) + { + SvLBoxEntry* pEntryLoop = static_cast<SvLBoxEntry*>( pList->First() ); + while ( pEntryLoop ) + { + DBTreeListUserData* pData = static_cast< DBTreeListUserData* >( pEntryLoop->GetUserData() ); + pEntryLoop->SetUserData( NULL ); + delete pData; + pEntryLoop = static_cast< SvLBoxEntry* >( pList->Next() ); + } + } + + // remove the entry + DBTreeListUserData* pData = static_cast< DBTreeListUserData* >( pDataSourceEntry->GetUserData() ); + pDataSourceEntry->SetUserData( NULL ); + delete pData; + m_pTreeModel->Remove( pDataSourceEntry ); +} + +//------------------------------------------------------------------------------ +void SAL_CALL SbaTableQueryBrowser::revokedDatabaseLocation( const DatabaseRegistrationEvent& _Event ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( Application::GetSolarMutex() ); + + impl_cleanupDataSourceEntry( _Event.Name ); + + // maybe the object which is part of the document data source has been removed + checkDocumentDataSource(); +} + +//------------------------------------------------------------------------------ +void SAL_CALL SbaTableQueryBrowser::changedDatabaseLocation( const DatabaseRegistrationEvent& _Event ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( Application::GetSolarMutex() ); + + // in case the data source was expanded, and connected, we need to clean it up + // for simplicity, just do as if the data source were completely removed and re-added + impl_cleanupDataSourceEntry( _Event.Name ); + implAddDatasource( _Event.Name, SharedConnection() ); +} + + // ......................................................................... } // namespace dbaui // ......................................................................... |