Bug 111785 - PPTX: Hatch fill background color is not exported to PPTX
Summary: PPTX: Hatch fill background color is not exported to PPTX
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
4.4 all versions
Hardware: All All
: medium normal
Assignee: g.tarsoly
URL:
Whiteboard: target:6.1.0 target:7.3.0
Keywords: difficultyInteresting, easyHack, filter:pptx, skillCpp
Depends on:
Blocks: PPTX
  Show dependency treegraph
 
Reported: 2017-08-14 02:31 UTC by Tamás Zolnai
Modified: 2021-11-05 17:25 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Document containing hatch fill with background (11.54 KB, application/vnd.oasis.opendocument.presentation)
2017-08-14 02:33 UTC, Tamás Zolnai
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tamás Zolnai 2017-08-14 02:31:13 UTC
Description:
Both in LO and MSO we can specify a background color for pattern area fill, but it seems PPTX export and also import does not handle the background color.

Steps to Reproduce:
1. Open attached ODP file
2. Save it as PPTX
3. Open the save file in LO or MSO

Actual Results:  
Pattern background color is not saved in PPTX files.

Expected Results:
Pattern background color should be save. MSO supports this feature.


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36
Comment 1 Tamás Zolnai 2017-08-14 02:32:56 UTC
Sorry, I mean hatch background color. In MSO there is only pattern and no hatch, but in LO this is called hatch fill.
Comment 2 Tamás Zolnai 2017-08-14 02:33:44 UTC
Created attachment 135531 [details]
Document containing hatch fill with background
Comment 3 Xisco Faulí 2017-08-14 10:48:58 UTC
Confirmed in

Version: 6.0.0.0.alpha0+
Build ID: ef2e6260fad38e26c8591ea88ded348db618270d
CPU threads: 4; OS: Linux 4.10; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

and 

Version: 4.3.0.0.alpha1+
Build ID: c15927f20d4727c3b8de68497b6949e72f9e6e9e
Comment 4 Tamás Zolnai 2017-08-14 23:23:21 UTC
Let's turn it into a easy hack. The code is here:
oox/source/export/drawingml.cxx
Check DrawingML::WriteFill(...) method
Comment 5 Shinnok 2017-09-07 08:18:23 UTC
Tamas, could you provide a bit more detailed code pointers for this easyHack?
Comment 6 Tamás Zolnai 2017-09-07 09:24:41 UTC
(In reply to Shinnok from comment #5)
> Tamas, could you provide a bit more detailed code pointers for this easyHack?

Of course.
The documentation of the fill API properties is here:
com/sun/star/drawing/FillProperties.idl
Where you see a xPropSet->getPropertyValue( "FillStyle" ) call, this means the code get an API property of the shape.
It's also a good idea to check how the Area dialog sets the fill properties for hatch (context menu -> Area -> Hatch tab):
cui/source/tabpages/tphatch.cxx
You can check what properties are set when a background is specified for a hatch fill (use some debugging for this). This code uses the internal items to set fill properties not the API.
The internal items are mapped to API properties here:
include/svx/unoshprp.hxx, check the block starting with "#define FILL_PROPERTIES".
For example XATTR_FILLHATCH is the ID of the internally used item which defines the hatch type and this is mapped to "FillHatch" API property.
Comment 7 Tamás Zolnai 2017-09-07 09:25:54 UTC
> The documentation of the fill API properties is here:
> com/sun/star/drawing/FillProperties.idl

offapi/com/sun/star/drawing/FillProperties.idl
Comment 9 Commit Notification 2017-12-11 19:32:00 UTC
geri1245 committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=54dfb9ff07a41d9249302ac2ed0a005d0a8114d4

tdf#111785 Save hatch background color in pptx format.

It will be available in 6.1.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 10 Commit Notification 2021-11-05 17:25:56 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/94df9426f557e49c8241fb2f5351a8d4ee801af6

tdf#111785: sd_export_tests-ooxml2: Add unittest

It will be available in 7.3.0.

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

Affected users are encouraged to test the fix and report feedback.