Kaydet (Commit) 7c757ade authored tarafından Julien Nabet's avatar Julien Nabet

cid#1418980: Resource leak

Since https://cgit.freedesktop.org/libreoffice/core/commit/?id=2694162969cf86ef366d3ce812fccd0630acc800

Change-Id: I4a48279f3d073160041b66dbcf148118588f8712
Reviewed-on: https://gerrit.libreoffice.org/43229Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 8b79b7f1
......@@ -1030,34 +1030,34 @@ void DocxExport::WriteSettings()
}
else if (propList[i].Name == "DocumentProtection")
{
sax_fastparser::FastAttributeList* pAttributeList = sax_fastparser::FastSerializerHelper::createAttrList();
uno::Sequence< beans::PropertyValue > rAttributeList;
propList[i].Value >>= rAttributeList;
for (sal_Int32 j = 0; j < rAttributeList.getLength(); ++j)
if (rAttributeList.getLength())
{
static DocxStringTokenMap const aTokens[] =
sax_fastparser::FastAttributeList* pAttributeList = sax_fastparser::FastSerializerHelper::createAttrList();
for (sal_Int32 j = 0; j < rAttributeList.getLength(); ++j)
{
{ "edit", XML_edit },
{ "enforcement", XML_enforcement },
{ "formatting", XML_formatting },
{ "cryptProviderType", XML_cryptProviderType },
{ "cryptAlgorithmClass", XML_cryptAlgorithmClass },
{ "cryptAlgorithmType", XML_cryptAlgorithmType },
{ "cryptAlgorithmSid", XML_cryptAlgorithmSid },
{ "cryptSpinCount", XML_cryptSpinCount },
{ "hash", XML_hash },
{ "salt", XML_salt },
{ nullptr, 0 }
};
if (sal_Int32 nToken = DocxStringGetToken(aTokens, rAttributeList[j].Name))
pAttributeList->add(FSNS(XML_w, nToken), rAttributeList[j].Value.get<OUString>().toUtf8());
}
static DocxStringTokenMap const aTokens[] =
{
{ "edit", XML_edit },
{ "enforcement", XML_enforcement },
{ "formatting", XML_formatting },
{ "cryptProviderType", XML_cryptProviderType },
{ "cryptAlgorithmClass", XML_cryptAlgorithmClass },
{ "cryptAlgorithmType", XML_cryptAlgorithmType },
{ "cryptAlgorithmSid", XML_cryptAlgorithmSid },
{ "cryptSpinCount", XML_cryptSpinCount },
{ "hash", XML_hash },
{ "salt", XML_salt },
{ nullptr, 0 }
};
if (sal_Int32 nToken = DocxStringGetToken(aTokens, rAttributeList[j].Name))
pAttributeList->add(FSNS(XML_w, nToken), rAttributeList[j].Value.get<OUString>().toUtf8());
}
if (rAttributeList.getLength())
{
// we have document protection from from input DOCX file
sax_fastparser::XFastAttributeListRef xAttributeList(pAttributeList);
......
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