Subversion Repositories Kolibri OS

Rev

Rev 6378 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6378 Rev 6383
Line 176... Line 176...
176
 
176
 
Line 177... Line 177...
177
0};
177
0};
178
 
178
 
179
// function to be called to fix the special symbols
-
 
180
void _text::fixSpecial(dword text) {
179
// function to be called to fix the special symbols
181
	//dword text = start;
180
void _text::fixSpecial(dword text) {
182
	byte ch;
181
	byte ch;
183
	int i , j, z;
182
	int i , j, z;
184
	dword aux;
183
	dword aux;
Line 193... Line 192...
193
			while ( i < 7)  {
192
			while ( i < 7)  {
194
				ch = ESBYTE[text];
193
				ch = ESBYTE[text];
195
				if (ch == ';') {
194
				if (ch == ';') {
196
					z = get_symbol(#str);
195
					z = get_symbol(#str);
197
					//debugval("z: ", z);
196
					//debugval("z: ", z);
-
 
197
					if (z == -1) { // not found
-
 
198
						ch = ' ';
-
 
199
					}
-
 
200
					else { // tag found
198
					aux = unicode_tags[z];
201
						aux = unicode_tags[z];
199
					strtrim(aux);
202
						strtrim(aux);
200
					debugln(aux);
203
						debugln(aux);
201
					ch = ESBYTE[aux];
204
						ch = ESBYTE[aux];
-
 
205
						// copy the special symbol found
202
					while (ch) {
206
						while (ch) {
203
						ESBYTE[text2] = ch;
207
							ESBYTE[text2] = ch;
204
						aux++;
208
							aux++;
205
						text2++;
209
							text2++;
206
						ch = ESBYTE[aux];
210
							ch = ESBYTE[aux];
207
					}
211
						}
208
					ch = ESBYTE[text2];
212
						ch = ESBYTE[text2];
-
 
213
					}
209
					//debugval("i: ", i);
214
					// clean the old symbol
210
					while (ch != ';') {
215
					while (ch != ';') {
211
						//debugval("j: ", j);
-
 
212
						ESBYTE[text2] = ' ';
216
						ESBYTE[text2] = ' ';// should be (char) 0;
213
						text2++;
217
						text2++;
214
						ch = ESBYTE[text2];
218
						ch = ESBYTE[text2];
215
					}
219
					}
216
					ESBYTE[text2] = ' ';
220
					ESBYTE[text2] = ' '; // should be '' or char 0
217
					//for (j=0;j
-
 
218
					//debugln(#str);
-
 
219
					//clean_str();
-
 
220
					break;
221
					break;
221
				}
222
				}
222
				str[i] = ch;
223
				str[i] = ch;
223
				if (!ch) return;
224
				if (!ch) return;
224
				text++;
225
				text++;
225
				i++;
226
				i++;
226
			}
227
			}
227
			for (i=0; i < 7; i++) str[i] = 0;
228
			for (i=0; i < 7; i++) str[i] = 0; // clean str
228
		}
229
		}
229
		text++;
230
		text++;
230
		text2++;
231
		text2++;
231
	}
232
	}
232
}
233
}
Line 233... Line 234...
233
 
234
 
234
 
235
 
235
 
236
 
236
// function to look for the conversion od special characters
237
// function to look for the conversion of special characters
237
// if not found--> return 0
238
// if not found--> return -1
238
int get_symbol(char *str2) {
239
int get_symbol(char *str2) {
239
	int i,j;
240
	int i,j;
240
	//debugln(#str2);
-
 
241
	for (i=0; unicode_tags[i]!=0; i+=2) {
-
 
242
		if (strcmp(str2, unicode_tags[i]) == 0) {
-
 
243
			//j = strlen(unicode_tags[i+1]);
-
 
244
			//debugval("i: ", i);
241
	//debugln(#str2);
245
			//strcat(text2, unicode_tags[i+1]);
242
	for (i=0; unicode_tags[i]!=0; i+=2) {
246
			i++;
243
		if (strcmp(str2, unicode_tags[i]) == 0) {
247
			return i;
244
			return (i+1);
248
		}
245
		}