aboutsummaryrefslogtreecommitdiff
path: root/editors/openoffice.org-1.1/files/patch-rtfcjk
blob: 2b44f86757f937e747a8f7be6aa772eba96f4fd4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
--- ../svx/source/svrtf/rtfitem.cxx	24 Jun 2003 07:48:56 -0000	1.18
+++ ../svx/source/svrtf/rtfitem.cxx	25 Jul 2003 22:54:24 -0000
@@ -285,11 +285,20 @@
 	}
 	else
 	{
-		if( LOW_CHARTYPE == eType || HIGH_CHARTYPE == eType )
+//		if( LOW_CHARTYPE == eType || HIGH_CHARTYPE == eType )	//Takashi Ono for CJK
+		if( LOW_CHARTYPE == eType )
 		{
 			if( *pNormal )
 			{
 				rItem.SetWhich( *pNormal );
+				rSet.Put( rItem );
+			}
+		}
+		else if( HIGH_CHARTYPE == eType )
+		{
+			if( *pCTL )
+			{
+				rItem.SetWhich( *pCTL );
 				rSet.Put( rItem );
 			}
 		}
--- ../svx/source/svrtf/svxrtf.cxx	19 May 2003 12:30:59 -0000	1.15
+++ ../svx/source/svrtf/svxrtf.cxx	25 Jul 2003 22:54:29 -0000
@@ -583,8 +583,14 @@
 
 		case RTF_FCHARSET:
 			if( -1 != nTokenValue )
-				pFont->SetCharSet( rtl_getTextEncodingFromWindowsCharset(
-										(BYTE)nTokenValue ) );
+			{
+//				pFont->SetCharSet( rtl_getTextEncodingFromWindowsCharset(
+//										(BYTE)nTokenValue ) );
+				CharSet nCharSet =
+					rtl_getTextEncodingFromWindowsCharset( (BYTE)nTokenValue );
+				pFont->SetCharSet( nCharSet );
+				SetEncoding( nCharSet );	//Takashi Ono
+			}
 			break;
 
 		case RTF_FPRQ:
--- ../sw/source/filter/rtf/swparrtf.cxx	4 Jun 2003 10:19:09 -0000	1.28
+++ ../sw/source/filter/rtf/swparrtf.cxx	25 Jul 2003 22:54:37 -0000
@@ -3231,10 +3231,156 @@
 	SetSwgValues( rCollSet );
 }
 
