sw/source/core/access/AccessibilityCheck.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 041e8806f2640e69634aee6a0a681e2f07b387eb
Author:     Balazs Varga <balazs.varga.ext...@allotropia.de>
AuthorDate: Tue Aug 1 20:32:09 2023 +0200
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Thu Aug 3 00:11:33 2023 +0200

    tdf#156550 - a11y - fix sidebar complains about TOC hyperlinks
    
    Just comparing strings of url text and url link target.
    
    Change-Id: Iaf6196512214195a947429cd2d5e00cf9be46b89
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155202
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>

diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index 501799a2a2ff..e4fd6bcc9919 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -331,7 +331,9 @@ private:
         if (!sHyperlink.isEmpty())
         {
             OUString sText = xTextRange->getString();
-            if (INetURLObject(sText) == INetURLObject(sHyperlink))
+            INetURLObject aHyperlink(sHyperlink);
+            if (aHyperlink.GetProtocol() != INetProtocol::NotValid
+                && INetURLObject(sText) == aHyperlink)
             {
                 OUString sIssueText
                     = 
SwResId(STR_HYPERLINK_TEXT_IS_LINK).replaceFirst("%LINK%", sHyperlink);

Reply via email to