[Libreoffice-commits] .: 2 commits - basctl/source cui/source dbaccess/source fpicker/source offapi/com offapi/type_reference offapi/UnoApi_offapi.mk padmin/source sfx2/inc sfx2/source svx/source sw/source writerfilter/source xmlsecurity/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Oct 23 01:27:33 PDT 2012


 basctl/source/basicide/moduldl2.cxx                |   38 +++++-------
 cui/source/dialogs/cuigaldlg.cxx                   |   42 ++++++--------
 cui/source/dialogs/hldocntp.cxx                    |    7 +-
 cui/source/dialogs/multipat.cxx                    |    7 +-
 cui/source/inc/cuigaldlg.hxx                       |    4 -
 cui/source/inc/optpath.hxx                         |    4 -
 cui/source/options/certpath.cxx                    |    7 --
 cui/source/options/optjava.cxx                     |   11 +--
 cui/source/options/optjava.hxx                     |    4 -
 cui/source/options/optpath.cxx                     |    7 +-
 cui/source/options/optupdt.cxx                     |    8 +-
 dbaccess/source/inc/stringconstants.inc            |    1 
 dbaccess/source/ui/dlg/ConnectionHelper.cxx        |   10 ---
 fpicker/source/win32/folderpicker/FolderPicker.hxx |    9 +--
 offapi/UnoApi_offapi.mk                            |    3 -
 offapi/com/sun/star/ui/dialogs/FolderPicker.idl    |   19 ------
 offapi/com/sun/star/ui/dialogs/XFolderPicker2.idl  |   62 +++++++++++++++++++++
 offapi/type_reference/types.rdb                    |binary
 padmin/source/helper.cxx                           |   56 ++++++++----------
 sfx2/inc/sfx2/filedlghelper.hxx                    |    1 
 sfx2/source/doc/templatedlg.cxx                    |    7 +-
 svx/source/dialog/docrecovery.cxx                  |    6 +-
 svx/source/inc/docrecovery.hxx                     |    1 
 sw/source/ui/envelp/mailmrge.cxx                   |   13 +---
 writerfilter/source/rtftok/rtftokenizer.cxx        |    4 -
 xmlsecurity/source/dialogs/macrosecurity.cxx       |    7 +-
 26 files changed, 172 insertions(+), 166 deletions(-)

New commits:
commit 96365ae6e670678919951859f4ddc61e86a5df02
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Oct 23 10:01:49 2012 +0200

    -Werror=maybe-uninitialized
    
    Change-Id: I31eefa2444d7d108103818785e83816d07f8cde2

diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx b/writerfilter/source/rtftok/rtftokenizer.cxx
index 471462c..de5cfff 100644
--- a/writerfilter/source/rtftok/rtftokenizer.cxx
+++ b/writerfilter/source/rtftok/rtftokenizer.cxx
@@ -92,8 +92,8 @@ int RTFTokenizer::resolveParse()
     {
         //SAL_INFO("writerfilter", OSL_THIS_FUNC << ": parsing character '" << ch << "'");
 
-        sal_uInt32 nCurrentPos;
-        if (m_xStatusIndicator.is() && (nCurrentPos = Strm().Tell()) > (nLastPos + nPercentSize))
+        sal_uInt32 nCurrentPos = Strm().Tell();
+        if (m_xStatusIndicator.is() && nCurrentPos > (nLastPos + nPercentSize))
             m_xStatusIndicator->setValue(nLastPos = nCurrentPos);
 
         if (m_nGroup < 0)
commit c988da288ec473a28f61ebb53aa3ff82bab11ef4
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Oct 11 15:43:08 2012 +0200

    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

diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index a972bf5..baef479 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -45,7 +45,7 @@
 #include <sot/storage.hxx>
 #include <com/sun/star/io/Pipe.hpp>
 #include <com/sun/star/ui/dialogs/XFilePicker.hpp>
-#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
+#include <com/sun/star/ui/dialogs/FolderPicker.hpp>
 #include <com/sun/star/ui/dialogs/XFilterManager.hpp>
 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
 #include <com/sun/star/script/XLibraryContainer2.hpp>
@@ -1386,30 +1386,26 @@ void LibPage::ExportAsBasic( const String& aLibName )
     // Folder picker
     Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory() );
     Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
