diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-02-15 12:55:11 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-02-23 10:31:17 +0000 |
commit | 796818d7b5a63c30d1ec837172deb73e300bfc38 (patch) | |
tree | 6a6be12e36c87476a6dbb277ae93408897e47db1 /l10ntools | |
parent | 0f691cc6896e03ab8ca805bf0689bc0fc53dd42f (diff) |
tweak build
Diffstat (limited to 'l10ntools')
-rw-r--r-- | l10ntools/inc/l10ntools/HelpIndexer.hxx (renamed from l10ntools/source/help/HelpIndexer.hxx) | 4 | ||||
-rw-r--r-- | l10ntools/inc/l10ntools/dllapi.h | 49 | ||||
-rw-r--r-- | l10ntools/prj/d.lst | 2 | ||||
-rw-r--r-- | l10ntools/source/help/HelpIndexer.cxx | 22 | ||||
-rw-r--r-- | l10ntools/source/help/HelpIndexer_main.cxx | 2 | ||||
-rw-r--r-- | l10ntools/source/help/makefile.mk | 20 |
6 files changed, 83 insertions, 16 deletions
diff --git a/l10ntools/source/help/HelpIndexer.hxx b/l10ntools/inc/l10ntools/HelpIndexer.hxx index 833e5e74bba3..ac034b5075f4 100644 --- a/l10ntools/source/help/HelpIndexer.hxx +++ b/l10ntools/inc/l10ntools/HelpIndexer.hxx @@ -1,6 +1,8 @@ #ifndef HELPINDEXER_HXX #define HELPINDEXER_HXX +#include <l10ntools/dllapi.h> + #include <CLucene/StdHeader.h> #include <CLucene.h> @@ -9,7 +11,7 @@ // I assume that TCHAR is defined as wchar_t throughout -class HelpIndexer { +class L10N_DLLPUBLIC HelpIndexer { private: rtl::OUString d_lang; rtl::OUString d_module; diff --git a/l10ntools/inc/l10ntools/dllapi.h b/l10ntools/inc/l10ntools/dllapi.h new file mode 100644 index 000000000000..184a590944ed --- /dev/null +++ b/l10ntools/inc/l10ntools/dllapi.h @@ -0,0 +1,49 @@ +/* -*- 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. + * + ************************************************************************/ + +#ifndef _L10N_DLLAPI_H +#define _L10N_DLLAPI_H + +#include "sal/config.h" +#include "sal/types.h" + +#if defined L10N_DLLIMPLEMENTATION +#define L10N_DLLPUBLIC SAL_DLLPUBLIC_EXPORT +#else +#define L10N_DLLPUBLIC SAL_DLLPUBLIC_IMPORT +#endif + +#if defined UNX && ! defined MACOS +#define L10N_PLUGIN_PUBLIC L10N_DLLPUBLIC +#else +#define L10N_PLUGIN_PUBLIC SAL_DLLPRIVATE +#endif + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/l10ntools/prj/d.lst b/l10ntools/prj/d.lst index 174bb6c6d99f..44cf5f001e14 100644 --- a/l10ntools/prj/d.lst +++ b/l10ntools/prj/d.lst @@ -44,8 +44,10 @@ mkdir: %_DEST%\bin\help\com\sun\star\help ..\scripts\propex.bat %_DEST%\bin\propex.bat ..\scripts\propmerge %_DEST%\bin\propmerge ..\inc\export.hxx %_DEST%\inc\l10ntools\export.hxx +..\inc\l10ntools\dllapi.h %_DEST%\inc\l10ntools\dllapi.h ..\inc\l10ntools\directory.hxx %_DEST%\inc\l10ntools\directory.hxx ..\inc\l10ntools\file.hxx %_DEST%\inc\l10ntools\file.hxx +..\inc\l10ntools\HelpIndexer.hxx %_DEST%\inc\l10ntools\HelpIndexer.hxx ..\source\filter\merge\FCFGMerge.cfg %_DEST%\inc\l10ntools\FCFGMerge.cfg ..\%__SRC%\lib\transex.lib %_DEST%\lib\transex.lib diff --git a/l10ntools/source/help/HelpIndexer.cxx b/l10ntools/source/help/HelpIndexer.cxx index f86d265d33be..b54814a41895 100644 --- a/l10ntools/source/help/HelpIndexer.cxx +++ b/l10ntools/source/help/HelpIndexer.cxx @@ -1,4 +1,4 @@ -#include "HelpIndexer.hxx" +#include <l10ntools/HelpIndexer.hxx> #define TODO @@ -100,11 +100,27 @@ bool HelpIndexer::scanForFiles(rtl::OUString const & path) { return true; } +std::vector<TCHAR> OUStringToTCHARVec(rtl::OUString const &rStr) +{ + //UTF-16 + if (sizeof(wchar_t) == sizeof(sal_Unicode)) + return std::vector<TCHAR>(rStr.getStr(), rStr.getStr() + rStr.getLength()); + + //UTF-32 + std::vector<TCHAR> aRet; + for (sal_Int32 nStrIndex = 0; nStrIndex < rStr.getLength();) + { + const sal_uInt32 nCode = rStr.iterateCodePoints(&nStrIndex); + aRet.push_back(nCode); + } + return aRet; +} + bool HelpIndexer::helpDocument(rtl::OUString const & fileName, Document *doc) { // Add the help path as an indexed, untokenized field. rtl::OUString path = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("#HLP#")) + d_module + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + fileName; - // FIXME: the (TCHAR*) cast is a problem, because TCHAR does not match sal_Unicode - doc->add(*new Field(_T("path"), (TCHAR*)path.getStr(), Field::STORE_YES | Field::INDEX_UNTOKENIZED)); + std::vector<TCHAR> aPath(OUStringToTCHARVec(path)); + doc->add(*new Field(_T("path"), &aPath[0], Field::STORE_YES | Field::INDEX_UNTOKENIZED)); // Add the caption as a field. rtl::OUString captionPath = d_captionDir + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + fileName; diff --git a/l10ntools/source/help/HelpIndexer_main.cxx b/l10ntools/source/help/HelpIndexer_main.cxx index 3d6963081e0a..ecea92847735 100644 --- a/l10ntools/source/help/HelpIndexer_main.cxx +++ b/l10ntools/source/help/HelpIndexer_main.cxx @@ -1,4 +1,4 @@ -#include "HelpIndexer.hxx" +#include <l10ntools/HelpIndexer.hxx> #include <string> #include <iostream> diff --git a/l10ntools/source/help/makefile.mk b/l10ntools/source/help/makefile.mk index 12835358fcd6..2ae32329d546 100644 --- a/l10ntools/source/help/makefile.mk +++ b/l10ntools/source/help/makefile.mk @@ -29,13 +29,15 @@ PRJ = ..$/.. PRJNAME = l10ntools TARGET = HelpLinker LIBBASENAME = helplinker -PACKAGE = com$/sun$/star$/help TARGETTYPE=CUI +ENABLE_EXCEPTIONS=TRUE # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk .INCLUDE : helplinker.pmk + +CFLAGS+=-DL10N_DLLIMPLEMENTATION .IF "$(SYSTEM_LIBXSLT)" == "YES" CFLAGS+= $(LIBXSLT_CFLAGS) @@ -52,18 +54,14 @@ CFLAGS+=-DSYSTEM_EXPAT OBJFILES=\ $(OBJ)$/HelpLinker.obj \ - $(OBJ)$/HelpCompiler.obj -SLOFILES=\ - $(SLO)$/HelpLinker.obj \ - $(SLO)$/HelpCompiler.obj - -EXCEPTIONSFILES=\ - $(OBJ)$/HelpLinker.obj \ $(OBJ)$/HelpCompiler.obj \ $(OBJ)$/HelpIndexer.obj \ - $(OBJ)$/HelpIndexer_main.obj \ + $(OBJ)$/HelpIndexer_main.obj + +SLOFILES=\ $(SLO)$/HelpLinker.obj \ - $(SLO)$/HelpCompiler.obj + $(SLO)$/HelpCompiler.obj \ + $(SLO)$/HelpIndexer.obj .IF "$(OS)" == "MACOSX" && "$(CPU)" == "P" && "$(COM)" == "GCC" # There appears to be a GCC 4.0.1 optimization error causing _file:good() to @@ -100,7 +98,7 @@ SHL1IMPLIB =i$(LIBBASENAME) SHL1IMPLIB =$(LIBBASENAME)$(DLLPOSTFIX) .ENDIF SHL1DEF =$(MISC)$/$(SHL1TARGET).def -SHL1STDLIBS =$(SALLIB) $(BERKELEYLIB) $(XSLTLIB) $(EXPATASCII3RDLIB) +SHL1STDLIBS =$(SALLIB) $(BERKELEYLIB) $(XSLTLIB) $(EXPATASCII3RDLIB) $(PKGCONFIG_LIBS) SHL1USE_EXPORTS =ordinal DEF1NAME =$(SHL1TARGET) |