summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-07-26 17:08:18 +0200
committerJulien Nabet <serval2412@yahoo.fr>2017-07-26 18:53:16 +0200
commitb7654300f0f002193c4e91baabbe6b60a86ca84f (patch)
tree9aa276ef2ea48ab987478e4b3ff81deca143a405
parentd148340babf6c973f7d463909d7a51e16c953248 (diff)
tdf#109364: fix assert in LibXSLTTransformer.cxx
by replacing createFromAscii with OStringToOUString + RTL_TEXTENCODING_UTF8 Change-Id: I92ab20812968d13546132afb65c9b956a9c8be8e Reviewed-on: https://gerrit.libreoffice.org/40456 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r--filter/source/xsltfilter/LibXSLTTransformer.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/filter/source/xsltfilter/LibXSLTTransformer.cxx b/filter/source/xsltfilter/LibXSLTTransformer.cxx
index 5e1776246246..33719eb5e4c6 100644
--- a/filter/source/xsltfilter/LibXSLTTransformer.cxx
+++ b/filter/source/xsltfilter/LibXSLTTransformer.cxx
@@ -154,7 +154,8 @@ namespace XSLT
xmlXPathObjectPtr streamName = valuePop(ctxt);
streamName = ensureStringValue(streamName, ctxt);
- oh->insertByName(OUString::createFromAscii(reinterpret_cast<char*>(streamName->stringval)), OString(reinterpret_cast<char*>(value->stringval)));
+ oh->insertByName(OStringToOUString(reinterpret_cast<char*>(streamName->stringval), RTL_TEXTENCODING_UTF8),
+ OString(reinterpret_cast<char*>(value->stringval)));
valuePush(ctxt, xmlXPathNewCString(""));
}
@@ -195,7 +196,7 @@ namespace XSLT
OleHandler * oh = static_cast<OleHandler*> (data);
xmlXPathObjectPtr streamName = valuePop(ctxt);
streamName = ensureStringValue(streamName, ctxt);
- const OString content = oh->getByName(OUString::createFromAscii(reinterpret_cast<char*>(streamName->stringval)));
+ const OString content = oh->getByName(OStringToOUString(reinterpret_cast<char*>(streamName->stringval), RTL_TEXTENCODING_UTF8));
valuePush(ctxt, xmlXPathNewCString(content.getStr()));
xmlXPathFreeObject(streamName);
}
@@ -320,7 +321,7 @@ namespace XSLT
xmlErrorPtr lastErr = xmlGetLastError();
OUString msg;
if (lastErr)
- msg = OUString::createFromAscii(lastErr->message);
+ msg = OStringToOUString(lastErr->message, RTL_TEXTENCODING_UTF8);
else
msg = "Unknown XSLT transformation error";