[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - vcl/source

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Sat Sep 28 07:25:17 UTC 2019


 vcl/source/control/button.cxx |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit f5308a09498cde2fc6ab039e17649c5b3ea33e54
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Fri Sep 27 22:02:06 2019 +0100
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Sat Sep 28 09:24:41 2019 +0200

    Hold reference on parent dialog while emitting EndDialog.
    
    Also cleanup the code.
    
    Change-Id: I5f9d562319dc244ee22feb2e3fd64023bc229c4e
    Reviewed-on: https://gerrit.libreoffice.org/79771
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 4fcd195ae535..c90a280639f6 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1737,13 +1737,14 @@ void OKButton::Click()
         {
             if ( pParent->IsDialog() )
             {
-                if ( static_cast<Dialog*>(pParent)->IsInExecute() )
-                    static_cast<Dialog*>(pParent)->EndDialog( RET_OK );
+                VclPtr<Dialog> xParent( static_cast<Dialog*>(pParent) );
+                if ( xParent->IsInExecute() )
+                    xParent->EndDialog( RET_OK );
                 // prevent recursive calls
-                else if ( !static_cast<Dialog*>(pParent)->IsInClose() )
+                else if ( !xParent->IsInClose() )
                 {
                     if ( pParent->GetStyle() & WB_CLOSEABLE )
-                        static_cast<Dialog*>(pParent)->Close();
+                        xParent->Close();
                 }
             }
             else


More information about the Libreoffice-commits mailing list