diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-12-09 07:39:58 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-06-18 16:59:48 +0200 |
commit | af5b0086239b2d0e33b4dcc5b7d401a0e1fc6a70 (patch) | |
tree | 3805325e403ada8d34764648d92768c234a218be | |
parent | 909d87cc6187ecffa2704e67ffbe372fd2d90e49 (diff) |
uitest: store the id of each vcl::Window
We will use the ID in the UI testing to identify the widget.
Change-Id: I4dd79a02355e1de40f3c2ddc6a61a805b4e30778
-rw-r--r-- | include/vcl/window.hxx | 10 | ||||
-rw-r--r-- | vcl/inc/window.h | 1 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 1 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 10 |
4 files changed, 22 insertions, 0 deletions
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 86ff2b76b905..933e490e2684 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -1544,6 +1544,16 @@ public: */ void reorderWithinParent(sal_uInt16 nNewPosition); + /** + * Sets an ID. + */ + void set_id(const OUString& rID); + + /** + * Get the ID of the window. + */ + const OUString& get_id() const; + // Native Widget Rendering functions diff --git a/vcl/inc/window.h b/vcl/inc/window.h index be5f0a91a9f5..b14806df1c7d 100644 --- a/vcl/inc/window.h +++ b/vcl/inc/window.h @@ -234,6 +234,7 @@ public: OString maHelpId; OUString maHelpText; OUString maQuickHelpText; + OUString maID; InputContext maInputContext; css::uno::Reference< css::awt::XWindowPeer > mxWindowPeer; css::uno::Reference< css::accessibility::XAccessible > mxAccessible; diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index f7cb3d0a6a10..ef1ae306517d 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -1851,6 +1851,7 @@ VclPtr<vcl::Window> VclBuilder::insertObject(vcl::Window *pParent, const OString if (pCurrentChild) { + pCurrentChild->set_id(OStringToOUString(rID, RTL_TEXTENCODING_UTF8)); if (pCurrentChild == m_pParent.get() && m_bToplevelHasDeferredProperties) m_aDeferredProperties = rProps; else diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 63df1d3a21ec..1d897d745543 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -3769,6 +3769,16 @@ bool Window::CompatNotify( NotifyEvent& rNEvt ) return Notify( rNEvt ); } +void Window::set_id(const OUString& rID) +{ + mpWindowImpl->maID = rID; +} + +const OUString& Window::get_id() const +{ + return mpWindowImpl->maID; +} + } /* namespace vcl */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |