diff options
author | Noel Grandin <noel@peralex.com> | 2012-10-11 15:43:08 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-23 10:26:40 +0200 |
commit | c988da288ec473a28f61ebb53aa3ff82bab11ef4 (patch) | |
tree | 284f184384dba369c40e0caff533a2d683e9d478 /cui/source/options | |
parent | eb016138e817d686795e1902a7a295d93639da27 (diff) |
fdo#46808, Adapt ui::dialogs::FolderPicker UNO service to new style
Create a merged XFolderPicker2 interface for this service to implement.
Which is backwards-compatible, but does not require creating a new service.
Change-Id: I4a2c2a8d491a8d5633c19ddcea547f0efe75b91d
Diffstat (limited to 'cui/source/options')
-rw-r--r-- | cui/source/options/certpath.cxx | 7 | ||||
-rw-r--r-- | cui/source/options/optjava.cxx | 11 | ||||
-rw-r--r-- | cui/source/options/optjava.hxx | 4 | ||||
-rw-r--r-- | cui/source/options/optpath.cxx | 7 | ||||
-rw-r--r-- | cui/source/options/optupdt.cxx | 8 |
5 files changed, 15 insertions, 22 deletions
diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx index d7a0b83f7e68..0e7f6a488783 100644 --- a/cui/source/options/certpath.cxx +++ b/cui/source/options/certpath.cxx @@ -39,7 +39,7 @@ #include <com/sun/star/mozilla/XMozillaBootstrap.hpp> #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> -#include <com/sun/star/ui/dialogs/XFolderPicker.hpp> +#include <com/sun/star/ui/dialogs/FolderPicker.hpp> #include <comphelper/processfactory.hxx> using namespace ::com::sun::star; @@ -237,10 +237,7 @@ IMPL_LINK_NOARG(CertPathDialog, AddHdl_Impl) { try { - uno::Reference<uno::XInterface> xInstance = comphelper::getProcessServiceFactory()->createInstance( - "com.sun.star.ui.dialogs.FolderPicker"); - - uno::Reference<ui::dialogs::XFolderPicker> xFolderPicker(xInstance, uno::UNO_QUERY_THROW); + uno::Reference<ui::dialogs::XFolderPicker2> xFolderPicker = ui::dialogs::FolderPicker::create(comphelper::getProcessComponentContext()); rtl::OUString sURL; osl::Security().getHomeDir(sURL); diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index 5157dae4cdc3..6c38810b92d3 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -39,6 +39,7 @@ #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> #include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> +#include <com/sun/star/ui/dialogs/FolderPicker.hpp> #include <com/sun/star/ucb/XContentProvider.hpp> #include <jvmfwk/framework.h> @@ -236,9 +237,8 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, AddHdl_Impl) { try { - Reference < XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() ); - xFolderPicker = Reference< XFolderPicker >( - xMgr->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.FolderPicker") ) ), UNO_QUERY ); + Reference < XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + xFolderPicker = FolderPicker::create(xContext); String sWorkFolder = SvtPathOptions().GetWorkPath(); xFolderPicker->setDisplayDirectory( sWorkFolder ); @@ -965,9 +965,8 @@ IMPL_LINK_NOARG(SvxJavaClassPathDlg, AddArchiveHdl_Impl) IMPL_LINK_NOARG(SvxJavaClassPathDlg, AddPathHdl_Impl) { - rtl::OUString sService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FolderPicker" ) ); - Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - Reference < XFolderPicker > xFolderPicker( xFactory->createInstance( sService ), UNO_QUERY ); + Reference < XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + Reference < XFolderPicker2 > xFolderPicker = FolderPicker::create(xContext);; String sOldFolder; if ( m_aPathList.GetSelectEntryCount() > 0 ) diff --git a/cui/source/options/optjava.hxx b/cui/source/options/optjava.hxx index aed4aef70269..7e7d9f5a8ec2 100644 --- a/cui/source/options/optjava.hxx +++ b/cui/source/options/optjava.hxx @@ -26,7 +26,7 @@ #include <vcl/timer.hxx> #include <sfx2/tabdlg.hxx> #include <svx/simptabl.hxx> -#include <com/sun/star/ui/dialogs/XFolderPicker.hpp> +#include <com/sun/star/ui/dialogs/XFolderPicker2.hpp> #include <svtools/dialogclosedlistener.hxx> #include "radiobtnbox.hxx" @@ -73,7 +73,7 @@ private: m_aAddedInfos; ::com::sun::star::uno::Reference< ::svt::DialogClosedListener > xDialogListener; - ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFolderPicker > xFolderPicker; + ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFolderPicker2 > xFolderPicker; DECL_LINK(EnableHdl_Impl, void *); DECL_LINK( CheckHdl_Impl, SvxSimpleTable * ); diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx index 6a8b4b4c0334..f1612b5e4922 100644 --- a/cui/source/options/optpath.cxx +++ b/cui/source/options/optpath.cxx @@ -48,6 +48,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> #include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp> +#include <com/sun/star/ui/dialogs/FolderPicker.hpp> #include <officecfg/Office/Common.hxx> #include "optHeaderTabListbox.hxx" #include <readonlyimage.hxx> @@ -610,10 +611,8 @@ IMPL_LINK_NOARG(SvxPathTabPage, PathHdl_Impl) { try { - rtl::OUString aService( RTL_CONSTASCII_USTRINGPARAM( FOLDER_PICKER_SERVICE_NAME ) ); - Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - xFolderPicker = ::com::sun::star::uno::Reference< XFolderPicker >( - xFactory->createInstance( aService ), UNO_QUERY ); + Reference < XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + xFolderPicker = FolderPicker::create(xContext);; INetURLObject aURL( sWritable, INET_PROT_FILE ); xFolderPicker->setDisplayDirectory( aURL.GetMainURL( INetURLObject::NO_DECODE ) ); diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx index 0e81360bc4f5..b0f255f80ffe 100644 --- a/cui/source/options/optupdt.cxx +++ b/cui/source/options/optupdt.cxx @@ -28,7 +28,7 @@ #include <comphelper/processfactory.hxx> #include <com/sun/star/configuration/theDefaultProvider.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/ui/dialogs/XFolderPicker.hpp> +#include <com/sun/star/ui/dialogs/FolderPicker.hpp> #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> #include <com/sun/star/frame/XDesktop.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> @@ -300,10 +300,8 @@ IMPL_LINK( SvxOnlineUpdateTabPage, AutoCheckHdl_Impl, CheckBox *, pBox ) IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, FileDialogHdl_Impl) { - uno::Reference < lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - uno::Reference < dialogs::XFolderPicker > xFolderPicker( - xFactory->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( FOLDER_PICKER_SERVICE_NAME ) ) ), - uno::UNO_QUERY ); + uno::Reference < uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + uno::Reference < dialogs::XFolderPicker2 > xFolderPicker = dialogs::FolderPicker::create(xContext); rtl::OUString aURL; if( osl::FileBase::E_None != osl::FileBase::getFileURLFromSystemPath(m_aDestPath.GetText(), aURL) ) |