summaryrefslogtreecommitdiff
path: root/cui/source/dialogs
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-10-11 15:43:08 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-10-23 10:26:40 +0200
commitc988da288ec473a28f61ebb53aa3ff82bab11ef4 (patch)
tree284f184384dba369c40e0caff533a2d683e9d478 /cui/source/dialogs
parenteb016138e817d686795e1902a7a295d93639da27 (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/dialogs')
-rw-r--r--cui/source/dialogs/cuigaldlg.cxx42
-rw-r--r--cui/source/dialogs/hldocntp.cxx7
-rw-r--r--cui/source/dialogs/multipat.cxx7
3 files changed, 24 insertions, 32 deletions
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index fb1bbdf7897b..4e50bb363932 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -43,6 +43,7 @@
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/ucb/XContentAccess.hpp>
+#include <com/sun/star/ui/dialogs/FolderPicker.hpp>
#include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp>
#include <sfx2/sfxuno.hxx>
#include "dialmgr.hxx"
@@ -1035,34 +1036,27 @@ IMPL_LINK_NOARG(TPGalleryThemeProperties, ClickSearchHdl)
try
{
// setup folder picker
- ::com::sun::star::uno::Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
- if( xMgr.is() )
- {
- xFolderPicker = ::com::sun::star::uno::Reference< XFolderPicker >(
- xMgr->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FolderPicker" ))), UNO_QUERY );
-
- if ( xFolderPicker.is() )
- {
- String aDlgPathName( SvtPathOptions().GetGraphicPath() );
- xFolderPicker->setDisplayDirectory(aDlgPathName);
+ com::sun::star::uno::Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
+ xFolderPicker = FolderPicker::create(xContext);
- aPreviewTimer.Stop();
+ String aDlgPathName( SvtPathOptions().GetGraphicPath() );
+ xFolderPicker->setDisplayDirectory(aDlgPathName);
- ::com::sun::star::uno::Reference< XAsynchronousExecutableDialog > xAsyncDlg( xFolderPicker, UNO_QUERY );
- if ( xAsyncDlg.is() )
- xAsyncDlg->startExecuteModal( xDialogListener.get() );
- else
- {
- if( xFolderPicker->execute() == RET_OK )
- {
- aURL = INetURLObject( xFolderPicker->getDirectory() );
- bSearchRecursive = sal_True; // UI choice no longer possible, windows file picker allows no user controls
- SearchFiles();
- }
+ aPreviewTimer.Stop();
- nCurFilterPos = aCbbFileType.GetEntryPos( aCbbFileType.GetText() );
- }
+ com::sun::star::uno::Reference< XAsynchronousExecutableDialog > xAsyncDlg( xFolderPicker, UNO_QUERY );
+ if ( xAsyncDlg.is() )
+ xAsyncDlg->startExecuteModal( xDialogListener.get() );
+ else
+ {
+ if( xFolderPicker->execute() == RET_OK )
+ {
+ aURL = INetURLObject( xFolderPicker->getDirectory() );
+ bSearchRecursive = sal_True; // UI choice no longer possible, windows file picker allows no user controls
+ SearchFiles();
}
+
+ nCurFilterPos = aCbbFileType.GetEntryPos( aCbbFileType.GetText() );
}
}
catch (const IllegalArgumentException&)
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index 1f4157dc4271..6e1a971750a1 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -36,7 +36,7 @@
#include "hyperdlg.hrc"
#include <comphelper/processfactory.hxx>
#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>
using namespace ::com::sun::star::lang;
@@ -399,9 +399,8 @@ void SvxHyperlinkNewDocTp::DoApply ()
IMPL_LINK_NOARG(SvxHyperlinkNewDocTp, ClickNewHdl_Impl)
{
- rtl::OUString aService( RTL_CONSTASCII_USTRINGPARAM( FOLDER_PICKER_SERVICE_NAME ) );
- uno::Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- uno::Reference < XFolderPicker > xFolderPicker( xFactory->createInstance( aService ), UNO_QUERY );
+ uno::Reference < XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
+ uno::Reference < XFolderPicker2 > xFolderPicker = FolderPicker::create(xContext);
String aStrURL;
String aTempStrURL( maCbbPath.GetText() );
diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx
index da177364a5d2..c185887919d5 100644
--- a/cui/source/dialogs/multipat.cxx
+++ b/cui/source/dialogs/multipat.cxx
@@ -29,7 +29,7 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
#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 <unotools/localfilehelper.hxx>
@@ -79,9 +79,8 @@ IMPL_LINK( SvxMultiPathDialog, CheckHdl_Impl, svx::SvxRadioButtonListBox *, pBox
IMPL_LINK_NOARG(SvxMultiPathDialog, AddHdl_Impl)
{
- rtl::OUString aService( RTL_CONSTASCII_USTRINGPARAM( FOLDER_PICKER_SERVICE_NAME ) );
- Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- Reference < XFolderPicker > xFolderPicker( xFactory->createInstance( aService ), UNO_QUERY );
+ Reference < XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
+ Reference < XFolderPicker2 > xFolderPicker = FolderPicker::create(xContext);
if ( xFolderPicker->execute() == ExecutableDialogResults::OK )
{