[PATCH 1/3] Remove unused code in XMLSignatureHelper

Catalin Iacob iacobcatalin at gmail.com
Fri Feb 10 14:10:42 PST 2012


---
 unusedcode.easy                                    |    6 ---
 xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx |   11 -----
 xmlsecurity/source/helper/xmlsignaturehelper.cxx   |   47 --------------------
 3 files changed, 0 insertions(+), 64 deletions(-)

diff --git a/unusedcode.easy b/unusedcode.easy
index d6d3b58..a06d04c 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -673,12 +673,6 @@ XMLPropertyBackpatcher<rtl::OUString>::XMLPropertyBackpatcher(rtl::OUString cons
 XMLPropertyBackpatcher<short>::XMLPropertyBackpatcher(char const*)
 XMLPropertyBackpatcher<short>::XMLPropertyBackpatcher(char const*, char const*, unsigned char, short)
 XMLPropertyBackpatcher<short>::XMLPropertyBackpatcher(rtl::OUString const&, rtl::OUString const&, unsigned char, short)
-XMLSignatureHelper::CreateAndWriteSignature(com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> const&)
-XMLSignatureHelper::GetSecurityEnvironmentByIndex(int)
-XMLSignatureHelper::GetSecurityEnvironmentNumber()
-XMLSignatureHelper::GetUriBinding() const
-XMLSignatureHelper::SetUriBinding(com::sun::star::uno::Reference<com::sun::star::xml::crypto::XUriBinding>&)
-XMLSignatureHelper::SetX509Certificate(int, int, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&)
 XMLTextFieldExport::ProcessDate(xmloff::token::XMLTokenEnum, com::sun::star::util::Date const&, unsigned short)
 XMLTextImportHelper::GetRangeFor(rtl::OUString&)
 XMLTextImportHelper::HasDrawNameAttribute(com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList> const&, SvXMLNamespaceMap&)
diff --git a/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx b/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx
index d0d3bbe..c83444a 100644
--- a/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx
+++ b/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx
@@ -137,11 +137,6 @@ public:
     // Returns true for success.
     bool        Init();
 
-                // Set UriBinding to create input streams to open files.
-                // Default implementation is capable to open files from disk.
-    void        SetUriBinding( com::sun::star::uno::Reference< com::sun::star::xml::crypto::XUriBinding >& rxUriBinding );
-    com::sun::star::uno::Reference< com::sun::star::xml::crypto::XUriBinding > GetUriBinding() const;
-
     // Set the storage which should be used by the default UriBinding
     // Must be set before StatrtMission().
     //sODFVersion indicates  the ODF version
@@ -154,8 +149,6 @@ public:
 
                 // Get the security environment
     ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > GetSecurityEnvironment();
-    ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > GetSecurityEnvironmentByIndex(sal_Int32 nId);
-    sal_Int32 GetSecurityEnvironmentNumber();
 
                 // After signing/veryfieng, get information about signatures
     SignatureInformation  GetSignatureInformation( sal_Int32 nSecurityId ) const;
@@ -186,14 +179,10 @@ public:
     void SetX509Certificate(sal_Int32 nSecurityId, const rtl::OUString& ouX509IssuerName,
         const rtl::OUString& ouX509SerialNumber, const rtl::OUString& ouX509Cert);
 
-    void SetX509Certificate(sal_Int32 nSecurityId, sal_Int32 nSecurityEnvironmentIndex,
-        const rtl::OUString& ouX509IssuerName,  const rtl::OUString& ouX509SerialNumber,
-        const rtl::OUString& ouX509Cert);
     void        SetDateTime( sal_Int32 nSecurityId, const Date& rDate, const Time& rTime );
 
     void        AddForSigning( sal_Int32 securityId, const rtl::OUString& uri, const rtl::OUString& objectURL, sal_Bool bBinary );
     bool        CreateAndWriteSignature( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler );
-    bool        CreateAndWriteSignature( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xOutputStream );
     bool        ReadAndVerifySignature( const com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& xInputStream );
 
     // MT: ??? I think only for adding/removing, not for new signatures...
diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
index 203d3f2..c05ba8e 100644
--- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
@@ -91,16 +91,6 @@ void XMLSignatureHelper::ImplCreateSEInitializer()
         xMCF->createInstanceWithContext( sSEInitializer,  mxCtx ), uno::UNO_QUERY );
 }
 
-void XMLSignatureHelper::SetUriBinding( com::sun::star::uno::Reference< com::sun::star::xml::crypto::XUriBinding >& rxUriBinding )
-{
-    mxUriBinding = rxUriBinding;
-}
-
-com::sun::star::uno::Reference< com::sun::star::xml::crypto::XUriBinding > XMLSignatureHelper::GetUriBinding() const
-{
-    return mxUriBinding;
-}
-
 void XMLSignatureHelper::SetStorage(
     const Reference < css::embed::XStorage >& rxStorage,
     ::rtl::OUString sODFVersion)
@@ -149,21 +139,6 @@ void XMLSignatureHelper::SetX509Certificate(
         ouX509Cert);
 }
 
-void XMLSignatureHelper::SetX509Certificate(
-        sal_Int32 nSecurityId,
-        sal_Int32 nSecurityEnvironmentIndex,
-        const rtl::OUString& ouX509IssuerName,
-        const rtl::OUString& ouX509SerialNumber,
-        const rtl::OUString& ouX509Cert)
-{
-    mpXSecController->setX509Certificate(
-        nSecurityId,
-        nSecurityEnvironmentIndex,
-        ouX509IssuerName,
-        ouX509SerialNumber,
-        ouX509Cert);
-}
-
 void XMLSignatureHelper::SetDateTime( sal_Int32 nSecurityId, const Date& rDate, const Time& rTime )
 {
     ::com::sun::star::util::DateTime stDateTime;
@@ -272,18 +247,6 @@ bool XMLSignatureHelper::CreateAndWriteSignature( const uno::Reference< xml::sax
     return !mbError;
 }
 
-bool XMLSignatureHelper::CreateAndWriteSignature( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xOutputStream )
-{
-    uno::Reference<xml::sax::XDocumentHandler> xDocHandler
-        = CreateDocumentHandlerWithHeader(xOutputStream);
-
-    bool rc = CreateAndWriteSignature( xDocHandler );
-
-    CloseDocumentHandler(xDocHandler);
-
-    return rc;
-}
-
 bool XMLSignatureHelper::ReadAndVerifySignature( const com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& xInputStream )
 {
     mbError = false;
@@ -388,16 +351,6 @@ uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > XMLSignatu
     return (mxSecurityContext.is()?(mxSecurityContext->getSecurityEnvironment()): uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >());
 }
 
-uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > XMLSignatureHelper::GetSecurityEnvironmentByIndex(sal_Int32 nId)
-{
-    return (mxSecurityContext.is()?(mxSecurityContext->getSecurityEnvironmentByIndex(nId)): uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >());
-}
-
-sal_Int32 XMLSignatureHelper::GetSecurityEnvironmentNumber()
-{
-    return (mxSecurityContext.is()?(mxSecurityContext->getSecurityEnvironmentNumber()): 0);
-}
-
 IMPL_LINK( XMLSignatureHelper, SignatureCreationResultListener, XMLSignatureCreationResult*, pResult )
 {
     maCreationResults.insert( maCreationResults.begin() + maCreationResults.size(), *pResult );
-- 
1.7.8.3



More information about the LibreOffice mailing list