LCOV - code coverage report
Current view: top level - libreoffice/hwpfilter/source - hbox.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 10 305 3.3 %
Date: 2012-12-17 Functions: 4 42 9.5 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include "precompile.h"
      21             : 
      22             : #include <ctype.h>
      23             : 
      24             : #include <osl/diagnose.h>
      25             : 
      26             : #include "hwpfile.h"
      27             : #include "hbox.h"
      28             : #include "hpara.h"
      29             : #include "hutil.h"
      30             : #include "htags.h"
      31             : #include "drawdef.h"
      32             : #include "hcode.h"
      33             : 
      34             : int HBox::boxCount = 0;
      35             : 
      36          70 : HBox::HBox(hchar hch)
      37             : {
      38          70 :     hh = hch;
      39          70 :     boxCount++;
      40          70 : }
      41             : 
      42             : 
      43         140 : HBox::~HBox()
      44             : {
      45          70 :     boxCount--;
      46         140 : }
      47             : 
      48             : 
      49         132 : int HBox::WSize(void)
      50             : {
      51             :     static const int wsize[32] =
      52             :     {
      53             :         1, 4, 4, 4, 4, 4, 4, 42,                  /* dateform */
      54             :         48, 4, 4, 4, 4, 1, 4, 4,                  /* hidden */
      55             :         4, 4, 4, 4, 4, 4, 12, 5,                  /* chcompose */
      56             :         3, 3, 123, 4, 32, 4, 2, 2
      57             :     };
      58             : 
      59         132 :     if (hh < 32)
      60           0 :         return wsize[hh];
      61             :     else
      62         132 :         return 1;
      63             : }
      64             : 
      65             : 
      66           0 : hchar_string HBox::GetString()
      67             : {
      68           0 :     hchar_string ret;
      69           0 :     ret.push_back(hh);
      70           0 :     return ret;
      71             : }
      72             : 
      73             : 
      74           0 : hunit HBox::Height(CharShape *csty)
      75             : {
      76           0 :     return( csty->size );
      77             : }
      78             : 
      79             : 
      80             : // skip block
      81           0 : SkipData::SkipData(hchar hch):HBox(hch)
      82             : {
      83           0 :     data_block = 0;
      84           0 : }
      85             : 
      86             : 
      87           0 : SkipData::~SkipData(void)
      88             : {
      89           0 :     delete[]data_block;
      90           0 : }
      91             : 
      92             : 
      93             : // FieldCode [5]
      94           0 : FieldCode::FieldCode(void) : HBox(CH_FIELD)
      95             : {
      96           0 :     str1 = 0;
      97           0 :     str2 = 0;
      98           0 :     str3 = 0;
      99           0 :     bin = 0;
     100           0 :     reserved1 = new char[4];
     101           0 :     reserved2 = new char[22];
     102           0 :      m_pDate = 0L;
     103           0 : }
     104             : 
     105             : 
     106           0 : FieldCode::~FieldCode(void)
     107             : {
     108           0 :     delete[] str1;
     109           0 :     delete[] str2;
     110           0 :     delete[] str3;
     111           0 :     delete[] bin;
     112           0 :     delete[] reserved1;
     113           0 :     delete[] reserved2;
     114           0 :      if( m_pDate )
     115           0 :           delete m_pDate;
     116           0 : }
     117             : 
     118             : 
     119             : // book mark(6)
     120           0 : Bookmark::Bookmark(void):HBox(CH_BOOKMARK)
     121             : {
     122           0 : }
     123             : 
     124             : 
     125           0 : Bookmark::~Bookmark(void)
     126             : {
     127           0 : }
     128             : 
     129             : 
     130             : // date format(7)
     131           0 : DateFormat::DateFormat(void):HBox(CH_DATE_FORM)
     132             : {
     133           0 : }
     134             : 
     135             : 
     136             : // date code(8)
     137             : 
     138           0 : DateCode::DateCode(void):HBox(CH_DATE_CODE)
     139             : {
     140           0 : }
     141             : 
     142             : 
     143             : #define _DATECODE_WEEK_DEFINES_
     144             : #include "datecode.h"
     145             : 
     146           0 : hchar_string DateCode::GetString()
     147             : {
     148           0 :     hchar_string ret;
     149             :     const hchar *fmt;
     150             :     int i, num;
     151             :     const char *form;
     152             :     char cbuf[256];
     153             :     bool is_pm, add_zero;
     154             : 
     155           0 :     add_zero = false;
     156           0 :     format[DATE_SIZE - 1] = 0;
     157           0 :     fmt = format[0] ? format : defaultform;
     158             : 
     159           0 :     for (; *fmt && ((int) ret.size() < DATE_SIZE); fmt++)
     160             :     {
     161           0 :         form = (add_zero) ? "%02d" : "%d";
     162             : 
     163           0 :         add_zero = false;
     164           0 :         is_pm = (date[HOUR] >= 12);
     165           0 :         *cbuf = 0;
     166           0 :         num = -1;
     167             : 
     168           0 :         switch (*fmt)
     169             :         {
     170             :             case '0':
     171           0 :                 add_zero = true;
     172           0 :                 break;
     173             :             case '1':
     174           0 :                 num = date[YEAR];
     175           0 :                 form = "%04d";
     176           0 :                 break;
     177             :             case '!':
     178           0 :                 num = date[YEAR] % 100;
     179           0 :                 break;
     180             :             case '2':
     181           0 :                 num = date[MONTH];
     182           0 :                 break;
     183             :             case '@':
     184           0 :                 memcpy(cbuf, eng_mon + (date[MONTH] - 1) * 3, 3);
     185           0 :                 cbuf[3] = '.';
     186           0 :                 cbuf[4] = 0;
     187           0 :                 break;
     188             :             case '*':
     189           0 :                 strcpy(cbuf, en_mon[date[MONTH] - 1]);
     190           0 :                 break;
     191             :             case '3':                             /* 'D' is day of korean */
     192           0 :                 num = date[DAY];
     193           0 :                 break;
     194             :             case '#':
     195           0 :                 num = date[DAY];
     196           0 :                 switch (date[DAY] % 10)
     197             :                 {
     198             :                     case 1:
     199           0 :                         form = "%dst";
     200           0 :                         break;
     201             :                     case 2:
     202           0 :                         form = "%dnd";
     203           0 :                         break;
     204             :                     case 3:
     205           0 :                         form = "%drd";
     206           0 :                         break;
     207             :                     default:
     208           0 :                         form = "%dth";
     209           0 :                         break;
     210             :                 }
     211           0 :                 break;
     212             :             case '4':
     213           0 :                 num = date[HOUR] - ((date[HOUR] > 12) ? 12 : 0);
     214           0 :                 break;
     215             :             case '$':
     216           0 :                 num = date[HOUR];
     217           0 :                 break;
     218             :             case '5':
     219             :             case '%':
     220           0 :                 num = date[MIN];
     221           0 :                 break;
     222             :             case '6':
     223           0 :                 ret.push_back(kor_week[date[WEEK]]);
     224           0 :                 break;
     225             :             case '^':
     226           0 :                 memcpy(cbuf, eng_week + date[WEEK] * 3, 3);
     227           0 :                 cbuf[3] = '.';
     228           0 :                 cbuf[4] = 0;
     229           0 :                 break;
     230             :             case '_':
     231           0 :                 strcpy(cbuf, en_week[date[WEEK]]);
     232           0 :                 break;
     233             :             case '7':
     234           0 :                 ret.push_back(0xB5A1);
     235           0 :                 ret.push_back((is_pm) ? 0xD281 : 0xB8E5);
     236           0 :                 break;
     237             :             case '&':
     238           0 :                 strcpy(cbuf, (is_pm) ? "p.m." : "a.m.");
     239           0 :                 break;
     240             :             case '+':
     241           0 :                 strcpy(cbuf, (is_pm) ? "P.M." : "A.M.");
     242           0 :                 break;
     243             :             case '8':                             // 2.5 feature
     244             :             case '9':
     245             : #if 0
     246             : // LATER
     247             :                 mkcurfilename(cbuf, *fmt);
     248             :                 for (i = 0; cbuf[i] != 0 && slen > 1; i++)
     249             :                 {                                 //for hangle filename
     250             :                     if (cbuf[i] & 0x80 && cbuf[i + 1] != 0)
     251             :                     {
     252             :                         *d++ = (cbuf[i] << 8) | cbuf[i + 1];
     253             :                         i++;
     254             :                     }
     255             :                     else
     256             :                         *d++ = cbuf[i];
     257             :                     slen--;
     258             :                 }
     259             : #endif
     260           0 :                 cbuf[0] = 0;
     261           0 :                 break;
     262             :             case '~':                             // 3.0b feature
     263           0 :                 if (fmt[1] == 0)
     264           0 :                     break;
     265           0 :                 fmt++;
     266           0 :                 if (*fmt == '6')
     267             :                 {
     268           0 :                     ret.push_back(china_week[date[WEEK]]);
     269           0 :                     break;
     270             :                 }
     271           0 :                 break;
     272             :             default:
     273           0 :                 if (*fmt == '\\' && *++fmt == 0)
     274           0 :                     goto done;
     275           0 :                 ret.push_back(*fmt);
     276             :         }
     277           0 :         if (num != -1)
     278           0 :             sprintf(cbuf, form, num);
     279           0 :         for (i = 0; 0 != cbuf[i]; i++)
     280             :         {
     281           0 :             ret.push_back(*(cbuf + i));
     282             :         }
     283             :     }
     284             :     done:
     285           0 :     return ret;
     286             : }
     287             : 
     288             : 
     289             : // tab(9)
     290             : 
     291           0 : Tab::Tab(void):HBox(CH_TAB)
     292             : {
     293           0 : }
     294             : 
     295             : 
     296             : // floating box
     297           0 : FBox::FBox(hchar hch):HBox(hch)
     298             : {
     299           0 :     prev = next = 0;
     300           0 :      zorder = 0;
     301           0 : }
     302             : 
     303             : 
     304           0 : FBox::~FBox()
     305             : {
     306           0 : }
     307             : 
     308             : 
     309             : // tbox(10) TABLE BOX MATH BUTTON HYPERTEXT
     310             : 
     311           0 : TxtBox::TxtBox(void):FBox(CH_TEXT_BOX), cell(0), plists(0)
     312             : {
     313           0 : }
     314             : 
     315             : 
     316           0 : TxtBox::~TxtBox(void)
     317             : {
     318           0 :     delete[]cell;
     319             : 
     320           0 :     for (int ii = 0; ii < nCell; ++ii)
     321             :     {
     322           0 :         std::list < HWPPara* >::iterator it = plists[ii].begin();
     323           0 :         for (; it != plists[ii].end(); ++it)
     324             :         {
     325           0 :             HWPPara* pPara = *it;
     326           0 :             delete pPara;
     327             :         }
     328             :     }
     329             : 
     330           0 :     std::list < HWPPara* >::iterator it = caption.begin();
     331           0 :     for (; it != caption.end(); ++it)
     332             :     {
     333           0 :         HWPPara* pPara = *it;
     334           0 :         delete pPara;
     335             :     }
     336             : 
     337           0 :     delete[]plists;
     338           0 : }
     339             : 
     340             : 
     341           0 : hunit TxtBox::Height(CharShape * csty)
     342             : {
     343           0 :     return (style.anchor_type == CHAR_ANCHOR) ? box_ys : csty->size;
     344             : }
     345             : 
     346             : 
     347             : // picture(11)
     348             : 
     349           0 : Picture::Picture(void):FBox(CH_PICTURE)
     350             : {
     351           0 :     follow = 0;
     352           0 :     ishyper = false;
     353           0 : }
     354             : 
     355             : 
     356           0 : Picture::~Picture(void)
     357             : {
     358           0 :     delete[]follow;
     359           0 :     if( pictype == PICTYPE_DRAW && picinfo.picdraw.hdo )
     360           0 :         delete (HWPDrawingObject *) picinfo.picdraw.hdo;
     361             : 
     362           0 :     std::list < HWPPara* >::iterator it = caption.begin();
     363           0 :     for (; it != caption.end(); ++it)
     364             :     {
     365           0 :         HWPPara* pPara = *it;
     366           0 :         delete pPara;
     367             :     }
     368           0 : }
     369             : 
     370             : 
     371           0 : int Picture::Type()
     372             : {
     373           0 :     return pictype;
     374             : }
     375             : 
     376             : 
     377           0 : hunit Picture::Height(CharShape * sty)
     378             : {
     379           0 :     return (style.anchor_type == CHAR_ANCHOR) ? box_ys : sty->size;
     380             : }
     381             : 
     382             : 
     383             : // line(14)
     384             : // hidden(15)
     385           0 : Hidden::~Hidden(void)
     386             : {
     387           0 :     std::list < HWPPara* >::iterator it = plist.begin();
     388           0 :     for (; it != plist.end(); ++it)
     389             :     {
     390           0 :         HWPPara* pPara = *it;
     391           0 :         delete pPara;
     392             :     }
     393           0 : }
     394             : 
     395             : 
     396             : // header/footer(16)
     397           0 : HeaderFooter::~HeaderFooter(void)
     398             : {
     399           0 :     std::list < HWPPara* >::iterator it = plist.begin();
     400           0 :     for (; it != plist.end(); ++it)
     401             :     {
     402           0 :         HWPPara* pPara = *it;
     403           0 :         delete pPara;
     404             :     }
     405           0 : }
     406             : 
     407             : 
     408             : // footnote(17)
     409           0 : Footnote::~Footnote(void)
     410             : {
     411           0 :     std::list < HWPPara* >::iterator it = plist.begin();
     412           0 :     for (; it != plist.end(); ++it)
     413             :     {
     414           0 :         HWPPara* pPara = *it;
     415           0 :         delete pPara;
     416             :     }
     417           0 : }
     418             : 
     419             : 
     420             : // auto number(18)
     421             : // new number(19)
     422             : // show page number (20)
     423             : // Ȧ¼öÂʽÃÀÛ/°¨Ãß±â (21)
     424             : 
     425             : // mail merge(22)
     426           0 : hchar_string MailMerge::GetString()
     427             : {
     428           0 :     return hchar_string();
     429             : }
     430             : 
     431             : 
     432             : // character compositon(23)
     433             : // hyphen(24)
     434             : // toc mark(25)
     435             : // index mark(26)
     436             : // outline(28)
     437             : 
     438             : #define OL_HANGL_JASO   0
     439             : #define OL_HANGL_KANATA 1
     440             : 
     441           0 : static hchar olHanglJaso(int num, int type)
     442             : {
     443             :     static const unsigned char han_init[] =
     444             :         { 0x88, 0x90, 0x94, 0x9c, 0xa0, 0xa4, 0xac, 0xb4, 0xb8, 0xc0, 0xc4, 0xc8, 0xcc, 0xd0 };
     445             :     static const unsigned char jung[] = { 3, 5, 7, 11, 13, 19, 20, 26, 27, 29, 30 };
     446             :     static const unsigned char jung2[] = { 3, 7, 13, 20, 27, 29, 30 };
     447             : 
     448           0 :     hchar hh = 0;
     449             : 
     450           0 :     if (type == OL_HANGL_JASO)
     451             :     {
     452           0 :         num = num % (14 + (sizeof(jung) / sizeof(char)));
     453             : 
     454           0 :         if (num < 14)
     455           0 :             hh = (han_init[num] << 8) | 'A';
     456             :         else
     457           0 :             hh = (jung[num - 14] << 5) | 0x8401;
     458             :     }
     459             :     else
     460             :     {
     461           0 :         if (num < 14)
     462           0 :             hh = (han_init[num] << 8) | 'a';
     463             :         else
     464             :         {
     465           0 :             int j = (num / 14) % (sizeof(jung2) / sizeof(char));
     466             : 
     467           0 :             num = num % 14;
     468           0 :             hh = (han_init[num] << 8) | (jung2[j] << 5) | 1;
     469             :         }
     470             :     }
     471           0 :     return hh;
     472             : }
     473             : 
     474             : 
     475           0 : static const hchar *GetOutlineStyleChars(int style)
     476             : {
     477             :     static const hchar out_bul_style_entry[5][8] =      // extern
     478             :     {
     479             :         {                                         // 0 OLSTY_BULLET1
     480             :             0x2f18, 0x2f12, 0x2f08, 0x2f02, 0x2f06, 0x2f00, 0x2043, 0x0000
     481             :         },
     482             :         {                                         // 1
     483             :             0x2f18, 0x2f12, 0x2f06, 0x2f00, 0x2f36, 0x2f30, 0x2043, 0x0000
     484             :         },
     485             :         {                                         // 2
     486             :             0x2f26, 0x2f20, 0x2f06, 0x2f00, 0x2f16, 0x2f10, 0x2043, 0x0000
     487             :         },
     488             :         {                                         // 3
     489             :             0x2f18, 0x2f16, 0x2f12, 0x2f10, 0x2f06, 0x2f00, 0x2043, 0x0000
     490             :         },
     491             :         {                                         //
     492             :             0xAC61, 0xB677, 0xB861, 0xB8F7, 0xB781, 0x0000
     493             :         },
     494             :     };
     495           0 :     if (style >= OLSTY_BULLET1 && style <= OLSTY_BULLET5)
     496           0 :         return out_bul_style_entry[style - OLSTY_BULLET1];
     497           0 :     return NULL;
     498             : }
     499             : 
     500             : 
     501           0 : static void getOutlineNumStr(int style, int level, int num, hchar * hstr)
     502             : {
     503             :     enum
     504             :     {
     505             :         U_ROM = 0x01, L_ROM = 0x02, U_ENG = 0x04, L_ENG = 0x08,
     506             :         HAN = 0x10, NUM = 0x20, L_BR = 0x40, R_BR = 0x80
     507             :     };
     508             :     static const unsigned char type_tbl[][MAX_OUTLINE_LEVEL] =
     509             :     {
     510             :         {
     511             :             U_ROM, HAN, NUM, HAN | R_BR, L_BR | NUM | R_BR,
     512             :             L_BR | HAN | R_BR, L_ROM | R_BR
     513             :         },
     514             :         {
     515             :             U_ROM, U_ENG, NUM, L_ENG | R_BR, L_BR | NUM | R_BR,
     516             :             L_BR | L_ENG | R_BR, L_ROM | R_BR
     517             :         },
     518             :         {
     519             :             NUM, HAN, L_BR | NUM | R_BR, L_BR | HAN | R_BR, NUM |
     520             :             R_BR, HAN | R_BR, L_ENG
     521             :         }
     522             :     };
     523           0 :     char fmt = type_tbl[style - OLSTY_NUMSIG1][level];
     524             :     char buf[80], *ptr;
     525             : 
     526           0 :     if (num < 1)
     527           0 :         num = 1;
     528           0 :     if (fmt & L_BR)
     529           0 :         *hstr++ = '(';
     530           0 :     if (fmt & NUM)
     531             :     {
     532           0 :         sprintf(buf, "%d", num);
     533           0 :         str2hstr(buf, hstr);
     534           0 :         hstr += strlen(buf);
     535             :     }
     536           0 :     else if (fmt & (U_ROM | L_ROM))
     537             :     {
     538           0 :         num2roman(num, buf);
     539           0 :         if (fmt & U_ROM)
     540             :         {
     541           0 :             ptr = buf;
     542           0 :             while (*ptr)
     543             :             {
     544           0 :                 *ptr = sal::static_int_cast<char>(toupper(*ptr));
     545           0 :                 ptr++;
     546             :             }
     547             :         }
     548           0 :         str2hstr(buf, hstr);
     549           0 :         hstr += strlen(buf);
     550             :     }
     551             :     else
     552             :     {
     553           0 :         num = (num - 1) % 26;
     554           0 :         if (fmt & U_ENG)
     555           0 :             *hstr++ = sal::static_int_cast<hchar>('A' + num);
     556           0 :         else if (fmt & L_ENG)
     557           0 :             *hstr++ = sal::static_int_cast<hchar>('a' + num);
     558           0 :         else if (fmt & HAN)
     559           0 :             *hstr++ = olHanglJaso(num, OL_HANGL_KANATA);
     560             :     }
     561           0 :     *hstr++ = (fmt & R_BR) ? ')' : '.';
     562           0 :     *hstr = 0;
     563           0 : }
     564             : 
     565             : 
     566             : enum
     567             : { OUTLINE_ON, OUTLINE_NUM };
     568             : 
     569             : /*  level Àº 0ºÎÅÍ ½ÃÀÛ. Áï 1.1.1. ÀÇ ·¹º§Àº 2ÀÌ´Ù.
     570             :     number´Â °ªÀÌ ±×´ë·Î µé¾î°¡ ÀÖ´Ù. Áï, 1.2.1¿¡´Â 1,2,1ÀÌ µé¾î°¡ ÀÖ´Ù.
     571             :     style Àº 1ºÎÅÍ °ªÀÌ µé¾î°¡ ÀÖ´Ù. hbox.h¿¡ Á¤ÀÇµÈ µ¥·Î..
     572             :  */
     573           0 : hchar_string Outline::GetUnicode() const
     574             : {
     575             :     const hchar *p;
     576             :      hchar buffer[255];
     577             : 
     578           0 :     buffer[0] = 0;
     579           0 :     if (kind == OUTLINE_NUM)
     580             :     {
     581             :         int levelnum;
     582           0 :         switch (shape)
     583             :         {
     584             :             case OLSTY_NUMS1:
     585             :             case OLSTY_NUMS2:
     586             :             {
     587             :                 char cur_num_str[10], buf[80];
     588             :                 int i;
     589             : 
     590           0 :                 buf[0] = 0;
     591           0 :                 for (i = 0; i <= level; i++)
     592             :                 {
     593           0 :                     levelnum = ((number[i] < 1) ? 1 : number[i]);
     594           0 :                     if (shape == OLSTY_NUMS2 && i && i == level)
     595           0 :                         sprintf(cur_num_str, "%d%c", levelnum, 0);
     596             :                     else
     597           0 :                         sprintf(cur_num_str, "%d%c", levelnum, '.');
     598           0 :                     strcat(buf, cur_num_str);
     599             :                 }
     600           0 :                 str2hstr(buf, buffer);
     601           0 :                 return hstr2ucsstr(buffer);
     602             :             }
     603             :             case OLSTY_NUMSIG1:
     604             :             case OLSTY_NUMSIG2:
     605             :             case OLSTY_NUMSIG3:
     606             :                 {
     607           0 :                 getOutlineNumStr(shape, level, number[level], buffer);
     608           0 :                 return hstr2ucsstr(buffer);
     609             :                 }
     610             :             case OLSTY_BULLET1:
     611             :             case OLSTY_BULLET2:
     612             :             case OLSTY_BULLET3:
     613             :             case OLSTY_BULLET4:
     614             :             case OLSTY_BULLET5:
     615             :                 {
     616           0 :                 p = GetOutlineStyleChars(shape);
     617           0 :                 buffer[0] = p[level];
     618           0 :                 buffer[1] = 0;
     619           0 :                      return hstr2ucsstr(buffer);
     620             :                 }
     621             :             case OLSTY_USER:
     622             :             case OLSTY_BULUSER:
     623             :                 {
     624             :                         char dest[80];
     625           0 :                     int l = 0;
     626           0 :                     int i = level;
     627           0 :                     if( deco[i][0] ){
     628           0 :                         buffer[l++] = deco[i][0];
     629             :                     }
     630             : /*  level Àº 0ºÎÅÍ ½ÃÀÛ. Áï 1.1.1. ÀÇ ·¹º§Àº 2ÀÌ´Ù.
     631             :     number´Â °ªÀÌ ±×´ë·Î µé¾î°¡ ÀÖ´Ù. Áï, 1.2.1¿¡´Â 1,2,1ÀÌ µé¾î°¡ ÀÖ´Ù.
     632             :     style Àº 1ºÎÅÍ °ªÀÌ µé¾î°¡ ÀÖ´Ù. hbox.h¿¡ Á¤ÀÇµÈ µ¥·Î..
     633             :  */
     634           0 :                     switch( user_shape[i] )
     635             :                     {
     636             :                         case 0:
     637           0 :                             buffer[l++] = '1' + number[i] - 1;
     638           0 :                             break;
     639             :                         case 1: /* ´ë¹®Àڷθ¶ */
     640             :                         case 2: /* ¼Ò¹®Àڷθ¶ */
     641           0 :                             num2roman(number[i], dest);
     642           0 :                             if( user_shape[i] == 1 ){
     643           0 :                                 char *ptr = dest;
     644           0 :                                 while( *ptr )
     645             :                                 {
     646           0 :                                     *ptr = sal::static_int_cast<char>(toupper(*ptr));
     647           0 :                                     ptr++;
     648             :                                 }
     649             :                             }
     650           0 :                             str2hstr(dest, buffer + l);
     651           0 :                             l += strlen(dest);
     652           0 :                             break;
     653             :                         case 3:
     654           0 :                             buffer[l++] = 'A' + number[i] -1;
     655           0 :                             break;
     656             :                         case 4:
     657           0 :                             buffer[l++] = 'a' + number[i] -1;
     658           0 :                             break;
     659             :                         case 5:
     660           0 :                             buffer[l++] = olHanglJaso(number[i] -1, OL_HANGL_KANATA);
     661           0 :                             break;
     662             :                         case 6:
     663           0 :                             buffer[l++] = olHanglJaso(number[i] -1, OL_HANGL_JASO);
     664           0 :                             break;
     665             :                         case 7: /* ÇÑÀÚ ¼ýÀÚ : ÀÏ¹Ý ¼ýÀڷΠǥÇö */
     666           0 :                             buffer[l++] = '1' + number[i] -1;
     667           0 :                             break;
     668             :                         case 8: /* ¿ø¼ýÀÚ */
     669           0 :                             buffer[l++] = 0x2e00 + number[i];
     670           0 :                             break;
     671             :                         case 9: /* ¿ø ¾ËÆĺª ¼Ò¹®ÀÚ */
     672           0 :                             buffer[l++] = 0x2c20 + number[i];
     673           0 :                             break;
     674             :                         case 10: /* ¿ø °¡³ª´Ù */
     675           0 :                             buffer[l++] = 0x2c50 + number[i] -1;
     676           0 :                             break;
     677             :                         case 11: /* ¿ø ¤¡ ¤¤ */
     678           0 :                             buffer[l++] = 0x2c40 + number[i] -1;
     679           0 :                             break;
     680             :                         case 12: /* À̾îÁø ¼ýÀÚ. */
     681             :                         {
     682             :                              char cur_num_str[10],buf[80];
     683             :                              int j;
     684           0 :                              buf[0] = 0;
     685           0 :                              for (j = 0; j <= level; j++)
     686             :                              {
     687           0 :                                   levelnum = ((number[j] < 1) ? 1 : number[j]);
     688           0 :                                   if ((j && j == level) || (j == level && deco[i][1]))
     689           0 :                                         sprintf(cur_num_str, "%d%c", levelnum, 0);
     690             :                                   else
     691           0 :                                         sprintf(cur_num_str, "%d%c", levelnum, '.');
     692           0 :                                   strcat(buf, cur_num_str);
     693             :                              }
     694           0 :                              str2hstr(buf, buffer + l);
     695           0 :                              l += strlen(buf);
     696             :                             break;
     697             :                         }
     698             :                         default:
     699           0 :                             buffer[l++] = user_shape[i];
     700           0 :                             break;
     701             :                     }
     702           0 :                     if( deco[i][1] ){
     703           0 :                         buffer[l++] = deco[i][1];
     704             :                     }
     705           0 :                     buffer[l] = 0;
     706           0 :                     return hstr2ucsstr(buffer);
     707             :                 }
     708             :         }
     709             :     }
     710           0 :     return hstr2ucsstr(buffer);
     711             : }
     712             : 
     713             : 
     714             : /* ¹­À½ ºóÄ­(30) */
     715             : /* °íÁ¤Æø ºóÄ­(31) */
     716             : 
     717             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10