Bug 77961 - FILEOPEN: MSO ODT - Text grid lines are enabled even when style:layout-grid-display isnt set
Summary: FILEOPEN: MSO ODT - Text grid lines are enabled even when style:layout-grid-d...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.4.2 release
Hardware: Other All
: medium normal
Assignee: Mark Hung
URL:
Whiteboard: odf target:6.0.0
Keywords:
Depends on:
Blocks: ODF-import Text-Grid
  Show dependency treegraph
 
Reported: 2014-04-26 10:52 UTC by Yousuf Philips (jay) (retired)
Modified: 2017-12-27 09:33 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
shows how the table looking lines show up in the document (60.45 KB, image/png)
2014-04-26 10:52 UTC, Yousuf Philips (jay) (retired)
Details
the odt file produced by word 2010 (223.22 KB, application/vnd.oasis.opendocument.text)
2014-04-26 10:53 UTC, Yousuf Philips (jay) (retired)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2014-04-26 10:52:16 UTC
Created attachment 98013 [details]
shows how the table looking lines show up in the document

I download the .docx file found at < http://download.microsoft.com/documents/customerevidence/Files/710000003670/Xiamen_Tungsten_Group_unifies_enterprise.docx > and opened it with word 2010 and then saved it as an ODT. When i opened the ODT in LibO, it file displays like it has tables all over it. Tested in 4.0 - 4.3.
Comment 1 Yousuf Philips (jay) (retired) 2014-04-26 10:53:53 UTC
Created attachment 98014 [details]
the odt file produced by word 2010
Comment 2 Jorendc 2014-04-26 12:24:55 UTC
Reproducible, tested using Windows 8.1 with LibreOffice Version: 4.3.0.0.alpha1+
Build ID: f4a6837025a293312cbc43b9c527851362f11030
TinderBox: Win-x86@47-TDF, Branch:MASTER, Time: 2014-04-26_09:21:18

But are we sure this is a bug in our .odt import filters, and not a bug in Word' export filters?

(In reply to comment #0)
> Tested in 4.0 - 4.3.
With what version of 4.0 did you test? This should be the version in the version field of this bug report (currently 4.2.3.3 is selected). Our version field is the oldest version of LibreOffice that can reproduce this bug (looks like you can reproduce using a version of 4.0-bracnh)

Kind regards,
Joren
Comment 3 Yousuf Philips (jay) (retired) 2014-04-26 13:42:13 UTC
Well i opened the file with Calligra Words and it opened fine. Is there a means to know 100% whether its a bug from LibO's or Office's side?

I primarily test on 4.2.3.3 and then test 4.1, 4.0, 4.3, and sometimes 3.6. Thanks for the notice about what the version field is for.
Comment 4 Jorendc 2014-04-26 13:48:27 UTC
(In reply to comment #3)
> Well i opened the file with Calligra Words and it opened fine. Is there a
> means to know 100% whether its a bug from LibO's or Office's side?

I marked your bug as NEW because I'm not 100% which suite is the 'bad' one :-). But I assume it is Word, due the fact our native file format is ODT (at least, it is more likely). Not saying my assumption is correct. So lets mark it as NEW and ask a dev to have a look.
 
> I primarily test on 4.2.3.3 and then test 4.1, 4.0, 4.3, and sometimes 3.6.
> Thanks for the notice about what the version field is for.

Okay, lets mark it as 4.0.6.2 right now. If you know the actual version of 4.0-branch, feel free to edit the field.

You are doing great testing :-). Great you also test older versions to spot regressions.

Kind regards,
Joren
Comment 5 Yousuf Philips (jay) (retired) 2014-04-26 14:26:39 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Well i opened the file with Calligra Words and it opened fine. Is there a
> > means to know 100% whether its a bug from LibO's or Office's side?
> 
> I marked your bug as NEW because I'm not 100% which suite is the 'bad' one
> :-). But I assume it is Word, due the fact our native file format is ODT (at
> least, it is more likely). Not saying my assumption is correct. So lets mark
> it as NEW and ask a dev to have a look.

Well Calligra Words native format is also ODT. :)

>  
> > I primarily test on 4.2.3.3 and then test 4.1, 4.0, 4.3, and sometimes 3.6.
> > Thanks for the notice about what the version field is for.
> 
> Okay, lets mark it as 4.0.6.2 right now. If you know the actual version of
> 4.0-branch, feel free to edit the field.
> 

I've been using 4.0.4.2 as thats was the version i could find online. Where can i download the last release of 4.0? I'm also running 3.6.4.3, is that the last 3.6 version?

> You are doing great testing :-). Great you also test older versions to spot
> regressions.
> 
> Kind regards,
> Joren

Thanks. Should i also test 3.5?
Comment 6 Jorendc 2014-04-26 14:39:35 UTC
(In reply to comment #5)
> Well Calligra Words native format is also ODT. :)

Aah, I see :-). That makes sense then :-).

> I've been using 4.0.4.2 as thats was the version i could find online. Where
> can i download the last release of 4.0? I'm also running 3.6.4.3, is that
> the last 3.6 version?

You can find all released LibreOffice versions here: http://downloadarchive.documentfoundation.org/libreoffice/old/

