summaryrefslogtreecommitdiff
path: root/unoxml
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2011-02-14 14:24:07 +0100
committerMichael Stahl <mst@openoffice.org>2011-02-14 14:24:07 +0100
commit701e38bf43ed8efe3998b131160d988b5fd63812 (patch)
treee158e8cfc4c5cce44932e813b28634dd97fa7c0f /unoxml
parent2029cf2e42a1dcc8543bff8dac15de21c665ed6a (diff)
xmlfix3: CDocument::createCDATASection(): keep OString a little longer
Diffstat (limited to 'unoxml')
-rw-r--r--unoxml/source/dom/document.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx
index 26e3b2cfe2f6..f08ee36178ca 100644
--- a/unoxml/source/dom/document.cxx
+++ b/unoxml/source/dom/document.cxx
@@ -489,8 +489,11 @@ namespace DOM
{
::osl::MutexGuard const g(m_Mutex);
- xmlChar *xData = (xmlChar*)OUStringToOString(data, RTL_TEXTENCODING_UTF8).getStr();
- xmlNodePtr pText = xmlNewCDataBlock(m_aDocPtr, xData, strlen((char*)xData));
+ OString const oData(OUStringToOString(data, RTL_TEXTENCODING_UTF8));
+ xmlChar const*const pData =
+ reinterpret_cast<xmlChar const*>(oData.getStr());
+ xmlNodePtr const pText =
+ xmlNewCDataBlock(m_aDocPtr, pData, strlen(oData.getStr()));
Reference< XCDATASection > const xRet(
static_cast< XNode* >(GetCNode(pText).get()),
UNO_QUERY_THROW);