svx/source/accessibility/AccessibleOLEShape.cxx |   11 ++++-------
 svx/source/accessibility/AccessibleShape.cxx    |   11 ++++-------
 2 files changed, 8 insertions(+), 14 deletions(-)

New commits:
commit d572a56bea0a5ad01f485b365b2135c682c9f65f
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu Apr 24 08:47:42 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Apr 24 11:39:29 2025 +0200

    svx a11y: Don't return just ";" for a11y description
    
    In AccessibleOLEShape::getExtendedAttributes and
    AccessibleShape::getExtendedAttributes,
    simply return an empty string instead of ";"
    for the extended attributes if there is no shape.
    
    Change-Id: I192dff95b433f167a15bb4f0bb8f634c45f2156e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184532
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/svx/source/accessibility/AccessibleOLEShape.cxx 
b/svx/source/accessibility/AccessibleOLEShape.cxx
index 156de8e723b4..89edf4315b46 100644
--- a/svx/source/accessibility/AccessibleOLEShape.cxx
+++ b/svx/source/accessibility/AccessibleOLEShape.cxx
@@ -126,13 +126,10 @@ uno::Sequence<uno::Type> SAL_CALL 
AccessibleOLEShape::getTypes()
 // XAccessibleExtendedAttributes
 OUString SAL_CALL AccessibleOLEShape::getExtendedAttributes()
 {
-    OUString style;
-    if( m_pShape )
-    {
-        style = "style:" + 
static_cast<SdrOle2Obj*>(m_pShape)->GetStyleString();
-    }
-    style += ";";
-    return style;
+    if (m_pShape)
+        return "style:" + static_cast<SdrOle2Obj*>(m_pShape)->GetStyleString() 
+ ";";
+
+    return OUString();
 }
 
 /// Set this object's name if is different to the current name.
diff --git a/svx/source/accessibility/AccessibleShape.cxx 
b/svx/source/accessibility/AccessibleShape.cxx
index b9f27ae8864e..e4869c37e185 100644
--- a/svx/source/accessibility/AccessibleShape.cxx
+++ b/svx/source/accessibility/AccessibleShape.cxx
@@ -769,16 +769,13 @@ void SAL_CALL AccessibleShape::deselectAccessibleChild( 
sal_Int64 )
 // XAccessibleExtendedAttributes
 OUString SAL_CALL AccessibleShape::getExtendedAttributes()
 {
-    OUString style;
     if (getAccessibleRole() != AccessibleRole::SHAPE)
         return OUString();
 
-    if( m_pShape )
-    {
-        style = "style:" + GetStyle();
-    }
-    style += ";";
-    return style;
+    if (m_pShape)
+        return "style:" + GetStyle() + ";";
+
+    return OUString();
 }
 
 // XServiceInfo

Reply via email to