-    Reference< XFolderPicker > xFolderPicker( xMSF->createInstance(
-                "com.sun.star.ui.dialogs.FolderPicker" ), UNO_QUERY );
+    Reference< XFolderPicker2 > xFolderPicker = FolderPicker::create(xContext);
     Reference< task::XInteractionHandler2 > xHandler( task::InteractionHandler::createWithParent(xContext, 0) );
 
-    if( xFolderPicker.is() )
-    {
-        xFolderPicker->setTitle( String( IDEResId( RID_STR_EXPORTBASIC ) ) );
-
-        // set display directory and filter
-        String aPath =GetExtraData()->GetAddLibPath();
-        if( !aPath.Len() )
-            aPath = SvtPathOptions().GetWorkPath();
+    xFolderPicker->setTitle( String( IDEResId( RID_STR_EXPORTBASIC ) ) );
 
-        // INetURLObject aURL(m_sSavePath, INET_PROT_FILE);
-        xFolderPicker->setDisplayDirectory( aPath );
-        short nRet = xFolderPicker->execute();
-        if( nRet == RET_OK )
-        {
-            String aTargetURL = xFolderPicker->getDirectory();
-            GetExtraData()->SetAddLibPath(aTargetURL);
+    // set display directory and filter
+    String aPath =GetExtraData()->GetAddLibPath();
+    if( !aPath.Len() )
+        aPath = SvtPathOptions().GetWorkPath();
+
+    // INetURLObject aURL(m_sSavePath, INET_PROT_FILE);
+    xFolderPicker->setDisplayDirectory( aPath );
+    short nRet = xFolderPicker->execute();
+    if( nRet == RET_OK )
+    {
+        String aTargetURL = xFolderPicker->getDirectory();
+        GetExtraData()->SetAddLibPath(aTargetURL);
 
-            Reference< task::XInteractionHandler > xDummyHandler( new DummyInteractionHandler( xHandler ) );
-            implExportLib( aLibName, aTargetURL, xDummyHandler );
-        }
+        Reference< task::XInteractionHandler > xDummyHandler( new DummyInteractionHandler( xHandler ) );
+        implExportLib( aLibName, aTargetURL, xDummyHandler );
     }
 }
 
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index fb1bbdf..4e50bb3 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 1f4157d..6e1a971 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 da17736..c185887 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 )
     {
diff --git a/cui/source/inc/cuigaldlg.hxx b/cui/source/inc/cuigaldlg.hxx
index 21f4cb7..6c7e489 100644
--- a/cui/source/inc/cuigaldlg.hxx
+++ b/cui/source/inc/cuigaldlg.hxx
@@ -38,7 +38,7 @@
 #include <svx/galctrl.hxx>
 #include <svx/galmisc.hxx>
 #include <com/sun/star/media/XPlayer.hpp>
-#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
+#include <com/sun/star/ui/dialogs/XFolderPicker2.hpp>
 #include <svtools/dialogclosedlistener.hxx>
 #include <vector>
 
@@ -335,7 +335,7 @@ class TPGalleryThemeProperties : public SfxTabPage
 
     ::com::sun::star::uno::Reference< ::svt::DialogClosedListener >                  xDialogListener;
     ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer >             xMediaPlayer;
-    ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFolderPicker > xFolderPicker;
+    ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFolderPicker2 > xFolderPicker;
 
     virtual void        Reset( const SfxItemSet& /*rSet*/ ) {}
     virtual sal_Bool        FillItemSet( SfxItemSet& /*rSet*/ ) { return sal_True; }
diff --git a/cui/source/inc/optpath.hxx b/cui/source/inc/optpath.hxx
index db237f0..4a25dfe 100644
--- a/cui/source/inc/optpath.hxx
+++ b/cui/source/inc/optpath.hxx
@@ -30,7 +30,7 @@ class HeaderBar;
 #endif
 #include "ControlFocusHelper.hxx"
 
-#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
+#include <com/sun/star/ui/dialogs/XFolderPicker2.hpp>
 #include <svtools/dialogclosedlistener.hxx>
 
 // forward ---------------------------------------------------------------
@@ -59,7 +59,7 @@ private:
     OptPath_Impl*               pImpl;
 
     ::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;
 
 #ifdef _SVX_OPTPATH_CXX
     void        ChangeCurrentEntry( const String& _rFolder );
diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx
index d7a0b83..0e7f6a4 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 5157dae..6c38810 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 aed4aef..7e7d9f5 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 6a8b4b4..f1612b5 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 0e81360..b0f255f 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) )
diff --git a/dbaccess/source/inc/stringconstants.inc b/dbaccess/source/inc/stringconstants.inc
index 133a060..9d6e79e 100644
--- a/dbaccess/source/inc/stringconstants.inc
+++ b/dbaccess/source/inc/stringconstants.inc
@@ -212,7 +212,6 @@ IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBC_CONNECTIONPOOL, "com.sun.star.sdbc.Con
 IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBCX_INDEXCOLUMN, "com.sun.star.sdbcx.IndexColumn");
 IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBCX_KEYCOLUMN, "com.sun.star.sdbcx.KeyColumn");
 IMPLEMENT_CONSTASCII_USTRING(SERVICE_FRAME_DESKTOP, "com.sun.star.frame.Desktop");
