clang -cc1 -cc1 -triple x86_64-unknown-linux-gnu -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name hbox.cxx -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -fno-split-dwarf-inlining -debugger-tuning=gdb -resource-dir /usr/lib64/clang/11.0.0 -D BOOST_ERROR_CODE_HEADER_ONLY -D BOOST_SYSTEM_NO_DEPRECATED -D CPPU_ENV=gcc3 -D LINUX -D OSL_DEBUG_LEVEL=1 -D SAL_LOG_INFO -D SAL_LOG_WARN -D UNIX -D UNX -D X86_64 -D _PTHREADS -D _REENTRANT -D SYSTEM_ZLIB -D EXCEPTIONS_ON -D LIBO_INTERNAL_ONLY -I /home/maarten/src/libreoffice/core/external/boost/include -I /home/maarten/src/libreoffice/core/workdir/UnpackedTarball/boost -I /home/maarten/src/libreoffice/core/include -I /usr/lib/jvm/java-11-openjdk-11.0.9.10-0.0.ea.fc33.x86_64/include -I /usr/lib/jvm/java-11-openjdk-11.0.9.10-0.0.ea.fc33.x86_64/include/linux -I /home/maarten/src/libreoffice/core/config_host -I /home/maarten/src/libreoffice/core/workdir/UnoApiHeadersTarget/udkapi/normal -I /home/maarten/src/libreoffice/core/workdir/UnoApiHeadersTarget/offapi/normal -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/10/../../../../include/c++/10 -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/10/../../../../include/c++/10/x86_64-redhat-linux -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/10/../../../../include/c++/10/backward -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/11.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O0 -Wno-missing-braces -std=c++17 -fdeprecated-macro -fdebug-compilation-dir /home/maarten/src/libreoffice/core -ferror-limit 19 -fvisibility hidden -fvisibility-inlines-hidden -stack-protector 2 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -debug-info-kind=constructor -analyzer-output=html -faddrsig -o /home/maarten/tmp/wis/scan-build-libreoffice/output/report/2020-10-07-141433-9725-1 -x c++ /home/maarten/src/libreoffice/core/hwpfilter/source/hbox.cxx
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | |
12 | |
13 | |
14 | |
15 | |
16 | |
17 | |
18 | |
19 | |
20 | #include "precompile.h" |
21 | |
22 | |
23 | #include "hwpfile.h" |
24 | #include "hbox.h" |
25 | #include "hpara.h" |
26 | #include "hutil.h" |
27 | #include "htags.h" |
28 | #include "drawdef.h" |
29 | #include "hcode.h" |
30 | #include "datecode.h" |
31 | |
32 | #include <rtl/character.hxx> |
33 | |
34 | int HBox::boxCount = 0; |
35 | |
36 | HBox::HBox(hchar hch) |
37 | { |
38 | hh = hch; |
39 | boxCount++; |
40 | } |
41 | |
42 | |
43 | HBox::~HBox() |
44 | { |
45 | boxCount--; |
46 | } |
47 | |
48 | |
49 | int HBox::WSize() |
50 | { |
51 | static const int wsize[32] = |
52 | { |
53 | 1, 4, 4, 4, 4, 4, 4, 42, |
54 | 48, 4, 4, 4, 4, 1, 4, 4, |
55 | 4, 4, 4, 4, 4, 4, 12, 5, |
56 | 3, 3, 123, 4, 32, 4, 2, 2 |
57 | }; |
58 | |
59 | if (hh < 32) |
60 | return wsize[hh]; |
61 | else |
62 | return 1; |
63 | } |
64 | |
65 | |
66 | |
67 | SkipData::SkipData(hchar hch) |
68 | : HBox(hch) |
69 | { |
70 | } |
71 | |
72 | SkipData::~SkipData() |
73 | { |
74 | } |
75 | |
76 | |
77 | |
78 | FieldCode::FieldCode() |
79 | : HBox(CH_FIELD) |
80 | , location_info(0) |
81 | { |
82 | } |
83 | |
84 | FieldCode::~FieldCode() |
85 | { |
86 | } |
87 | |
88 | |
89 | Bookmark::Bookmark() |
90 | : HBox(CH_BOOKMARK) |
91 | , dummy(0) |
92 | , type(0) |
93 | { |
94 | } |
95 | |
96 | Bookmark::~Bookmark() |
97 | { |
98 | } |
99 | |
100 | |
101 | DateFormat::DateFormat() |
102 | : HBox(CH_DATE_FORM) |
103 | , dummy(0) |
104 | { |
105 | } |
106 | |
107 | |
108 | DateCode::DateCode() |
109 | : HBox(CH_DATE_CODE) |
110 | , dummy(0) |
111 | , key(0) |
112 | { |
113 | } |
114 | |
115 | const hchar kor_week[] = |
116 | { |
117 | 0xB7A9, 0xB6A9, 0xD1C1, 0xAE81, 0xA1A2, 0x8B71, 0xC9A1 |
118 | }; |
119 | const hchar china_week[] = |
120 | { |
121 | 0x4CC8, 0x4BE4, 0x525A, 0x48D8, 0x45AB, 0x4270, 0x50B4 |
122 | }; |
123 | const char eng_week[] = { "SunMonTueWedThuFriSat" }; |
124 | const char eng_mon[] = { "JanFebMarAprMayJunJulAugSepOctNovDec" }; |
125 | const char * const en_mon[] = |
126 | { |
127 | "January", "February", "March", "April", "May", "June", "July", |
128 | "August", "September", "October", "November", "December" |
129 | }; |
130 | const char * const en_week[] = |
131 | { |
132 | "Sunday", "Monday", "Tuesday", "Wednesday", |
133 | "Thursday", "Friday", "Saturday" |
134 | }; |
135 | |
136 | hchar_string DateCode::GetString() |
137 | { |
138 | hchar_string ret; |
139 | const hchar *fmt; |
140 | int i, num; |
141 | const char *form; |
142 | char cbuf[256]; |
143 | bool is_pm, add_zero; |
144 | |
145 | add_zero = false; |
146 | format[DATE_SIZE - 1] = 0; |
147 | fmt = format[0] ? format : defaultform; |
| 1 | Assuming the condition is true | |
|
| |
148 | |
149 | for (; *fmt && (static_cast<int>(ret.size()) < DATE_SIZE); fmt++) |
| 3 | | Assuming the condition is true | |
|
| 4 | | Loop condition is true. Entering loop body | |
|
| 12 | | Assuming the condition is true | |
|
| 13 | | Assuming the condition is true | |
|
| 14 | | Loop condition is true. Entering loop body | |
|
150 | { |
151 | form = add_zero ? "%02d" : "%d"; |
| |
| |
152 | |
153 | add_zero = false; |
154 | is_pm = (date[HOUR] >= 12); |
| 6 | | Assuming the condition is false | |
|
155 | *cbuf = 0; |
156 | num = -1; |
157 | |
158 | switch (*fmt) |
| 7 | | Control jumps to 'case 50:' at line 170 | |
|
| 16 | | Control jumps to 'case 42:' at line 178 | |
|
159 | { |
160 | case '0': |
161 | add_zero = true; |
162 | break; |
163 | case '1': |
164 | num = date[YEAR]; |
165 | form = "%04d"; |
166 | break; |
167 | case '!': |
168 | num = date[YEAR] % 100; |
169 | break; |
170 | case '2': |
171 | num = date[MONTH]; |
172 | break; |
| 8 | | Execution continues on line 267 | |
|
173 | case '@': |
174 | memcpy(cbuf, eng_mon + (date[MONTH] - 1) * 3, 3); |
175 | cbuf[3] = '.'; |
176 | cbuf[4] = 0; |
177 | break; |
178 | case '*': |
179 | strncat(cbuf, en_mon[date[MONTH] - 1], sizeof(cbuf) - strlen(cbuf) - 1); |
| 17 | | 2nd function call argument is an uninitialized value |
|
180 | break; |
181 | case '3': |
182 | num = date[DAY]; |
183 | break; |
184 | case '#': |
185 | num = date[DAY]; |
186 | switch (date[DAY] % 10) |
187 | { |
188 | case 1: |
189 | form = "%dst"; |
190 | break; |
191 | case 2: |
192 | form = "%dnd"; |
193 | break; |
194 | case 3: |
195 | form = "%drd"; |
196 | break; |
197 | default: |
198 | form = "%dth"; |
199 | break; |
200 | } |
201 | break; |
202 | case '4': |
203 | num = date[HOUR] - ((date[HOUR] > 12) ? 12 : 0); |
204 | break; |
205 | case '$': |
206 | num = date[HOUR]; |
207 | break; |
208 | case '5': |
209 | case '%': |
210 | num = date[MIN]; |
211 | break; |
212 | case '6': |
213 | ret.push_back(kor_week[date[WEEK]]); |
214 | break; |
215 | case '^': |
216 | memcpy(cbuf, eng_week + date[WEEK] * 3, 3); |
217 | cbuf[3] = '.'; |
218 | cbuf[4] = 0; |
219 | break; |
220 | case '_': |
221 | strncat(cbuf, en_week[date[WEEK]], sizeof(cbuf) - strlen(cbuf) - 1); |
222 | break; |
223 | case '7': |
224 | ret.push_back(0xB5A1); |
225 | ret.push_back(is_pm ? 0xD281 : 0xB8E5); |
226 | break; |
227 | case '&': |
228 | strncat(cbuf, is_pm ? "p.m." : "a.m.", sizeof(cbuf) - strlen(cbuf) - 1); |
229 | break; |
230 | case '+': |
231 | strncat(cbuf, is_pm ? "P.M." : "A.M.", sizeof(cbuf) - strlen(cbuf) - 1); |
232 | break; |
233 | case '8': |
234 | case '9': |
235 | #if 0 |
236 | |
237 | mkcurfilename(cbuf, *fmt); |
238 | for (i = 0; cbuf[i] != 0 && slen > 1; i++) |
239 | { |
240 | if (cbuf[i] & 0x80 && cbuf[i + 1] != 0) |
241 | { |
242 | *d++ = (cbuf[i] << 8) | cbuf[i + 1]; |
243 | i++; |
244 | } |
245 | else |
246 | *d++ = cbuf[i]; |
247 | slen--; |
248 | } |
249 | #endif |
250 | cbuf[0] = 0; |
251 | break; |
252 | case '~': |
253 | if (fmt[1] == 0) |
254 | break; |
255 | fmt++; |
256 | if (*fmt == '6') |
257 | { |
258 | ret.push_back(china_week[date[WEEK]]); |
259 | break; |
260 | } |
261 | break; |
262 | default: |
263 | if (*fmt == '\\' && *++fmt == 0) |
264 | goto done; |
265 | ret.push_back(*fmt); |
266 | } |
267 | if (num != -1) |
| 9 | | Assuming the condition is false | |
|
| |
268 | sprintf(cbuf, form, num); |
269 | for (i = 0; 0 != cbuf[i]; i++) |
| 11 | | Loop condition is false. Execution continues on line 149 | |
|
270 | { |
271 | ret.push_back(*(cbuf + i)); |
272 | } |
273 | } |
274 | done: |
275 | return ret; |
276 | } |
277 | |
278 | |
279 | Tab::Tab() |
280 | : HBox(CH_TAB) |
281 | , width(0) |
282 | , leader(0) |
283 | , dummy(0) |
284 | { |
285 | } |
286 | |
287 | |
288 | FBox::FBox(hchar hch) |
289 | : HBox(hch) |
290 | , zorder(0) |
291 | , option(0) |
292 | , ctrl_ch(0) |
293 | , box_xs(0) |
294 | , box_ys(0) |
295 | , cap_xs(0) |
296 | , cap_ys(0) |
297 | , xs(0) |
298 | , ys(0) |
299 | , cap_margin(0) |
300 | , xpos_type(0) |
301 | , ypos_type(0) |
302 | , smart_linesp(0) |
303 | , boundsy(0) |
304 | , boundey(0) |
305 | , boundx(0) |
306 | , draw(0) |
307 | , pgx(0) |
308 | , pgy(0) |
309 | , pgno(0) |
310 | , showpg(0) |
311 | { |
312 | } |
313 | |
314 | FBox::~FBox() |
315 | { |
316 | } |
317 | |
318 | |
319 | TxtBox::TxtBox() |
320 | : FBox(CH_TEXT_BOX) |
321 | , dummy(0) |
322 | , dummy1(0) |
323 | , cap_len(0) |
324 | , next_box(0) |
325 | , dummy2(0) |
326 | , reserved1(0) |
327 | , cap_pos(0) |
328 | , num(0) |
329 | , dummy3(0) |
330 | , baseline(0) |
331 | , type(0) |
332 | , nCell(0) |
333 | , protect(0) |
334 | , m_pTable(nullptr) |
335 | { |
336 | reserved[0] = reserved[1] = 0; |
337 | } |
338 | |
339 | TxtBox::~TxtBox() |
340 | { |
341 | } |
342 | |
343 | |
344 | |
345 | Picture::Picture() |
346 | : FBox(CH_PICTURE) |
347 | , dummy(0) |
348 | , follow_block_size(0) |
349 | , dummy1(0) |
350 | , dummy2(0) |
351 | , reserved1(0) |
352 | , cap_pos(0) |
353 | , num(0) |
354 | , pictype(0) |
355 | , ishyper(false) |
356 | { |
357 | } |
358 | |
359 | Picture::~Picture() |
360 | { |
361 | if (pictype == PICTYPE_DRAW) |
362 | delete picinfo.picdraw.hdo; |
363 | } |
364 | |
365 | |
366 | |
367 | |
368 | Hidden::~Hidden() |
369 | { |
370 | } |
371 | |
372 | |
373 | |
374 | HeaderFooter::~HeaderFooter() |
375 | { |
376 | } |
377 | |
378 | |
379 | |
380 | Footnote::~Footnote() |
381 | { |
382 | } |
383 | |
384 | |
385 | |
386 | |
387 | |
388 | |
389 | |
390 | |
391 | hchar_string MailMerge::GetString() |
392 | { |
393 | return hchar_string(); |
394 | } |
395 | |
396 | |
397 | |
398 | |
399 | |
400 | |
401 | |
402 | |
403 | #define OL_HANGL_JASO 0 |
404 | #define OL_HANGL_KANATA 1 |
405 | |
406 | static hchar olHanglJaso(int num, int type) |
407 | { |
408 | static const unsigned char han_init[] = |
409 | { 0x88, 0x90, 0x94, 0x9c, 0xa0, 0xa4, 0xac, 0xb4, 0xb8, 0xc0, 0xc4, 0xc8, 0xcc, 0xd0 }; |
410 | static const unsigned char jung[] = { 3, 5, 7, 11, 13, 19, 20, 26, 27, 29, 30 }; |
411 | static const unsigned char jung2[] = { 3, 7, 13, 20, 27, 29, 30 }; |
412 | |
413 | hchar hh = 0; |
414 | |
415 | if (type == OL_HANGL_JASO) |
416 | { |
417 | num = num % (14 + SAL_N_ELEMENTS(jung)); |
418 | |
419 | if (num < 14) |
420 | hh = (han_init[num] << 8) | 'A'; |
421 | else |
422 | hh = (jung[num - 14] << 5) | 0x8401; |
423 | } |
424 | else |
425 | { |
426 | if (num < 14) |
427 | hh = (han_init[num] << 8) | 'a'; |
428 | else |
429 | { |
430 | int j = (num / 14) % SAL_N_ELEMENTS(jung2); |
431 | |
432 | num = num % 14; |
433 | hh = (han_init[num] << 8) | (jung2[j] << 5) | 1; |
434 | } |
435 | } |
436 | return hh; |
437 | } |
438 | |
439 | |
440 | static const hchar *GetOutlineStyleChars(int style) |
441 | { |
442 | static const hchar out_bul_style_entry[5][8] = |
443 | { |
444 | { |
445 | 0x2f18, 0x2f12, 0x2f08, 0x2f02, 0x2f06, 0x2f00, 0x2043, 0x0000 |
446 | }, |
447 | { |
448 | 0x2f18, 0x2f12, 0x2f06, 0x2f00, 0x2f36, 0x2f30, 0x2043, 0x0000 |
449 | }, |
450 | { |
451 | 0x2f26, 0x2f20, 0x2f06, 0x2f00, 0x2f16, 0x2f10, 0x2043, 0x0000 |
452 | }, |
453 | { |
454 | 0x2f18, 0x2f16, 0x2f12, 0x2f10, 0x2f06, 0x2f00, 0x2043, 0x0000 |
455 | }, |
456 | { |
457 | 0xAC61, 0xB677, 0xB861, 0xB8F7, 0xB781, 0x0000 |
458 | }, |
459 | }; |
460 | if (style >= OLSTY_BULLET1 && style <= OLSTY_BULLET5) |
461 | return out_bul_style_entry[style - OLSTY_BULLET1]; |
462 | return nullptr; |
463 | } |
464 | |
465 | |
466 | static void getOutlineNumStr(int style, int level, int num, hchar * hstr) |
467 | { |
468 | enum |
469 | { |
470 | U_ROM = 0x01, L_ROM = 0x02, U_ENG = 0x04, L_ENG = 0x08, |
471 | HAN = 0x10, NUM = 0x20, L_BR = 0x40, R_BR = 0x80 |
472 | }; |
473 | static const unsigned char type_tbl[][MAX_OUTLINE_LEVEL] = |
474 | { |
475 | { |
476 | U_ROM, HAN, NUM, HAN | R_BR, L_BR | NUM | R_BR, |
477 | L_BR | HAN | R_BR, L_ROM | R_BR |
478 | }, |
479 | { |
480 | U_ROM, U_ENG, NUM, L_ENG | R_BR, L_BR | NUM | R_BR, |
481 | L_BR | L_ENG | R_BR, L_ROM | R_BR |
482 | }, |
483 | { |
484 | NUM, HAN, L_BR | NUM | R_BR, L_BR | HAN | R_BR, NUM | |
485 | R_BR, HAN | R_BR, L_ENG |
486 | } |
487 | }; |
488 | char fmt = type_tbl[style - OLSTY_NUMSIG1][level]; |
489 | char buf[80], *ptr; |
490 | |
491 | if (num < 1) |
492 | num = 1; |
493 | if (fmt & L_BR) |
494 | *hstr++ = '('; |
495 | if (fmt & NUM) |
496 | { |
497 | sprintf(buf, "%d", num); |
498 | str2hstr(buf, hstr); |
499 | hstr += strlen(buf); |
500 | } |
501 | else if (fmt & (U_ROM | L_ROM)) |
502 | { |
503 | num2roman(num, buf); |
504 | if (fmt & U_ROM) |
505 | { |
506 | ptr = buf; |
507 | while (*ptr) |
508 | { |
509 | *ptr = sal::static_int_cast<char>( |
510 | rtl::toAsciiUpperCase(static_cast<unsigned char>(*ptr))); |
511 | ptr++; |
512 | } |
513 | } |
514 | str2hstr(buf, hstr); |
515 | hstr += strlen(buf); |
516 | } |
517 | else |
518 | { |
519 | num = (num - 1) % 26; |
520 | if (fmt & U_ENG) |
521 | *hstr++ = sal::static_int_cast<hchar>('A' + num); |
522 | else if (fmt & L_ENG) |
523 | *hstr++ = sal::static_int_cast<hchar>('a' + num); |
524 | else if (fmt & HAN) |
525 | *hstr++ = olHanglJaso(num, OL_HANGL_KANATA); |
526 | } |
527 | *hstr++ = (fmt & R_BR) ? ')' : '.'; |
528 | *hstr = 0; |
529 | } |
530 | |
531 | |
532 | enum |
533 | { OUTLINE_ON, OUTLINE_NUM }; |
534 | |
535 | |
536 | |
537 | |
538 | |
539 | hchar_string Outline::GetUnicode() const |
540 | { |
541 | const hchar *p; |
542 | hchar buffer[255]; |
543 | |
544 | buffer[0] = 0; |
545 | if (kind == OUTLINE_NUM) |
546 | { |
547 | int levelnum; |
548 | switch (shape) |
549 | { |
550 | case OLSTY_NUMS1: |
551 | case OLSTY_NUMS2: |
552 | { |
553 | char cur_num_str[10], buf[80]; |
554 | int i; |
555 | |
556 | buf[0] = 0; |
557 | for (i = 0; i <= level; i++) |
558 | { |
559 | levelnum = ((number[i] < 1) ? 1 : number[i]); |
560 | if (shape == OLSTY_NUMS2 && i && i == level) |
561 | sprintf(cur_num_str, "%d%c", levelnum, 0); |
562 | else |
563 | sprintf(cur_num_str, "%d%c", levelnum, '.'); |
564 | strcat(buf, cur_num_str); |
565 | } |
566 | str2hstr(buf, buffer); |
567 | return hstr2ucsstr(buffer); |
568 | } |
569 | case OLSTY_NUMSIG1: |
570 | case OLSTY_NUMSIG2: |
571 | case OLSTY_NUMSIG3: |
572 | { |
573 | getOutlineNumStr(shape, level, number[level], buffer); |
574 | return hstr2ucsstr(buffer); |
575 | } |
576 | case OLSTY_BULLET1: |
577 | case OLSTY_BULLET2: |
578 | case OLSTY_BULLET3: |
579 | case OLSTY_BULLET4: |
580 | case OLSTY_BULLET5: |
581 | { |
582 | p = GetOutlineStyleChars(shape); |
583 | buffer[0] = p[level]; |
584 | buffer[1] = 0; |
585 | return hstr2ucsstr(buffer); |
586 | } |
587 | case OLSTY_USER: |
588 | case OLSTY_BULUSER: |
589 | { |
590 | char dest[80]; |
591 | int l = 0; |
592 | int i = level; |
593 | if( deco[i][0] ){ |
594 | buffer[l++] = deco[i][0]; |
595 | } |
596 | |
597 | |
598 | |
599 | |
600 | switch( user_shape[i] ) |
601 | { |
602 | case 0: |
603 | buffer[l++] = '1' + number[i] - 1; |
604 | break; |
605 | case 1: |
606 | case 2: |
607 | num2roman(number[i], dest); |
608 | if( user_shape[i] == 1 ){ |
609 | char *ptr = dest; |
610 | while( *ptr ) |
611 | { |
612 | *ptr = sal::static_int_cast<char>(rtl::toAsciiUpperCase(static_cast<unsigned char>(*ptr))); |
613 | ptr++; |
614 | } |
615 | } |
616 | str2hstr(dest, buffer + l); |
617 | l += strlen(dest); |
618 | break; |
619 | case 3: |
620 | buffer[l++] = 'A' + number[i] -1; |
621 | break; |
622 | case 4: |
623 | buffer[l++] = 'a' + number[i] -1; |
624 | break; |
625 | case 5: |
626 | buffer[l++] = olHanglJaso(number[i] -1, OL_HANGL_KANATA); |
627 | break; |
628 | case 6: |
629 | buffer[l++] = olHanglJaso(number[i] -1, OL_HANGL_JASO); |
630 | break; |
631 | case 7: |
632 | buffer[l++] = '1' + number[i] -1; |
633 | break; |
634 | case 8: |
635 | buffer[l++] = 0x2e00 + number[i]; |
636 | break; |
637 | case 9: |
638 | buffer[l++] = 0x2c20 + number[i]; |
639 | break; |
640 | case 10: |
641 | buffer[l++] = 0x2c50 + number[i] -1; |
642 | break; |
643 | case 11: |
644 | buffer[l++] = 0x2c40 + number[i] -1; |
645 | break; |
646 | case 12: |
647 | { |
648 | char cur_num_str[10],buf[80]; |
649 | int j; |
650 | buf[0] = 0; |
651 | for (j = 0; j <= level; j++) |
652 | { |
653 | levelnum = ((number[j] < 1) ? 1 : number[j]); |
654 | if ((j && j == level) || (j == level && deco[i][1])) |
655 | sprintf(cur_num_str, "%d%c", levelnum, 0); |
656 | else |
657 | sprintf(cur_num_str, "%d%c", levelnum, '.'); |
658 | strcat(buf, cur_num_str); |
659 | } |
660 | str2hstr(buf, buffer + l); |
661 | l += strlen(buf); |
662 | break; |
663 | } |
664 | default: |
665 | buffer[l++] = user_shape[i]; |
666 | break; |
667 | } |
668 | if( deco[i][1] ){ |
669 | buffer[l++] = deco[i][1]; |
670 | } |
671 | buffer[l] = 0; |
672 | return hstr2ucsstr(buffer); |
673 | } |
674 | } |
675 | } |
676 | return hstr2ucsstr(buffer); |
677 | } |
678 | |
679 | |
680 | |
681 | |
682 | |
683 | |