diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 76b717f88cee..fee2d61a2539 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -2102,7 +2102,7 @@ EditorWindow::GetComponentInterface(sal_Bool bCreate) if (!pEditEngine) CreateEditEngine(); - xPeer = new ::svt::TextWindowPeer(*GetEditView()); + xPeer = svt::createTextWindowPeer(*GetEditView()); SetComponentInterface(xPeer); } return xPeer; diff --git a/include/svtools/textwindowpeer.hxx b/include/svtools/textwindowpeer.hxx index 14ef753c3f5a..7da6b83d2ef6 100644 --- a/include/svtools/textwindowpeer.hxx +++ b/include/svtools/textwindowpeer.hxx @@ -20,45 +20,24 @@ #ifndef INCLUDED_SVTOOLS_TEXTWINDOWPEER_HXX #define INCLUDED_SVTOOLS_TEXTWINDOWPEER_HXX +#include + +#include +#include #include -#include -#include - -class TextEngine; +namespace com { namespace sun { namespace star { namespace awt { + class XWindowPeer; +} } } } class TextView; -namespace svt -{ - class AccessibleFactoryAccess ; +namespace svt { -class TextWindowPeer: public ::VCLXWindow -{ -public: - SVT_DLLPUBLIC TextWindowPeer(::TextView & rView); - - virtual ~TextWindowPeer(); - -private: - // VCLXWindow inherits funny copy constructor and assignment operator from - // ::cppu::OWeakObject, so override them here: - - TextWindowPeer(TextWindowPeer &); // not implemented - - void operator =(TextWindowPeer); // not implemented - - virtual ::com::sun::star::uno::Reference< - ::com::sun::star::accessibility::XAccessibleContext > - CreateAccessibleContext(); - - ::TextEngine & m_rEngine; - ::TextView & m_rView; - - ::std::auto_ptr< ::svt::AccessibleFactoryAccess > m_pFactoryAccess; -}; +css::uno::Reference SVT_DLLPUBLIC createTextWindowPeer( + TextView & view); } -#endif // INCLUDED_SVTOOLS_TEXTWINDOWPEER_HXX +#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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) { - TextWindowPeer::TextWindowPeer(::TextView & rView): - m_rEngine(*rView.GetTextEngine()), m_rView(rView) - { - SetWindow(rView.GetWindow()); - m_pFactoryAccess.reset( new AccessibleFactoryAccess ); - } + SetWindow(view.GetWindow()); +} - // virtual - TextWindowPeer::~TextWindowPeer() - { - } +css::uno::Reference +TextWindowPeer::CreateAccessibleContext() { + return m_aFactoryAccess.getFactory().createAccessibleTextWindowContext( + this, m_rEngine, m_rView); +} - css::uno::Reference< css::accessibility::XAccessibleContext > TextWindowPeer::CreateAccessibleContext() - { - return m_pFactoryAccess->getFactory().createAccessibleTextWindowContext( - this, m_rEngine, m_rView - ); - } +} + +css::uno::Reference svt::createTextWindowPeer( + TextView & view) +{ + return new TextWindowPeer(view); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */