summaryrefslogtreecommitdiff
path: root/unoxml/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-10-11 10:25:21 +0200
committerStephan Bergmann <sbergman@redhat.com>2013-10-11 10:25:32 +0200
commit54ec8a9a718281968291da2c4ffee11da07f30c2 (patch)
tree2ade5a727ccb930beeca6abf89de1409b2230091 /unoxml/source
parentac8c5ea6c4efec357a289a48fb129e29ceef19b2 (diff)
-Werror,-Wunused-variable
Change-Id: I7777008aac6331d7598f496c4808ab34c73f814e
Diffstat (limited to 'unoxml/source')
-rw-r--r--unoxml/source/dom/documentbuilder.cxx16
-rw-r--r--unoxml/source/xpath/xpathapi.cxx56
2 files changed, 30 insertions, 42 deletions
diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx
index 6cd4798a2608..eef5e387252c 100644
--- a/unoxml/source/dom/documentbuilder.cxx
+++ b/unoxml/source/dom/documentbuilder.cxx
@@ -278,19 +278,19 @@ namespace DOM
// default warning handler does not trigger assertion
static void warning_func(void * ctx, const char * /*msg*/, ...)
{
- OUStringBuffer buf("libxml2 warning\n");
- buf.append(make_error_message(static_cast< xmlParserCtxtPtr >(ctx)));
- OString msg = OUStringToOString(buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US);
- OSL_TRACE(msg.getStr());
+ SAL_INFO(
+ "unoxml",
+ "libxml2 warning: "
+ << make_error_message(static_cast<xmlParserCtxtPtr>(ctx)));
}
// default error handler triggers assertion
static void error_func(void * ctx, const char * /*msg*/, ...)
{
- OUStringBuffer buf("libxml2 error\n");
- buf.append(make_error_message(static_cast< xmlParserCtxtPtr >(ctx)));
- OString msg = OUStringToOString(buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US);
- OSL_FAIL(msg.getStr());
+ SAL_WARN(
+ "unoxml",
+ "libxml2 error: "
+ << make_error_message(static_cast<xmlParserCtxtPtr>(ctx)));
}
} // extern "C"
diff --git a/unoxml/source/xpath/xpathapi.cxx b/unoxml/source/xpath/xpathapi.cxx
index 69960a048452..65c58c0c6df3 100644
--- a/unoxml/source/xpath/xpathapi.cxx
+++ b/unoxml/source/xpath/xpathapi.cxx
@@ -260,20 +260,24 @@ namespace XPath
static OUString make_error_message(xmlErrorPtr pError)
{
OUStringBuffer buf;
- if (pError->message) {
- buf.appendAscii(pError->message);
- }
- int line = pError->line;
- if (line) {
- buf.appendAscii("Line: ");
- buf.append(static_cast<sal_Int32>(line));
- buf.appendAscii("\n");
- }
- int column = pError->int2;
- if (column) {
- buf.appendAscii("Column: ");
- buf.append(static_cast<sal_Int32>(column));
- buf.appendAscii("\n");
+ if (pError) {
+ if (pError->message) {
+ buf.appendAscii(pError->message);
+ }
+ int line = pError->line;
+ if (line) {
+ buf.appendAscii("Line: ");
+ buf.append(static_cast<sal_Int32>(line));
+ buf.appendAscii("\n");
+ }
+ int column = pError->int2;
+ if (column) {
+ buf.appendAscii("Column: ");
+ buf.append(static_cast<sal_Int32>(column));
+ buf.appendAscii("\n");
+ }
+ } else {
+ buf.appendAscii("no error argument!");
}
OUString msg = buf.makeStringAndClear();
return msg;
@@ -281,9 +285,8 @@ namespace XPath
extern "C" {
- static void generic_error_func(void *userData, const char *format, ...)
+ static void generic_error_func(void *, const char *format, ...)
{
- (void) userData;
char str[1000];
va_list args;
@@ -294,27 +297,12 @@ namespace XPath
vsnprintf(str, sizeof(str), format, args);
va_end(args);
- OUStringBuffer buf(
- "libxml2 error:\n");
- buf.appendAscii(str);
- OString msg = OUStringToOString(buf.makeStringAndClear(),
- RTL_TEXTENCODING_ASCII_US);
- OSL_FAIL(msg.getStr());
+ SAL_WARN("unoxml", "libxml2 error: " << str);
}
- static void structured_error_func(void * userData, xmlErrorPtr error)
+ static void structured_error_func(void *, xmlErrorPtr error)
{
- (void) userData;
- OUStringBuffer buf(
- "libxml2 error:\n");
- if (error) {
- buf.append(make_error_message(error));
- } else {
- buf.append("no error argument!");
- }
- OString msg = OUStringToOString(buf.makeStringAndClear(),
- RTL_TEXTENCODING_ASCII_US);
- OSL_FAIL(msg.getStr());
+ SAL_WARN("unoxml", "libxml2 error: " << make_error_message(error));
}
} // extern "C"