Bug 90534 - FILEOPEN: The top/bottom margins and footer text in Pleading document do not match MS-Office layout
Summary: FILEOPEN: The top/bottom margins and footer text in Pleading document do not ...
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.3.1.2 release
Hardware: Other All
: high critical
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, filter:docx
Depends on:
Blocks: 103206 103207 103208
  Show dependency treegraph
 
Reported: 2015-04-09 17:32 UTC by Stephanie Shattuck
Modified: 2016-11-12 20:18 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample Word Pleading (145.96 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2015-04-09 17:32 UTC, Stephanie Shattuck
Details
Sample Pleading when opened with LibreOffice (62.75 KB, application/vnd.oasis.opendocument.text)
2015-04-09 17:33 UTC, Stephanie Shattuck
Details
PDF rendering (73.71 KB, application/pdf)
2015-04-10 02:51 UTC, Matthew Francis
Details
PDF export from 5.3 alpha0 (35.12 KB, application/pdf)
2016-09-14 18:04 UTC, Buovjaga
Details
partial revert of my speedup (2.48 KB, patch)
2016-10-01 07:55 UTC, Michael Meeks
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephanie Shattuck 2015-04-09 17:32:42 UTC
Created attachment 114701 [details]
Sample Word Pleading

Hello,
Robinson came to EFF a while ago now and suggested I open a ticket to see if you can make court pleadings work correctly in LibreOffice.
The court requires documents to have the numbers 1-28 and then two vertical lines on the left margin and 1 vertical line on the right margin. (Word puts these in the header.)
You also have to have a line at the bottom of the page and then some text below that horizontal line. (Word puts this in the footer.)
Finally, the court requires us to email Word versions of all proposed orders, so even if you could create a beautiful pleading in LibreOffice, you would have to be able to convert it to Word seamlessly. 
Attached is a sample pleading of a publicly filed document.
Feel free to contact me if you have any questions. Also, Robinson had asked me to cc him on this ticket but I don't see how to do that.
Best,
Stephanie
Comment 1 Stephanie Shattuck 2015-04-09 17:33:43 UTC
Created attachment 114702 [details]
Sample Pleading when opened with LibreOffice
Comment 2 A (Andy) 2015-04-09 18:13:36 UTC
Reproducible with LO 4.4.1.2, Win 8.1

If you open the attached file in MSO everything is fine.  But if you open it in LO the layout is totally destroyed (e.g. the left line and numbers are in black instead of grey, the text blocks are displaced, the footer is missing etc).

@Stephanie: To put somebody in copy please go to the top right of this online form under "CC:" and click on "edit".  Another input line opens and there you can enter the email address of somebody you want to put public into CC (no BCC option available).
Comment 3 Stephanie Shattuck 2015-04-09 18:27:27 UTC
The numbers and lines in the left and right margins aren't grey. They're just in the header so they won't appear black until you show the header. Also, I tried to cc Robinson Tryon and got this message:

CC: 	qubit@libreoffice.org did not match anything 

Thanks,
Steph
Comment 4 A (Andy) 2015-04-09 18:42:02 UTC
(In reply to Stephanie Shattuck from comment #3)
> The numbers and lines in the left and right margins aren't grey. They're
> just in the header so they won't appear black until you show the header.
> Also, I tried to cc Robinson Tryon and got this message:

Thanks for your correction.  This is an unfortunately already some time existing problem.

> CC: 	qubit@libreoffice.org did not match anything 
> 
> Thanks,
> Steph

Strange.  It worked in the past.  I will write Robinson an email if he maybe knows why this does not work.
Comment 5 Julien Nabet 2015-04-09 19:01:25 UTC
Stephanie: for your information, you just have to begin to type the name, then a list of users is proposed (automatic completion).
Comment 6 A (Andy) 2015-04-09 19:08:24 UTC
(In reply to Julien Nabet from comment #5)
> Stephanie: for your information, you just have to begin to type the name,
> then a list of users is proposed (automatic completion).

@Julien: Thanks for your reply.  But why does it not work to put only the email address in it, especially if you take a look at the FindTheExpert website (https://wiki.documentfoundation.org/FindTheExpert)?
Comment 7 Julien Nabet 2015-04-09 19:11:47 UTC
Andy: you'll notice the Robinson's email in cc is different that the one you quoted. I suppose it's because Robinson registered on Bugzilla with a different email.
Comment 8 A (Andy) 2015-04-09 19:19:52 UTC
(In reply to Julien Nabet from comment #7)
> Andy: you'll notice the Robinson's email in cc is different that the one you
> quoted. I suppose it's because Robinson registered on Bugzilla with a
> different email.

Yes, that's why I put the FindTheExpert website.  If there is another email address mentioned or if a users wants to use another email address, is it then not possible to insert this email address?  Does it mean this email address had to been registered by in its owner in advance (how, a login created with this email address?)?
Comment 9 Julien Nabet 2015-04-09 19:24:06 UTC
Andy: I recognize it'd be quite logical that emails should correspond but I'll let Robinson speak, he certainly knows the answer! :-)
Comment 10 Robinson Tryon (qubit) 2015-04-09 21:05:17 UTC
(In reply to Julien Nabet from comment #7)
> Andy: you'll notice the Robinson's email in cc is different that the one you
> quoted. I suppose it's because Robinson registered on Bugzilla with a
> different email.

Indeed! My email address on Bugzilla predates my @libreoffice.org email address ;-)

(In reply to A (Andy) from comment #4)
> > CC: 	qubit@libreoffice.org did not match anything 

Yep, looks like Bugzilla only allows you to cc email addresses that exist in the system (which probably prevents some categories of SPAM). I'll leave it as an exercise for the reader to decide if this is overall beneficial or just an annoying impediment to getting work done :P

But enough about me... let's take a look at your bug! :-)
Comment 11 Matthew Francis 2015-04-10 02:51:06 UTC
Created attachment 114709 [details]
PDF rendering

I printed the attached PDF from Mac Word 2011 so we have a fixed rendering to compare against.

- The header/footer seem to be cut off (Not sure if I needed to select some particular paper/printing options)
- The numbering at the side doesn't align with the lines of the main text. Is that expected?


PS. "Church v. NSA" sounds like a lot of fun in one courtroom!
Comment 12 Matthew Francis 2015-04-10 05:54:49 UTC
OK so the file used to look much better - there are at least two separate regressions at play here. 

1) The formatting (positioning) of the body text is all wrong
2) The numbering on the left isn't in the right place

The third issue I can see I think isn't a regression - at least I can't find a version that shows it correctly.

3) The line on the right side is missing


Generally we should have one identifiable bug per report, so let's split those three up (the third will probably have to wait for something to happen to the first two to let us see what's going on with it currently)
Comment 13 Matthew Francis 2015-04-10 06:03:42 UTC
Issue (1) in comment 12 started at the below commit.
Adding Cc: to michael.meeks@collabora.com; Could you possibly take a look at this? Thanks

(There are several things wrong with this file, but the below is where the most recent and obvious started - the main text of the file isn't laid out at all correctly)


commit 4771c8836a3e4d5e8ac25a7212293a13fb1e73ba
Author: Michael Meeks <michael.meeks@collabora.com>
Date:   Sat Jun 28 22:59:33 2014 +0100

    writerfilter: use XFastAttributes more efficiently.
    
    Don't duplicate UTF8 as UCS2 before converting to integers.
    Don't double convert every attribute, and allocate it twice.
    
    Change-Id: Ibb15d703f011865dac8eb72f18408a5d62b60d96
Comment 14 Matthew Francis 2015-04-10 06:07:19 UTC
For issue (2) of comment 12, I have identified a commit and am working to split it into a separate bug - but there are several potential existing duplicates to evaluate, so that could take a while to sort out
(commit 874f0a1be443b8027d5aba2285866f31cf4169e5)
Comment 15 Robinson Tryon (qubit) 2015-04-10 12:10:23 UTC
cc: joel (relevant to his lawyering interests)

[Joel: what do you think about a tracking bug for issues that affect legal docs/lawyers?]
Comment 16 Matthew Francis 2015-04-10 14:17:23 UTC
bug 69515 also tracks back to commit 874f0a1be443b8027d5aba2285866f31cf4169e5 and has a nice simple test case for misplaced frames already, so that should do for issue (2) of comment 12
Comment 17 Joel Madero 2015-04-10 14:17:44 UTC
I have mixed feelings about yet another list - I honestly don't keep track of any of them ;) What would be the criteria for getting on a "super annoying for lawyers list" ? 

I do agree that this particular but will affect the legal community more than most but I'm hard pressed to think of other bugs that are unique to the legal community - for instance I think that the bug that makes it so the size isn't retrained in footnote numbering is quite bad for lawyers, but I think it's going to affect the wider community also.

For me I'd wait until we have at least 5 bugs that belong on the list before making the list :) If we find 5 that seem like they would affect lawyers significantly more than the wider community than sure, let's make it :)
Comment 18 Robinson Tryon (qubit) 2015-04-10 15:02:19 UTC
(In reply to Joel Madero from comment #17)
> What would be the criteria for getting on a "super
> annoying for lawyers list" ? 

Good question. Perhaps if it's something that is a showstopper for using LibreOffice, e.g. to interact with the courts? My understanding is that clerks of the court are *significantly* more rigorous at enforcing rules than the average person.

> For me I'd wait until we have at least 5 bugs that belong on the list before
> making the list :) If we find 5 that seem like they would affect lawyers
> significantly more than the wider community than sure, let's make it :)

Yep, sounds good.
Comment 19 Robinson Tryon (qubit) 2015-12-13 11:12:06 UTC Comment hidden (obsolete)
Comment 20 Caolán McNamara 2016-06-17 16:20:48 UTC
commit 2062d5d6f472ffa22ab4a769f4cb992f3a91894c
Author: Oliver Specht <oliver.specht@cib.de>
Date:   Fri Sep 11 10:30:45 2015 +0200

    tdf#94045: negative margins in OOXML reenabled

fixed (probably)

commit 4771c8836a3e4d5e8ac25a7212293a13fb1e73ba
Author: Michael Meeks <michael.meeks@collabora.com>
Date:   Sat Jun 28 22:59:33 2014 +0100

    writerfilter: use XFastAttributes more efficiently.

The doc is still a bit of a car crash, but currently in master if you toggle the header's fit-to-text off the text lays out not too far away from the original intent. Enough to show its not utterly broken at an import level, just not quite right.
Comment 21 Michael Meeks 2016-08-04 09:01:35 UTC
Any chance you can re-test with a newer version including this fix - anything recent should so - 5.1.5 or 5.2.0 would be fine.

Thanks.
Comment 22 Buovjaga 2016-09-14 18:04:27 UTC
Created attachment 127334 [details]
PDF export from 5.3 alpha0

Arch Linux 64-bit, KDE Plasma 5
Version: 5.3.0.0.alpha0+
Build ID: 798d55fcd8efc10fcef6b8ac3fa5abdbc82501ec
CPU Threads: 8; OS Version: Linux 4.7; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on September 13th 2016
Comment 23 Xisco Faulí 2016-09-26 15:29:09 UTC
Adding Cc: to Michael Meeks
Comment 24 Michael Meeks 2016-10-01 07:55:25 UTC
Created attachment 127760 [details]
partial revert of my speedup
Comment 25 Michael Meeks 2016-10-01 08:02:28 UTC
After playing with reverting my patch; debugging version attached; I'm really un-convinced that there is a regression left here. Also this bug is really bad style - three+ bugs wedged into a single issue =)

Robinson / Matthew - could you split the bug into several pieces ? and it would be good to know which earlier versions this worked better in =)

