accessibility/source/helper/characterattributeshelper.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commits: commit aa0a39f2be0cf9d633c3654babc6f738d67f871f Author: Michael Weghorn <[email protected]> AuthorDate: Fri Sep 23 20:26:52 2022 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Sun Sep 25 14:44:03 2022 +0200 a11y: Use FontSlant for "CharPosture" The platform a11y integration code expects a `FontSlant` in the "CharPosture" `Any` (s. e.g. `get_style_value`/`FontSlant2Style` in `vcl/unx/gtk3/a11y/atktextattributes.cxx` or `QtAccessibleWidget::attributes`) and that's also what e.g. Writer sets for that attribute for text in the document, so do the same in `CharacterAttributesHelper::CharacterAttributesHelper`. After handling for "CharPosture" was added for the Qt-based VCL plugins in commit 99841da686625428b8ad2e219dd19e5fbfb145f5 Author: Michael Weghorn <[email protected]> Date: Tue Jul 20 13:23:21 2021 +0200 qt a11y: Report font style text attribute (e.g. italic) , clicking through the a11y hierarchy of e.g. Writer's "Page Style" dialog in Accerciser's treeview of the LO a11y hierarchy would otherwise crash LO when used with the qt6 VCL plugin. With this in place, the style is reported correctly there. (Tested by temporarily setting "oblique" style using glade for the "Next style" label in the "Organizer" tab in that dialog's UI file.) Change-Id: Ibea42db067e0cdb3b85c80dbcca5939b3dfe5570 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140527 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/accessibility/source/helper/characterattributeshelper.cxx b/accessibility/source/helper/characterattributeshelper.cxx index 9cbeaaee8a7c..1d6120ff483c 100644 --- a/accessibility/source/helper/characterattributeshelper.cxx +++ b/accessibility/source/helper/characterattributeshelper.cxx @@ -19,6 +19,7 @@ #include <helper/characterattributeshelper.hxx> #include <tools/gen.hxx> +#include <vcl/unohelp.hxx> #include <comphelper/sequence.hxx> using namespace ::com::sun::star::uno; @@ -39,7 +40,7 @@ CharacterAttributesHelper::CharacterAttributesHelper( const vcl::Font& rFont, sa m_aAttributeMap.emplace( OUString( "CharStrikeout" ), Any( static_cast<sal_Int16>(rFont.GetStrikeout()) ) ); m_aAttributeMap.emplace( OUString( "CharUnderline" ), Any( static_cast<sal_Int16>(rFont.GetUnderline()) ) ); m_aAttributeMap.emplace( OUString( "CharWeight" ), Any( static_cast<float>(rFont.GetWeight()) ) ); - m_aAttributeMap.emplace( OUString( "CharPosture" ), Any( static_cast<sal_Int16>(rFont.GetItalic()) ) ); + m_aAttributeMap.emplace( OUString( "CharPosture" ), Any( vcl::unohelper::ConvertFontSlant(rFont.GetItalic()) ) ); }
