diff options
Diffstat (limited to 'dbaccess/source/ui')
34 files changed, 94 insertions, 109 deletions
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index aaa71c380db0..72520aa7e42f 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -66,7 +66,7 @@ #include <svl/urihelper.hxx> #include <svl/filenotation.hxx> -#include <svtools/svtreebx.hxx> +#include <svtools/treelistbox.hxx> #include <svtools/transfer.hxx> #include <svtools/cliplistener.hxx> #include <svtools/svlbitm.hxx> diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx index 0225c000af04..6ed5db02d53f 100644 --- a/dbaccess/source/ui/app/AppControllerDnD.cxx +++ b/dbaccess/source/ui/app/AppControllerDnD.cxx @@ -69,7 +69,7 @@ #include "dbexchange.hxx" #include "UITools.hxx" #include <algorithm> -#include <svtools/svtreebx.hxx> +#include <svtools/treelistbox.hxx> #include <com/sun/star/sdb/XReportDocumentsSupplier.hpp> #include <com/sun/star/sdb/XFormDocumentsSupplier.hpp> #include <unotools/pathoptions.hxx> diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.hxx b/dbaccess/source/ui/app/AppDetailPageHelper.hxx index 00a2725bb8d1..8b34d8c4a6ff 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.hxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.hxx @@ -26,7 +26,7 @@ #include <com/sun/star/sdb/application/NamedDatabaseObject.hpp> #include <com/sun/star/ucb/XContent.hpp> #include "AppElementType.hxx" -#include <svtools/svtreebx.hxx> +#include <svtools/treelistbox.hxx> #include <svtools/DocumentInfoPreview.hxx> #include <vcl/fixed.hxx> #include <vcl/toolbox.hxx> diff --git a/dbaccess/source/ui/app/AppDetailView.hxx b/dbaccess/source/ui/app/AppDetailView.hxx index 497c050281b0..220b31f10f2a 100644 --- a/dbaccess/source/ui/app/AppDetailView.hxx +++ b/dbaccess/source/ui/app/AppDetailView.hxx @@ -30,7 +30,7 @@ #include "IClipBoardTest.hxx" #include "AppTitleWindow.hxx" #include "AppElementType.hxx" -#include <svtools/svtreebx.hxx> +#include <svtools/treelistbox.hxx> #include "VertSplitView.hxx" #include <vector> diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index c918fa04a3b8..460b09354860 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -57,7 +57,7 @@ #include <com/sun/star/sdbc/XWarningsSupplier.hpp> #include <com/sun/star/sdbcx/Privilege.hpp> #include <com/sun/star/sdbcx/XRowLocate.hpp> -#include <com/sun/star/task/XInteractionHandler.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/uno/TypeClass.hpp> #include <com/sun/star/util/NumberFormatter.hpp> #include <com/sun/star/util/XCancellable.hpp> @@ -1471,9 +1471,8 @@ sal_Bool SbaXDataBrowserController::approveParameter(const ::com::sun::star::for pParamRequest->addContinuation(pAbort); // create the handler, let it handle the request - Reference< XInteractionHandler > xHandler(getORB()->createInstance(SERVICE_TASK_INTERACTION_HANDLER), UNO_QUERY); - if (xHandler.is()) - xHandler->handle(xParamRequest); + Reference< XInteractionHandler2 > xHandler( InteractionHandler::createWithParent(comphelper::getComponentContext(getORB()), 0) ); + xHandler->handle(xParamRequest); if (!pParamValues->wasSelected()) { // canceled diff --git a/dbaccess/source/ui/browser/dbtreemodel.hxx b/dbaccess/source/ui/browser/dbtreemodel.hxx index 5da08ba7f0eb..b939ac31e8ef 100644 --- a/dbaccess/source/ui/browser/dbtreemodel.hxx +++ b/dbaccess/source/ui/browser/dbtreemodel.hxx @@ -21,8 +21,6 @@ #define DBAUI_DBTREEMODEL_HXX #include <com/sun/star/container/XNameAccess.hpp> -#include <svtools/svlbox.hxx> -#include <svtools/svlbitm.hxx> #include "unodatbr.hxx" #include "commontypes.hxx" diff --git a/dbaccess/source/ui/browser/dbtreeview.cxx b/dbaccess/source/ui/browser/dbtreeview.cxx index b557766fe3d3..6f26f6c063f3 100644 --- a/dbaccess/source/ui/browser/dbtreeview.cxx +++ b/dbaccess/source/ui/browser/dbtreeview.cxx @@ -19,7 +19,7 @@ #include "dbtreeview.hxx" -#include <svtools/svtreebx.hxx> +#include <svtools/treelistbox.hxx> #include "dbtreelistbox.hxx" #include "dbtreemodel.hxx" #include "dbaccess_helpid.hrc" diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index a77df938f369..3a8ac73c81bb 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -69,7 +69,6 @@ #include <connectivity/dbtools.hxx> #include <connectivity/dbconversion.hxx> #include <cppuhelper/typeprovider.hxx> -#include <rtl/memory.h> #include <comphelper/extract.hxx> #include <comphelper/servicehelper.hxx> #include <com/sun/star/sdbcx/XTablesSupplier.hpp> @@ -588,7 +587,7 @@ Sequence< Type > SAL_CALL SbaXGridPeer::getTypes() throw (RuntimeException) //------------------------------------------------------------------ sal_Int64 SAL_CALL SbaXGridPeer::getSomething( const Sequence< sal_Int8 > & rId ) throw(::com::sun::star::uno::RuntimeException) { - if( rId.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) + if( rId.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) return reinterpret_cast< sal_Int64 >( this ); return FmXGridPeer::getSomething(rId); diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 2b47defe48ad..5e0b0075e98f 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -84,12 +84,14 @@ #include <com/sun/star/sdbcx/XDrop.hpp> #include <com/sun/star/sdbcx/XTablesSupplier.hpp> #include <com/sun/star/sdbcx/XViewsSupplier.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/util/XFlushable.hpp> #include <com/sun/star/document/MacroExecMode.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> #include <com/sun/star/ui/XContextMenuInterceptor.hpp> +#include <comphelper/processfactory.hxx> #include <comphelper/extract.hxx> #include <comphelper/sequence.hxx> #include <comphelper/types.hxx> @@ -104,7 +106,7 @@ #include <svl/intitem.hxx> #include <unotools/moduleoptions.hxx> #include <svtools/svlbitm.hxx> -#include <svtools/svtreebx.hxx> +#include <svtools/treelistbox.hxx> #include <svx/algitem.hxx> #include <svx/dataaccessdescriptor.hxx> #include <svx/databaseregistrationui.hxx> @@ -3528,11 +3530,8 @@ void SbaTableQueryBrowser::implAdministrate( SvLBoxEntry* _pApplyTo ) if ( xDocumentModel.is() ) { - Reference< XInteractionHandler > xInteractionHandler( - getORB()->createInstance( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.InteractionHandler" ) ) ), - UNO_QUERY ); - OSL_ENSURE( xInteractionHandler.is(), "SbaTableQueryBrowser::implAdministrate: no interaction handler available!" ); + Reference< XInteractionHandler2 > xInteractionHandler( + InteractionHandler::createWithParent(comphelper::getComponentContext(getORB()), 0) ); ::comphelper::NamedValueCollection aLoadArgs; aLoadArgs.put( "Model", xDocumentModel ); diff --git a/dbaccess/source/ui/control/listviewitems.cxx b/dbaccess/source/ui/control/listviewitems.cxx index 0e884a82f0a1..aaf208db812c 100644 --- a/dbaccess/source/ui/control/listviewitems.cxx +++ b/dbaccess/source/ui/control/listviewitems.cxx @@ -28,7 +28,7 @@ namespace dbaui // class OBoldListboxString //======================================================================== //------------------------------------------------------------------------ - void OBoldListboxString::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* _pViewData) + void OBoldListboxString::InitViewData( SvTreeListBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* _pViewData) { SvLBoxString::InitViewData( pView, pEntry, _pViewData ); if ( !m_bEmphasized ) @@ -38,7 +38,7 @@ namespace dbaui pView->Push(PUSH_ALL); Font aFont( pView->GetFont()); aFont.SetWeight(WEIGHT_BOLD); - pView->SetFont( aFont ); + pView->Control::SetFont( aFont ); _pViewData->aSize = Size(pView->GetTextWidth(GetText()), pView->GetTextHeight()); pView->Pop(); } @@ -50,7 +50,7 @@ namespace dbaui } //------------------------------------------------------------------------ - void OBoldListboxString::Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry ) + void OBoldListboxString::Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry ) { if (m_bEmphasized) { diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx index 5dd965614e77..7123db850014 100644 --- a/dbaccess/source/ui/dlg/CollectionView.cxx +++ b/dbaccess/source/ui/dlg/CollectionView.cxx @@ -23,12 +23,12 @@ #include <tools/diagnose_ex.h> #include "moduledbu.hxx" #include "dbu_dlg.hrc" +#include <comphelper/processfactory.hxx> #include <comphelper/interaction.hxx> #include <cppuhelper/exc_hlp.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <svtools/QueryFolderName.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/container/XChild.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -38,7 +38,7 @@ #include <com/sun/star/container/XHierarchicalNameContainer.hpp> #include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp> #include <com/sun/star/ucb/IOErrorCode.hpp> -#include <com/sun/star/task/XInteractionHandler.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/task/InteractionClassification.hpp> #include <com/sun/star/sdbc/SQLException.hpp> #include <com/sun/star/awt/XWindow.hpp> @@ -169,23 +169,15 @@ IMPL_LINK_NOARG(OCollectionView, Save_Click) InteractiveAugmentedIOException aException(sTemp,Reference<XInterface>(),eClass,eError,aValues); - Reference<XInitialization> xIni(m_xORB->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.InteractionHandler"))),UNO_QUERY); - if ( xIni.is() ) - { - aValue.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Parent")); - aValue.Value <<= VCLUnoHelper::GetInterface( this ); - Sequence< Any > aArgs(1); - aArgs[0] <<= makeAny(aValue); - xIni->initialize(aArgs); - OInteractionRequest* pRequest = new OInteractionRequest(makeAny(aException)); - Reference< XInteractionRequest > xRequest(pRequest); + Reference<XInteractionHandler2> xHandler( + InteractionHandler::createWithParent(comphelper::getComponentContext(m_xORB), VCLUnoHelper::GetInterface( this ))); + OInteractionRequest* pRequest = new OInteractionRequest(makeAny(aException)); + Reference< XInteractionRequest > xRequest(pRequest); - OInteractionApprove* pApprove = new OInteractionApprove; - pRequest->addContinuation(pApprove); + OInteractionApprove* pApprove = new OInteractionApprove; + pRequest->addContinuation(pApprove); + xHandler->handle(xRequest); - Reference< XInteractionHandler > xHandler(xIni,UNO_QUERY); - xHandler->handle(xRequest); - } return 0; } } diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index 26b32f24a33a..ac7e55f21a55 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -49,7 +49,7 @@ #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <com/sun/star/sdbc/XRow.hpp> #include <com/sun/star/awt/XWindow.hpp> -#include <com/sun/star/task/XInteractionHandler.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/ucb/XProgressHandler.hpp> #include "UITools.hxx" #include <unotools/localfilehelper.hxx> @@ -71,6 +71,7 @@ #endif //_ADO_DATALINK_BROWSE_ #include <com/sun/star/mozilla/XMozillaBootstrap.hpp> +#include <comphelper/componentcontext.hxx> #include <comphelper/processfactory.hxx> @@ -522,8 +523,8 @@ DBG_NAME(OConnectionHelper) ::ucbhelper::Content aCheckExistence; sal_Bool bExists = sal_False; IS_PATH_EXIST eExists = PATH_NOT_EXIST; - Reference< ::com::sun::star::task::XInteractionHandler > xInteractionHandler = Reference< ::com::sun::star::task::XInteractionHandler >( - m_xORB->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.InteractionHandler") ) ), UNO_QUERY ); + Reference< ::com::sun::star::task::XInteractionHandler > xInteractionHandler( + task::InteractionHandler::createWithParent(comphelper::getComponentContext(m_xORB), 0), UNO_QUERY ); OFilePickerInteractionHandler* pHandler = new OFilePickerInteractionHandler(xInteractionHandler); xInteractionHandler = pHandler; diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index 2150c6b283a3..9082417c97ca 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -45,7 +45,7 @@ #include <com/sun/star/sdb/SQLContext.hpp> #include <com/sun/star/sdbc/XDriver.hpp> #include <com/sun/star/sdbc/XDriverAccess.hpp> -#include <com/sun/star/task/XInteractionHandler.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/task/XInteractionRequest.hpp> #include <com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp> #include <com/sun/star/ucb/AuthenticationRequest.hpp> @@ -255,9 +255,7 @@ sal_Bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< Propert if ( !xHandler.is() ) { // instantiate the default SDB interaction handler - xHandler = Reference< XInteractionHandler >( m_xORB->createInstance( SERVICE_TASK_INTERACTION_HANDLER ), UNO_QUERY ); - if ( !xHandler.is() ) - ShowServiceNotAvailableError(m_pParent->GetParent(), String(SERVICE_TASK_INTERACTION_HANDLER), sal_True); + xHandler = Reference< XInteractionHandler >( task::InteractionHandler::createWithParent(comphelper::getComponentContext(m_xORB), 0), UNO_QUERY ); } String sName = pName ? pName->GetValue() : String(); diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index 9f05b4e298d9..1f34d54c47df 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -70,6 +70,7 @@ #include <com/sun/star/sdbc/XDriverAccess.hpp> #include <com/sun/star/document/MacroExecMode.hpp> #include <com/sun/star/ucb/IOErrorCode.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/task/XInteractionHandler2.hpp> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> @@ -734,7 +735,7 @@ namespace //------------------------------------------------------------------------- sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() { - Reference< XInteractionHandler2 > xHandler( getORB()->createInstance( SERVICE_TASK_INTERACTION_HANDLER ), UNO_QUERY ); + Reference< XInteractionHandler2 > xHandler( InteractionHandler::createWithParent(comphelper::getComponentContext(getORB()), 0) ); try { if (callSaveAsDialog() == sal_True) @@ -964,7 +965,7 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() private: Reference< XComponentLoader > m_xFrameLoader; Reference< XDesktop > m_xDesktop; - Reference< XInteractionHandler > m_xInteractionHandler; + Reference< XInteractionHandler2 > m_xInteractionHandler; ::rtl::OUString m_sURL; OAsyncronousLink m_aAsyncCaller; @@ -992,11 +993,8 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() { m_xDesktop.set( _rxORB->createInstance( SERVICE_FRAME_DESKTOP ), UNO_QUERY_THROW ); m_xFrameLoader.set( m_xDesktop, UNO_QUERY_THROW ); - m_xInteractionHandler.set( - _rxORB->createInstance( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.InteractionHandler" ) ) - ), - UNO_QUERY_THROW ); + m_xInteractionHandler = + InteractionHandler::createWithParent(comphelper::getComponentContext(_rxORB), 0); } catch( const Exception& ) { diff --git a/dbaccess/source/ui/dlg/odbcconfig.cxx b/dbaccess/source/ui/dlg/odbcconfig.cxx index 5adbbf36b4af..c6047a15639d 100644 --- a/dbaccess/source/ui/dlg/odbcconfig.cxx +++ b/dbaccess/source/ui/dlg/odbcconfig.cxx @@ -133,6 +133,8 @@ sal_Bool OOdbcLibWrapper::load(const sal_Char* _pLibPath) // load the module m_pOdbcLib = osl_loadModule(m_sLibPath.pData, SAL_LOADMODULE_NOW); return (NULL != m_pOdbcLib); +#else + return sal_False; #endif } @@ -289,6 +291,8 @@ void OOdbcEnumeration::getDatasourceNames(StringBag& _rNames) _rNames.insert(aCurrentDsn); } } +#else + (void) _rNames; #endif } diff --git a/dbaccess/source/ui/dlg/odbcconfig.hxx b/dbaccess/source/ui/dlg/odbcconfig.hxx index d24b57afd6ab..7ecadd29c9e9 100644 --- a/dbaccess/source/ui/dlg/odbcconfig.hxx +++ b/dbaccess/source/ui/dlg/odbcconfig.hxx @@ -22,7 +22,7 @@ #include "commontypes.hxx" -#if defined(WNT) || defined (UNX) +#if defined(WNT) || (defined (UNX) && !defined(ANDROID) && !defined(IOS)) #define HAVE_ODBC_SUPPORT #endif diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx index af4f3e332b94..323d819ef61d 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -25,7 +25,7 @@ #include <com/sun/star/sdb/SQLContext.hpp> #include <vcl/fixed.hxx> #include <osl/diagnose.h> -#include <svtools/svtreebx.hxx> +#include <svtools/treelistbox.hxx> #include <svtools/svmedit.hxx> #include <connectivity/dbexception.hxx> #include <connectivity/sqlerror.hxx> diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx index 19eba7de6f98..3259a87d3f28 100644 --- a/dbaccess/source/ui/dlg/tablespage.cxx +++ b/dbaccess/source/ui/dlg/tablespage.cxx @@ -48,6 +48,7 @@ #include <svtools/imgdef.hxx> #include "TablesSingleDlg.hxx" #include <tools/diagnose_ex.h> +#include <comphelper/processfactory.hxx> #include <cppuhelper/exc_hlp.hxx> #include "AutoControls.hrc" @@ -310,7 +311,7 @@ DBG_NAME(OTableSubscriptionPage) xProp->setPropertyValue( PROPERTY_TABLETYPEFILTER, makeAny( Sequence< ::rtl::OUString >() ) ); Reference< ::com::sun::star::lang::XEventListener> xEvt; - aErrorInfo = ::dbaui::createConnection(xProp,m_xORB,xEvt,m_xCurrentConnection); + aErrorInfo = ::dbaui::createConnection(xProp,comphelper::getComponentContext(m_xORB),xEvt,m_xCurrentConnection); xProp->setPropertyValue(PROPERTY_TABLEFILTER,aTableFilter); xProp->setPropertyValue(PROPERTY_TABLETYPEFILTER,aTableTypeFilter); @@ -335,7 +336,7 @@ DBG_NAME(OTableSubscriptionPage) if (aErrorInfo.isValid()) { // establishing the connection failed. Show an error window and exit. - OSQLMessageBox aMessageBox( GetParent()->GetParent(), aErrorInfo ); + OSQLMessageBox aMessageBox( GetParentDialog(), aErrorInfo ); aMessageBox.Execute(); m_aTables.Enable(sal_False); m_aTablesList.Enable(sal_False); diff --git a/dbaccess/source/ui/inc/TableWindowListBox.hxx b/dbaccess/source/ui/inc/TableWindowListBox.hxx index 1bec9757ed0d..890f69887e6e 100644 --- a/dbaccess/source/ui/inc/TableWindowListBox.hxx +++ b/dbaccess/source/ui/inc/TableWindowListBox.hxx @@ -19,7 +19,7 @@ #ifndef DBAUI_TABLEWINDOWLISTBOX_HXX #define DBAUI_TABLEWINDOWLISTBOX_HXX -#include <svtools/svtreebx.hxx> +#include <svtools/treelistbox.hxx> #include "callbacks.hxx" struct AcceptDropEvent; diff --git a/dbaccess/source/ui/inc/UITools.hxx b/dbaccess/source/ui/inc/UITools.hxx index 574b3ad231e7..df0c4b18b675 100644 --- a/dbaccess/source/ui/inc/UITools.hxx +++ b/dbaccess/source/ui/inc/UITools.hxx @@ -80,7 +80,7 @@ namespace dbaui /** creates a new connection and appends the eventlistener @param _rsDataSourceName name of the datasource @param _xDatabaseContext the database context - @param _rMF the multi service factory + @param _rxContext the UNO component context @param _rEvtLst the eventlistener which will be added to the new created connection @param _rOUTConnection this parameter will be filled with the new created connection @return SQLExceptionInfo contains a SQLException, SQLContext or a SQLWarning when they araised else .isValid() will return false @@ -88,19 +88,19 @@ namespace dbaui ::dbtools::SQLExceptionInfo createConnection( const ::rtl::OUString& _rsDataSourceName, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _xDatabaseContext, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rMF, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener>& _rEvtLst, ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _rOUTConnection ); /** creates a new connection and appends the eventlistener @param _xDataSource the datasource - @param _rMF the multi service factory + @param _rxContext the UNO component context @param _rEvtLst the eventlistener which will be added to the new created connection @param _rOUTConnection this parameter will be filled with the new created connection @return SQLExceptionInfo contains a SQLException, SQLContext or a SQLWarning when they araised else .isValid() will return false */ ::dbtools::SQLExceptionInfo createConnection( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xDataSource, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rMF, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener>& _rEvtLst, ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _rOUTConnection ); diff --git a/dbaccess/source/ui/inc/dbtreelistbox.hxx b/dbaccess/source/ui/inc/dbtreelistbox.hxx index 7ef0cd1a328c..f5948baee4cd 100644 --- a/dbaccess/source/ui/inc/dbtreelistbox.hxx +++ b/dbaccess/source/ui/inc/dbtreelistbox.hxx @@ -24,7 +24,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <svtools/svtreebx.hxx> +#include <svtools/treelistbox.hxx> #include <vcl/timer.hxx> #include <set> diff --git a/dbaccess/source/ui/inc/indexdialog.hxx b/dbaccess/source/ui/inc/indexdialog.hxx index 1a0ab7e7709a..61ae42971402 100644 --- a/dbaccess/source/ui/inc/indexdialog.hxx +++ b/dbaccess/source/ui/inc/indexdialog.hxx @@ -29,7 +29,7 @@ #include <com/sun/star/sdbc/XConnection.hpp> #include <com/sun/star/uno/Sequence.hxx> #include <vcl/toolbox.hxx> -#include <svtools/svtreebx.hxx> +#include <svtools/treelistbox.hxx> #include <unotools/viewoptions.hxx> #include "indexes.hxx" #include "ToolBoxHelper.hxx" diff --git a/dbaccess/source/ui/inc/listviewitems.hxx b/dbaccess/source/ui/inc/listviewitems.hxx index 6fb05f0a1a20..99aca2095a40 100644 --- a/dbaccess/source/ui/inc/listviewitems.hxx +++ b/dbaccess/source/ui/inc/listviewitems.hxx @@ -45,8 +45,8 @@ namespace dbaui virtual sal_uInt16 IsA(); - virtual void Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry); - virtual void InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* _pViewData); + virtual void Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry); + virtual void InitViewData( SvTreeListBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* _pViewData); sal_Bool isEmphasized() const { return m_bEmphasized; } void emphasize(sal_Bool _bEmphasize) { m_bEmphasized = _bEmphasize; } diff --git a/dbaccess/source/ui/inc/marktree.hxx b/dbaccess/source/ui/inc/marktree.hxx index 12db88750880..adda68952197 100644 --- a/dbaccess/source/ui/inc/marktree.hxx +++ b/dbaccess/source/ui/inc/marktree.hxx @@ -22,6 +22,7 @@ #include "dbtreelistbox.hxx" +#include "svtools/svlbitm.hxx" //......................................................................... diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx index 16615e4c478b..90522f2e8f80 100644 --- a/dbaccess/source/ui/misc/TokenWriter.cxx +++ b/dbaccess/source/ui/misc/TokenWriter.cxx @@ -281,7 +281,7 @@ void ODatabaseImportExport::initialize() Reference< XEventListener> xEvt((::cppu::OWeakObject*)this,UNO_QUERY); Reference< XConnection > xConnection; - SQLExceptionInfo aInfo = ::dbaui::createConnection( m_sDataSourceName, xDatabaseContext, m_xFactory, xEvt, xConnection ); + SQLExceptionInfo aInfo = ::dbaui::createConnection( m_sDataSourceName, xDatabaseContext, comphelper::getComponentContext(m_xFactory), xEvt, xConnection ); m_xConnection.reset( xConnection ); if(aInfo.isValid() && aInfo.getType() == SQLExceptionInfo::SQL_EXCEPTION) diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 0ac020f5e792..d43e4cdd7752 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -42,7 +42,7 @@ #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp> #include <com/sun/star/sdbc/XResultSetMetaData.hpp> #include <com/sun/star/sdbc/ColumnValue.hpp> -#include <com/sun/star/task/XInteractionHandler.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/ucb/XContent.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -138,7 +138,7 @@ using ::com::sun::star::frame::XModel; // ----------------------------------------------------------------------------- SQLExceptionInfo createConnection( const ::rtl::OUString& _rsDataSourceName, const Reference< ::com::sun::star::container::XNameAccess >& _xDatabaseContext, - const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rMF, + const Reference< ::com::sun::star::uno::XComponentContext >& _rxContext, Reference< ::com::sun::star::lang::XEventListener>& _rEvtLst, Reference< ::com::sun::star::sdbc::XConnection>& _rOUTConnection ) { @@ -152,11 +152,11 @@ SQLExceptionInfo createConnection( const ::rtl::OUString& _rsDataSourceName, } SQLExceptionInfo aInfo; - return createConnection(xProp,_rMF,_rEvtLst,_rOUTConnection); + return createConnection(xProp,_rxContext,_rEvtLst,_rOUTConnection); } // ----------------------------------------------------------------------------- SQLExceptionInfo createConnection( const Reference< ::com::sun::star::beans::XPropertySet>& _xDataSource, - const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rMF, + const Reference< ::com::sun::star::uno::XComponentContext >& _rxContext, Reference< ::com::sun::star::lang::XEventListener>& _rEvtLst, Reference< ::com::sun::star::sdbc::XConnection>& _rOUTConnection ) { @@ -192,14 +192,8 @@ SQLExceptionInfo createConnection( const Reference< ::com::sun::star::beans::XP } else { // instantiate the default SDB interaction handler - Reference< XInteractionHandler > xHandler(_rMF->createInstance(SERVICE_TASK_INTERACTION_HANDLER), UNO_QUERY); - if (!xHandler.is()) - { - OSL_FAIL("createConnection: could not instantiate an interaction handler!"); - // TODO: a real parent! - } - else - _rOUTConnection = xConnectionCompletion->connectWithCompletion(xHandler); + Reference< XInteractionHandler > xHandler( InteractionHandler::createWithParent(_rxContext, 0), UNO_QUERY); + _rOUTConnection = xConnectionCompletion->connectWithCompletion(xHandler); } } else diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index 025e7d14cef1..bf3c9d35e7d4 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -45,6 +45,7 @@ #include <com/sun/star/sdbcx/XTablesSupplier.hpp> #include <com/sun/star/sdbcx/XViewsSupplier.hpp> #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <comphelper/extract.hxx> #include <comphelper/processfactory.hxx> @@ -683,7 +684,7 @@ OCopyTableWizard::OCopyTableWizard( Window* pParent, const ::rtl::OUString& _rDe ::dbaui::fillTypeInfo( _xConnection, m_sTypeNames, m_aTypeInfo, m_aTypeInfoIndex ); ::dbaui::fillTypeInfo( _xConnection, m_sTypeNames, m_aDestTypeInfo, m_aDestTypeInfoIndex ); - m_xInteractionHandler.set( m_xFactory->createInstance( SERVICE_TASK_INTERACTION_HANDLER ), UNO_QUERY); + m_xInteractionHandler.set( InteractionHandler::createWithParent(comphelper::getComponentContext(m_xFactory), 0), UNO_QUERY ); OCopyTable* pPage1( new OCopyTable( this ) ); pPage1->disallowViews(); diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index 569a7a7caed0..b68b329a3162 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -335,10 +335,10 @@ public: { } - virtual void Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry); + virtual void Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry); }; //------------------------------------------------------------------------ -void OColumnString::Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 /*nFlags*/, SvLBoxEntry* /*pEntry*/ ) +void OColumnString::Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 /*nFlags*/, SvLBoxEntry* /*pEntry*/ ) { if(m_bReadOnly) { diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx index 4b3078b2cb3e..0a40d8e22c0c 100644 --- a/dbaccess/source/ui/misc/WTypeSelect.cxx +++ b/dbaccess/source/ui/misc/WTypeSelect.cxx @@ -112,7 +112,7 @@ void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId ) { case FIELD_PRPOERTY_COLUMNNAME: { - OCopyTableWizard* pWiz = static_cast<OCopyTableWizard*>(GetParent()->GetParent()); + OCopyTableWizard* pWiz = static_cast<OCopyTableWizard*>(GetParentDialog()); // first we have to check if this name already exists sal_Bool bDoubleName = sal_False; sal_Bool bCase = sal_True; diff --git a/dbaccess/source/ui/misc/datasourceconnector.cxx b/dbaccess/source/ui/misc/datasourceconnector.cxx index 38a84b5451d9..b4b4187038d6 100644 --- a/dbaccess/source/ui/misc/datasourceconnector.cxx +++ b/dbaccess/source/ui/misc/datasourceconnector.cxx @@ -24,11 +24,12 @@ #include <com/sun/star/sdbc/XWarningsSupplier.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/sdb/XCompletedConnection.hpp> -#include <com/sun/star/task/XInteractionHandler.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/sdb/SQLContext.hpp> #include <com/sun/star/sdbc/SQLWarning.hpp> #include <osl/thread.h> +#include <comphelper/processfactory.hxx> #include <comphelper/extract.hxx> #include <comphelper/namedvaluecollection.hxx> #include <connectivity/dbexception.hxx> @@ -138,15 +139,10 @@ namespace dbaui if ( !xHandler.is() ) { // instantiate the default SDB interaction handler - xHandler = Reference< XInteractionHandler >( m_xORB->createInstance( SERVICE_TASK_INTERACTION_HANDLER ), UNO_QUERY ); - if ( !xHandler.is() ) - ShowServiceNotAvailableError(m_pErrorMessageParent, (::rtl::OUString)SERVICE_TASK_INTERACTION_HANDLER, sal_True); + xHandler = Reference< XInteractionHandler >( InteractionHandler::createWithParent(comphelper::getComponentContext(m_xORB), 0), UNO_QUERY ); } - if ( xHandler.is() ) - { - xConnection = xConnectionCompletion->connectWithCompletion(xHandler); - } + xConnection = xConnectionCompletion->connectWithCompletion(xHandler); } else { diff --git a/dbaccess/source/ui/querydesign/JoinExchange.cxx b/dbaccess/source/ui/querydesign/JoinExchange.cxx index 82100a1e053a..9614c49c94db 100644 --- a/dbaccess/source/ui/querydesign/JoinExchange.cxx +++ b/dbaccess/source/ui/querydesign/JoinExchange.cxx @@ -112,7 +112,7 @@ namespace dbaui //------------------------------------------------------------------------ sal_Int64 SAL_CALL OJoinExchObj::getSomething( const Sequence< sal_Int8 >& _rIdentifier ) throw(RuntimeException) { - if (_rIdentifier.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), _rIdentifier.getConstArray(), 16 ) ) + if (_rIdentifier.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), _rIdentifier.getConstArray(), 16 ) ) return reinterpret_cast<sal_Int64>(this); return 0; diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index 820569a903af..252564d610d8 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -35,7 +35,7 @@ #include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/container/XChild.hpp> -#include <com/sun/star/task/XInteractionHandler.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/sdb/DatabaseContext.hpp> #include <com/sun/star/sdb/XDocumentDataSource.hpp> @@ -102,6 +102,7 @@ namespace dbaui using ::com::sun::star::sdbc::XDataSource; using ::com::sun::star::container::XNameAccess; using ::com::sun::star::container::XChild; + using ::com::sun::star::task::InteractionHandler; using ::com::sun::star::task::XInteractionHandler; using ::com::sun::star::frame::XModel; using ::com::sun::star::sdb::DatabaseContext; @@ -135,7 +136,6 @@ namespace dbaui namespace DataType = ::com::sun::star::sdbc::DataType; typedef ::utl::SharedUNOComponent< XConnection > SharedConnection; - typedef Reference< XInteractionHandler > InteractionHandler; //========================================================================= //= CopyTableWizard @@ -238,7 +238,7 @@ namespace dbaui const Sequence< Any >& _rAllArgs, const sal_Int16 _nArgPos, SharedConnection& _out_rxConnection, - InteractionHandler& _out_rxDocInteractionHandler + Reference< XInteractionHandler >& _out_rxDocInteractionHandler ) const; /** extracts the source object (table or query) described by the given descriptor, @@ -292,7 +292,7 @@ namespace dbaui SharedConnection impl_extractConnection_throw( const Reference< XPropertySet >& _rxDataSourceDescriptor, - InteractionHandler& _out_rxDocInteractionHandler + Reference< XInteractionHandler >& _out_rxDocInteractionHandler ) const; /** actually copies the table @@ -357,7 +357,7 @@ private: SharedConnection m_xDestConnection; // other - InteractionHandler m_xInteractionHandler; + Reference< XInteractionHandler > m_xInteractionHandler; ::cppu::OInterfaceContainerHelper m_aCopyTableListeners; sal_Int16 m_nOverrideExecutionResult; @@ -634,9 +634,9 @@ namespace if it occures during invoking any of the data source's methods, or if any of the involved components violates its contract by not providing the required interfaces */ - InteractionHandler lcl_getInteractionHandler_throw( const Reference< XDataSource >& _rxDataSource, const InteractionHandler& _rFallback ) + Reference< XInteractionHandler > lcl_getInteractionHandler_throw( const Reference< XDataSource >& _rxDataSource, const Reference< XInteractionHandler >& _rFallback ) { - InteractionHandler xHandler( _rFallback ); + Reference< XInteractionHandler > xHandler( _rFallback ); // try to obtain the document model Reference< XModel > xDocumentModel; @@ -663,7 +663,7 @@ namespace if it occures during invoking any of the data source's methods, or if any of the involved components violates its contract by not providing the required interfaces */ - InteractionHandler lcl_getInteractionHandler_throw( const Reference< XConnection >& _rxConnection, const InteractionHandler& _rFallback ) + Reference< XInteractionHandler > lcl_getInteractionHandler_throw( const Reference< XConnection >& _rxConnection, const Reference< XInteractionHandler >& _rFallback ) { // try whether there is a data source which the connection belongs to Reference< XDataSource > xDataSource; @@ -681,7 +681,7 @@ namespace //------------------------------------------------------------------------- Reference< XPropertySet > CopyTableWizard::impl_ensureDataAccessDescriptor_throw( const Sequence< Any >& _rAllArgs, const sal_Int16 _nArgPos, SharedConnection& _out_rxConnection, - InteractionHandler& _out_rxDocInteractionHandler ) const + Reference< XInteractionHandler >& _out_rxDocInteractionHandler ) const { Reference< XPropertySet > xDescriptor; _rAllArgs[ _nArgPos ] >>= xDescriptor; @@ -878,7 +878,7 @@ void CopyTableWizard::impl_extractSourceResultSet_throw( const Reference< XPrope //------------------------------------------------------------------------- SharedConnection CopyTableWizard::impl_extractConnection_throw( const Reference< XPropertySet >& _rxDataSourceDescriptor, - InteractionHandler& _out_rxDocInteractionHandler ) const + Reference< XInteractionHandler >& _out_rxDocInteractionHandler ) const { SharedConnection xConnection; @@ -886,7 +886,7 @@ SharedConnection CopyTableWizard::impl_extractConnection_throw( const Reference< if ( !_rxDataSourceDescriptor.is() ) return xConnection; - InteractionHandler xInteractionHandler; + Reference< XInteractionHandler > xInteractionHandler; do { @@ -1553,15 +1553,15 @@ void SAL_CALL CopyTableWizard::initialize( const Sequence< Any >& _rArguments ) ); } if ( !m_xInteractionHandler.is() ) - m_xInteractionHandler.set( m_aContext.createComponent( "com.sun.star.task.InteractionHandler" ), UNO_QUERY_THROW ); + m_xInteractionHandler.set( InteractionHandler::createWithParent(m_aContext.getUNOContext(), 0), UNO_QUERY ); - InteractionHandler xSourceDocHandler; + Reference< XInteractionHandler > xSourceDocHandler; Reference< XPropertySet > xSourceDescriptor( impl_ensureDataAccessDescriptor_throw( _rArguments, 0, m_xSourceConnection, xSourceDocHandler ) ); impl_checkForUnsupportedSettings_throw( xSourceDescriptor ); m_pSourceObject = impl_extractSourceObject_throw( xSourceDescriptor, m_nCommandType ); impl_extractSourceResultSet_throw( xSourceDescriptor ); - InteractionHandler xDestDocHandler; + Reference< XInteractionHandler > xDestDocHandler; impl_ensureDataAccessDescriptor_throw( _rArguments, 1, m_xDestConnection, xDestDocHandler ); if ( xDestDocHandler.is() && !m_xInteractionHandler.is() ) diff --git a/dbaccess/source/ui/uno/dbinteraction.cxx b/dbaccess/source/ui/uno/dbinteraction.cxx index 0b31334810f7..8cb12b91397a 100644 --- a/dbaccess/source/ui/uno/dbinteraction.cxx +++ b/dbaccess/source/ui/uno/dbinteraction.cxx @@ -25,6 +25,7 @@ #include <vcl/msgbox.hxx> #include <connectivity/dbexception.hxx> #include "sqlmessage.hxx" +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/task/XInteractionApprove.hpp> #include <com/sun/star/task/XInteractionDisapprove.hpp> #include <com/sun/star/task/XInteractionRetry.hpp> @@ -38,6 +39,7 @@ #include <osl/mutex.hxx> #include "CollectionView.hxx" #include "UITools.hxx" +#include <comphelper/processfactory.hxx> //========================================================================== @@ -302,11 +304,10 @@ namespace dbaui //------------------------------------------------------------------------- bool BasicInteractionHandler::implHandleUnknown( const Reference< XInteractionRequest >& _rxRequest ) { - Reference< XInteractionHandler > xFallbackHandler; if ( m_xORB.is() ) - xFallbackHandler = xFallbackHandler.query( m_xORB->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.InteractionHandler" ) ) ) ); - if ( xFallbackHandler.is() ) { + Reference< XInteractionHandler2 > xFallbackHandler( + InteractionHandler::createWithParent(comphelper::getComponentContext(m_xORB), 0) ); xFallbackHandler->handle( _rxRequest ); return true; } diff --git a/dbaccess/source/ui/uno/dbinteraction.hxx b/dbaccess/source/ui/uno/dbinteraction.hxx index 216c566d1101..f5e7496de485 100644 --- a/dbaccess/source/ui/uno/dbinteraction.hxx +++ b/dbaccess/source/ui/uno/dbinteraction.hxx @@ -73,6 +73,9 @@ namespace dbaui const bool i_bFallbackToGeneric ); + // XInitialization + void SAL_CALL initialize( com::sun::star::uno::Sequence< com::sun::star::uno::Any > const & /*rArguments*/) throw (com::sun::star::uno::Exception) {} + // XInteractionHandler2 virtual ::sal_Bool SAL_CALL handleInteractionRequest( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& Request ) throw (::com::sun::star::uno::RuntimeException); |