Bug 94773 - FILEOPEN: OOXML - Object fill patterns incorrectly imported as hatching
Summary: FILEOPEN: OOXML - Object fill patterns incorrectly imported as hatching
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.1.0.0.alpha0+ Master
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:ooxml, needsDevEval, topicUI
Depends on:
Blocks: OOXML-Object-Fill Object-Fill-Pattern
  Show dependency treegraph
 
Reported: 2015-10-05 03:14 UTC by Yousuf Philips (jay) (retired)
Modified: 2018-11-05 22:43 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
sample (21.47 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2015-10-05 03:14 UTC, Yousuf Philips (jay) (retired)
Details
Sample file correctly exported to .odt with Word 2016 (6.93 KB, application/vnd.oasis.opendocument.text)
2018-11-05 22:43 UTC, Luke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2015-10-05 03:14:22 UTC
Created attachment 119295 [details]
sample

Steps:
1) Open attached file
2) Notice that all three rectangles have a hatching fill, though they should have a pattern fill

Version: 5.1.0.0.alpha1+
Build ID: 329496c1f75f97d2e6119ceb214a2ea1fbadb17a
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2015-10-03_02:47:24
Locale: en-US (en_US.UTF-8)

/word/document.xml has entries similar to this

<a:pattFill prst="pct5">
  <a:fgClr><a:schemeClr val="accent1"/></a:fgClr>
  <a:bgClr><a:schemeClr val="bg1"/></a:bgClr>
</a:pattFill>

where "pct5" is the internal pattern name for the 5% pattern, "accent1" is a foreground color of #4F81BD found in /word/theme/theme1.xml (<a:accent1>) and "bg1" is the background color of #FFFFFF found in /word/theme/theme1.xml (<a:lt1>) through <w:clrSchemeMapping w:bg1> in /word/settings.xml. As LO doesnt have any inbuilt patterns to map to, it can utilize the pattern bitmap file with the <mc:Fallback> tag, similar to

<v:fill r:id="rId6" o:title="" color2="white [3212]" type="pattern"/>

where "rId6" is referenced in /word/_rels/document.xml.rels to /word/media/image1.gif. The only thing that needs to be done to the black and white pattern bitmap file is swap the colors with the foreground and background colors.
Comment 1 Buovjaga 2015-10-08 08:30:27 UTC
Confirmed.

Win 7 Pro 64-bit, Version: 5.0.2.2 (x64)
Build ID: 37b43f919e4de5eeaca9b9755ed688758a8251fe
Locale: fi-FI (fi_FI)
Comment 2 Yousuf Philips (jay) (retired) 2016-08-27 15:38:19 UTC
We now have the MSO patterns (bug 94547), so it is now possible to map the prst attribute value to the presets found in standard.sop file.
Comment 3 Yousuf Philips (jay) (retired) 2016-09-04 17:35:36 UTC
As Luke mentioned in bug 94547 comment 16, we correctly utilize the gif file when it is in the old mso format (e.g. attachment 127146 [details]).
Comment 4 Luke 2018-11-05 22:43:40 UTC
Created attachment 146328 [details]
Sample file correctly exported to .odt with Word 2016

LO uses 8x8 pattern, while MSO uses 32x32. The dots patterns do map well, but this is not true for many others. A universal fix would be to import patterns the same way MSO exports them to ODF, by converting the pattern to a tiled bitmap.