Bug 130984 - Searching the CharEscapement attribute using regexes replaces additional text
Summary: Searching the CharEscapement attribute using regexes replaces additional text
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
(earliest affected)
Hardware: All All
: medium normal
Assignee: Mike Kaganski
Whiteboard: target:7.0.0
Depends on:
Blocks: Macro-UNOAPI
  Show dependency treegraph
Reported: 2020-02-27 12:28 UTC by Andreas Heinisch
Modified: 2020-02-28 10:13 UTC (History)
0 users

See Also:
Crash report or crash signature:

ReplaceFormatting (9.77 KB, application/vnd.oasis.opendocument.text)
2020-02-27 12:31 UTC, Andreas Heinisch

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Heinisch 2020-02-27 12:28:57 UTC
Consider the attached document with a macro, which searches for a superscript in the text and replaces it with <sup>&</sup>.

Example worked in:
Version: (x64)
Build-ID: a187af327633f5f00363be5131bd21a13e0f1a7b
CPU-Threads: 4; BS: Windows 10.0; UI-Render: GL; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: CL

Does not work anymore in:
Version: (x86)
Build ID: 2ce99d12771407631288af5a12fe2165ae3599d8
CPU threads: 4; OS: Windows 10.0 Build 18362; UI render: default; VCL: win; 
Locale: en-GB (de_DE); UI-Language: en-US
Calc: CL

Actual Results:
Here is a <sup>x in superscript.</sup>

Expected Results:
Here is a <sup>x</sup> in superscript.

Reproducible: Always

User Profile Reset: No

Additional Info:
Has this bug something todo with https://bugs.documentfoundation.org/show_bug.cgi?id=75806?
Comment 1 Andreas Heinisch 2020-02-27 12:31:07 UTC
Created attachment 158228 [details]
Comment 2 Mike Kaganski 2020-02-27 19:45:50 UTC
Most likely regression since https://git.libreoffice.org/core/+/0cd3b7926cafc01d06b589124215e9cb7c148f19
Comment 3 Mike Kaganski 2020-02-28 06:03:56 UTC
Comment 4 Mike Kaganski 2020-02-28 07:22:15 UTC
Comment 5 Commit Notification 2020-02-28 10:13:00 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":


tdf#130984: use RegexMatcher::region to properly limit the search

It will be available in 7.0.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:

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