summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/uitest/uitest.hxx2
-rw-r--r--offapi/com/sun/star/ui/test/XUITest.idl2
-rw-r--r--vcl/source/uitest/uitest.cxx12
-rw-r--r--vcl/source/uitest/uno/uitest_uno.cxx9
4 files changed, 25 insertions, 0 deletions
diff --git a/include/vcl/uitest/uitest.hxx b/include/vcl/uitest/uitest.hxx
index 53a049069a14..1674ad2fd50f 100644
--- a/include/vcl/uitest/uitest.hxx
+++ b/include/vcl/uitest/uitest.hxx
@@ -24,6 +24,8 @@ public:
static void executeDialog(const OUString& rCommand);
static std::unique_ptr<UIObject> getFocusTopWindow();
+
+ static std::unique_ptr<UIObject> getFloatWindow();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/ui/test/XUITest.idl b/offapi/com/sun/star/ui/test/XUITest.idl
index 89da44c7d6e7..55f234164296 100644
--- a/offapi/com/sun/star/ui/test/XUITest.idl
+++ b/offapi/com/sun/star/ui/test/XUITest.idl
@@ -21,6 +21,8 @@ interface XUITest
void executeDialog([in] string command);
XUIObject getTopFocusWindow();
+
+ XUIObject getFloatWindow();
};
}; }; }; }; };
diff --git a/vcl/source/uitest/uitest.cxx b/vcl/source/uitest/uitest.cxx
index 413201843ced..3b19a9acc49c 100644
--- a/vcl/source/uitest/uitest.cxx
+++ b/vcl/source/uitest/uitest.cxx
@@ -49,4 +49,16 @@ std::unique_ptr<UIObject> UITest::getFocusTopWindow()
return rWinData.mpFirstFrame->GetUITestFactory()(rWinData.mpFirstFrame);
}
+std::unique_ptr<UIObject> UITest::getFloatWindow()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ ImplSVWinData& rWinData = pSVData->maWinData;
+
+ VclPtr<vcl::Window> pFloatWin = rWinData.mpFirstFloat;
+ if (pFloatWin)
+ return pFloatWin->GetUITestFactory()(pFloatWin);
+
+ return nullptr;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/uitest/uno/uitest_uno.cxx b/vcl/source/uitest/uno/uitest_uno.cxx
index c5a15a4f52ee..1d874c32c7d1 100644
--- a/vcl/source/uitest/uno/uitest_uno.cxx
+++ b/vcl/source/uitest/uno/uitest_uno.cxx
@@ -44,6 +44,8 @@ public:
css::uno::Reference<css::ui::test::XUIObject> SAL_CALL getTopFocusWindow() override;
+ css::uno::Reference<css::ui::test::XUIObject> SAL_CALL getFloatWindow() override;
+
OUString SAL_CALL getImplementationName() override;
sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
@@ -76,6 +78,13 @@ css::uno::Reference<css::ui::test::XUIObject> SAL_CALL UITestUnoObj::getTopFocus
return new UIObjectUnoObj(std::move(pObj));
}
+css::uno::Reference<css::ui::test::XUIObject> SAL_CALL UITestUnoObj::getFloatWindow()
+{
+ SolarMutexGuard aGuard;
+ std::unique_ptr<UIObject> pObj = UITest::getFloatWindow();
+ return new UIObjectUnoObj(std::move(pObj));
+}
+
OUString SAL_CALL UITestUnoObj::getImplementationName()
{
return OUString("org.libreoffice.uitest.UITest");