Bug Hunting Session
Bug 111789 - TextBox shadow propeties are not saved to PPTX
Summary: TextBox shadow propeties are not saved to PPTX
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
4.4 all versions
Hardware: All All
: medium normal
Assignee: Tamás Zolnai
URL:
Whiteboard: target:6.1.0
Keywords: difficultyBeginner, easyHack, filter:pptx, skillCpp
Depends on:
Blocks: PPTX
  Show dependency treegraph
 
Reported: 2017-08-14 03:40 UTC by Tamás Zolnai
Modified: 2018-02-27 13:44 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
OPD file containing a shape and a text box with shadow (10.69 KB, application/vnd.oasis.opendocument.presentation)
2017-08-14 03:40 UTC, Tamás Zolnai
Details
Exported PPTX with no shadow for textshape (20.49 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2017-08-14 03:41 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 03:40:17 UTC
Description:
In general shapes' shadow properties are handled during export to PPTX file, but this does not work for text boxs, which are also some kind of shapes.

Steps to Reproduce:
1. Open attached ODP file containing a shape and a textbox
2. Save it to PPTX
3. Import the save PPTX to LO or MSO

Actual Results:  
Textbox's shadow is gone, while shape's shadow is there.

Expected Results:
Textbox's shadow also should be exported.


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 03:40:41 UTC
Created attachment 135534 [details]
OPD file containing a shape and a text box with shadow
Comment 2 Tamás Zolnai 2017-08-14 03:41:04 UTC
Created attachment 135535 [details]
Exported PPTX with no shadow for textshape
Comment 3 raal 2017-08-14 06:16:52 UTC
Confirmed. Version: 6.0.0.0.alpha0+
Build ID: b6e32d53ce9c98bfba517c40f53d40e97a091b0e
CPU threads: 4; OS: Windows 6.1; UI render: default; 
and Version: 4.4.0.0.alpha0+
Comment 4 Tamás Zolnai 2017-08-14 23:30:55 UTC
Let's turn it into a easy hack. The code is here:
oox/source/export/shapes.cxx
Check ShapeExport::WriteTextBox(...) method and also ShapeExport::WriteCustomShape(...)
Comment 5 Shubham Gupta 2017-12-23 12:06:42 UTC
Hello, I am a newbie and wish to work on this bug but when I tried this on my pc text box shadows were exporting fine.
Comment 6 Tamás Zolnai 2017-12-23 19:46:44 UTC
Hi,

Someone is already working on this bug (see assignee field). So please find and other easy hack work on and do not forget to assign that to yourself.
Comment 7 Archit Jugran 2018-01-01 10:20:57 UTC
Hey Tamas , in the assignee field, it mentioned that it was assigned to you only. So can  i work on this bug? I was successful in reproducing the bug and am looking forward to solve it as my first ever bug.
Comment 8 Tamás Zolnai 2018-01-01 13:14:41 UTC
(In reply to Archit Jugran from comment #7)
> Hey Tamas , in the assignee field, it mentioned that it was assigned to you
> only. So can  i work on this bug? I was successful in reproducing the bug
> and am looking forward to solve it as my first ever bug.

Yes, you can work on this bug.
Comment 9 Ekansh Jha 2018-01-03 04:25:47 UTC
Archit: A Polite Ping, Still working on this? or I can assign it to myself?
Comment 10 Ekansh Jha 2018-01-03 18:18:53 UTC
Hi,

I think Archit is not working on this as he hasn't assign it to himself. Hence I am assigning this bug to myself.
Comment 11 Ekansh Jha 2018-01-04 04:29:28 UTC
Hi Tamas,

I looked into this bug and got to know that WriteShapeEffects is responsible for shadow of custom shapea and works fine in ShapeExport::WriteCustomShape but when i try to apply this function in ShapeExport::WriteTextBox, it's not working. Is there any other information that i need to know?
Comment 12 Ekansh Jha 2018-01-04 07:51:24 UTC
And also what type of box is that orange? is that normal rectangle? actually i tried with WritePolyPolygonShape, WriteahCustomShape, WriteRectangleShape but i dob't see anything related to that textbox. Could you please help me.
Comment 13 Tamás Zolnai 2018-01-06 01:21:24 UTC
I suggest to use a debugger tool to better understand the code:
https://wiki.documentfoundation.org/Development/How_to_debug
Also use MS Office to check the export result, it might add some invalidation error, which means that the generated file is invalid. Also you can check what WriteShapeEffects do. Maybe textbox is exported differently as the other shape next to it. It's also a good idea to check the xml files inside PPTX, what it looks like after LO export and after MSO export.
Comment 14 Ekansh Jha 2018-01-06 14:15:49 UTC
Hi Tamas,

I tried to play with the code and just out of my curiosity i commented "pFS->endElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp) );" this xml tag at line 1023 under ShapeExport::WriteCustomShape, and i got the required shadow property but:
didn't get the second right box in export.

I do know that after starting one should obviously close the tag, but could you please tell me what could be the possible cause of this weird behaviour.
Comment 15 Tamás Zolnai 2018-01-07 19:55:39 UTC
(In reply to Ekansh Jha from comment #14)
> Hi Tamas,
> 
> I tried to play with the code and just out of my curiosity i commented
> "pFS->endElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ?
> XML_sp : XML_wsp) );" this xml tag at line 1023 under
> ShapeExport::WriteCustomShape, and i got the required shadow property but:
> didn't get the second right box in export.
> 
> I do know that after starting one should obviously close the tag, but could
> you please tell me what could be the possible cause of this weird behaviour.

I have no idea about the details. A corrupted file can lead to weird behavior.
Comment 16 Ekansh Jha 2018-01-08 19:19:34 UTC
Hi,

I tried to look into it and found that in ShapeExport::WriteTextBox() first loop doesn't work, After implementing WriteShapeEffects( rXPropSet ) to that loop, i think it will work. I tried but failed, Could you please suggest anything that can help.
Comment 17 Tamás Zolnai 2018-01-09 22:40:18 UTC
(In reply to Ekansh Jha from comment #16)
> Hi,
> 
> I tried to look into it and found that in ShapeExport::WriteTextBox() first
> loop doesn't work, After implementing WriteShapeEffects( rXPropSet ) to that
> loop, i think it will work. I tried but failed, Could you please suggest
> anything that can help.

As I already suggested, it's the best to find out what MSO export shadow properties into a PPTX file. For this you can save the attached ODP to a PPTX (in LO), open it in MSO, set some shadow and then save again. You can find the important part in slide1.xml and you can check how shadow is implemented in this file format.
Also you can monitor how LO export works by reading the XML file. In the code you can find contstans with XML_ prefix (e.g. XML_txBody, XML_txbx), those are the xml tags (without the prefix, e.g. txBody, txbx) which you can search in the output.
Comment 18 Xisco Faulí 2018-02-26 03:29:29 UTC Comment hidden (obsolete)
Comment 19 Commit Notification 2018-02-27 10:08:11 UTC
Tamás Zolnai committed a patch related to this issue.
It has been pushed to "master":

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

tdf#111789: TextBox shadow propeties are not saved to PPTX

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.