Some more loplugin:cstylecast: helpcompiler
Change-Id: I9e094356601cf156537f75d0629fd214710d80e8
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -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()
|
||||
|
@@ -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: */
|
||||
|
Reference in New Issue
Block a user