Bug 38982 - Calc find & replace removes mixed cell formatting; undo does not restore it
Summary: Calc find & replace removes mixed cell formatting; undo does not restore it
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: dataLoss
: 92447 151656 159520 (view as bug list)
Depends on:
Blocks: Find-Search Undo-Redo Cell-Direct-Formatting-Parts
  Show dependency treegraph
 
Reported: 2011-07-05 10:49 UTC by Adam Voysey
Modified: 2024-02-20 04:33 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
Example of spreadsheet with formatting that is affected (10.37 KB, application/vnd.oasis.opendocument.spreadsheet)
2011-07-05 10:49 UTC, Adam Voysey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Voysey 2011-07-05 10:49:36 UTC
Created attachment 48777 [details]
Example of spreadsheet with formatting that is affected

Problem:
Performing a find and replace on a spreadsheet causes any formatting applied to a cell to be overwritten with the default formatting, if any of the contents of the cell are changed (even if the word/text within the cell that the formatting is applied to, is not the word/text which is changed).

Expected behavior:
find and replaces the text, but not the formating (that is it respects the formatting already in place; and leaves the same result one would have found if they manually selected the cell, double clicked to select the word to be changed, and typed the new word)

To reproduce:
i) type some text into a cell
ii) apply a formatting change (for example make one word in the cell red, and another underlined)
iii) open edit->find&replace
iv) perform a find and replace (bug exists for both "replace" and "replace all")
[compare/contrast with behavior of manually making the replacement to the text in the cell]

Bug reproduced on:
x86 and x86-64 versions on linux (Ubuntu natty) and windows (Vista)
Comment 1 Björn Michaelsen 2011-12-23 12:23:47 UTC Comment hidden (obsolete)
Comment 2 Adam Voysey 2011-12-24 13:18:29 UTC
Bug still exists in 3.5.0beta2 (x86 build) on windows Vista 64-bit at least. Will test on other OSs as well if I get chance.
Comment 3 Florian Reisinger 2012-08-14 13:59:41 UTC Comment hidden (obsolete)
Comment 4 Florian Reisinger 2012-08-14 14:00:51 UTC Comment hidden (obsolete)
Comment 5 Florian Reisinger 2012-08-14 14:05:35 UTC Comment hidden (obsolete)
Comment 6 Florian Reisinger 2012-08-14 14:07:36 UTC Comment hidden (obsolete)
Comment 7 Adam Voysey 2012-08-15 02:09:08 UTC
Bug still exists on version 3.5.6.2 on Ubuntu Precise x86_64.
I don't think NEEDINFO was the correct status for the bug anyway... It only had that status due to an automated change. Just needs someone to come along and give it NEW status?
Comment 8 Florian Reisinger 2012-08-24 13:44:33 UTC
I can confirm it @Win 7 with Version 3.6.0.4 (Build ID: 932b512)

@Reporter, someone: Which is the oldest version affected..?
Comment 9 sasha.libreoffice 2012-09-26 12:20:29 UTC
Reproduced in 3.3.4 and 3.6.1 on Fedora 64 bit
In case using button "Replace" this function is even not undoable.
(content undoes, but formatting is lost)
Changing version to 3.3.4 as most early reproduced
Comment 10 Maciej Rumianowski 2012-11-29 12:20:24 UTC
Reproduced in 3.3.0 (Ubuntu 11.04 x86, LO installed from site) and 3.6.3.
The bug is an Old one from OOo see i#51429
Comment 11 QA Administrators 2015-01-05 17:52:10 UTC Comment hidden (obsolete)
Comment 12 Maciej Rumianowski 2015-01-18 18:25:19 UTC
Reproduced in 4.3.5.2 Ubuntu 14.04 x86

Important to reproduce is to apply different formatting to words in a cell.
If there is only one word or same formatting on all words then formatting is preserved and bug does not occur.
Comment 13 QA Administrators 2016-02-21 08:37:13 UTC Comment hidden (obsolete)
Comment 14 QA Administrators 2017-03-06 15:45:37 UTC Comment hidden (obsolete)
Comment 15 Tino Didriksen 2017-08-08 15:16:52 UTC
I can reproduce this on LO Calc 5.4.0.3 (Windows 10, x86_64).

All formatting of a line is lost when a replace happens on it - it doesn't affect the whole cell, if there are multiple lines in the cell.
Comment 16 QA Administrators 2018-08-09 02:36:03 UTC Comment hidden (obsolete)
Comment 17 Tino Didriksen 2018-08-09 05:42:22 UTC
Reproduced in 6.1.0.3 (Windows 10, x86_64).

All formatting is still lost in cells affected by the replace action.
Comment 18 QA Administrators 2019-08-19 06:58:46 UTC Comment hidden (obsolete)
Comment 19 Tino Didriksen 2019-08-19 07:13:06 UTC
Reproduced in 6.2.5.2 (Windows 10, x86_64).

All formatting is lost for lines in cells affected by the replace action.
Comment 21 QA Administrators 2023-01-11 03:23:24 UTC Comment hidden (obsolete)
Comment 22 Tino Didriksen 2023-01-16 12:57:29 UTC
Reproduced in 7.4.4.2 (Windows 10, x86_64).

All formatting is still lost in cells affected by the replace action.
Comment 23 Buovjaga 2023-02-23 08:29:08 UTC
*** Bug 151656 has been marked as a duplicate of this bug. ***
Comment 24 Stéphane Guillou (stragu) 2023-05-22 17:04:23 UTC
*** Bug 92447 has been marked as a duplicate of this bug. ***
Comment 25 Stéphane Guillou (stragu) 2023-05-22 17:17:50 UTC
reproduced in OOo 3.3, so inherited.
Comment 26 Buovjaga 2024-02-16 14:23:17 UTC
*** Bug 159520 has been marked as a duplicate of this bug. ***
Comment 27 Stéphane Guillou (stragu) 2024-02-20 04:33:36 UTC
Reproduced in recent trunk build:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 1cda27cf69054b006aa1b16cab8f56339274588b
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Whole formatting is lost for mixed formatting cells; undoing does not restore formatting _if replacement was done with Replace button_ (but does work if Replace All was used). A bit of an inverted bug 131430...
A mild dataloss of sorts.