summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorColomban Wendling <cwendling@hypra.fr>2023-02-07 16:32:22 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2023-03-03 10:58:05 +0000
commit8a449f2de0d926967331436adfd3d5dd0b9e2db8 (patch)
tree5be1c28898bdda5dd51c8af669283f45c12eb3f0 /include
parent655f6164e38c2f675beb5272fc6a9780f4767429 (diff)
test: Use css::awt::XExtentdedToolkit::addTopWindowListener()
Use awt::XExtentdedToolkit::addTopWindowListener() instead of Application::AddEventListener() for lower dependency on vcl::Window. We however still require some vcl::Window for EventPosterHelper to work without which we cannot post events to the dialog. It however doesn't really have to be the top-level window itself, any vcl::Window high enough the event tree would probably work. Change-Id: I40b56a6c9e45f4e2ef2cab27a735856baef7e3c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146634 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'include')
-rw-r--r--include/test/a11y/accessibletestbase.hxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/test/a11y/accessibletestbase.hxx b/include/test/a11y/accessibletestbase.hxx
index 5f5fb54aff4b..1445d0eb4737 100644
--- a/include/test/a11y/accessibletestbase.hxx
+++ b/include/test/a11y/accessibletestbase.hxx
@@ -18,6 +18,7 @@
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/accessibility/XAccessibleAction.hpp>
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include <com/sun/star/awt/XDialog2.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/lang/XComponent.hpp>
@@ -181,23 +182,25 @@ protected:
const EventPosterHelperBase* pEventPosterHelper = nullptr);
/* Dialog handling */
- class Dialog : public test::EventPosterHelper
+ class Dialog : public test::AccessibleEventPosterHelper
{
private:
bool mbAutoClose;
+ css::uno::Reference<css::awt::XDialog2> mxDialog2;
+ css::uno::Reference<css::accessibility::XAccessible> mxAccessible;
public:
- Dialog(vcl::Window* pWindow, bool bAutoClose = true);
+ Dialog(css::uno::Reference<css::awt::XDialog2>& xDialog2, bool bAutoClose = true);
virtual ~Dialog();
void setAutoClose(bool bAutoClose) { mbAutoClose = bAutoClose; }
css::uno::Reference<css::accessibility::XAccessible> getAccessible() const
{
- return mxWindow ? mxWindow->GetAccessible() : nullptr;
+ return mxAccessible;
}
- bool close(sal_Int32 result = VclResponseType::RET_CANCEL);
+ void close(sal_Int32 result = VclResponseType::RET_CANCEL);
css::uno::Reference<css::accessibility::XAccessibleContext>
tabTo(const sal_Int16 role, const std::u16string_view name)