diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-10-11 10:25:21 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-11 10:25:32 +0200 |
commit | 54ec8a9a718281968291da2c4ffee11da07f30c2 (patch) | |
tree | 2ade5a727ccb930beeca6abf89de1409b2230091 | |
parent | ac8c5ea6c4efec357a289a48fb129e29ceef19b2 (diff) |
-Werror,-Wunused-variable
Change-Id: I7777008aac6331d7598f496c4808ab34c73f814e
-rw-r--r-- | include/sal/log-areas.dox | 1 | ||||
-rw-r--r-- | unoxml/source/dom/documentbuilder.cxx | 16 | ||||
-rw-r--r-- | unoxml/source/xpath/xpathapi.cxx | 56 |
3 files changed, 31 insertions, 42 deletions
diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox index 56472e0ecd2d..b4ddc0303fc2 100644 --- a/include/sal/log-areas.dox +++ b/include/sal/log-areas.dox @@ -428,6 +428,7 @@ certain functionality. @li @c svg @li @c ucbhelper @li @c unoidl +@li @c unoxml @li @c uui @li @c vbahelper @li @c xmlhelp 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" |