Download it now!
Bug 47337 - Word import sets some margins to 100%
Summary: Word import sets some margins to 100%
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
3.5.0 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
Depends on:
Reported: 2012-03-15 01:17 UTC by Werner Donné
Modified: 2015-03-11 16:01 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:

Test document (37.00 KB, application/msword)
2012-03-15 01:17 UTC, Werner Donné
Another test-document (459.78 KB, application/vnd.oasis.opendocument.text)
2012-11-26 15:28 UTC, Werner Donné

Note You need to log in before you can comment on or make changes to this bug.
Description Werner Donné 2012-03-15 01:17:43 UTC
Created attachment 58474 [details]
Test document

When you import the attached document and save it in ODT you will see that the paragraphs have the property "fo:margin" set to "100%".
Comment 1 Werner Donné 2012-04-16 01:56:21 UTC
This also happens when you save the test-document in ODT in Word 2010 and then open it in LibreOffice. The document saved by Word doesn't have margin properties in the "Standard" style. This leads me to think that there might be something wrong with the assignment of default values for the margin properties.

In LibreOffice the fo:margin=100% is there too, but it is accompanied with explicit assignments of the margins at the four sides, which effectively overrides fo:margin completely.
Comment 2 sasha.libreoffice 2012-06-05 04:48:52 UTC
Thanks for bugreport
in 3.5.4 only style "lyst" has such property. Why it is bad?
Comment 3 Werner Donné 2012-06-05 06:40:15 UTC
It is bad because the paragraph style in the Word file has space before and after set to 0pt for those items. Therefore, fo:margin="100%" is wrong.

After the import the style looks like this:

      <style:style style:name="lyst" style:family="paragraph" style:parent-style-name="Standard">
         <style:paragraph-properties fo:margin="100%" fo:margin-left="3mm" fo:margin-right="0mm" fo:orphans="2"
         <style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>

This means that fo:margin-top and fo:margin-bottom both resolve to "100%", which is not what the Word file says. The result is that the paragraphs have a very large separation between them. However, LibreOffice doesn't show this separation.

I suspect therefore that the following happens:

1) In Word the default for the margins is 0pt, which is why it isn't set explicitly.
2) The LibreOffice input filter for Word or maybe LibreOffice itself sets fo:margin="100%".
3) LibeOffice ignores the fo:margin shorthand and only uses the specific margin properties fo:margin-left, etc.

If this is correct then the import is wrong as well as the interpretation of the fo:margin shorthand property.
Comment 4 sasha.libreoffice 2012-06-05 22:41:29 UTC
Thanks for additional information
Comment 5 bfoman (inactive) 2012-08-10 10:42:01 UTC
(In reply to comment #3)
> After the import the style looks like this:
>       <style:style style:name="lyst" style:family="paragraph"
> style:parent-style-name="Standard">
>          <style:paragraph-properties fo:margin="100%" fo:margin-left="3mm"

Confirmed with:
Build ID: own W7 debug build
Windows 7 Professional SP1 64 bit
Comment 6 Werner Donné 2012-11-26 15:28:29 UTC
Created attachment 70597 [details]
Another test-document
Comment 7 Werner Donné 2012-11-26 15:31:32 UTC
The bug is still in status unconfirmed, while it seems that in the last comment it was confirmed.

In the meantime I have discovered that it is not related to the Word import module, but just a problem of the default value of fo:margin. The second test-document has the style "Heading_20_3" where fo:margin is not set. After saving it fo:margin is set to 100%, which is wrong.
Comment 8 sasha.libreoffice 2012-11-27 11:32:18 UTC
Thanks for additional testing
I have saved first attachment to odt and manually removed fo:margin=100% from there. But it not helps. odt still differs from doc in Writer
May be we have problem with opening doc the same as in Bug 47838?
Comment 9 Werner Donné 2012-11-27 11:49:51 UTC
I don't think it is related to that bug. This bug is about the default value of fo:margin. Whenever you have a style in which one of the four margins is not set "fo:margin=100%" is added. This happens either when opening or when saving the document. I recon it will be the first.
Comment 10 Jorendc 2013-05-19 15:30:29 UTC
(In reply to comment #7)
> The bug is still in status unconfirmed, while it seems that in the last
> comment it was confirmed.

I agree to that. Therefore lets mark it as such.

Thanks for your patience and information.

Kind regards,
Comment 11 QA Administrators 2015-03-04 02:18:28 UTC
** Please read this message in its entirety before responding **

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present on a currently supported version of LibreOffice ( or later):

If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior

If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case)

Thank you for your help!

-- The LibreOffice QA Team
This NEW Message was generated on: 2015-03-03
Comment 12 Werner Donné 2015-03-11 16:01:03 UTC
I have retried it with version on Mac OS X 10.10.2 and it works as expected.