Kaydet (Commit) 8bafe38c authored tarafından Michael Stahl's avatar Michael Stahl

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
ce14342c, 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
üst 33050f59
...@@ -150,10 +150,6 @@ toolkit.UnoControlNumericField::com::sun::star::awt::XView ...@@ -150,10 +150,6 @@ toolkit.UnoControlNumericField::com::sun::star::awt::XView
toolkit.UnoControlCheckBox::com::sun::star::awt::XView toolkit.UnoControlCheckBox::com::sun::star::awt::XView
toolkit.UnoScrollBarControl::com::sun::star::awt::XView toolkit.UnoScrollBarControl::com::sun::star::awt::XView
### i87757 ###
toolkit.AccessibleFixedText::com::sun::star::accessibility::XAccessibleText
### i37643 ### ### i37643 ###
toolkit.AccessibleStatusBarItem::com::sun::star::accessibility::XAccessibleEventBroadcaster toolkit.AccessibleStatusBarItem::com::sun::star::accessibility::XAccessibleEventBroadcaster
......
...@@ -43,6 +43,11 @@ ...@@ -43,6 +43,11 @@
namespace { struct SimpleLayoutEngine : public rtl::Static< ServerFontLayoutEngine, SimpleLayoutEngine > {}; } 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 // layout implementation for ServerFont
// ======================================================================= // =======================================================================
......
...@@ -132,7 +132,7 @@ protected: ...@@ -132,7 +132,7 @@ protected:
friend class GlyphData; friend class GlyphData;
void SetOffset( int nX, int nY ) { maOffset = Point( nX, nY); } void SetOffset( int nX, int nY ) { maOffset = Point( nX, nY); }
void SetDelta( int nX, int nY ) { maDelta = 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; } void SetCharWidth( long nW ) { mnAdvanceWidth = nW; }
private: private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment