diff options
Diffstat (limited to 'l10ntools/source/help')
-rw-r--r-- | l10ntools/source/help/HelpLinker.cxx | 99 | ||||
-rw-r--r-- | l10ntools/source/help/HelpLinker_main.cxx | 51 | ||||
-rw-r--r-- | l10ntools/source/help/helplinker.pmk | 31 | ||||
-rw-r--r-- | l10ntools/source/help/makefile.mk | 116 |
4 files changed, 62 insertions, 235 deletions
diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx index 0103f43f8674..8c0d510ddb32 100644 --- a/l10ntools/source/help/HelpLinker.cxx +++ b/l10ntools/source/help/HelpLinker.cxx @@ -26,11 +26,8 @@ * ************************************************************************/ -#ifdef AIX -# undef _THREAD_SAFE -#endif - #include "HelpCompiler.hxx" +#include "l10ntools/HelpLinker.hxx" #include <map> @@ -38,7 +35,6 @@ #include <limits.h> #include <libxslt/xslt.h> -#include <libxslt/transform.h> #include <libxslt/xsltutils.h> #include <libxslt/functions.h> #include <libxslt/extensions.h> @@ -50,26 +46,17 @@ #include <expat.h> -#define DBHELP_ONLY - -class IndexerPreProcessor +namespace lucene { -private: - std::string m_aModuleName; - fs::path m_fsIndexBaseDir; - fs::path m_fsCaptionFilesDirName; - fs::path m_fsContentFilesDirName; - - xsltStylesheetPtr m_xsltStylesheetPtrCaption; - xsltStylesheetPtr m_xsltStylesheetPtrContent; - -public: - IndexerPreProcessor( const std::string& aModuleName, const fs::path& fsIndexBaseDir, - const fs::path& idxCaptionStylesheet, const fs::path& idxContentStylesheet ); - ~IndexerPreProcessor(); - - void processDocument( xmlDocPtr doc, const std::string& EncodedDocPath ); -}; +namespace document +{ +class Document; +} +namespace util +{ +class Reader; +} +} IndexerPreProcessor::IndexerPreProcessor ( const std::string& aModuleName, const fs::path& fsIndexBaseDir, @@ -97,7 +84,6 @@ IndexerPreProcessor::~IndexerPreProcessor() xsltFreeStylesheet( m_xsltStylesheetPtrContent ); } - std::string getEncodedPath( const std::string& Path ) { rtl::OString aOStr_Path( Path.c_str() ); @@ -260,51 +246,6 @@ public: } }; -class HelpLinker -{ -public: - void main(std::vector<std::string> &args, - std::string* pExtensionPath = NULL, - std::string* pDestination = NULL, - const rtl::OUString* pOfficeHelpPath = NULL ) - - throw( HelpProcessingException ); - - HelpLinker() - : init(true) - , m_pIndexerPreProcessor(NULL) - {} - ~HelpLinker() - { delete m_pIndexerPreProcessor; } - -private: - int locCount, totCount; - Stringtable additionalFiles; - HashSet helpFiles; - fs::path sourceRoot; - fs::path embeddStylesheet; - fs::path idxCaptionStylesheet; - fs::path idxContentStylesheet; - fs::path zipdir; - fs::path outputFile; - std::string extsource; - std::string extdestination; - std::string module; - std::string lang; - std::string extensionPath; - std::string extensionDestination; - bool bExtensionMode; - fs::path indexDirName; - fs::path indexDirParentName; - bool init; - IndexerPreProcessor* m_pIndexerPreProcessor; - void initIndexerPreProcessor(); - void link() throw( HelpProcessingException ); - void addBookmark( DB* dbBase, FILE* pFile_DBHelp, std::string thishid, - const std::string& fileB, const std::string& anchorB, - const std::string& jarfileB, const std::string& titleB ); -}; - namespace URLEncoder { static std::string encode(const std::string &rIn) @@ -1024,24 +965,6 @@ void HelpLinker::main( std::vector<std::string> &args, link(); } -SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) { - std::vector<std::string> args; - for (int i = 1; i < argc; ++i) - args.push_back(std::string(argv[i])); - try - { - HelpLinker* pHelpLinker = new HelpLinker(); - pHelpLinker->main( args ); - delete pHelpLinker; - } - catch( const HelpProcessingException& e ) - { - std::cerr << e.m_aErrorMsg; - exit(1); - } - return 0; -} - // Variable to set an exception in "C" StructuredXMLErrorFunction static const HelpProcessingException* GpXMLParsingException = NULL; diff --git a/l10ntools/source/help/HelpLinker_main.cxx b/l10ntools/source/help/HelpLinker_main.cxx new file mode 100644 index 000000000000..fae24bcebf0b --- /dev/null +++ b/l10ntools/source/help/HelpLinker_main.cxx @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "HelpCompiler.hxx" +#include "l10ntools/HelpLinker.hxx" + +#include <sal/main.h> + +SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) { + std::vector<std::string> args; + for (int i = 1; i < argc; ++i) + args.push_back(std::string(argv[i])); + try + { + HelpLinker* pHelpLinker = new HelpLinker(); + pHelpLinker->main( args ); + delete pHelpLinker; + } + catch( const HelpProcessingException& e ) + { + std::cerr << e.m_aErrorMsg; + exit(1); + } + return 0; +} + diff --git a/l10ntools/source/help/helplinker.pmk b/l10ntools/source/help/helplinker.pmk deleted file mode 100644 index 6e99d322f434..000000000000 --- a/l10ntools/source/help/helplinker.pmk +++ /dev/null @@ -1,31 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -# define HELPLINKER_DLLIMPLEMENTATION (see @ inc/xmlhelp/helplinkerdllapi.h) -CDEFS += -DHELPLINKER_DLLIMPLEMENTATION - -VISIBILITY_HIDDEN=TRUE diff --git a/l10ntools/source/help/makefile.mk b/l10ntools/source/help/makefile.mk deleted file mode 100644 index f3019f415b6f..000000000000 --- a/l10ntools/source/help/makefile.mk +++ /dev/null @@ -1,116 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ = ..$/.. -PRJNAME = l10ntools -TARGET = HelpLinker -LIBBASENAME = helplinker -TARGETTYPE=CUI -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : helplinker.pmk - -CFLAGS+=-DL10N_DLLIMPLEMENTATION - -.IF "$(SYSTEM_LIBXSLT)" == "YES" -CFLAGS+= $(LIBXSLT_CFLAGS) -.ELSE -LIBXSLTINCDIR=external$/libxslt -CFLAGS+= -I$(SOLARINCDIR)$/$(LIBXSLTINCDIR) -.ENDIF - -CFLAGS+= $(SYSTEM_DB_CFLAGS) - -.IF "$(SYSTEM_EXPAT)" == "YES" -CFLAGS+=-DSYSTEM_EXPAT -.ENDIF - -.IF "$(SYSTEM_CLUCENE)" == "YES" -CFLAGS+= $(CLUCENE_CFLAGS) -.ENDIF - -OBJFILES=\ - $(OBJ)$/HelpLinker.obj \ - $(OBJ)$/HelpCompiler.obj \ - $(OBJ)$/HelpIndexer.obj \ - $(OBJ)$/HelpIndexer_main.obj \ - $(OBJ)$/HelpSearch.obj \ - $(OBJ)$/LuceneHelper.obj - -SLOFILES=\ - $(SLO)$/HelpLinker.obj \ - $(SLO)$/HelpCompiler.obj \ - $(SLO)$/LuceneHelper.obj \ - $(SLO)$/HelpIndexer.obj \ - $(SLO)$/HelpSearch.obj - -.IF "$(OS)" == "MACOSX" && "$(CPU)" == "P" && "$(COM)" == "GCC" -# There appears to be a GCC 4.0.1 optimization error causing _file:good() to -# report true right before the call to writeOut at HelpLinker.cxx:1.12 l. 954 -# but out.good() to report false right at the start of writeOut at -# HelpLinker.cxx:1.12 l. 537: -NOOPTFILES=\ - $(OBJ)$/HelpLinker.obj \ - $(SLO)$/HelpLinker.obj -.ENDIF - -APP1TARGET= $(TARGET) -APP1OBJS=\ - $(OBJ)$/HelpLinker.obj \ - $(OBJ)$/HelpCompiler.obj -APP1RPATH = NONE -APP1STDLIBS+=$(SALLIB) $(BERKELEYLIB) $(XSLTLIB) $(EXPATASCII3RDLIB) - -APP2TARGET=HelpIndexer -APP2OBJS=\ - $(OBJ)$/LuceneHelper.obj \ - $(OBJ)$/HelpIndexer.obj \ - $(OBJ)$/HelpIndexer_main.obj -APP2RPATH = NONE -APP2STDLIBS+=$(SALLIB) $(CLUCENELIB) - -SHL1TARGET =$(LIBBASENAME)$(DLLPOSTFIX) -SHL1LIBS= $(SLB)$/$(TARGET).lib -.IF "$(COM)" == "MSC" -SHL1IMPLIB =i$(LIBBASENAME) -.ELSE -SHL1IMPLIB =$(LIBBASENAME)$(DLLPOSTFIX) -.ENDIF -SHL1DEF =$(MISC)$/$(SHL1TARGET).def -SHL1STDLIBS =$(SALLIB) $(BERKELEYLIB) $(XSLTLIB) $(EXPATASCII3RDLIB) $(CLUCENELIB) -SHL1USE_EXPORTS =ordinal - -DEF1NAME =$(SHL1TARGET) -DEFLIB1NAME =$(TARGET) - - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk |