LCOV - code coverage report
Current view: top level - workdir/unxlngi6.pro/CustomTarget/writerfilter/source - OOXMLFactory_dml-stylesheet.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 33 69 47.8 %
Date: 2012-08-25 Functions: 10 13 76.9 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 29 155 18.7 %

           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-stylesheet.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_stylesheet > OOXMLFactory_dml_stylesheet_Mutex;
      19                 :            : 
      20                 :          8 : OOXMLFactory_dml_stylesheet::OOXMLFactory_dml_stylesheet()
      21                 :            : {
      22                 :            :     // multi-thread-safe mutex for all platforms
      23                 :            :     
      24 [ +  - ][ +  - ]:          8 :     osl::MutexGuard aGuard(OOXMLFactory_dml_stylesheet_Mutex::get());
                 [ +  - ]
      25                 :          8 : }
      26                 :            : 
      27                 :          8 : OOXMLFactory_dml_stylesheet::~OOXMLFactory_dml_stylesheet()
      28                 :            : {
      29         [ -  + ]:         16 : }
      30                 :            : 
      31                 :         20 : OOXMLFactory_ns::Pointer_t OOXMLFactory_dml_stylesheet::m_pInstance;
      32                 :            :     
      33                 :       1325 : OOXMLFactory_ns::Pointer_t OOXMLFactory_dml_stylesheet::getInstance()
      34                 :            : {
      35         [ +  + ]:       1325 :     if (m_pInstance.get() == NULL)
      36         [ +  - ]:          8 :         m_pInstance.reset(new OOXMLFactory_dml_stylesheet());
      37                 :            :     
      38                 :       1325 :     return m_pInstance;
      39                 :            : }
      40                 :            : 
      41                 :          8 : AttributeToResourceMapPointer OOXMLFactory_dml_stylesheet::createAttributeToResourceMap(Id nId)
      42                 :            : {
      43 [ +  - ][ +  - ]:          8 :     AttributeToResourceMapPointer pMap(new AttributeToResourceMap());
                 [ +  - ]
      44                 :            :     
      45      [ -  +  - ]:          8 :     switch (nId)
      46                 :            :     {
      47                 :            :     case NN_dml_stylesheet|DEFINE_CT_ColorMapping:
      48                 :            :       // CT_ColorMapping
      49                 :            :       // empty resource: OOXML_bg1
      50                 :            :       // empty resource: OOXML_tx1
      51                 :            :       // empty resource: OOXML_bg2
      52                 :            :       // empty resource: OOXML_tx2
      53                 :            :       // empty resource: OOXML_accent1
      54                 :            :       // empty resource: OOXML_accent2
      55                 :            :       // empty resource: OOXML_accent3
      56                 :            :       // empty resource: OOXML_accent4
      57                 :            :       // empty resource: OOXML_accent5
      58                 :            :       // empty resource: OOXML_accent6
      59                 :            :       // empty resource: OOXML_hlink
      60                 :            :       // empty resource: OOXML_folHlink
      61                 :          0 :         break;
      62                 :            :     case NN_dml_stylesheet|DEFINE_CT_OfficeStyleSheet:
      63                 :            :       // CT_OfficeStyleSheet
      64 [ +  - ][ +  - ]:          8 :         (*pMap)[OOXML_name] = AttributeInfo(RT_String, 0);
      65                 :          8 :         break;
      66                 :            :     default:
      67                 :          0 :         break;
      68                 :            :     }
      69                 :            :     
      70                 :          8 :     return pMap;
      71                 :            : }
      72                 :            : 
      73                 :          0 : ListValueMapPointer OOXMLFactory_dml_stylesheet::createListValueMap(Id nId)
      74                 :            : {
      75 [ #  # ][ #  # ]:          0 :     ListValueMapPointer pMap(new ListValueMap());
                 [ #  # ]
      76                 :            :     
      77                 :            :     switch (nId)
      78                 :            :     {
      79                 :            :     default:
      80                 :          0 :         break;
      81                 :            :     }
      82                 :            :     
      83                 :          0 :     return pMap;
      84                 :            : }
      85                 :         22 : CreateElementMapPointer OOXMLFactory_dml_stylesheet::createCreateElementMap(Id nId)
      86                 :            : {
      87 [ +  - ][ +  - ]:         22 :     CreateElementMapPointer pMap(new CreateElementMap());
                 [ +  - ]
      88                 :            :     
      89   [ -  +  -  -  :         22 :     switch (nId)
                   -  + ]
      90                 :            :     {
      91                 :            :     case NN_dml_stylesheet|DEFINE_CT_ColorSchemeAndMapping:
      92 [ #  # ][ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_clrScheme] = CreateElement(RT_Properties, NN_dml_baseStylesheet|DEFINE_CT_ColorScheme);
      93                 :          0 :         break;
      94                 :            :     case NN_dml_stylesheet|DEFINE_CT_OfficeStyleSheet:
      95 [ +  - ][ +  - ]:          8 :         (*pMap)[NS_drawingml|OOXML_themeElements] = CreateElement(RT_Properties, NN_dml_baseStylesheet|DEFINE_CT_BaseStyles);
      96                 :          8 :         break;
      97                 :            :     case NN_dml_stylesheet|DEFINE_CT_BaseStylesOverride:
      98 [ #  # ][ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_clrScheme] = CreateElement(RT_Properties, NN_dml_baseStylesheet|DEFINE_CT_ColorScheme);
      99 [ #  # ][ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_fontScheme] = CreateElement(RT_Properties, NN_dml_baseStylesheet|DEFINE_CT_FontScheme);
     100 [ #  # ][ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_fmtScheme] = CreateElement(RT_Properties, NN_dml_baseStylesheet|DEFINE_CT_StyleMatrix);
     101                 :          0 :         break;
     102                 :            :     case NN_dml_stylesheet|DEFINE_CT_ClipboardStyleSheet:
     103 [ #  # ][ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_themeElements] = CreateElement(RT_Properties, NN_dml_baseStylesheet|DEFINE_CT_BaseStyles);
     104                 :          0 :         break;
     105                 :            :     case NN_dml_stylesheet|DEFINE_theme:
     106 [ #  # ][ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_theme] = CreateElement(RT_Table, NN_dml_stylesheet|DEFINE_CT_OfficeStyleSheet);
     107                 :          0 :         break;
     108                 :            :     default:
     109                 :            :         /* start: theme*/
     110 [ +  - ][ +  - ]:         14 :         (*pMap)[NS_drawingml|OOXML_theme] = CreateElement(RT_Table, NN_dml_stylesheet|DEFINE_CT_OfficeStyleSheet);
     111                 :            :         /* start: themeOverride*/
     112                 :            :         /* start: themeManager*/
     113                 :         14 :         break;
     114                 :            :     }
     115                 :            :     
     116                 :         22 :     return pMap;
     117                 :            : }
     118                 :            : 
     119                 :          0 : void OOXMLFactory_dml_stylesheet::charactersAction(OOXMLFastContextHandler*, const OUString &)
     120                 :            : {
     121                 :          0 : }
     122                 :            : 
     123                 :          0 : string OOXMLFactory_dml_stylesheet::getDefineName(Id nId) const
     124                 :            : {
     125 [ #  # ][ #  # ]:          0 :     static IdToStringMapPointer pMap;
         [ #  # ][ #  # ]
     126                 :            :     
     127         [ #  # ]:          0 :     if (pMap.get() == NULL)
     128                 :            :     {
     129 [ #  # ][ #  # ]:          0 :         pMap = IdToStringMapPointer(new IdToStringMap());
         [ #  # ][ #  # ]
                 [ #  # ]
     130                 :            :         
     131                 :            : 
     132 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_stylesheet|DEFINE_CT_EmptyElement] = "CT_EmptyElement";
     133 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_stylesheet|DEFINE_CT_ColorMapping] = "CT_ColorMapping";
     134 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_stylesheet|DEFINE_CT_ColorMappingOverride] = "CT_ColorMappingOverride";
     135 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_stylesheet|DEFINE_CT_ColorSchemeAndMapping] = "CT_ColorSchemeAndMapping";
     136 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_stylesheet|DEFINE_CT_ColorSchemeList] = "CT_ColorSchemeList";
     137 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_stylesheet|DEFINE_CT_OfficeStyleSheet] = "CT_OfficeStyleSheet";
     138 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_stylesheet|DEFINE_CT_BaseStylesOverride] = "CT_BaseStylesOverride";
     139 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_stylesheet|DEFINE_CT_ClipboardStyleSheet] = "CT_ClipboardStyleSheet";
     140 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_stylesheet|DEFINE_theme] = "theme";
     141 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_stylesheet|DEFINE_themeOverride] = "themeOverride";
     142 [ #  # ][ #  # ]:          0 :         (*pMap)[NN_dml_stylesheet|DEFINE_themeManager] = "themeManager";
     143                 :            :     }
     144                 :            :     
     145                 :          0 :     return (*pMap)[nId];
     146                 :            : }
     147                 :            :     
     148                 :            : 
     149                 :         22 : TokenToIdMapPointer OOXMLFactory_dml_stylesheet::createTokenToIdMap(Id nId)
     150                 :            : {
     151 [ +  - ][ +  - ]:         22 :     TokenToIdMapPointer pMap(new TokenToIdMap());
                 [ +  - ]
     152                 :            :     
     153         [ -  + ]:         22 :     switch (nId)
     154                 :            :     {
     155                 :            :     case NN_dml_stylesheet|DEFINE_theme:
     156                 :            :         // theme
     157         [ #  # ]:          0 :         (*pMap)[NS_drawingml|OOXML_theme] = NS_ooxml::LN_THEMETABLE;
     158                 :          0 :         break;
     159                 :            :     default:
     160                 :            :         // theme
     161                 :            :         // theme
     162         [ +  - ]:         22 :         (*pMap)[NS_drawingml|OOXML_theme] = NS_ooxml::LN_THEMETABLE;
     163                 :            :         // themeOverride
     164                 :            :         // themeManager
     165                 :         22 :         break;
     166                 :            :     }
     167                 :            :     
     168                 :         22 :     return pMap;
     169                 :            : }
     170                 :            : 
     171                 :         83 : void OOXMLFactory_dml_stylesheet::attributeAction(OOXMLFastContextHandler *, Token_t, OOXMLValue::Pointer_t)
     172                 :            : {
     173                 :         83 : }
     174                 :            : 
     175                 :            : #ifdef DEBUG_FACTORY
     176                 :            : string OOXMLFactory_dml_stylesheet::getName() const
     177                 :            : {
     178                 :            :     return "dml-stylesheet";
     179                 :            : }
     180                 :            : #endif
     181                 :            : 
     182                 :            : /// @endcond
     183 [ +  - ][ +  - ]:         60 : }}

Generated by: LCOV version 1.10