Skip to content

Shape properties in drawing not populated on save #424

@KISPE-Shane

Description

@KISPE-Shane

When DrawingAnchor::loadXmlObjectShape encounters "nvSpPr", "spPr", "style" or "txBody", no corresponding data is loaded from the XML:

while (!reader.atEnd()) {
    reader.readNextStartElement();

     if (reader.tokenType() == QXmlStreamReader::StartElement) {
        if (reader.name() == QLatin1String("nvSpPr")) {

        } else if (reader.name() == QLatin1String("spPr")) {

        } else if (reader.name() == QLatin1String("style")) {

        } else if (reader.name() == QLatin1String("txBody")) {
        }
    } else if (reader.tokenType() == QXmlStreamReader::EndElement &&
               reader.name() == QLatin1String("sp")) {
        break;
    }
}

so when the file is written, we get

<xdr:sp macro="" textlink="">
xdr:nvSpPr
<xdr:cNvPr id="" name="">
<a:extLst/>
</xdr:cNvPr>
xdr:cNvSpPr/
</xdr:nvSpPr>
xdr:spPr
...

If we then load the corresponding .xlsx file into Excel, we get a message saying the file needed to be repaired resulting in

<xdr:sp macro="" textlink="">
xdr:nvSpPr
<xdr:cNvPr id="2" name="shape">
<a:extLst>
<a:ext uri="{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}">
<a16:creationId xmlns:a16="http://schemas.microsoft.com/office/drawing/2014/main" id="{00000000-0008-0000-0000-000002000000}"/>
</a:ext>
</a:extLst>
</xdr:cNvPr>
xdr:cNvSpPr/
</xdr:nvSpPr>
...
indicating that the id/name was lost between loading and writing of the XML.
xdr:spPr

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions