Bug 103078 - Left header and right header inconsistent and vary thru doc, and mismatch UI (see comment 11)
Summary: Left header and right header inconsistent and vary thru doc, and mismatch UI ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
QA Contact:
Keywords: filter:odt
Depends on:
Reported: 2016-10-10 04:21 UTC by Luke Kendall
Modified: 2016-12-05 09:49 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:

Four screenshots and the long MS (obfuscated) showing the problems (1.33 MB, application/zip)
2016-10-10 04:21 UTC, Luke Kendall
Another document exhibiting the problem (447.94 KB, application/vnd.oasis.opendocument.text)
2016-10-11 00:26 UTC, Luke Kendall
Fresh screenshots from WildThing-CS-4x7obfus.odt (2.93 MB, application/zip)
2016-10-11 01:55 UTC, Luke Kendall

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Kendall 2016-10-10 04:21:37 UTC
Created attachment 127907 [details]
Four screenshots and the long MS (obfuscated) showing the problems

This bug might relate to bugs 49171, 81012, 91296, 94621, 100287 and 100290 but I think it's also likely to be different.

When I set the left header and right header to be different for my novels, it seems that:
1) The paragraph style "Header left" is used on the right pages *sometimes* through my novel, and I have to manually set the paragraph style in the header to be "Header Left"
2) The reverse situation sometimes applies
3) As well, sometimes on a left page, the header's *contents* are the cocontents of a right page, and I have to manually copy the contents of a left page into the already "Header left" style paragraph, before the right contents appear.
4) The reverse is also true for some right pages.

In addition, on some pages, it's hard to say what the header's paragraph style really is.  When you click into the header, the UI element that appears and shows the style sometimes says that the style is "First Page Header (<page style)", even if I manually set the paragraph style to be "Header Left" or "Header Right".

In the sequence of attached images,
Header-oddity-1.png shows p22, a left page, which the Styles menu says is style "Header" (instead of "Header Left")
Header-oddity-2.png shows how it changes if I double-click "Header Left" in the Styles and Formatting menu to force it to that style.  (Note that the page number also changes to a different typeface and font size.)
Header-oddity-3.png shows what the header text looks like after I "Select All" in the header and paste in the text from an earlier left hand page that has correct contents.  In particular, the source text was from a page where the header format panel as "Header Left".
Header-oddity-4.png shows the result of the copy/paste mentioned above: the contents are now correct, but the Style and Formatting panel now shows the paragraph style has been reset to "Header", even thought the blue UI element now shows as "Left Page Header (Convert 8)".

In case it's relevant, to start each chapter so as to display no header or footer, I make sure that it uses a page style that I have set up to have no header or footer ("Convert 1"), and which is succeeded by a normal page style that does have a header (only) - called "Convert 8".

The header area on such chapter 1st pages (a page style called Convert 1), are marked in the blue UI element as "Header (Convert 1)".  The header of the next page is marked "First Page Header (Convert 8)", which makes no sense to me.

As I work through my hundreds of pages of MS, checking each page header, it seems that typically the page headers get confused and wrong immediately after each new chapter.

I'm just scrolling through, correcting as I go (I spent a couple of hours fixing the 4.25"x7" edition of my 1st novel, yesterday, and am now doing the same kinds of corrections for that same size edition for my 2nd), and it looks quite consistent: the errors start after the 1st page of each new chapter.  I think it's because LO is somehow miscalculating what pages are left and what are right.  It's like the 1st page of a new chapter confuses LO so it doesn't realise that odd-number pages are right hand pages, and even numbered pages are left hand pages.

I'm on p54 of my corrections.  I'll obfuscate my MS, and save it as-is, and attach it along with the screen shots.  I hope it will help you track down what is going on.  This bug is driving me a bit batty, since I can't work out what triggers it.

I can see that it's kind of WYSIWYG, to allow people to click in to a header and type directly, and having that then flow on and affect all the following pages (I think).

But it sure would be nice to be able to just define a header with the text I want for the left pages (in my case: page no, left justified, author name, regular font, centred) and for the right pages (Book title, italic, right-justified tab, page no.), and then have that applied to all pages that have headers turned on, and let LO work out which pages are left and right pages.

That said, maybe there's some other bug that's confusing LO about left and right, and if that was fixed, all would be well.
Comment 1 Joel Madero 2016-10-10 04:41:03 UTC
We need the actual document. Mark as UNCONFIRMED once you add it.
Comment 2 Luke Kendall 2016-10-10 04:45:04 UTC
The document is in the zip file I provided: HarshLessons-CS-4x7-headerBugs.odt
Comment 3 Luke Kendall 2016-10-10 05:14:58 UTC
It might also relate to bug 95357.
Comment 4 Luke Kendall 2016-10-10 05:17:32 UTC
Sorry, I just realised that bug number I mentioned in my last comment, above, was for Apache OpenOffice: https://bz.apache.org/ooo/show_bug.cgi?id=95357
Comment 5 Luke Kendall 2016-10-10 23:52:51 UTC
I just received the eproofs for my 1st book in A-format size, and found that although I had carefully gone through that, correcting this same issue, it still had 25 pages with the headers broken as I've described here.
So I went through it, manually find each case and fixing it up: that took an hour.
Then I rechecked - and now, new pages had their headers broken.  In each case, it seems that a page header style suddenly changes to the wrong left/right sense. So this time I noted down each page number that head the error, and started correcting again - to see if the same page numbers keep getting the error.
I corrected the 1st two (pages 15 and 29, which it thought were left hand pages, since the paragraph style had changed to Header Left; so I changed the style to Header Right and set the correct header text).
Then I scanned back to see if any pages had changed: yes, p34 was now wrong: it thought it was now a Header Right page; so I changed it to Header Left and correct the text, and rescanned - and now page 20 is broken, it thinks it's a Header Right style.

