Download it now!
Bug 40560 - Paste of paragraph with direct formatted indent into numbered paragraph destroys paragraph format
Summary: Paste of paragraph with direct formatted indent into numbered paragraph destr...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.4.3 release
Hardware: All All
: medium major
Assignee: Not Assigned
URL: http://docs.oasis-open.org/office/v1....
Whiteboard:
Keywords:
Depends on:
Blocks: Paste Bullet-Number-Outline-Lists Paragraph-Indent Formatting-Text-Diverse
  Show dependency treegraph
 
Reported: 2011-09-01 09:38 UTC by David C. Rankin
Modified: 2019-09-09 13:21 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Test document with numbered paragraphs (10.36 KB, application/vnd.oasis.opendocument.text)
2011-09-01 09:38 UTC, David C. Rankin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David C. Rankin 2011-09-01 09:38:16 UTC
Created attachment 50824 [details]
Test document with numbered paragraphs

This may be directly related to https://bugs.freedesktop.org/show_bug.cgi?id=40558 but is a separate and distinct bug in Libre.

When using numbered paragraphs in Libre, any attempt to paste text anywhere into a numbered paragraph, completely destroys the paragraph format for the numbered paragraph. It changes the margins and the hanging indent of the paragraph. Even pasting a single word into the middle of a numbered paragraph completely screws it up. This makes any type of legal document preparation impossible.

I have prepared a test document and included it as an attachment. Simply open the document and try to paste anything into paragraph 2. The whole paragraph format settings are messed up. Simply copying one word into the paragraph is enough.

I don't know when this was introduced, but it renders editing numbered paragraphs with copy/paste in Libre impossible.
Comment 1 Björn Michaelsen 2011-12-23 12:35:22 UTC Comment hidden (obsolete)
Comment 2 David C. Rankin 2012-04-12 20:51:53 UTC
Still present in 3.5.1-1.
Comment 3 A (Andy) 2014-09-20 21:08:23 UTC
reproducible with LO 4.3.1.2 (Win 8.1)

If I copy text from anywhere in this attached document then I can reproduce it.  But if I copy it first to the Windows Editor and then from this Editor to LO then everything is fine.
Comment 4 Gordo 2015-04-30 13:54:12 UTC
Still reproducible in 4.4.2.2

I reproduced this from scratch by taking a numbered list and applying various indents to it from the Sidebar.

Action/Formatting lost?
increase indent -> no
switch to hanging indent -> yes
before text indent -> yes
first line indent -> yes

It reverts back to the default position and spacing as seen in Bullets and Numbering -> Position tab from the context menu.

Paste Special -> Unformatted Text does not cause the numbered list to lose its formatting.

Version: 4.4.2.2
Build ID: c4c7d32d0d49397cad38d62472b0bc8acff48dd6
Comment 5 QA Administrators 2016-09-20 09:37:51 UTC Comment hidden (obsolete)
Comment 6 Thomas Lendo 2018-01-17 13:08:07 UTC
Reproduces with 6.0.0.2 (x64).

I also ran into this issue while working with lists within paragraphs which have indent before text.

Additionally I work much with marginal note in indents before text. A list style can't assigned to both paragraphs with indents and paragraphs without (or another) indents because the list style overwrite the paragraph attribute. You have to create a list style for a paragraph with indent and a second one for a paragraph without indent (or another indent). This is ridiculous.

I find that a list style should be "put on" a paragraph as you can't use a list without a paragraph--every list item is also part of a paragraph.

Example of content.xml with a list style (Numbering_20_ABC) and a direct formatted list (L1):

<style:style style:name="P1" style:list-style-name="Numbering_20_ABC" style:parent-style-name="Hanging_20_indent" style:family="paragraph"/>
<style:style style:name="P2" style:list-style-name="L1" style:parent-style-name="Hanging_20_indent" style:family="paragraph"/>

For all attributes that exist in paragraphs and lists, the list attributes should add their values to the attributes of the paragraph and not overwrite them.

With that you could use a list style on different paragraph styles.

@Regina:
Is it possible to change the behavior of lists (and list styles) so that they don't overwrite indents and other attributes of the parent paragraph and only add their own indent/alignment/margin/attribute?
Comment 7 Regina Henschel 2018-01-17 15:59:08 UTC
(In reply to Thomas Lendo from comment #6)
> 
> For all attributes that exist in paragraphs and lists, the list attributes
> should add their values to the attributes of the paragraph and not overwrite
> them.
> 
> With that you could use a list style on different paragraph styles.
> 
> @Regina:
> Is it possible to change the behavior of lists (and list styles) so that
> they don't overwrite indents and other attributes of the parent paragraph
> and only add their own indent/alignment/margin/attribute?

I think, that a change is not possible and not needed.

The conflict between list and paragraph is only in the attributes fo:margin-left and fo:text-indent. Any other influence of list numbering on paragraph is an error.

The spec explains it in section 17.20. <style:list-level-label-alignment>, 19.237 fo:margin-left and 19.246 fo:text-indent. The problem might be, whether inherited values of fo:margin-left and fo:text-indent for the paragraph also fulfill "paragraph style specifies fo:margin-left and fo:text-indent". LibreOffice denies this.
Therefore the rule "paragraph overrides list" is only applied, if the list style is directly referenced by the paragraph style. In UI you get this, if you select the list style in the Outline&Numbering tab of the paragraph style. The automatic numbering produces a similar structure. As long as you change the indent of all paragraphs in the list at the same time, this structure is retained.

The fact, that inserting into a list item changes its automatic paragraph style, is a special problem with the attached document. Inserting sets a new automatic paragraph style without own fo:margin-left and fo:text-indent here. I have no idea, what is wrong with the attached document. I cannot produce it from scratch and if I use "Save a copy" with the attached document, and then test the behavior on the copy, I do no longer see the error. I have made the tests with LO 6.1. The document is from LO 3.4. Perhaps some compatibility setting?
Comment 8 Thomas Lendo 2018-01-17 19:17:32 UTC
Regina, thanks fo your comment. I had not only the attachment of this report in mind but list/paragraph interference in general. 

So what should be done with the attributes fo:margin-left and fo:text-indent in the case I described in comment 6? List indent should be additionally added to paragraph indent (in my view) and not override para indent. I think of paragraph-agnostic list styles. I see no sense in lists that define margin and indent when paragraphs do that already.

Assigning a list to a paragraph in the para dialog complicated the list/paragraph behavior and is no solution for Benjamin. Or I'm working with Writer not as intended and I should change that and create own paragraph style with assigned list style for every indent variant I have. I'll create a new test document.
Comment 9 Regina Henschel 2018-01-17 20:31:50 UTC
Hi Thomas, that is a general discussion and should not be here in this bug report in Bugzilla. This bug report is only about the curios behavior of the attached document.
Comment 10 Thomas Lendo 2018-01-17 22:52:02 UTC
I can reproduce the issue with the attached document and a completely new document created with LibO 6.1.0.0.alpha0+ from 2018-01-09_01:20:44. It's a problem that is caused by the indent.

Steps to reproduce:
1) Open a new Writer document.
2) Insert 3 lines of text.
3) Assign a list style from the Styles sidebar to the 3 lines.
4) Select the 3 list lines and open the paragraph dialog (context menu > Paragraph...)
5) Go to Indents & Spacing tab.
6) Change the value "Before text".
7) Copy the first line and paste it into the second line.

Actual result:
The indent of the second line changes.

Expected result:
Only the text is added without changing the formatting. Especially because the text with the same style and direct formatting has been pasted.


You can test that the attached document has been changed by direct formatting (DF) when using Ctrl+M to the whole content. Without that DF then the problem doesn't occur anymore.
Comment 11 QA Administrators 2019-04-05 02:59:41 UTC Comment hidden (obsolete)
Comment 12 Timur 2019-09-09 13:18:22 UTC
Sorry for not reading all, but this simply works in 6.4+, probably 6.2.7 also.
Comment 13 Timur 2019-09-09 13:21:18 UTC
Already in 6.1.