xmlsecurity: clean up not needed C2U macro in xmldocumentwrapper

Also remove some auto-generated documentation that adds no useful
information.

Change-Id: I5e5c5dd6aaa3fb6953c38d6e82fa13737217c25c
Reviewed-on: https://gerrit.libreoffice.org/31748
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
This commit is contained in:
Miklos Vajna
2016-12-08 09:26:16 +01:00
parent 64889c9fb6
commit 9bd471cb76

View File

@@ -50,8 +50,6 @@ namespace cssxw = com::sun::star::xml::wrapper;
#define STRXMLNS "xmlns" #define STRXMLNS "xmlns"
#define C2U( asciiStr ) asciiStr, strlen( asciiStr ), RTL_TEXTENCODING_UTF8
/* used by the recursiveDelete method */ /* used by the recursiveDelete method */
#define NODE_REMOVED 0 #define NODE_REMOVED 0
#define NODE_NOTREMOVED 1 #define NODE_NOTREMOVED 1
@@ -69,7 +67,7 @@ XMLDocumentWrapper_XmlSecImpl::XMLDocumentWrapper_XmlSecImpl()
/* /*
* creates the virtual root element * creates the virtual root element
*/ */
saxHelper.startElement(OUString(C2U( "root" )), cssu::Sequence<cssxcsax::XMLAttribute>()); saxHelper.startElement("root", cssu::Sequence<cssxcsax::XMLAttribute>());
m_pRootElement = saxHelper.getCurrentNode(); m_pRootElement = saxHelper.getCurrentNode();
m_pCurrentElement = m_pRootElement; m_pCurrentElement = m_pRootElement;
@@ -87,9 +85,6 @@ void XMLDocumentWrapper_XmlSecImpl::getNextSAXEvent()
* NAME * NAME
* getNextSAXEvent -- Prepares the next SAX event to be manipulate * getNextSAXEvent -- Prepares the next SAX event to be manipulate
* *
* SYNOPSIS
* getNextSAXEvent();
*
* FUNCTION * FUNCTION
* When converting the document into SAX events, this method is used to * When converting the document into SAX events, this method is used to
* decide the next SAX event to be generated. * decide the next SAX event to be generated.
@@ -179,9 +174,6 @@ void XMLDocumentWrapper_XmlSecImpl::sendStartElement(
* NAME * NAME
* sendStartElement -- Constructs a startElement SAX event * sendStartElement -- Constructs a startElement SAX event
* *
* SYNOPSIS
* sendStartElement(xHandler, xHandler2, pNode);
*
* FUNCTION * FUNCTION
* Used when converting the document into SAX event stream. * Used when converting the document into SAX event stream.
* This method constructs a startElement SAX event for a particular * This method constructs a startElement SAX event for a particular
@@ -209,16 +201,15 @@ void XMLDocumentWrapper_XmlSecImpl::sendStartElement(
if (pNsDef->prefix == nullptr) if (pNsDef->prefix == nullptr)
{ {
pAttributeList->AddAttribute( pAttributeList->AddAttribute(
OUString(C2U( STRXMLNS )), STRXMLNS,
OUString(C2U( reinterpret_cast<char const *>(pNsHref) ))); OUString::fromUtf8(reinterpret_cast<char const *>(pNsHref)));
} }
else else
{ {
pAttributeList->AddAttribute( pAttributeList->AddAttribute(
OUString(C2U( STRXMLNS )) STRXMLNS ":"
+OUString(C2U( ":" )) +OUString::fromUtf8(reinterpret_cast<char const *>(pNsPrefix)),
+OUString(C2U( reinterpret_cast<char const *>(pNsPrefix) )), OUString::fromUtf8(reinterpret_cast<char const *>(pNsHref)));
OUString(C2U( reinterpret_cast<char const *>(pNsHref) )));
} }
pNsDef = pNsDef->next; pNsDef = pNsDef->next;
@@ -234,17 +225,17 @@ void XMLDocumentWrapper_XmlSecImpl::sendStartElement(
OUString ouAttrName; OUString ouAttrName;
if (pAttrNs == nullptr) if (pAttrNs == nullptr)
{ {
ouAttrName = OUString(C2U( reinterpret_cast<char const *>(pAttrName) )); ouAttrName = OUString::fromUtf8(reinterpret_cast<char const *>(pAttrName));
} }
else else
{ {
ouAttrName = OUString(C2U( reinterpret_cast<char const *>(pAttrNs->prefix))) ouAttrName = OUString::fromUtf8(reinterpret_cast<char const *>(pAttrNs->prefix))
+ ":" + OUString(C2U( reinterpret_cast<char const *>(pAttrName) )); + ":" + OUString::fromUtf8(reinterpret_cast<char const *>(pAttrName));
} }
pAttributeList->AddAttribute( pAttributeList->AddAttribute(
ouAttrName, ouAttrName,
OUString(C2U( reinterpret_cast<char*>(pAttr->children->content)))); OUString::fromUtf8(reinterpret_cast<char*>(pAttr->children->content)));
pAttr = pAttr->next; pAttr = pAttr->next;
} }
@@ -253,12 +244,12 @@ void XMLDocumentWrapper_XmlSecImpl::sendStartElement(
if (xHandler.is()) if (xHandler.is())
{ {
xHandler->startElement( xHandler->startElement(
OUString(C2U ( sNodeName.getStr() )), OUString::fromUtf8(sNodeName),
xAttrList); xAttrList);
} }
xHandler2->startElement( xHandler2->startElement(
OUString(C2U ( sNodeName.getStr() )), OUString::fromUtf8(sNodeName),
xAttrList); xAttrList);
} }
@@ -272,9 +263,6 @@ void XMLDocumentWrapper_XmlSecImpl::sendEndElement(
* NAME * NAME
* sendEndElement -- Constructs a endElement SAX event * sendEndElement -- Constructs a endElement SAX event
* *
* SYNOPSIS
* sendEndElement(xHandler, xHandler2, pNode);
*
* FUNCTION * FUNCTION
* Used when converting the document into SAX event stream. * Used when converting the document into SAX event stream.
* This method constructs a endElement SAX event for a particular * This method constructs a endElement SAX event for a particular
@@ -293,10 +281,10 @@ void XMLDocumentWrapper_XmlSecImpl::sendEndElement(
if (xHandler.is()) if (xHandler.is())
{ {
xHandler->endElement(OUString(C2U ( sNodeName.getStr() ))); xHandler->endElement(OUString::fromUtf8(sNodeName));
} }
xHandler2->endElement(OUString(C2U ( sNodeName.getStr() ))); xHandler2->endElement(OUString::fromUtf8(sNodeName));
} }
void XMLDocumentWrapper_XmlSecImpl::sendNode( void XMLDocumentWrapper_XmlSecImpl::sendNode(
@@ -310,9 +298,6 @@ void XMLDocumentWrapper_XmlSecImpl::sendNode(
* sendNode -- Constructs a characters SAX event or a * sendNode -- Constructs a characters SAX event or a
* processingInstruction SAX event * processingInstruction SAX event
* *
* SYNOPSIS
* sendNode(xHandler, xHandler2, pNode);
*
* FUNCTION * FUNCTION
* Used when converting the document into SAX event stream. * Used when converting the document into SAX event stream.
* This method constructs a characters SAX event or a * This method constructs a characters SAX event or a
@@ -336,23 +321,23 @@ void XMLDocumentWrapper_XmlSecImpl::sendNode(
{ {
if (xHandler.is()) if (xHandler.is())
{ {
xHandler->characters(OUString(C2U ( reinterpret_cast<char*>(pNode->content) ))); xHandler->characters(OUString::fromUtf8(reinterpret_cast<char*>(pNode->content)));
} }
xHandler2->characters(OUString(C2U ( reinterpret_cast<char*>(pNode->content) ))); xHandler2->characters(OUString::fromUtf8(reinterpret_cast<char*>(pNode->content)));
} }
else if (type == XML_PI_NODE) else if (type == XML_PI_NODE)
{ {
if (xHandler.is()) if (xHandler.is())
{ {
xHandler->processingInstruction( xHandler->processingInstruction(
OUString(C2U ( reinterpret_cast<char const *>(pNode->name) )), OUString::fromUtf8(reinterpret_cast<char const *>(pNode->name)),
OUString(C2U ( reinterpret_cast<char const *>(pNode->content) ))); OUString::fromUtf8(reinterpret_cast<char const *>(pNode->content)));
} }
xHandler2->processingInstruction( xHandler2->processingInstruction(
OUString(C2U ( reinterpret_cast<char const *>(pNode->name) )), OUString::fromUtf8(reinterpret_cast<char const *>(pNode->name)),
OUString(C2U ( reinterpret_cast<char*>(pNode->content) ))); OUString::fromUtf8(reinterpret_cast<char*>(pNode->content)));
} }
} }
@@ -362,9 +347,6 @@ OString XMLDocumentWrapper_XmlSecImpl::getNodeQName(const xmlNodePtr pNode)
* NAME * NAME
* getNodeQName -- Retrieves the qualified name of a node * getNodeQName -- Retrieves the qualified name of a node
* *
* SYNOPSIS
* name = getNodeQName(pNode);
*
* INPUTS * INPUTS
* pNode - the node whose name will be retrieved * pNode - the node whose name will be retrieved
* *
@@ -394,9 +376,6 @@ xmlNodePtr XMLDocumentWrapper_XmlSecImpl::checkElement( const cssu::Reference< c
* checkElement -- Retrieves the node wrapped by an XXMLElementWrapper * checkElement -- Retrieves the node wrapped by an XXMLElementWrapper
* interface * interface
* *
* SYNOPSIS
* node = checkElement(xXMLElement);
*
* INPUTS * INPUTS
* xXMLElement - the XXMLElementWrapper interface wraping a node * xXMLElement - the XXMLElementWrapper interface wraping a node
* *
@@ -437,9 +416,6 @@ sal_Int32 XMLDocumentWrapper_XmlSecImpl::recursiveDelete(
* NAME * NAME
* recursiveDelete -- Deletes a particular node with its branch. * recursiveDelete -- Deletes a particular node with its branch.
* *
* SYNOPSIS
* result = recursiveDelete(pNode);
*
* FUNCTION * FUNCTION
* Deletes a particular node with its branch, while reserving the nodes * Deletes a particular node with its branch, while reserving the nodes
* (and their branches) listed in the m_aReservedNodes. * (and their branches) listed in the m_aReservedNodes.
@@ -524,9 +500,6 @@ void XMLDocumentWrapper_XmlSecImpl::getNextReservedNode()
* getNextReservedNode -- Highlights the next reserved node in the * getNextReservedNode -- Highlights the next reserved node in the
* reserved node list * reserved node list
* *
* SYNOPSIS
* getNextReservedNode();
*
* FUNCTION * FUNCTION
* The m_aReservedNodes array holds a node list, while the * The m_aReservedNodes array holds a node list, while the
* m_pCurrentReservedNode points to the one currently highlighted. * m_pCurrentReservedNode points to the one currently highlighted.
@@ -552,9 +525,6 @@ void XMLDocumentWrapper_XmlSecImpl::removeNode(const xmlNodePtr pNode) const
* NAME * NAME
* removeNode -- Deletes a node with its branch unconditionally * removeNode -- Deletes a node with its branch unconditionally
* *
* SYNOPSIS
* removeNode( pNode );
*
* FUNCTION * FUNCTION
* Delete the node along with its branch from the document. * Delete the node along with its branch from the document.
* *
@@ -587,9 +557,6 @@ void XMLDocumentWrapper_XmlSecImpl::buildIDAttr(xmlNodePtr pNode) const
* NAME * NAME
* buildIDAttr -- build the ID attribute of a node * buildIDAttr -- build the ID attribute of a node
* *
* SYNOPSIS
* buildIDAttr( pNode );
*
* INPUTS * INPUTS
* pNode - the node whose id attribute will be built * pNode - the node whose id attribute will be built
******************************************************************************/ ******************************************************************************/
@@ -613,9 +580,6 @@ void XMLDocumentWrapper_XmlSecImpl::rebuildIDLink(xmlNodePtr pNode) const
* NAME * NAME
* rebuildIDLink -- rebuild the ID link for the branch * rebuildIDLink -- rebuild the ID link for the branch
* *
* SYNOPSIS
* rebuildIDLink( pNode );
*
* INPUTS * INPUTS
* pNode - the node, from which the branch will be rebuilt * pNode - the node, from which the branch will be rebuilt
******************************************************************************/ ******************************************************************************/
@@ -661,11 +625,7 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::removeCurrentElement( )
* automatically become the new stack top, and * automatically become the new stack top, and
* the current node as well. * the current node as well.
*/ */
saxHelper.endElement( saxHelper.endElement(OUString::fromUtf8(reinterpret_cast<char const *>(pOldCurrentElement->name)));
OUString(
C2U (
reinterpret_cast<char const *>(pOldCurrentElement->name)
)));
m_pCurrentElement = saxHelper.getCurrentNode(); m_pCurrentElement = saxHelper.getCurrentNode();
/* /*
@@ -698,7 +658,7 @@ OUString SAL_CALL XMLDocumentWrapper_XmlSecImpl::getNodeName( const cssu::Refere
throw (cssu::RuntimeException, std::exception) throw (cssu::RuntimeException, std::exception)
{ {
xmlNodePtr pNode = checkElement(node); xmlNodePtr pNode = checkElement(node);
return OUString(C2U ( reinterpret_cast<char const *>(pNode->name) )); return OUString::fromUtf8(reinterpret_cast<char const *>(pNode->name));
} }
void SAL_CALL XMLDocumentWrapper_XmlSecImpl::clearUselessData( void SAL_CALL XMLDocumentWrapper_XmlSecImpl::clearUselessData(