Kaydet (Commit) 0a4b0db0 authored tarafından Thorsten Behrens's avatar Thorsten Behrens

xmlsecurity/source/framework: un-screw-up indent

This was painful to read.

Change-Id: I34c8038f5db1b9d3f60e9541fa09bb803a680b54
Reviewed-on: https://gerrit.libreoffice.org/37450Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst 1cf44947
...@@ -614,30 +614,30 @@ const BufferNode* BufferNode::getNextNodeByTreeOrder() const ...@@ -614,30 +614,30 @@ const BufferNode* BufferNode::getNextNodeByTreeOrder() const
* 4. otherwise, no "next" node exists. * 4. otherwise, no "next" node exists.
******************************************************************************/ ******************************************************************************/
{ {
/* /*
* If this buffer node has m_vChildren, then return the first * If this buffer node has m_vChildren, then return the first
* child. * child.
*/ */
if (hasChildren()) if (hasChildren())
{ {
return getFirstChild(); return getFirstChild();
} }
/* /*
* Otherwise, it this buffer node has a following sibling, * Otherwise, it this buffer node has a following sibling,
* then return that sibling. * then return that sibling.
*/ */
BufferNode* pNextSibling = const_cast<BufferNode*>(getNextSibling()); BufferNode* pNextSibling = const_cast<BufferNode*>(getNextSibling());
if (pNextSibling != nullptr) if (pNextSibling != nullptr)
{ {
return pNextSibling; return pNextSibling;
} }
/* /*
* Otherwise, it this buffer node has parent, then return * Otherwise, it this buffer node has parent, then return
* its parent's following sibling. * its parent's following sibling.
*/ */
BufferNode* pNode = const_cast<BufferNode*>(this); BufferNode* pNode = const_cast<BufferNode*>(this);
BufferNode* pParent; BufferNode* pParent;
BufferNode* pNextSiblingParent = nullptr; BufferNode* pNextSiblingParent = nullptr;
...@@ -655,7 +655,7 @@ const BufferNode* BufferNode::getNextNodeByTreeOrder() const ...@@ -655,7 +655,7 @@ const BufferNode* BufferNode::getNextNodeByTreeOrder() const
} }
pNode = pParent; pNode = pParent;
}while (pNextSiblingParent == nullptr); } while (pNextSiblingParent == nullptr);
return pNextSiblingParent; return pNextSiblingParent;
} }
......
...@@ -437,39 +437,39 @@ void SAXEventKeeperImpl::smashBufferNode( ...@@ -437,39 +437,39 @@ void SAXEventKeeperImpl::smashBufferNode(
{ {
BufferNode* pParent = const_cast<BufferNode*>(pBufferNode->getParent()); BufferNode* pParent = const_cast<BufferNode*>(pBufferNode->getParent());
/* /*
* delete the XML data * delete the XML data
*/ */
if (pParent == m_pRootBufferNode) if (pParent == m_pRootBufferNode)
{ {
bool bIsNotBlocking = (m_pCurrentBlockingBufferNode == nullptr); bool bIsNotBlocking = (m_pCurrentBlockingBufferNode == nullptr);
bool bIsBlockInside = false; bool bIsBlockInside = false;
bool bIsBlockingAfterward = false; bool bIsBlockingAfterward = false;
/* /*
* If this is a blocker, then remove any out-element data * If this is a blocker, then remove any out-element data
* which caused by blocking. The removal process will stop * which caused by blocking. The removal process will stop
* at the next blocker to avoid removing any useful data. * at the next blocker to avoid removing any useful data.
*/ */
if (bClearRoot) if (bClearRoot)
{ {
cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > > cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > >
aChildElements = collectChildWorkingElement(m_pRootBufferNode); aChildElements = collectChildWorkingElement(m_pRootBufferNode);
/* /*
* the clearUselessData only clearup the content in the * the clearUselessData only clearup the content in the
* node, not the node itself. * node, not the node itself.
*/ */
m_xXMLDocument->clearUselessData(m_pRootBufferNode->getXMLElement(), m_xXMLDocument->clearUselessData(m_pRootBufferNode->getXMLElement(),
aChildElements, aChildElements,
bIsNotBlocking?(nullptr): bIsNotBlocking?(nullptr):
(m_pCurrentBlockingBufferNode->getXMLElement())); (m_pCurrentBlockingBufferNode->getXMLElement()));
/* /*
* remove the node if it is empty, then if its parent is also * remove the node if it is empty, then if its parent is also
* empty, remove it, then if the next parent is also empty, * empty, remove it, then if the next parent is also empty,
* remove it,..., until parent become null. * remove it,..., until parent become null.
*/ */
m_xXMLDocument->collapse( m_pRootBufferNode->getXMLElement() ); m_xXMLDocument->collapse( m_pRootBufferNode->getXMLElement() );
} }
...@@ -507,20 +507,20 @@ void SAXEventKeeperImpl::smashBufferNode( ...@@ -507,20 +507,20 @@ void SAXEventKeeperImpl::smashBufferNode(
cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > > cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > >
aChildElements = collectChildWorkingElement(pBufferNode); aChildElements = collectChildWorkingElement(pBufferNode);
/* /*
* the clearUselessData only clearup the content in the * the clearUselessData only clearup the content in the
* node, not the node itself. * node, not the node itself.
*/ */
m_xXMLDocument->clearUselessData(pBufferNode->getXMLElement(), m_xXMLDocument->clearUselessData(pBufferNode->getXMLElement(),
aChildElements, aChildElements,
bIsBlockInside?(m_pCurrentBlockingBufferNode->getXMLElement()): bIsBlockInside?(m_pCurrentBlockingBufferNode->getXMLElement()):
(nullptr)); (nullptr));
/* /*
* remove the node if it is empty, then if its parent is also * remove the node if it is empty, then if its parent is also
* empty, remove it, then if the next parent is also empty, * empty, remove it, then if the next parent is also empty,
* remove it,..., until parent become null. * remove it,..., until parent become null.
*/ */
m_xXMLDocument->collapse( pBufferNode->getXMLElement() ); m_xXMLDocument->collapse( pBufferNode->getXMLElement() );
} }
} }
...@@ -650,8 +650,8 @@ void SAXEventKeeperImpl::releaseElementMarkBuffer() ...@@ -650,8 +650,8 @@ void SAXEventKeeperImpl::releaseElementMarkBuffer()
cssxc::sax::ElementMarkPriority nPriority = pElementCollector->getPriority(); cssxc::sax::ElementMarkPriority nPriority = pElementCollector->getPriority();
/* /*
* Delete the EC from the buffer node. * Delete the EC from the buffer node.
*/ */
BufferNode* pBufferNode = pElementCollector->getBufferNode(); BufferNode* pBufferNode = pElementCollector->getBufferNode();
pBufferNode->removeElementCollector(pElementCollector); pBufferNode->removeElementCollector(pElementCollector);
...@@ -678,34 +678,34 @@ void SAXEventKeeperImpl::releaseElementMarkBuffer() ...@@ -678,34 +678,34 @@ void SAXEventKeeperImpl::releaseElementMarkBuffer()
* it is a Blocker * it is a Blocker
*/ */
{ {
/* /*
* Delete the TH from the buffer node. * Delete the TH from the buffer node.
*/ */
BufferNode *pBufferNode = pElementMark->getBufferNode(); BufferNode *pBufferNode = pElementMark->getBufferNode();
pBufferNode->setBlocker(nullptr); pBufferNode->setBlocker(nullptr);
/* /*
* If there is a following handler and no blocking now, then * If there is a following handler and no blocking now, then
* forward this event * forward this event
*/ */
if (m_pCurrentBlockingBufferNode == pBufferNode) if (m_pCurrentBlockingBufferNode == pBufferNode)
{ {
/* /*
* Before forwarding, the next blocking point needs to be * Before forwarding, the next blocking point needs to be
* found. * found.
*/ */
m_pCurrentBlockingBufferNode = findNextBlockingBufferNode(pBufferNode); m_pCurrentBlockingBufferNode = findNextBlockingBufferNode(pBufferNode);
/* /*
* Forward the blocked events between these two STHs. * Forward the blocked events between these two STHs.
*/ */
if (m_xNextHandler.is()) if (m_xNextHandler.is())
{ {
BufferNode* pTempCurrentBufferNode = m_pCurrentBufferNode; BufferNode* pTempCurrentBufferNode = m_pCurrentBufferNode;
BufferNode* pTempCurrentBlockingBufferNode = m_pCurrentBlockingBufferNode; BufferNode* pTempCurrentBlockingBufferNode = m_pCurrentBlockingBufferNode;
m_pCurrentBufferNode = pBufferNode; m_pCurrentBufferNode = pBufferNode;
m_pCurrentBlockingBufferNode = nullptr; m_pCurrentBlockingBufferNode = nullptr;
m_bIsForwarding = true; m_bIsForwarding = true;
...@@ -822,9 +822,9 @@ sal_Int32 SAXEventKeeperImpl::createElementCollector( ...@@ -822,9 +822,9 @@ sal_Int32 SAXEventKeeperImpl::createElementCollector(
m_vElementMarkBuffers.push_back( pElementCollector ); m_vElementMarkBuffers.push_back( pElementCollector );
/* /*
* All the new EC to initial EC array. * All the new EC to initial EC array.
*/ */
m_vNewElementCollectors.push_back( pElementCollector ); m_vNewElementCollectors.push_back( pElementCollector );
return nId; return nId;
...@@ -913,7 +913,7 @@ void SAL_CALL SAXEventKeeperImpl::setElement( ...@@ -913,7 +913,7 @@ void SAL_CALL SAXEventKeeperImpl::setElement(
BufferNode* pBufferNode = pElementMark->getBufferNode(); BufferNode* pBufferNode = pElementMark->getBufferNode();
if (pBufferNode != nullptr) if (pBufferNode != nullptr)
{ {
bool bIsCurrent = m_xXMLDocument->isCurrent(pBufferNode->getXMLElement()); bool bIsCurrent = m_xXMLDocument->isCurrent(pBufferNode->getXMLElement());
pBufferNode->setXMLElement(aElement); pBufferNode->setXMLElement(aElement);
if (bIsCurrent) if (bIsCurrent)
...@@ -1035,10 +1035,10 @@ void SAL_CALL SAXEventKeeperImpl::startElement( ...@@ -1035,10 +1035,10 @@ void SAL_CALL SAXEventKeeperImpl::startElement(
const OUString& aName, const OUString& aName,
const cssu::Reference< cssxs::XAttributeList >& xAttribs ) const cssu::Reference< cssxs::XAttributeList >& xAttribs )
{ {
/* /*
* If there is a following handler and no blocking now, then * If there is a following handler and no blocking now, then
* forward this event * forward this event
*/ */
if ((m_pCurrentBlockingBufferNode == nullptr) && if ((m_pCurrentBlockingBufferNode == nullptr) &&
(m_xNextHandler.is()) && (m_xNextHandler.is()) &&
(!m_bIsForwarding) && (!m_bIsForwarding) &&
...@@ -1046,11 +1046,11 @@ void SAL_CALL SAXEventKeeperImpl::startElement( ...@@ -1046,11 +1046,11 @@ void SAL_CALL SAXEventKeeperImpl::startElement(
{ {
m_xNextHandler->startElement(aName, xAttribs); m_xNextHandler->startElement(aName, xAttribs);
} }
/* /*
* If not forwarding, buffer this startElement. * If not forwarding, buffer this startElement.
*/ */
if (!m_bIsForwarding) if (!m_bIsForwarding)
{ {
sal_Int32 nLength = xAttribs->getLength(); sal_Int32 nLength = xAttribs->getLength();
cssu::Sequence< cssxcsax::XMLAttribute > aAttributes (nLength); cssu::Sequence< cssxcsax::XMLAttribute > aAttributes (nLength);
...@@ -1064,20 +1064,20 @@ void SAL_CALL SAXEventKeeperImpl::startElement( ...@@ -1064,20 +1064,20 @@ void SAL_CALL SAXEventKeeperImpl::startElement(
} }
BufferNode* pBufferNode = addNewElementMarkBuffers(); BufferNode* pBufferNode = addNewElementMarkBuffers();
if (pBufferNode != nullptr) if (pBufferNode != nullptr)
{ {
setCurrentBufferNode(pBufferNode); setCurrentBufferNode(pBufferNode);
} }
} }
void SAL_CALL SAXEventKeeperImpl::endElement( const OUString& aName ) void SAL_CALL SAXEventKeeperImpl::endElement( const OUString& aName )
{ {
bool bIsCurrent = m_xXMLDocument->isCurrent(m_pCurrentBufferNode->getXMLElement()); bool bIsCurrent = m_xXMLDocument->isCurrent(m_pCurrentBufferNode->getXMLElement());
/* /*
* If there is a following handler and no blocking now, then * If there is a following handler and no blocking now, then
* forward this event * forward this event
*/ */
if ((m_pCurrentBlockingBufferNode == nullptr) && if ((m_pCurrentBlockingBufferNode == nullptr) &&
(m_xNextHandler.is()) && (m_xNextHandler.is()) &&
(!m_bIsForwarding)) (!m_bIsForwarding))
...@@ -1099,7 +1099,7 @@ void SAL_CALL SAXEventKeeperImpl::endElement( const OUString& aName ) ...@@ -1099,7 +1099,7 @@ void SAL_CALL SAXEventKeeperImpl::endElement( const OUString& aName )
* the current buffer node is waiting for the current element, * the current buffer node is waiting for the current element,
* then let it notify. * then let it notify.
*/ */
if (bIsCurrent && (m_pCurrentBufferNode != m_pRootBufferNode)) if (bIsCurrent && (m_pCurrentBufferNode != m_pRootBufferNode))
{ {
BufferNode* pOldCurrentBufferNode = m_pCurrentBufferNode; BufferNode* pOldCurrentBufferNode = m_pCurrentBufferNode;
m_pCurrentBufferNode = const_cast<BufferNode*>(m_pCurrentBufferNode->getParent()); m_pCurrentBufferNode = const_cast<BufferNode*>(m_pCurrentBufferNode->getParent());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment