[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - vcl/source
Michael Meeks (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jul 14 20:56:16 UTC 2021
vcl/source/uitest/uiobject.cxx | 2 +-
vcl/source/window/window.cxx | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 7fc110d776caa32e7209880d19aab45e3f1b46ba
Author: Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Fri Jul 9 15:14:50 2021 +0100
Commit: Michael Meeks <michael.meeks at collabora.com>
CommitDate: Wed Jul 14 22:55:40 2021 +0200
vcl: make get_id safe for disposed windows; avoid unsafe use as well.
crash from:
findChild(vcl::Window*, rtl::OUString const&, bool) include/rtl/ustring.hxx:1744
WindowUIObject::get_visible_child(rtl::OUString const&) /vcl/source/uitest/uiobject.cxx:463
lcl_sendDialogEvent ...
Change-Id: Ic1756c7b03f2dee9780fb1a735917f1d0fc11876
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118690
Tested-by: Michael Meeks <michael.meeks at collabora.com>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx
index c10cc5f21d9d..08e2dc01fb9c 100644
--- a/vcl/source/uitest/uiobject.cxx
+++ b/vcl/source/uitest/uiobject.cxx
@@ -395,7 +395,7 @@ vcl::Window* findChild(vcl::Window* pParent, const OUString& rID, bool bRequireV
for (size_t i = 0; i < nCount; ++i)
{
vcl::Window* pChild = pParent->GetChild(i);
- if (pChild && pChild->get_id() == rID
+ if (pChild && !pChild->isDisposed() && pChild->get_id() == rID
&& (!bRequireVisible || pChild->IsVisible()))
return pChild;
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 0143bf85ee2f..60160d46b71a 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3889,7 +3889,10 @@ void Window::set_id(const OUString& rID)
const OUString& Window::get_id() const
{
- return mpWindowImpl->maID;
+ if (mpWindowImpl)
+ return mpWindowImpl->maID;
+ static OUString empty;
+ return empty;
}
FactoryFunction Window::GetUITestFactory() const
More information about the Libreoffice-commits
mailing list