LCOV - code coverage report
Current view: top level - writerfilter/source/dmapper - ConversionHelper.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 89 203 43.8 %
Date: 2012-08-25 Functions: 8 12 66.7 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 56 163 34.4 %

           Branch data     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                 :            : #include <ConversionHelper.hxx>
      20                 :            : #include <com/sun/star/table/BorderLine2.hpp>
      21                 :            : #include <com/sun/star/table/BorderLineStyle.hpp>
      22                 :            : #include <com/sun/star/lang/Locale.hpp>
      23                 :            : #include <com/sun/star/text/HoriOrientation.hpp>
      24                 :            : #include <com/sun/star/style/NumberingType.hpp>
      25                 :            : #include <editeng/borderline.hxx>
      26                 :            : #include <ooxml/resourceids.hxx>
      27                 :            : #include <rtl/ustrbuf.hxx>
      28                 :            : #include <tools/color.hxx>
      29                 :            : #include <algorithm>
      30                 :            : #include <functional>
      31                 :            : 
      32                 :            : using namespace com::sun::star;
      33                 :            : using namespace com::sun::star::table::BorderLineStyle;
      34                 :            : 
      35                 :            : namespace writerfilter {
      36                 :            : namespace dmapper{
      37                 :            : namespace ConversionHelper{
      38                 :            : 
      39                 :            : const sal_Int16  API_LINE_SOLID    = 0;
      40                 :            : const sal_Int16  API_LINE_DOTTED   = 1;
      41                 :            : const sal_Int16  API_LINE_DASHED   = 2;
      42                 :            : 
      43                 :            : #define TWIP_TO_MM100(TWIP)     ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
      44                 :            : 
      45                 :            : //line definitions in 1/100 mm
      46                 :            : #define LINE_WIDTH_0            2
      47                 :            : #define LINE_WIDTH_1            36
      48                 :            : #define LINE_WIDTH_2            89
      49                 :            : #define LINE_WIDTH_3            142
      50                 :            : 
      51                 :            : #define DOUBLE_LINE0_OUT    LINE_WIDTH_0
      52                 :            : #define DOUBLE_LINE0_IN     LINE_WIDTH_0
      53                 :            : #define DOUBLE_LINE0_DIST   LINE_WIDTH_1
      54                 :            : 
      55                 :            : #define DOUBLE_LINE1_OUT    LINE_WIDTH_1
      56                 :            : #define DOUBLE_LINE1_IN     LINE_WIDTH_1
      57                 :            : #define DOUBLE_LINE1_DIST   LINE_WIDTH_1
      58                 :            : 
      59                 :            : #define DOUBLE_LINE2_OUT    LINE_WIDTH_2
      60                 :            : #define DOUBLE_LINE2_IN     LINE_WIDTH_2
      61                 :            : #define DOUBLE_LINE2_DIST   LINE_WIDTH_2
      62                 :            : 
      63                 :            : #define DOUBLE_LINE3_OUT    LINE_WIDTH_2
      64                 :            : #define DOUBLE_LINE3_IN     LINE_WIDTH_1
      65                 :            : #define DOUBLE_LINE3_DIST   LINE_WIDTH_2
      66                 :            : 
      67                 :            : #define DOUBLE_LINE4_OUT    LINE_WIDTH_1
      68                 :            : #define DOUBLE_LINE4_IN     LINE_WIDTH_2
      69                 :            : #define DOUBLE_LINE4_DIST   LINE_WIDTH_1
      70                 :            : 
      71                 :            : #define DOUBLE_LINE5_OUT    LINE_WIDTH_3
      72                 :            : #define DOUBLE_LINE5_IN     LINE_WIDTH_2
      73                 :            : #define DOUBLE_LINE5_DIST   LINE_WIDTH_2
      74                 :            : 
      75                 :            : #define DOUBLE_LINE6_OUT    LINE_WIDTH_2
      76                 :            : #define DOUBLE_LINE6_IN     LINE_WIDTH_3
      77                 :            : #define DOUBLE_LINE6_DIST   LINE_WIDTH_2
      78                 :            : 
      79                 :            : #define DOUBLE_LINE7_OUT    LINE_WIDTH_0
      80                 :            : #define DOUBLE_LINE7_IN     LINE_WIDTH_0
      81                 :            : #define DOUBLE_LINE7_DIST   LINE_WIDTH_2
      82                 :            : 
      83                 :            : #define DOUBLE_LINE8_OUT    LINE_WIDTH_1
      84                 :            : #define DOUBLE_LINE8_IN     LINE_WIDTH_0
      85                 :            : #define DOUBLE_LINE8_DIST   LINE_WIDTH_2
      86                 :            : 
      87                 :            : #define DOUBLE_LINE9_OUT    LINE_WIDTH_2
      88                 :            : #define DOUBLE_LINE9_IN     LINE_WIDTH_0
      89                 :            : #define DOUBLE_LINE9_DIST   LINE_WIDTH_2
      90                 :            : 
      91                 :            : #define DOUBLE_LINE10_OUT   LINE_WIDTH_3
      92                 :            : #define DOUBLE_LINE10_IN    LINE_WIDTH_0
      93                 :            : #define DOUBLE_LINE10_DIST  LINE_WIDTH_2
      94                 :            : 
      95                 :          0 : sal_Int32 MakeBorderLine( sal_Int32 nSprmValue, table::BorderLine2& rToFill )
      96                 :            : {
      97                 :            :     //TODO: Lines are always solid
      98                 :            :     //Border
      99                 :            :     //borders are defined as:
     100                 :            :     // 0x XX XX XX XX
     101                 :            :     //    || || || ||
     102                 :            :     //    || || ||  ---- Line width in 1/8 pt
     103                 :            :     //    || || ||
     104                 :            :     //    || ||  ------- Line type: 0 - none 1 - single ... 25 - engrave 3D and 64 - 230 page borders
     105                 :            :     //    || ||
     106                 :            :     //    ||  ---------- Line color
     107                 :            :     //    ||
     108                 :            :     //     ------------- seven bits line space
     109                 :            :     //    -------------- first bit: with shading
     110                 :          0 :     sal_Int16 nLineThicknessTwip = (sal_Int16)((nSprmValue & 0xff) * 20)/8L ;
     111                 :          0 :     sal_Int32 nLineType       = ((nSprmValue & 0xff00) >> 8);
     112                 :          0 :     sal_Int32 nLineColor    = (nSprmValue & 0xff0000)>>16;
     113                 :          0 :     sal_Int32 nLineDistance = (((nSprmValue & 0x3f000000)>>24) * 2540 + 36)/72L;
     114                 :          0 :     MakeBorderLine( nLineThicknessTwip, nLineType, nLineColor, rToFill, false);
     115                 :          0 :     return nLineDistance;
     116                 :            : }
     117                 :       1246 : void MakeBorderLine( sal_Int32 nLineThickness,   sal_Int32 nLineType,
     118                 :            :                                             sal_Int32 nLineColor,
     119                 :            :                                             table::BorderLine2& rToFill, bool bIsOOXML )
     120                 :            : {
     121                 :            :     static const sal_Int32 aBorderDefColor[] =
     122                 :            :     {
     123                 :            :         // The first item means automatic color (COL_AUTO), but we
     124                 :            :         // do not use it anyway (see the next statement) .-)
     125                 :            :         0, COL_BLACK, COL_LIGHTBLUE, COL_LIGHTCYAN, COL_LIGHTGREEN,
     126                 :            :         COL_LIGHTMAGENTA, COL_LIGHTRED, COL_YELLOW, COL_WHITE, COL_BLUE,
     127                 :            :         COL_CYAN, COL_GREEN, COL_MAGENTA, COL_RED, COL_BROWN, COL_GRAY,
     128                 :            :         COL_LIGHTGRAY
     129                 :            :     };
     130                 :            :     //no auto color for borders
     131         [ +  + ]:       1246 :     if(!nLineColor)
     132                 :        813 :         ++nLineColor;
     133 [ -  + ][ #  # ]:       1246 :     if(!bIsOOXML && sal::static_int_cast<sal_uInt32>(nLineColor) < SAL_N_ELEMENTS(aBorderDefColor))
                 [ -  + ]
     134                 :          0 :         nLineColor = aBorderDefColor[nLineColor];
     135                 :            : 
     136                 :       1246 :     sal_Int16 nLineStyle = NONE;
     137                 :            :     // Map to our border types, we should use of one equal line
     138                 :            :     // thickness, or one of smaller thickness. If too small we
     139                 :            :     // can make the defecit up in additional white space or
     140                 :            :     // object size
     141   [ +  -  +  +  :       1246 :     switch(nLineType)
          +  -  +  -  +  
             +  +  +  +  
                      + ]
     142                 :            :     {
     143                 :            :         // First the single lines
     144                 :            :         case  1:
     145                 :            :         case  2:
     146                 :            :         case  5:
     147                 :        115 :             nLineStyle = SOLID;
     148                 :        115 :             break;
     149                 :            :         // Dotted and dashed lines
     150                 :            :         case  6:
     151                 :          0 :             nLineStyle = DOTTED;
     152                 :          0 :             break;
     153                 :            :         case  7:
     154                 :            :         case 22:
     155                 :          8 :             nLineStyle = DASHED;
     156                 :          8 :             break;
     157                 :            :         // and the unsupported special cases which we map to a single line
     158                 :            :         case  8:
     159                 :            :         case  9:
     160                 :            :         case 20:
     161                 :         12 :             nLineStyle = SOLID;
     162                 :         12 :             break;
     163                 :            :         // Double line
     164                 :            :         case 3:
     165                 :            :         case 10: //Don't have tripple so use double
     166                 :            :         case 21:
     167                 :            :         case 23:
     168                 :         55 :             nLineStyle = DOUBLE;
     169                 :         55 :             break;
     170                 :            :         case 11:
     171                 :            :         case 13: //Don't have thin thick thin, so use thick thin
     172                 :          0 :             nLineStyle = THINTHICK_SMALLGAP;
     173                 :          0 :             break;
     174                 :            :         case 12:
     175                 :         30 :             nLineStyle = THICKTHIN_SMALLGAP;
     176                 :         30 :             break;
     177                 :            :         case 14:
     178                 :          0 :             nLineStyle = THINTHICK_MEDIUMGAP;
     179                 :          0 :             break;
     180                 :            :         case 15:
     181                 :            :         case 16: //Don't have thin thick thin, so use thick thin
     182                 :         57 :             nLineStyle = THICKTHIN_MEDIUMGAP;
     183                 :         57 :             break;
     184                 :            :         case 17:
     185                 :         57 :             nLineStyle = THINTHICK_LARGEGAP;
     186                 :         57 :             break;
     187                 :            :         case 18:
     188                 :            :         case 19: //Don't have thin thick thin, so use thick thin
     189                 :        111 :             nLineStyle = THICKTHIN_LARGEGAP;
     190                 :        111 :             break;
     191                 :            :         // Embossed and engraved lines
     192                 :            :         case 24:
     193                 :         48 :             nLineStyle = EMBOSSED;
     194                 :         48 :             break;
     195                 :            :         case 25:
     196                 :         48 :             nLineStyle = ENGRAVED;
     197                 :         48 :             break;
     198                 :            :         case 0:
     199                 :            :         case 255:
     200                 :            :         default:
     201                 :        705 :             break;
     202                 :            :     }
     203                 :            : 
     204                 :       1246 :     rToFill.LineStyle = nLineStyle;
     205                 :            :     double const fConverted( (NONE == nLineStyle) ? 0.0 :
     206         [ +  + ]:       1246 :         ::editeng::ConvertBorderWidthFromWord(nLineStyle, nLineThickness));
     207                 :       1246 :     rToFill.LineWidth = convertTwipToMM100(fConverted);
     208                 :       1246 :     rToFill.Color = nLineColor;
     209                 :       1246 : }
     210                 :            : 
     211                 :          3 : void lcl_SwapQuotesInField(OUString &rFmt)
     212                 :            : {
     213                 :            :     //Swap unescaped " and ' with ' and "
     214                 :          3 :     sal_Int32 nLen = rFmt.getLength();
     215         [ +  - ]:          3 :     OUStringBuffer aBuffer( rFmt.getStr() );
     216                 :          3 :     const sal_Unicode* pFmt = rFmt.getStr();
     217         [ +  + ]:         36 :     for (sal_Int32 nI = 0; nI < nLen; ++nI)
     218                 :            :     {
     219 [ -  + ][ #  # ]:         33 :         if ((pFmt[nI] == '\"') && (!nI || pFmt[nI-1] != '\\'))
                 [ #  # ]
     220                 :          0 :             aBuffer[nI] = '\'';
     221 [ -  + ][ #  # ]:         33 :         else if ((pFmt[nI] == '\'') && (!nI || pFmt[nI-1] != '\\'))
                 [ #  # ]
     222                 :          0 :             aBuffer[nI] = '\"';
     223                 :            :     }
     224         [ +  - ]:          3 :     rFmt = aBuffer.makeStringAndClear();
     225                 :          3 : }
     226                 :          0 : bool lcl_IsNotAM(OUString& rFmt, sal_Int32 nPos)
     227                 :            : {
     228                 :            :     return (
     229                 :          0 :             (nPos == rFmt.getLength() - 1) ||
     230                 :            :             (
     231                 :          0 :             (rFmt[nPos+1] != 'M') &&
     232                 :          0 :             (rFmt[nPos+1] != 'm')
     233                 :            :             )
     234   [ #  #  #  #  :          0 :         );
                   #  # ]
     235                 :            : }
     236                 :            : 
     237                 :          3 : OUString ConvertMSFormatStringToSO(
     238                 :            :         const OUString& rFormat, lang::Locale& rLocale, bool bHijri)
     239                 :            : {
     240                 :          3 :     OUString sFormat(rFormat);
     241         [ +  - ]:          3 :     lcl_SwapQuotesInField(sFormat);
     242                 :            : 
     243                 :            :     //#102782#, #102815#, #108341# & #111944# have to work at the same time :-)
     244                 :          3 :     bool bForceJapanese(false);
     245                 :          3 :     bool bForceNatNum(false);
     246                 :          3 :     sal_Int32 nLen = sFormat.getLength();
     247                 :          3 :     sal_Int32 nI = 0;
     248                 :            : //    const sal_Unicode* pFormat = sFormat.getStr();
     249         [ +  - ]:          3 :     OUStringBuffer aNewFormat( sFormat );
     250         [ +  + ]:         36 :     while (nI < nLen)
     251                 :            :     {
     252         [ -  + ]:         33 :         if (aNewFormat[nI] == '\\')
     253                 :          0 :             nI++;
     254         [ -  + ]:         33 :         else if (aNewFormat[nI] == '\"')
     255                 :            :         {
     256                 :          0 :             ++nI;
     257                 :            :             //While not at the end and not at an unescaped end quote
     258 [ #  # ][ #  # ]:          0 :             while ((nI < nLen) && (!(aNewFormat[nI] == '\"') && (aNewFormat[nI-1] != '\\')))
         [ #  # ][ #  # ]
     259                 :          0 :                 ++nI;
     260                 :            :         }
     261                 :            :         else //normal unquoted section
     262                 :            :         {
     263                 :         33 :             sal_Unicode nChar = aNewFormat[nI];
     264         [ -  + ]:         33 :             if (nChar == 'O')
     265                 :            :             {
     266                 :          0 :                 aNewFormat[nI] = 'M';
     267                 :          0 :                 bForceNatNum = true;
     268                 :            :             }
     269         [ -  + ]:         33 :             else if (nChar == 'o')
     270                 :            :             {
     271                 :          0 :                 aNewFormat[nI] = 'm';
     272                 :          0 :                 bForceNatNum = true;
     273                 :            :             }
     274 [ -  + ][ #  # ]:         33 :             else if ((nChar == 'A') && lcl_IsNotAM(sFormat, nI))
                 [ -  + ]
     275                 :            :             {
     276                 :          0 :                 aNewFormat[nI] = 'D';
     277                 :          0 :                 bForceNatNum = true;
     278                 :            :             }
     279 [ +  - ][ -  + ]:         33 :             else if ((nChar == 'g') || (nChar == 'G'))
     280                 :          0 :                 bForceJapanese = true;
     281 [ -  + ][ #  # ]:         33 :             else if ((nChar == 'a') && lcl_IsNotAM(sFormat, nI))
                 [ -  + ]
     282                 :          0 :                 bForceJapanese = true;
     283         [ -  + ]:         33 :             else if (nChar == 'E')
     284                 :            :             {
     285 [ #  # ][ #  # ]:          0 :                 if ((nI != nLen-1) && (aNewFormat[nI+1] == 'E'))
                 [ #  # ]
     286                 :            :                 {
     287                 :            :                     //todo: this cannot be the right way to replace a part of the string!
     288                 :          0 :                     aNewFormat[nI] = 'Y';
     289                 :          0 :                     aNewFormat[nI + 1] = 'Y';
     290         [ #  # ]:          0 :                     aNewFormat.insert(nI + 2, "YY");
     291                 :          0 :                     nLen+=2;
     292                 :          0 :                     nI+=3;
     293                 :            :                 }
     294                 :          0 :                 bForceJapanese = true;
     295                 :            :             }
     296         [ -  + ]:         33 :             else if (nChar == 'e')
     297                 :            :             {
     298 [ #  # ][ #  # ]:          0 :                 if ((nI != nLen-1) && (aNewFormat[nI+1] == 'e'))
                 [ #  # ]
     299                 :            :                 {
     300                 :            :                     //todo: this cannot be the right way to replace a part of the string!
     301                 :          0 :                     aNewFormat[nI] = 'y';
     302                 :          0 :                     aNewFormat[nI + 1] = 'y';
     303         [ #  # ]:          0 :                     aNewFormat.insert(nI + 2, "yy");
     304                 :          0 :                     nLen+=2;
     305                 :          0 :                     nI+=3;
     306                 :            :                 }
     307                 :          0 :                 bForceJapanese = true;
     308                 :            :             }
     309         [ -  + ]:         33 :             else if (nChar == '/')
     310                 :            :             {
     311                 :            :                 // MM We have to escape '/' in case it's used as a char
     312                 :            :                 //todo: this cannot be the right way to replace a part of the string!
     313                 :          0 :                 aNewFormat[nI] = '\\';
     314         [ #  # ]:          0 :                 aNewFormat.insert(nI + 1, "/");
     315                 :          0 :                 nI++;
     316                 :          0 :                 nLen++;
     317                 :            :             }
     318                 :            :         }
     319                 :         33 :         ++nI;
     320                 :            :     }
     321                 :            : 
     322         [ -  + ]:          3 :     if (bForceNatNum)
     323                 :          0 :         bForceJapanese = true;
     324                 :            : 
     325         [ -  + ]:          3 :     if (bForceJapanese)
     326                 :            :     {
     327                 :          0 :         rLocale.Language = "ja";
     328                 :          0 :         rLocale.Country = "JP";
     329                 :            :     }
     330                 :            : 
     331         [ -  + ]:          3 :     if (bForceNatNum)
     332                 :            :     {
     333         [ #  # ]:          0 :         aNewFormat.insert( 0, "[NatNum1][$-411]");
     334                 :            :     }
     335                 :            : 
     336         [ -  + ]:          3 :     if (bHijri)
     337                 :            :     {
     338         [ #  # ]:          0 :         aNewFormat.insert( 0, "[~hijri]");
     339                 :            :     }
     340         [ +  - ]:          3 :     return aNewFormat.makeStringAndClear();
     341                 :            : 
     342                 :            : }
     343                 :            : 
     344                 :            : 
     345                 :      15059 : sal_Int32 convertTwipToMM100(sal_Int32 _t)
     346                 :            : {
     347         [ +  + ]:      15059 :     return TWIP_TO_MM100( _t );
     348                 :            : }
     349                 :            : 
     350                 :            : 
     351                 :         54 : sal_Int32 convertEMUToMM100(sal_Int32 _t)
     352                 :            : {
     353                 :         54 :     return _t / 360;
     354                 :            : }
     355                 :            : 
     356                 :            : /*-------------------------------------------------------------------------
     357                 :            :     contains a color from 0xTTRRGGBB to 0xTTRRGGBB
     358                 :            :   -----------------------------------------------------------------------*/
     359                 :          0 : sal_Int32 ConvertColor(sal_Int32 nWordColor)
     360                 :            : {
     361                 :            :     sal_uInt8
     362                 :          0 :         r(static_cast<sal_uInt8>(nWordColor&0xFF)),
     363                 :          0 :         g(static_cast<sal_uInt8>(((nWordColor)>>8)&0xFF)),
     364                 :          0 :         b(static_cast<sal_uInt8>((nWordColor>>16)&0xFF)),
     365                 :          0 :         t(static_cast<sal_uInt8>((nWordColor>>24)&0xFF));
     366                 :          0 :     sal_Int32 nRet = (t<<24) + (r<<16) + (g<<8) + b;
     367                 :          0 :     return nRet;
     368                 :            : }
     369                 :            : 
     370                 :            : 
     371                 :          0 : sal_Int16 convertTableJustification( sal_Int32 nIntValue )
     372                 :            : {
     373                 :          0 :     sal_Int16 nOrient = text::HoriOrientation::LEFT_AND_WIDTH;
     374      [ #  #  # ]:          0 :     switch( nIntValue )
     375                 :            :     {
     376                 :          0 :         case 1 : nOrient = text::HoriOrientation::CENTER; break;
     377                 :          0 :         case 2 : nOrient = text::HoriOrientation::RIGHT; break;
     378                 :            :         case 0 :
     379                 :            :         //no break
     380                 :            :         default:;
     381                 :            : 
     382                 :            :     }
     383                 :          0 :     return nOrient;
     384                 :            : }
     385                 :            : 
     386                 :        825 : sal_Int16 ConvertNumberingType(sal_Int32 nNFC)
     387                 :            : {
     388                 :            :     sal_Int16 nRet;
     389   [ +  +  +  -  :        825 :     switch(nNFC)
          -  -  +  +  +  
          +  -  -  -  -  
          -  -  -  -  -  
          -  -  -  -  -  
          -  -  -  -  -  
                      - ]
     390                 :            :     {
     391                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_decimal:
     392                 :            :         case 0:
     393                 :        387 :             nRet = style::NumberingType::ARABIC;
     394                 :        387 :             break;
     395                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_upperRoman:
     396                 :            :         case 1:
     397                 :          3 :             nRet = style::NumberingType::ROMAN_UPPER;
     398                 :          3 :             break;
     399                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_lowerRoman:
     400                 :            :         case 2:
     401                 :        177 :             nRet = style::NumberingType::ROMAN_LOWER;
     402                 :        177 :             break;
     403                 :            :         case 3:
     404                 :          0 :             nRet = style::NumberingType::CHARS_UPPER_LETTER_N;
     405                 :          0 :             break;
     406                 :            :         case 4:
     407                 :          0 :             nRet = style::NumberingType::CHARS_LOWER_LETTER_N;
     408                 :          0 :             break;
     409                 :            :         case 5:
     410                 :          0 :             nRet = style::NumberingType::ARABIC;
     411                 :          0 :             break;//ORDINAL
     412                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_bullet:
     413                 :            :         case 23:
     414                 :            :         case 25:
     415                 :        204 :             nRet = style::NumberingType::CHAR_SPECIAL;
     416                 :        204 :         break;
     417                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_none:
     418                 :            :         case 255:
     419                 :          3 :             nRet = style::NumberingType::NUMBER_NONE;
     420                 :          3 :             break;
     421                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_upperLetter:
     422                 :          3 :             nRet = style::NumberingType::CHARS_UPPER_LETTER;
     423                 :          3 :             break;
     424                 :            :         case  NS_ooxml::LN_Value_ST_NumberFormat_lowerLetter:
     425                 :         48 :             nRet = style::NumberingType::CHARS_LOWER_LETTER;
     426                 :         48 :             break;
     427                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_iroha:
     428                 :          0 :             nRet = style::NumberingType::IROHA_HALFWIDTH_JA;
     429                 :          0 :             break;
     430                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_irohaFullWidth:
     431                 :          0 :             nRet = style::NumberingType::IROHA_FULLWIDTH_JA;
     432                 :          0 :             break;
     433                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_aiueo:
     434                 :          0 :             nRet = style::NumberingType::AIU_HALFWIDTH_JA;
     435                 :          0 :             break;
     436                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_aiueoFullWidth:
     437                 :          0 :             nRet = style::NumberingType::AIU_FULLWIDTH_JA;
     438                 :          0 :             break;
     439                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_hebrew2:
     440                 :          0 :             nRet = style::NumberingType::CHARS_HEBREW;
     441                 :          0 :             break;
     442                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_thaiLetters:
     443                 :          0 :             nRet = style::NumberingType::CHARS_THAI;
     444                 :          0 :             break;
     445                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_russianLower:
     446                 :          0 :             nRet = style::NumberingType::CHARS_CYRILLIC_LOWER_LETTER_RU;
     447                 :          0 :             break;
     448                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_russianUpper:
     449                 :          0 :             nRet = style::NumberingType::CHARS_CYRILLIC_UPPER_LETTER_RU;
     450                 :          0 :             break;
     451                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_decimalEnclosedCircleChinese:
     452                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_ideographEnclosedCircle:
     453                 :          0 :             nRet = style::NumberingType::CIRCLE_NUMBER;
     454                 :          0 :             break;
     455                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_ideographTraditional:
     456                 :          0 :             nRet = style::NumberingType::TIAN_GAN_ZH;
     457                 :          0 :             break;
     458                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_ideographZodiac:
     459                 :          0 :             nRet = style::NumberingType::DI_ZI_ZH;
     460                 :          0 :             break;
     461                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_ganada:
     462                 :          0 :             nRet = style::NumberingType::HANGUL_SYLLABLE_KO;
     463                 :          0 :             break;
     464                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_chosung:
     465                 :          0 :             nRet = style::NumberingType::HANGUL_JAMO_KO;
     466                 :          0 :             break;
     467                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_koreanDigital:
     468                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_koreanCounting:
     469                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_koreanDigital2:
     470                 :          0 :             nRet = style::NumberingType::NUMBER_HANGUL_KO;
     471                 :          0 :             break;
     472                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_ideographLegalTraditional:
     473                 :          0 :             nRet = style::NumberingType::NUMBER_UPPER_ZH_TW;
     474                 :          0 :             break;
     475                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_arabicAlpha:
     476                 :          0 :             nRet = style::NumberingType::CHARS_ARABIC;
     477                 :          0 :             break;
     478                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_hindiVowels:
     479                 :          0 :             nRet = style::NumberingType::CHARS_NEPALI;
     480                 :          0 :             break;
     481                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_japaneseLegal:
     482                 :          0 :             nRet = style::NumberingType::NUMBER_TRADITIONAL_JA;
     483                 :          0 :             break;
     484                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_chineseCounting:
     485                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_japaneseCounting:
     486                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_taiwaneseCounting:
     487                 :            :         case NS_ooxml::LN_Value_ST_NumberFormat_ideographDigital:
     488                 :          0 :             nRet = style::NumberingType::NUMBER_LOWER_ZH;
     489                 :          0 :             break;
     490                 :          0 :         default: nRet = style::NumberingType::ARABIC;
     491                 :            :     }
     492                 :            : /*  TODO: Lots of additional values are available - some are supported in the I18 framework
     493                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_ordinal = 91682;
     494                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_cardinalText = 91683;
     495                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_ordinalText = 91684;
     496                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_hex = 91685;
     497                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_chicago = 91686;
     498                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_decimalFullWidth = 91691;
     499                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_decimalHalfWidth = 91692;
     500                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_japaneseDigitalTenThousand = 91694;
     501                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_decimalEnclosedCircle = 91695;
     502                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_decimalFullWidth2 = 91696;
     503                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_decimalZero = 91699;
     504                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_decimalEnclosedFullstop = 91703;
     505                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_decimalEnclosedParen = 91704;
     506                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_ideographZodiacTraditional = 91709;
     507                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_taiwaneseCountingThousand = 91712;
     508                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_taiwaneseDigital = 91713;
     509                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_chineseLegalSimplified = 91715;
     510                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_chineseCountingThousand = 91716;
     511                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_koreanLegal = 91719;
     512                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_vietnameseCounting = 91721;
     513                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_numberInDash = 91725;
     514                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_arabicAbjad:
     515                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_hebrew1 = 91726;
     516                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_hindiConsonants = 91731;
     517                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_hindiNumbers = 91732;
     518                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_hindiCounting = 91733;
     519                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_thaiNumbers = 91735;
     520                 :            :     NS_ooxml::LN_Value_ST_NumberFormat_thaiCounting = 91736;*/
     521                 :        825 :     return nRet;
     522                 :            : }
     523                 :            : 
     524                 :            : 
     525                 :            : } // namespace ConversionHelper
     526                 :            : } //namespace dmapper
     527 [ +  - ][ +  - ]:         60 : } //namespace writerfilter
     528                 :            : 
     529                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10