Frankly, Ican't find a way to manually correct it: it's like a very unpleasant game of "whack-a-mole": any correction to one header seems to have a chance of creating errors on other pages, and I can only find them by manually scrolling and looking.  In a 386 page novel, it's a lot of work, and basically, I seem to be stuck: I can find no way to get a correct text.

So this edition of my novel is now stalled, as I can't create a correct PDF file because I can't get correct text in LO.

Comment 6 Luke Kendall 2016-10-11 00:26:55 UTC
Created attachment 127939 [details]
Another document exhibiting the problem

Yes, in my 1st novel, in this size, if I fix the header on p15 it breaks the header on p20, and when I fix the header on p20 it then breaks the header on p15.  So it is impossible for me to generate a correct text.

If I go to p20, when it's in error (shows the text that should appear for a /right/ page, though says it's header style is Header Left), if I just double click on Header Left in the Styles and Formatting menu, its italicisation changes to Regular (which is the style for a left page).  And if I make no other corrections to it, and scroll back to p15, the header text has changed to style Header Left too (even though it's a right page), and the italicisation is that of a left page, though its text hasn't changed.

And if I don't change the header style to the correct style for that page (Header Left for left pages, or Header Right for right), and change the text anyway, then it changes the header text of the mystically-linked pages to use that header text and style.

It's like a subset of the pages are linked together and are being forced to be treated all as the same left or right kinds of pages, regardless of the true left or right nature of those pages.  So if I change any of the mysteriously-linked pages, they all change.

It's sounding to me like the documents have become corrupted, if so, and I'm at a loss as to what I might do to fix them.  Save it as a Word file (.docx? .xml?), or save it as unified office type (.uot), or flat XML odt format (.fodt?)?  Any suggestions?

I will attach an obfuscated copy of my 1st novel, that I've been describing in this comment.  The file is WildThing-CS-4x7obfus.odt.  The pages I noted as having errors in the headers are:

15, 289, 67, 79, 87, 117, 119, 123, 133, 143, 159, 183, 187, 195, 219, 245, 251, 259, 261, 271, 313,323, 355, 359.

All odd numbers, come to think of it.  But when I started correcting them, I found that just in doing the first couple, pages 20 and 34 had newly broken; so I think there are both odd and even pages "mysteriously linked", but it's tricky to find out which pages they are.  Certainly, pages 15 and 20 are linked in this mysterious way.
Comment 7 Luke Kendall 2016-10-11 00:29:10 UTC
Because LO appears to have corrupted the documents, I've tried to increase the severity one level, to "major"; but maybe I can't change that, or maybe you disagree - you;re the experts, so I'll leave it to you to adjust that if you disagree.
Comment 8 Luke Kendall 2016-10-11 00:39:45 UTC
I was quite sure I'd fixed my second novel, yesterday, since I w2as unaware at the time that corrections to some headers would then break headers on other pages, and didn't re-check after making all the corrections.  So I see that the other example file (novel two, Harsh Lessons), is also full of these errors in the header.

So both novels are "broken", and would look embarrassingly full of errors if anyone ordered them.  I'll need to contact the printer/publisher to put a hold on them both until I have a fix or a workaround for the problem.
Comment 9 Joel Madero 2016-10-11 00:43:04 UTC
I tried triaging this bug the bug is really complicated - almost like reading a novel (not so funny joke). Sorry but without much simpler instructions it's going to be hard for anyone to triage. 

The screenshots aren't entirely helpful because you took them before you apparently randomized text so there is no way for us to compare. 

What would be nice is:
1) Post randomized screenshots that we can easily compare;
2) Exact pages with something like:
Page XX:

Page XXX:

I very quickly checked this:
Header-oddity-1.png shows p22, a left page, which the Styles menu says is style "Header" (instead of "Header Left")

On page 22 I see "Header Right" not "Header Left" or "Header." I see "Header Right" for every header after a chapter
Comment 10 Luke Kendall 2016-10-11 01:21:00 UTC
Yeah, sorry.  Okay, I'm now doing just that, for the example I was talking about in my last comment, since the strange linking of pages 15 and 20 should help in the triaging, I hope!
Comment 11 Luke Kendall 2016-10-11 01:55:03 UTC
Created attachment 127941 [details]
Fresh screenshots from WildThing-CS-4x7obfus.odt

