diff options
author | Eike Rathke <erack@redhat.com> | 2018-07-10 11:13:57 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-07-12 13:44:38 +0200 |
commit | 172817aa670ff923780d0159c4416871179fa94c (patch) | |
tree | 4bfa044baec4c0818d29212b72799f50a52c2e40 | |
parent | 37a27823ad181387943a3193236f2cca6d3ec0d6 (diff) |
Resolves: tdf#115950 proper double click return and bail out, tdf#117063
commit b649ce123dea372359ec571135a68eb3de844e5b
CommitDate: Sun Apr 29 08:46:46 2018 +0200
tdf#117063 Modify tree list double click behavior in the navigator
changed the return value in SvTreeListBox::DoubleClickHdl() from
return !aDoubleClickHdl.IsSet() || aDoubleClickHdl.Call(this);
to an unconditional true. Earlier there was
commit 1b9af08481b8f7f4bd15a30508606dff56b8e74f
CommitDate: Tue Mar 13 16:28:40 2018 +0100
tdf#116334: Actually when there is no handler, we have to return 'true'.
- aDoubleClickHdl.Call( this );
- return false;
+ return !aDoubleClickHdl.IsSet() || aDoubleClickHdl.Call(this);
and before that
commit 7651e57573952758032ceb88f16e2dbbb6cc4e18
CommitDate: Thu Mar 1 15:41:13 2018 +0100
tdf#115950: Indicate that the dialog was already destroyed.
- return true;
+ return false;
Neither a constant false or true are correct return values here,
but only the value the double click handler, if any, returned to
indicate whether processing should continue (true) or not (false).
If handlers don't return a proper value so the intended behaviour
for tdf#117063 or anything else does not work then fix the
handlers instead.
If the handler returned false then don't even attempt to access
anything in SvImpLBox::MouseButtonDown() because an OK handler may
have destroyed everything and all is rotten.
Change-Id: Ia90c21288bedd7e5078dbe4b3dd6d9f5199a2a98
Reviewed-on: https://gerrit.libreoffice.org/57225
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-by: Eike Rathke <erack@redhat.com>
(cherry picked from commit c9d1655d455ad783694e6d7f0d2e6cf3d0d0acae)
Reviewed-on: https://gerrit.libreoffice.org/57324
-rw-r--r-- | svtools/source/contnr/svimpbox.cxx | 8 | ||||
-rw-r--r-- | svtools/source/contnr/treelistbox.cxx | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index b53b403c80f1..52d1f9a47f59 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -2019,7 +2019,13 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt ) { nFlags &= (~LBoxFlags::StartEditTimer); pView->pHdlEntry = pEntry; - if( pView->DoubleClickHdl() ) + if( !pView->DoubleClickHdl() ) + { + // Handler signals nothing to be done anymore, bail out, 'this' may + // even be dead and destroyed. + return; + } + else { // if the entry was deleted within the handler pEntry = GetClickedEntry( aPos ); diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index c236e432e227..8ae4c745e170 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -426,8 +426,7 @@ void SvTreeListBox::DeselectHdl() bool SvTreeListBox::DoubleClickHdl() { - aDoubleClickHdl.Call( this ); - return true; + return !aDoubleClickHdl.IsSet() || aDoubleClickHdl.Call(this); } |