merged kh's changes in 1.0 branch into trunk

This commit is contained in:
nidd 2002-05-09 16:36:02 +00:00
parent e604ec79ab
commit 0cba0d358a
2 changed files with 21 additions and 14 deletions

View File

@ -2,9 +2,9 @@
* *
* $RCSfile: hyphenimp.cxx,v $ * $RCSfile: hyphenimp.cxx,v $
* *
* $Revision: 1.2 $ * $Revision: 1.3 $
* *
* last change: $Author: nidd $ $Date: 2002-02-28 15:44:10 $ * last change: $Author: nidd $ $Date: 2002-05-09 17:36:02 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@ -185,10 +185,12 @@ Sequence< Locale > SAL_CALL Hyphenator::getLocales()
if (!aSuppLocales.getLength()) if (!aSuppLocales.getLength())
{ {
aSuppLocales.realloc( 2 ); aSuppLocales.realloc( 4 );
Locale *pLocale = aSuppLocales.getArray(); Locale *pLocale = aSuppLocales.getArray();
pLocale[0] = Locale( A2OU("en"), A2OU("US"), OUString() ); pLocale[0] = Locale( A2OU("en"), A2OU("US"), OUString() );
pLocale[1] = Locale( A2OU("ru"), A2OU("RU"), OUString() ); pLocale[1] = Locale( A2OU("ru"), A2OU("RU"), OUString() );
pLocale[2] = Locale( A2OU("de"), A2OU("DE"), OUString() );
pLocale[3] = Locale( A2OU("da"), A2OU("DK"), OUString() );
} }
@ -272,7 +274,6 @@ Hyphenator::hyphenate( const ::rtl::OUString& aWord,
rtl_TextEncoding DictionaryEnc = L2TE( LocaleToLanguage( aLocale ) ); rtl_TextEncoding DictionaryEnc = L2TE( LocaleToLanguage( aLocale ) );
// chclass.toLower(aWord); // chclass.toLower(aWord);
encWord = OUStringToOString (aWord, DictionaryEnc); encWord = OUStringToOString (aWord, DictionaryEnc);
@ -304,7 +305,7 @@ Hyphenator::hyphenate( const ::rtl::OUString& aWord,
else else
{ {
xRes = new HyphenatedWord( aWord, LocaleToLanguage( aLocale ), nHyphenationPos, xRes = new HyphenatedWord( aWord, LocaleToLanguage( aLocale ), nHyphenationPos,
hyphenatedWord.makeStringAndClear(), nHyphenationPos ); aWord, nHyphenationPos );
} }
delete hyphens; delete hyphens;
@ -380,13 +381,19 @@ Reference< XPossibleHyphens > SAL_CALL
return NULL; return NULL;
} }
Sequence< INT16 > aHyphPos( encWord.getLength());
INT16 *pPos = aHyphPos.getArray();
OUStringBuffer hyphenatedWordBuffer;
OUString hyphenatedWord;
INT16 nHyphCount = 0; INT16 nHyphCount = 0;
for (INT16 i = 0; i < encWord.getLength(); i++) for (INT16 i = 0; i < encWord.getLength(); i++)
if (hyphens[i]&1)
nHyphCount++;
Sequence< INT16 > aHyphPos(nHyphCount);
INT16 *pPos = aHyphPos.getArray();
OUStringBuffer hyphenatedWordBuffer;
OUString hyphenatedWord;
nHyphCount = 0;
for (i = 0; i < encWord.getLength(); i++)
{ {
hyphenatedWordBuffer.append(aWord[i]); hyphenatedWordBuffer.append(aWord[i]);
if (hyphens[i]&1) if (hyphens[i]&1)

View File

@ -2,9 +2,9 @@
# #
# $RCSfile: makefile.mk,v $ # $RCSfile: makefile.mk,v $
# #
# $Revision: 1.2 $ # $Revision: 1.3 $
# #
# last change: $Author: nidd $ $Date: 2001-12-25 08:48:43 $ # last change: $Author: nidd $ $Date: 2002-05-09 17:36:02 $
# #
# The Contents of this file are made available subject to the terms of # The Contents of this file are made available subject to the terms of
# either of the following licenses # either of the following licenses
@ -109,9 +109,9 @@ UNOTYPES=\
com.sun.star.linguistic2.XSupportedLocales\ com.sun.star.linguistic2.XSupportedLocales\
com.sun.star.linguistic2.XThesaurus com.sun.star.linguistic2.XThesaurus
CXXFLAGS += -I../libhnj -Wall CXXFLAGS += -I../libhnj
CFLAGSCXX += -I../libhnj -Wall CFLAGSCXX += -I../libhnj
CFLAGSCC += -I../libhnj -Wall CFLAGSCC += -I../libhnj
.IF "$(header)" == "" .IF "$(header)" == ""