diff options
author | Noel Grandin <noel@peralex.com> | 2013-03-05 14:17:14 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-03-07 08:23:41 +0200 |
commit | 30caf94d816dfcf9a5bc8cb5198c977d7021c369 (patch) | |
tree | 11e0d97b0dbe3d1ee2aeebf8107766c1dd6799fc /sfx2 | |
parent | c98a1fa04884c7fa34dfeb5e2eae706e57c09123 (diff) |
fdo#46808, Convert ui::dialogs::AddressBookSourceDialog to new style
The service already existed, it just needed an IDL file.
Change-Id: I6b9a5a5fd02985bfdd29bb42f032265d0b5498c7
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 97ebdc494208..55d74f354adb 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -17,27 +17,27 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <com/sun/star/uno/Reference.hxx> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/lang/IllegalArgumentException.hpp> +#include <com/sun/star/document/XEmbeddedScripts.hpp> +#include <com/sun/star/embed/XStorage.hpp> +#include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/DispatchResultEvent.hpp> #include <com/sun/star/frame/DispatchResultState.hpp> -#include <com/sun/star/task/XJobExecutor.hpp> -#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/frame/DispatchHelper.hpp> #include <com/sun/star/frame/XDesktop.hpp> #include <com/sun/star/frame/XFramesSupplier.hpp> -#include <com/sun/star/util/XCloseable.hpp> -#include <com/sun/star/util/CloseVetoException.hpp> #include <com/sun/star/frame/XLayoutManager.hpp> -#include <com/sun/star/document/XEmbeddedScripts.hpp> -#include <com/sun/star/embed/XStorage.hpp> -#include <com/sun/star/embed/ElementModes.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/lang/IllegalArgumentException.hpp> +#include <com/sun/star/sdbc/DriverManager.hpp> #include <com/sun/star/system/SystemShellExecute.hpp> #include <com/sun/star/system/SystemShellExecuteFlags.hpp> #include <com/sun/star/system/SystemShellExecuteException.hpp> -#include <com/sun/star/sdbc/DriverManager.hpp> +#include <com/sun/star/task/XJobExecutor.hpp> +#include <com/sun/star/ui/dialogs/AddressBookSourcePilot.hpp> +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/util/XCloseable.hpp> +#include <com/sun/star/util/CloseVetoException.hpp> #include <org/freedesktop/PackageKit/SyncDbusSessionHelper.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> @@ -602,7 +602,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) case SID_TEMPLATE_ADDRESSBOKSOURCE: { - svt::AddressBookSourceDialog aDialog(GetTopWindow(), ::comphelper::getProcessServiceFactory()); + svt::AddressBookSourceDialog aDialog(GetTopWindow(), ::comphelper::getProcessComponentContext()); aDialog.Execute(); bDone = true; break; @@ -1428,20 +1428,16 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) case SID_ADDRESS_DATA_SOURCE: { - ::rtl::OUString sDialogServiceName( "com.sun.star.ui.dialogs.AddressBookSourcePilot" ); try { - Reference< com::sun::star::lang::XMultiServiceFactory > xORB = ::comphelper::getProcessServiceFactory(); - Reference< com::sun::star::ui::dialogs::XExecutableDialog > xDialog; - if (xORB.is()) - xDialog = Reference< com::sun::star::ui::dialogs::XExecutableDialog >(xORB->createInstance(sDialogServiceName), UNO_QUERY); - if (xDialog.is()) - xDialog->execute(); - else - ShowServiceNotAvailableError(NULL, sDialogServiceName, sal_True); + Reference< uno::XComponentContext > xORB = ::comphelper::getProcessComponentContext(); + Reference< ui::dialogs::XExecutableDialog > xDialog; + xDialog = ui::dialogs::AddressBookSourcePilot::createWithParent(xORB, 0); + xDialog->execute(); } - catch(::com::sun::star::uno::Exception&) + catch(const ::com::sun::star::uno::Exception&) { + DBG_UNHANDLED_EXCEPTION(); } } break; |