1. HeaderOddity-v2-1.png shows p20, which LO thinks is a Header Left page. (True, but its showing Header Right text and style)
2. Make no change and scrollback to p15.
HeaderOddity-v2-2.png shows p15, which LO thinks is a Header Left  page. (False, it's Header Right, but at least it's displaying Header Right text and style.)
3. Then I change p15 to be Header Right, and I take HeaderOddity-v2-3.png screenshot
4. Scroll back to p20, still thinks it's a Header Right page: take HeaderOddity-v2-4.png
5. Change Header Style to Header Left - apart from the style setting change, no real difference.  HeaderOddity-v2-5.png
6. Delete all text in the header on p20, and correct the text for a left page: insert page number, type author name. HeaderOddity-v2-6.png
7. Scroll back to p15: see that the text has changed to the new text, and the style is once again Header Left: HeaderOddity-v2-7.png
8. Scroll forward a page: see that it hasn't affected that page: HeaderOddity-v2-8.png.
9. And scroll forward to the next page, and see it hasn't changed that, either: HeaderOddity-v2-9.png
10. Actually having the obfuscated text in the headers really helps for this: the strangely-linked pages are revealed.  Scrolling further forwards, I see p29 is also affected, which nicely matches the list of page numbers I mentioned a bit earlier.

I've zipped these all up (including the obfuscated file after making that small change described in this process: "WildThing-CS-4x7obfus-after.odt").

Oh, and please replace the previous file "WildThing-CS-4x7obfus.odt" (the "before" file) with the one in this zip file: somehow, I gave you the unobfuscated text, which Amazon would not be happy with!

Thanks, and I hope this makes it a bit less troublesome.

Comment 12 Buovjaga 2016-10-24 12:26:34 UTC
I confirm the steps in comment 11.

When I tested steps 1 and 2 with version 3.5, LibO thought both were Header right style and displayed them as such.

Win 7 Pro 64-bit Version:
Build ID: 02e6c1c95993740e0dbea724b3014348c4b6559d
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@39, Branch:master, Time: 2016-10-24_04:01:05
Locale: fi-FI (fi_FI); Calc: group

LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
Comment 13 Luke Kendall 2016-10-26 03:47:06 UTC
Thanks very much for investigating this; it's good to know you could reproduce it.

In the meantime, if you think of a workaround that I might try, please let me know.

I plan to create a template document with only the default styles I need, plus the page and paragraph styles I need, then save the faulty files as RTF, copy their text into the "good" template file, and then re-break the pages using the appropriate (header-less) page style for each chapter start.

A simpler approach I might try 1st is deleting all page breaks, and re-inserting them.

If you have any thoughts or suggestions, I'm "all ears".

I probably won't be starting on the workaround attempt until about Nov 10th.
Comment 14 Luke Kendall 2016-12-05 02:17:36 UTC
Actually, it's only this week that I might find time to work around this bug, which is holding up my release of the mass-market size editions of two books.  Can anyone guess whether either of my planned approaches is worth trying?

Approach 1:

Try deleting all page breaks, and re-inserting them.

Approach 2:

Create a template document with only the default styles I need, plus the page and paragraph styles I need, save the faulty files as RTF, copy their text into the "good" template file, and then re-break the pages using the appropriate (header-less) page style for each chapter start.
Comment 15 Buovjaga 2016-12-05 07:53:25 UTC
No idea about the approaches and I don't know, why you would want to throw in RTF to the mix to complicate things.

I suggest using the community support channels http://www.libreoffice.org/get-help/community-support/ Ask.LibO and IRC..
Comment 16 Luke Kendall 2016-12-05 08:31:40 UTC
The only reason for throwing in RTF was because the two documents in .odt format are broken, and I could find no way to correct it.  But maybe you're suggesting that if I just open a fresh, empty text document and copy and paste the entire body in LO it might fix the problem?

I assumed that if I did that it would copy across the cross-linkages... And I can add that I tried that quick and easy approach, and the 2nd page I looked at had the same error: pages 28 and 29 had the same text in the header (it said p28 was First Page Header and p29 was Right Page Header).

So, given that I need to copy across the typeface, font size, and regular/italic style for the text, my choices would seem to be RTF, LO native, or HTML. Though I just this instant doing a Paste Special and choosing RTF, and LO just crashed. Though maybe that was because I chose to Undo the previous Paste of the whole document.  Ah, no: after LO recovered, I tried again, and it crashed as soon as I tried to copy it all again.  I'll submit a fresh bug for that.

Anyway, I'll take your suggestion and try the forum.
Comment 17 Luke Kendall 2016-12-05 09:49:36 UTC
I eventually thought to look in the spam folder for the confirmation email to join the forum.

So having passed that first IQ test, I then checked https://wiki.documentfoundation.org/Ask/Getting_Started to see if there was any information about actually asking a question.

Unfortunately, I have not been able to find how to do that.

I also found it particularly difficult to prove I'm not a robot, as the captcha instructions for the forums switched into a language I don't speak (Spanish? Portuguese?) which meant I had to use Google translate to try to decode what I was being asked to do, and some of the captchas seem to require you to do a fair bit of clicking before letting me proceed.

This is despite my language settings on the site being English only.

I've also provided that feedback to the forums, politely.