diff options
author | Noel Grandin <noel@peralex.com> | 2012-09-05 09:47:35 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-11 18:51:54 +0200 |
commit | 77897f5994bd18c3b771e51abce5ee6be01322fc (patch) | |
tree | 83e748eae69283ba5fde7ccc6bab32f23c34ad77 /cui | |
parent | a9b9ffacac74310c38f152cb9bcc56fe06b0e1d6 (diff) |
fdo#46808, Adapt task::PasswordContainer UNO service to new style
Create a merged XPasswordContainer2 interface for this service to implement.
Which is backwards-compatible, but does not require creating a new service.
Change-Id: I245b566b43e4646f10914b0aee13b2a0b0e296ae
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optinet2.cxx | 16 | ||||
-rw-r--r-- | cui/source/options/webconninfo.cxx | 16 |
2 files changed, 11 insertions, 21 deletions
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index 51ba59543806..7202ce06ad77 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -94,6 +94,7 @@ #include "com/sun/star/ui/dialogs/TemplateDescription.hpp" #include "com/sun/star/task/XMasterPasswordHandling2.hpp" +#include "com/sun/star/task/PasswordContainer.hpp" #include "com/sun/star/task/XPasswordContainer.hpp" #include "securityoptions.hxx" #include "webconninfo.hxx" @@ -709,8 +710,7 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, SavePasswordHdl) try { Reference< task::XMasterPasswordHandling > xMasterPasswd( - comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.PasswordContainer" ) ) ), + task::PasswordContainer::create(comphelper::getProcessComponentContext()), UNO_QUERY_THROW ); if ( maSavePasswordsCB.IsChecked() ) @@ -766,8 +766,7 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, MasterPasswordHdl) try { Reference< task::XMasterPasswordHandling > xMasterPasswd( - comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.PasswordContainer" ) ) ), + task::PasswordContainer::create(comphelper::getProcessComponentContext()), UNO_QUERY ); if ( xMasterPasswd.is() && xMasterPasswd->isPersistentStoringAllowed() ) @@ -784,8 +783,7 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, MasterPasswordCBHdl) try { Reference< task::XMasterPasswordHandling2 > xMasterPasswd( - comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.PasswordContainer" ) ) ), + task::PasswordContainer::create(comphelper::getProcessComponentContext()), UNO_QUERY_THROW ); if ( maMasterPasswordCB.IsChecked() ) @@ -830,8 +828,7 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, ShowPasswordsHdl) try { Reference< task::XMasterPasswordHandling > xMasterPasswd( - comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.PasswordContainer" ) ) ), + task::PasswordContainer::create(comphelper::getProcessComponentContext()), UNO_QUERY ); if ( xMasterPasswd.is() && xMasterPasswd->isPersistentStoringAllowed() && xMasterPasswd->authorizateWithMasterPassword( Reference< task::XInteractionHandler>() ) ) @@ -966,8 +963,7 @@ void SvxSecurityTabPage::InitControls() try { Reference< task::XMasterPasswordHandling > xMasterPasswd( - comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.PasswordContainer" ) ) ), + task::PasswordContainer::create(comphelper::getProcessComponentContext()), UNO_QUERY_THROW ); if ( xMasterPasswd->isPersistentStoringAllowed() ) diff --git a/cui/source/options/webconninfo.cxx b/cui/source/options/webconninfo.cxx index 0f43f19cb069..198d1fc4d578 100644 --- a/cui/source/options/webconninfo.cxx +++ b/cui/source/options/webconninfo.cxx @@ -30,6 +30,7 @@ #include <cuires.hrc> #include <sal/macros.h> #include <com/sun/star/task/UrlRecord.hpp> +#include <com/sun/star/task/PasswordContainer.hpp> #include <com/sun/star/task/XPasswordContainer.hpp> #include <com/sun/star/task/XMasterPasswordHandling.hpp> #include "com/sun/star/task/XUrlContainer.hpp" @@ -183,8 +184,7 @@ void WebConnectionInfoDialog::FillPasswordList() try { uno::Reference< task::XMasterPasswordHandling > xMasterPasswd( - comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.PasswordContainer" ) ) ), + task::PasswordContainer::create(comphelper::getProcessComponentContext()), uno::UNO_QUERY ); if ( xMasterPasswd.is() && xMasterPasswd->isPersistentStoringAllowed() ) @@ -244,9 +244,7 @@ IMPL_LINK_NOARG(WebConnectionInfoDialog, RemovePasswordHdl) ::rtl::OUString aUserName = m_aPasswordsLB.GetEntryText( pEntry, 1 ); uno::Reference< task::XPasswordContainer > xPasswdContainer( - comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.task.PasswordContainer" ) ) ), + task::PasswordContainer::create(comphelper::getProcessComponentContext()), uno::UNO_QUERY_THROW ); sal_Int32 nPos = (sal_Int32)(sal_IntPtr)pEntry->GetUserData(); @@ -275,9 +273,7 @@ IMPL_LINK_NOARG(WebConnectionInfoDialog, RemoveAllPasswordsHdl) try { uno::Reference< task::XPasswordContainer > xPasswdContainer( - comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.task.PasswordContainer" ) ) ), + task::PasswordContainer::create(comphelper::getProcessComponentContext()), uno::UNO_QUERY_THROW ); // should the master password be requested before? @@ -327,9 +323,7 @@ IMPL_LINK_NOARG(WebConnectionInfoDialog, ChangePasswordHdl) aPasswd[0] = aNewPass; uno::Reference< task::XPasswordContainer > xPasswdContainer( - comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.task.PasswordContainer" ) ) ), + task::PasswordContainer::create(comphelper::getProcessComponentContext()), uno::UNO_QUERY_THROW ); xPasswdContainer->addPersistent( aURL, aUserName, aPasswd, xInteractionHandler ); |