sw/source/core/access/accpara.cxx |   22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

New commits:
commit 90d49b980d7fed1d55ab83f3ed88d27ab2cfbb12
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue Dec 5 12:55:37 2023 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Dec 7 07:09:49 2023 +0100

    sw a11y: Only report heading level attr for heading
    
    Only report the "heading-level" and "level" object
    attributes for a Writer paragraph when this paragraph
    has a heading level that can be reported as the value
    of the object attribute.
    No longer report the attribute without any value set otherwise,
    since the attribute doesn't provide any value then,
    but is rather confusing/misleading.
    
    Change-Id: I282345b00a32a74de229058ff368f3b169bf1c03
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160346
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/sw/source/core/access/accpara.cxx 
b/sw/source/core/access/accpara.cxx
index 62db53567a3e..6f487ab46c53 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -3516,19 +3516,15 @@ uno::Any SAL_CALL 
SwAccessibleParagraph::getExtendedAttributes()
 {
     SolarMutexGuard g;
 
-    uno::Any Ret;
-    OUString strHeading("heading-level:");
-    if( m_nHeadingLevel >= 0 )
-        strHeading += OUString::number(m_nHeadingLevel);
-    // tdf#84102: expose the same attribute with the name "level"
-    strHeading += ";level:";
-    if( m_nHeadingLevel >= 0 )
-        strHeading += OUString::number(m_nHeadingLevel);
-    strHeading += ";";
-
-    Ret <<= strHeading;
-
-    return Ret;
+    OUString strHeading;
+    if (m_nHeadingLevel >= 0)
+    {
+        strHeading = "heading-level:" + OUString::number(m_nHeadingLevel);
+        // tdf#84102: expose the same attribute with the name "level"
+        strHeading += ";level:" + OUString::number(m_nHeadingLevel) + ";";
+    }
+
+    return uno::Any(strHeading);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to