4 Mart 2018 Pazar

Solution Proposal For OOXML Shape's in Libreoffice Calc

Hello everyone, I am Serdar and I am working on bug 104290. It's about OOXML filters and LibreOffice Calc. When you add a shape in Excel to document and rotate it by any degrees, LibreOffice Calc opens it without rotation. The reason of problem is this patch(bnc#762542). Which commited in 2012 by Noel Power.

In this patch, Calc sets rotation to zero by anchor type. There is two main problem before this patch:

1-) When you add rectangular shapes in Excel to document and rotate it by 90-180-270 degrees, In my opinion, Excel writes rectangular shape's coordinates after rotation(In Writer or other components there isn't a problem and I searched oox filters in calc for shape rotation and all I can find is Noel's patch which causes error)

This is an explanation what I've said on above:






2-) LibreOffice doesn't handle upright property.

And I have solution proposal for this 2 problems.

 Problem 1: We need to control shape type for set shape rotation to zero in LibreOffice Calc, not anchor type (We need to delete patch for bnc#762542). If the shape is rectangular, set shape rotation to zero, not the text rotation. If the shape is not rectangular leave the shape as it is.

There is an explanation for what I've said on above:

Original shapes in Excel



How it looks like with patch for bnc#762542



How it looks like without patch for bnc#762542



As you can see problem occurs in only rectangle (Textboxes are positioning inside a rectangle in XML by Excel).



I am working on the patch for this solution proposal and I am near to finish that.

Problem 2: If there is an upright property in the text we need to handle upright property first. After that, we need to set only text rotation to zero. It's just about text, not the shape.

I've tried to explain the problem and how to solve it by myself. It might not be correct but if it is wrong please contact me and tell me how should be the correct solution. Have a great day...