Bug 103539 - Macro gives wrong result on replace all with regular expression with "\n"
Summary: Macro gives wrong result on replace all with regular expression with "\n"
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
5.1.4.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-27 13:32 UTC by Oswald Luc
Modified: 2016-11-15 13:02 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Basic file containing the macros to be tested (544 bytes, text/plain)
2016-10-27 13:35 UTC, Oswald Luc
Details
LibreOffice Writer text file on which the macros have to be tested (8.48 KB, application/vnd.oasis.opendocument.text)
2016-10-27 13:37 UTC, Oswald Luc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oswald Luc 2016-10-27 13:32:41 UTC
Description:
In some cases only the first occurrence is replaced when every occurrence should be replaced.

Steps to Reproduce:
The bug is easy to reproduce.
I give two attached files :

- A basic file to import into your macros.
In which you find two simple macros.
In fact, they are simply calling the same function with two different arguments.
MacAAA is working correctly, but MacBBB is not : it changes only the first occurrence.
The macros have to be run on the original file and not consecutively in order to see the bug.

-TestFile.odt a small and simple text file on which to run macros

Actual Results:  
For MacBBB on the original file :
AAA
BBB
AAABBB
AAABBB
AAABBB
AAABBB
AAABBB
AAABBB


Expected Results:
AAA
BBB
AAA
BBB
AAA
BBB
AAA
BBB
AAA
BBB
AAA
BBB
AAA
BBB



Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0
Comment 1 Oswald Luc 2016-10-27 13:35:38 UTC
Created attachment 128308 [details]
Basic file containing the macros to be tested
Comment 2 Oswald Luc 2016-10-27 13:37:27 UTC
Created attachment 128309 [details]
LibreOffice Writer text file on which the macros have to be tested
Comment 3 Buovjaga 2016-11-14 19:37:59 UTC
This is what I get when running MacBBB (did not run anything else beforehand):
AAA
BBB
AAA
BBB
AAA
BBB
AAA
BBB
AAA
BBB
AAA
BBB
AAA
BBB

Maybe you could test with LibO 5.2.

Set to NEEDINFO.
Change back to UNCONFIRMED, if the problem persists. Change to RESOLVED WORKSFORME, if the problem went away.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.2.3.3
Build ID: 5.2.3-1
CPU Threads: 8; OS Version: Linux 4.8; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group

Arch Linux 64-bit, KDE Plasma 5
Version: 5.3.0.0.alpha1+
Build ID: 553cfda502a1516673233e409f91372766da6c4d
CPU Threads: 8; OS Version: Linux 4.8; UI Render: default; VCL: kde4; Layout Engine: new; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on November 11th 2016
Comment 4 Oswald Luc 2016-11-15 13:02:48 UTC
Indeed, I run the test with 
LibreOffice
Version: 5.2.4.0.0+
Build ID: 015061495373d7c09362b175dc1f6be3f2a37a1a
and it worked without problem.
So I set the status to RESOLVED WORKSFORME as you asked.
Thank you.