[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - uui/source

Caolán McNamara caolanm at redhat.com
Sat Jul 30 21:36:51 UTC 2016


 uui/source/iahndl-authentication.cxx |   26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

New commits:
commit 9a458d4cd3c2af37d5c3768ff672f4d069a7c61f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jul 29 10:08:25 2016 +0100

    VclPtr: password prompts never dispose
    
    Change-Id: I917e5457be6de152b39e91ad41b6ed196dfe3e45
    (cherry picked from commit 4b73aff7d2e4af7d3a1359df52133cd2c59058c5)
    Reviewed-on: https://gerrit.libreoffice.org/27675
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx
index 9855df9..a0a0377 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 &)


More information about the Libreoffice-commits mailing list