sw/source/core/access/accpara.cxx |   39 --------------------------------------
 1 file changed, 39 deletions(-)

New commits:
commit a2e0b39b62129d9dbae438ec6b12fca210bbcbb5
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Oct 20 16:04:51 2023 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Nov 3 07:31:37 2023 +0100

    sw a11y: No longer report underline for misspelling
    
    No longer report a red wavy underline for misspelled
    words in Writer.
    
    The underline isn't really a character/text attribute, since
    it's not part of the actual formatting of the text, but is
    just shown visually.
    
    Each platform a11y API has a better way to explicitly
    report misspelling.
    
        commit ec2e02cfa41510c3d30b118cbf7595c84a046d03
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Tue Oct 17 14:36:58 2023 +0200
    
            tdf#157696 a11y: Report spelling error via IA2 "invalid:spelling" 
attr
    
    and
    
        commit 2bf88c172c9c9d159344b95fb96073f4891a6c30
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Wed Oct 18 13:44:42 2023 +0200
    
            tdf#157696 wina11y: Switch from custom to IA2 text attributes
    
    added the implementation for Windows and
    the Qt-based VCL plugins on Linux.
    
    On macOS (`NSAccessibilityMarkedMisspelledTextAttribute`/
    `NSAccessibilityMisspelledTextAttribute`) and for gtk3/ATK,
    the corresponding attributes were already used before.
    
    Therefore, reporting an underline as a workaround is no
    longer needed.
    
    Orca on Linux, NVDA on Windows (with [1] in place)
    and CrossOver on macOS all make use of the specific
    character attribute to announce spelling errors, not
    the underline. If any assistive technology should stop
    reporting spelling errors due to this change, it should
    be fixed to handle the proper text attribute as well.
    
    After switching to text attributes according to the
    IAccessible2 specification on Windows (i.e. with,
    the above-mentioned commits and the NVDA commit
    to switch to IAccessible2 text attributes for LO [1]),
    NVDA was starting to announce not only that a word is
    misspelled, but an underline in addition, which is
    no more the case now that the underlining is no more
    reported.
    
    [1] 
https://github.com/nvaccess/nvda/commit/de4e8814f39ab6ae9fbc5330b007494ef6888cd3
    
    Change-Id: Ifa29e0080a4a039c5a119dd0debe5e924fa546ed
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158847
    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 7fb728f68fbc..62db53567a3e 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -1905,7 +1905,6 @@ void SwAccessibleParagraph::_correctValues( const 
sal_Int32 nIndex,
         pos = pFrame->MapViewToModel(nCorePos + TextFrameIndex(1)); // try 
this one instead
         assert(pos.first->Len() != pos.second);
     }
-    const SwTextNode *const pTextNode(pos.first);
 
     sal_Int32 nValues = rValues.size();
     for (sal_Int32 i = 0;  i < nValues;  ++i)
@@ -1962,47 +1961,9 @@ void SwAccessibleParagraph::_correctValues( const 
sal_Int32 nIndex,
             continue;
         }
 
-        // UnderLine
-        if (rValue.Name == UNO_NAME_CHAR_UNDERLINE)
-        {
-            //misspelled word
-            SwCursorShell* pCursorShell = GetCursorShell();
-            if( pCursorShell != nullptr && pCursorShell->GetViewOptions() && 
pCursorShell->GetViewOptions()->IsOnlineSpell())
-            {
-                const SwWrongList* pWrongList = pTextNode->GetWrong();
-                if( nullptr != pWrongList )
-                {
-                    sal_Int32 nBegin = pos.second;
-                    sal_Int32 nLen = 1;
-                    if (pWrongList->InWrongWord(nBegin, nLen) && 
!pTextNode->IsSymbolAt(nBegin))
-                    {
-                        rValue.Value <<= sal_uInt16(LINESTYLE_WAVE);
-                    }
-                }
-            }
-            continue;
-        }
-
         // UnderLineColor
         if (rValue.Name == UNO_NAME_CHAR_UNDERLINE_COLOR)
         {
-            //misspelled word
-            SwCursorShell* pCursorShell = GetCursorShell();
-            if( pCursorShell != nullptr && pCursorShell->GetViewOptions() && 
pCursorShell->GetViewOptions()->IsOnlineSpell())
-            {
-                const SwWrongList* pWrongList = pTextNode->GetWrong();
-                if( nullptr != pWrongList )
-                {
-                    sal_Int32 nBegin = pos.second;
-                    sal_Int32 nLen = 1;
-                    if (pWrongList->InWrongWord(nBegin, nLen) && 
!pTextNode->IsSymbolAt(nBegin))
-                    {
-                        rValue.Value <<= sal_Int32(0x00ff0000);
-                        continue;
-                    }
-                }
-            }
-
             uno::Any &anyChar = rValue.Value;
             sal_uInt32 crUnderline = static_cast<sal_uInt32>( 
reinterpret_cast<sal_uIntPtr>(anyChar.pReserved));
             if ( COL_AUTO == Color(ColorTransparency, crUnderline) )

Reply via email to