summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/gtk/a11y/atktext.cxx18
-rw-r--r--vcl/unx/gtk/a11y/atktextattributes.cxx6
2 files changed, 18 insertions, 6 deletions
diff --git a/vcl/unx/gtk/a11y/atktext.cxx b/vcl/unx/gtk/a11y/atktext.cxx
index 5c662a711131..425b3358f1b7 100644
--- a/vcl/unx/gtk/a11y/atktext.cxx
+++ b/vcl/unx/gtk/a11y/atktext.cxx
@@ -494,12 +494,20 @@ text_wrapper_get_run_attributes( AtkText *text,
css::uno::Reference<css::accessibility::XAccessibleText> pText
= getText( text );
- css::uno::Reference<css::accessibility::XAccessibleTextAttributes>
- pTextAttributes = getTextAttributes( text );
- if( pText.is() && pTextAttributes.is() )
+ if( pText.is())
{
- uno::Sequence< beans::PropertyValue > aAttributeList =
- pTextAttributes->getRunAttributes( offset, uno::Sequence< OUString > () );
+ uno::Sequence< beans::PropertyValue > aAttributeList;
+
+ css::uno::Reference<css::accessibility::XAccessibleTextAttributes>
+ pTextAttributes = getTextAttributes( text );
+ if(pTextAttributes.is()) // Text attributes are available for paragraphs only
+ {
+ aAttributeList = pTextAttributes->getRunAttributes( offset, uno::Sequence< OUString > () );
+ }
+ else // For other text objects use character attributes
+ {
+ aAttributeList = pText->getCharacterAttributes( offset, uno::Sequence< OUString > () );
+ }
pSet = attribute_set_new_from_property_values( aAttributeList, true, text );
// #i100938#
diff --git a/vcl/unx/gtk/a11y/atktextattributes.cxx b/vcl/unx/gtk/a11y/atktextattributes.cxx
index b7857d079b66..43d6d9c535d4 100644
--- a/vcl/unx/gtk/a11y/atktextattributes.cxx
+++ b/vcl/unx/gtk/a11y/atktextattributes.cxx
@@ -301,7 +301,11 @@ FontSlant2Style(const uno::Any& rAny)
{
const gchar * value = nullptr;
- switch( rAny.get<awt::FontSlant>() )
+ awt::FontSlant aFontSlant;
+ if(!(rAny >>= aFontSlant))
+ return nullptr;
+
+ switch( aFontSlant )
{
case awt::FontSlant_NONE:
value = "normal";