vcl/source/window/accessibility.cxx |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 941cdb082ab05605aae58421ce89636b9b815965
Author:     codewithvk <[email protected]>
AuthorDate: Mon Feb 2 14:21:51 2026 +0530
Commit:     vivek javiya <[email protected]>
CommitDate: Mon Feb 2 12:35:22 2026 +0100

    fix(vcl): skip mnemonic-widget as implied label when explicit label-for 
exists
    
    Signed-off-by: codewithvk <[email protected]>
    Change-Id: I528eec7e6fad7ae35ed12991d32c2f9131497519
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198516
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Caolán McNamara <[email protected]>

diff --git a/vcl/source/window/accessibility.cxx 
b/vcl/source/window/accessibility.cxx
index 0015507f66f6..32f711f254f6 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -590,13 +590,20 @@ vcl::Window* Window::GetAccessibleRelationLabeledBy() 
const
     auto const& aMnemonicLabels = list_mnemonic_labels();
     if (!aMnemonicLabels.empty())
     {
-        //if we have multiple labels, then prefer the first that is visible
         for (auto const & rCandidate : aMnemonicLabels)
         {
+            if (rCandidate->mpWindowImpl->mpAccessibleInfos
+                && 
rCandidate->mpWindowImpl->mpAccessibleInfos->pLabelForWindow)
+                continue;
+
             if (rCandidate->IsVisible())
                 return rCandidate;
         }
-        return aMnemonicLabels[0];
+        // only sent mnemonic label if explicit label-for not exist
+        auto const& pFallback = aMnemonicLabels[0];
+        if (!(pFallback->mpWindowImpl->mpAccessibleInfos
+              && pFallback->mpWindowImpl->mpAccessibleInfos->pLabelForWindow))
+            return pFallback;
     }
 
     // Avoid searching when using LOKit (jsdialog) - it can slow down dumping 
to json when we have a huge hierarchy

Reply via email to