Some more loplugin:cstylecast: unoxml
Change-Id: I7467e033c998d9ee4283a146088c3b09d161f3cd
This commit is contained in:
@@ -105,8 +105,8 @@ namespace DOM
|
||||
if ((0 == m_aNodePtr) || (0 == m_aAttrPtr)) {
|
||||
return OUString();
|
||||
}
|
||||
OUString const aName((char*)m_aAttrPtr->name,
|
||||
strlen((char*)m_aAttrPtr->name), RTL_TEXTENCODING_UTF8);
|
||||
OUString const aName(reinterpret_cast<char const *>(m_aAttrPtr->name),
|
||||
strlen(reinterpret_cast<char const *>(m_aAttrPtr->name)), RTL_TEXTENCODING_UTF8);
|
||||
return aName;
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace DOM
|
||||
OUString sOldValue = getValue();
|
||||
|
||||
OString o1 = OUStringToOString(value, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar* xValue = (xmlChar*)o1.getStr();
|
||||
xmlChar const * xValue = reinterpret_cast<xmlChar const *>(o1.getStr());
|
||||
// this does not work if the attribute was created anew
|
||||
// xmlNodePtr pNode = m_aAttrPtr->parent;
|
||||
// xmlSetProp(pNode, m_aAttrPtr->name, xValue);
|
||||
|
@@ -70,11 +70,11 @@ namespace DOM
|
||||
if (pNode != NULL)
|
||||
{
|
||||
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar* xName = (xmlChar*)o1.getStr();
|
||||
xmlChar const * xName = reinterpret_cast<xmlChar const *>(o1.getStr());
|
||||
xmlAttrPtr cur = pNode->properties;
|
||||
while (cur != NULL)
|
||||
{
|
||||
if( strcmp((char*)xName, (char*)cur->name) == 0)
|
||||
if( strcmp(reinterpret_cast<char const *>(xName), reinterpret_cast<char const *>(cur->name)) == 0)
|
||||
{
|
||||
aNode = Reference< XNode >(
|
||||
m_pElement->GetOwnerDocument().GetCNode(
|
||||
@@ -102,7 +102,7 @@ namespace DOM
|
||||
if (pNode != NULL)
|
||||
{
|
||||
OString o1 = OUStringToOString(localName, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar* xName = (xmlChar*)o1.getStr();
|
||||
xmlChar const * xName = reinterpret_cast<xmlChar const *>(o1.getStr());
|
||||
OString o2 = OUStringToOString(namespaceURI, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar const*const xNs =
|
||||
reinterpret_cast<xmlChar const*>(o2.getStr());
|
||||
@@ -110,7 +110,7 @@ namespace DOM
|
||||
xmlAttrPtr cur = pNode->properties;
|
||||
while (cur != NULL && pNs != NULL)
|
||||
{
|
||||
if( strcmp((char*)xName, (char*)cur->name) == 0 &&
|
||||
if( strcmp(reinterpret_cast<char const *>(xName), reinterpret_cast<char const *>(cur->name)) == 0 &&
|
||||
cur->ns == pNs)
|
||||
{
|
||||
aNode = Reference< XNode >(
|
||||
|
@@ -67,9 +67,9 @@ namespace DOM
|
||||
|
||||
if (m_aNodePtr != NULL)
|
||||
{
|
||||
OUString oldValue((char*)m_aNodePtr->content, strlen((char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
|
||||
xmlNodeAddContent(m_aNodePtr, (const xmlChar*)(OUStringToOString(arg, RTL_TEXTENCODING_UTF8).getStr()));
|
||||
OUString newValue((char*)m_aNodePtr->content, strlen((char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
|
||||
OUString oldValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
|
||||
xmlNodeAddContent(m_aNodePtr, reinterpret_cast<const xmlChar*>(OUStringToOString(arg, RTL_TEXTENCODING_UTF8).getStr()));
|
||||
OUString newValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
|
||||
|
||||
guard.clear(); // release mutex before calling event handlers
|
||||
dispatchEvent_Impl(oldValue, newValue);
|
||||
@@ -101,9 +101,9 @@ namespace DOM
|
||||
|
||||
OUString tmp2 = tmp.copy(0, offset);
|
||||
tmp2 += tmp.copy(offset+count, tmp.getLength() - (offset+count));
|
||||
OUString oldValue((char*)m_aNodePtr->content, strlen((char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
|
||||
xmlNodeSetContent(m_aNodePtr, (const xmlChar*)(OUStringToOString(tmp2, RTL_TEXTENCODING_UTF8).getStr()));
|
||||
OUString newValue((char*)m_aNodePtr->content, strlen((char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
|
||||
OUString oldValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
|
||||
xmlNodeSetContent(m_aNodePtr, reinterpret_cast<const xmlChar*>(OUStringToOString(tmp2, RTL_TEXTENCODING_UTF8).getStr()));
|
||||
OUString newValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
|
||||
|
||||
guard.clear(); // release mutex before calling event handlers
|
||||
dispatchEvent_Impl(oldValue, newValue);
|
||||
@@ -124,7 +124,7 @@ namespace DOM
|
||||
OSL_ENSURE(m_aNodePtr->content, "character data node with NULL content, please inform lars.oppermann@sun.com!");
|
||||
if (m_aNodePtr->content != NULL)
|
||||
{
|
||||
aData = OUString((const sal_Char*)m_aNodePtr->content, strlen((const sal_Char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
|
||||
aData = OUString(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
|
||||
}
|
||||
}
|
||||
return aData;
|
||||
@@ -141,7 +141,7 @@ namespace DOM
|
||||
sal_Int32 length = 0;
|
||||
if (m_aNodePtr != NULL)
|
||||
{
|
||||
OUString aData((const sal_Char*)m_aNodePtr->content, strlen((const sal_Char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
|
||||
OUString aData(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
|
||||
length = aData.getLength();
|
||||
}
|
||||
return length;
|
||||
@@ -171,9 +171,9 @@ namespace DOM
|
||||
OUString tmp2 = tmp.copy(0, offset);
|
||||
tmp2 += arg;
|
||||
tmp2 += tmp.copy(offset, tmp.getLength() - offset);
|
||||
OUString oldValue((char*)m_aNodePtr->content, strlen((char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
|
||||
xmlNodeSetContent(m_aNodePtr, (const xmlChar*)(OUStringToOString(tmp2, RTL_TEXTENCODING_UTF8).getStr()));
|
||||
OUString newValue((char*)m_aNodePtr->content, strlen((char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
|
||||
OUString oldValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
|
||||
xmlNodeSetContent(m_aNodePtr, reinterpret_cast<const xmlChar*>(OUStringToOString(tmp2, RTL_TEXTENCODING_UTF8).getStr()));
|
||||
OUString newValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
|
||||
|
||||
guard.clear(); // release mutex before calling event handlers
|
||||
dispatchEvent_Impl(oldValue, newValue);
|
||||
@@ -208,9 +208,9 @@ namespace DOM
|
||||
OUString tmp2 = tmp.copy(0, offset);
|
||||
tmp2 += arg;
|
||||
tmp2 += tmp.copy(offset+count, tmp.getLength() - (offset+count));
|
||||
OUString oldValue((char*)m_aNodePtr->content, strlen((char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
|
||||
xmlNodeSetContent(m_aNodePtr, (const xmlChar*)(OUStringToOString(tmp2, RTL_TEXTENCODING_UTF8).getStr()));
|
||||
OUString newValue((char*)m_aNodePtr->content, strlen((char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
|
||||
OUString oldValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
|
||||
xmlNodeSetContent(m_aNodePtr, reinterpret_cast<const xmlChar*>(OUStringToOString(tmp2, RTL_TEXTENCODING_UTF8).getStr()));
|
||||
OUString newValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
|
||||
|
||||
guard.clear(); // release mutex before calling event handlers
|
||||
dispatchEvent_Impl(oldValue, newValue);
|
||||
@@ -227,9 +227,9 @@ namespace DOM
|
||||
|
||||
if (m_aNodePtr != NULL)
|
||||
{
|
||||
OUString oldValue((char*)m_aNodePtr->content, strlen((char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
|
||||
xmlNodeSetContent(m_aNodePtr, (const xmlChar*)(OUStringToOString(data, RTL_TEXTENCODING_UTF8).getStr()));
|
||||
OUString newValue((char*)m_aNodePtr->content, strlen((char*)m_aNodePtr->content), RTL_TEXTENCODING_UTF8);
|
||||
OUString oldValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
|
||||
xmlNodeSetContent(m_aNodePtr, reinterpret_cast<const xmlChar*>(OUStringToOString(data, RTL_TEXTENCODING_UTF8).getStr()));
|
||||
OUString newValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
|
||||
|
||||
guard.clear(); // release mutex before calling event handlers
|
||||
dispatchEvent_Impl(oldValue, newValue);
|
||||
|
@@ -438,7 +438,7 @@ namespace DOM
|
||||
::osl::MutexGuard const g(m_Mutex);
|
||||
|
||||
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar *xName = (xmlChar*)o1.getStr();
|
||||
xmlChar const *xName = reinterpret_cast<xmlChar const *>(o1.getStr());
|
||||
xmlAttrPtr const pAttr = xmlNewDocProp(m_aDocPtr, xName, NULL);
|
||||
::rtl::Reference< CAttr > const pCAttr(
|
||||
dynamic_cast< CAttr* >(GetCNode(
|
||||
@@ -509,7 +509,7 @@ namespace DOM
|
||||
::osl::MutexGuard const g(m_Mutex);
|
||||
|
||||
OString o1 = OUStringToOString(data, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar *xData = (xmlChar*)o1.getStr();
|
||||
xmlChar const *xData = reinterpret_cast<xmlChar const *>(o1.getStr());
|
||||
xmlNodePtr pComment = xmlNewDocComment(m_aDocPtr, xData);
|
||||
Reference< XComment > const xRet(
|
||||
static_cast< XNode* >(GetCNode(pComment).get()),
|
||||
@@ -537,7 +537,7 @@ namespace DOM
|
||||
::osl::MutexGuard const g(m_Mutex);
|
||||
|
||||
OString o1 = OUStringToOString(tagName, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar *xName = (xmlChar*)o1.getStr();
|
||||
xmlChar const *xName = reinterpret_cast<xmlChar const *>(o1.getStr());
|
||||
xmlNodePtr const pNode = xmlNewDocNode(m_aDocPtr, NULL, xName, NULL);
|
||||
Reference< XElement > const xRet(
|
||||
static_cast< XNode* >(GetCNode(pNode).get()),
|
||||
@@ -554,22 +554,22 @@ namespace DOM
|
||||
|
||||
sal_Int32 i = qname.indexOf(':');
|
||||
if (ns.isEmpty()) throw RuntimeException();
|
||||
xmlChar *xPrefix;
|
||||
xmlChar *xName;
|
||||
xmlChar const *xPrefix;
|
||||
xmlChar const *xName;
|
||||
OString o1, o2, o3;
|
||||
if ( i != -1) {
|
||||
o1 = OUStringToOString(qname.copy(0, i), RTL_TEXTENCODING_UTF8);
|
||||
xPrefix = (xmlChar*)o1.getStr();
|
||||
xPrefix = reinterpret_cast<xmlChar const *>(o1.getStr());
|
||||
o2 = OUStringToOString(qname.copy(i+1, qname.getLength()-i-1), RTL_TEXTENCODING_UTF8);
|
||||
xName = (xmlChar*)o2.getStr();
|
||||
xName = reinterpret_cast<xmlChar const *>(o2.getStr());
|
||||
} else {
|
||||
// default prefix
|
||||
xPrefix = (xmlChar*)"";
|
||||
xPrefix = reinterpret_cast<xmlChar const *>("");
|
||||
o2 = OUStringToOString(qname, RTL_TEXTENCODING_UTF8);
|
||||
xName = (xmlChar*)o2.getStr();
|
||||
xName = reinterpret_cast<xmlChar const *>(o2.getStr());
|
||||
}
|
||||
o3 = OUStringToOString(ns, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar *xUri = (xmlChar*)o3.getStr();
|
||||
xmlChar const *xUri = reinterpret_cast<xmlChar const *>(o3.getStr());
|
||||
|
||||
// xmlNsPtr aNsPtr = xmlNewReconciledNs?
|
||||
// xmlNsPtr aNsPtr = xmlNewGlobalNs?
|
||||
@@ -589,7 +589,7 @@ namespace DOM
|
||||
::osl::MutexGuard const g(m_Mutex);
|
||||
|
||||
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar *xName = (xmlChar*)o1.getStr();
|
||||
xmlChar const *xName = reinterpret_cast<xmlChar const *>(o1.getStr());
|
||||
xmlNodePtr const pNode = xmlNewReference(m_aDocPtr, xName);
|
||||
Reference< XEntityReference > const xRet(
|
||||
static_cast< XNode* >(GetCNode(pNode).get()),
|
||||
@@ -606,9 +606,9 @@ namespace DOM
|
||||
::osl::MutexGuard const g(m_Mutex);
|
||||
|
||||
OString o1 = OUStringToOString(target, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar *xTarget = (xmlChar*)o1.getStr();
|
||||
xmlChar const *xTarget = reinterpret_cast<xmlChar const *>(o1.getStr());
|
||||
OString o2 = OUStringToOString(data, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar *xData = (xmlChar*)o2.getStr();
|
||||
xmlChar const *xData = reinterpret_cast<xmlChar const *>(o2.getStr());
|
||||
xmlNodePtr const pNode = xmlNewDocPI(m_aDocPtr, xTarget, xData);
|
||||
pNode->doc = m_aDocPtr;
|
||||
Reference< XProcessingInstruction > const xRet(
|
||||
@@ -624,7 +624,7 @@ namespace DOM
|
||||
::osl::MutexGuard const g(m_Mutex);
|
||||
|
||||
OString o1 = OUStringToOString(data, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar *xData = (xmlChar*)o1.getStr();
|
||||
xmlChar const *xData = reinterpret_cast<xmlChar const *>(o1.getStr());
|
||||
xmlNodePtr const pNode = xmlNewDocText(m_aDocPtr, xData);
|
||||
Reference< XText > const xRet(
|
||||
static_cast< XNode* >(GetCNode(pNode).get()),
|
||||
@@ -673,7 +673,7 @@ namespace DOM
|
||||
while (a != NULL)
|
||||
{
|
||||
if (a->atype == XML_ATTRIBUTE_ID) {
|
||||
if (strcmp((char*)a->children->content, (char*)id) == 0)
|
||||
if (strcmp(reinterpret_cast<char*>(a->children->content), reinterpret_cast<char const *>(id)) == 0)
|
||||
return cur;
|
||||
}
|
||||
a = a->next;
|
||||
@@ -696,7 +696,7 @@ namespace DOM
|
||||
|
||||
// search the tree for an element with the given ID
|
||||
OString o1 = OUStringToOString(elementId, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar *xId = (xmlChar*)o1.getStr();
|
||||
xmlChar const *xId = reinterpret_cast<xmlChar const *>(o1.getStr());
|
||||
xmlNodePtr const pStart = lcl_getDocumentRootPtr(m_aDocPtr);
|
||||
if (!pStart) { return 0; }
|
||||
xmlNodePtr const pNode = lcl_search_element_by_id(pStart, xId);
|
||||
|
@@ -166,7 +166,7 @@ namespace DOM
|
||||
::osl::MutexGuard const g(m_Mutex);
|
||||
|
||||
// create a new document
|
||||
xmlDocPtr pDocument = xmlNewDoc((const xmlChar*)"1.0");
|
||||
xmlDocPtr pDocument = xmlNewDoc(reinterpret_cast<const xmlChar*>("1.0"));
|
||||
Reference< XDocument > const xRet(
|
||||
CDocument::CreateCDocument(pDocument).get());
|
||||
return xRet;
|
||||
@@ -247,10 +247,10 @@ namespace DOM
|
||||
Reference< XEntityResolver > resolver = builder->getEntityResolver();
|
||||
OUString sysid;
|
||||
if (systemId != 0)
|
||||
sysid = OUString((sal_Char*)systemId, strlen((char*)systemId), RTL_TEXTENCODING_UTF8);
|
||||
sysid = OUString(reinterpret_cast<char const *>(systemId), strlen(reinterpret_cast<char const *>(systemId)), RTL_TEXTENCODING_UTF8);
|
||||
OUString pubid;
|
||||
if (publicId != 0)
|
||||
pubid = OUString((sal_Char*)publicId, strlen((char*)publicId), RTL_TEXTENCODING_UTF8);
|
||||
pubid = OUString(reinterpret_cast<char const *>(publicId), strlen(reinterpret_cast<char const *>(publicId)), RTL_TEXTENCODING_UTF8);
|
||||
|
||||
// resolve the entity
|
||||
InputSource src = resolver->resolveEntity(pubid, sysid);
|
||||
|
@@ -78,7 +78,7 @@ namespace DOM
|
||||
OUString aName;
|
||||
if (m_aDtdPtr != NULL)
|
||||
{
|
||||
aName = OUString((sal_Char*)m_aDtdPtr->name, strlen((char*)m_aDtdPtr->name), RTL_TEXTENCODING_UTF8);
|
||||
aName = OUString(reinterpret_cast<char const *>(m_aDtdPtr->name), strlen(reinterpret_cast<char const *>(m_aDtdPtr->name)), RTL_TEXTENCODING_UTF8);
|
||||
}
|
||||
return aName;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ namespace DOM
|
||||
OUString aId;
|
||||
if (m_aDtdPtr != NULL)
|
||||
{
|
||||
aId = OUString((sal_Char*)m_aDtdPtr->name, strlen((char*)m_aDtdPtr->ExternalID), RTL_TEXTENCODING_UTF8);
|
||||
aId = OUString(reinterpret_cast<char const *>(m_aDtdPtr->name), strlen(reinterpret_cast<char const *>(m_aDtdPtr->ExternalID)), RTL_TEXTENCODING_UTF8);
|
||||
}
|
||||
return aId;
|
||||
}
|
||||
@@ -123,7 +123,7 @@ namespace DOM
|
||||
OUString aId;
|
||||
if (m_aDtdPtr != NULL)
|
||||
{
|
||||
aId = OUString((sal_Char*)m_aDtdPtr->name, strlen((char*)m_aDtdPtr->SystemID), RTL_TEXTENCODING_UTF8);
|
||||
aId = OUString(reinterpret_cast<char const *>(m_aDtdPtr->name), strlen(reinterpret_cast<char const *>(m_aDtdPtr->SystemID)), RTL_TEXTENCODING_UTF8);
|
||||
}
|
||||
return aId;
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ namespace DOM
|
||||
OUString type = "";
|
||||
// add namespace definitions to attributes
|
||||
for (xmlNsPtr pNs = m_aNodePtr->nsDef; pNs != 0; pNs = pNs->next) {
|
||||
const xmlChar *pPrefix = pNs->prefix ? pNs->prefix : (const xmlChar*)"";
|
||||
const xmlChar *pPrefix = pNs->prefix ? pNs->prefix : reinterpret_cast<const xmlChar*>("");
|
||||
OUString prefix(reinterpret_cast<const sal_Char*>(pPrefix),
|
||||
strlen(reinterpret_cast<const char*>(pPrefix)),
|
||||
RTL_TEXTENCODING_UTF8);
|
||||
@@ -119,12 +119,12 @@ namespace DOM
|
||||
const xmlChar* xName = pAttr->name;
|
||||
sal_Int32 nAttributeToken=FastToken::DONTKNOW;
|
||||
|
||||
if( pAttr->ns && strlen((char*)pAttr->ns->prefix) )
|
||||
if( pAttr->ns && strlen(reinterpret_cast<char const *>(pAttr->ns->prefix)) )
|
||||
nAttributeToken = getTokenWithPrefix( i_rContext,
|
||||
(sal_Char*)pAttr->ns->prefix,
|
||||
(sal_Char*)xName );
|
||||
reinterpret_cast<char const *>(pAttr->ns->prefix),
|
||||
reinterpret_cast<char const *>(xName) );
|
||||
else
|
||||
nAttributeToken = getToken( i_rContext, (sal_Char*)xName );
|
||||
nAttributeToken = getToken( i_rContext, reinterpret_cast<char const *>(xName) );
|
||||
|
||||
if( nAttributeToken != FastToken::DONTKNOW )
|
||||
i_rContext.mxAttribList->add( nAttributeToken,
|
||||
@@ -132,13 +132,13 @@ namespace DOM
|
||||
RTL_TEXTENCODING_UTF8));
|
||||
}
|
||||
|
||||
const xmlChar* xPrefix = m_aNodePtr->ns ? m_aNodePtr->ns->prefix : (const xmlChar*)"";
|
||||
const xmlChar* xPrefix = m_aNodePtr->ns ? m_aNodePtr->ns->prefix : reinterpret_cast<const xmlChar*>("");
|
||||
const xmlChar* xName = m_aNodePtr->name;
|
||||
sal_Int32 nElementToken=FastToken::DONTKNOW;
|
||||
if( strlen((char*)xPrefix) )
|
||||
nElementToken = getTokenWithPrefix( i_rContext, (sal_Char*)xPrefix, (sal_Char*)xName );
|
||||
if( strlen(reinterpret_cast<char const *>(xPrefix)) )
|
||||
nElementToken = getTokenWithPrefix( i_rContext, reinterpret_cast<char const *>(xPrefix), reinterpret_cast<char const *>(xName) );
|
||||
else
|
||||
nElementToken = getToken( i_rContext, (sal_Char*)xName );
|
||||
nElementToken = getToken( i_rContext, reinterpret_cast<char const *>(xName) );
|
||||
|
||||
Reference<XFastContextHandler> xParentHandler(i_rContext.mxCurrentHandler);
|
||||
try
|
||||
@@ -147,8 +147,8 @@ namespace DOM
|
||||
if( nElementToken == FastToken::DONTKNOW )
|
||||
{
|
||||
const OUString aNamespace;
|
||||
const OUString aElementName( (sal_Char*)xPrefix,
|
||||
strlen((char*)xPrefix),
|
||||
const OUString aElementName( reinterpret_cast<char const *>(xPrefix),
|
||||
strlen(reinterpret_cast<char const *>(xPrefix)),
|
||||
RTL_TEXTENCODING_UTF8 );
|
||||
|
||||
if( xParentHandler.is() )
|
||||
@@ -189,8 +189,8 @@ namespace DOM
|
||||
else
|
||||
{
|
||||
const OUString aNamespace;
|
||||
const OUString aElementName( (sal_Char*)xPrefix,
|
||||
strlen((char*)xPrefix),
|
||||
const OUString aElementName( reinterpret_cast<char const *>(xPrefix),
|
||||
strlen(reinterpret_cast<char const *>(xPrefix)),
|
||||
RTL_TEXTENCODING_UTF8 );
|
||||
|
||||
i_rContext.mxCurrentHandler->endUnknownElement( aNamespace, aElementName );
|
||||
@@ -241,7 +241,7 @@ namespace DOM
|
||||
// search properties
|
||||
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
|
||||
::boost::shared_ptr<xmlChar const> const pValue(
|
||||
xmlGetProp(m_aNodePtr, (xmlChar*)o1.getStr()), xmlFree);
|
||||
xmlGetProp(m_aNodePtr, reinterpret_cast<xmlChar const *>(o1.getStr())), xmlFree);
|
||||
OUString const ret( (pValue)
|
||||
? OUString(reinterpret_cast<sal_Char const*>(pValue.get()),
|
||||
strlen(reinterpret_cast<char const*>(pValue.get())),
|
||||
@@ -379,8 +379,8 @@ namespace DOM
|
||||
if (0 == m_aNodePtr) {
|
||||
return OUString();
|
||||
}
|
||||
OUString const ret((sal_Char*)m_aNodePtr->name,
|
||||
strlen((char*)m_aNodePtr->name), RTL_TEXTENCODING_UTF8);
|
||||
OUString const ret(reinterpret_cast<char const *>(m_aNodePtr->name),
|
||||
strlen(reinterpret_cast<char const *>(m_aNodePtr->name)), RTL_TEXTENCODING_UTF8);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -395,7 +395,7 @@ namespace DOM
|
||||
::osl::MutexGuard const g(m_rMutex);
|
||||
|
||||
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar *xName = (xmlChar*)o1.getStr();
|
||||
xmlChar const *xName = reinterpret_cast<xmlChar const *>(o1.getStr());
|
||||
return (m_aNodePtr != NULL && xmlHasProp(m_aNodePtr, xName) != NULL);
|
||||
}
|
||||
|
||||
@@ -410,9 +410,9 @@ namespace DOM
|
||||
::osl::MutexGuard const g(m_rMutex);
|
||||
|
||||
OString o1 = OUStringToOString(localName, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar *xName = (xmlChar*)o1.getStr();
|
||||
xmlChar const *xName = reinterpret_cast<xmlChar const *>(o1.getStr());
|
||||
OString o2 = OUStringToOString(namespaceURI, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar *xNs = (xmlChar*)o2.getStr();
|
||||
xmlChar const *xNs = reinterpret_cast<xmlChar const *>(o2.getStr());
|
||||
return (m_aNodePtr != NULL && xmlHasNsProp(m_aNodePtr, xName, xNs) != NULL);
|
||||
}
|
||||
|
||||
@@ -488,7 +488,7 @@ namespace DOM
|
||||
if (!pCNode.is()) { throw RuntimeException(); }
|
||||
|
||||
xmlNodePtr const pNode = pCNode->GetNodePtr();
|
||||
xmlAttrPtr const pAttr = (xmlAttrPtr) pNode;
|
||||
xmlAttrPtr const pAttr = reinterpret_cast<xmlAttrPtr>(pNode);
|
||||
if (!pAttr) { throw RuntimeException(); }
|
||||
|
||||
if (pAttr->parent != m_aNodePtr)
|
||||
@@ -619,9 +619,9 @@ namespace DOM
|
||||
::osl::ClearableMutexGuard guard(m_rMutex);
|
||||
|
||||
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar *xName = (xmlChar*)o1.getStr();
|
||||
xmlChar const *xName = reinterpret_cast<xmlChar const *>(o1.getStr());
|
||||
OString o2 = OUStringToOString(value, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar *xValue = (xmlChar*)o2.getStr();
|
||||
xmlChar const *xValue = reinterpret_cast<xmlChar const *>(o2.getStr());
|
||||
|
||||
if (0 == m_aNodePtr) {
|
||||
throw RuntimeException();
|
||||
@@ -667,29 +667,29 @@ namespace DOM
|
||||
::osl::ClearableMutexGuard guard(m_rMutex);
|
||||
|
||||
OString o1, o2, o3, o4, o5;
|
||||
xmlChar *xPrefix = NULL;
|
||||
xmlChar *xLName = NULL;
|
||||
xmlChar const *xPrefix = NULL;
|
||||
xmlChar const *xLName = NULL;
|
||||
o1 = OUStringToOString(qualifiedName, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar *xQName = (xmlChar*)o1.getStr();
|
||||
xmlChar const *xQName = reinterpret_cast<xmlChar const *>(o1.getStr());
|
||||
sal_Int32 idx = qualifiedName.indexOf(':');
|
||||
if (idx != -1)
|
||||
{
|
||||
o2 = OUStringToOString(
|
||||
qualifiedName.copy(0,idx),
|
||||
RTL_TEXTENCODING_UTF8);
|
||||
xPrefix = (xmlChar*)o2.getStr();
|
||||
xPrefix = reinterpret_cast<xmlChar const *>(o2.getStr());
|
||||
o3 = OUStringToOString(
|
||||
qualifiedName.copy(idx+1),
|
||||
RTL_TEXTENCODING_UTF8);
|
||||
xLName = (xmlChar*)o3.getStr();
|
||||
xLName = reinterpret_cast<xmlChar const *>(o3.getStr());
|
||||
} else {
|
||||
xPrefix = (xmlChar*)"";
|
||||
xPrefix = reinterpret_cast<xmlChar const *>("");
|
||||
xLName = xQName;
|
||||
}
|
||||
o4 = OUStringToOString(namespaceURI, RTL_TEXTENCODING_UTF8);
|
||||
o5 = OUStringToOString(value, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar *xURI= (xmlChar*)o4.getStr();
|
||||
xmlChar *xValue = (xmlChar*)o5.getStr();
|
||||
xmlChar const *xURI= reinterpret_cast<xmlChar const *>(o4.getStr());
|
||||
xmlChar const *xValue = reinterpret_cast<xmlChar const *>(o5.getStr());
|
||||
|
||||
if (0 == m_aNodePtr) {
|
||||
throw RuntimeException();
|
||||
@@ -702,7 +702,7 @@ namespace DOM
|
||||
pNs = xmlNewNs(m_aNodePtr, xURI, xPrefix);
|
||||
}
|
||||
|
||||
if (strcmp((char*)pNs->href, (char*)xURI) != 0) {
|
||||
if (strcmp(reinterpret_cast<char const *>(pNs->href), reinterpret_cast<char const *>(xURI)) != 0) {
|
||||
// ambiguous ns prefix
|
||||
throw RuntimeException();
|
||||
}
|
||||
@@ -728,7 +728,7 @@ namespace DOM
|
||||
"DOMAttrModified"), UNO_QUERY);
|
||||
event->initMutationEvent(
|
||||
"DOMAttrModified", sal_True, sal_False,
|
||||
Reference< XNode >(getAttributeNodeNS(namespaceURI, OUString((char*)xLName, strlen((char*)xLName), RTL_TEXTENCODING_UTF8)), UNO_QUERY),
|
||||
Reference< XNode >(getAttributeNodeNS(namespaceURI, OUString(reinterpret_cast<char const *>(xLName), strlen(reinterpret_cast<char const *>(xLName)), RTL_TEXTENCODING_UTF8)), UNO_QUERY),
|
||||
oldValue, value, qualifiedName, aChangeType);
|
||||
|
||||
guard.clear(); // release mutex before calling event handlers
|
||||
@@ -759,7 +759,7 @@ namespace DOM
|
||||
if (m_aNodePtr != NULL)
|
||||
{
|
||||
const xmlChar* xName = m_aNodePtr->name;
|
||||
aName = OUString((const sal_Char*)xName, strlen((const char*)xName), RTL_TEXTENCODING_UTF8);
|
||||
aName = OUString(reinterpret_cast<const char*>(xName), strlen(reinterpret_cast<const char*>(xName)), RTL_TEXTENCODING_UTF8);
|
||||
}
|
||||
return aName;
|
||||
}
|
||||
@@ -785,7 +785,7 @@ namespace DOM
|
||||
throw RuntimeException();
|
||||
}
|
||||
OString oName = OUStringToOString(aName, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar *xName = (xmlChar*)oName.getStr();
|
||||
xmlChar const *xName = reinterpret_cast<xmlChar const *>(oName.getStr());
|
||||
xmlNodeSetName(m_aNodePtr, xName);
|
||||
}
|
||||
|
||||
|
@@ -136,13 +136,13 @@ namespace DOM
|
||||
while (pNode != NULL )
|
||||
{
|
||||
if (pNode->type == XML_ELEMENT_NODE &&
|
||||
(strcmp((char*)pNode->name, (char*)m_pName.get()) == 0))
|
||||
(strcmp(reinterpret_cast<char const *>(pNode->name), reinterpret_cast<char*>(m_pName.get())) == 0))
|
||||
{
|
||||
if (!m_pURI) {
|
||||
m_nodevector.push_back(pNode);
|
||||
} else {
|
||||
if (pNode->ns != NULL && (0 ==
|
||||
strcmp((char*)pNode->ns->href, (char*)m_pURI.get())))
|
||||
strcmp(reinterpret_cast<char const *>(pNode->ns->href), reinterpret_cast<char*>(m_pURI.get()))))
|
||||
{
|
||||
m_nodevector.push_back(pNode);
|
||||
}
|
||||
|
@@ -72,7 +72,7 @@ namespace DOM
|
||||
OUString aID;
|
||||
if(m_aEntityPtr != NULL)
|
||||
{
|
||||
aID = OUString((sal_Char*)m_aEntityPtr->ExternalID, strlen((char*)m_aEntityPtr->ExternalID), RTL_TEXTENCODING_UTF8);
|
||||
aID = OUString(reinterpret_cast<char const *>(m_aEntityPtr->ExternalID), strlen(reinterpret_cast<char const *>(m_aEntityPtr->ExternalID)), RTL_TEXTENCODING_UTF8);
|
||||
}
|
||||
return aID;
|
||||
}
|
||||
@@ -87,7 +87,7 @@ namespace DOM
|
||||
OUString aID;
|
||||
if(m_aEntityPtr != NULL)
|
||||
{
|
||||
aID = OUString((sal_Char*)m_aEntityPtr->SystemID, strlen((char*)m_aEntityPtr->SystemID), RTL_TEXTENCODING_UTF8);
|
||||
aID = OUString(reinterpret_cast<char const *>(m_aEntityPtr->SystemID), strlen(reinterpret_cast<char const *>(m_aEntityPtr->SystemID)), RTL_TEXTENCODING_UTF8);
|
||||
}
|
||||
return aID;
|
||||
}
|
||||
@@ -99,7 +99,7 @@ namespace DOM
|
||||
if (m_aNodePtr != NULL)
|
||||
{
|
||||
const xmlChar* xName = m_aNodePtr->name;
|
||||
aName = OUString((sal_Char*)xName, strlen((char*)xName), RTL_TEXTENCODING_UTF8);
|
||||
aName = OUString(reinterpret_cast<char const *>(xName), strlen(reinterpret_cast<char const *>(xName)), RTL_TEXTENCODING_UTF8);
|
||||
}
|
||||
return aName;
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ namespace DOM
|
||||
if (m_aNodePtr != NULL)
|
||||
{
|
||||
const xmlChar* xName = m_aNodePtr->name;
|
||||
aName = OUString((sal_Char*)xName, strlen((char*)xName), RTL_TEXTENCODING_UTF8);
|
||||
aName = OUString(reinterpret_cast<char const *>(xName), strlen(reinterpret_cast<char const *>(xName)), RTL_TEXTENCODING_UTF8);
|
||||
}
|
||||
return aName;
|
||||
}
|
||||
|
@@ -85,7 +85,7 @@ namespace DOM
|
||||
RTL_TEXTENCODING_UTF8);
|
||||
|
||||
OSL_TRACE("Trying to add namespace %s (prefix %s)",
|
||||
(const char*)pHref, (const char*)pPrefix);
|
||||
reinterpret_cast<const char*>(pHref), reinterpret_cast<const char*>(pPrefix));
|
||||
|
||||
Context::NamespaceMapType::iterator aIter=
|
||||
io_rContext.maNamespaceMap.find(val);
|
||||
@@ -105,7 +105,7 @@ namespace DOM
|
||||
|
||||
sal_Int32 getToken( const Context& rContext, const sal_Char* pToken )
|
||||
{
|
||||
const Sequence<sal_Int8> aSeq( (sal_Int8*)pToken, strlen( pToken ) );
|
||||
const Sequence<sal_Int8> aSeq( reinterpret_cast<sal_Int8 const *>(pToken), strlen( pToken ) );
|
||||
return rContext.mxTokenHandler->getTokenFromUTF8( aSeq );
|
||||
}
|
||||
|
||||
@@ -242,14 +242,14 @@ namespace DOM
|
||||
if (cur->ns != NULL)
|
||||
{
|
||||
xmlNsPtr ns = xmlSearchNs(cur->doc, aParent, cur->ns->prefix);
|
||||
if (ns != NULL && ns != cur->ns && strcmp((char*)ns->href, (char*)cur->ns->href)==0)
|
||||
if (ns != NULL && ns != cur->ns && strcmp(reinterpret_cast<char const *>(ns->href), reinterpret_cast<char const *>(cur->ns->href))==0)
|
||||
{
|
||||
xmlNsPtr curDef = cur->nsDef;
|
||||
xmlNsPtr *refp = &(cur->nsDef); // insert point
|
||||
while (curDef != NULL)
|
||||
{
|
||||
ns = xmlSearchNs(cur->doc, aParent, curDef->prefix);
|
||||
if (ns != NULL && ns != curDef && strcmp((char*)ns->href, (char*)curDef->href)==0)
|
||||
if (ns != NULL && ns != curDef && strcmp(reinterpret_cast<char const *>(ns->href), reinterpret_cast<char const *>(curDef->href))==0)
|
||||
{
|
||||
// reconnect ns pointers in sub-tree to newly found ns before
|
||||
// removing redundant nsdecl to prevent dangling pointers.
|
||||
@@ -490,7 +490,7 @@ namespace DOM
|
||||
m_aNodePtr->ns != NULL)
|
||||
{
|
||||
const xmlChar* xHref = m_aNodePtr->ns->href;
|
||||
aURI = OUString((sal_Char*)xHref, strlen((char*)xHref), RTL_TEXTENCODING_UTF8);
|
||||
aURI = OUString(reinterpret_cast<char const *>(xHref), strlen(reinterpret_cast<char const *>(xHref)), RTL_TEXTENCODING_UTF8);
|
||||
}
|
||||
return aURI;
|
||||
}
|
||||
@@ -606,7 +606,7 @@ namespace DOM
|
||||
{
|
||||
const xmlChar* xPrefix = m_aNodePtr->ns->prefix;
|
||||
if( xPrefix != NULL )
|
||||
aPrefix = OUString((sal_Char*)xPrefix, strlen((char*)xPrefix), RTL_TEXTENCODING_UTF8);
|
||||
aPrefix = OUString(reinterpret_cast<char const *>(xPrefix), strlen(reinterpret_cast<char const *>(xPrefix)), RTL_TEXTENCODING_UTF8);
|
||||
}
|
||||
return aPrefix;
|
||||
|
||||
@@ -891,7 +891,7 @@ namespace DOM
|
||||
throw e;
|
||||
}
|
||||
|
||||
xmlAttrPtr pAttr = (xmlAttrPtr)pOld;
|
||||
xmlAttrPtr pAttr = reinterpret_cast<xmlAttrPtr>(pOld);
|
||||
xmlRemoveProp( pAttr );
|
||||
pOldNode->invalidate(); // freed by xmlRemoveProp
|
||||
appendChild(xNewChild);
|
||||
@@ -980,7 +980,7 @@ namespace DOM
|
||||
throw e;
|
||||
}
|
||||
OString o1 = OUStringToOString(prefix, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar *pBuf = (xmlChar*)o1.getStr();
|
||||
xmlChar const *pBuf = reinterpret_cast<xmlChar const *>(o1.getStr());
|
||||
if (m_aNodePtr != NULL && m_aNodePtr->ns != NULL)
|
||||
{
|
||||
xmlFree(const_cast<xmlChar *>(m_aNodePtr->ns->prefix));
|
||||
|
@@ -62,7 +62,7 @@ namespace DOM
|
||||
if (m_aNodePtr != NULL)
|
||||
{
|
||||
const xmlChar* xName = m_aNodePtr->name;
|
||||
aName = OUString((sal_Char*)xName, strlen((char*)xName), RTL_TEXTENCODING_UTF8);
|
||||
aName = OUString(reinterpret_cast<char const *>(xName), strlen(reinterpret_cast<char const *>(xName)), RTL_TEXTENCODING_UTF8);
|
||||
}
|
||||
return aName;
|
||||
}
|
||||
|
@@ -1074,7 +1074,7 @@ void addChaffWhenEncryptedStorage(const uno::Reference< io::XOutputStream > &rSt
|
||||
else
|
||||
{
|
||||
unsigned char *postcomment =
|
||||
(unsigned char*)strchr((const char*)pBuffer, '\n');
|
||||
reinterpret_cast<unsigned char*>(strchr(reinterpret_cast<char*>(pBuffer), '\n'));
|
||||
if (postcomment != NULL)
|
||||
{
|
||||
++postcomment;
|
||||
|
@@ -130,8 +130,8 @@ namespace XPath
|
||||
{
|
||||
oprefix = OUStringToOString(i->first, RTL_TEXTENCODING_UTF8);
|
||||
ouri = OUStringToOString(i->second, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar *p = (xmlChar*)oprefix.getStr();
|
||||
xmlChar *u = (xmlChar*)ouri.getStr();
|
||||
xmlChar const *p = reinterpret_cast<xmlChar const *>(oprefix.getStr());
|
||||
xmlChar const *u = reinterpret_cast<xmlChar const *>(ouri.getStr());
|
||||
xmlXPathRegisterNs(ctx, p, u);
|
||||
++i;
|
||||
}
|
||||
@@ -151,9 +151,9 @@ namespace XPath
|
||||
xmlNsPtr curDef = pNode->nsDef;
|
||||
while (curDef != 0) {
|
||||
const xmlChar* xHref = curDef->href;
|
||||
OUString aURI((sal_Char*)xHref, strlen((char*)xHref), RTL_TEXTENCODING_UTF8);
|
||||
OUString aURI(reinterpret_cast<char const *>(xHref), strlen(reinterpret_cast<char const *>(xHref)), RTL_TEXTENCODING_UTF8);
|
||||
const xmlChar* xPre = curDef->prefix;
|
||||
OUString aPrefix((sal_Char*)xPre, strlen((char*)xPre), RTL_TEXTENCODING_UTF8);
|
||||
OUString aPrefix(reinterpret_cast<char const *>(xPre), strlen(reinterpret_cast<char const *>(xPre)), RTL_TEXTENCODING_UTF8);
|
||||
// we could already have this prefix from a child node
|
||||
if (rNamespaces.find(aPrefix) == rNamespaces.end())
|
||||
{
|
||||
@@ -372,7 +372,7 @@ namespace XPath
|
||||
|
||||
/* run the query */
|
||||
OString o1 = OUStringToOString(expr, RTL_TEXTENCODING_UTF8);
|
||||
xmlChar *xStr = (xmlChar*)o1.getStr();
|
||||
xmlChar const *xStr = reinterpret_cast<xmlChar const *>(o1.getStr());
|
||||
::boost::shared_ptr<xmlXPathObject> const xpathObj(
|
||||
xmlXPathEval(xStr, xpathCtx.get()), xmlXPathFreeObject);
|
||||
xmlSetGenericErrorFunc(NULL, NULL);
|
||||
|
Reference in New Issue
Block a user