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

New commits:
commit 2603a7d51d5c6a283831ba8b92af561eb5931692
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Jun 15 09:55:10 2022 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Jun 16 07:55:01 2022 +0200

    tdf#147084 sw a11y: Ensure focus event gets sent when moving to table
    
    The code responsible for sending an a11y focus event when the cursor
    moves from elsewhere into e.g. a table cell depends on the fact that the
    cursor was previously not in that object, i.e. the previous/old
    cursor/caret position is -1, s. e.g.
    `SwAccessibleParagraph::InvalidateCursorPos_`.
    
    Already setting `m_nOldCaretPos` to the the actual cursor position
    instead of -1 in the `SwAccessibleParagraph` ctor resulted in that
    assumption no longer holding when initially moving the cursor into a
    table (cell), so no focus event would get sent and
    the NVDA screen reader on Windows would therefore also not refer to
    the correct a11y object when handling the subsequent CARET_CHANGED
    event and fail to retrieve the caret position in the previously
    focused object (because focus/cursor have moved on).
    
    Make focus announcement work by only setting `m_nOldCaretPos` to the
    actual cursor position when processing the corresponding events related
    to change of cursor position, not in the ctor.
    
    Setting the cursor pos already in the ctor had been added to fix an
    issue with IM handling in
    
        commit 817da76529aa39f641d76805d429b09681348811
        Date:   Sat Nov 8 19:37:22 2014 +0300
    
            fdo#85912 Delete surrounding text failing for input method calls 
regression.
    
            When Apache OpenOffice code was merged in, a few lines were removed 
for
            no apparent reason.  This just adds the code back in, and resolves 
the bug.
    
            See the comments in fdo#85912 for details about this bug.  It is 
hard for
            majority language users to reproduce since they don't use ibus/kmfl 
to
            type their language's letters.
    
    The issue mentioned in the referenced tdf#85912 (== fdo#85912) is not
    reproducible for me with this change here in place either, neither with
    the gtk3 VCL plugin nor with kf5 (for which the relevant IM handling has
    been added in the context of tdf#149255, which has some more
    information on the ibus/kmfl setup needed to reproduce the
    original bug). The bug report already mentioned that the issue
    was reproducible with Linux 13 Mint and LibreOffice 4.3.3.2, but not
    Linux 17 Mint with exactly the same LO version, so without being able to
    analyze this any further, the best explanation I can come up with is
    that the root cause for tdf#85912 was somewhere else and has been fixed
    in the meanwhile.
    
    In hindsight, comment 5 in tdf#85912 already has further information
    on why adding the assignment back to the ctor was problematic:
    
    > Reviewed OpenOffice code as well.  The missing lines exist (but are
    > commented out) in the current AOO code.  The commenting out
    > occurred when Steven Ying implemented his huge "AOO IA2 enabled draft
    > version 1" change on 27 Sep 2013.
    > 
https://github.com/apache/openoffice/commit/0deba7fbda3d9908785c25a443701a293b6f4e71#diff-50d752f41bb880abd1094d09d9e1a7fc
    >
    > The current AOO comment is
    > // If this object has the focus, then it is remembered by the map itself.
    > // not necessary to remember this pos here. Generally, the pos will be 
updated in invalidateXXX method, which may fire the
    > //Focus event based on the difference of new & old caret pos.
    > //nOldCaretPos = GetCaretPos();
    
    Change-Id: If8cd4e92bc1f6233775ccc2834230f3a388ccadb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135868
    Reviewed-by: Justin Luth <jl...@mail.com>
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    (cherry picked from commit 38b14d4b61cdcf894d42e159bcf7aa8edab44de8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135941

diff --git a/sw/source/core/access/accpara.cxx 
b/sw/source/core/access/accpara.cxx
index 1447b97a6dbd..94a1df603c4a 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -412,9 +412,6 @@ SwAccessibleParagraph::SwAccessibleParagraph(
     //Get the real heading level, Heading1 ~ Heading10
     m_nHeadingLevel = GetRealHeadingLevel();
     SetName( OUString() ); // set an empty accessibility name for paragraphs
-
-    // If this object has the focus, then it is remembered by the map itself.
-    m_nOldCaretPos = GetCaretPos();
 }
 
 SwAccessibleParagraph::~SwAccessibleParagraph()

Reply via email to