summaryrefslogtreecommitdiff
path: root/uui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-07-29 10:08:25 +0100
committerAndras Timar <andras.timar@collabora.com>2016-08-15 10:25:45 +0200
commit613d8f32f0f8810e64c1308a0af0239421f9f8ce (patch)
tree2e2a259f6b4e6a343ba5d073ad2995af52f3cf41 /uui
parent8889345f04d82efafcc92f961901d4227d3067ee (diff)
VclPtr: password prompts never dispose
Change-Id: I917e5457be6de152b39e91ad41b6ed196dfe3e45 (cherry picked from commit 4b73aff7d2e4af7d3a1359df52133cd2c59058c5) Reviewed-on: https://gerrit.libreoffice.org/27676 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> (cherry picked from commit c0af6d6dac1f0b9d99d7ecec92e4f3377979a475)
Diffstat (limited to 'uui')
-rw-r--r--uui/source/iahndl-authentication.cxx26
1 files changed, 12 insertions, 14 deletions
diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx
index a58a0be5978f..ac0f036c9c47 100644
--- a/uui/source/iahndl-authentication.cxx
+++ b/uui/source/iahndl-authentication.cxx
@@ -516,13 +516,12 @@ executePasswordDialog(
{
if (bIsSimplePasswordRequest)
{
- VclPtr< PasswordDialog > pDialog(
- VclPtr<PasswordDialog>::Create( pParent, nMode, xManager.get(), aDocName,
- bIsPasswordToModify, bIsSimplePasswordRequest ) );
- pDialog->SetMinLen(0);
+ ScopedVclPtrInstance<PasswordDialog> xDialog(pParent, nMode, xManager.get(), aDocName,
+ bIsPasswordToModify, bIsSimplePasswordRequest);
+ xDialog->SetMinLen(0);
- rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL );
- rInfo.SetPassword( pDialog->GetPassword() );
+ rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL);
+ rInfo.SetPassword(xDialog->GetPassword());
}
else
{
@@ -540,14 +539,13 @@ executePasswordDialog(
}
else // enter password or reenter password
{
- VclPtr< PasswordDialog > pDialog(
- VclPtr<PasswordDialog>::Create( pParent, nMode, xManager.get(), aDocName,
- bIsPasswordToModify, bIsSimplePasswordRequest ) );
- pDialog->SetMinLen(0);
-
- rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL );
- rInfo.SetPassword( bIsPasswordToModify ? OUString() : pDialog->GetPassword() );
- rInfo.SetPasswordToModify( bIsPasswordToModify ? pDialog->GetPassword() : OUString() );
+ ScopedVclPtrInstance<PasswordDialog> xDialog(pParent, nMode, xManager.get(), aDocName,
+ bIsPasswordToModify, bIsSimplePasswordRequest);
+ xDialog->SetMinLen(0);
+
+ rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL);
+ rInfo.SetPassword(bIsPasswordToModify ? OUString() : xDialog->GetPassword());
+ rInfo.SetPasswordToModify(bIsPasswordToModify ? xDialog->GetPassword() : OUString());
}
}
catch (std::bad_alloc const &)