[Libreoffice-commits] .: 2 commits - qadevOOo/tests toolkit/qa vcl/generic vcl/inc

Michael Stahl mst at kemper.freedesktop.org
Wed May 30 00:06:42 PDT 2012


 qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java |    6 ++++--
 toolkit/qa/unoapi/knownissues.xcl                           |    4 ----
 vcl/generic/glyphs/gcach_layout.cxx                         |    5 +++++
 vcl/inc/generic/glyphcache.hxx                              |    2 +-
 4 files changed, 10 insertions(+), 7 deletions(-)

New commits:
commit 8bafe38c569afa2e1055eb647cb7ff161ddd1230
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 30 08:53:00 2012 +0200

    i#87757: do not create empty Rectangle bounding box for glyphs:
    
    Enforce a minimum width and height of 1 in GlyphMetric::SetSize(),
    preventing X11SalGraphics::GetGlyphBoundRect() from returning a
    Rectangle that has one side set as RECT_EMPTY.
    
    This problem has surfaced due to the change of the status bar in
    ce14342c4292628a641a72d4f63d9c048e030c6a, causing the
    AccessibleStatusBarItem to fail in getCharacterBounds() because
    the text of the control, "Words: 0", now contains a space, for which an
    empty Rectangle bounding box is created, which results in a wrong
    return value from getCharacterBounds():
    
    LOG> Character bounds outside component
    LOG> Character rect: 43, -566, 0, 0
    LOG> Component rect: 91, 2, 71, 18
    
    It turns out that the following test was disabled due to this problem,
    so re-enable it now:
    toolkit.AccessibleFixedText::com::sun::star::accessibility::XAccessibleText

diff --git a/toolkit/qa/unoapi/knownissues.xcl b/toolkit/qa/unoapi/knownissues.xcl
index e6880b8..a64fd8f 100644
--- a/toolkit/qa/unoapi/knownissues.xcl
+++ b/toolkit/qa/unoapi/knownissues.xcl
@@ -150,10 +150,6 @@ toolkit.UnoControlNumericField::com::sun::star::awt::XView
 toolkit.UnoControlCheckBox::com::sun::star::awt::XView
 toolkit.UnoScrollBarControl::com::sun::star::awt::XView
 
-
-### i87757 ###
-toolkit.AccessibleFixedText::com::sun::star::accessibility::XAccessibleText
-
 ### i37643 ###
 toolkit.AccessibleStatusBarItem::com::sun::star::accessibility::XAccessibleEventBroadcaster
 
diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index ef03aa3..c1b5b10 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -43,6 +43,11 @@
 
 namespace { struct SimpleLayoutEngine : public rtl::Static< ServerFontLayoutEngine, SimpleLayoutEngine > {}; }
 
+void GlyphMetric::SetSize(const Size& s)
+{
+    maSize = Size(std::max<long>(1, s.Width()), std::max<long>(1, s.Height()));
+}
+
 // =======================================================================
 // layout implementation for ServerFont
 // =======================================================================
diff --git a/vcl/inc/generic/glyphcache.hxx b/vcl/inc/generic/glyphcache.hxx
index 1ab2a74..8c0f3b1 100644
--- a/vcl/inc/generic/glyphcache.hxx
+++ b/vcl/inc/generic/glyphcache.hxx
@@ -132,7 +132,7 @@ protected:
     friend class GlyphData;
     void                    SetOffset( int nX, int nY ) { maOffset = Point( nX, nY); }
     void                    SetDelta( int nX, int nY )  { maDelta = Point( nX, nY); }
-    void                    SetSize( const Size& s )    { maSize = s; }
+    void                    SetSize(const Size& s);
     void                    SetCharWidth( long nW )     { mnAdvanceWidth = nW; }
 
 private:
commit 33050f597cef81162eede4360b011b41e10ab69f
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 30 08:48:36 2012 +0200

    qadevOOo: _XAccessibleText._getTextBeforeIndex:
    
    Do not check length of first word for AccessibleStatusBarItem, which
    now contains "Words: 0" since ce14342c4292628a641a72d4f63d9c048e030c6a,
    but the test stupidly assumes that its text does not contain a space.

diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java
index c72c255..22626cf 100644
--- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java
+++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleText.java
@@ -956,7 +956,10 @@ public class _XAccessibleText extends MultiMethodTest {
         }
 
         try {
-            if (!tEnv.getTestCase().getObjectName().equals("SmGraphicAccessible")) {
+            if (!tEnv.getTestCase().getObjectName().equals("SmGraphicAccessible")
+                // next one fails because the control actually contains 2 words
+                && !tEnv.getTestCase().getObjectName().equals("AccessibleStatusBarItem"))
+            {
                 log.print("getTextBeforeIndex(chCount," +
                           " AccessibleTextType.WORD):");
 
@@ -1192,4 +1195,4 @@ public class _XAccessibleText extends MultiMethodTest {
 
         return res;
     }
-}
\ No newline at end of file
+}


More information about the Libreoffice-commits mailing list