diff options
author | Chirag Manwani <cmkmanwani@gmail.com> | 2016-03-16 17:23:23 +0530 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-03-17 07:05:47 +0000 |
commit | 5b3fee11f4019820cc1212a0441020609418dbf1 (patch) | |
tree | d5aa70496ac7c3f7ac84d81e00068caaefeea15a /l10ntools/source | |
parent | a9a7768399e95d912509c1e6a277634fd8b388ed (diff) |
tdf#84938 Replaced #defined constants with enum class
Change-Id: I2078f15f03fbadab8a0253763d779c3eb7cdf448
Reviewed-on: https://gerrit.libreoffice.org/23302
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'l10ntools/source')
-rw-r--r-- | l10ntools/source/xmlparse.cxx | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx index 714ef1d64580..97d6012d812f 100644 --- a/l10ntools/source/xmlparse.cxx +++ b/l10ntools/source/xmlparse.cxx @@ -94,13 +94,13 @@ XMLParentNode::XMLParentNode( const XMLParentNode& rObj) { switch(pNode->GetNodeType()) { - case XML_NODE_TYPE_ELEMENT: + case XMLNodeType::ELEMENT: AddChild( new XMLElement( *static_cast<XMLElement* >(pNode) ) ); break; - case XML_NODE_TYPE_DATA: + case XMLNodeType::DATA: AddChild( new XMLData ( *static_cast<XMLData* > (pNode) ) ); break; - case XML_NODE_TYPE_COMMENT: + case XMLNodeType::COMMENT: AddChild( new XMLComment( *static_cast<XMLComment* >(pNode) ) ); break; - case XML_NODE_TYPE_DEFAULT: + case XMLNodeType::DEFAULT: AddChild( new XMLDefault( *static_cast<XMLDefault* >(pNode) ) ); break; default: fprintf(stdout,"XMLParentNode::XMLParentNode( const XMLParentNode& rObj) strange obj"); } @@ -173,14 +173,14 @@ bool XMLFile::Write( ofstream &rStream , XMLNode *pCur ) else { switch( pCur->GetNodeType()) { - case XML_NODE_TYPE_FILE: + case XMLNodeType::XFILE: { if( GetChildList()) for ( size_t i = 0; i < GetChildList()->size(); i++ ) Write( rStream, (*GetChildList())[ i ] ); } break; - case XML_NODE_TYPE_ELEMENT: + case XMLNodeType::ELEMENT: { XMLElement *pElement = static_cast<XMLElement*>(pCur); rStream << "<"; @@ -209,13 +209,13 @@ bool XMLFile::Write( ofstream &rStream , XMLNode *pCur ) } } break; - case XML_NODE_TYPE_DATA: + case XMLNodeType::DATA: { OString sData( static_cast<const XMLData*>(pCur)->GetData()); rStream << XMLUtil::QuotHTML( sData ).getStr(); } break; - case XML_NODE_TYPE_COMMENT: + case XMLNodeType::COMMENT: { const XMLComment *pComment = static_cast<const XMLComment*>(pCur); rStream << "<!--"; @@ -223,7 +223,7 @@ bool XMLFile::Write( ofstream &rStream , XMLNode *pCur ) rStream << "-->"; } break; - case XML_NODE_TYPE_DEFAULT: + case XMLNodeType::DEFAULT: { const XMLDefault *pDefault = static_cast<const XMLDefault*>(pCur); rStream << pDefault->GetDefault().getStr(); @@ -242,14 +242,14 @@ void XMLFile::Print( XMLNode *pCur, sal_uInt16 nLevel ) { switch( pCur->GetNodeType()) { - case XML_NODE_TYPE_FILE: + case XMLNodeType::XFILE: { if( GetChildList()) for ( size_t i = 0; i < GetChildList()->size(); i++ ) Print( (*GetChildList())[ i ] ); } break; - case XML_NODE_TYPE_ELEMENT: + case XMLNodeType::ELEMENT: { XMLElement *pElement = static_cast<XMLElement*>(pCur); @@ -278,19 +278,19 @@ void XMLFile::Print( XMLNode *pCur, sal_uInt16 nLevel ) } } break; - case XML_NODE_TYPE_DATA: + case XMLNodeType::DATA: { const XMLData *pData = static_cast<const XMLData*>(pCur); fprintf( stdout, "%s", pData->GetData().getStr()); } break; - case XML_NODE_TYPE_COMMENT: + case XMLNodeType::COMMENT: { const XMLComment *pComment = static_cast<const XMLComment*>(pCur); fprintf( stdout, "<!--%s-->", pComment->GetComment().getStr()); } break; - case XML_NODE_TYPE_DEFAULT: + case XMLNodeType::DEFAULT: { const XMLDefault *pDefault = static_cast<const XMLDefault*>(pCur); fprintf( stdout, "%s", pDefault->GetDefault().getStr()); @@ -429,20 +429,20 @@ void XMLFile::SearchL10NElements( XMLChildNode *pCur, int nPos ) { switch( pCur->GetNodeType()) { - case XML_NODE_TYPE_FILE: + case XMLNodeType::XFILE: { if( GetChildList()) { for ( size_t i = 0; i < GetChildList()->size(); i++ ) { XMLChildNode* pElement = (*GetChildList())[ i ]; - if( pElement->GetNodeType() == XML_NODE_TYPE_ELEMENT ) + if( pElement->GetNodeType() == XMLNodeType::ELEMENT ) SearchL10NElements( pElement , i); } } } break; - case XML_NODE_TYPE_ELEMENT: + case XMLNodeType::ELEMENT: { bool bInsert = true; XMLElement *pElement = static_cast<XMLElement*>(pCur); @@ -485,11 +485,7 @@ void XMLFile::SearchL10NElements( XMLChildNode *pCur, int nPos ) } } break; - case XML_NODE_TYPE_DATA: - break; - case XML_NODE_TYPE_COMMENT: - break; - case XML_NODE_TYPE_DEFAULT: + default: break; } } @@ -504,19 +500,19 @@ bool XMLFile::CheckExportStatus( XMLParentNode *pCur ) else { switch( pCur->GetNodeType()) { - case XML_NODE_TYPE_FILE: + case XMLNodeType::XFILE: { if( GetChildList()) { for ( size_t i = 0; i < GetChildList()->size(); i++ ) { XMLParentNode* pElement = static_cast<XMLParentNode*>((*GetChildList())[ i ]); - if( pElement->GetNodeType() == XML_NODE_TYPE_ELEMENT ) CheckExportStatus( pElement );//, i); + if( pElement->GetNodeType() == XMLNodeType::ELEMENT ) CheckExportStatus( pElement );//, i); } } } break; - case XML_NODE_TYPE_ELEMENT: + case XMLNodeType::ELEMENT: { XMLElement *pElement = static_cast<XMLElement*>(pCur); if (pElement->GetName().equalsIgnoreAsciiCase("TOPIC")) @@ -546,6 +542,8 @@ bool XMLFile::CheckExportStatus( XMLParentNode *pCur ) } } break; + default: + break; } } return bStatusExport; @@ -641,7 +639,7 @@ void XMLElement::ChangeLanguageTag( const OString &rValue ) for ( size_t i = 0; i < pCList->size(); i++ ) { XMLChildNode* pNode = (*pCList)[ i ]; - if( pNode && pNode->GetNodeType() == XML_NODE_TYPE_ELEMENT ) + if( pNode && pNode->GetNodeType() == XMLNodeType::ELEMENT ) { XMLElement* pElem = static_cast< XMLElement* >(pNode); pElem->ChangeLanguageTag( rValue ); @@ -693,7 +691,7 @@ void XMLElement::Print(XMLNode *pCur, OStringBuffer& rBuffer, bool bRootelement { switch( pCur->GetNodeType()) { - case XML_NODE_TYPE_ELEMENT: + case XMLNodeType::ELEMENT: { XMLElement *pElement = static_cast<XMLElement*>(pCur); @@ -729,24 +727,26 @@ void XMLElement::Print(XMLNode *pCur, OStringBuffer& rBuffer, bool bRootelement } } break; - case XML_NODE_TYPE_DATA: + case XMLNodeType::DATA: { const XMLData *pData = static_cast<const XMLData*>(pCur); rBuffer.append( pData->GetData() ); } break; - case XML_NODE_TYPE_COMMENT: + case XMLNodeType::COMMENT: { const XMLComment *pComment = static_cast<const XMLComment*>(pCur); rBuffer.append( "<!--" + pComment->GetComment() + "-->" ); } break; - case XML_NODE_TYPE_DEFAULT: + case XMLNodeType::DEFAULT: { const XMLDefault *pDefault = static_cast<const XMLDefault*>(pCur); rBuffer.append( pDefault->GetDefault() ); } break; + default: + break; } } } |