diff options
-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())); |