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

Tor Lillqvist tml at collabora.com
Thu Nov 3 12:18:33 UTC 2016


 xmlsecurity/source/helper/xsecctl.cxx  |    2 --
 xmlsecurity/source/helper/xsecctl.hxx  |   13 -------------
 xmlsecurity/source/helper/xsecsign.cxx |   24 ------------------------
 3 files changed, 39 deletions(-)

New commits:
commit 954f721ad59e52f039154cb01490e068cc0f0ce5
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Nov 3 14:11:29 2016 +0200

    Bin the XSecController::m_pErrorMessage field as it was never used
    
    It was only assigned to. Some follow-up simplification.
    
    Change-Id: I3b522064e946667d3a4c8fb82ee40bd0d44dd569

diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx
index 92a26c4..d4467a9 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -63,7 +63,6 @@ XSecController::XSecController( const cssu::Reference<cssu::XComponentContext>&
     , m_bIsBlocking(false)
     , m_eStatusOfSecurityComponents(InitializationState::UNINITIALIZED)
     , m_bIsSAXEventKeeperSticky(false)
-    , m_pErrorMessage(nullptr)
     , m_nReservedSignatureId(0)
     , m_bVerifyCurrentSignature(false)
 {
@@ -457,7 +456,6 @@ void XSecController::startMission(
 
     m_eStatusOfSecurityComponents = InitializationState::UNINITIALIZED;
     m_xSecurityContext = xSecurityContext;
-    m_pErrorMessage = nullptr;
 
     m_vInternalSignatureInformations.clear();
 
diff --git a/xmlsecurity/source/helper/xsecctl.hxx b/xmlsecurity/source/helper/xsecctl.hxx
index 86dbec0..a2dc326 100644
--- a/xmlsecurity/source/helper/xsecctl.hxx
+++ b/xmlsecurity/source/helper/xsecctl.hxx
@@ -47,14 +47,6 @@
 
 #include <vector>
 
-/*
- * all error information
- */
-#define ERROR_CANNOTCREATEXMLSECURITYCOMPONENT    "Can't create XML security components."
-#define ERROR_SAXEXCEPTIONDURINGCREATION          "A SAX exception is throwed during signature creation."
-#define ERROR_IOEXCEPTIONDURINGCREATION           "An IO exception is throwed during signature creation."
-#define ERROR_EXCEPTIONDURINGCREATION             "An exception is throwed during signature creation."
-
 #define NS_XMLDSIG "http://www.w3.org/2000/09/xmldsig#"
 #define NS_DC      "http://purl.org/dc/elements/1.1/"
 #define NS_XD      "http://uri.etsi.org/01903/v1.3.2#"
@@ -248,11 +240,6 @@ private:
     bool m_bIsSAXEventKeeperSticky;
 
     /*
-      * error message pointer
-      */
-    const char *m_pErrorMessage;
-
-    /*
      * the XSecParser which is used to parse the signature stream
      */
     css::uno::Reference<css::xml::sax::XDocumentHandler> m_xSecParser;
diff --git a/xmlsecurity/source/helper/xsecsign.cxx b/xmlsecurity/source/helper/xsecsign.cxx
index 4a5fb3d..5b27c13 100644
--- a/xmlsecurity/source/helper/xsecsign.cxx
+++ b/xmlsecurity/source/helper/xsecsign.cxx
@@ -350,26 +350,13 @@ bool XSecController::WriteSignature(
 
             rc = true;
         }
-        catch( cssxs::SAXException& )
-        {
-            m_pErrorMessage = ERROR_SAXEXCEPTIONDURINGCREATION;
-        }
-        catch( css::io::IOException& )
-        {
-            m_pErrorMessage = ERROR_IOEXCEPTIONDURINGCREATION;
-        }
         catch( cssu::Exception& )
         {
-            m_pErrorMessage = ERROR_EXCEPTIONDURINGCREATION;
         }
 
         m_xSAXEventKeeper->setNextHandler( nullptr );
         m_bIsSAXEventKeeperSticky = false;
     }
-    else
-    {
-        m_pErrorMessage = ERROR_CANNOTCREATEXMLSECURITYCOMPONENT;
-    }
 
     return rc;
 }
@@ -406,24 +393,13 @@ bool XSecController::WriteOOXMLSignature(const uno::Reference<embed::XStorage>&
 
             bRet = true;
         }
-        catch (const xml::sax::SAXException&)
-        {
-            m_pErrorMessage = ERROR_SAXEXCEPTIONDURINGCREATION;
-        }
-        catch(const io::IOException&)
-        {
-            m_pErrorMessage = ERROR_IOEXCEPTIONDURINGCREATION;
-        }
         catch(const uno::Exception&)
         {
-            m_pErrorMessage = ERROR_EXCEPTIONDURINGCREATION;
         }
 
         m_xSAXEventKeeper->setNextHandler(nullptr);
         m_bIsSAXEventKeeperSticky = false;
     }
-    else
-        m_pErrorMessage = ERROR_CANNOTCREATEXMLSECURITYCOMPONENT;
 
     return bRet;
 }


More information about the Libreoffice-commits mailing list