diff options
-rw-r--r-- | i18npool/inc/indexentrysupplier.hxx | 33 | ||||
-rw-r--r-- | i18npool/prj/build.lst | 3 | ||||
-rw-r--r-- | i18npool/source/indexentry/indexentrysupplier.cxx | 178 | ||||
-rw-r--r-- | i18npool/source/indexentry/makefile.mk | 58 | ||||
-rw-r--r-- | i18npool/source/localedata/makefile.mk | 7 | ||||
-rw-r--r-- | i18npool/source/registerservices/registerservices.cxx | 58 | ||||
-rw-r--r-- | i18npool/util/makefile.mk | 7 |
7 files changed, 320 insertions, 24 deletions
diff --git a/i18npool/inc/indexentrysupplier.hxx b/i18npool/inc/indexentrysupplier.hxx index 1a72dc2ac524..89e423788c43 100644 --- a/i18npool/inc/indexentrysupplier.hxx +++ b/i18npool/inc/indexentrysupplier.hxx @@ -2,9 +2,9 @@ * * $RCSfile: indexentrysupplier.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: er $ $Date: 2001-11-12 16:12:06 $ + * last change: $Author: bustamam $ $Date: 2001-12-14 16:26:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,7 +77,7 @@ #endif // ---------------------------------------------------- -// class BreakIterator +// class IndexEntrySupplier // ---------------------------------------------------- class IndexEntrySupplier : public cppu::WeakImplHelper2 < @@ -85,26 +85,31 @@ class IndexEntrySupplier : public cppu::WeakImplHelper2 ::com::sun::star::lang::XServiceInfo > { - ::com::sun::star::uno::Reference < - ::com::sun::star::lang::XMultiServiceFactory > xMSF; - ::com::sun::star::uno::Reference < - ::com::sun::star::i18n::XCharacterClassification > xCC; + ::rtl::OUString aServiceName; + ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory > xMSF; + ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XIndexEntrySupplier > xIES; + +protected: + sal_Char *implementationName; public: IndexEntrySupplier( const ::com::sun::star::uno::Reference < - ::com::sun::star::lang::XMultiServiceFactory >& rxMSF ); - virtual ~IndexEntrySupplier(); + ::com::sun::star::lang::XMultiServiceFactory >& rxMSF ) + : xMSF( rxMSF ) { + implementationName = "com.sun.star.i18n.IndexEntrySupplier"; + }; + ~IndexEntrySupplier() {}; // Methods virtual ::rtl::OUString SAL_CALL getIndexCharacter( const ::rtl::OUString& IndexEntry, - const ::com::sun::star::lang::Locale& aLocale, - const ::rtl::OUString& SortAlgorithm ) - throw (::com::sun::star::uno::RuntimeException); + const ::com::sun::star::lang::Locale& aLocale, + const ::rtl::OUString& SortAlgorithm ) + throw (::com::sun::star::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL getIndexFollowPageWord( sal_Bool MorePages, - const ::com::sun::star::lang::Locale& aLocale ) - throw (::com::sun::star::uno::RuntimeException); + const ::com::sun::star::lang::Locale& aLocale ) + throw (::com::sun::star::uno::RuntimeException); //XServiceInfo virtual rtl::OUString SAL_CALL getImplementationName(void) diff --git a/i18npool/prj/build.lst b/i18npool/prj/build.lst index 70f4f9c1edc8..de4a36a6f88b 100644 --- a/i18npool/prj/build.lst +++ b/i18npool/prj/build.lst @@ -8,4 +8,5 @@ inp i18npool\source\localedata_CJK nmake - all inp_locdata_cjk inp i18npool\source\numberformatcode nmake - all inp_numformat inp_utypes NULL inp i18npool\source\xmlparser nmake - all inp_xmlparser inp_utypes NULL inp i18npool\source\defaultnumberingprovider nmake - all inp_dnum inp_utypes NULL -inp i18npool\util nmake - all inp_util inp_dnum inp_localedata inp_locdata_ascii inp_locdata_cjk inp_numformat inp_rserv inp_xmlparser NULL +inp i18npool\source\indexentry nmake - all inp_index inp_utypes NULL +inp i18npool\util nmake - all inp_util inp_dnum inp_localedata inp_locdata_ascii inp_locdata_cjk inp_numformat inp_rserv inp_xmlparser inp_index NULL diff --git a/i18npool/source/indexentry/indexentrysupplier.cxx b/i18npool/source/indexentry/indexentrysupplier.cxx new file mode 100644 index 000000000000..77f1343f615a --- /dev/null +++ b/i18npool/source/indexentry/indexentrysupplier.cxx @@ -0,0 +1,178 @@ +/************************************************************************* + * + * $RCSfile: indexentrysupplier.cxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: bustamam $ $Date: 2001-12-14 16:26:09 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#define I18N_CHARACTERCLASSIFICATION_USES_CLASS_INTERNATIONAL + +#ifndef _STRING_HXX +#include <tools/string.hxx> +#endif +#ifndef _TOOLS_INTN_HXX +#include <tools/intn.hxx> +#endif +#ifndef _ISOLANG_HXX +#include <tools/isolang.hxx> +#endif +#ifndef _I18N_INDEXENTRYSUPPLIER_HXX_ +#include <indexentrysupplier.hxx> +#endif + +using namespace ::com::sun::star::i18n; + + +::rtl::OUString SAL_CALL IndexEntrySupplier::getIndexCharacter( + const ::rtl::OUString& rIndexEntry, + const ::com::sun::star::lang::Locale& rLocale, + const ::rtl::OUString& rSortAlgorithm ) + throw (::com::sun::star::uno::RuntimeException) +{ + ::rtl::OUString aRet; + ::rtl::OUString rServiceName(::rtl::OUString::createFromAscii( "com.sun.star.i18n.")); + + if ( rLocale.Language.getLength() ) { + ::rtl::OUString underScore( ::rtl::OUString::createFromAscii("_") ); + rServiceName += rLocale.Language; + if ( rLocale.Country.getLength() ) + rServiceName += underScore + rLocale.Country; + if ( rLocale.Variant.getLength() ) + rServiceName += underScore + rLocale.Variant; + if ( rSortAlgorithm.getLength() ) + rServiceName += underScore + rSortAlgorithm; + rServiceName += underScore; + } + rServiceName += ::rtl::OUString::createFromAscii("IndexEntrySupplier"); + + if ( (!rServiceName.equals(aServiceName) || (!xIES.is())) && xMSF.is() ) { + + aServiceName = rServiceName; + + if ( aServiceName.compareToAscii( implementationName ) != 0 ) { + + ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface > + xI = xMSF->createInstance( aServiceName ); + if( xI.is() ) { + ::com::sun::star::uno::Any x = xI->queryInterface( ::getCppuType((const ::com::sun::star::uno::Reference< + ::com::sun::star::i18n::XIndexEntrySupplier>*)0) ); + x >>= xIES; + } else if ( xIES.is() ) + xIES.clear(); + } else if ( xIES.is() ) + xIES.clear(); + } + + if( xIES.is() ) + aRet = xIES->getIndexCharacter( rIndexEntry, rLocale, rSortAlgorithm ); + else if( rIndexEntry.getLength() ) + aRet = ::rtl::OUString( rIndexEntry.getStr(), 1 ); + return aRet; +} + +::rtl::OUString SAL_CALL IndexEntrySupplier::getIndexFollowPageWord( + sal_Bool bMorePages, + const ::com::sun::star::lang::Locale& rLocale ) + throw (::com::sun::star::uno::RuntimeException) +{ + static const struct { + const sal_Char *pLang, *pFollowPage, *pFollowPages; + } aFollowPageArr[] = { + { "en", "p.", "pp" }, + { "de", "f.", "ff." }, + { "es", "seg.", "segs." }, + { "it", "seg.", "segg." }, + { "fr", "suivante", "suivantes" }, + { "zh", "", "" }, + { 0, 0, 0 } + }; + + int n; + for( n = 0; aFollowPageArr[ n ].pLang; ++n ) + if( 0 == rLocale.Language.compareToAscii( aFollowPageArr[ n ].pLang )) + break; + + if( !aFollowPageArr[ n ].pLang ) + n = 0; //the default for unknow languages + + return ::rtl::OUString::createFromAscii( bMorePages + ? aFollowPageArr[ n ].pFollowPages + : aFollowPageArr[ n ].pFollowPage ); +} + +::rtl::OUString SAL_CALL +IndexEntrySupplier::getImplementationName(void) + throw( ::com::sun::star::uno::RuntimeException ) +{ + return ::rtl::OUString::createFromAscii( implementationName ); +} + +sal_Bool SAL_CALL +IndexEntrySupplier::supportsService(const rtl::OUString& rServiceName) + throw( ::com::sun::star::uno::RuntimeException ) +{ + return rServiceName.compareToAscii(implementationName) == 0; +} + +::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL +IndexEntrySupplier::getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ) +{ + ::com::sun::star::uno::Sequence< ::rtl::OUString > aRet(1); + aRet[0] = ::rtl::OUString::createFromAscii( implementationName ); + return aRet; +} + diff --git a/i18npool/source/indexentry/makefile.mk b/i18npool/source/indexentry/makefile.mk new file mode 100644 index 000000000000..266cd7d744f9 --- /dev/null +++ b/i18npool/source/indexentry/makefile.mk @@ -0,0 +1,58 @@ +#************************************************************************* +#* +#* $RCSfile: makefile.mk,v $ +#* +#* makefile +#* +#* Erstellung MT 25.6.98 +#* +#* Letzte Aenderung $Author: bustamam $ $Date: 2001-12-14 16:26:09 $ +#* +#* $Revision: 1.1 $ +#* +#* $Source: /zpool/svn/migration/cvs_rep_09_09_08/code/i18npool/source/indexentry/makefile.mk,v $ +#* +#* Copyright (c) 1998, Star Division Corp. +#* +#************************************************************************* + +PRJ=..$/.. + + +PRJNAME=i18n +TARGET=indexentry + +ENABLE_EXCEPTIONS=TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + + +# --- Files -------------------------------------------------------- + +SLOFILES= \ + $(SLO)$/indexentrysupplier.obj \ + $(SLO)$/indexentrysupplier_CJK.obj \ + $(SLO)$/indexentrysupplier_zh_CN_pinyin.obj \ + $(SLO)$/indexentrysupplier_zh_CN_stroke.obj \ + $(SLO)$/indexentrysupplier_zh_CN_radical.obj \ + $(SLO)$/indexentrysupplier_zh_TW_zhuyin.obj \ + $(SLO)$/indexentrysupplier_zh_TW_radical.obj \ + $(SLO)$/indexentrysupplier_zh_TW_stroke.obj \ + $(SLO)$/indexentrysupplier_ko_KR_dict.obj \ + $(SLO)$/indexentrysupplier_Euro.obj \ + $(SLO)$/indexentrysupplier_en_US_alphanumeric.obj \ + $(SLO)$/indexentrysupplier_it_IT_alphanumeric.obj \ + $(SLO)$/indexentrysupplier_sv_SE_alphanumeric.obj \ + $(SLO)$/indexentrysupplier_en_AU_alphanumeric.obj \ + $(SLO)$/indexentrysupplier_da_DK_alphanumeric.obj \ + $(SLO)$/indexentrysupplier_fi_FI_alphanumeric.obj \ + $(SLO)$/indexentrysupplier_is_IS_alphanumeric.obj \ + $(SLO)$/indexentrysupplier_nl_BE_alphanumeric.obj \ + $(SLO)$/indexentrysupplier_no_NO_alphanumeric.obj + + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk diff --git a/i18npool/source/localedata/makefile.mk b/i18npool/source/localedata/makefile.mk index 9c2b2a27fb30..585736a13de7 100644 --- a/i18npool/source/localedata/makefile.mk +++ b/i18npool/source/localedata/makefile.mk @@ -2,9 +2,9 @@ #* #* $RCSfile: makefile.mk,v $ #* -#* $Revision: 1.2 $ +#* $Revision: 1.3 $ #* -#* last change: $Author: bustamam $ $Date: 2001-09-16 15:23:00 $ +#* last change: $Author: bustamam $ $Date: 2001-12-14 16:26:11 $ #* #* The Contents of this file are made available subject to the terms of #* either of the following licenses @@ -75,8 +75,7 @@ ENABLE_EXCEPTIONS=TRUE # --- Files -------------------------------------------------------- SLOFILES= \ - $(SLO)$/localedata.obj \ - $(SLO)$/indexentrysupplier.obj + $(SLO)$/localedata.obj # --- Targets ------------------------------------------------------ diff --git a/i18npool/source/registerservices/registerservices.cxx b/i18npool/source/registerservices/registerservices.cxx index 5c31611dd1b5..48abc15f34c8 100644 --- a/i18npool/source/registerservices/registerservices.cxx +++ b/i18npool/source/registerservices/registerservices.cxx @@ -2,9 +2,9 @@ * * $RCSfile: registerservices.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: bustamam $ $Date: 2001-09-16 15:23:00 $ + * last change: $Author: bustamam $ $Date: 2001-12-14 16:26:11 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -82,6 +82,8 @@ #include <numberformatcode.hxx> #include <defaultnumberingprovider.hxx> #include <indexentrysupplier.hxx> +#include <indexentrysupplier_CJK.hxx> +#include <indexentrysupplier_Euro.hxx> #define IMPL_CREATEINSTANCE( ImplName ) \ @@ -119,6 +121,13 @@ IMPL_CREATEINSTANCE_MSF( NumberFormatCodeMapper ) IMPL_CREATEINSTANCE( LocaleData ) IMPL_CREATEINSTANCE_MSF( DefaultNumberingProvider ) IMPL_CREATEINSTANCE_MSF( IndexEntrySupplier ) +IMPL_CREATEINSTANCE_MSF( IndexEntrySupplier_zh_CN_pinyin ) +IMPL_CREATEINSTANCE_MSF( IndexEntrySupplier_zh_CN_radical ) +IMPL_CREATEINSTANCE_MSF( IndexEntrySupplier_zh_CN_stroke ) +IMPL_CREATEINSTANCE_MSF( IndexEntrySupplier_zh_TW_zhuyin ) +IMPL_CREATEINSTANCE_MSF( IndexEntrySupplier_zh_TW_radical ) +IMPL_CREATEINSTANCE_MSF( IndexEntrySupplier_zh_TW_stroke ) +IMPL_CREATEINSTANCE_MSF( IndexEntrySupplier_ko_KR_dict ) static const struct InstancesArray { const sal_Char* pServiceNm; @@ -137,6 +146,51 @@ static const struct InstancesArray { { "com.sun.star.i18n.IndexEntrySupplier", "com.sun.star.i18n.IndexEntrySupplier", &IndexEntrySupplier_CreateInstance }, + { "com.sun.star.i18n.IndexEntrySupplier_zh_CN_pinyin", + "com.sun.star.i18n.zh_CN_pinyin_IndexEntrySupplier", + &IndexEntrySupplier_zh_CN_pinyin_CreateInstance }, + { "com.sun.star.i18n.IndexEntrySupplier_zh_CN_radical", + "com.sun.star.i18n.zh_CN_radical_IndexEntrySupplier", + &IndexEntrySupplier_zh_CN_radical_CreateInstance }, + { "com.sun.star.i18n.IndexEntrySupplier_zh_CN_stroke", + "com.sun.star.i18n.zh_CN_stroke_IndexEntrySupplier", + &IndexEntrySupplier_zh_CN_stroke_CreateInstance }, + { "com.sun.star.i18n.IndexEntrySupplier_zh_CN_pinyin", + "com.sun.star.i18n.zh_SG_pinyin_IndexEntrySupplier", + &IndexEntrySupplier_zh_CN_pinyin_CreateInstance }, + { "com.sun.star.i18n.IndexEntrySupplier_zh_CN_radical", + "com.sun.star.i18n.zh_SG_radical_IndexEntrySupplier", + &IndexEntrySupplier_zh_CN_radical_CreateInstance }, + { "com.sun.star.i18n.IndexEntrySupplier_zh_CN_stroke", + "com.sun.star.i18n.zh_SG_stroke_IndexEntrySupplier", + &IndexEntrySupplier_zh_CN_stroke_CreateInstance }, + { "com.sun.star.i18n.IndexEntrySupplier_zh_TW_radical", + "com.sun.star.i18n.zh_HK_radical_IndexEntrySupplier", + &IndexEntrySupplier_zh_TW_radical_CreateInstance }, + { "com.sun.star.i18n.IndexEntrySupplier_zh_TW_stroke", + "com.sun.star.i18n.zh_HK_stroke_IndexEntrySupplier", + &IndexEntrySupplier_zh_TW_stroke_CreateInstance }, + { "com.sun.star.i18n.IndexEntrySupplier_zh_TW_radical", + "com.sun.star.i18n.zh_MO_radical_IndexEntrySupplier", + &IndexEntrySupplier_zh_TW_radical_CreateInstance }, + { "com.sun.star.i18n.IndexEntrySupplier_zh_TW_stroke", + "com.sun.star.i18n.zh_MO_stroke_IndexEntrySupplier", + &IndexEntrySupplier_zh_TW_stroke_CreateInstance }, + { "com.sun.star.i18n.IndexEntrySupplier_zh_TW_zhuyin", + "com.sun.star.i18n.zh_TW_zhuyin_IndexEntrySupplier", + &IndexEntrySupplier_zh_TW_zhuyin_CreateInstance }, + { "com.sun.star.i18n.IndexEntrySupplier_zh_CN_pinyin", + "com.sun.star.i18n.zh_TW_pinyin_IndexEntrySupplier", + &IndexEntrySupplier_zh_CN_pinyin_CreateInstance }, + { "com.sun.star.i18n.IndexEntrySupplier_zh_TW_radical", + "com.sun.star.i18n.zh_TW_radical_IndexEntrySupplier", + &IndexEntrySupplier_zh_TW_radical_CreateInstance }, + { "com.sun.star.i18n.IndexEntrySupplier_zh_TW_stroke", + "com.sun.star.i18n.zh_TW_stroke_IndexEntrySupplier", + &IndexEntrySupplier_zh_TW_stroke_CreateInstance }, + { "com.sun.star.i18n.IndexEntrySupplier_ko_KR_dict", + "com.sun.star.i18n.ko_KR_dict_IndexEntrySupplier", + &IndexEntrySupplier_ko_KR_dict_CreateInstance }, // add here new services !! { 0, 0, 0 } diff --git a/i18npool/util/makefile.mk b/i18npool/util/makefile.mk index 865552f93dcb..9285ad413966 100644 --- a/i18npool/util/makefile.mk +++ b/i18npool/util/makefile.mk @@ -2,9 +2,9 @@ #* #* $RCSfile: makefile.mk,v $ #* -#* $Revision: 1.4 $ +#* $Revision: 1.5 $ #* -#* last change: $Author: er $ $Date: 2001-11-23 15:00:27 $ +#* last change: $Author: bustamam $ $Date: 2001-12-14 16:26:11 $ #* #* The Contents of this file are made available subject to the terms of #* either of the following licenses @@ -97,7 +97,8 @@ LIB3TARGET= $(SLB)$/$(TARGET).lib LIB3FILES= $(SLB)$/defaultnumberingprovider.lib \ $(SLB)$/registerservices.lib \ $(SLB)$/numberformatcode.lib \ - $(SLB)$/localedata.lib + $(SLB)$/localedata.lib \ + $(SLB)$/indexentry.lib SHL3TARGET= $(TARGET)$(VERSION)$(DLLPOSTFIX) SHL3IMPLIB= i$(TARGET) |