[Libreoffice-bugs] [Bug 137494] Cycle text selection per shortcut
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Sat Oct 24 08:11:20 UTC 2020
https://bugs.documentfoundation.org/show_bug.cgi?id=137494
--- Comment #7 from Jim Raykowski <raykowj at gmail.com> ---
I think this is a nice opportunity for some fun LO hacking indeed :-)
Here are some code pointers:
A user command for this will be needed.
Perhaps .uno:CycleSelection or .uno:SelectionCycle?
Feel free to chime in with a better command name.
An example how to add a Writer user interface command is here:
https://gerrit.libreoffice.org/c/core/+/91605
Details of how this works is here:
https://wiki.openoffice.org/wiki/Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2
Look here to do the implemention of the command:
sw/source/uibase/uiview/view2.cxx
void SwView::ExecuteSfxRequest &rReq)
The original cursor position, point and mark positions of the selection cycle,
and selection cycle step number will be useful to store. A struct with a member
variable assigned in the SwView class might work well for this purpose.
Any selection(s) when the cycle is initiated should be cleared and word
selection should be done from current cursor position.
If point and/or mark positions are changed before the next selection cycle step
the cycle step should return to word selection.
The following functions will be of use to cycle selection thru word, sentence,
and paragraph and to set the cursor to the original cursor position with no
selection.
sw/inc/crsrsh.hxx
SwCursorShell::GetCursor_
SwCursorShell::SetCursor
sw/inc/viscrs.hxx
SwShellCursor::GetPtPos
SwShellCursor::GetMkPos
sw/source/uibase/inc/wrtsh.hxx
SwWrtShell::IsSelection
SwWrtShell::MoveCursor
SwWrtShell::SelWrd
SwWrtShell::SelSentence
SwWrtShell::SelPara
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20201024/a3c8dc8c/attachment.htm>
More information about the Libreoffice-bugs
mailing list