sw/source/core/access/accembedded.cxx |   16 +++++-----------
 sw/source/core/access/accembedded.hxx |    5 ++---
 2 files changed, 7 insertions(+), 14 deletions(-)

New commits:
commit 1b5934fa5f3f5babddd4e3b5549c091eb15ccd46
Author:     Michael Weghorn <[email protected]>
AuthorDate: Thu Mar 5 14:30:22 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Fri Mar 6 07:17:20 2026 +0100

    sw a11y: Switch to override new extended attr helper for embedded obj
    
    Override the OAccessible::implGetExtendedAttributes
    base class method newly introduced in
    
        Change-Id: Ie66f135fbf6cdc98c7cdca27fa3f5fe7db7f9a74
        Author: Michael Weghorn <[email protected]>
        Date:   Thu Mar 5 12:12:45 2026 +0100
    
            a11y: Introduce helper to implement XAccessibleExtendedAttributes 
logic
    
    instead of manually implementing
    XAccessibleExtendedAttributes::getExtendedAttributes, to
    unify/deduplicate the string concatenation and locking logic
    by having it implemented (only) in the base class implementation.
    
    Change-Id: I85e74e97a55a7b3bdaf4bb6cec23ef7c6147b7d8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201045
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/sw/source/core/access/accembedded.cxx 
b/sw/source/core/access/accembedded.cxx
index 454920d8f316..a0a77c79e490 100644
--- a/sw/source/core/access/accembedded.cxx
+++ b/sw/source/core/access/accembedded.cxx
@@ -38,27 +38,23 @@ SwAccessibleEmbeddedObject::SwAccessibleEmbeddedObject(
 
 SwAccessibleEmbeddedObject::~SwAccessibleEmbeddedObject() {}
 
-// XAccessibleExtendedAttributes
-OUString SAL_CALL SwAccessibleEmbeddedObject::getExtendedAttributes()
+std::unordered_map<OUString, OUString> 
SwAccessibleEmbeddedObject::implGetExtendedAttributes()
 {
-    SolarMutexGuard g;
-
     SwFlyFrame* pFFrame = getFlyFrame();
     if (!pFFrame)
         return {};
 
-    OUString style = "style:";
+    OUString sStyleValue;
     if (SwContentFrame* pCFrame = pFFrame->ContainsContent())
     {
         assert(pCFrame->IsNoTextFrame());
         SwContentNode* const pCNode = 
static_cast<SwNoTextFrame*>(pCFrame)->GetNode();
         if (pCNode)
         {
-            style += 
static_cast<SwOLENode*>(pCNode)->GetOLEObj().GetStyleString();
+            sStyleValue = 
static_cast<SwOLENode*>(pCNode)->GetOLEObj().GetStyleString();
         }
     }
-    style += ";";
-    return style;
+    return { { u"style"_ustr, sStyleValue } };
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accembedded.hxx 
b/sw/source/core/access/accembedded.hxx
index 7f0ea3381425..fb6829389156 100644
--- a/sw/source/core/access/accembedded.hxx
+++ b/sw/source/core/access/accembedded.hxx
@@ -29,12 +29,11 @@ class SwAccessibleEmbeddedObject : public 
SwAccessibleNoTextFrame
 protected:
     virtual ~SwAccessibleEmbeddedObject() override;
 
+    virtual std::unordered_map<OUString, OUString> implGetExtendedAttributes() 
override;
+
 public:
     SwAccessibleEmbeddedObject(std::shared_ptr<SwAccessibleMap> const& 
pInitMap,
                                const SwFlyFrame* pFlyFrame);
-
-    // XAccessibleExtendedAttributes
-    virtual OUString SAL_CALL getExtendedAttributes() override;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 2abad06ddac175a95ffc53430623866283491290
Author:     Michael Weghorn <[email protected]>
AuthorDate: Thu Mar 5 14:28:01 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Fri Mar 6 07:17:12 2026 +0100

    sw a11y: Merge 3 statements into 1
    
    Change-Id: Idc2fd177d85084d69fc61e270c0ec3236c0316c8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201044
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/sw/source/core/access/accembedded.cxx 
b/sw/source/core/access/accembedded.cxx
index 9859f343a555..454920d8f316 100644
--- a/sw/source/core/access/accembedded.cxx
+++ b/sw/source/core/access/accembedded.cxx
@@ -48,9 +48,7 @@ OUString SAL_CALL 
SwAccessibleEmbeddedObject::getExtendedAttributes()
         return {};
 
     OUString style = "style:";
-    SwContentFrame* pCFrame;
-    pCFrame = pFFrame->ContainsContent();
-    if (pCFrame)
+    if (SwContentFrame* pCFrame = pFFrame->ContainsContent())
     {
         assert(pCFrame->IsNoTextFrame());
         SwContentNode* const pCNode = 
static_cast<SwNoTextFrame*>(pCFrame)->GetNode();

Reply via email to