Kaydet (Commit) 17773e1a authored tarafından Tamás Zolnai's avatar Tamás Zolnai Kaydeden (comit) Tamás Zolnai

tdf#93430: Get run attributes of text objects

.. which are not paragraphs.

Note: For some reason in character attributes sequence
we have a wrong Any value for "CharPosture" property.

Change-Id: Ia45526c01cc381d3d6a1b56dbf4f03fdd38a0989
Signed-off-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/31591
üst 94de45ec
......@@ -482,12 +482,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#
......
......@@ -298,7 +298,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";
......
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