Thanks !
Comment 26 Robinson Tryon (qubit) 2016-10-14 05:14:11 UTC
(In reply to Michael Meeks from comment #25)
> Robinson / Matthew - could you split the bug into several pieces ? 

Sure thing!

Bug 103206 - FILEOPEN: Vertical numbers missing from left margin of Pleading document

Bug 103207 - FILEOPEN: Vertical lines missing from margins of Pleading document

(In reply to Stephanie Shattuck from comment #0)
> ...the court requires us to email Word versions of all proposed
> orders, so even if you could create a beautiful pleading in LibreOffice, you
> would have to be able to convert it to Word seamlessly.

Confusing, but I'll split this one out as well:
Bug 103208 - US Federal Courts require proposed orders in Word format

That leaves the fourth problem for this bug report:

> 
> 1) The formatting (positioning) of the body text is all wrong

  Summary -> (changed)

So what's wrong with the body text?

TESTING with 5.3.0.0.alpha0+;OS X 10.10.5; 2016-10-13,
I opened the DOCX file and compared the body text to our reference rendering (attachment 114709 [details]). The left/right margins look fine, but LO does seem to be eliminating a good chunk of the top margin.

LO also renders a full two-line footer on both pages:
"Case No. 13-cv-3287-JSW [PROPOSED] ORDER GRANTING MOTION FOR HEARING
DATES FOR PENDING MOTION",
while the MS-Office-generated PDF includes *just* the first line in the footer of the first page:
"Case No. 13-cv-3287-JSW [PROPOSED] ORDER GRANTING MOTION FOR HEARING",
and *just* the top half of the first line in the footer of the second page.

Perhaps we need to test this document again in a newer version of MS-Office to make sure that we've got an accurate reference PDF.
Comment 27 Buovjaga 2016-10-14 05:32:33 UTC
Oops, there appears to have been a communication break. I created bug 102913 two weeks ago and pinged Michael about it and about how to close this report. I got no response and apparently forgot to add the report here.
Comment 28 Xisco Faulí 2016-11-12 13:12:28 UTC
bug 102913, bug 103206 and bug 103207 have been created as a follow-up of this one. Can this one be closed now?
Comment 29 Buovjaga 2016-11-12 20:18:07 UTC
(In reply to Xisco Faulí from comment #28)
> bug 102913, bug 103206 and bug 103207 have been created as a follow-up of
> this one. Can this one be closed now?

Might as well.