Issue 37511

Summary: Page style lost after saving file with a section set to hide under some condition.
Product: Writer Reporter: dcarrera <daniel.carrera>
Component: formattingAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: andreas.martens, issues, jeanweber, stx123
Version: 680m62   
Target Milestone: ---   
Hardware: Sun   
OS: Solaris   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Sample file that illustrates the bug. It includes a section, and instructions to reproduce the problem.
none
new bugdoc none

Description dcarrera 2004-11-21 10:05:34 UTC
This is a subtle bug.  It is present on both OOo 1.x and OOo 1.9m62.  It applies
to sxw, stw, oot and ott formats.

Steps to reproduce the bug:

1) Create a new document.
2) Insert a section at the top.
3) With the cursor inside the section, change the page style (for example, to
"Front Page").
4) Save the file.
5) Open the file again, and the page reverts back to "Default" page style.

*Notice*:  This happens even when the section spans several pages.

This is causing problems for the user guide tean.  The Front Matter part of each
chapter (title, overview, copyright and table of contents) is all in one
section. We plan to hide it when the chapter is inserted in the master doc.

The "work around" for this issue is to uncheck the "Hide" attribute of the section.

This bug has been tested on Solaris and Windows, OOo 1.9m62, OOo 1.1.2, 1.1.3,
and using sxw, stw, oot and ott files.

I am attaching a sample file that illustrates the bug.

Cheers,
Daniel.
Comment 1 dcarrera 2004-11-21 10:10:54 UTC
Created attachment 19535 [details]
Sample file that illustrates the bug.  It includes a section, and instructions to reproduce the problem.
Comment 2 nagashree 2004-11-22 04:21:10 UTC
I was able to replicate the problem even with OOo 1.9m58
Comment 3 andreas.martens 2004-11-22 09:26:36 UTC
I see a bug and a missing feature and I want to provide a work-around.
The problem is caused by our way to define the page style. Normally it's a
property of a paragraph! If you change the page style of your document to "First
page" the first paragraph at the first page gets the property "Break page before
with page style 'First page' ". So the document always want to start with a
"Default" page style but the first paragraph says "First page". If the paragraph
is hidden as part of a hidden section, its property is lost, the "Default" page
style is the winner again. So far, so good.
Bug: The bug is that even the condition to hide the section is false, the page
style is set to "Default".
But if we fix this problem, the page style will change if you really hide the
section. I don't know if you like this behaviour?! So I could imagine the
following feature.
Feature: A document property page style which defines the page style of the
first page if there's no paragraph with another page style.
Work-Around: If your document starts with a small paragraph before the first
section, you're able the set the wished page style at this paragraph and it will
never got lost.
Comment 4 dcarrera 2004-11-22 10:38:31 UTC
Hello Ama.

Thank you for the explanation.

> The problem is caused by our way to define the page style. Normally it's a
> property of a paragraph!

Yes.  I'm reading the book "OOo XML Essentials" and I noticed that. That's odd,
but it's not bad. If OOo did that on the first page we'd be happy.

> But if we fix this problem, the page style will change if you really hide
> the section. I don't know if you like this behaviour?!

Actually, *yes*, that's the behaviour we want.

Well, let me check we understand each other.  If you fix this bug, the behaviour
will be:

  * If the section is visible, the first page will have "First Page" style.
  * If the section is hidden, the first page will have "Default" style.

Yes, this is what we want.  I'll explain.  In our template, the first 4 pages
(exactly) are inside a section.  The idea is that if you hide the section it's
as if you had thrown out those pages.  So it "makes sense" for the next page to
keep whichever page style it has.

Our document has two major components:

 * Pages 1-4: Front Matter -- title page, copyright, edits, etc.
 * Pages 5-*: Content -- the actual information of the document.

Each of these two has its own page style.  For example, the Front Matter uses
Roman Numerals for page numbers and the body (content) of the document uses
Arabic numbers.

We want to be able to hide the Front Matter and only look at the content. 
Naturally, we would want the content of the document to keep its page style.


> Work-Around: If your document starts with a small paragraph before the first
> section, you're able the set the wished page style at this paragraph and it
> will never got lost.

And this work-around would do the right thing for people who want the first page
to always have the same page style.

After looking at this issue, I'm thinking that associating the page style with
the first paragraph is not so bad.  It allows you to effectively put a page
inside a section.  So when you hide the section, the page goes.

Cheers,
Daniel.
Comment 5 michael.ruess 2004-11-26 14:08:17 UTC
MRU->AMA: maybe we should implement an exception: if the very first paragraph of
a document is in a section, the page break information should be handed to the
para following the section (if this does not have an explicit page break attribute).
Comment 6 andreas.martens 2004-11-26 14:58:18 UTC
AMA->MRU: I'm not sure what you mean by handed to the following para. Do you
mean when the section is hided? But I don't think that's a good idea. A section
could contain a lot of pages and a lot of different pagebreaks. Which one should
be handed to the next para?

Daniel wants our behaviour the pagestyle should be defined by the _visible_
paragraphs. But at the moment we have a bug that the pagestyle can be "default"
even the section is visible! This bug is annoying and we should fix it.
Comment 7 dcarrera 2005-07-02 03:43:22 UTC
Hello? How's this issue comming? Any news?

As I said earlier, all that needs to be fixed is this bug:

AMA> Bug: The bug is that even the condition to hide the section is
AMA> false, the page style is set to "Default".

From what Ama said, if this bug is fixed, the resulting behaviour would be
exactly what I would want (to have the page style change when I hide the
section) and Ama's work around would work well for people who want the page
style to remain fixed. And everyone's happy.

How difficult would it be to fix this bug? I just want a rough indication, so I
know what to expect. Something more specific than "OOo Later" :-)

Cheers,
Daniel.
Comment 8 jeanweber 2006-03-01 16:12:46 UTC
Any progress on this? Any target milestone other than "OOo Later"? This is a
problem for writing documentation in chapters and then combining them to make a
book (for example, using a master document).
Comment 9 frank.meies 2006-03-02 07:51:15 UTC
FME->dcarrera/jeanweber: Please have a look at my new attached file. It looks
like somebody fixed this already (SRC680m156). If the section is visible, we
have the page style "First page", otherwise "Default".
Comment 10 frank.meies 2006-03-02 07:55:11 UTC
Created attachment 34541 [details]
new bugdoc
Comment 11 jeanweber 2006-03-02 15:35:48 UTC
Thanks. I'll have a look at your file as soon as I can (may not be for a few
days, though) and also test some of my own files. 
Comment 12 jeanweber 2009-08-04 21:12:40 UTC
I think this problem has been fixed, and is no longer present in OOo 3.x, so the
issue can be closed.