diff options
author | Andreas Bregas <ab@openoffice.org> | 2009-12-09 14:52:59 +0000 |
---|---|---|
committer | Andreas Bregas <ab@openoffice.org> | 2009-12-09 14:52:59 +0000 |
commit | 6cfb4e0977e2f7974edabd2e617286c6e2e46738 (patch) | |
tree | 6c13f44dd372a5632980088956dcea01c6946471 | |
parent | e4f41f75acdebc7885377d476606fd5ffbfa8e0d (diff) |
#i107075# Check any type in getTextMarkup()
-rw-r--r-- | vcl/unx/gtk/a11y/atktext.cxx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/vcl/unx/gtk/a11y/atktext.cxx b/vcl/unx/gtk/a11y/atktext.cxx index f6755deb60b5..0a97e5ba1ca6 100644 --- a/vcl/unx/gtk/a11y/atktext.cxx +++ b/vcl/unx/gtk/a11y/atktext.cxx @@ -187,9 +187,16 @@ static accessibility::XAccessibleTextMarkup* if( !pWrap->mpTextMarkup && pWrap->mpContext ) { uno::Any any = pWrap->mpContext->queryInterface( accessibility::XAccessibleTextMarkup::static_type(NULL) ); - pWrap->mpTextMarkup = reinterpret_cast< accessibility::XAccessibleTextMarkup * > (any.pReserved); - if( pWrap->mpTextMarkup ) - pWrap->mpTextMarkup->acquire(); + /* Since this not a dedicated interface in Atk and thus has not + * been queried during wrapper initialization, we need to check + * the return value here. + */ + if( typelib_TypeClass_INTERFACE == any.pType->eTypeClass ) + { + pWrap->mpTextMarkup = reinterpret_cast< accessibility::XAccessibleTextMarkup * > (any.pReserved); + if( pWrap->mpTextMarkup ) + pWrap->mpTextMarkup->acquire(); + } } return pWrap->mpTextMarkup; |