Bug 151451 - SearchDescriptor returns wrong result when Tracking enabled (macro search finds not-displayed redline text)
Summary: SearchDescriptor returns wrong result when Tracking enabled (macro search fin...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
6.2.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Track-Changes redlinehide-regressions
  Show dependency treegraph
 
Reported: 2022-10-10 11:06 UTC by Jordi
Modified: 2024-05-13 13:54 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Doc with Sample Text and Macro (11.93 KB, application/vnd.oasis.opendocument.text)
2022-10-10 11:06 UTC, Jordi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jordi 2022-10-10 11:06:32 UTC
Created attachment 182939 [details]
Doc with Sample Text and Macro

SearchDescriptor in macro finds specified regex pattern in overwritten text when Tracking Changes is enabled (but old text not visible). No issue when Tracking is disabled in document.

Tested against the versions of LO I have on my Windows 10 system, 

it does NOT occur on LibreOffice 5.4.7.2 x64
but it DOES on LibreOffice 6.2.0.3 x64


Sample document with macro attached. Simple test macro to exhibit the problem is as follows,

Dim oDoc:oDoc = ThisComponent

Dim sDescriptor
sDescriptor = oDoc.createSearchDescriptor

Dim regx: regx = "[:digit:][:digit:]:[:digit:][:digit:]:[:digit:][:digit:]"

sDescriptor.SearchString = regx
sDescriptor.SearchRegularExpression = True

Dim oVC: oVC = oDoc.CurrentController.getViewCursor()	

dim r, oText
r = oDoc.findnext(oVC.end(),sDescriptor)

oVC.gotoRange(r.end(), false)
Comment 1 Jordi 2022-10-10 11:10:34 UTC
Searching for regex using F&R dialog works correctly.
Comment 2 Buovjaga 2023-02-23 08:49:52 UTC
Bibisected with linux-64-6.2 to 94c1af65367dcbc7272455cf6d4940252a289b62
sw_redlinehide: make layout based Show/Hide mode the default

Bad result is cursor stopping at the indicated spot:
<-- There was a time code here, mustn’t stop here.
Comment 3 Justin L 2023-08-25 17:31:54 UTC
I got an error when running the macro in 24.2.

So I just did Ctrl-H (find replace dialog), turn on regex and searched for [:digit:][:digit:]:[:digit:][:digit:]:[:digit:][:digit:].

It only found-next the three time-stamps. Interactively it works fine.

So, I'm guessing that this 6.2 commit is some major re-write of redlining, where the "deleted text" stays around as regular nodes and is just displayed or not. I wouldn't consider this a regression. I imagine there is a way the macro can be re-written to accommodate the change.
Comment 4 Mae Inman 2024-01-16 02:09:00 UTC Comment hidden (spam)
Comment 5 Thorsten Behrens (allotropia) 2024-05-13 13:54:28 UTC
Un-CCing developer, its unclear if we can find the time to look into it at this stage.