summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2014-01-16 08:25:42 +0100
committerDavid Tardon <dtardon@redhat.com>2014-01-16 07:41:05 +0000
commit0501b81caf787ace5d2c8da65329d9f6adbace4e (patch)
treeb3c3283e7961c3ec1abf1130834754763b2677cd
parentd72321b665f54946cf603e6f30740f31151c898f (diff)
libodfgen produces strings in utf8 encoding
Change-Id: Iad17f4b4786473205669bd5b080b0a64d4a6a441 Reviewed-on: https://gerrit.libreoffice.org/7455 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com> (cherry picked from commit 9e5e7c9b556bf9386fb5ad3ecd28b3d43aeeb393) Reviewed-on: https://gerrit.libreoffice.org/7456
-rw-r--r--writerperfect/source/common/DocumentHandler.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/writerperfect/source/common/DocumentHandler.cxx b/writerperfect/source/common/DocumentHandler.cxx
index 4fd98da571f5..073b9429571b 100644
--- a/writerperfect/source/common/DocumentHandler.cxx
+++ b/writerperfect/source/common/DocumentHandler.cxx
@@ -41,17 +41,20 @@ void DocumentHandler::startElement(const char *psName, const WPXPropertyList &xP
// filter out libwpd elements
if (strncmp(i.key(), "libwpd", 6) != 0)
{
- pAttrList->AddAttribute(OUString::createFromAscii(i.key()),
- OUString::createFromAscii(i()->getStr().cstr()));
+ OUString sName(i.key(), strlen(i.key()), RTL_TEXTENCODING_UTF8);
+ OUString sValue(i()->getStr().cstr(), strlen(i()->getStr().cstr()), RTL_TEXTENCODING_UTF8);
+ pAttrList->AddAttribute(sName, sValue);
}
}
- mxHandler->startElement(OUString::createFromAscii(psName), xAttrList);
+ OUString sElementName(psName, strlen(psName), RTL_TEXTENCODING_UTF8);
+ mxHandler->startElement(sElementName, xAttrList);
}
void DocumentHandler::endElement(const char *psName)
{
- mxHandler->endElement(OUString::createFromAscii(psName));
+ OUString sElementName(psName, strlen(psName), RTL_TEXTENCODING_UTF8);
+ mxHandler->endElement(sElementName);
}
void DocumentHandler::characters(const WPXString &sCharacters)