diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-02-08 18:46:21 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-02-08 18:46:21 +0100 |
commit | 3d0a2c8c43179ae0e19be154f44def8bb6cf8de6 (patch) | |
tree | 1a9a54167fe12541a797018bc9682a98e11412f5 /xmlsecurity | |
parent | d833d695fda3726447a9295cfc679229e554b1ce (diff) |
loplugin:refcounting
Change-Id: Ib522a6ce9663b5f56888debb911296360da484d6
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/helper/xsecctl.cxx | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx index dad4c39c69e2..0b7fa3427a62 100644 --- a/xmlsecurity/source/helper/xsecctl.cxx +++ b/xmlsecurity/source/helper/xsecctl.cxx @@ -30,6 +30,7 @@ #include <xmloff/attrlist.hxx> #include <rtl/math.hxx> +#include <rtl/ref.hxx> #include <unotools/datetime.hxx> namespace cssu = com::sun::star::uno; @@ -980,16 +981,16 @@ void XSecController::exportOOXMLSignature(const uno::Reference<xml::sax::XDocume xDocumentHandler->startElement(TAG_SIGNEDINFO, uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); { - std::unique_ptr<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); pAttributeList->AddAttribute(ATTR_ALGORITHM, ALGO_C14N); - xDocumentHandler->startElement(TAG_CANONICALIZATIONMETHOD, uno::Reference<xml::sax::XAttributeList>(pAttributeList.release())); + xDocumentHandler->startElement(TAG_CANONICALIZATIONMETHOD, uno::Reference<xml::sax::XAttributeList>(pAttributeList.get())); xDocumentHandler->endElement(TAG_CANONICALIZATIONMETHOD); } { - std::unique_ptr<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); pAttributeList->AddAttribute(ATTR_ALGORITHM, ALGO_RSASHA256); - xDocumentHandler->startElement(TAG_SIGNATUREMETHOD, uno::Reference<xml::sax::XAttributeList>(pAttributeList.release())); + xDocumentHandler->startElement(TAG_SIGNATUREMETHOD, uno::Reference<xml::sax::XAttributeList>(pAttributeList.get())); xDocumentHandler->endElement(TAG_SIGNATUREMETHOD); } @@ -999,28 +1000,28 @@ void XSecController::exportOOXMLSignature(const uno::Reference<xml::sax::XDocume if (rReference.nType == SignatureReferenceType::SAMEDOCUMENT) { { - std::unique_ptr<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); if (rReference.ouURI != "#idSignedProperties") pAttributeList->AddAttribute("Type", "http://www.w3.org/2000/09/xmldsig#Object"); else pAttributeList->AddAttribute("Type", "http://uri.etsi.org/01903#SignedProperties"); pAttributeList->AddAttribute(ATTR_URI, rReference.ouURI); - xDocumentHandler->startElement(TAG_REFERENCE, uno::Reference<xml::sax::XAttributeList>(pAttributeList.release())); + xDocumentHandler->startElement(TAG_REFERENCE, uno::Reference<xml::sax::XAttributeList>(pAttributeList.get())); } if (rReference.ouURI == "#idSignedProperties") { xDocumentHandler->startElement(TAG_TRANSFORMS, uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); - std::unique_ptr<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); pAttributeList->AddAttribute(ATTR_ALGORITHM, ALGO_C14N); - xDocumentHandler->startElement(TAG_TRANSFORM, uno::Reference<xml::sax::XAttributeList>(pAttributeList.release())); + xDocumentHandler->startElement(TAG_TRANSFORM, uno::Reference<xml::sax::XAttributeList>(pAttributeList.get())); xDocumentHandler->endElement(TAG_TRANSFORM); xDocumentHandler->endElement(TAG_TRANSFORMS); } { - std::unique_ptr<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); pAttributeList->AddAttribute(ATTR_ALGORITHM, ALGO_XMLDSIGSHA256); - xDocumentHandler->startElement(TAG_DIGESTMETHOD, uno::Reference<xml::sax::XAttributeList>(pAttributeList.release())); + xDocumentHandler->startElement(TAG_DIGESTMETHOD, uno::Reference<xml::sax::XAttributeList>(pAttributeList.get())); xDocumentHandler->endElement(TAG_DIGESTMETHOD); } xDocumentHandler->startElement(TAG_DIGESTVALUE, uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); |