Bug 129743 - XSelectionSupplier::select does not select first range of passed multi-range
Summary: XSelectionSupplier::select does not select first range of passed multi-range
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:6.5.0
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-02 17:20 UTC by Mike Kaganski
Modified: 2020-01-03 14:35 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2020-01-02 17:20:22 UTC
1. Create a new text document;
2. Type this text: "abc abc abc"
3. Run this BASIC code:

Sub Main
  d = ThisComponent
  f = d.createSearchDescriptor()
  f.SearchString = "abc"
  c = d.findAll(f)
  d.currentController.select(c)
End Sub

Expected result: three pieces of "abc" text selected

Actual result: second and third pieces are selected, but first is not; cursor blinks after "c" of the first (not selected) occurence of "abc".

Already reproducible with OpenOffice.org 3.3.0 OOO330m20 (Build:9567)

and with Version: 6.4.0.1 (x64)
Build ID: 1b6477b31f0334bd8620a96f0aeeb449b587be9f
CPU threads: 12; OS: Windows 10.0 Build 18363; UI render: default; VCL: win; 
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: threaded

Ref.: https://ask.libreoffice.org/en/question/223441
Comment 1 Mike Kaganski 2020-01-02 17:29:32 UTC
https://gerrit.libreoffice.org/c/core/+/86142
Comment 2 Wolfgang Jäger 2020-01-02 17:37:51 UTC
Tested with V6.4.0.1RC

(Also with V5.4.4 and V3.3.0 : Same behaviour.)
Comment 3 Wolfgang Jäger 2020-01-02 17:39:08 UTC
Sorry. Was too rash!
Comment 4 Wolfgang Jäger 2020-01-02 17:41:05 UTC
Tried to repair.
Comment 5 Commit Notification 2020-01-02 18:31:31 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d8a188d8d59ae51621a0540fe931e1c70db285fe

tdf#129743: don't delete mark of current cursor when creating new cursor

It will be available in 6.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2020-01-03 14:35:58 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0fce75bde16d64970feab5de488da530193dfa23

tdf#129743 follow-up: implement the other variant of the fix

It will be available in 6.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.