Kaydet (Commit) 442701de authored tarafından Joren De Cuyper's avatar Joren De Cuyper Kaydeden (comit) Caolán McNamara

Don't write empty value when exporting grab-bagged w:docPartUnique

See http://dev-builds.libreoffice.org/crashtest/e658cb4d5ce49d3a3c6acc63155974b5ff8490c7/validation/docx/fdo33590-2.docx.log

(footer1.xml:2 col:890) cvc-datatype-valid.1.2.1: '' is not a valid value for 'boolean'.
(footer1.xml:2 col:890) cvc-attribute.3: The value '' of attribute 'w:val' on
element 'w:docPartUnique' is not valid with respect to its type, 'ST_OnOff'.

Original document:
      <w:docPartObj>
        <w:docPartGallery w:val="Page Numbers (Bottom of Page)"/>
        <w:docPartUnique/>
      </w:docPartObj>

RT document:
      <w:docPartObj>
        <w:docPartGallery w:val="Page Numbers (Bottom of Page)"/>
        <w:docPartUnique w:val=""/>
      </w:docPartObj>

Change-Id: If41af8f4bca99fba4d3ad0c966c2345f87ea422a
solution: if value is empty, export it as true (default ST-OnOff value)
Reviewed-on: https://gerrit.libreoffice.org/15686Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 1bcf8e12
......@@ -8004,7 +8004,12 @@ void DocxAttributeOutput::ParaGrabBag(const SfxGrabBagItem& rItem)
FSNS( XML_w, XML_docPartCategory ),
OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr() );
else if (aGrabBag[j].Name == "ooxml:CT_SdtDocPart_docPartUnique")
AddToAttrList( m_pParagraphSdtPrTokenChildren, FSNS( XML_w, XML_docPartUnique ), "" );
{
if (sValue.isEmpty())
sValue = "true";
AddToAttrList( m_pParagraphSdtPrTokenChildren, FSNS( XML_w, XML_docPartUnique ),
OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr() );
}
}
}
else if (aPropertyValue.Name == "ooxml:CT_SdtPr_equation")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment