Bug 155740 - Support distinction rather than override of conflicting subdocument styles
Summary: Support distinction rather than override of conflicting subdocument styles
Status: RESOLVED WONTFIX
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: Writer-Master-Doc
  Show dependency treegraph
 
Reported: 2023-06-08 20:47 UTC by Eyal Rozenberg
Modified: 2023-09-18 13:21 UTC (History)
2 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-06-08 20:47:43 UTC
When you add subsequent documents to a master document, styles already existing in the master document (including those from previous inserted documents) are kept, and the same-name styles from the newly-inserted document are discarded.

While this is not a bug, a user may well want different behavior. That is especially true with commonly-used styles, those styles defined by default, like the default PS, Body Text, Emphasis, Default Page Style, etc. Sometimes, you want to align subsequent documents to the style of the first; but sometimes, you may want to preserve the styling in each of the documents, because the differences are intentional.

Some specific example: One subdocument has all pages with light blue background (default page style), and the next subdocument has them in light green. These documents could constitute a children's book with different chapters in different background color.
Comment 1 Dieter 2023-06-28 08:57:37 UTC
I remember a similar report with overriding styles (not in master documents, but pershaps with loading styles from a differnet document), but I couldn't find it.

cc: Design-Team
Comment 2 David 2023-06-29 12:43:12 UTC
(In reply to Eyal Rozenberg from comment #0)
> Some specific example: One subdocument has all pages with light blue
> background (default page style), and the next subdocument has them in light
> green. These documents could constitute a children's book with different
> chapters in different background color.

For this particular use case, is there a reason why modifying the settings for the section in the master document to which the subdocument is linked wouldn't work as designed?
Comment 3 Shu Zhang 2023-06-30 19:04:58 UTC
do you think it is better when you try to add the subsequent document it will have a pop-up window or something like that to make you choose to either keep the existing styles or follow the master document style.
Comment 4 David 2023-07-01 05:57:07 UTC
(In reply to Shu Zhang from comment #3)
> do you think it is better when you try to add the subsequent document it
> will have a pop-up window or something like that to make you choose to
> either keep the existing styles or follow the master document style.

I think what you would be asking for is if the settings for the section in the master document should be reset to match the settings of the linked document.
Comment 5 Heiko Tietze 2023-07-01 10:08:28 UTC
(In reply to Dieter from comment #1)
> I remember a similar report with overriding styles...

Bug 112697 for Impress? 

Mike, what do you think about such an option? I wouldn't ask the user and rather have a toggle box somewhere. It is very likely that you have "Body Text" (or Default) in all documents.
Comment 6 Mike Kaganski 2023-07-01 10:59:28 UTC
Definitely not a bug, and a WONTFIX.

The most important idea behind the master documents is exactly being able to centrally configure styles. The premise that styles in sub-documents are "discarded" is wrong, and they are "overridden" *temporarily*, i.e. when you open a sub-document by itself, they will keep the original properties. Among other things, this allows a kind of "css", when different master documents override same styles in different ways.

If one wants some distinction in their *part* of a multi=part document, they need to create new styles (or use ad-hoc formatting, if it's a single-use case).
Comment 7 Eyal Rozenberg 2023-07-01 22:03:55 UTC
(In reply to Mike Kaganski from comment #6)
> Definitely not a bug

I explicitly said in comment #0 that this is not a bug - it's an enhancement request.

> and a WONTFIX.

It is impolite to mark an issue WONTFIX based on UX considerations when you're not, say, Heiko, without first waiting for a reply to your claim. If you had made a development consideration (e.g. "impelementing this introduces exponential time complexity for rendering") - then maybe it would be legitimate. Or if the reporter were a known crank. etc.

> The most important idea behind the master documents is exactly being able to
> centrally configure styles.

1. That is not the most important idea. The most important idea is having a document composed of individual, existing documents "by reference" rather than "by value", i.e. not by concatenating copies of the existing documents.

2. "Centrally configure" does not necessarily being with "delete non-central configurations".

> The premise that styles in sub-documents are
> "discarded" is wrong, and they are "overridden" *temporarily*, i.e. when you
> open a sub-document by itself, they will keep the original properties.

They are discarded in the context of the larger document. And I explained and gave an example of when the user may want them kept rather than discarded.

> Among
> other things, this allows a kind of "css", when different master documents
> override same styles in different ways.

I never said the user _never_ wants to override sub-document styles. I'm saying the user _sometimes_ wants to override, and sometimes - to keep. 

> If one wants some distinction in their *part* of a multi=part document, they
> need to create new styles (or use ad-hoc formatting, if it's a single-use
> case).

No, they don't. They created a self-contained, perfectly valid document - as well they should have. In fact, they probably need to _not_ create new artificial styles; documents should definitely use styles with the common names (e.g. Footnote, Emphasis, Internet Link etc. etc.)
Comment 8 Heiko Tietze 2023-07-03 08:43:15 UTC
(In reply to Eyal Rozenberg from comment #7)
> It is impolite to mark an issue WONTFIX based on UX considerations when...
Since we do open-source business my _opinion_ has as much value as anyone's else. In most cases I agree with (or trust) Mike as he has the meritocracy of senior development with client relation and ask-libreoffice experience.

For this particular topic I'd take his -1 as a strong argument against an option. While it sounds reasonable at first the point of master documents is in fact to not just copy documents together but have a consistent layout.

Anyway, I'll put it on the agenda for next week.
Comment 9 Eyal Rozenberg 2023-07-03 09:10:27 UTC
(In reply to Heiko Tietze from comment #8)
> (In reply to Eyal Rozenberg from comment #7)
> Since we do open-source business my _opinion_ has as much value as anyone's
> else. In most cases I agree with (or trust) Mike as he has the meritocracy
> of senior development with client relation and ask-libreoffice experience.

I wasn't suggesting Mike's opinion is of less merit. The question is whether it's Mike's decision to close a bug as WONTFIX immediately after opining about it - which is like claiming that there is to be no arguing with his opinion. 

The approach I've see you take (and which I believe is the appropriate one) is saying what you believe should happen with the bug (e.g. writing "=> WF" or "=> NOTABUG"); letting other there voice strong objections/counter-arguments; then acting.
Comment 10 David 2023-07-03 09:18:04 UTC
(In reply to Eyal Rozenberg from comment #7)
> They are discarded in the context of the larger document. And I explained
> and gave an example of when the user may want them kept rather than
> discarded.

Since the proposed example was reiterated as a prime example of the issue, I'll ask again, Is there a reason why modifying the settings for the section in the master document to which the subdocument is linked wouldn't work as designed to set the background for that section to match the linked document? Given your example and my understanding of it, I fail to comprehend the problem.
Comment 11 Mike Kaganski 2023-07-03 09:40:49 UTC
(In reply to Eyal Rozenberg from comment #9)

1. You are trying to over-regulate the procedure, without thinking why it is as it is (and removing my resolution, when I would ask if it's up to you to do that, and if it's polite). The why is that usually all would behave as you expect; but sometimes the problem gets the attention of someone who is not just guessing, but who happens to know exactly; and that person takes the responsibility to give a final decision on a problem that shouldn't waste others' time.

2. Your example is exactly why it should *not* be implemented. Even in your example, there's no way every part would need *every* bit different; and most likely, it would need *most* (but a couple of details) consistent. Fonts, their sizes, spacing, headings, ... In this case, implementing your proposal breaks the fundamental principle of the master documents (which you refuse), which is - ability to set the style centrally, and have all the sub-documents look consistent. Someone making the final preparations, and deciding to change something, would have to edit individual documents on each and every thing they need to change globally.

Direct formatting, or separate styles per chapter, which is something that the creator would be perfectly aware of, is the solution to your example.
Comment 12 Mike Kaganski 2023-07-03 09:54:33 UTC
Additional points to those who will have to consider this on the next UX call:

1. Master documents is an advanced feature, not *designed* as something to be used without a bit of learning. A proposal designed to enable use like "I suddenly decided to use this feature with a set of documents not designed with master documents in mind" is not a proper scenario here. If someone makes a mistake while using the feature the first time (without reading the guides), it's simply part of learning curve, not a justification to break this feature by breaking its founding principle.
2. Creating even more complex "solution", like "let me decide what to keep, and what to override" is also not a useful option. In cases of inheriting, this would create a mess, with uncertainty, from where to inherit - from original document's style, or from master override; impossible complexity to understand it from user's PoV.
Comment 13 Eyal Rozenberg 2023-07-06 19:51:24 UTC
(In reply to David from comment #10)
> Is there a reason why modifying the settings for the section
> in the master document to which the subdocument is linked wouldn't work as
> designed to set the background for that section to match the linked
> document? Given your example and my understanding of it, I fail to
> comprehend the problem.

It would work. But you will need to do this for _every_ setting of _every_ style of _every_ subdocument which is overridden by the master document. And you should not have to.
Comment 14 Eyal Rozenberg 2023-07-06 19:57:05 UTC
(In reply to Mike Kaganski from comment #11)
> 2. ... Even in your
> example, there's no way every part would need *every* bit different; and
> most likely, it would need *most* (but a couple of details) consistent.
> Fonts, their sizes, spacing, headings, ... In this case, implementing your
> proposal breaks the fundamental principle of the master documents (which you
> refuse), which is - ability to set the style centrally, and have all the
> sub-documents look consistent. Someone making the final preparations, and
> deciding to change something, would have to edit individual documents on
> each and every thing they need to change globally.

But that's only if they explicitly chose to keep all of the subdocument styles, i.e. only if they wanted this to happen. And - they may well want this to happen! 

See further about this below.

> Direct formatting, or separate styles per chapter, which is something that
> the creator would be perfectly aware of, is the solution to your example.

Direct formatting is only even a solution for something which happens once. Formatting in a subdocument happens many times; I gave a page style as an example - maybe it's a base style of several page styles? Or maybe what I want to keep is one of the character or paragraph styles etc.

Mike, I think you might may be making an implicit assumption that the author of the master document has written the subdocuments with the prior intent to place them in a master document. I'm thinking in this issue more about the user who wants to integrate an independently-authored document, which would have stood on its own, into the master document. 

Here's another use case, exemplifying this perhaps more strongly: I'm working on some legal brief, or report, to which I want to attach documents somebody else has written (and luckily for me, they are available as (maybe read-only) ODT's or DOCX's). Each of those documents has its styles defined via Text Body, Normal, Heading 1,2,3 etc. and so on. And - they might be different. When I use these as subdocuments - I want all of their styles _preserved_.
Comment 15 Mike Kaganski 2023-07-07 05:47:02 UTC
(In reply to Eyal Rozenberg from comment #14)
> Mike, I think you might may be making an implicit assumption that the author
> of the master document has written the subdocuments with the prior intent to
> place them in a master document.

Exactly; I even stated that explicitly:

(from comment #12)
> 1. Master documents is an advanced feature, not *designed* as something to
> be used without a bit of learning. A proposal designed to enable use like "I
> suddenly decided to use this feature with a set of documents not designed
> with master documents in mind" is not a proper scenario here.

I strongly believe that what you explain below is not a proper use of master documents feature:

> I'm thinking in this issue more about the
> user who wants to integrate an independently-authored document, which would
> have stood on its own, into the master document. 
> 
> Here's another use case, exemplifying this perhaps more strongly: I'm
> working on some legal brief, or report, to which I want to attach documents
> somebody else has written (and luckily for me, they are available as (maybe
> read-only) ODT's or DOCX's). Each of those documents has its styles defined
> via Text Body, Normal, Heading 1,2,3 etc. and so on. And - they might be
> different. When I use these as subdocuments - I want all of their styles
> _preserved_.

Any LibreOffice *document* is a *source*, i.e. an artifact allowing to *author* the content. The *authoring* is the primary goal of existence of all the office document formats, the reason why we don't use raster bitmaps for our documents. (I exaggerate, just to emphasize my point.)

Indeed, people might want to store these artifacts, instead of dumping in the end after creation of a hard copy. But this is still to be able to reuse, change, or inspect the structure - if not these reasons, PDF would be a better choice for storing after the document is finished.

But specifically for the "legal brief", the insertion of *other document sources* into your document is *incorrect*: these documents' structures do *not* contribute your document's structure; you are not expected to edit them, but these other documents are just replicas of some state of those documents in some specified moment in time.

And while I want to stress, that your own "legal brief" example is, IMO, *strong* case where master documents should *not* be used (and, e.g., scans/PDFs of those documents should be inserted), I also say that it would hold for *any* case when you collect multiple documents into one, when the sources were *not* created with master document / consistent style in mind, and you want to keep the heterogenous styling of sources in the end result.

I can see a Paste Special (*not* master document!), which would convert source style names to unique names on paste, or convert everything to DF.
Comment 16 Shu Zhang 2023-07-07 21:04:52 UTC
like mike said use the paste special function, and then you can keep the source style names. Is this function solve your issue, or do you think this paste special function missing something you needed?
Comment 17 Eyal Rozenberg 2023-07-07 21:44:23 UTC
(In reply to Shu Zhang from comment #16)
> like mike said use the paste special function, and then you can keep the
> source style names. Is this function solve your issue, or do you think this
> paste special function missing something you needed?

Even if this was a reasonable thing to do conceptually, I couldn't keep the source style names, in general, for two reasons:

1. Many of them are the default/built-in style names.
2. Other are styles derived from those default styles (although perhaps that's a different issue)

it's also not reasonable, since pasting defeats the whole purpose of a master document, which is having links to subdocuments rather than copies of their contents.
Comment 18 Heiko Tietze 2023-07-14 07:27:40 UTC
We discussed the topic in the design meeting. We agree with comment 6 and other that MD provides a way to achieve style consistency. While the option shouldn't have much impact on usability it is against the simplicity principle. It _might_ be nice being able to combine documents without loosing the individual style but there is not scenario that makes it absolutely necessary. Corner cases can be solved easily. So the suggestion is to not implement this proposal.