-IMPLEMENT_CONSTASCII_USTRING(SERVICE_UI_FOLDERPICKER, "com.sun.star.ui.dialogs.FolderPicker");
 IMPLEMENT_CONSTASCII_USTRING(SERVICE_I18N_COLLATOR, "com.sun.star.i18n.Collator");
 IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_TABLEDEFINITION, "com.sun.star.sdb.TableDefinition");
 IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_COMMAND_DEFINITION,	"com.sun.star.sdb.CommandDefinition");
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
index ac7e55f..c33685d 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
@@ -45,7 +45,7 @@
 #include "dsselect.hxx"
 #include <svl/filenotation.hxx>
 #include "dbustrings.hrc"
-#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
+#include <com/sun/star/ui/dialogs/FolderPicker.hpp>
 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/awt/XWindow.hpp>
@@ -172,13 +172,7 @@ DBG_NAME(OConnectionHelper)
             {
                 try
                 {
-                    ::rtl::OUString sFolderPickerService(SERVICE_UI_FOLDERPICKER);
-                    Reference< XFolderPicker > xFolderPicker(m_xORB->createInstance(sFolderPickerService), UNO_QUERY);
-                    if (!xFolderPicker.is())
-                    {
-                        ShowServiceNotAvailableError(GetParent(), sFolderPickerService, sal_True);
-                        break;
-                    }
+                    Reference< XFolderPicker2 > xFolderPicker = FolderPicker::create(comphelper::getComponentContext(m_xORB));
 
                     sal_Bool bDoBrowse = sal_False;
                     String sOldPath = getURLNoPrefix();
diff --git a/fpicker/source/win32/folderpicker/FolderPicker.hxx b/fpicker/source/win32/folderpicker/FolderPicker.hxx
index a795f5f..ec95c26 100644
--- a/fpicker/source/win32/folderpicker/FolderPicker.hxx
+++ b/fpicker/source/win32/folderpicker/FolderPicker.hxx
@@ -20,7 +20,7 @@
 #ifndef _FOLDERPICKER_HXX_
 #define _FOLDERPICKER_HXX_
 
-#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/implbase2.hxx>
 #include <osl/mutex.hxx>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 
@@ -36,10 +36,9 @@
 //----------------------------------------------------------
 
 class CFolderPicker :
-    public  cppu::WeakImplHelper3<
-                com::sun::star::ui::dialogs::XFolderPicker,
-                com::sun::star::lang::XServiceInfo,
-                com::sun::star::util::XCancellable >
+    public  cppu::WeakImplHelper2<
+                com::sun::star::ui::dialogs::XFolderPicker2,
+                com::sun::star::lang::XServiceInfo >
 {
 public:
 
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index b5d3fb2..8f63748 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -300,6 +300,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/ui,\
 	WindowContentFactory \
 ))
 $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/ui/dialogs,\
+	FolderPicker \
 	Wizard \
 ))
 $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/util,\
@@ -1477,7 +1478,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/ui,\
 $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/ui/dialogs,\
 	FilePicker \
 	FilterOptionsDialog \
