[Libreoffice-commits] core.git: xmlsecurity/source

Stephan Bergmann sbergman at redhat.com
Mon Feb 8 17:46:44 UTC 2016


 xmlsecurity/source/helper/xsecctl.cxx |   21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

New commits:
commit 3d0a2c8c43179ae0e19be154f44def8bb6cf8de6
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Feb 8 18:46:21 2016 +0100

    loplugin:refcounting
    
    Change-Id: Ib522a6ce9663b5f56888debb911296360da484d6

diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx
index dad4c39..0b7fa34 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()));


More information about the Libreoffice-commits mailing list