[Libreoffice-commits] core.git: 2 commits - basctl/source include/svtools qadevOOo/tests svtools/source

Stephan Bergmann sbergman at redhat.com
Wed Nov 27 02:36:01 PST 2013


 basctl/source/basicide/baside2b.cxx                         |    2 
 include/svtools/textwindowpeer.hxx                          |   43 ++------
 qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java |    5 
 svtools/source/edit/textwindowpeer.cxx                      |   64 ++++++++----
 4 files changed, 59 insertions(+), 55 deletions(-)

New commits:
commit 0ee2cddfbd9cc710371048df560e397d6881d69b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Nov 27 11:35:17 2013 +0100

    Properly encapsulate svt::TextWindowPeer
    
    Change-Id: Iffa67c345a03852ad7872031b4c5a87e223ffcad

diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 76b717f..fee2d61 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 14ef753..7da6b83 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 <svtools/svtdllapi.h>
-#include <toolkit/awt/vclxwindow.hxx>
+#include <sal/config.h>
 
-#include <memory>
+#include <com/sun/star/uno/Reference.hxx>
+#include <sal/types.h>
+#include <svtools/svtdllapi.h>
 
-class TextEngine;
+namespace com { namespace sun { namespace star { namespace awt {
+    class XWindowPeer;
+} } } }
 class TextView;
 
-namespace svt
-{
-    class AccessibleFactoryAccess ;
-
-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;
+namespace svt {
 
-    ::std::auto_ptr< ::svt::AccessibleFactoryAccess  >  m_pFactoryAccess;
-};
+css::uno::Reference<css::awt::XWindowPeer> 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 11fa8c9..6e0a8b7 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 <sal/config.h>
 
+#include <svtaccessiblefactory.hxx>
+
+#include <boost/noncopyable.hpp>
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include <com/sun/star/awt/XWindowPeer.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+#include <sal/types.h>
 #include <svtools/textwindowpeer.hxx>
+#include <toolkit/awt/vclxwindow.hxx>
+#include <vcl/texteng.hxx>
 #include <vcl/textview.hxx>
-#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<css::accessibility::XAccessibleContext>
+    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<css::accessibility::XAccessibleContext>
+TextWindowPeer::CreateAccessibleContext() {
+    return m_aFactoryAccess.getFactory().createAccessibleTextWindowContext(
+        this, m_rEngine, m_rView);
+}
+
+}
+
+css::uno::Reference<css::awt::XWindowPeer> 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: */
commit 758abf0130d5bc38507c31c2eb5d414a4a27b53b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Nov 27 11:33:40 2013 +0100

    Improve test output
    
    Change-Id: I33b289a31a9a4991eb270b3d154d999fa76c7bb4

diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java
index 50a803f..63eb4c5 100644
--- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java
+++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java
@@ -295,7 +295,7 @@ public class _XAccessibleText extends MultiMethodTest {
         }
 
         try {
-            log.println("getCharacterAttributes(chCount)");
+            log.println("getCharacterAttributes(chCount = " + chCount + ")");
             oObj.getCharacterAttributes(chCount, attr);
             log.println("Exception was expected");
             res &= false;
@@ -305,7 +305,8 @@ public class _XAccessibleText extends MultiMethodTest {
         }
 
         try {
-            log.println("getCharacterAttributes(chCount-1)");
+            log.println(
+                "getCharacterAttributes(chCount-1 = " + (chCount - 1) + ")");
 
             PropertyValue[] props = oObj.getCharacterAttributes(chCount - 1,
                                                                 attr);


More information about the Libreoffice-commits mailing list