diff options
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/inc/indexentryres.hxx | 20 | ||||
-rw-r--r-- | svtools/source/control/collatorres.cxx | 77 | ||||
-rw-r--r-- | svtools/source/control/ctrlbox.src | 63 | ||||
-rw-r--r-- | svtools/source/control/indexentryres.cxx | 105 | ||||
-rw-r--r-- | svtools/source/control/makefile.mk | 5 |
5 files changed, 213 insertions, 57 deletions
diff --git a/svtools/inc/indexentryres.hxx b/svtools/inc/indexentryres.hxx new file mode 100644 index 000000000000..6b3d63b5e565 --- /dev/null +++ b/svtools/inc/indexentryres.hxx @@ -0,0 +1,20 @@ + +#ifndef SVTOOLS_INDEXENTRYRESSOURCE_HXX +#define SVTOOLS_INDEXENTRYRESSOURCE_HXX + +class IndexEntryRessourceData; + +class IndexEntryRessource +{ + private: + IndexEntryRessourceData *mp_Data; + + public: + IndexEntryRessource (); + ~IndexEntryRessource (); + const String& GetTranslation (const String& r_Algorithm); +}; + +#endif /* SVTOOLS_INDEXENTRYRESSOURCE_HXX */ + + diff --git a/svtools/source/control/collatorres.cxx b/svtools/source/control/collatorres.cxx index 4e48e9277d79..7df098ad396a 100644 --- a/svtools/source/control/collatorres.cxx +++ b/svtools/source/control/collatorres.cxx @@ -15,38 +15,27 @@ class CollatorRessourceData { friend class CollatorRessource; - private: /* data */ - String ma_Name; String ma_Translation; - private: /* member functions */ - - CollatorRessourceData () - {} + CollatorRessourceData () {} public: - CollatorRessourceData ( - const String &r_Algorithm, const String &r_Translation) - : ma_Name (r_Algorithm), ma_Translation (r_Translation) - {} - - const String& GetAlgorithm () const - { return ma_Name; } - - const String& GetTranslation () const - { return ma_Translation; } - - ~CollatorRessourceData () - {} - - CollatorRessourceData& - operator= (const CollatorRessourceData& r_From) - { - ma_Name = r_From.GetAlgorithm(); - ma_Translation = r_From.GetTranslation(); - return *this; - } + CollatorRessourceData ( const String &r_Algorithm, const String &r_Translation) + : ma_Name (r_Algorithm), ma_Translation (r_Translation) {} + + const String& GetAlgorithm () const { return ma_Name; } + + const String& GetTranslation () const { return ma_Translation; } + + ~CollatorRessourceData () {} + + CollatorRessourceData& operator= (const CollatorRessourceData& r_From) + { + ma_Name = r_From.GetAlgorithm(); + ma_Translation = r_From.GetTranslation(); + return *this; + } }; // ------------------------------------------------------------------------- @@ -55,7 +44,7 @@ class CollatorRessourceData // // ------------------------------------------------------------------------- -#define COLLATOR_RESSOURCE_COUNT 10 +#define COLLATOR_RESSOURCE_COUNT (STR_SVT_COLLATE_END - STR_SVT_COLLATE_START + 1) CollatorRessource::CollatorRessource() { @@ -65,26 +54,18 @@ CollatorRessource::CollatorRessource() #define RESSTR(rid) String(SvtResId(rid)) - mp_Data[0] = CollatorRessourceData (ASCSTR("alphanumeric"), - RESSTR(STR_SVT_COLLATE_ALPHANUMERIC)); - mp_Data[1] = CollatorRessourceData (ASCSTR("charset"), - RESSTR(STR_SVT_COLLATE_CHARSET)); - mp_Data[2] = CollatorRessourceData (ASCSTR("dict"), - RESSTR(STR_SVT_COLLATE_DICTIONARY)); - mp_Data[3] = CollatorRessourceData (ASCSTR("normal"), - RESSTR(STR_SVT_COLLATE_NORMAL)); - mp_Data[4] = CollatorRessourceData (ASCSTR("pinyin"), - RESSTR(STR_SVT_COLLATE_PINYIN)); - mp_Data[5] = CollatorRessourceData (ASCSTR("radical"), - RESSTR(STR_SVT_COLLATE_RADICAL)); - mp_Data[6] = CollatorRessourceData (ASCSTR("stroke"), - RESSTR(STR_SVT_COLLATE_STROKE)); - mp_Data[7] = CollatorRessourceData (ASCSTR("unicode"), - RESSTR(STR_SVT_COLLATE_UNICODE)); - mp_Data[8] = CollatorRessourceData (ASCSTR("zhuyin"), - RESSTR(STR_SVT_COLLATE_ZHUYIN)); - mp_Data[9] = CollatorRessourceData (ASCSTR("phonebook"), - RESSTR(STR_SVT_COLLATE_PHONEBOOK)); + mp_Data[0] = CollatorRessourceData (ASCSTR("alphanumeric"), RESSTR(STR_SVT_COLLATE_ALPHANUMERIC)); + mp_Data[1] = CollatorRessourceData (ASCSTR("charset"), RESSTR(STR_SVT_COLLATE_CHARSET)); + mp_Data[2] = CollatorRessourceData (ASCSTR("dict"), RESSTR(STR_SVT_COLLATE_DICTIONARY)); + mp_Data[3] = CollatorRessourceData (ASCSTR("normal"), RESSTR(STR_SVT_COLLATE_NORMAL)); + mp_Data[4] = CollatorRessourceData (ASCSTR("pinyin"), RESSTR(STR_SVT_COLLATE_PINYIN)); + mp_Data[5] = CollatorRessourceData (ASCSTR("radical"), RESSTR(STR_SVT_COLLATE_RADICAL)); + mp_Data[6] = CollatorRessourceData (ASCSTR("stroke"), RESSTR(STR_SVT_COLLATE_STROKE)); + mp_Data[7] = CollatorRessourceData (ASCSTR("unicode"), RESSTR(STR_SVT_COLLATE_UNICODE)); + mp_Data[8] = CollatorRessourceData (ASCSTR("zhuyin"), RESSTR(STR_SVT_COLLATE_ZHUYIN)); + mp_Data[9] = CollatorRessourceData (ASCSTR("phonebook"), RESSTR(STR_SVT_COLLATE_PHONEBOOK)); + mp_Data[10] = CollatorRessourceData (ASCSTR("phonetic (alphanumeric first)"), RESSTR(STR_SVT_COLLATE_PHONETIC_F)); + mp_Data[11] = CollatorRessourceData (ASCSTR("phonetic (alphanumeric last)"), RESSTR(STR_SVT_COLLATE_PHONETIC_L)); } CollatorRessource::~CollatorRessource() diff --git a/svtools/source/control/ctrlbox.src b/svtools/source/control/ctrlbox.src index e1a67c290298..13c0070dc249 100644 --- a/svtools/source/control/ctrlbox.src +++ b/svtools/source/control/ctrlbox.src @@ -2,9 +2,9 @@ * * $RCSfile: ctrlbox.src,v $ * - * $Revision: 1.39 $ + * $Revision: 1.40 $ * - * last change: $Author: kz $ $Date: 2002-08-16 20:11:02 $ + * last change: $Author: fme $ $Date: 2002-08-23 08:42:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -409,20 +409,69 @@ String STR_SVT_COLLATE_PHONEBOOK Text[ arabic ] = "Phone book"; }; +String STR_SVT_COLLATE_PHONETIC_F +{ + Text = "Phonetic (alphanumeric first)"; +}; +String STR_SVT_COLLATE_PHONETIC_L +{ + Text = "Phonetic (alphanumeric last)"; +}; +String STR_SVT_INDEXENTRY_ALPHANUMERIC +{ + /* alphanumeric indexentry algorithm */ + Text = "Alphanumerisch" ; +}; +String STR_SVT_INDEXENTRY_DICTIONARY +{ + /* korean dictionary indexentry algorithm */ + Text = "Wrterbuch" ; +}; +String STR_SVT_INDEXENTRY_PINYIN +{ + /* chinese sorting algorithm */ + Text = "Pinyin" ; +}; +String STR_SVT_INDEXENTRY_RADICAL +{ + /* chinese indexentry algorithm */ + Text = "Radical" ; +}; +String STR_SVT_INDEXENTRY_STROKE +{ + /* chinese indexentry algorithm */ + Text = "Stroke" ; +}; +String STR_SVT_INDEXENTRY_ZHUYIN +{ + /* chinese indexentry algorithm */ + Text = "Zhuyin" ; +}; +String STR_SVT_INDEXENTRY_PHONETIC_FS +{ + Text = "Phonetic (alphanumeric first) (grouped by syllable)"; +}; +String STR_SVT_INDEXENTRY_PHONETIC_FC +{ + Text = "Phonetic (alphanumeric first) (grouped by consonant)"; +}; +String STR_SVT_INDEXENTRY_PHONETIC_LS +{ + Text = "Phonetic (alphanumeric last) (grouped by syllable)"; +}; - - - - - +String STR_SVT_INDEXENTRY_PHONETIC_LC +{ + Text = "Phonetic (alphanumeric last) (grouped by consonant)"; +}; diff --git a/svtools/source/control/indexentryres.cxx b/svtools/source/control/indexentryres.cxx new file mode 100644 index 000000000000..16b0c7fadd8c --- /dev/null +++ b/svtools/source/control/indexentryres.cxx @@ -0,0 +1,105 @@ +#include <svtdata.hxx> +#include <svtools.hrc> + + +#ifndef SVTOOLS_INDEXENTRYRESSOURCE_HXX +#include <indexentryres.hxx> +#endif + +// ------------------------------------------------------------------------- +// +// wrapper for locale specific translations data of indexentry algorithm +// +// ------------------------------------------------------------------------- + +class IndexEntryRessourceData +{ + friend class IndexEntryRessource; + private: /* data */ + String ma_Name; + String ma_Translation; + private: /* member functions */ + IndexEntryRessourceData () {} + public: + IndexEntryRessourceData ( const String &r_Algorithm, const String &r_Translation) + : ma_Name (r_Algorithm), ma_Translation (r_Translation) {} + + const String& GetAlgorithm () const { return ma_Name; } + + const String& GetTranslation () const { return ma_Translation; } + + ~IndexEntryRessourceData () {} + + IndexEntryRessourceData& operator= (const IndexEntryRessourceData& r_From) + { + ma_Name = r_From.GetAlgorithm(); + ma_Translation = r_From.GetTranslation(); + return *this; + } +}; + +// ------------------------------------------------------------------------- +// +// implementation of the indexentry-algorithm-name translation +// +// ------------------------------------------------------------------------- + +#define INDEXENTRY_RESSOURCE_COUNT (STR_SVT_INDEXENTRY_END - STR_SVT_INDEXENTRY_START + 1) + +IndexEntryRessource::IndexEntryRessource() +{ + mp_Data = new IndexEntryRessourceData[INDEXENTRY_RESSOURCE_COUNT]; + + #define ASCSTR(str) String(RTL_CONSTASCII_USTRINGPARAM(str)) + #define RESSTR(rid) String(SvtResId(rid)) + + mp_Data[STR_SVT_INDEXENTRY_ALPHANUMERIC - STR_SVT_INDEXENTRY_START] = + IndexEntryRessourceData (ASCSTR("alphanumeric"), RESSTR(STR_SVT_INDEXENTRY_ALPHANUMERIC)); + mp_Data[STR_SVT_INDEXENTRY_DICTIONARY - STR_SVT_INDEXENTRY_START] = + IndexEntryRessourceData (ASCSTR("dict"), RESSTR(STR_SVT_INDEXENTRY_DICTIONARY)); + mp_Data[STR_SVT_INDEXENTRY_PINYIN - STR_SVT_INDEXENTRY_START] = + IndexEntryRessourceData (ASCSTR("pinyin"), RESSTR(STR_SVT_INDEXENTRY_PINYIN)); + mp_Data[STR_SVT_INDEXENTRY_PINYIN - STR_SVT_INDEXENTRY_START] = + IndexEntryRessourceData (ASCSTR("radical"), RESSTR(STR_SVT_INDEXENTRY_RADICAL)); + mp_Data[STR_SVT_INDEXENTRY_STROKE - STR_SVT_INDEXENTRY_START] = + IndexEntryRessourceData (ASCSTR("stroke"), RESSTR(STR_SVT_INDEXENTRY_STROKE)); + mp_Data[STR_SVT_INDEXENTRY_STROKE - STR_SVT_INDEXENTRY_START] = + IndexEntryRessourceData (ASCSTR("zhuyin"), RESSTR(STR_SVT_INDEXENTRY_ZHUYIN)); + mp_Data[STR_SVT_INDEXENTRY_ZHUYIN - STR_SVT_INDEXENTRY_START] = + IndexEntryRessourceData (ASCSTR("phonetic (alphanumeric first) (grouped by syllable)"), + RESSTR(STR_SVT_INDEXENTRY_PHONETIC_FS)); + mp_Data[STR_SVT_INDEXENTRY_PHONETIC_FS - STR_SVT_INDEXENTRY_START] = + IndexEntryRessourceData (ASCSTR("phonetic (alphanumeric first) (grouped by consonant)"), + RESSTR(STR_SVT_INDEXENTRY_PHONETIC_FC)); + mp_Data[STR_SVT_INDEXENTRY_PHONETIC_FC - STR_SVT_INDEXENTRY_START] = + IndexEntryRessourceData (ASCSTR("phonetic (alphanumeric last) (grouped by syllable)"), + RESSTR(STR_SVT_INDEXENTRY_PHONETIC_LS)); + mp_Data[STR_SVT_INDEXENTRY_PHONETIC_LS - STR_SVT_INDEXENTRY_START] = + IndexEntryRessourceData (ASCSTR("phonetic (alphanumeric last) (grouped by consonant)"), + RESSTR(STR_SVT_INDEXENTRY_PHONETIC_LC)); +} + +IndexEntryRessource::~IndexEntryRessource() +{ + delete[] mp_Data; +} + +const String& +IndexEntryRessource::GetTranslation (const String &r_Algorithm) +{ + xub_StrLen nIndex = r_Algorithm.Search('.'); + String aLocaleFreeAlgorithm; + + if (nIndex == STRING_NOTFOUND) + aLocaleFreeAlgorithm = r_Algorithm; + else { + nIndex += 1; + aLocaleFreeAlgorithm = String(r_Algorithm, nIndex, r_Algorithm.Len() - nIndex); + } + + for (sal_uInt32 i = 0; i < INDEXENTRY_RESSOURCE_COUNT; i++) + if (aLocaleFreeAlgorithm == mp_Data[i].GetAlgorithm()) + return mp_Data[i].GetTranslation(); + return r_Algorithm; +} + diff --git a/svtools/source/control/makefile.mk b/svtools/source/control/makefile.mk index d7993ad12d8e..c717d89d13e9 100644 --- a/svtools/source/control/makefile.mk +++ b/svtools/source/control/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.8 $ +# $Revision: 1.9 $ # -# last change: $Author: hr $ $Date: 2002-03-05 15:58:31 $ +# last change: $Author: fme $ $Date: 2002-08-23 08:43:19 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -106,6 +106,7 @@ SLOFILES= $(EXCEPTIONSFILES) \ $(SLO)$/scrwin.obj \ $(SLO)$/reginfo.obj \ $(SLO)$/collatorres.obj \ + $(SLO)$/indexentryres.obj \ $(SLO)$/fmtfield.obj \ $(SLO)$/scriptedtext.obj |