From a89b221afe2d2d8aa670236fce6e95022ffa1cd9 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 26 Jul 2022 12:12:49 +0200 Subject: tdf#150017 vcl,sw: add UITest Unfortunately i couldn't figure out how to send keyboard input to the Edit widget in the SvTreeListBox; it's created by SvTreeListBox::EditText() and shows up when calling dumpHierarchy() on the DialogUIObject as a child of the SvTreeListBox/"19LclHeaderTabListBox" but the execute() doesn't send it events, neither when called on DialogUIObject nor on TreeListUIObject. So forward explicitly in TreeListUIObject::execute() - probably not the best way to do this? When using the UI, events arrive like this: 0 SvInplaceEdit2::KeyInput(KeyEvent const&) at vcl/source/treelist/treelistbox.cxx:202 1 (anonymous namespace)::MyEdit_Impl::KeyInput(KeyEvent const&) at vcl/source/treelist/treelistbox.cxx:117 2 ImplHandleKey(vcl::Window*, MouseNotifyEvent, sal_uInt16, sal_uInt16, sal_uInt16, bool) (pWindow=0x6dc4bc0, nSVEvent=MouseNotifyEvent::KEYINPUT, nKeyCode=1026, nCharCode=0, nRepeat=0, bForward=true) at vcl/source/window/winproc.cxx:1209 3 ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) at vcl/source/window/winproc.cxx:2672 4 SalFrame::CallCallback(SalEvent, void const*) const (this=0x8a19fb0, nEvent=SalEvent::KeyInput, pEvent=0x7ffc7f3639a0) at vcl/inc/salframe.hxx:306 5 X11SalFrame::HandleKeyEvent(XKeyEvent*) at vcl/unx/generic/window/salframe.cxx:3190 Change-Id: I0be42330aeef98ef09e21297acef6cf616b7f2d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137459 Tested-by: Jenkins Reviewed-by: Michael Stahl --- include/vcl/toolkit/treelistbox.hxx | 1 + 1 file changed, 1 insertion(+) (limited to 'include/vcl/toolkit') diff --git a/include/vcl/toolkit/treelistbox.hxx b/include/vcl/toolkit/treelistbox.hxx index 355b6343de20..62bee8ea976e 100644 --- a/include/vcl/toolkit/treelistbox.hxx +++ b/include/vcl/toolkit/treelistbox.hxx @@ -392,6 +392,7 @@ public: SvViewDataItem* GetViewDataItem(SvTreeListEntry const *, SvLBoxItem const *); const SvViewDataItem* GetViewDataItem(const SvTreeListEntry*, const SvLBoxItem*) const; + VclPtr GetEditWidget() const; // for UITest bool IsInplaceEditingEnabled() const { return bool(nImpFlags & SvTreeListBoxFlags::EDT_ENABLED); } bool IsEditingActive() const { return bool(nImpFlags & SvTreeListBoxFlags::IN_EDT); } void EndEditing( bool bCancel = false ); -- cgit