-	FolderPicker \
 ))
 $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/util,\
 	NumberFormatProperties \
@@ -3984,6 +3984,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/ui/dialogs,\
 	XFilterGroupManager \
 	XFilterManager \
 	XFolderPicker \
+	XFolderPicker2 \
 	XWizard \
 	XWizardController \
 	XWizardPage \
diff --git a/offapi/com/sun/star/ui/dialogs/FolderPicker.idl b/offapi/com/sun/star/ui/dialogs/FolderPicker.idl
index 16187c3..a283c60 100644
--- a/offapi/com/sun/star/ui/dialogs/FolderPicker.idl
+++ b/offapi/com/sun/star/ui/dialogs/FolderPicker.idl
@@ -20,30 +20,15 @@
 #ifndef __com_sun_star_ui_dialogs_FolderPicker_idl__
 #define __com_sun_star_ui_dialogs_FolderPicker_idl__
 
-#include <com/sun/star/lang/XComponent.idl>
-#include <com/sun/star/util/XCancellable.idl>
+#include <com/sun/star/ui/dialogs/XFolderPicker2.idl>
 
 
 module com { module sun { module star { module ui { module dialogs {
 
-
-published interface XFolderPicker;
-
 /** A FolderPicker service.
 */
 
-published service FolderPicker
-{
-    /** Provides the ability to execute a FolderPicker dialog and
-        browse for and select folders.
-    */
-    interface XFolderPicker;
-
-    /** For canceling a running dialog instance.
-        <p>This may be useful for automatic test tools for instance.</p>
-    */
-    [optional] interface com::sun::star::util::XCancellable;
-};
+published service FolderPicker : XFolderPicker2;
 
 
 }; }; }; }; };
