Issue 14253

Summary: Text section of master document loses page style
Product: Writer Reporter: Unknown <non-migrated>
Component: codeAssignee: AOO issues mailing list <issues>
Status: ACCEPTED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: esigra, issues, os_ooo, tamblyne
Version: OOo 1.1 BetaKeywords: oooqa
Target Milestone: ---   
Hardware: PC   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Description Flags
Master document created with red background for page style
Subdocument inserted into master document
Template used to create the master and the sub-document none

Description Unknown 2003-05-08 19:13:07 UTC

1) Create a template with a custom page style. Make something in the page style 
obvious, such as specifying a background color other than white. (That's to 
make the problem more obvious, not to make it happen.) In the template, set the 
initial page style to the custom style.

2) Create a new document based on the template. Add a line or text.

3) File | Send | Create Master Document. You now have a master document with 
one page based on the custom page style.

4) Create another document based on the template. Add some text.

5) Save this document as an ordinary document and close it.

6) Use the Navigator to insert the document saved in step 5 into the master 
document. Move the new document below the Text section.

Observed: The page no longer uses the custom page style.
Expected: Inserting a subdocument wouldn't change the page style of the master 
Comment 1 Unknown 2003-05-08 19:19:48 UTC
It looks as though this problem also explains why I've been having 
problems getting headers and footers to stick in a master document. 
Even when they're added at the document level (rather than the 
template), it appears they become part of the page style, not just a 
feature of the page itself.
Comment 2 Unknown 2003-05-29 22:24:55 UTC
Still a problem in 1.1Beta2
Comment 3 rblackeagle 2003-07-16 21:52:47 UTC
This behavior also happens in RC1.  In fact, in my case, the first
page of an inserted document reverts to "First Page" style despite the
fact that neither the Master Document nor the inserted sub-document
uses such a style.  Nothing can correct this error.  This behavior did
not exist in or any previous version of OOo.
Comment 4 mci 2003-09-18 16:31:53 UTC
reassigned to es
Comment 5 eric.savary 2003-09-23 08:09:53 UTC
Please attach a sample document.
Comment 6 Unknown 2003-09-25 15:17:07 UTC
Created attachment 9662 [details]
Master document created with red background for page style
Comment 7 Unknown 2003-09-25 15:22:17 UTC
Created attachment 9663 [details]
Subdocument inserted into master document
Comment 8 Unknown 2003-09-25 15:23:29 UTC
Created attachment 9664 [details]
Template used to create the master and the sub-document
Comment 9 tamblyne 2003-11-01 22:02:00 UTC
Unable to reproduce via reporter's instructions RH9/OOo 1.1.0  
Comment 10 Unknown 2003-11-03 16:58:38 UTC
I just retested this with OOo 1.1 on Windows 2000 SP4. I'm still 
seeing exactly the behavior I reported. In this case, I set up a page 
style with a yellow background. As soon as I added the sub-document 
to the master document, the background changed to white. Checking in 
the Stylist showed that the page now used the Default style instead 
of the one I set up.
Comment 11 tamblyne 2004-03-18 16:26:41 UTC
Confirmed -- 1.1.1b Mandrake 9.2
Comment 12 auberger 2004-03-29 21:38:27 UTC
Confirmed on OOo 1.1.0 on SuSE 9.0 (x86): Master document uses only one page
style and ignores custom page styles from linked documents. Even if the same
page style exists in the master and the referenced document it is ignored by the
Comment 13 rblackeagle 2004-03-30 00:23:52 UTC
Here is a workaround:
IN THE MD: Insert some of the front matter (title page, etc) before any inserted

IN THE TEMPLATE: Load and save it with a document title (to distinguish it from
the general template).  Then double-click on each page style (so it is the
active page style) and set the headers and footers the way you want them
(including Fields).

NOW: When you load the MD and it updates the sub-docs, everything should work as
expected.  Just remember: NEVER MAKE CHANGES TO THE MD (other than the front
matter) BUT TO THE TEMPLATE INSTEAD (so that all changes are part of the sub-docs).

Remember: A style name in the MD overrides an identical name in a sub-doc.  If
you want to see the sub-docs (when editing) in the same form as it will appear
in the MD, you MUST set changes in the template, otherwise what you get will not
propagate correctly from sub-doc to MD.

