LCOV - code coverage report
Current view: top level - workdir/unxlngi6.pro/CustomTarget/writerfilter/source - OOXMLFactory_dml-textCharacter.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 35 128 27.3 %
Date: 2012-08-25 Functions: 10 13 76.9 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 30 333 9.0 %

           Branch data     Line data    Source code
       1                 :            : 
       2                 :            : #include "doctok/sprmids.hxx"
       3                 :            : #include "doctok/resourceids.hxx"
       4                 :            : #include "ooxml/resourceids.hxx"
       5                 :            : #include "OOXMLFactory_values.hxx"
       6                 :            : #include "OOXMLFactory_dml-textCharacter.hxx"
       7                 :            : #include "ooxml/OOXMLFastHelper.hxx"
       8                 :            :     
       9                 :            : #ifdef _MSC_VER
      10                 :            : #pragma warning(disable:4065) // switch statement contains 'default' but no 'case' labels
      11                 :            : #endif
      12                 :            : 
      13                 :            : namespace writerfilter {
      14                 :            : namespace ooxml {
      15                 :            : 
      16                 :            : /// @cond GENERATED
      17                 :            :     
      18                 :            : typedef rtl::Static < osl::Mutex, OOXMLFactory_dml_textCharacter > OOXMLFactory_dml_textCharacter_Mutex;
      19                 :            : 
      20                 :          8 : OOXMLFactory_dml_textCharacter::OOXMLFactory_dml_textCharacter()
      21                 :            : {
      22                 :            :     // multi-thread-safe mutex for all platforms
      23                 :            :     
      24 [ +  - ][ +  - ]:          8 :     osl::MutexGuard aGuard(OOXMLFactory_dml_textCharacter_Mutex::get());
                 [ +  - ]
      25                 :          8 : }
      26                 :            : 
      27                 :          8 : OOXMLFactory_dml_textCharacter::~OOXMLFactory_dml_textCharacter()
      28                 :            : {
      29         [ -  + ]:         16 : }
      30                 :            : 
      31                 :         20 : OOXMLFactory_ns::Pointer_t OOXMLFactory_dml_textCharacter::m_pInstance;
      32                 :            :     
      33                 :       2321 : OOXMLFactory_ns::Pointer_t OOXMLFactory_dml_textCharacter::getInstance()
      34                 :            : {
      35         [ +  + ]:       2321 :     if (m_pInstance.get() == NULL)
      36         [ +  - ]:          8 :         m_pInstance.reset(new OOXMLFactory_dml_textCharacter());
      37                 :            :     
      38                 :       2321 :     return m_pInstance;
      39                 :            : }
      40                 :            : 
      41                 :          8 : AttributeToResourceMapPointer OOXMLFactory_dml_textCharacter::createAttributeToResourceMap(Id nId)
      42                 :            : {
      43 [ +  - ][ +  - ]:          8 :     AttributeToResourceMapPointer pMap(new AttributeToResourceMap());
                 [ +  - ]
      44                 :            :     
      45      [ +  -  - ]:          8 :     switch (nId)
      46                 :            :     {
      47                 :            :     case NN_dml_textCharacter|DEFINE_CT_TextFont:
      48                 :            :       // CT_TextFont
      49 [ +  - ][ +  - ]:          8 :         (*pMap)[OOXML_typeface] = AttributeInfo(RT_String, NN_dml_textCharacter|DEFINE_ST_TextTypeface);
      50 [ +  - ][ +  - ]:          8 :         (*pMap)[OOXML_panose] = AttributeInfo(RT_Hex, NN_dml_textCharacter|DEFINE_ST_Panose);
      51                 :            :       // empty resource: OOXML_pitchFamily
      52                 :            :       // empty resource: OOXML_charset
      53                 :          8 :         break;
      54                 :            :     case NN_dml_textCharacter|DEFINE_CT_TextCharacterProperties:
      55                 :            :       // CT_TextCharacterProperties
      56 [ #  # ][ #  # ]:          0 :         (*pMap)[OOXML_kumimoji] = AttributeInfo(RT_Boolean, 0);
      57 [ #  # ][ #  # ]:          0 :         (*pMap)[OOXML_lang] = AttributeInfo(RT_String, NN_dml_textCharacter|DEFINE_ST_TextLanguageID);
      58 [ #  # ][ #  # ]:          0 :         (*pMap)[OOXML_altLang] = AttributeInfo(RT_String, NN_dml_textCharacter|DEFINE_ST_TextLanguageID);
      59 [ #  # ][ #  # ]:          0 :         (*pMap)[OOXML_sz] = AttributeInfo(RT_Integer, NN_dml_textCharacter|DEFINE_ST_TextFontSize);
      60 [ #  # ][ #  # ]:          0 :         (*pMap)[OOXML_b] = AttributeInfo(RT_Boolean, 0);
      61 [ #  # ][ #  # ]:          0 :         (*pMap)[OOXML_i] = AttributeInfo(RT_Boolean, 0);
      62 [ #  # ][ #  # ]:          0 :         (*pMap)[OOXML_u] = AttributeInfo(RT_List, NN_dml_textCharacter|DEFINE_ST_TextUnderlineType);
      63 [ #  # ][ #  # ]:          0 :         (*pMap)[OOXML_strike] = AttributeInfo(RT_List, NN_dml_textCharacter|DEFINE_ST_TextStrikeType);
      64 [ #  # ][ #  # ]:          0 :         (*pMap)[OOXML_kern] = AttributeInfo(RT_Integer, NN_dml_textCharacter|DEFINE_ST_TextNonNegativePoint);
      65 [ #  # ][ #  # ]:          0 :         (*pMap)[OOXML_cap] = AttributeInfo(RT_List, NN_dml_textCharacter|DEFINE_ST_TextCapsType);
      66 [ #  # ][ #  # ]:          0 :         (*pMap)[OOXML_spc] = AttributeInfo(RT_Integer, NN_dml_textCharacter|DEFINE_ST_TextPoint);
      67 [ #  # ][ #  # ]:          0 :         (*pMap)[OOXML_normalizeH] = AttributeInfo(RT_Boolean, 0);
      68                 :            :       // empty resource: OOXML_baseline
      69 [ #  # ][ #  # ]:          0 :         (*pMap)[OOXML_noProof] = AttributeInfo(RT_Boolean, 0);
      70 [ #  # ][ #  # ]:          0 :         (*pMap)[OOXML_dirty] = AttributeInfo(RT_Boolean, 0);
      71 [ #  # ][ #  # ]:          0 :         (*pMap)[OOXML_err] = AttributeInfo(RT_Boolean, 0);
      72 [ #  # ][ #  # ]:          0 :         (*pMap)[OOXML_smtClean] = AttributeInfo(RT_Boolean, 0);
      73 [ #  # ][ #  # ]:          0 :         (*pMap)[OOXML_smtId] = AttributeInfo(RT_Integer, 0);
      74 [ #  # ][ #  # ]:          0 :         (*pMap)[OOXML_bmk] = AttributeInfo(RT_String, 0);
      75                 :          0 :         break;
      76                 :            :     default:
      77                 :          0 :         break;
      78                 :            :     }
      79                 :            :     
      80                 :          8 :     return pMap;
      81                 :            : }
      82                 :            : 
      83                 :          0 : ListValueMapPointer OOXMLFactory_dml_textCharacter::createListValueMap(Id nId)
      84                 :            : {
      85 [ #  # ][ #  # ]:          0 :     ListValueMapPointer pMap(new ListValueMap());
                 [ #  # ]
      86                 :            :     
      87   [ #  #  #  # ]:          0 :     switch (nId)
      88                 :            :     {
      89                 :            :     case NN_dml_textCharacter|DEFINE_ST_TextUnderlineType:
      90         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_none] = NS_ooxml::LN_Value_drawingml_ST_TextUnderlineType_none;
      91         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_words] = NS_ooxml::LN_Value_drawingml_ST_TextUnderlineType_words;
      92         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_sng] = NS_ooxml::LN_Value_drawingml_ST_TextUnderlineType_sng;
      93         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_dbl] = NS_ooxml::LN_Value_drawingml_ST_TextUnderlineType_dbl;
      94         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_heavy] = NS_ooxml::LN_Value_drawingml_ST_TextUnderlineType_heavy;
      95         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_dotted] = NS_ooxml::LN_Value_drawingml_ST_TextUnderlineType_dotted;
      96         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_dottedHeavy] = NS_ooxml::LN_Value_drawingml_ST_TextUnderlineType_dottedHeavy;
      97         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_dash] = NS_ooxml::LN_Value_drawingml_ST_TextUnderlineType_dash;
      98         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_dashHeavy] = NS_ooxml::LN_Value_drawingml_ST_TextUnderlineType_dashHeavy;
      99         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_dashLong] = NS_ooxml::LN_Value_drawingml_ST_TextUnderlineType_dashLong;
     100         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_dashLongHeavy] = NS_ooxml::LN_Value_drawingml_ST_TextUnderlineType_dashLongHeavy;
     101         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_dotDash] = NS_ooxml::LN_Value_drawingml_ST_TextUnderlineType_dotDash;
     102         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_dotDashHeavy] = NS_ooxml::LN_Value_drawingml_ST_TextUnderlineType_dotDashHeavy;
     103         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_dotDotDash] = NS_ooxml::LN_Value_drawingml_ST_TextUnderlineType_dotDotDash;
     104         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_dotDotDashHeavy] = NS_ooxml::LN_Value_drawingml_ST_TextUnderlineType_dotDotDashHeavy;
     105         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_wavy] = NS_ooxml::LN_Value_drawingml_ST_TextUnderlineType_wavy;
     106         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_wavyHeavy] = NS_ooxml::LN_Value_drawingml_ST_TextUnderlineType_wavyHeavy;
     107         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_wavyDbl] = NS_ooxml::LN_Value_drawingml_ST_TextUnderlineType_wavyDbl;
     108                 :          0 :         break;
     109                 :            :     case NN_dml_textCharacter|DEFINE_ST_TextStrikeType:
     110         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_noStrike] = NS_ooxml::LN_Value_drawingml_ST_TextStrikeType_noStrike;
     111         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_sngStrike] = NS_ooxml::LN_Value_drawingml_ST_TextStrikeType_sngStrike;
     112         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_dblStrike] = NS_ooxml::LN_Value_drawingml_ST_TextStrikeType_dblStrike;
     113                 :          0 :         break;
     114                 :            :     case NN_dml_textCharacter|DEFINE_ST_TextCapsType:
     115         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_none] = NS_ooxml::LN_Value_drawingml_ST_TextCapsType_none;
     116         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_small] = NS_ooxml::LN_Value_drawingml_ST_TextCapsType_small;
     117         [ #  # ]:          0 :         (*pMap)[OOXMLValueString_all] = NS_ooxml::LN_Value_drawingml_ST_TextCapsType_all;
     118                 :          0 :         break;
     119                 :            :     default:
     120                 :          0 :         break;
     121                 :            :     }
     122                 :            :     
     123                 :          0 :     return pMap;
     124                 :            : }
     125                 :         14 : CreateElementMapPointer OOXMLFactory_dml_textCharacter::createCreateElementMap(Id nId)
     126                 :            : {
     127 [ +  - ][ +  - ]:         14 :     CreateElementMapPointer pMap(new CreateElementMap());
                 [ +  - ]
     128                 :            :     
     129   [ -  -  -  + ]:         14 :     switch (nId)
     130                 :            :     {
     131                 :            :     case NN_dml_textCharacter|DEFINE_CT_TextUnderlineFillGroupWrapper:
     132                 :            :          /* ref: EG_FillProperties*/
     133 [ #  # ][ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_solidFill] = CreateElement(RT_Properties, NN_dml_shapeEffects|DEFINE_CT_SolidColorFillProperties);
     134 [ #  # ][ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_blipFill] = CreateElement(RT_Properties, NN_dml_shapeEffects|DEFINE_CT_BlipFillProperties);
     135                 :          0 :         break;
     136                 :            :     case NN_dml_textCharacter|DEFINE_EG_TextUnderlineLine:
     137 [ #  # ][ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_uLn] = CreateElement(RT_Properties, NN_dml_shapeLineProperties|DEFINE_CT_LineProperties);
     138                 :          0 :         break;
     139                 :            :     case NN_dml_textCharacter|DEFINE_CT_TextCharacterProperties:
     140                 :            :          /* ref: EG_FillProperties*/
     141 [ #  # ][ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_solidFill] = CreateElement(RT_Properties, NN_dml_shapeEffects|DEFINE_CT_SolidColorFillProperties);
     142 [ #  # ][ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_blipFill] = CreateElement(RT_Properties, NN_dml_shapeEffects|DEFINE_CT_BlipFillProperties);
     143                 :            :          /* ref: EG_EffectProperties*/
     144 [ #  # ][ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_effectDag] = CreateElement(RT_Properties, NN_dml_shapeEffects|DEFINE_CT_EffectContainer);
     145                 :            :          /* ref: EG_TextUnderlineLine*/
     146 [ #  # ][ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_uLn] = CreateElement(RT_Properties, NN_dml_shapeLineProperties|DEFINE_CT_LineProperties);
     147 [ #  # ][ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_ln] = CreateElement(RT_Properties, NN_dml_shapeLineProperties|DEFINE_CT_LineProperties);
     148 [ #  # ][ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_highlight] = CreateElement(RT_Properties, NN_dml_baseTypes|DEFINE_CT_Color);
     149 [ #  # ][ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_latin] = CreateElement(RT_Properties, NN_dml_textCharacter|DEFINE_CT_TextFont);
     150 [ #  # ][ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_ea] = CreateElement(RT_Properties, NN_dml_textCharacter|DEFINE_CT_TextFont);
     151 [ #  # ][ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_cs] = CreateElement(RT_Properties, NN_dml_textCharacter|DEFINE_CT_TextFont);
     152 [ #  # ][ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_sym] = CreateElement(RT_Properties, NN_dml_textCharacter|DEFINE_CT_TextFont);
     153 [ #  # ][ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_hlinkClick] = CreateElement(RT_Stream, NN_dml_baseTypes|DEFINE_CT_Hyperlink);
     154 [ #  # ][ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_hlinkMouseOver] = CreateElement(RT_Stream, NN_dml_baseTypes|DEFINE_CT_Hyperlink);
     155                 :          0 :         break;
     156                 :            :     default:
     157                 :         14 :         break;
     158                 :            :     }
     159                 :            :     
     160                 :         14 :     return pMap;
     161                 :            : }
     162                 :            : 
     163                 :          0 : void OOXMLFactory_dml_textCharacter::charactersAction(OOXMLFastContextHandler*, const OUString &)
     164                 :            : {
     165                 :          0 : }
     166                 :            : 
     167                 :          0 : string OOXMLFactory_dml_textCharacter::getDefineName(Id nId) const
     168                 :            : {
     169 [ #  # ][ #  # ]:          0 :     static IdToStringMapPointer pMap;
         [ #  # ][ #  # ]
     170                 :            :     
     171         [ #  # ]:          0 :     if (pMap.get() == NULL)
     172                 :            :     {
     173 [ #  # ][ #  # ]:          0 :         pMap = IdToStringMapPointer(new IdToStringMap());
         [ #  # ][ #  # ]
                 [ #  # ]
     174                 :            :         
     175                 :            : 
     176 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_textCharacter|DEFINE_ST_TextPoint] = "ST_TextPoint";
     177 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_textCharacter|DEFINE_ST_TextNonNegativePoint] = "ST_TextNonNegativePoint";
     178 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_textCharacter|DEFINE_ST_TextFontSize] = "ST_TextFontSize";
     179 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_textCharacter|DEFINE_ST_Panose] = "ST_Panose";
     180 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_textCharacter|DEFINE_ST_TextTypeface] = "ST_TextTypeface";
     181 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_textCharacter|DEFINE_CT_TextFont] = "CT_TextFont";
     182 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_textCharacter|DEFINE_ST_TextLanguageID] = "ST_TextLanguageID";
     183 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_textCharacter|DEFINE_ST_TextUnderlineType] = "ST_TextUnderlineType";
     184 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_textCharacter|DEFINE_CT_TextUnderlineLineFollowText] = "CT_TextUnderlineLineFollowText";
     185 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_textCharacter|DEFINE_CT_TextUnderlineFillFollowText] = "CT_TextUnderlineFillFollowText";
     186 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_textCharacter|DEFINE_CT_TextUnderlineFillGroupWrapper] = "CT_TextUnderlineFillGroupWrapper";
     187 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_textCharacter|DEFINE_EG_TextUnderlineLine] = "EG_TextUnderlineLine";
     188 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_textCharacter|DEFINE_EG_TextUnderlineFill] = "EG_TextUnderlineFill";
     189 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_textCharacter|DEFINE_ST_TextStrikeType] = "ST_TextStrikeType";
     190 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_textCharacter|DEFINE_ST_TextCapsType] = "ST_TextCapsType";
     191 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_textCharacter|DEFINE_CT_TextCharacterProperties] = "CT_TextCharacterProperties";
     192                 :            :     }
     193                 :            :     
     194                 :          0 :     return (*pMap)[nId];
     195                 :            : }
     196                 :            :     
     197                 :            : 
     198                 :         22 : TokenToIdMapPointer OOXMLFactory_dml_textCharacter::createTokenToIdMap(Id nId)
     199                 :            : {
     200 [ +  - ][ +  - ]:         22 :     TokenToIdMapPointer pMap(new TokenToIdMap());
                 [ +  - ]
     201                 :            :     
     202         [ +  + ]:         22 :     switch (nId)
     203                 :            :     {
     204                 :            :     case NN_dml_textCharacter|DEFINE_CT_TextFont:
     205                 :            :         // CT_TextFont
     206         [ +  - ]:          8 :         (*pMap)[OOXML_typeface] = NS_ooxml::LN_CT_TextFont_typeface;
     207         [ +  - ]:          8 :         (*pMap)[OOXML_panose] = NS_ooxml::LN_CT_TextFont_panose;
     208         [ +  - ]:          8 :         (*pMap)[OOXML_pitchFamily] = NS_ooxml::LN_CT_TextFont_pitchFamily;
     209         [ +  - ]:          8 :         (*pMap)[OOXML_charset] = NS_ooxml::LN_CT_TextFont_charset;
     210                 :          8 :         break;
     211                 :            :     default:
     212                 :         14 :         break;
     213                 :            :     }
     214                 :            :     
     215                 :         22 :     return pMap;
     216                 :            : }
     217                 :            : 
     218                 :        498 : void OOXMLFactory_dml_textCharacter::attributeAction(OOXMLFastContextHandler *, Token_t, OOXMLValue::Pointer_t)
     219                 :            : {
     220                 :        498 : }
     221                 :            : 
     222                 :            : #ifdef DEBUG_FACTORY
     223                 :            : string OOXMLFactory_dml_textCharacter::getName() const
     224                 :            : {
     225                 :            :     return "dml-textCharacter";
     226                 :            : }
     227                 :            : #endif
     228                 :            : 
     229                 :            : /// @endcond
     230 [ +  - ][ +  - ]:         60 : }}

Generated by: LCOV version 1.10