+//Takashi Ono for CJK
+String SwRTFParser::XlateFmtColName( const String &rName )
+{
+#define RES_NONE RES_POOLCOLL_DOC_END
+
+	static const RES_POOL_COLLFMT_TYPE aArr[]={
+		RES_POOLCOLL_STANDARD, RES_POOLCOLL_HEADLINE1, RES_POOLCOLL_HEADLINE2,
+		RES_POOLCOLL_HEADLINE3, RES_POOLCOLL_HEADLINE4, RES_POOLCOLL_HEADLINE5,
+		RES_POOLCOLL_HEADLINE6, RES_POOLCOLL_HEADLINE7, RES_POOLCOLL_HEADLINE8,
+		RES_POOLCOLL_HEADLINE9,
+
+		RES_POOLCOLL_TOX_IDX1, RES_POOLCOLL_TOX_IDX2, RES_POOLCOLL_TOX_IDX3,
+		RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_NONE,
+		RES_POOLCOLL_TOX_CNTNT1,
+
+		RES_POOLCOLL_TOX_CNTNT2, RES_POOLCOLL_TOX_CNTNT3, RES_POOLCOLL_TOX_CNTNT4,
+		RES_POOLCOLL_TOX_CNTNT5, RES_POOLCOLL_TOX_CNTNT6, RES_POOLCOLL_TOX_CNTNT7,
+		RES_POOLCOLL_TOX_CNTNT8, RES_POOLCOLL_TOX_CNTNT9,
+		RES_NONE, RES_POOLCOLL_FOOTNOTE,
+
+		RES_NONE, RES_POOLCOLL_HEADER, RES_POOLCOLL_FOOTER, RES_POOLCOLL_TOX_IDXH,
+		RES_NONE, RES_NONE, RES_POOLCOLL_JAKETADRESS, RES_POOLCOLL_SENDADRESS,
+		RES_NONE, RES_NONE,
+
+		RES_NONE, RES_NONE, RES_NONE, RES_POOLCOLL_ENDNOTE, RES_NONE, RES_NONE, RES_NONE,
+		RES_POOLCOLL_LISTS_BEGIN, RES_NONE, RES_NONE,
+
+		RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_NONE,
+		RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_NONE,
+
+		RES_NONE,RES_NONE, RES_POOLCOLL_DOC_TITEL, RES_NONE, RES_POOLCOLL_SIGNATURE, RES_NONE,
+		RES_POOLCOLL_TEXT, RES_POOLCOLL_TEXT_MOVE, RES_NONE, RES_NONE,
+
+		RES_NONE, RES_NONE, RES_NONE, RES_NONE, RES_POOLCOLL_DOC_SUBTITEL };
+	static const sal_Char *stiName[] = {
+		"Normal",
+		"heading 1",
+		"heading 2",
+		"heading 3",
+		"heading 4",
+		"heading 5",
+		"heading 6",
+		"heading 7",
+		"heading 8",
+		"heading 9",
+		"index 1",
+		"index 2",
+		"index 3",
+		"index 4",
+		"index 5",
+		"index 6",
+		"index 7",
+		"index 8",
+		"index 9",
+		"toc 1",
+		"toc 2",
+		"toc 3",
+		"toc 4",
+		"toc 5",
+		"toc 6",
+		"toc 7",
+		"toc 8",
+		"toc 9",
+		"Normal Indent",
+		"footnote text",
+		"annotation text",
+		"header",
+		"footer",
+		"index heading",
+		"caption",
+		"table of figures",
+		"envelope address",
+		"envelope return",
+		"footnote reference",
+		"annotation reference",
+		"line number",
+		"page number",
+		"endnote reference",
+		"endnote text",
+		"table of authorities",
+		"macro",
+		"toa heading",
+		"List",
+		"List Bullet",
+		"List Number",
+		"List 2",
+		"List 3",
+		"List 4",
+		"List 5",
+		"List Bullet 2",
+		"List Bullet 3",
+		"List Bullet 4",
+		"List Bullet 5",
+		"List Number 2",
+		"List Number 3",
+		"List Number 4",
+		"List Number 5",
+		"Title",
+		"Closing",
+		"Signature",
+		"Default Paragraph Font",
+		"Body Text",
+		"Body Text Indent",
+		"List Continue",
+		"List Continue 2",
+		"List Continue 3",
+		"List Continue 4",
+		"List Continue 5",
+		"Message Header",
+		"Subtitle",
+	};
+
+
+	ASSERT( ( sizeof( aArr ) / sizeof( RES_POOL_COLLFMT_TYPE ) == 75 ),
+			"Style-UEbersetzungstabelle hat falsche Groesse" );
+	ASSERT( ( sizeof( stiName ) / sizeof( *stiName ) == 75 ),
+			"Style-UEbersetzungstabelle hat falsche Groesse" );
+
+	RES_POOL_COLLFMT_TYPE nId = RES_NONE;
+
+	for (int i = 0; i < sizeof( stiName ) / sizeof( *stiName ); i++)
+	{
+		if ( rName == String( stiName[i], RTL_TEXTENCODING_MS_1252 ) )
+		{
+			nId = aArr[i];
+			break;
+		}
+	}
+	USHORT nResId;
+	if( RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END )
+		nResId = RC_POOLCOLL_TEXT_BEGIN - RES_POOLCOLL_TEXT_BEGIN;
+	else if (RES_POOLCOLL_LISTS_BEGIN <= nId && nId < RES_POOLCOLL_LISTS_END)
+		nResId = RC_POOLCOLL_LISTS_BEGIN - RES_POOLCOLL_LISTS_BEGIN;
+	else if (RES_POOLCOLL_EXTRA_BEGIN <= nId && nId < RES_POOLCOLL_EXTRA_END)
+		nResId = RC_POOLCOLL_EXTRA_BEGIN - RES_POOLCOLL_EXTRA_BEGIN;
+	else if (RES_POOLCOLL_REGISTER_BEGIN <= nId && nId < RES_POOLCOLL_REGISTER_END)
+		nResId = RC_POOLCOLL_REGISTER_BEGIN - RES_POOLCOLL_REGISTER_BEGIN;
+	else if (RES_POOLCOLL_DOC_BEGIN <= nId && nId < RES_POOLCOLL_DOC_END)
+		nResId = RC_POOLCOLL_DOC_BEGIN - RES_POOLCOLL_DOC_BEGIN;
+	else if (RES_POOLCOLL_HTML_BEGIN <= nId && nId < RES_POOLCOLL_HTML_END)
+		nResId = RC_POOLCOLL_HTML_BEGIN - RES_POOLCOLL_HTML_BEGIN;
+	return String( ResId( nResId + nId, pSwResMgr ) );
+}
+
 SwTxtFmtColl* SwRTFParser::MakeStyle( USHORT nNo, const SvxRTFStyleType& rStyle )
 {
-	int bCollExist;
-	SwTxtFmtColl* pColl = MakeColl( rStyle.sName, USHORT(nNo),
+ 	int bCollExist;
+//	SwTxtFmtColl* pColl = MakeColl( rStyle.sName, USHORT(nNo),	//Takashi Ono for CJK
+	SwTxtFmtColl* pColl = MakeColl( XlateFmtColName( rStyle.sName ),
+									USHORT(nNo),
 									rStyle.nOutlineNo, bCollExist );
 	aTxtCollTbl.Insert( nNo, pColl );
 
--- ../sw/source/filter/rtf/swparrtf.hxx	19 May 2003 12:25:34 -0000	1.10
+++ ../sw/source/filter/rtf/swparrtf.hxx	25 Jul 2003 22:54:44 -0000
@@ -364,6 +364,7 @@
 	void SetStyleAttr( SfxItemSet& rCollSet,
 						const SfxItemSet& rStyleSet,
 						const SfxItemSet& rDerivedSet );
+	String XlateFmtColName( const String &rName );	//Takashi Ono for CJK
 	SwTxtFmtColl* MakeStyle( USHORT nNo, const SvxRTFStyleType& rStyle );
 	SwCharFmt* MakeCharStyle( USHORT nNo, const SvxRTFStyleType& rStyle );
 	void MakeStyleTab();