diff options
author | umeshkadam <umesh.kadam@synerzip.com> | 2014-02-10 17:28:13 +0530 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-02-14 11:12:19 +0000 |
commit | cf4e5e497974edc5d19d6899fbe01cdf2451b341 (patch) | |
tree | 848bb2025cc59233c1a08e3c831a8783663e6243 /oox | |
parent | 0ff99adddc104ca09a97c2fd3d25e58787afb32d (diff) |
FDO#74774 : issue with number of child nodes of tag CubicBezierTo.
Issue :
- Number of child nodes required by cubicBexTo should be 3 of type "pt".
While exporting, sometimes the child nodes are less than 3.
The sequence of writing these tags was getting messed up.
Implementation :
- corrected the logic for writing the sequence of cubicBexTo tag.
Change-Id: Ic26db72b2c516276c2e6452a21b4106d6a0a1a80
Reviewed-on: https://gerrit.libreoffice.org/7990
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/drawingml.cxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index bdec63d80e1a..d03a0d87c007 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1812,6 +1812,7 @@ void DrawingML::WritePolyPolygon( const PolyPolygon& rPolyPolygon ) mpFS->endElementNS( XML_a, XML_moveTo ); } + sal_Int32 nCounter = 0 ; for( sal_uInt16 j = 1; j < rPoly.GetSize(); j ++ ) { enum PolyFlags flags = rPoly.GetFlags(j); @@ -1821,7 +1822,10 @@ void DrawingML::WritePolyPolygon( const PolyPolygon& rPolyPolygon ) bBezier = sal_True; } else if( flags == POLY_NORMAL && !bBezier ) + { mpFS->startElementNS( XML_a, XML_lnTo, FSEND ); + ++nCounter ; + } mpFS->singleElementNS( XML_a, XML_pt, XML_x, I64S( rPoly[j].X() - aRect.Left() ), @@ -1835,12 +1839,19 @@ void DrawingML::WritePolyPolygon( const PolyPolygon& rPolyPolygon ) } else if( flags == POLY_NORMAL && !bBezier ) mpFS->endElementNS( XML_a, XML_lnTo ); - else if( bBezier && ( j % 3 ) == 0 ) + + /* ( j % 3 == 0 ) will fail to address the iterations + that have been dedicated to XML_lnTo in case if the + flag is POLY_NORMAL. + Similarly the sequence would go wrong if we do not + make the flag bBezier as false after ending the element. + */ + else if( bBezier && ( ( j - nCounter ) % 3 ) == 0 ) { // //a:cubicBezTo can only contain 3 //a:pt elements, so we // need to break things up... mpFS->endElementNS( XML_a, XML_cubicBezTo ); - mpFS->startElementNS( XML_a, XML_cubicBezTo, FSEND ); + bBezier = sal_False; } } |