Bug 153676 - Page styles should include a default paragraph style like paragraph styles include a character styles
Summary: Page styles should include a default paragraph style like paragraph styles in...
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Writer-Styles Writer-Styles-Paragraph ODF-spec Writer-Styles-Page
  Show dependency treegraph
 
Reported: 2023-02-16 21:42 UTC by Eyal Rozenberg
Modified: 2023-02-17 14:21 UTC (History)
3 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 Eyal Rozenberg 2023-02-16 21:42:10 UTC
Each paragraph style has an "embedded" default character style (and whether that's implemented as specific CS features or a reference to complete CS is immaterial as far as this bug is concerned).

Similarly, each Page Style should contain a full set of Paragraph Style properties (or a reference to an actual Paragraph Style).

When setting a Page Style, the "Default Paragraph Style" would be that page style's default, rather than a document-wide default.


Motivation: 

* It is customary for pages used for an Index, Table-of-Contents or Endnotes (and no other content) to have various properties different than regular document content pages. Some of these features are "proper" page style features, such as the number of columns, or the use of footers or headers; but some are aspects of the paragraph style, e.g. different font size, spacing or margins.

* We already have this implemented for a single property, which is the text direction. Why just that and not all other Paragraph Style properties?

* If my page style has, say, a deep/dark-color background, it stands to reason I would want the text, by default, to have a color which contrasts with that color. But a Page Style doesn't currently have CS properties; it could have them if it had a default Paragraph Style (or default-paragraph-style properties).
Comment 1 Mike Kaganski 2023-02-17 04:44:19 UTC
This is IMO wrong, since page style is an *attribute* of paragraph (style). And this would introduce a possible circular problem.
Comment 2 Mike Kaganski 2023-02-17 06:28:23 UTC
Conceptually, text document is a text with attributes applied to parts of the text defining the end result. The text consists of the main entities, which are paragraphs. Then, paragraphs consist of text runs. These are the real constituents of the documents. *There is no pages*. The pages are the artifacts of the dynamic layout process (i.e., they emerge in WYSIWYG and at print). But each paragraph, by definition, has a paragraph style. If a paragraph has a DF, it is also an (auto) paragraph style, based on another real paragraph style. There is no way to define an "automatically assigned" paragraph style.

Automatically assigning paragraph styles based on page styles could happen in one of two ways. First would be like the "next paragraph style" mechanism: the editor would hard-assign it at the next paragraph creation time. This requires knowing which page style is current at the time of the paragraph creation. Which means that the layout must be known at creation time (ruling out any automated creation, e.g. macros and manual markup generation). And changing page style would make it inconsistent, where already assigned styles would not match the current page style in the changed layout.

Another way would be a dynamic assignment of paragraph style at layout time, and would require a conception of paragraphs without otherwise assigned para styles. Which is a nonsense in the ODT model.

Consider this situation. You type something on the first page. Its style A is decided in some way; and now you are near the bottom of it. You start a new paragraph. Its style depends on the active page style. Let's say, the automatic paragraph style X has spacing-before, or widow/orphan setting, to not fit on this page. The next page gets created automatically, to accommodate the content. Its style is defined by the previous page style's "next style". And this new page with its new style B defines another automatic paragraph style Y. And this paragraph style Y could, e.g., define that it has a page-break-with-page-style C. So instead of page style B, this next page much become style C. But style C could define yet another automatic paragraph style Z, and our new paragraph needs to be it (because its style is just being defined). But it could have new properties that allow it to fit to page 1 ...

All in all, I consider this proposal to be incompatible with text flow-oriented paradigm of Writer. It is more like page-oriented approach. If Draw/Impress had paragraph styles (which they should one day), it could be applicable there; and then, it would be the one difference between similar features in different modules.

For now, as in Writer, I consider this not only WONTFIX (i.e., "acknowledge the problem, but have reasons to not do it"), but even INVALID (as in "there is no such problem in the first place").
Comment 3 Eyal Rozenberg 2023-02-17 14:21:46 UTC
(In reply to Mike Kaganski from comment #2)

I had a long reply to your comment, which half-agrees with you, but then I realized I actually did not understand Writer page styles at all.

I'm marking this as INVALID for now, although my opinion is actually more complicated than that. Maybe we can chat about this sometime.