[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - xmlsecurity/source

Tor Lillqvist tml at collabora.com
Mon Dec 5 09:20:55 UTC 2016


 xmlsecurity/source/xmlsec/errorcallback.cxx |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

New commits:
commit 57fbe96477107e2646b946c11a1bc0327e00457e
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Nov 24 11:31:28 2016 +0200

    Show the message for the last Windows error also in our own error handler
    
    That is what the default libxmlsec error handler,
    xmlSecMSCryptoErrorsDefaultCallback(), does. Why show less information
    in our own handler?
    
    Also, bin a copy-pasted comment that is meaningless here and a useless 'using'.
    
    Change-Id: Ibc9f9b5066536d0f5cabbf2bda6d1fa14eca5613
    Reviewed-on: https://gerrit.libreoffice.org/31159
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/xmlsecurity/source/xmlsec/errorcallback.cxx b/xmlsecurity/source/xmlsec/errorcallback.cxx
index d1b25b6..dc817db 100644
--- a/xmlsecurity/source/xmlsec/errorcallback.cxx
+++ b/xmlsecurity/source/xmlsec/errorcallback.cxx
@@ -17,16 +17,15 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
-/*
- * Implementation of the I/O interfaces based on stream and URI binding
- */
 #include "errorcallback.hxx"
 
 #include "xmlsec-wrapper.h"
 
-using namespace ::com::sun::star::xml::crypto;
-
+#ifdef _WIN32
+#include <prewin.h>
+#include <postwin.h>
+#include "comphelper/windowserrorstring.hxx"
+#endif
 
 extern "C"
 void errorCallback(const char* file,
@@ -40,7 +39,13 @@ void errorCallback(const char* file,
     const char* pErrorObject = errorObject ? errorObject : "";
     const char* pErrorSubject = errorSubject ? errorSubject : "";
     const char* pMsg = msg ? msg : "";
-    SAL_WARN("xmlsecurity.xmlsec", file << ":" << line << ": " << func << "() '" << pErrorObject << "' '" << pErrorSubject << "' " << reason << " '" << pMsg << "'");
+    OUString systemErrorString;
+
+#ifdef _WIN32
+    systemErrorString = " " + WindowsErrorString(GetLastError());
+#endif
+
+    SAL_WARN("xmlsecurity.xmlsec", file << ":" << line << ": " << func << "() '" << pErrorObject << "' '" << pErrorSubject << "' " << reason << " '" << pMsg << "'" << systemErrorString);
 }
 
 void setErrorRecorder()


More information about the Libreoffice-commits mailing list