https://bugs.freedesktop.org/show_bug.cgi?id=43390

Vincent Povirk <madewokh...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #53986|0                           |1
        is obsolete|                            |

--- Comment #2 from Vincent Povirk <madewokh...@gmail.com> 2011-12-16 12:55:23 
PST ---
Created attachment 54515
  --> https://bugs.freedesktop.org/attachment.cgi?id=54515
Proper patch

So it turns out the selection weirdness I'm seeing in Writer with accessibility
api's has several different causes:

SwWrtShell uses the SttSelect and EndSelect methods to decide when to extend
the selection as the user moves the cursor, and when to kill the selection. The
upshot of this is that if we set the selection without calling SttCursor (which
the accessibility code does), SwWrtShell does not know to kill the selection
when the user later moves the cursor, and instead the selection is extended.
This causes bad behavior when something is selected through the accessibility
API and the user later moves the cursor manually.

The "RemoveSelection" method is implemented by doing SetSelection(0, 0),
creating a selection that starts and ends at the start of a line. While this
looks the same as removing the selection, it's actually subtly different and
causes a problem later.

The "SetCaretOffset" method, unlike "RemoveSelection", selects a PaM without a
mark. That means that if there's currently a selection, even an empty selection
of the sort that "RemoveSelection" creates, it extends that selection. I think
this is OK (I remember reading somewhere that moving the caret has an undefined
result if there's an existing selection), but if we call "RemoveSelection"
followed by "SetCaretOffset" then that should result in no selection.

I've chosen to address the first two issues in my patch and leave the third one
alone. We could make SetCaretOffset kill the selection, but I think the way it
behaves now is also a correct behavior, as long as RemoveSelection is fixed.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to