diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-01-17 18:47:15 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-01-20 09:06:48 +0100 |
commit | b7c27fef4ee42c17bde6aa05dea583e31d5b32fe (patch) | |
tree | 3f4436d6238bed9a85324477bd8eba109a683f2c /helpcompiler | |
parent | d69fb68f3074cea073d82f9d8c88756d2b169e42 (diff) |
Some more loplugin:cstylecast: helpcompiler
Change-Id: I9e094356601cf156537f75d0629fd214710d80e8
Diffstat (limited to 'helpcompiler')
-rw-r--r-- | helpcompiler/source/BasCodeTagger.cxx | 10 | ||||
-rw-r--r-- | helpcompiler/source/HelpCompiler.cxx | 44 | ||||
-rw-r--r-- | helpcompiler/source/HelpLinker.cxx | 4 | ||||
-rw-r--r-- | helpcompiler/source/LuceneHelper.cxx | 4 |
4 files changed, 31 insertions, 31 deletions
diff --git a/helpcompiler/source/BasCodeTagger.cxx b/helpcompiler/source/BasCodeTagger.cxx index 58e6cfdabe4d..3e514e7c72f8 100644 --- a/helpcompiler/source/BasCodeTagger.cxx +++ b/helpcompiler/source/BasCodeTagger.cxx @@ -82,14 +82,14 @@ void BasicCodeTagger::getBasicCodeContainerNodes() m_pXmlTreeWalker = new LibXmlTreeWalker( m_pDocument ); currentNode = m_pXmlTreeWalker->currentNode(); - if ( !( xmlStrcmp( currentNode->name, (const xmlChar*) "bascode" ) ) ) + if ( !( xmlStrcmp( currentNode->name, reinterpret_cast<const xmlChar*>("bascode") ) ) ) { //Found <bascode> m_BasicCodeContainerTags.push_back( currentNode ); //it goes to the end of the list } while ( !m_pXmlTreeWalker->end() ) { m_pXmlTreeWalker->nextNode(); - if ( !( xmlStrcmp( m_pXmlTreeWalker->currentNode()->name, (const xmlChar*) "bascode" ) ) ) + if ( !( xmlStrcmp( m_pXmlTreeWalker->currentNode()->name, reinterpret_cast<const xmlChar*>("bascode") ) ) ) { //Found <bascode> m_BasicCodeContainerTags.push_back( m_pXmlTreeWalker->currentNode() ); //it goes to the end of the list m_pXmlTreeWalker->ignoreCurrNodesChildren(); @@ -151,12 +151,12 @@ void BasicCodeTagger::tagParagraph( xmlNodePtr paragraph ) i != portions.end(); ++i) { OString sToken(OUStringToOString(strLine.copy(i->nBegin, i->nEnd-i->nBegin), RTL_TEXTENCODING_UTF8)); - xmlNodePtr text = xmlNewText((const xmlChar*)sToken.getStr()); + xmlNodePtr text = xmlNewText(reinterpret_cast<const xmlChar*>(sToken.getStr())); if ( i->tokenType != TT_WHITESPACE ) { xmlChar* typeStr = getTypeString( i->tokenType ); - curNode = xmlNewTextChild( paragraph, 0, (xmlChar*)"item", 0 ); - xmlNewProp( curNode, (xmlChar*)"type", typeStr ); + curNode = xmlNewTextChild( paragraph, 0, reinterpret_cast<xmlChar const *>("item"), 0 ); + xmlNewProp( curNode, reinterpret_cast<xmlChar const *>("type"), typeStr ); xmlAddChild( curNode, text ); xmlFree( typeStr ); } diff --git a/helpcompiler/source/HelpCompiler.cxx b/helpcompiler/source/HelpCompiler.cxx index 03cb4f47f7c0..602acce19e97 100644 --- a/helpcompiler/source/HelpCompiler.cxx +++ b/helpcompiler/source/HelpCompiler.cxx @@ -77,7 +77,7 @@ xmlDocPtr HelpCompiler::compactXhpForJar( xmlDocPtr doc ) if (!compact) { - compact = xsltParseStylesheetFile((const xmlChar *)resCompactStylesheet.native_file_string().c_str()); + compact = xsltParseStylesheetFile(reinterpret_cast<const xmlChar *>(resCompactStylesheet.native_file_string().c_str())); } compacted = xsltApplyStylesheet(compact, doc, params); @@ -139,7 +139,7 @@ xmlDocPtr HelpCompiler::getSourceDocument(const fs::path &filePath) xmlSubstituteEntitiesDefault(1); xmlLoadExtDtdDefaultValue = 1; - cur = xsltParseStylesheetFile((const xmlChar *)resEmbStylesheet.native_file_string().c_str()); + cur = xsltParseStylesheetFile(reinterpret_cast<const xmlChar *>(resEmbStylesheet.native_file_string().c_str())); int nbparams = 0; params[nbparams++] = "fsroot"; @@ -171,17 +171,17 @@ xmlNodePtr HelpCompiler::clone(xmlNodePtr node, const std::string& appl) xmlNodePtr list = node->xmlChildrenNode; while (list) { - if (strcmp((const char*)list->name, "switchinline") == 0 || strcmp((const char*)list->name, "switch") == 0) + if (strcmp(reinterpret_cast<const char*>(list->name), "switchinline") == 0 || strcmp(reinterpret_cast<const char*>(list->name), "switch") == 0) { std::string tmp=""; - xmlChar * prop = xmlGetProp(list, (xmlChar*)"select"); + xmlChar * prop = xmlGetProp(list, reinterpret_cast<xmlChar const *>("select")); if (prop != 0) { - if (strcmp((char *)prop, "sys") == 0) + if (strcmp(reinterpret_cast<char *>(prop), "sys") == 0) { tmp = gui; } - else if (strcmp((char *)prop, "appl") == 0) + else if (strcmp(reinterpret_cast<char *>(prop), "appl") == 0) { tmp = appl; } @@ -193,10 +193,10 @@ xmlNodePtr HelpCompiler::clone(xmlNodePtr node, const std::string& appl) xmlNodePtr caseList=list->xmlChildrenNode; while (caseList) { - xmlChar *select = xmlGetProp(caseList, (xmlChar*)"select"); + xmlChar *select = xmlGetProp(caseList, reinterpret_cast<xmlChar const *>("select")); if (select) { - if (!strcmp((const char*)select, tmp.c_str()) && !isCase) + if (!strcmp(reinterpret_cast<char*>(select), tmp.c_str()) && !isCase) { isCase=true; xmlNodePtr clp = caseList->xmlChildrenNode; @@ -210,7 +210,7 @@ xmlNodePtr HelpCompiler::clone(xmlNodePtr node, const std::string& appl) } else { - if ((strcmp((const char*)caseList->name, "defaultinline") != 0) && (strcmp((const char*)caseList->name, "default") != 0)) + if ((strcmp(reinterpret_cast<const char*>(caseList->name), "defaultinline") != 0) && (strcmp(reinterpret_cast<const char*>(caseList->name), "default") != 0)) { xmlAddChild(root, clone(caseList, appl)); } @@ -282,7 +282,7 @@ std::string myparser::dump(xmlNodePtr node) if (xmlNodeIsText(node)) { xmlChar *pContent = xmlNodeGetContent(node); - app += std::string((const char*)pContent); + app += std::string(reinterpret_cast<char*>(pContent)); xmlFree(pContent); } return app; @@ -308,28 +308,28 @@ void myparser::traverse( xmlNodePtr parentNode ) xmlNodePtr test ; for (test = parentNode->xmlChildrenNode; test; test = test->next) { - if (fileName.empty() && !strcmp((const char*)test->name, "filename")) + if (fileName.empty() && !strcmp(reinterpret_cast<const char*>(test->name), "filename")) { xmlNodePtr node = test->xmlChildrenNode; if (xmlNodeIsText(node)) { xmlChar *pContent = xmlNodeGetContent(node); - fileName = std::string((const char*)pContent); + fileName = std::string(reinterpret_cast<char*>(pContent)); xmlFree(pContent); } } - else if (title.empty() && !strcmp((const char*)test->name, "title")) + else if (title.empty() && !strcmp(reinterpret_cast<const char*>(test->name), "title")) { title = dump(test); if (title.empty()) title = "<notitle>"; } - else if (!strcmp((const char*)test->name, "bookmark")) + else if (!strcmp(reinterpret_cast<const char*>(test->name), "bookmark")) { - xmlChar *branchxml = xmlGetProp(test, (const xmlChar*)"branch"); - xmlChar *idxml = xmlGetProp(test, (const xmlChar*)"id"); - std::string branch((const char*)branchxml); - std::string anchor((const char*)idxml); + xmlChar *branchxml = xmlGetProp(test, reinterpret_cast<const xmlChar*>("branch")); + xmlChar *idxml = xmlGetProp(test, reinterpret_cast<const xmlChar*>("id")); + std::string branch(reinterpret_cast<char*>(branchxml)); + std::string anchor(reinterpret_cast<char*>(idxml)); xmlFree (branchxml); xmlFree (idxml); @@ -357,14 +357,14 @@ void myparser::traverse( xmlNodePtr parentNode ) for (xmlNodePtr nd = test->xmlChildrenNode; nd; nd = nd->next) { - if (strcmp((const char*)nd->name, "bookmark_value")) + if (strcmp(reinterpret_cast<const char*>(nd->name), "bookmark_value")) continue; std::string embedded; - xmlChar *embeddedxml = xmlGetProp(nd, (const xmlChar*)"embedded"); + xmlChar *embeddedxml = xmlGetProp(nd, reinterpret_cast<const xmlChar*>("embedded")); if (embeddedxml) { - embedded = std::string((const char*)embeddedxml); + embedded = std::string(reinterpret_cast<char*>(embeddedxml)); xmlFree (embeddedxml); std::transform (embedded.begin(), embedded.end(), embedded.begin(), tocharlower); @@ -396,7 +396,7 @@ void myparser::traverse( xmlNodePtr parentNode ) // currently not used } } - else if (!strcmp((const char*)test->name, "ahelp")) + else if (!strcmp(reinterpret_cast<const char*>(test->name), "ahelp")) { std::string text = dump(test); trim(text); diff --git a/helpcompiler/source/HelpLinker.cxx b/helpcompiler/source/HelpLinker.cxx index b85911aa8e0b..b2144fb5a376 100644 --- a/helpcompiler/source/HelpLinker.cxx +++ b/helpcompiler/source/HelpLinker.cxx @@ -52,9 +52,9 @@ IndexerPreProcessor::IndexerPreProcessor fs::create_directory( m_fsContentFilesDirName ); m_xsltStylesheetPtrCaption = xsltParseStylesheetFile - ((const xmlChar *)idxCaptionStylesheet.native_file_string().c_str()); + (reinterpret_cast<const xmlChar *>(idxCaptionStylesheet.native_file_string().c_str())); m_xsltStylesheetPtrContent = xsltParseStylesheetFile - ((const xmlChar *)idxContentStylesheet.native_file_string().c_str()); + (reinterpret_cast<const xmlChar *>(idxContentStylesheet.native_file_string().c_str())); } IndexerPreProcessor::~IndexerPreProcessor() diff --git a/helpcompiler/source/LuceneHelper.cxx b/helpcompiler/source/LuceneHelper.cxx index a8e8f6429715..7002162a7862 100644 --- a/helpcompiler/source/LuceneHelper.cxx +++ b/helpcompiler/source/LuceneHelper.cxx @@ -30,10 +30,10 @@ OUString TCHARArrayToOUString(TCHAR const *str) { // UTF-16 if (sizeof(TCHAR) == sizeof(sal_Unicode)) - return OUString((const sal_Unicode*)(str)); + return OUString(reinterpret_cast<const sal_Unicode*>(str)); // UTF-32 - return OUString((const sal_uInt32*)str, wcslen(str)); + return OUString(reinterpret_cast<const sal_uInt32*>(str), wcslen(str)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |