Download it now!
Bug 79717 - EDITING: Overwriting selected text doesn't always maintain formatting
Summary: EDITING: Overwriting selected text doesn't always maintain formatting
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard: BSA target:6.3.0
Keywords:
: 79364 95312 112961 (view as bug list)
Depends on:
Blocks: Character Formatting-Text-Diverse
  Show dependency treegraph
 
Reported: 2014-06-06 10:39 UTC by Patrick Moody
Modified: 2020-10-17 20:00 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Moody 2014-06-06 10:39:38 UTC
Problem description: 
Selecting text then typing over it uses the formatting from the preceding (to the left) text, rather than maintaining the formatting of the text that is being replaced.


Steps to reproduce:
1. In a document with a line of normal text followed by a some bold type text.
2. Make a selection from the start of the bold type text (where normal type is to the left of it and bold is to the right) to some point within the bold text but not up to the end of it.
3. Type in some new text to replace that which was selected.

Current behaviour:
The new text is not bold, but has the same format of the existing text to the left of it.


Expected behaviour:
The new text maintains the formatting of the text that it is replacing.
              
Operating System: Windows 7
Version: 4.2.2.1 release
Comment 1 Yousuf Philips (jay) (retired) 2014-06-06 19:44:14 UTC
Confirmed in Linux Mint in 3.3.0, 4.2.4 and 4.3 beta.

Steps:
1. type 'abcdefg'
2. press Ctrl+B
3. type 'hijklmn'
4. highlight 'hijk'
5. type any number of characters
6. characters typed arent bold
Comment 2 QA Administrators 2015-06-08 14:41:34 UTC Comment hidden (obsolete)
Comment 3 Buovjaga 2015-06-21 17:14:44 UTC
Repro.

Win 7 Pro 64-bit Version: 5.1.0.0.alpha1+
Build ID: 3ecef8cedb215e49237a11607197edc91639bfcd
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-06-19_23:16:58
Locale: fi-FI (fi_FI)
Comment 4 Buovjaga 2015-10-26 08:35:42 UTC
*** Bug 95312 has been marked as a duplicate of this bug. ***
Comment 5 QA Administrators 2016-11-08 11:53:08 UTC Comment hidden (obsolete)
Comment 6 Phil Krylov 2019-02-10 19:15:15 UTC
*** Bug 112961 has been marked as a duplicate of this bug. ***
Comment 7 Commit Notification 2019-03-13 10:29:19 UTC
Phil Krylov committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/6abed0ea006f3616e40faf2ae782cf64f8ac2914%5E%21

tdf#79717 save/restore character format on selection overwrite

It will be available in 6.3.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:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Buovjaga 2019-03-20 18:40:16 UTC
Phil: I verify the fix. Should this be set to resolved?

Arch Linux 64-bit
Version: 6.3.0.0.alpha0+
Build ID: 0c7009e751a5c8b3c5f73ac42fad5b4954206fc1
CPU threads: 8; OS: Linux 5.0; UI render: default; VCL: gtk3; 
Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US
Calc: threaded
Built on 17 March 2019
Comment 9 Phil Krylov 2019-03-20 20:57:22 UTC
(In reply to Buovjaga from comment #8)
> Phil: I verify the fix. Should this be set to resolved?

The issue actually seems to be somewhat bigger.

First, it also applies not only to direct formatting, but also to character styles. For this I've posted a simple extension of the accepted patch, which is now on review queue at https://gerrit.libreoffice.org/69323 .

Then, these patches do fix the problem with direct user input, but do not seem to fix the same problem appearing when replacing text via UNO API (with portion/cursor setString method) or from a spelling suggestion context menu. I am going to further investigate this problem when time permits; probably separate issue numbers should be used (I have now found bug 51423, bug 99786, bug 104137 which probably should be marked duplicates of 51423; but found no filed issue for the UNO API behavior) although they are all clearly related. I've also met this behaviour with Find&Replace, but that seems to be fixed recently.
Comment 10 Buovjaga 2019-03-21 06:54:48 UTC
Ok, thanks a lot! If you get stuck, feel free to email the dev list for assistance.
Comment 11 Commit Notification 2019-03-21 07:14:49 UTC
Phil Krylov committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/04bd1925706360414438b814046b543c5e317d0a%5E%21

tdf#79717 save/restore character style on selection overwrite

It will be available in 6.3.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:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Xisco Faulí 2019-05-16 10:33:07 UTC
A polite ping to Phil Krylov:
Is this bug fixed? if so, could you please close it as RESOLVED FIXED ?
Otherwise, Could you please explain what's missing?
Thanks
Comment 13 Luke Kendall 2019-05-23 12:49:38 UTC
I went looking for a 6.3 RC but there aren't any yet.
I'm hesitant to try an alpha build from the https://dev-builds.libreoffice.org/pre-releases

(Sorry, I'm probably butting my head in unnecessarily.)
Comment 14 Xisco Faulí 2019-05-23 13:23:13 UTC
(In reply to Luke Kendall from comment #13)
> I went looking for a 6.3 RC but there aren't any yet.
> I'm hesitant to try an alpha build from the
> https://dev-builds.libreoffice.org/pre-releases
> 
> (Sorry, I'm probably butting my head in unnecessarily.)

6.3 RC is planned to be released the first week of August, 2019.
Meanwhile, you can use LibreOffice 6.3 Alpha1 -> https://wiki.documentfoundation.org/QA/GetInvolved#Test_Pre-releases
Comment 15 Thomas Lendo 2020-08-24 19:09:10 UTC
I can't reproduce the steps in comment 0 and comment 1, so I think this bug is fixed?

Tested with
Version: 7.1.0.0.alpha0+
Build ID: a06a83b29a9da770787bffe416b138102aa12531
CPU threads: 2; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: de-AT (de_AT.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2020-08-24_01:03:26
Calc: CL


Phil Krylov, for the several bugs of overwriting/pasting of text and losing of formatting please see meta bug 127250 (Formatting-Text-Diverse) - [META] Text formatting issues when inserting or overwriting.
Comment 16 Thomas Lendo 2020-08-24 19:13:40 UTC
*** Bug 79364 has been marked as a duplicate of this bug. ***