Bug 105550 - FORMATTING Pasting text changes paragraph format in older ODT (because it introduces list style)
Summary: FORMATTING Pasting text changes paragraph format in older ODT (because it int...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.1.4.2 release
Hardware: All All
: low normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsUXEval
: 136982 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-01-26 16:14 UTC by Ulrich Gemkow
Modified: 2021-05-03 09:50 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Test document (11.79 KB, application/vnd.oasis.opendocument.text)
2017-01-26 16:14 UTC, Ulrich Gemkow
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Gemkow 2017-01-26 16:14:26 UTC
Created attachment 130705 [details]
Test document

Pasting text (ctrl-v) in an paragraph which has a modified style changes the paragraph style.

To reproduce

- Open the attached example document

- Select a few chars in the indented text

- Copy the chars (ctrl-c)

- Paste (ctrl-v) in the middle of the indented paragraph

The style of the paragraph changes which should not happen. It is not obvious which attributes are changed.

The "list bullet style" is custom-made. I was not able to reproduce this with a "bare example". I have no idea what happens.

The bug only happens when pasting, not when typing.
Comment 1 Vitaliy 2017-01-27 10:56:06 UTC Comment hidden (obsolete)
Comment 2 Vitaliy 2017-01-27 10:56:29 UTC Comment hidden (me-too, obsolete)
Comment 3 Ulrich Gemkow 2017-08-10 20:06:47 UTC
Further investigation shows that this is a problem with an old LO document opened in a new LO release:

The attached document was created with a older LO release which had not yet separated the list styles from the "Styles and Formatting" list of styles. For this document the list format was modified in the paragraph styles with the old LO release.

When editing the old document in the current LO release the changing of the paragraph "auto-assigns" the list style to the paragraph and this style is different from the old modified list style.

When opening the attached document in the current LO release you see that the list styles are in both lists.

I cannot judge what would be the correct behaviour. IMHO it would be correct to copy the "old" list styles to the new ones when opening an old document to be backward compatible. Or is the current behaviour intended?

[Unfortunately I cannot determine which old LO release was the creator of the document, the document was changed several times with different LO releases]
Comment 4 QA Administrators 2018-08-18 02:38:49 UTC Comment hidden (obsolete)
Comment 5 Ulrich Gemkow 2020-03-08 20:54:38 UTC Comment hidden (obsolete)
Comment 6 Heiko Tietze 2020-03-12 07:47:45 UTC
When you paste into an empty paragraph the source paragraph style will be used. If the target is not empty, for example when you add a single space, the target style will be used. That applies only to paragraph styles, of course. The discussion runs on bug 98381 and bug 100018.

*** This bug has been marked as a duplicate of bug 98381 ***
Comment 7 Ulrich Gemkow 2020-03-15 07:35:04 UTC
Thanks for looking into this. But this is IMHO not the same as #98381 and not handled there.

Take the test document, select a few character _inside_ of the paragraph, press Ctrl-C and then inside the same paragraph press Ctrl-V and the style changes.

This is text from the same paragraph pasted inside the same paragraph.

This behavior can IMHO never be correct, it is not what a user expects.

Thanks again!
Comment 8 Heiko Tietze 2020-03-16 13:18:58 UTC
True, this one was wrong. But a bug like this has been reported before with high probability and I found some relevant issues. No idea what exactly goes wrong here.

*** This bug has been marked as a duplicate of bug 77651 ***
Comment 9 Timur 2021-04-26 09:53:22 UTC
Repro 7.2+ so not a duplicate of bug 77651.
Comment 10 Timur 2021-04-26 09:55:46 UTC
*** Bug 136982 has been marked as a duplicate of this bug. ***
Comment 11 Timur 2021-04-26 10:44:30 UTC
Hi Miklos. Since you fixed  bug 101534, can you explain if this should be fixed or not per Comment 3.
Comment 12 Miklos Vajna 2021-04-26 11:11:59 UTC
Sounds like this is working as intended: paste doesn't overwrite styles in the target document, so if your original content was formatted with styles and the target has styles with the same names, then it's wanted behavior to change the formatting during paste.
Comment 13 Ulrich Gemkow 2021-04-26 12:06:29 UTC
IMHO this not expected behavior.

When selecting characters from a source paragraph and pasting these characters into a target paragraph, I do not expect that the format of the source paragraph is pasted and replaces the target paragraphs settings.

The _paragraph_ style should not at all be attached to selected characters from a paragraph.

I would expect that pasting transfers the character style of the pasted characters but not the paragraph styles.
Comment 14 Heiko Tietze 2021-04-27 10:17:59 UTC
But if the paragraph is empty with Default PS, isn't it a convenience feature to keep the source style? Pretty easy to paste without styles anyway.
Comment 15 Ulrich Gemkow 2021-04-28 21:59:12 UTC
(In reply to Heiko Tietze from comment #14)
> But if the paragraph is empty with Default PS, isn't it a convenience
> feature to keep the source style? Pretty easy to paste without styles anyway.

This may be convenient but the usability costs are IMHO too high. Copying characters from a paragraph to another should not change the targets paragraphs style.

Side node on copying paragraph styles: Old MS word (sorry for referencing this) had a notion of a paragraph style char at the end of each paragraph (a mirrored P). Copying this special charactr (with or without preceding characters) copied the paragraph style. This is IHMO a good solution.

But please look at the original bug report: The bug is that copying characters from a paragraph in an existing document in the _same_ paragraph in the _same_ document changes the style of this paragraph - I cannot imagine any explanation that this can be correct.
Comment 16 Heiko Tietze 2021-04-29 08:57:29 UTC
I respectfully disagree. Given your text consists of <heading><text> and now you want to copy/paste the first heading. But since the paragraph style after text is text again you always have to format the headings after copy/paste. That's definitely not wanted. In my opinion we have a pretty good implementation.

(In reply to Ulrich Gemkow from comment #15)
> Copying this special character ... copied the paragraph style.

We do it the other way around and you paste spacial > only text per ctrl+shift+insert. That's what I meant with "easy to paste without styles".
Comment 17 Ulrich Gemkow 2021-04-29 20:19:40 UTC
(In reply to Heiko Tietze from comment #16)
> ...

> (In reply to Ulrich Gemkow from comment #15)
> > Copying this special character ... copied the paragraph style.
> 
> We do it the other way around and you paste spacial > only text per
> ctrl+shift+insert. That's what I meant with "easy to paste without styles".

I understand, thanks (maybe you mean ctrl+shift+alt+V, "Paste unformatted text"). But this also removes the character style from the pasted text. So I have no way to paste text with the characters style retained but not the paragraph style.

I see the different view: IMHO selecting characters and pasting them should paste what I selected (the characters and their style) and not more (not the paragraph style).

Thanks again for looking into this.