OpenXML (docx) - problem with a:graphicData inside a:graphicData

Issue #452 resolved
Former user created an issue

Original issue 452 created by andriy.luts...@crowdin.com on 2015-04-01T09:38:30.000Z:

If we have nested <a:graphic> <a:graphicData> tags:

........................
<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">
......................
<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">
......................
........................
</a:graphicData>
</a:graphic>
........................
</a:graphicData>
</a:graphic>
........................

We obtain result:
........................
<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">
......................
<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
......................
........................

</a:graphic>
........................
</a:graphicData>
</a:graphic>
........................

Nested tag a:graphicData converted into a:graphic and is not closed.

Comments (4)

  1. Chase Tingley

    Fixed, based on a patch from from Andriy Lutskiv at CrowdIn. I made a few cleanups to the patch to pull out some code, etc.

    I think there may be a more general approach here -- the WordTextBox class looks like it's trying to do something similar for a different special case (textboxes), but combining these cases may not be worth it at this point.

    This also fixes #455.

  2. Log in to comment