Bug Hunting Session
Bug 125280 - Footer can not be made to appear only on the first page after it has been filled with content (see comment 8 for solution)
Summary: Footer can not be made to appear only on the first page after it has been fil...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.3.0.0.alpha0+
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Writer-Header-Footer
  Show dependency treegraph
 
Reported: 2019-05-14 11:05 UTC by Adalbert Hanßen
Modified: 2019-06-18 13:28 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Test saple showing that it is possible to make a footer which only appears on the first page and how to get there (56.57 KB, application/vnd.oasis.opendocument.text)
2019-05-16 21:46 UTC, Adalbert Hanßen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adalbert Hanßen 2019-05-14 11:05:01 UTC
Description:
If the options _same content on first page_ and _same content on right and left pages_ are deselected after a footnote really has content, they appear on all pages despite of that.

I expect changing _Format>Page_ tab _Footer_, check marks _same content on first page_ and _same content on right and left pages_ immediately after they have been altered.

Steps to Reproduce:
1.Open an new document
2.enable Footers on the page default style
3.enable the two other options under it
4.enter some text to the footnote
5.enter a page break on the first side. Result: the footnote should appear on both pages.
6.decide that you want the footer only on the first page: Go the the first page
7.Use _Format>Page_ tab _Footer_ to uncheck the two options  _same content on first page_ and _same content on right and left pages_.

Actual Results:
7.The footer still appears on the second page. But it should not!

This bug can be circumvented by disabling footers altogehter (thereby loosing the current content of it). Then you have to go back to _Format>Page_ tab _Footer_, uncheck the check marks _same content on first page_ and _same content on right and left pages_ and after this is done and the dialogue is closed you may enter or paste the content for the footer.

Expected Results:
I expect the change to happen immediately after unchecking the check marks _same content on first page_ and _same content on right and left pages_, even if there already is content in the footer


Reproducible: Always


User Profile Reset: No



Additional Info:
This has been found as a side finding of https://bugs.documentfoundation.org/show_bug.cgi?id=125256, but I was told to file a new bug on this one (after I could not reproduce the other one).
Comment 1 Dieter Praas 2019-05-15 06:11:04 UTC
I confirm that behaviour with

Version: 6.3.0.0.alpha1+ (x64)
Build ID: e92dcfdc7bd7b237e0bee26ff226a102d9e8e766
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-05-14_00:00:57
Locale: en-US (de_DE); UI-Language: en-US
Calc: threaded

But I'm not sure, if this is a bug. To disable "Same content on first page" gives you the possibility to have a different footer on the first page. It dosn't mean, that you have no footer

=> set to NEW, because I can confirm it, but also add design team for decision about it
Comment 2 Timur 2019-05-15 15:06:48 UTC
LO works somewhat differently than MSO and it has options "same content on first page" and "same content on right and left pages".
You first enabled footer content and it was created on both pages. 

When in 6. you unchecked both options, there are two options:
- that *other* footer content disappears, and that's what you seems to expect,
- that *other* footer content is separated, but duplicated at the beginning. 
Obviously LO chooses 2nd option, you get "First Page Footer" and "Footer" that you can independently change. 
And I find it correct because you alredy had content. If you remove "same content on first page" that doesn't mean that you want none at others if it already exist. 
If you wish you can remove *other* footer, you just delete "Footer".

This is a request for behavior change, so enhancement. 
I wouldn't call this a bug so I mark as NotaBug. 
But let UX confirm.
Comment 3 Heiko Tietze 2019-05-16 11:13:51 UTC
Obviously users, at least one, struggle with the option. The hierarchically organized checkboxes are not depending on each other, ie. if the children are disabled the parent has to reflect this. But OTOH disabling all footnotes "magically" wouldn't solve the issue and rather produce more trouble for most users. Actually we have five options: off, on with the same on all pages, on with different on first page, on with different on left/right, on with different on first as well as left/right pages. Are radiobuttons better suited? Don't think so. Let's keep it a NAB.
Comment 4 Adalbert Hanßen 2019-05-16 15:47:43 UTC
Sometimes one wants Headers and footers to be present only on the first page of a document. A letter template is such an example with data about the legal entity e.g. in the footer, but only on the first page. Sometimes (e.g. in Books) one wants Headers and Footers which do not appear on the first page (or on the first two pages, if a chapter always starts on a pair of consecutive pages. 

Sometimes one wants to have footers (or headers) which reflect the name of the current section (e.g. the category of things in a catalogue or the title of the current chapter or the like).

And different appearance for left and right pages is required for something which shall be bound like a book (in this case it might be wished to have the category text only on the left sides or only on the right ones, depending on e.g. the font orientation or other criteria).

Sometimes one wants to suppress page numbers on a last empty fill page to make a chapter using an even number of pages.

===

What are the Headers and Footers linked to in the data representation? I first thought, they are linked to the section. However, this can't be true, because experimenting in a sample document with several sections with different number of columns to make them easily discernible and altering the footer, I saw that altering affects the whole document rather the footer in that section.

If I follow the manuals, they must be linked to the page style. So on my playground, I defined several different page styles with different properties regarding Footers and tried to associate them with different portions of my document. This did not work as expected.

To better understand things, some questions are worth to be enlightened:

1.  What are the Headers and Footers linked to in the data representation?
2.  What properties are associated with them and how are they related to the three controls currently available in the software? (on/off altogether, same content for left and for right pages, same content on first page).
2a. How many bits are thy?
2b. What are they meant for?
2c. Which dialogue function can control them?
2d. Some examples of how they are intended to be used for some useful purpose?
Comment 5 Heiko Tietze 2019-05-16 18:26:20 UTC
We are restricted by the open document format definition, not sure that another option like "only at first page" is possible. Perhaps we can add some notes to the documentation.
Comment 6 Adalbert Hanßen 2019-05-16 21:46:01 UTC
Created attachment 151472 [details]
Test saple showing that it is possible to make a footer which only appears on the first page and how to get there

Heiko, it is possible to make a footer which only appears on the first page and the rest of the same document without footers.

It is also possible, to make a document which has a different footer on the first page and different ones on all even pages and just a third different footer on all odd pages.

All these three things can be made with one and the same settings for the footer options. They are shown in the attached document.

Unfortunately I have no access to the definition of the odt format, but obviously it is capable to host that type of information and possibly even more things for headers and footers (presumably they are both incarnations of almost the same thing, the only difference being that one is arranged on the top of the page and the other one close to the end).
Comment 7 Regina Henschel 2019-05-16 22:48:25 UTC
(In reply to Adalbert Hanßen from comment #6)
> Unfortunately I have no access to the definition of the odt format

Everyone can access the ODF standard. You can get it from http://standards.iso.org/ittf/PubliclyAvailableStandards (number ISO/IEC 26300) or from https://www.oasis-open.org/standards#opendocumentv1.2 

, but
> obviously it is capable to host that type of information

The feature, that the first page can have a different header/footer is currently a LibreOffice extension, but will be part of the upcoming version ODF 1.3.
Drafts of the new version are available from https://www.oasis-open.org/committees/documents.php?wg_abbrev=office
Comment 8 Heiko Tietze 2019-05-17 07:28:20 UTC
If this will be included we can in fact think about a different UI.

(o) No Footer/Header

( ) Footer/Header equally on all pages
( ) Footer/Header different for left/right pages
    [x] Extra footer/header on first page

( ) Footer/Header only on the first page

I think the last option is too much as any of the above option with extra on first on does the trick when footnotes are empty. But OTOH it's more clear. Opinions?
Comment 9 Adalbert Hanßen 2019-05-17 09:52:11 UTC
(In reply to Regina Henschel from comment #7)
> (In reply to Adalbert Hanßen from comment #6)
> > Unfortunately I have no access to the definition of the odt format
> 
> Everyone can access the ODF standard. You can get it from
> http://standards.iso.org/ittf/PubliclyAvailableStandards (number ISO/IEC
> 26300) or from https://www.oasis-open.org/standards#opendocumentv1.2 
> 
> , but
> > obviously it is capable to host that type of information
> 
> The feature, that the first page can have a different header/footer is
> currently a LibreOffice extension, but will be part of the upcoming version
> ODF 1.3.
> Drafts of the new version are available from
> https://www.oasis-open.org/committees/documents.php?wg_abbrev=office

Thank you for the link. I'll take a look at it. 
Adalbert
Comment 10 Adalbert Hanßen 2019-05-17 10:08:20 UTC
One more thing regarding headers and footers would be, to let them change from place to place inside a document. This would be particularly important for a document, which is a master document (e.g. let something appear in the footer which designates the part from which a section comes). 

If I would have to design such a thing, I would give the user some means to define a variable in the text (such that it is displayed only, if control characters are shown but hidden otherwise) and let the headers or footers refer to such variables. 

Generalizing a bit more, I would let the user also use such variables in his text alone, let him do concatenations and, if the current value of such variables is numeric, even do arithmetic with it. Something like the text substitutions possible in bash... 

If it is about printing or displaying the footer, the last state of such a variable seen from the end of the last line displayed on that page would be used as substitution in the footer. For a header, the reference logically would have to refer to the last definition of the variable above the to be displayed header, of course. For the very first page, an empty definition for all variables would have to been taken instead.

Perhaps something of this kind is already in LO or in the definition of the odt format. If this is the case, a reference to it would be welcome.
Comment 11 Adalbert Hanßen 2019-05-17 10:42:06 UTC
(In reply to Adalbert Hanßen from comment #9)
> (In reply to Regina Henschel from comment #7)
> > (In reply to Adalbert Hanßen from comment #6)
> > > Unfortunately I have no access to the definition of the odt format
> > 
> > Everyone can access the ODF standard. You can get it from
> > http://standards.iso.org/ittf/PubliclyAvailableStandards (number ISO/IEC
> > 26300) or from https://www.oasis-open.org/standards#opendocumentv1.2 
> > 
> > , but
> > > obviously it is capable to host that type of information
> > 
> > The feature, that the first page can have a different header/footer is
> > currently a LibreOffice extension, but will be part of the upcoming version
> > ODF 1.3.
> > Drafts of the new version are available from
> > https://www.oasis-open.org/committees/documents.php?wg_abbrev=office
> 
> Thank you for the link. I'll take a look at it. 
> Adalbert

Regina, 

I took a look at the second link and finally found http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os.zip. I looked, what's in it and it looks like the main content is in three files as odt and pdf OpenDocument-v1.2-os-part1.*, ..., OpenDocument-v1.2-os-part3.*

Then I followed your second link to the draft 1.3, i.e. to https://www.oasis-open.org/committees/documents.php?wg_abbrev=office. This one shows me a table of 10 documents. They contain links to some OpenDocument-v1.3-*part*.odt, but the part numbers go beyond the range 1...3 and the low numbers are missing. Is there something similar to the ZIP-file OpenDocument-v1.2-os.zip (of course, the version 1.3 and perhaps draft and the date or a subversion number in it)?

Kind regards
Adalbert
Comment 12 Regina Henschel 2019-05-17 14:29:55 UTC
(In reply to Adalbert Hanßen from comment #11)
 
> Then I followed your second link to the draft 1.3, i.e. to
> https://www.oasis-open.org/committees/documents.php?wg_abbrev=office. This
> one shows me a table of 10 documents. They contain links to some
> OpenDocument-v1.3-*part*.odt, but the part numbers go beyond the range 1...3

The numbering will change from ODF 1.2 to ODF 1.3.

> and the low numbers are missing. Is there something similar to the ZIP-file
> OpenDocument-v1.2-os.zip (of course, the version 1.3 and perhaps draft and
> the date or a subversion number in it)?

No zip. They are working drafts of the committee.
For header/footer topic you need 'part 3'. 'part 4' contains the formula language for Calc. "production" in the file name means, that it is a version without change tracking. Take that with highest wd-number in the filename.

Sent me a mail, in case you need help getting it.
Comment 13 V Stuart Foote 2019-06-04 12:46:33 UTC
(In reply to Heiko Tietze from comment #8)
> If this will be included we can in fact think about a different UI.
> 
> (o) No Footer/Header
> 
> ( ) Footer/Header equally on all pages
> ( ) Footer/Header different for left/right pages
>     [x] Extra footer/header on first page
> 
> ( ) Footer/Header only on the first page
> 
> I think the last option is too much as any of the above option with extra on
> first on does the trick when footnotes are empty. But OTOH it's more clear.
> Opinions?

Adjusting the GUI would makes it clear/doable for users, and better UX. Include the last. Also allows tweaking for explicit support for the ODF 1.3 change, so yes.  

Are IDL and API changes to support macro and extension usage also needed? Thinking of external projects like Zotero.
Comment 14 Thomas Lendo 2019-06-04 19:20:09 UTC
If the changed wording reflects the implementation of the LibO extended ODF and the upcoming ODF 1.3 then I support Heiko's proposal including the last line for only on the first page.
Comment 15 Heiko Tietze 2019-06-06 12:18:05 UTC
Agreement to proposal in c8. So removing needsUX.
Comment 16 Mike Kaganski 2019-06-06 12:53:49 UTC
(In reply to Heiko Tietze from comment #8)
> If this will be included we can in fact think about a different UI.

If what will be included? LibreOffice already includes the functionality that the future standard will standardize. And IIUC, the standardized behavior fully matches what is implemented in LO, no more, no less... please correct me if I am wrong.

> (o) No Footer/Header
> 
> ( ) Footer/Header equally on all pages
> ( ) Footer/Header different for left/right pages
>     [x] Extra footer/header on first page
> 
> ( ) Footer/Header only on the first page

So, looking at this, I see problems:
1. The "[x] Extra footer/header on first page" looks like (a) it applies exclusively to "( ) Footer/Header different for left/right pages" (while in fact, it applies to both options above it); and (b) its wording makes impression as if unchecking it *removes* the header from the first page (while in reality, it makes first page header same as other pages). Or - alternative reading of the wording: "in addition to standard header, first page will get second extra header"? :-)
2. "( ) Footer/Header only on the first page" is impossible.

I feel that current UI is ~optimal. It leaves no doubt that the only two possible states are (1) header absent (on all pages of this style), and (2) header present (on all pages of the style). It makes no doubt that the other two checkboxes are independent on each other (you may independently choose different l/r and different first page); and they explicitly only speak about different/same *content*, not presense. Any other, more fine-grained control over the headers/footers should only be done using different page styles, which gives invinite power in that regard.
Comment 17 Mike Kaganski 2019-06-06 13:29:19 UTC
(In reply to Adalbert Hanßen from comment #4)
> Sometimes one wants Headers and footers to be ...

Whatever you might want about different headers/footers, is possible using different page styles.

> What are the Headers and Footers linked to in the data representation? I
> first thought, they are linked to the section. However, this can't be true,
> because experimenting in a sample document with several sections with
> different number of columns to make them easily discernible and altering the
> footer, I saw that altering affects the whole document rather the footer in
> that section.
> 
> If I follow the manuals, they must be linked to the page style. So on my
> playground, I defined several different page styles with different
> properties regarding Footers and tried to associate them with different
> portions of my document. This did not work as expected.
> 
> To better understand things, some questions are worth to be enlightened:
> 
> 1.  What are the Headers and Footers linked to in the data representation?
> 2.  What properties are associated with them and how are they related to the
> three controls currently available in the software? (on/off altogether, same
> content for left and for right pages, same content on first page).
> 2a. How many bits are thy?
> 2b. What are they meant for?
> 2c. Which dialogue function can control them?
> 2d. Some examples of how they are intended to be used for some useful
> purpose?

I suppose that much confusion stems from the one not-too-obvious thing about page styles: page styles are controlled by *content* (like paragraphs or tables). Pages don't exist in document model, and only created on the fly when needed to place content; and when they are dynamically created, each page gets its style (from the list of document page styles), based on properties of the *content*.

Specifically, you may mark that your *content* - some part of text, starting from *this specific paragraph*, - is placed on pages of this style. To do so, you mark the first *paragraph* of that part of text to start on new page with said style. And that setting marks the beginning of the part of document with this style; it will end as soon as another paragraph with such setting is encountered.

People often don't realize this powerful yet not obvious conception; so it's a frequent question "I try to apply page style Foo to my third page, but all the document gets that style!". That's because - again - the page style is applied from one paragraph with "page break with page style" to the next paragraph with "page break with page style". And when they put cursor to arbitrary point on third page, and double-click a page style on the sidebar, LibreOffice looks for the paragraph with such a setting: if cursor stays on such a paragraph, then its setting is modified to refer to chosen style; if current paragraph has no "page break with page style" set, then LO looka previous paragraphs, until it finds one, or until it comes to the very first paragraph in the document, in which case that very first paragraph would get that setting.

A few words about page style's "next style" feature. Page styles not only define their own properties, but they also may define that after the page of this style will follow a page with other defined style. This allows to create auto-alternating sequence of differently-styled pages, giving ~infinite abilities in regularly changing page formats. Having that feature, anything as simple as "different left/right headers", "different first page header", as well as more involved, such as "no header on first page" or "only header on single second page", and much more, is possible. The discussed checkboxes are just a simplified features duplicating this powerful mechanism, to make some common scenarious a little simpler.

Returning to the specific question: headers/footers are properties of page styles. So defining page styles' headers/footers properly, *and* applying the page styles to content runs in the document, are necessary and enough to fully control headers/footers.
Comment 18 Xisco Faulí 2019-06-11 08:43:17 UTC
Hi Heiko,
Code pointers are missing for this easyhack. Would you mind adding them ?
Comment 19 Heiko Tietze 2019-06-11 10:29:05 UTC
ALbert, please reply to comment 17.
Comment 20 Mike Kaganski 2019-06-14 07:56:38 UTC
(In reply to Mike Kaganski from comment #16)
> (In reply to Heiko Tietze from comment #8)
> > If this will be included we can in fact think about a different UI.
> 
> If what will be included? LibreOffice already includes the functionality
> that the future standard will standardize. And IIUC, the standardized
> behavior fully matches what is implemented in LO, no more, no less... please
> correct me if I am wrong.
> 
> > (o) No Footer/Header
> > 
> > ( ) Footer/Header equally on all pages
> > ( ) Footer/Header different for left/right pages
> >     [x] Extra footer/header on first page
> > 
> > ( ) Footer/Header only on the first page
> 
> So, looking at this, I see problems:

Reading the ODF 1.3 standard, I see not that it imposes no restriction on which subelements of [<style:footer>, <style:footer-first>, <style:footer-left>, <style:header>, <style:header-first> and <style:header-left>] exist in <style:master-page>. So I don't see why couldn't just a single <style:footer-first> be present, without <style:footer>. Moreover, *each* of the subelements may have style:display attribute, allowing to *remove* (hide) any of them *independently*, thus allowing to e.g. have left headers, but not have right headers; or have all headers but on first page. Here I don't mean different content of the said headers/footers, but their presence on the page, taking space. Also, there's no requirement that *when* there is different header on first page, there also must be different footer on first page (and likewise for left/right), it looks like possible combinations are very numerous (listing only for headers; footers would have the same set, without any dependencies on header selection):

1. No headers
2. Same header for all
3. Header only on first page; no header on the rest
4. No header on first page; same header on the rest
5. Different headers for first page and the rest
6. Headers only on odd pages, no headers on even pages
7. Headers only on odd pages, no headers on even pages and on first page
8. Headers only on even pages, no headers on odd pages
9. Headers only on even pages, no headers on odd pages and on first page
10. Different headers on odd and even pages
11. Different headers on odd and even pages, no headers on first page
12. Different headers on first page, odd pages, and even pages

Basically, each of [odd pages, even pages, first page] may independently be enabled and disabled; even pages and first page, when enabled, also may be independently same as odd pages or not.

And most of those possibilities need to be implemented yet (including independence of headers and footers, when one may check "same left&right headers", but "different left&right footers").
Comment 21 Adalbert Hanßen 2019-06-17 19:31:26 UTC
(In reply to Mike Kaganski from comment #17)
I tried hard to use this feature, but all I was able to achieve is different header styles (or footer styles) for left pages and for right pages.

I never succeeded to let another regime of footers or headers start from one specific point in my document, not even if it starts with a new page.

One specific application which I have in mind is letting the footers of a document which is a combination of several different files let the footers reflect the file names of the components, such that one can easily find the right one if one of the part of that "master document" has to be updated.

My trial: E.g. I inserted a forced page break above a headline in a document. Then following your hint
> 
> Specifically, you may mark that your *content* - some part of text, starting from *this specific paragraph*, - is placed on pages of this style. To do so, you mark the first *paragraph* of that part of text to start on new page with said style. And that setting marks the beginning of the part of document with this style; it will end as soon as another paragraph with such setting is encountered.
> 

How do you mean “to start on a new page with said style”? I marked the paragraph which happens to be a headline (which is at the beginning of a page far down in my document). Then I changed the appearance of the footer of that page and created a new style LP2 from it and double clicked on that in the list under the pages styles. But since it was a left page, changing the header changed the headers of all left pages in the whole document, not just for the left pages from from this starting point. The same is true for changing the right pages. 

Either the description in the manual of this feature is insufficient (and the function is somewhat not easy to understand) or it does not work as described. 

How do I apply footers of one type starting from one paragraph starting on a new page in my document? A LO Writer document showing all the steps in sequence applied to that document probably would be most helpful for the many LO Writer users who do not have understood how to switch header or footer regimes within one document. You promised it to be very powerful so I want to know how to use it.
Comment 22 Mike Kaganski 2019-06-17 21:25:50 UTC
(In reply to Adalbert Hanßen from comment #21)
> My trial: E.g. I inserted a forced page break above a headline in a
> document. Then following your hint
> > 
> > Specifically, you may mark that your *content* - some part of text, starting from *this specific paragraph*, - is placed on pages of this style. To do so, you mark the first *paragraph* of that part of text to start on new page with said style. And that setting marks the beginning of the part of document with this style; it will end as soon as another paragraph with such setting is encountered.
> > 
> 
> How do you mean “to start on a new page with said style”? I marked the
> paragraph which happens to be a headline (which is at the beginning of a
> page far down in my document). Then I changed the appearance of the footer
> of that page and created a new style LP2 from it and double clicked on that
> in the list under the pages styles. But since it was a left page, changing
> the header changed the headers of all left pages in the whole document, not
> just for the left pages from from this starting point. The same is true for
> changing the right pages. 

Page break with page style means you either use menu Insert->More Breaks->Manual Break, and then in the dialog, you specify the style you want from this point on; or you use menu Format->Paragraph; there go to tab Text Flow, and check Breaks->Insert->Type:Page->Position:Before->With page style:<your page style here>.

https://wiki.documentfoundation.org/Faq/Writer/003
Comment 23 Heiko Tietze 2019-06-18 13:28:40 UTC
(In reply to Mike Kaganski from comment #20)
> 1. No headers
> 2. Same header for all
> 3. Header only on first page; no header on the rest
> 4. No header on first page; same header on the rest
> 5. Different headers for first page and the rest
> 6. Headers only on odd pages, no headers on even pages
> 7. Headers only on odd pages, no headers on even pages and on first page
> 8. Headers only on even pages, no headers on odd pages
> 9. Headers only on even pages, no headers on odd pages and on first page
> 10. Different headers on odd and even pages
> 11. Different headers on odd and even pages, no headers on first page
> 12. Different headers on first page, odd pages, and even pages

How about

(o) No Footer/Header
( ) Footer/Header equally on all pages
( ) Extra Footer/Header on first page and ALTERNATING for left/right
( ) User-define configuration
    [ ] First page
    [ ] Odd pages
    [ ] Even pages
    (assuming different for odd/even, which has to go to the help; 

(if users want special solutions such as #6-9 they have to do it per page style otherwise we spoil the UI)

Nothing to say against page styles but having the first page different is quite common and it makes sense to cover it by a dedicated option.

(In reply to Xisco Faulí from comment #18)
> Code pointers are missing for this easyhack. Would you mind adding them ?

Feel free to remove the flags in this case (did it here).