summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-10-07 13:37:00 +0200
committerJulien Nabet <serval2412@yahoo.fr>2017-10-07 14:36:00 +0200
commit7c757ade47bc47008d1292aac4989cfc995c3470 (patch)
tree3dd7d18923ba28364cf895a1998dcbd8c4760777 /sw
parent8b79b7f1e3e01c4d67bd42368e142c8073a1d1ac (diff)
cid#1418980: Resource leak
Since https://cgit.freedesktop.org/libreoffice/core/commit/?id=2694162969cf86ef366d3ce812fccd0630acc800 Change-Id: I4a48279f3d073160041b66dbcf148118588f8712 Reviewed-on: https://gerrit.libreoffice.org/43229 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/docxexport.cxx42
1 files changed, 21 insertions, 21 deletions
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 4ecd04f7d425..b57d24acbdb1 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -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);