Kaydet (Commit) 796818d7 authored tarafından Caolán McNamara's avatar Caolán McNamara

tweak build

üst 0f691cc6
#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;
......
/* -*- 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: */
......@@ -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
......
#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;
......
#include "HelpIndexer.hxx"
#include <l10ntools/HelpIndexer.hxx>
#include <string>
#include <iostream>
......
......@@ -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)
......@@ -51,19 +53,15 @@ CFLAGS+=-DSYSTEM_EXPAT
.ENDIF
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)
......
......@@ -41,7 +41,7 @@
// EDIT FROM HERE
#include <HelpIndexer.hxx>
#include <l10ntools/HelpIndexer.hxx>
// EDIT ENDS HERE
......
......@@ -67,8 +67,6 @@ LIBXSLTINCDIR=external$/libxslt
CFLAGS+= -I$(SOLARINCDIR)$/$(LIBXSLTINCDIR)
.ENDIF
CFLAGS+= -I$(SRC_ROOT)$/l10ntools$/source$/help
PKGCONFIG_MODULES=libclucene-core libclucene-contribs-lib
.INCLUDE : pkg_config.mk
......
......@@ -58,6 +58,7 @@ SHL1STDLIBS= \
$(CPPUHELPERLIB) \
$(CPPULIB) \
$(COMPHELPERLIB) \
$(HELPLINKERLIB) \
$(SALLIB) \
$(EXPATASCII3RDLIB) \
$(UNOTOOLSLIB) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment