From 0ee2cddfbd9cc710371048df560e397d6881d69b Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 27 Nov 2013 11:35:17 +0100 Subject: Properly encapsulate svt::TextWindowPeer Change-Id: Iffa67c345a03852ad7872031b4c5a87e223ffcad --- svtools/source/edit/textwindowpeer.cxx | 64 +++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 20 deletions(-) (limited to 'svtools') diff --git a/svtools/source/edit/textwindowpeer.cxx b/svtools/source/edit/textwindowpeer.cxx index 11fa8c9eb38c..6e0a8b7d0aca 100644 --- a/svtools/source/edit/textwindowpeer.cxx +++ b/svtools/source/edit/textwindowpeer.cxx @@ -17,31 +17,55 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include +#include + +#include +#include +#include +#include +#include #include +#include +#include #include -#include "svtaccessiblefactory.hxx" -namespace svt +namespace { + +class TextWindowPeer: public VCLXWindow, private boost::noncopyable { +public: + explicit TextWindowPeer(TextView & view); + + virtual ~TextWindowPeer() {} + +private: + virtual css::uno::Reference + CreateAccessibleContext(); + + TextEngine & m_rEngine; + TextView & m_rView; + svt::AccessibleFactoryAccess m_aFactoryAccess; +}; + +TextWindowPeer::TextWindowPeer(TextView & view): + m_rEngine(*view.GetTextEngine()), m_rView(view) +{ + SetWindow(view.GetWindow()); +} + +css::uno::Reference +TextWindowPeer::CreateAccessibleContext() { + return m_aFactoryAccess.getFactory().createAccessibleTextWindowContext( + this, m_rEngine, m_rView); +} + +} + +css::uno::Reference svt::createTextWindowPeer( + TextView & view) { - TextWindowPeer::TextWindowPeer(::TextView & rView): - m_rEngine(*rView.GetTextEngine()), m_rView(rView) - { - SetWindow(rView.GetWindow()); - m_pFactoryAccess.reset( new AccessibleFactoryAccess ); - } - - // virtual - TextWindowPeer::~TextWindowPeer() - { - } - - css::uno::Reference< css::accessibility::XAccessibleContext > TextWindowPeer::CreateAccessibleContext() - { - return m_pFactoryAccess->getFactory().createAccessibleTextWindowContext( - this, m_rEngine, m_rView - ); - } + return new TextWindowPeer(view); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit