Download it now!
Bug 124959 - The formatting of the target paragraph should remain intact upon pasting content from another paragraph
Summary: The formatting of the target paragraph should remain intact upon pasting cont...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Paste Writer-Styles-Paragraph Formatting-Text-Diverse
  Show dependency treegraph
 
Reported: 2019-04-25 14:25 UTC by Christian Lehmann
Modified: 2020-01-07 22:17 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Full description of bug, justification of complaint, suggestion (43.30 KB, application/pdf)
2019-04-25 14:28 UTC, Christian Lehmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Lehmann 2019-04-25 14:25:29 UTC
Description:
The current paste operation disfigures the formatting either of the source string or of the target paragraph.

Steps to Reproduce:
1. Mark a substring of some paragraph formatted one way.
2. Copy it.
3. Paste it into a paragraph formatted a different way.

Actual Results:
The target paragraph assumes the formatting of the source paragraph.

Expected Results:
The formatting of the target paragraph should remain intact.


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
The document attached describes it in full and suggests a repair.
Comment 1 Christian Lehmann 2019-04-25 14:28:22 UTC
Created attachment 151009 [details]
Full description of bug, justification of complaint, suggestion

Current functioning of the paste operation is based on the failure to distinguish between block-level formatting and inline-element formatting. It is suggested to observe this distinction.
Comment 2 Roman Kuznetsov 2019-04-26 07:10:04 UTC
did you try to use "Paste Special->Unformatted text"?
Comment 3 Christian Lehmann 2019-04-26 07:16:49 UTC
This is described extensively in the document appended to the report.
Comment 4 Buovjaga 2019-08-14 16:55:17 UTC
Design team: please inspect the attached design document
Comment 5 Heiko Tietze 2019-08-16 11:47:11 UTC
If you work with styles the copy/paste operation will not override in Writer. Workflow:
* Insert some dummy text, apply a style and change it to something else (eg font color red)
* Create another document, do the same as before but don't change the style
* Copy/paste from one into the other document
=> the document style is preserved (meaning the red font color is lost in one way or adopted in the other), and that's good, at least for Writer. 

There is a similar request for Impress in bug 112697 (and the duplicate bug 79928) where the situation is not so clear. What template (slide background color/image, indentation of bullets etc.) should be used for copy/paste operations? The source means you add another master or the target and you change the copied objects. Ideally we get a Paste Special option. 

Back to the topic, when you paste special in Writer per "Without Style" it's the same as "Unformatted Text" and the opposite "Adopt Style" (or whatever we call this option) it changes all your document as the inserted style is taken. Don't think it's useful this way. Could you provide a use case like "I copy <foo> from <bar> and paste at <baz> expecting <qux>?
Comment 6 Christian Lehmann 2019-08-18 17:38:03 UTC
At the moment, I can do nothing about this, since on my current installation (LO 6.1.4.2 on Windows 7), the bug does not show. I.e., when I copy a string from paragraph source to paragraph target, the formatting of the target is not touched, no matter whether it uses a predefined or a user-defined template. It thus appears that this bug is a feature of the Linux version. I will be back when I can use my Linux version.
Comment 7 QA Administrators 2019-08-19 07:11:22 UTC Comment hidden (obsolete)
Comment 8 Christian Lehmann 2019-10-31 18:23:54 UTC
I have now checked this for LO 6.3.2.2 on Kubuntu 18.04. Result:

I confirm (comment 5) that if the source paragraph has a style applied, copying part of this paragraph into another one does not transfer that style. Moreover, what I observed for the Windows version now holds for the Linux version, too: Paragraph properties are generally not transferred if only part of a paragraph is copied and pasted. I.o.w.: For properties applying to an entire paragraph, it does not matter for the copy/paste operation whether they have been stipulated specifically for the source paragraph or they are properties of a style applied to it. So far, so good; problem partly solved.

However, a difference appears for character properties:
- If a certain character property (say font size 10 pt) is set in the style applied to the source paragraph, it is not transferred by copy/paste of part of it.
- If the same property is assigned specifically to the source paragraph, then it is inherited by all of its parts and, therefore, transferred to the paste target.

This is still inconsistent. Properties applied to entire paragraphs should _never_ be copied if only part of them is copied.

Moreover, see Bug 113605, comment 6.
Comment 9 Heiko Tietze 2019-11-01 08:22:12 UTC
If you modify the paragraph style in document A and copy text into document B, the style of B is preserved, which makes sense. If the copied text has a character style or direct formatting applied, wouldn't expect anything else.

I don't see an issue.
Comment 10 Christian Lehmann 2019-11-01 08:32:28 UTC
We are talking about an attribute - a character style - applied to an entire paragraph (not to parts of it). Why is it treated differently depending on whether it is a component of a paragraph style or stipulated by direct formating of the given paragraph?
Comment 11 Heiko Tietze 2019-11-01 08:45:49 UTC
(In reply to Christian Lehmann from comment #10)
> character style - applied to an entire paragraph 

The character style (CS) is not meant to format paragraphs, it applies on single words or phrases and comes on top of the paragraph style (PS). For example, you can define the PS "Citation" in italic and a CS "InnerCitation" in normal weight.

Example: <i>He heard quiet steps behind him.</i> That didn't bode well.

From start to end of the CS formatted part it will adopt the copied text.

Example: <i>He heard quiet [didn't bode] steps behind him.</i> That didn't bode well.

And of course it also takes what your copy from

Example: <i>He heard quiet steps behind him.</i> That didn't <i>heard quiet</i>bode well.

The same happens with directly formatted text.
Comment 12 Christian Lehmann 2019-11-01 09:04:55 UTC
Maybe we have a terminological problem here. For reasons not transparent to me, recent editions of LO offer attributes like font size, italics and so on in two submenus of the Format menu, viz. in Text and Character [this should be undone, by the way]. I called this kind of attribute "Character" attribute just to comply with recent terminology. I was not referring to the rubric "Character Styles" of the Styles panel.
Now if that is settled, then your statement that this kind of attribute "is not meant to format paragraphs" does not hold. Of course I can apply such attributes to an entire paragraph. And it does make sense: Of course, we have paragraphs formated with a certain Text (or "Character") attribute, like quotations to be set in a smaller font size etc.
Now as said before, there are (at least) two ways of assigning such an attribute to a paragraph: Either in a Paragraph Style (this time, yes, using the rubric "Paragraph Styles" of that panel). Or else by marking the entire paragraph in question and assigning it the attribute in question (by any of the methods available for this operation). 
If we can agree on this, then I would uphold my complaint about the differential copy/paste treatment of the two paragraph attributes. Which is the treatment of such a text attribute holding for an entire paragraph that you would "expect" (as you say) on a copy/paste operation applied to part of it?
Comment 13 Heiko Tietze 2019-11-08 09:50:40 UTC
(In reply to Christian Lehmann from comment #12)
> Maybe we have a terminological problem here. For reasons not transparent to
> me, recent editions of LO offer attributes like font size, italics and so on
> in two submenus of the Format menu...

The main menu has Format > Text > Bold, Italic... which is direct formatting (it wont change across the document), with the context menu Character > Default, Emphasis... is character style (the appearance changes over the whole document if the style is modified). And the same is available at the main menu under Styles.

Paragraph styles do not override the target, character styles and direct formatting is taken into the target. The supposed way to format documents is to use paragraph styles for sections and to highlight only parts with character style.

That works perfectly for me and I recommend to resolve the issue respectively. Admittedly it's not really simple, as you may expect, but text processors are complex software and you have to learn concepts. The alleged inconsistency comes from the fact that we not only want to support expert users but also people who just write a short letter with no straight formatting, as an example.
Comment 14 Christian Lehmann 2019-11-08 10:42:05 UTC
(In reply to Heiko Tietze from comment #13)
> (In reply to Christian Lehmann from comment #12)
> > Maybe we have a terminological problem here. For reasons not transparent to
> > me, recent editions of LO offer attributes like font size, italics and so on
> > in two submenus of the Format menu...
> 
> The main menu has Format > Text > Bold, Italic... which is direct formatting
> (it wont change across the document), with the context menu Character >
> Default, Emphasis... is character style (the appearance changes over the
> whole document if the style is modified). And the same is available at the
> main menu under Styles.

I cannot reproduce this. First, taking stock:
a) The main menu Format has (among others) two submenus called Text and Character.
b) The context menu (available upon right-click in the document) only offers the Character menu plus a selection of Character Styles as available from #c.
c) In the Styles panel, there are (among others) catalogs of paragraph and of character styles. Upon modifying any of these, menus appear which offer features of the options also available from the main Format menu.

Now ignoring #c, I observe that the submenu Text of #a offers the very same features as the submenu Character. It is this what I considered redundant; the more so as the same features are, again, available as clickable icons in the Formatting Toolbar. One can also confuse the user by presenting the same features under different names.

As for #b, it does the same service as the submenu Character of #a plus the Character Styles list of #c. I observe no difference concerning the appearance changing over the whole document. This is as it should be.

> 
> Paragraph styles do not override the target, character styles and direct
> formatting is taken into the target. The supposed way to format documents is
> to use paragraph styles for sections and to highlight only parts with
> character style.
> 
But please consider the case that I made in comment 12: I can assign a certain Font property like, say, 11 pt, to an entire paragraph by defining and assigning a paragraph style which has this feature. Or else - if I have only one such paragraph in my document - I do not define such a style, but simply mark the paragraph and assign it this font property. I see nothing wrong in this latter procedure, nor do I see an alternate way of doing this which avoids the inconsistency that I mentioned.

Sorry if this exchange boils down to removing a misunderstanding. But hopefully it will lead to clearer menus and menu functions.
Comment 15 Mike Kaganski 2019-11-11 15:02:55 UTC
Could someone please provide *full* description of *every small* step needed to see the problem, and that full description followed by clear description of which result of the steps is considered wrong, and which is the expected result - all that without now-useless description of _why_, which is already tldr here?
Comment 16 Timur 2019-11-11 16:24:38 UTC
For me, problem here is the discussion itself, which repeats from time to time. What I do is convert those bugs to Documentation, like bug 112872 for clone formatting.
Documentation should be very clear with all those examples, so that we immediately can point there. But I can't see a good page on copy/paste with direct/style/character...