/[pkgs]/rpms/openoffice.org/devel/openoffice.org-3.1.0.ooo100273.fix-utf8-hyphenation.patch
ViewVC logotype

Contents of /rpms/openoffice.org/devel/openoffice.org-3.1.0.ooo100273.fix-utf8-hyphenation.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Tue Mar 17 14:27:08 2009 UTC (8 months, 1 week ago) by caolanm
Branch: MAIN
CVS Tags: openoffice_org-3_1_1-18_1_fc12, F-12-split, openoffice_org-3_1_1-16_1_fc12, openoffice_org-3_1_0-7_1_fc11, openoffice_org-3_1_1-19_7_fc12, openoffice_org-3_1_1-19_9_fc12, openoffice_org-3_2_0-2_2_fc13, openoffice_org-3_1_1-19_6_fc12, openoffice_org-3_1_1-19_4_fc12, openoffice_org-3_1_1-19_5_fc12, openoffice_org-3_1_1-18_2_fc12, openoffice_org-3_1_1-14_1_fc12, openoffice_org-3_2_0-2_1_fc13, openoffice_org-3_2_0-4_2_fc13, openoffice_org-3_2_0-2_4_fc13, openoffice_org-3_1_1-12_1_fc12, openoffice_org-3_2_0-1_2_fc13, openoffice_org-3_2_0-4_1_fc13, openoffice_org-3_1_1-12_2_fc12, F-11-split, openoffice_org-3_1_1-13_1_fc12, openoffice_org-3_1_0-6_2_fc11, openoffice_org-3_1_1-15_2_fc12, openoffice_org-3_1_1-19_1_fc12, openoffice_org-3_1_0-8_1_fc11, openoffice_org-3_1_1-15_1_fc12, openoffice_org-3_1_0-11_3_fc12, openoffice_org-3_1_1-19_1_fc12_1, openoffice_org-3_1_1-17_1_fc12, openoffice_org-3_1_1-19_8_fc12, openoffice_org-3_2_0-2_3_fc13, openoffice_org-3_2_0-5_1_fc13, openoffice_org-3_2_0-3_1_fc13, openoffice_org-3_1_1-13_2_fc12, openoffice_org-3_2_0-3_2_fc13, openoffice_org-3_1_1-19_2_fc12, openoffice_org-3_1_0-9_3_fc12, openoffice_org-3_1_0-9_1_fc11, openoffice_org-3_2_0-1_1_fc13, openoffice_org-3_1_1-16_2_fc12, openoffice_org-3_1_1-13_3_fc12, openoffice_org-3_2_0-2_5_fc13, openoffice_org-3_1_0-10_1_fc12, openoffice_org-3_2_0-3_4_fc13, openoffice_org-3_1_0-9_2_fc11, HEAD
File MIME type: text/x-patch
Resolves: ooo#100273 fix utf-8 hyphenation for potential Indic hyphenation patterns
1 Index: source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx
2 ===================================================================
3 --- lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx (revision 269609)
4 +++ lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx (working copy)
5 @@ -652,18 +652,36 @@
6 OUString hyphenatedWord;
7 nHyphCount = 0;
8
9 + INT16 nLastChunk=0;
10 +
11 + //Our postions are relative to the potentially multi-byte encoded string,
12 + //not the original string, so we need to work in terms of that encoded
13 + //string when created the hyphenated word
14 + OString origEncWord(OU2ENC(aWord,aEnc));
15 +
16 for (i = 0; i < encWord.getLength(); i++)
17 {
18 - hyphenatedWordBuffer.append(aWord[i]);
19 if (hyphens[i]&1)
20 {
21 - pPos[nHyphCount] = i;
22 + //Take potentially multi-byte pending chunk of text and convert back to an OUString,
23 + //include the current character in the chunk
24 + hyphenatedWordBuffer.append(rtl::OStringToOUString(origEncWord.copy(nLastChunk,i-nLastChunk+1), aEnc));
25 +
26 + //Position of current char at pos i of encWord in unicode equivalent, excluding
27 + //hyphen characters and excluding the current char
28 + pPos[nHyphCount] = hyphenatedWordBuffer.getLength() - nHyphCount - 1;
29 hyphenatedWordBuffer.append(sal_Unicode('='));
30 nHyphCount++;
31 + nLastChunk = i+1;
32 }
33 }
34
35 + //Append remaining potentially multi-byte pending text and convert back to an OUString
36 + if (nLastChunk < encWord.getLength())
37 + hyphenatedWordBuffer.append(rtl::OStringToOUString(origEncWord.copy(nLastChunk), aEnc));
38 +
39 hyphenatedWord = hyphenatedWordBuffer.makeStringAndClear();
40 +
41 //fprintf(stderr,"result is %s\n",OU2A(hyphenatedWord));
42 //fflush(stderr);
43

admin@fedoraproject.org
ViewVC Help
Powered by ViewVC 1.1.2