summaryrefslogtreecommitdiff
path: root/transex3
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2009-12-14 10:03:24 +0100
committerVladimir Glazunov <vg@openoffice.org>2009-12-14 10:03:24 +0100
commitbc3a6e41643dfe7f5e410258a87ba1137692882f (patch)
treef3d16fc32df5686663cca18100d5ec1811baf0c5 /transex3
parent944184edde7e753b93c3d93ff30229673e14260a (diff)
parent231200087c468fb036324d27784c9b3379b8bdfe (diff)
CWS-TOOLING: integrate CWS fwk131_DEV300
Diffstat (limited to 'transex3')
-rw-r--r--transex3/source/help/HelpLinker.cxx64
-rw-r--r--transex3/source/help/compilehelp.hxx1
2 files changed, 37 insertions, 28 deletions
diff --git a/transex3/source/help/HelpLinker.cxx b/transex3/source/help/HelpLinker.cxx
index 47d9181a75a0..7dfe4ee4a2a2 100644
--- a/transex3/source/help/HelpLinker.cxx
+++ b/transex3/source/help/HelpLinker.cxx
@@ -114,35 +114,41 @@ void IndexerPreProcessor::processDocument
{
std::string aStdStr_EncodedDocPathURL = getEncodedPath( EncodedDocPath );
- xmlDocPtr resCaption = xsltApplyStylesheet( m_xsltStylesheetPtrCaption, doc, NULL );
- xmlNodePtr pResNodeCaption = resCaption->xmlChildrenNode;
- if( pResNodeCaption )
+ if( m_xsltStylesheetPtrCaption )
{
- fs::path fsCaptionPureTextFile_docURL = m_fsCaptionFilesDirName / aStdStr_EncodedDocPathURL;
- std::string aCaptionPureTextFileStr_docURL = fsCaptionPureTextFile_docURL.native_file_string();
- FILE* pFile_docURL = fopen( aCaptionPureTextFileStr_docURL.c_str(), "w" );
- if( pFile_docURL )
+ xmlDocPtr resCaption = xsltApplyStylesheet( m_xsltStylesheetPtrCaption, doc, NULL );
+ xmlNodePtr pResNodeCaption = resCaption->xmlChildrenNode;
+ if( pResNodeCaption )
{
- fprintf( pFile_docURL, "%s\n", pResNodeCaption->content );
- fclose( pFile_docURL );
+ fs::path fsCaptionPureTextFile_docURL = m_fsCaptionFilesDirName / aStdStr_EncodedDocPathURL;
+ std::string aCaptionPureTextFileStr_docURL = fsCaptionPureTextFile_docURL.native_file_string();
+ FILE* pFile_docURL = fopen( aCaptionPureTextFileStr_docURL.c_str(), "w" );
+ if( pFile_docURL )
+ {
+ fprintf( pFile_docURL, "%s\n", pResNodeCaption->content );
+ fclose( pFile_docURL );
+ }
}
+ xmlFreeDoc(resCaption);
}
- xmlFreeDoc(resCaption);
- xmlDocPtr resContent = xsltApplyStylesheet( m_xsltStylesheetPtrContent, doc, NULL );
- xmlNodePtr pResNodeContent = resContent->xmlChildrenNode;
- if( pResNodeContent )
+ if( m_xsltStylesheetPtrContent )
{
- fs::path fsContentPureTextFile_docURL = m_fsContentFilesDirName / aStdStr_EncodedDocPathURL;
- std::string aContentPureTextFileStr_docURL = fsContentPureTextFile_docURL.native_file_string();
- FILE* pFile_docURL = fopen( aContentPureTextFileStr_docURL.c_str(), "w" );
- if( pFile_docURL )
+ xmlDocPtr resContent = xsltApplyStylesheet( m_xsltStylesheetPtrContent, doc, NULL );
+ xmlNodePtr pResNodeContent = resContent->xmlChildrenNode;
+ if( pResNodeContent )
{
- fprintf( pFile_docURL, "%s\n", pResNodeContent->content );
- fclose( pFile_docURL );
+ fs::path fsContentPureTextFile_docURL = m_fsContentFilesDirName / aStdStr_EncodedDocPathURL;
+ std::string aContentPureTextFileStr_docURL = fsContentPureTextFile_docURL.native_file_string();
+ FILE* pFile_docURL = fopen( aContentPureTextFileStr_docURL.c_str(), "w" );
+ if( pFile_docURL )
+ {
+ fprintf( pFile_docURL, "%s\n", pResNodeContent->content );
+ fclose( pFile_docURL );
+ }
}
+ xmlFreeDoc(resContent);
}
- xmlFreeDoc(resContent);
}
struct Data
@@ -241,8 +247,9 @@ public:
class HelpLinker
{
public:
- void main(std::vector<std::string> &args, std::string* pExtensionPath = NULL )
- throw( HelpProcessingException );
+ void main(std::vector<std::string> &args,
+ std::string* pExtensionPath = NULL, const rtl::OUString* pOfficeHelpPath = NULL )
+ throw( HelpProcessingException );
HelpLinker()
: init(true)
@@ -747,21 +754,21 @@ void HelpLinker::link() throw( HelpProcessingException )
}
-void HelpLinker::main(std::vector<std::string> &args, std::string* pExtensionPath)
- throw( HelpProcessingException )
+void HelpLinker::main( std::vector<std::string> &args,
+ std::string* pExtensionPath, const rtl::OUString* pOfficeHelpPath )
+ throw( HelpProcessingException )
{
rtl::OUString aOfficeHelpPath;
bExtensionMode = false;
- if( pExtensionPath && pExtensionPath->length() > 0 )
+ if( pExtensionPath && pExtensionPath->length() > 0 && pOfficeHelpPath )
{
helpFiles.clear();
bExtensionMode = true;
extensionPath = *pExtensionPath;
sourceRoot = fs::path(extensionPath);
- aOfficeHelpPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("$OOO_BASE_DIR/help") );
- rtl::Bootstrap::expandMacros( aOfficeHelpPath );
+ aOfficeHelpPath = *pOfficeHelpPath;
}
if (args.size() > 0 && args[0][0] == '@')
{
@@ -1061,6 +1068,7 @@ HelpProcessingErrorInfo& HelpProcessingErrorInfo::operator=( const struct HelpPr
// Returns true in case of success, false in case of error
HELPLINKER_DLLPUBLIC bool compileExtensionHelp
(
+ const rtl::OUString& aOfficeHelpPath,
const rtl::OUString& aExtensionName,
const rtl::OUString& aExtensionLanguageRoot,
sal_Int32 nXhpFileCount, const rtl::OUString* pXhpFiles,
@@ -1103,7 +1111,7 @@ HELPLINKER_DLLPUBLIC bool compileExtensionHelp
try
{
HelpLinker* pHelpLinker = new HelpLinker();
- pHelpLinker->main( args,&aStdStrExtensionPath );
+ pHelpLinker->main( args, &aStdStrExtensionPath, &aOfficeHelpPath );
delete pHelpLinker;
}
catch( const HelpProcessingException& e )
diff --git a/transex3/source/help/compilehelp.hxx b/transex3/source/help/compilehelp.hxx
index 1e9a1c8604b8..d123d628be27 100644
--- a/transex3/source/help/compilehelp.hxx
+++ b/transex3/source/help/compilehelp.hxx
@@ -71,6 +71,7 @@ struct HelpProcessingErrorInfo
// Returns true in case of success, false in case of error
HELPLINKER_DLLPUBLIC bool compileExtensionHelp
(
+ const rtl::OUString& aOfficeHelpPath,
const rtl::OUString& aExtensionName,
const rtl::OUString& aExtensionLanguageRoot,
sal_Int32 nXhpFileCount, const rtl::OUString* pXhpFiles,