summaryrefslogtreecommitdiff
path: root/cui/source/options/webconninfo.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-09-11 19:09:24 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-09-11 19:09:24 +0200
commit8963c350986fc57cb0cf98387d7bd1c7bf6420a1 (patch)
tree6fc8a0b83e9406bfaac91a0026466a94d28e8624 /cui/source/options/webconninfo.cxx
parent77897f5994bd18c3b771e51abce5ee6be01322fc (diff)
Improvement on previous commit
Change-Id: I10984b6ac4128ad46f512dade0f4e0084d0b9348
Diffstat (limited to 'cui/source/options/webconninfo.cxx')
-rw-r--r--cui/source/options/webconninfo.cxx46
1 files changed, 16 insertions, 30 deletions
diff --git a/cui/source/options/webconninfo.cxx b/cui/source/options/webconninfo.cxx
index 198d1fc4d578..0bfdd2527cbf 100644
--- a/cui/source/options/webconninfo.cxx
+++ b/cui/source/options/webconninfo.cxx
@@ -29,11 +29,9 @@
#include <dialmgr.hxx>
#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"
+#include <com/sun/star/task/UrlRecord.hpp>
+#include <com/sun/star/task/XPasswordContainer2.hpp>
#include <comphelper/processfactory.hxx>
#include <comphelper/docpasswordrequest.hxx>
#include "webconninfo.hxx"
@@ -183,19 +181,17 @@ void WebConnectionInfoDialog::FillPasswordList()
{
try
{
- uno::Reference< task::XMasterPasswordHandling > xMasterPasswd(
- task::PasswordContainer::create(comphelper::getProcessComponentContext()),
- uno::UNO_QUERY );
+ uno::Reference< task::XPasswordContainer2 > xMasterPasswd(
+ task::PasswordContainer::create(comphelper::getProcessComponentContext()));
- if ( xMasterPasswd.is() && xMasterPasswd->isPersistentStoringAllowed() )
+ if ( xMasterPasswd->isPersistentStoringAllowed() )
{
- uno::Reference< task::XPasswordContainer > xPasswdContainer( xMasterPasswd, uno::UNO_QUERY_THROW );
uno::Reference< task::XInteractionHandler > xInteractionHandler(
comphelper::getProcessServiceFactory()->createInstance(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.InteractionHandler" ) ) ),
uno::UNO_QUERY_THROW );
- uno::Sequence< task::UrlRecord > aURLEntries = xPasswdContainer->getAllPersistent( xInteractionHandler );
+ uno::Sequence< task::UrlRecord > aURLEntries = xMasterPasswd->getAllPersistent( xInteractionHandler );
sal_Int32 nCount = 0;
for ( sal_Int32 nURLInd = 0; nURLInd < aURLEntries.getLength(); nURLInd++ )
{
@@ -212,11 +208,8 @@ void WebConnectionInfoDialog::FillPasswordList()
// remember pos of first url container entry.
m_nPos = nCount;
- uno::Reference< task::XUrlContainer > xUrlContainer(
- xPasswdContainer, uno::UNO_QUERY_THROW );
-
uno::Sequence< rtl::OUString > aUrls
- = xUrlContainer->getUrls( sal_True /* OnlyPersistent */ );
+ = xMasterPasswd->getUrls( sal_True /* OnlyPersistent */ );
for ( sal_Int32 nURLIdx = 0; nURLIdx < aUrls.getLength(); nURLIdx++ )
{
@@ -243,9 +236,8 @@ IMPL_LINK_NOARG(WebConnectionInfoDialog, RemovePasswordHdl)
::rtl::OUString aURL = m_aPasswordsLB.GetEntryText( pEntry, 0 );
::rtl::OUString aUserName = m_aPasswordsLB.GetEntryText( pEntry, 1 );
- uno::Reference< task::XPasswordContainer > xPasswdContainer(
- task::PasswordContainer::create(comphelper::getProcessComponentContext()),
- uno::UNO_QUERY_THROW );
+ uno::Reference< task::XPasswordContainer2 > xPasswdContainer(
+ task::PasswordContainer::create(comphelper::getProcessComponentContext()));
sal_Int32 nPos = (sal_Int32)(sal_IntPtr)pEntry->GetUserData();
if ( nPos < m_nPos )
@@ -254,9 +246,7 @@ IMPL_LINK_NOARG(WebConnectionInfoDialog, RemovePasswordHdl)
}
else
{
- uno::Reference< task::XUrlContainer > xUrlContainer(
- xPasswdContainer, uno::UNO_QUERY_THROW );
- xUrlContainer->removeUrl( aURL );
+ xPasswdContainer->removeUrl( aURL );
}
m_aPasswordsLB.RemoveEntry( pEntry );
}
@@ -272,19 +262,16 @@ IMPL_LINK_NOARG(WebConnectionInfoDialog, RemoveAllPasswordsHdl)
{
try
{
- uno::Reference< task::XPasswordContainer > xPasswdContainer(
- task::PasswordContainer::create(comphelper::getProcessComponentContext()),
- uno::UNO_QUERY_THROW );
+ uno::Reference< task::XPasswordContainer2 > xPasswdContainer(
+ task::PasswordContainer::create(comphelper::getProcessComponentContext()));
// should the master password be requested before?
xPasswdContainer->removeAllPersistent();
- uno::Reference< task::XUrlContainer > xUrlContainer(
- xPasswdContainer, uno::UNO_QUERY_THROW );
uno::Sequence< rtl::OUString > aUrls
- = xUrlContainer->getUrls( sal_True /* OnlyPersistent */ );
+ = xPasswdContainer->getUrls( sal_True /* OnlyPersistent */ );
for ( sal_Int32 nURLIdx = 0; nURLIdx < aUrls.getLength(); nURLIdx++ )
- xUrlContainer->removeUrl( aUrls[ nURLIdx ] );
+ xPasswdContainer->removeUrl( aUrls[ nURLIdx ] );
m_aPasswordsLB.Clear();
}
@@ -322,9 +309,8 @@ IMPL_LINK_NOARG(WebConnectionInfoDialog, ChangePasswordHdl)
uno::Sequence< ::rtl::OUString > aPasswd( 1 );
aPasswd[0] = aNewPass;
- uno::Reference< task::XPasswordContainer > xPasswdContainer(
- task::PasswordContainer::create(comphelper::getProcessComponentContext()),
- uno::UNO_QUERY_THROW );
+ uno::Reference< task::XPasswordContainer2 > xPasswdContainer(
+ task::PasswordContainer::create(comphelper::getProcessComponentContext()));
xPasswdContainer->addPersistent(
aURL, aUserName, aPasswd, xInteractionHandler );
}