diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-07 20:03:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-08 08:48:54 +0200 |
commit | 4eb75e416e7245e4cb0291ea186e7e5a40bdfe60 (patch) | |
tree | 624f3a2a3e331c9b884816ff3d596e7923879c9d | |
parent | 523922ee9d033fd304d2b50a72b76853ddcfbcdf (diff) |
loplugin:flatten in helpcompiler
Change-Id: I5d6b83b6976c115426f186958b749e48c60ba8f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91847
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | helpcompiler/source/HelpLinker.cxx | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/helpcompiler/source/HelpLinker.cxx b/helpcompiler/source/HelpLinker.cxx index ecd85044d238..46a9fac2edf2 100644 --- a/helpcompiler/source/HelpLinker.cxx +++ b/helpcompiler/source/HelpLinker.cxx @@ -104,22 +104,22 @@ void IndexerPreProcessor::processDocument xmlFreeDoc(resCaption); } - if( m_xsltStylesheetPtrContent ) + if( !m_xsltStylesheetPtrContent ) + return; + + xmlDocPtr resContent = xsltApplyStylesheet( m_xsltStylesheetPtrContent, doc, nullptr ); + xmlNodePtr pResNodeContent = resContent->xmlChildrenNode; + if( pResNodeContent ) { - xmlDocPtr resContent = xsltApplyStylesheet( m_xsltStylesheetPtrContent, doc, nullptr ); - xmlNodePtr pResNodeContent = resContent->xmlChildrenNode; - if( pResNodeContent ) + fs::path fsContentPureTextFile_docURL = m_fsContentFilesDirName / aStdStr_EncodedDocPathURL; + FILE* pFile_docURL = fopen_impl( fsContentPureTextFile_docURL, "w" ); + if( pFile_docURL ) { - fs::path fsContentPureTextFile_docURL = m_fsContentFilesDirName / aStdStr_EncodedDocPathURL; - FILE* pFile_docURL = fopen_impl( fsContentPureTextFile_docURL, "w" ); - if( pFile_docURL ) - { - fprintf( pFile_docURL, "%s\n", pResNodeContent->content ); - fclose( pFile_docURL ); - } + fprintf( pFile_docURL, "%s\n", pResNodeContent->content ); + fclose( pFile_docURL ); } - xmlFreeDoc(resContent); } + xmlFreeDoc(resContent); } namespace { @@ -462,25 +462,25 @@ void HelpLinker::link() helpKeyword.dump_DBHelp( keyWordFileName_DBHelp); - if( !bExtensionMode ) + if( bExtensionMode ) + return; + + // New index + for (auto const& additionalFile : additionalFiles) { - // New index - for (auto const& additionalFile : additionalFiles) - { - const std::string &additionalFileName = additionalFile.second; - const std::string &additionalFileKey = additionalFile.first; + const std::string &additionalFileName = additionalFile.second; + const std::string &additionalFileKey = additionalFile.first; - fs::path fsAdditionalFileName( additionalFileName, fs::native ); - HCDBG({ - std::string aNativeStr = fsAdditionalFileName.native_file_string(); - const char* pStr = aNativeStr.c_str(); - std::cerr << pStr << std::endl; - }); + fs::path fsAdditionalFileName( additionalFileName, fs::native ); + HCDBG({ + std::string aNativeStr = fsAdditionalFileName.native_file_string(); + const char* pStr = aNativeStr.c_str(); + std::cerr << pStr << std::endl; + }); - fs::path fsTargetName( indexDirParentName / additionalFileKey ); + fs::path fsTargetName( indexDirParentName / additionalFileKey ); - fs::copy( fsAdditionalFileName, fsTargetName ); - } + fs::copy( fsAdditionalFileName, fsTargetName ); } } |