diff --git a/offapi/com/sun/star/ui/dialogs/XFolderPicker2.idl b/offapi/com/sun/star/ui/dialogs/XFolderPicker2.idl
new file mode 100644
index 0000000..4dfec0a
--- /dev/null
+++ b/offapi/com/sun/star/ui/dialogs/XFolderPicker2.idl
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef __com_sun_star_ui_dialogs_XFolderPicker2_idl__
+#define __com_sun_star_ui_dialogs_XFolderPicker2_idl__
+
+#include <com/sun/star/ui/dialogs/XFolderPicker.idl>
+#include <com/sun/star/util/XCancellable.idl>
+
+
+module com { module sun { module star { module ui { module dialogs {
+
+
+/**
+  Provides a unified interface for the new-style FolderPicker service to implement.
+
+  @since LibreOffice 3.7
+*/
+published interface XFolderPicker2
+{
+    /** Provides the ability to execute a FolderPicker dialog and
+        browse for and select folders.
+    */
+    interface XFolderPicker;
+
+    /** For canceling a running dialog instance.
+        <p>This may be useful for automatic test tools for instance.</p>
+    */
+    interface com::sun::star::util::XCancellable;
+};
+
+
+}; }; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb
index 8a14c14..34d7172 100644
Binary files a/offapi/type_reference/types.rdb and b/offapi/type_reference/types.rdb differ
diff --git a/padmin/source/helper.cxx b/padmin/source/helper.cxx
index 3b1892c..2be6526 100644
--- a/padmin/source/helper.cxx
+++ b/padmin/source/helper.cxx
@@ -26,7 +26,7 @@
 #include <vcl/msgbox.hxx>
 #include <tools/config.hxx>
 #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 <com/sun/star/ui/dialogs/XControlAccess.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <comphelper/processfactory.hxx>
@@ -275,42 +275,36 @@ void padmin::freePadminRC()
 bool padmin::chooseDirectory( String& rInOutPath )
 {
     bool bRet = false;
-    Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
-    if( xFactory.is() )
+    Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
+    Reference< XFolderPicker2 > xFolderPicker = FolderPicker::create(xContext);;
+    Reference< XControlAccess > xCA( xFolderPicker, UNO_QUERY );
+    if( xCA.is() )
     {
-        Reference< XFolderPicker > xFolderPicker( xFactory->createInstance( OUString(  "com.sun.star.ui.dialogs.FolderPicker"  ) ), UNO_QUERY );
-        if( xFolderPicker.is() )
+        try
         {
-            Reference< XControlAccess > xCA( xFolderPicker, UNO_QUERY );
-            if( xCA.is() )
-            {
-                try
-                {
-                    Any aState;
-                    aState <<= sal_False;
-                    xCA->setControlProperty( OUString(  "HelpButton"  ),
-                                             OUString(  "Visible"  ),
-                                             aState );
+            Any aState;
+            aState <<= sal_False;
+            xCA->setControlProperty( OUString(  "HelpButton"  ),
+                                     OUString(  "Visible"  ),
+                                     aState );
 
-                }
-                catch( ... )
-                {
-                }
-            }
-            INetURLObject aObj( rInOutPath, INET_PROT_FILE, INetURLObject::ENCODE_ALL );
-            xFolderPicker->setDisplayDirectory( aObj.GetMainURL(INetURLObject::DECODE_TO_IURI) );
-            if( xFolderPicker->execute() == ExecutableDialogResults::OK )
-            {
-                aObj = INetURLObject( xFolderPicker->getDirectory() );
-                rInOutPath = aObj.PathToFileName();
-                bRet = true;
-            }
         }
+        catch( ... )
+        {
+        }
+    }
+    INetURLObject aObj( rInOutPath, INET_PROT_FILE, INetURLObject::ENCODE_ALL );
+    xFolderPicker->setDisplayDirectory( aObj.GetMainURL(INetURLObject::DECODE_TO_IURI) );
+    if( xFolderPicker->execute() == ExecutableDialogResults::OK )
+    {
+        aObj = INetURLObject( xFolderPicker->getDirectory() );
+        rInOutPath = aObj.PathToFileName();
+        bRet = true;
+    }
 #if OSL_DEBUG_LEVEL > 1
-        else
-            fprintf( stderr, "could not get FolderPicker service\n" );
+    else
+        fprintf( stderr, "could not get FolderPicker service\n" );
 #endif
-    }
     return bRet;
 }
 
diff --git a/sfx2/inc/sfx2/filedlghelper.hxx b/sfx2/inc/sfx2/filedlghelper.hxx
index 98c55b1..738f8e1 100644
--- a/sfx2/inc/sfx2/filedlghelper.hxx
+++ b/sfx2/inc/sfx2/filedlghelper.hxx
@@ -70,7 +70,6 @@ class Window;
 #define FILEDIALOG_FILTER_ALL   "*.*"
 
 #define FILE_OPEN_SERVICE_NAME      "com.sun.star.ui.dialogs.FilePicker"
-#define FOLDER_PICKER_SERVICE_NAME  "com.sun.star.ui.dialogs.FolderPicker"
 #define FILE_OPEN_SERVICE_NAME_OOO   "com.sun.star.ui.dialogs.OfficeFilePicker"
 
 namespace sfx2 {
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index ca5e0b3..01a9a8a 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -46,7 +46,7 @@
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
-#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
+#include <com/sun/star/ui/dialogs/FolderPicker.hpp>
 
 #include "doc.hrc"
 #include "templatedlg.hrc"
@@ -62,6 +62,7 @@ using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::embed;
 using namespace ::com::sun::star::frame;
 using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::ui::dialogs;
 
 static bool lcl_getServiceName (const OUString &rFileURL, OUString &rName );
@@ -838,8 +839,8 @@ void SfxTemplateManagerDlg::OnTemplateImport ()
 
 void SfxTemplateManagerDlg::OnTemplateExport()
 {
-    uno::Reference<XMultiServiceFactory> xFactory(comphelper::getProcessServiceFactory());
-    uno::Reference<XFolderPicker> xFolderPicker(xFactory->createInstance(FOLDER_PICKER_SERVICE_NAME),uno::UNO_QUERY);
+    uno::Reference<XComponentContext> xContext(comphelper::getProcessComponentContext());
+    uno::Reference<XFolderPicker2> xFolderPicker = FolderPicker::create(xContext);
 
     xFolderPicker->setDisplayDirectory(SvtPathOptions().GetWorkPath());
 
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index aa68971..7abb0fb 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -55,7 +55,7 @@
 #include <com/sun/star/util/XURLTransformer.hpp>
 #include <com/sun/star/frame/XDispatch.hpp>
 #include <com/sun/star/awt/XWindow.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/util/URLTransformer.hpp>
 #include <osl/file.hxx>
@@ -1548,8 +1548,8 @@ IMPL_LINK_NOARG(BrokenRecoveryDialog, SaveButtonHdl)
 //===============================================
 void BrokenRecoveryDialog::impl_askForSavePath()
 {
-    css::uno::Reference< css::ui::dialogs::XFolderPicker > xFolderPicker(
-        m_pCore->getSMGR()->createInstance(SERVICENAME_FOLDERPICKER), css::uno::UNO_QUERY_THROW);
+    css::uno::Reference< css::ui::dialogs::XFolderPicker2 > xFolderPicker =
+        css::ui::dialogs::FolderPicker::create(::comphelper::getComponentContext(m_pCore->getSMGR()));
 
     INetURLObject aURL(m_sSavePath, INET_PROT_FILE);
     xFolderPicker->setDisplayDirectory(aURL.GetMainURL(INetURLObject::NO_DECODE));
diff --git a/svx/source/inc/docrecovery.hxx b/svx/source/inc/docrecovery.hxx
index 3fcd9ca..e037ea4 100644
--- a/svx/source/inc/docrecovery.hxx
+++ b/svx/source/inc/docrecovery.hxx
@@ -61,7 +61,6 @@
 
 #define SERVICENAME_PROGRESSFACTORY                 rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.StatusIndicatorFactory"))
 #define SERVICENAME_RECOVERYCORE                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.AutoRecovery"         ))
-#define SERVICENAME_FOLDERPICKER                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FolderPicker"    ))
 #define SERVICENAME_DESKTOP                         rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop"              ))
 
 #define PROP_PARENTWINDOW                           rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Window"           ))
diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index 1367afc..4b60406 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -51,7 +51,7 @@
 #include <sfx2/docfile.hxx>
 #include <sfx2/docfilt.hxx>
 #include <comphelper/sequenceashashmap.hxx>
-#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
+#include <com/sun/star/ui/dialogs/FolderPicker.hpp>
 #include <com/sun/star/frame/XDispatchProvider.hpp>
 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
 #include <com/sun/star/sdbcx/XRowLocate.hpp>
@@ -782,15 +782,8 @@ IMPL_LINK_NOARG(SwMailMergeDlg, InsertPathHdl)
         sPath = aPathOpt.GetWorkPath();
     }
 
-    uno::Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
-    uno::Reference < XFolderPicker > xFP;
-    if( xMgr.is() )
-    {
-        xFP = uno::Reference< XFolderPicker >(
-                xMgr->createInstance(
-                    C2U( "com.sun.star.ui.dialogs.FolderPicker" ) ),
-                UNO_QUERY );
-    }
+    uno::Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
+    uno::Reference < XFolderPicker2 > xFP = FolderPicker::create(xContext);
     xFP->setDisplayDirectory(sPath);
     if( xFP->execute() == RET_OK )
     {
diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx
index a86fca3..3f5b37d 100644
--- a/xmlsecurity/source/dialogs/macrosecurity.cxx
+++ b/xmlsecurity/source/dialogs/macrosecurity.cxx
@@ -34,7 +34,7 @@
 #include <comphelper/processfactory.hxx>
 #include <com/sun/star/uno/Exception.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 <tools/urlobj.hxx>
 
@@ -228,9 +228,8 @@ IMPL_LINK_NOARG(MacroSecurityTrustedSourcesTP, AddLocPBHdl)
 {
     try
     {
-        rtl::OUString aService( RTL_CONSTASCII_USTRINGPARAM( FOLDER_PICKER_SERVICE_NAME ) );
-        uno::Reference < lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
-        uno::Reference < ui::dialogs::XFolderPicker > xFolderPicker( xFactory->createInstance( aService ), uno::UNO_QUERY );
+        uno::Reference < uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
+        uno::Reference < ui::dialogs::XFolderPicker2 > xFolderPicker = ui::dialogs::FolderPicker::create(xContext);
 
         short nRet = xFolderPicker->execute();
 


More information about the Libreoffice-commits mailing list