This is a clumsy workaround that defeats the purpose of templates (having a
style set you can use for multiple documents) because you now have to have a
separate template for each Master Document.

Expected behavior: Header, footer and Outline Numbering information should ALL
be saved with the MD.  (Bet you haven't found out about the Outline Numbering
bug, yet.)
Comment 14 eric.savary 2004-04-15 17:02:55 UTC
ES->OS: sum up:
- a master doc and a sub doc based on the same template have (for instance)
'First Page' as current page style set.
- insert the sub doc in the master doc
-> page style resets to 'Standard'.
Comment 15 rblackeagle 2004-04-16 19:41:36 UTC
For some strange reason (the reason that leads to the "workaround" I posted,
page styles are ignored, regardless of the template, unless the MD has some text
in it as well.  If the MD is just used as a sub-doc holder and nothing further,
it simply does NOT work.

I guess that's the simplest description of the problem.

I have played around with it a bit more and find that the following steps need
to be taken.  In order to make it work, the sub-doc needs to be second -- it
will not work with "Text" at the top, so the inserted sub-doc needs to be moved
below.  BEFORE doing that, you MUST insert a Manual-Break defining the style for
the inserted doc's first page and the page number (normally "1").  Now you have
two blank pages so printing must be from page 3-, it simply doesn't work if you
try to print the entire document.

Now, unless you have a unique first page style defined with "Break Before" and
the page style set, you MUST have a Manual Break before each new sub-doc (but
not changing the page number after the first).  Again, if you don't do that, you
cannot end up with something.

BTW, deleting the "Text" and having only inserted sub-docs complete disables the
styles of the sub-docs -- there is no way to reach them without a Manual Break
and the resulting blank pages.
Comment 16 Oliver Specht 2004-04-26 12:52:45 UTC
os->dvo: Inserting a linked section doesn't reset the break-with-pagestyle.
It only happens when SwEditShell::InsertGlobalDocContent() is used.
Any idea?
Comment 17 openoffice 2004-11-26 19:19:57 UTC
Some investigation reveals: The break-with-style attribute is deliberately
removed when copying text nodes, which in turn is called whenever linked
sections (or subdocuments) are loaded. The decision was made in days and can be found in the (old) bugtracker, issue #61467#.
The code necessary to maintain break-with-style is still in the sources, but
commented out. (sw/source/core/attr/swatrset.cxx#308)

(If one just allows copying it still doesn't work, because then the attribute
refers to the page style from the source document. The attribute always needs
special treatment so that a corresponing page style in the host document is used
or created.)

The main reason was apparently: A new page style affects all subsequent pages,
which would allow a linked section to modify the styling of content outside the
section. Also, I see the break-with-style attribute is treated specially in a
number of places. Apparently we're trying to hide that it is actually a styling
attribute, and try to maintain a behaviour as if a page-break is actually some
kind of content element just before the respective paragraph.

The only work-around I can see is to create corresponding paragraph styles with
page breaks, and use them in both the master and sub-documents. That's ugly, and
I suspect no average user will ever find out...

dvo->rblackeagle: Unfortunately I entirely fail to see how your work-around
would work around the bug. No problem, though; I think now I understand the
problem well enough to fix it. :-)

dvo->TamarGranor: Nice bugdoc. That helped quite a bit.

dvo->os: Also, this appears to affect ALL linked sections. A regular linked
section uses the same code, and shows the same behaviour as global document
sections. I can't see how SwEditShell::InsertGlobalDocContent() comes into play
with any of this.

dvo->os: We need to discuss... I think this bug report is perfectly reasonable.
That a page-break-with-style affects all subsequent pages is the nature of the
attribute, and shouldn't really be a reason to disable them in linked sections.
Currently, we disallow ALL manual page breaks in linked sections, which doesn't
may much sense to me. [*] Still, I can see the original point for making the

[*] We could also change it such that the page break is allowed, but not with
changing the page style.

Comment 18 andreas.martens 2004-12-03 10:53:39 UTC
Set to target OOoLater due to lack of resources.
Comment 19 Rob Weir 2013-07-30 02:24:20 UTC
Reset assignee on issues not touched by assignee in more than 2000 days.