4.0.6.2 is the last version of 4.0-branch, while 3.6.7.2 is the last version of 3.6-branch.

> Thanks. Should i also test 3.5?

If you can, please do :-). The more info, the better. But maybe it is not necessary due the fact it is just present, and probably not a regression.

Kind regards,
Joren
Comment 7 Yousuf Philips (jay) (retired) 2014-04-26 17:20:30 UTC
Thanks for the link.
Comment 8 Michael Stahl (CIB) 2014-07-03 16:58:50 UTC
apparently the document has a text grid applied in its PL0 page style:

    <style:page-layout style:name="PL0">
      <style:page-layout-properties 
        ...
        style:layout-grid-mode="line" style:layout-grid-lines="44"

so since a text grid exists on the page, it's not much of a
surprise that grid lines are displayed.

you can check that on Format->Page, Text Grid tab, it says "Grid (lines only)"

Word does not display a grid when opening the file.

saving the document with LO, some additional attributes appear:

    style:layout-grid-print="true" style:layout-grid-display="true"

these explicitly control whether the grid is displayed.

so probably what happens is that Word has fixed default off for these
attributes while OOo/LO has the default depending on whether the other
attributes are present.

according to Microsoft's Office ODF conformance document,
the style:layout-grid-display attribute is not supported by Word.

http://msdn.microsoft.com/en-us/library/jj671891%28v=office.12%29.aspx

although on Page Layout -> Page Setup -> Document Grid
in Word 2010 it says that a line grid is enabled... but Word does not
display grid lines, even if you click View->Show->Gridlines checkbox.

hmm.... there is actually a grid displayed in Word, but apparently
only in those places where there is no text, such as at the bottom
of the first page.  if you add more text the grid disappears.

an obvious difference is that in Writer the text grid has a 10pt
space for Ruby text, whereas the same is much smaller in Word,
or actually it looks like Word only provides space for Ruby text
if such exists;
this is controlled by the style:layout-grid-ruby-height attribute.

so i don't think there is a bug here really.
Comment 9 Jorendc 2014-07-03 20:22:42 UTC
(In reply to comment #8)
Wow, thanks for your explanation and your analysis of this bug.

> so i don't think there is a bug here really.

I think I have to say 'great' :-). But since you didn't marked it as RESOLVED NOTABUG, are there still some things to discuss/analyze for this bug?

Kind regards,
Joren
Comment 10 QA Administrators 2015-07-18 17:44:43 UTC Comment hidden (obsolete)
Comment 11 Buovjaga 2015-10-23 17:20:49 UTC
Notabug per comment 8
Comment 12 Yousuf Philips (jay) (retired) 2017-09-29 10:55:12 UTC
(In reply to Michael Stahl from comment #8)
> so probably what happens is that Word has fixed default off for these
> attributes while OOo/LO has the default depending on whether the other
> attributes are present.

Yes it seems this is the problem as WebODF, Word and Calligra all default to off and OOo/LO default to it being on. You can see the screenshots for odt-layout-grid-mode-both, odt-layout-grid-mode-lines, and odt-layout-grid-snap-to havings grids enabled in these page-level tests[1].

http://autotests.opendocumentformat.org/2015/sep/page-layout-properties/report.html

> according to Microsoft's Office ODF conformance document,
> the style:layout-grid-display attribute is not supported by Word.
> 
> http://msdn.microsoft.com/en-us/library/jj671891%28v=office.12%29.aspx

I assume they will never support it, as MS Word doesnt have an equivalent feature for it. Their gridline feature is like our grid feature (View > Grid), but they dont have an additional one similar to our page-level text grid feature.

> although on Page Layout -> Page Setup -> Document Grid
> in Word 2010 it says that a line grid is enabled... but Word does not
> display grid lines, even if you click View->Show->Gridlines checkbox.

Havent been able to find Document Grid in any 2007, 2010, and 2013, but did find Page Layout -> Arrange > Align > Grid Settings.

> hmm.... there is actually a grid displayed in Word, but apparently
> only in those places where there is no text, such as at the bottom
> of the first page.  if you add more text the grid disappears.

Yes grids in Word are put in the background, LO puts grid in the foreground, and because the paragraphs have a background color, you dont see the grid behind it.

http://cdn.makeuseof.com/wp-content/uploads/2014/09/flowchart03.jpg

> so i don't think there is a bug here really.

I believe there is.

Regina, Jos: What is your take?
Comment 13 Commit Notification 2017-10-24 14:12:33 UTC
Mark Hung committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=48a4cf1021c471ebf1ecbc351292511131c2d4ca

tdf#77961 set display grid to false if the attribute is missing

It will be available in 6.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Yousuf Philips (jay) (retired) 2017-10-24 21:39:14 UTC
Mark: will the patch also disable print grid (style:layout-grid-print)?
Comment 15 Commit Notification 2017-10-26 15:33:21 UTC
Mark Hung committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4e5123fc592cc1a97f7f64b964f858b6f71540cb

tdf#77961 regard layout-grid-print as off when missing.

It will be available in 6.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 16 Xisco Faulí 2017-11-26 17:48:53 UTC
A polite ping to Mark Hung: is this bug fixed? if so, could you
please close it as RESOLVED FIXED ? Thanks