Kaydet (Commit) 8f6321b7 authored tarafından Caolán McNamara's avatar Caolán McNamara

use different OUString ctor for RTL_TEXTENCODING_UCS4

üst c4e35968
...@@ -46,6 +46,7 @@ $(eval $(call gb_CustomTarget_add_outdir_dependencies,clucene/source,\ ...@@ -46,6 +46,7 @@ $(eval $(call gb_CustomTarget_add_outdir_dependencies,clucene/source,\
$(FIXED_TARFILE_LOCATION)/48d647fbd8ef8889e5a7f422c1bfda94-clucene-core-2.3.3.4.tar.gz \ $(FIXED_TARFILE_LOCATION)/48d647fbd8ef8889e5a7f422c1bfda94-clucene-core-2.3.3.4.tar.gz \
)) ))
$(eval $(call gb_Package_add_file,clucene_source,inc/CLucene/clucene-config.h,src/shared/CLucene/clucene-config.h))
$(eval $(call gb_Package_add_file,clucene_source,inc/CLucene/SharedHeader.h,src/shared/CLucene/SharedHeader.h)) $(eval $(call gb_Package_add_file,clucene_source,inc/CLucene/SharedHeader.h,src/shared/CLucene/SharedHeader.h))
$(eval $(call gb_Package_add_file,clucene_source,inc/CLucene/index/DirectoryIndexReader.h,src/core/CLucene/index/DirectoryIndexReader.h)) $(eval $(call gb_Package_add_file,clucene_source,inc/CLucene/index/DirectoryIndexReader.h,src/core/CLucene/index/DirectoryIndexReader.h))
$(eval $(call gb_Package_add_file,clucene_source,inc/CLucene/index/Terms.h,src/core/CLucene/index/Terms.h)) $(eval $(call gb_Package_add_file,clucene_source,inc/CLucene/index/Terms.h,src/core/CLucene/index/Terms.h))
......
...@@ -1110,6 +1110,10 @@ AC_ARG_WITH(system-jpeg, ...@@ -1110,6 +1110,10 @@ AC_ARG_WITH(system-jpeg,
with_system_jpeg="$with_system_libs" with_system_jpeg="$with_system_libs"
fi]) fi])
AC_ARG_WITH(system-clucene,
AS_HELP_STRING([--with-system-clucene],
[Use clucene already on system.]),,)
AC_ARG_WITH(system-expat, AC_ARG_WITH(system-expat,
AS_HELP_STRING([--with-system-expat], AS_HELP_STRING([--with-system-expat],
[Use expat already on system.]),, [Use expat already on system.]),,
...@@ -5625,6 +5629,36 @@ else ...@@ -5625,6 +5629,36 @@ else
fi fi
AC_SUBST(SYSTEM_JPEG) AC_SUBST(SYSTEM_JPEG)
dnl ===================================================================
dnl Check for system clucene
dnl ===================================================================
AC_MSG_CHECKING([which clucene to use])
if test "$with_system_clucene" = "yes"; then
AC_MSG_RESULT([external])
SYSTEM_CLUCENE=YES
PKG_CHECK_MODULES(LIBCLUCENE, libclucene-core)
AC_LANG_PUSH([C++])
save_CXXFLAGS=$CXXFLAGS
save_CPPFLAGS=$CPPFLAGS
CXXFLAGS="$CXXFLAGS $LIBCLUCENE_CFLAGS"
CPPFLAGS="$CPPFLAGS $LIBCLUCENE_CFLAGS"
AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
[AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [])
CXXFLAGS=$save_CXXFLAGS
CPPFLAGS=$save_CPPFLAGS
AC_LANG_POP([C++])
LIBCLUCENE_LIBS="$LIBCLUCENE_LIBS -lclucene-contribs-lib"
else
AC_MSG_RESULT([internal])
SYSTEM_CLUCENE=NO
BUILD_TYPE="$BUILD_TYPE CLUCENE"
fi
AC_SUBST(SYSTEM_CLUCENE)
AC_SUBST(LIBCLUCENE_CFLAGS)
AC_SUBST(LIBCLUCENE_LIBS)
dnl =================================================================== dnl ===================================================================
dnl Check for system expat dnl Check for system expat
dnl =================================================================== dnl ===================================================================
......
tr l10ntools : BERKELEYDB:berkeleydb EXPAT:expat LIBXSLT:libxslt sal NULL tr l10ntools : BERKELEYDB:berkeleydb EXPAT:expat LIBXSLT:libxslt CLUCENE:clucene sal NULL
tr l10ntools usr1 - all tr_mkout NULL tr l10ntools usr1 - all tr_mkout NULL
tr l10ntools\inc nmake - all tr_inc NULL tr l10ntools\inc nmake - all tr_inc NULL
tr l10ntools\source nmake - all tr_src tr_inc NULL tr l10ntools\source nmake - all tr_src tr_inc NULL
......
...@@ -8,26 +8,21 @@ std::vector<TCHAR> OUStringToTCHARVec(rtl::OUString const &rStr) ...@@ -8,26 +8,21 @@ std::vector<TCHAR> OUStringToTCHARVec(rtl::OUString const &rStr)
//UTF-32 //UTF-32
std::vector<TCHAR> aRet; std::vector<TCHAR> aRet;
for (sal_Int32 nStrIndex = 0; nStrIndex < rStr.getLength() + 1; ) for (sal_Int32 nStrIndex = 0; nStrIndex < rStr.getLength(); )
{ {
const sal_uInt32 nCode = rStr.iterateCodePoints(&nStrIndex); const sal_uInt32 nCode = rStr.iterateCodePoints(&nStrIndex);
aRet.push_back(nCode); aRet.push_back(nCode);
} }
aRet.push_back(0);
return aRet; return aRet;
} }
inline unsigned tstrlen(TCHAR const *str) {
unsigned i;
for (i = 0; str[i] != 0; ++i) {}
return i;
}
rtl::OUString TCHARArrayToOUString(TCHAR const *str) rtl::OUString TCHARArrayToOUString(TCHAR const *str)
{ {
// UTF-16 // UTF-16
if (sizeof(TCHAR) == sizeof(sal_Unicode)) if (sizeof(TCHAR) == sizeof(sal_Unicode))
return rtl::OUString((sal_Unicode*) str); return rtl::OUString((const sal_Unicode*)(str));
// UTF-32 // UTF-32
return rtl::OUString((char*) str, tstrlen(str), RTL_TEXTENCODING_UCS4); return ::OUString((const sal_uInt32*)str, wcslen(str));
} }
...@@ -77,9 +77,6 @@ NOOPTFILES=\ ...@@ -77,9 +77,6 @@ NOOPTFILES=\
$(SLO)$/HelpLinker.obj $(SLO)$/HelpLinker.obj
.ENDIF .ENDIF
PKGCONFIG_MODULES=libclucene-core libclucene-contribs-lib
.INCLUDE : pkg_config.mk
APP1TARGET= $(TARGET) APP1TARGET= $(TARGET)
APP1OBJS=\ APP1OBJS=\
$(OBJ)$/HelpLinker.obj \ $(OBJ)$/HelpLinker.obj \
...@@ -93,7 +90,7 @@ APP2OBJS=\ ...@@ -93,7 +90,7 @@ APP2OBJS=\
$(OBJ)$/HelpIndexer.obj \ $(OBJ)$/HelpIndexer.obj \
$(OBJ)$/HelpIndexer_main.obj $(OBJ)$/HelpIndexer_main.obj
APP2RPATH = NONE APP2RPATH = NONE
APP2STDLIBS+=$(SALLIB) $(PKGCONFIG_LIBS) APP2STDLIBS+=$(SALLIB) $(CLUCENELIB)
SHL1TARGET =$(LIBBASENAME)$(DLLPOSTFIX) SHL1TARGET =$(LIBBASENAME)$(DLLPOSTFIX)
SHL1LIBS= $(SLB)$/$(TARGET).lib SHL1LIBS= $(SLB)$/$(TARGET).lib
...@@ -103,7 +100,7 @@ SHL1IMPLIB =i$(LIBBASENAME) ...@@ -103,7 +100,7 @@ SHL1IMPLIB =i$(LIBBASENAME)
SHL1IMPLIB =$(LIBBASENAME)$(DLLPOSTFIX) SHL1IMPLIB =$(LIBBASENAME)$(DLLPOSTFIX)
.ENDIF .ENDIF
SHL1DEF =$(MISC)$/$(SHL1TARGET).def SHL1DEF =$(MISC)$/$(SHL1TARGET).def
SHL1STDLIBS =$(SALLIB) $(BERKELEYLIB) $(XSLTLIB) $(EXPATASCII3RDLIB) $(PKGCONFIG_LIBS) SHL1STDLIBS =$(SALLIB) $(BERKELEYLIB) $(XSLTLIB) $(EXPATASCII3RDLIB) $(CLUCENELIB)
SHL1USE_EXPORTS =ordinal SHL1USE_EXPORTS =ordinal
DEF1NAME =$(SHL1TARGET) DEF1NAME =$(SHL1TARGET)
......
...@@ -76,6 +76,19 @@ File gid_File_Lib_Cached1 ...@@ -76,6 +76,19 @@ File gid_File_Lib_Cached1
#endif #endif
End End
#ifndef SYSTEM_CLUCENE
File gid_File_Lib_CLucene
LIB_FILE_BODY;
Styles = (PACKED);
Dir = SCP2_OOO_BIN_DIR;
#ifdef UNX
Name = STRING(CONCAT2(libclucene,UNXSUFFIX));
#else
Name = "clucene.dll";
#endif
End
#endif
SPECIAL_COMPONENT_LIB_FILE(gid_File_Lib_Configmgr, configmgr.uno) SPECIAL_COMPONENT_LIB_FILE(gid_File_Lib_Configmgr, configmgr.uno)
#ifdef WITH_LDAP #ifdef WITH_LDAP
......
...@@ -101,6 +101,10 @@ SCPDEFS+=-DENABLE_CAIROCANVAS ...@@ -101,6 +101,10 @@ SCPDEFS+=-DENABLE_CAIROCANVAS
.ENDIF .ENDIF
.ENDIF .ENDIF
.IF "$(SYSTEM_LUCENE)" == "YES"
SCPDEFS+=-DSYSTEM_LUCENE
.ENDIF
.IF "$(SYSTEM_EXPAT)" == "YES" .IF "$(SYSTEM_EXPAT)" == "YES"
SCPDEFS+=-DSYSTEM_EXPAT SCPDEFS+=-DSYSTEM_EXPAT
.ENDIF .ENDIF
......
...@@ -337,6 +337,9 @@ Module gid_Module_Root_Files_5 ...@@ -337,6 +337,9 @@ Module gid_Module_Root_Files_5
gid_File_Lib_Stringresource, gid_File_Lib_Stringresource,
gid_File_Lib_Ldapbe2, gid_File_Lib_Ldapbe2,
gid_File_Lib_Cached1, gid_File_Lib_Cached1,
#if ! defined SYSTEM_CLUCENE
gid_File_Lib_CLucene,
#endif
gid_File_Lib_CLuceneHelpWrapper, gid_File_Lib_CLuceneHelpWrapper,
gid_File_Lib_Comphelper2, gid_File_Lib_Comphelper2,
gid_File_Lib_Curl, gid_File_Lib_Curl,
......
...@@ -182,6 +182,11 @@ HM2LIBSH=-lhmwrpdll ...@@ -182,6 +182,11 @@ HM2LIBSH=-lhmwrpdll
HM2LIBST=-lhmwrap HM2LIBST=-lhmwrap
LINGULIB=$(HM2LIBST) LINGULIB=$(HM2LIBST)
LNGLIB=-llng$(DLLPOSTFIX) LNGLIB=-llng$(DLLPOSTFIX)
.IF "$(SYSTEM_CLUCENE)"=="YES"
CLUCENELIB=$(LIBCLUCENE_LIBS)
.ELSE
CLUCENELIB=-lclucene
.ENDIF
.IF "$(SYSTEM_EXPAT)"=="YES" .IF "$(SYSTEM_EXPAT)"=="YES"
EXPAT3RDLIB=-lexpat EXPAT3RDLIB=-lexpat
EXPATASCII3RDLIB=-lexpat EXPATASCII3RDLIB=-lexpat
...@@ -453,6 +458,7 @@ HM2LIBSH=hmwrpdll.lib ...@@ -453,6 +458,7 @@ HM2LIBSH=hmwrpdll.lib
HM2LIBST=hmwrap.lib HM2LIBST=hmwrap.lib
LINGULIB=$(HM2LIBST) LINGULIB=$(HM2LIBST)
LNGLIB=ilng.lib LNGLIB=ilng.lib
CLUCENELIB=clucene.lib
EXPAT3RDLIB=expat_xmltok.lib expat_xmlparse.lib EXPAT3RDLIB=expat_xmltok.lib expat_xmlparse.lib
EXPATASCII3RDLIB=expat_xmltok.lib ascii_expat_xmlparse.lib EXPATASCII3RDLIB=expat_xmltok.lib ascii_expat_xmlparse.lib
ZLIB3RDLIB=zlib.lib ZLIB3RDLIB=zlib.lib
......
...@@ -67,9 +67,6 @@ LIBXSLTINCDIR=external$/libxslt ...@@ -67,9 +67,6 @@ LIBXSLTINCDIR=external$/libxslt
CFLAGS+= -I$(SOLARINCDIR)$/$(LIBXSLTINCDIR) CFLAGS+= -I$(SOLARINCDIR)$/$(LIBXSLTINCDIR)
.ENDIF .ENDIF
PKGCONFIG_MODULES=libclucene-core libclucene-contribs-lib
.INCLUDE : pkg_config.mk
.IF "$(GUI)"=="WNT" .IF "$(GUI)"=="WNT"
.IF "$(COM)"=="MSC" .IF "$(COM)"=="MSC"
CFLAGS+=-GR CFLAGS+=-GR
......
...@@ -61,7 +61,7 @@ public: ...@@ -61,7 +61,7 @@ public:
} }
virtual Any SAL_CALL invoke(const OUString& FunctionName, const Sequence< Any >& Params, Sequence< sal_Int16 >& OutParamIndex, Sequence< Any >& OutParam) virtual Any SAL_CALL invoke(const OUString& FunctionName, const Sequence< Any >& Params, Sequence< sal_Int16 >& OutParamIndex, Sequence< Any >& OutParam)
throw( IllegalArgumentException, CannotConvertException, InvocationTargetException, RuntimeException ); throw( IllegalArgumentException, CannotConvertException, InvocationTargetException, RuntimeException );
virtual void SAL_CALL setValue(const OUString& PropertyName, const Any& Value) virtual void SAL_CALL setValue(const OUString&, const Any&)
throw( UnknownPropertyException, CannotConvertException, InvocationTargetException, RuntimeException ) throw( UnknownPropertyException, CannotConvertException, InvocationTargetException, RuntimeException )
{ {
throw UnknownPropertyException(); throw UnknownPropertyException();
...@@ -83,7 +83,7 @@ public: ...@@ -83,7 +83,7 @@ public:
#include <stdio.h> // FIXME: remove once the fprintf() calls below are gone #include <stdio.h> // FIXME: remove once the fprintf() calls below are gone
Any CLuceneHelpWrapper::invoke(const OUString& rFunctionName, const Sequence< Any >& Params, Sequence< sal_Int16 >& OutParamIndex, Sequence< Any >& OutParam) Any CLuceneHelpWrapper::invoke(const OUString& rFunctionName, const Sequence< Any >&, Sequence< sal_Int16 >&, Sequence< Any >& )
throw( IllegalArgumentException, CannotConvertException, InvocationTargetException, RuntimeException ) throw( IllegalArgumentException, CannotConvertException, InvocationTargetException, RuntimeException )
{ {
fprintf(stderr, "invoke something or other, %s\n", rtl::OUStringToOString(rFunctionName, RTL_TEXTENCODING_UTF8).getStr()); fprintf(stderr, "invoke something or other, %s\n", rtl::OUStringToOString(rFunctionName, RTL_TEXTENCODING_UTF8).getStr());
...@@ -93,6 +93,7 @@ Any CLuceneHelpWrapper::invoke(const OUString& rFunctionName, const Sequence< An ...@@ -93,6 +93,7 @@ Any CLuceneHelpWrapper::invoke(const OUString& rFunctionName, const Sequence< An
fprintf(stderr, "implement me, do indexing thing for extensions with help, but without pre-created index, make need to split l10ntools HelpIndexer tool into a lib and header that we can link to here"); fprintf(stderr, "implement me, do indexing thing for extensions with help, but without pre-created index, make need to split l10ntools HelpIndexer tool into a lib and header that we can link to here");
else else
throw IllegalArgumentException(); throw IllegalArgumentException();
return Any();
} }
namespace namespace
......
...@@ -37,9 +37,6 @@ ENABLE_EXCEPTIONS=TRUE ...@@ -37,9 +37,6 @@ ENABLE_EXCEPTIONS=TRUE
SLOFILES=\ SLOFILES=\
$(SLO)$/CLuceneHelpWrapper.obj $(SLO)$/CLuceneHelpWrapper.obj
PKGCONFIG_MODULES=libclucene-core
.INCLUDE : pkg_config.mk
LIB1TARGET=$(SLB)$/_$(TARGET).lib LIB1TARGET=$(SLB)$/_$(TARGET).lib
LIB1OBJFILES=$(SLOFILES) LIB1OBJFILES=$(SLOFILES)
...@@ -52,7 +49,7 @@ SHL1STDLIBS=\ ...@@ -52,7 +49,7 @@ SHL1STDLIBS=\
$(COMPHELPERLIB) \ $(COMPHELPERLIB) \
$(UNOTOOLSLIB) \ $(UNOTOOLSLIB) \
$(SALLIB) \ $(SALLIB) \
$(PKGCONFIG_LIBS) $(LIBCLUCENE_LIBS)
SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1VERSIONMAP=$(SOLARENV)/src/component.map
.INCLUDE : target.mk .INCLUDE : target.mk
......
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