Bug Hunting Session
Bug 108233 - Paragraph inside a table cannot be given the formatting property "Page break before"
Summary: Paragraph inside a table cannot be given the formatting property "Page break ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: ODF-import Writer-Page-Break
  Show dependency treegraph
 
Reported: 2017-05-29 22:19 UTC by tony.g2
Modified: 2019-01-15 06:36 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
File having the "Page break before" property on two instances of text "bb". (19.00 KB, application/msword)
2017-05-29 22:27 UTC, tony.g2
Details
Table with fo:break-before on a table row (9.79 KB, application/vnd.oasis.opendocument.text)
2017-05-30 19:07 UTC, Regina Henschel
Details
Attaching same file as earlier in .odt format. (9.44 KB, application/vnd.oasis.opendocument.text)
2017-05-30 19:17 UTC, tony.g2
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tony.g2 2017-05-29 22:19:08 UTC
Description:
A paragraph can be given the property "Page break before" with the sequence:
  Format | Paragraph | Text Flow | Insert(on), Type(Page), Position(Before)

If the paragraph is inside a table, the Insert() check-box is grayed out.

Steps to Reproduce:
1. Create a new document in Writer.
2. Display formatting marks - View | Formatting Marks
3. Insert a 2 x 2 table - Table | Insert Table | Insert
4. Place cursor in any cell of the first column of the table.
5. Show Text Flow dialog - Format | Paragraph | Text Flow

Actual Results:  
In the Text Flow dialog, the Insert box is disabled.


Expected Results:
In the Text Flow dialog, the Insert box should be enabled. 


Reproducible: Always

User Profile Reset: No

Additional Info:
If the cursor is placed in a paragraph which is not inside a table, then the Insert box is enabled. If it is checked, the paragraph is moved to the next page (i.e. it has a page break before).

In MS Word, it is possible to give the property "Page break before" to a paragraph inside a table. I the paragraph is in a cell of the first column of a table, this causes the row to be moved to the next page.

The attached file was created in MS Word 97.
The two paragraphs with the text "bb" both have the "Page break before" property and are placed at the top of a new page when printed in MS Word.


User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:42.0) Gecko/20100101 Firefox/42.0
Comment 1 tony.g2 2017-05-29 22:27:29 UTC
Created attachment 133704 [details]
File having the "Page break before" property on two instances of text "bb".
Comment 2 tony.g2 2017-05-29 22:41:52 UTC
This problem exists in earlier versions of Writer too.
Comment 3 Regina Henschel 2017-05-30 07:04:27 UTC
See http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1417948_253892949

A page break introduced by the style:master-page-name attribute is ignored inside tables.

".doc" is not the native file format of LibreOffice. An example file in .odt format is needed.
Comment 4 Regina Henschel 2017-05-30 07:22:40 UTC
fo:break-before or fo:break-after should be possible as attribute of a table-row. That would be an enhancement request.

I would not allow a break, which is introduced by a paragraph, because that results in undefined behavior for the content of the other cells in the that row.
Comment 5 tony.g2 2017-05-30 18:37:24 UTC
(In reply to Regina Henschel from comment #4)
> fo:break-before or fo:break-after should be possible as attribute of a
> table-row. That would be an enhancement request.
> 
> I would not allow a break, which is introduced by a paragraph, because that
> results in undefined behavior for the content of the other cells in the that
> row.

This reasoning for not allowing a break by a paragraph in a table is perfectly logical. 

However, this causes some files created in MS Word to be formatted differently when opened in LO Write. In those files, any paragraph inside a table cell CAN have a "break before" attribute -- just like any other paragraph not in a table.

Word uses the following logic to define the behavior of such a "break before" attribute:
If the attribute is on the FIRST paragraph of the FIRST column of a row, it causes a page break before the row.
If the attribute is on any other paragraph in the table, it has no effect.
(This behavior seems to be consistent in all Word versions I have tried.)

So the question seems to be: Should Write have the most "compatible" (with Word) behavior? For people using Write to open files created in Word, I suspect the preferred answer would be "yes".

I have not yet seen the "break after" attribute in paragraphs in tables in Word files, but would be happy to test it if needed.
Comment 6 Regina Henschel 2017-05-30 19:00:31 UTC
So Word too does not insert a page break for arbitrary paragraphs, but only for exact one situation. And the case "first paragraph in first column" would fit exactly to a page break defined on a row. The ODF specification allows a page break setting for a row, but only LibreOffice has not implemented it.

After this basic it implemented, the filters for Word documents can be extended to "translate" between the different descriptions of the same behavior.
Comment 7 Regina Henschel 2017-05-30 19:07:34 UTC
Created attachment 133727 [details]
Table with fo:break-before on a table row

Added example in ODF.

The table should break before the row with "G". Such page break can be seen by application "TextMaker".
Comment 8 tony.g2 2017-05-30 19:17:47 UTC
Created attachment 133728 [details]
Attaching same file as earlier in .odt format.
Comment 9 tony.g2 2017-05-30 20:08:26 UTC
(In reply to Regina Henschel from comment #6)
> So Word too does not insert a page break for arbitrary paragraphs, but only
> for exact one situation. And the case "first paragraph in first column"
> would fit exactly to a page break defined on a row. The ODF specification
> allows a page break setting for a row, but only LibreOffice has not
> implemented it.
> 
> After this basic it implemented, the filters for Word documents can be
> extended to "translate" between the different descriptions of the same
> behavior.

(My last .odt attachment can be ignored. I had not seen the replies posted at about the same time.)

Good explanation.

So the filter would translate:
"page break before" on "first paragraph in first column" in row N (.doc file)
    to 
"page break on a row" on row N (.odt file).

I am not aware of any other case in a .doc file that would translate to the same target. So it seems that the reverse translation is also possible without ambiguity.

I have not yet checked if this translation is unambiguous (one to one mapping) in later versions of Word and .docx files.