Bug 75885 - Search and replace removes formatting (e.g. italics)
Summary: Search and replace removes formatting (e.g. italics)
Status: RESOLVED DUPLICATE of bug 62603
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
4.2.0.4 release
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Find-Search Formatting-Text-Diverse
  Show dependency treegraph
 
Reported: 2014-03-07 13:33 UTC by nissimnanach
Modified: 2023-05-22 17:10 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
transclusion bug demo (9.94 KB, application/vnd.oasis.opendocument.text)
2014-03-10 15:20 UTC, nissimnanach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nissimnanach 2014-03-07 13:33:17 UTC
Transcluded Search groups that are entered in Replace (i.e. $1) lose their formatting such as italics.

To reproduce this:
1. Type "aitalicsb" in a new document, and make word "italics" between "a" and "b" in italics.
2. CTRL+H Find and Replace > Check "Regular Expressions"
3. Search: a(.+)b
4. Replace: A$1D
5. Click replace.

Expected result: AitalicsB, with the word "italics" in italics as before
Actual result  : AitalicsB, with the word "italics" no longer italics.

AltSearch has the same problem, which may be resolved when this is fixed.
Comment 1 nissimnanach 2014-03-07 13:36:46 UTC
Thank you!
Comment 2 sophie 2014-03-10 15:03:20 UTC
Could not reproduce with Version: 4.2.2.1
Build ID: 3be8cda0bddd8e430d8cda1ebfd581265cca5a0f Ubuntu 13.10 - Closing as works for me, please reopen if you still reproduce with the latest version - Sophie
Comment 3 nissimnanach 2014-03-10 15:20:33 UTC
Created attachment 95510 [details]
transclusion bug demo
Comment 4 nissimnanach 2014-03-10 15:21:58 UTC
I'll have to check it again on my Linux,
but here is my platform:
Version: 4.2.0.4
Build ID: 05dceb5d363845f2cf968344d7adab8dcfb2ba71
on XP
Comment 5 Joel Madero 2014-11-06 00:28:06 UTC
From what I can see this was never confirmed by QA team - moving to UNCONFIRMED to get their confirmation.
Comment 6 nissimnanach 2014-11-06 02:58:28 UTC
I just produced this error again on this platform:

Version: 4.2.2.1
Build ID: 3be8cda0bddd8e430d8cda1ebfd581265cca5a0f
on Windows XP SP3 32 bit.

Let's see what QA says or if anyone else can confirm.
Comment 7 A (Andy) 2014-11-06 14:04:18 UTC
Reproducible with LO 4.3.3.2, Win 8.1.

You need to press the Replace button two times (after the first time everything is still ok).  After the second time the italics format gets lost.
Comment 8 QA Administrators 2015-12-20 16:08:33 UTC Comment hidden (obsolete)
Comment 9 A (Andy) 2015-12-26 23:02:43 UTC
Reproducible with LO 5.1.0.1, Win 8.1
Comment 10 QA Administrators 2017-01-03 19:55:23 UTC Comment hidden (obsolete)
Comment 11 Thomas Lendo 2019-09-22 15:46:07 UTC
Seems to be one of the problems of 'exchanging' content where LibreOffice in reality deletes content and then inserts new content. This results in losing formatting/style definitions.
Comment 12 sdc.blanco 2021-01-10 12:34:42 UTC
@nissimnanach I believe your report is a duplicate of bug 62603.

The problem is not regex, but that the font attributes of the first matched character is applied to the entire replace string.  

See bug 62603, comment 24

If you think your case is not a duplicate of bug 62063, then please REOPEN, with an explanation of what is different.

*** This bug has been marked as a duplicate of bug 62603 ***