LCOV - code coverage report
Current view: top level - writerfilter/source/dmapper - FFDataHandler.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 30 71 42.3 %
Date: 2012-08-25 Functions: 9 17 52.9 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 22 63 34.9 %

           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 "FFDataHandler.hxx"
      20                 :            : 
      21                 :            : #include <ooxml/resourceids.hxx>
      22                 :            : #include "dmapperLoggers.hxx"
      23                 :            : 
      24                 :            : namespace writerfilter {
      25                 :            : namespace dmapper {
      26                 :            : 
      27                 :            : /************************
      28                 :            :  * class: FFDataHandler *
      29                 :            :  ************************/
      30                 :            : 
      31                 :         21 : FFDataHandler::FFDataHandler() :
      32                 :            : LoggedProperties(dmapper_logger, "FFDataHandler"),
      33                 :            : m_nCheckboxHeight(0),
      34                 :            : m_bCheckboxAutoHeight(false),
      35                 :            : m_nCheckboxChecked(-1),
      36 [ +  - ][ +  - ]:         21 : m_nCheckboxDefault(-1)
         [ +  - ][ +  - ]
                 [ +  - ]
      37                 :            : {
      38                 :         21 : }
      39                 :            : 
      40                 :            : 
      41                 :         21 : FFDataHandler::~FFDataHandler()
      42                 :            : {
      43         [ -  + ]:         42 : }
      44                 :            : 
      45                 :          3 : const OUString & FFDataHandler::getName() const
      46                 :            : {
      47                 :          3 :     return m_sName;
      48                 :            : }
      49                 :            : 
      50                 :          0 : const OUString & FFDataHandler::getHelpText() const
      51                 :            : {
      52                 :          0 :     return m_sHelpText;
      53                 :            : }
      54                 :            : 
      55                 :          0 : const OUString & FFDataHandler::getStatusText() const
      56                 :            : {
      57                 :          0 :     return m_sStatusText;
      58                 :            : }
      59                 :            : 
      60                 :          0 : sal_uInt32 FFDataHandler::getCheckboxHeight() const
      61                 :            : {
      62                 :          0 :     return m_nCheckboxHeight;
      63                 :            : }
      64                 :            : 
      65                 :          0 : bool FFDataHandler::getCheckboxAutoHeight() const
      66                 :            : {
      67                 :          0 :     return m_bCheckboxAutoHeight;
      68                 :            : }
      69                 :            : 
      70                 :          3 : bool FFDataHandler::getCheckboxChecked() const
      71                 :            : {
      72         [ -  + ]:          3 :     if (m_nCheckboxChecked != -1)
      73                 :          0 :         return m_nCheckboxChecked;
      74         [ +  - ]:          3 :     else if (m_nCheckboxDefault != -1)
      75                 :          3 :         return m_nCheckboxDefault;
      76                 :            :     else
      77                 :          3 :         return false;
      78                 :            : }
      79                 :            : 
      80                 :          0 : const OUString & FFDataHandler::getDropDownResult() const
      81                 :            : {
      82                 :          0 :     return m_sDropDownResult;
      83                 :            : }
      84                 :            : 
      85                 :          0 : const FFDataHandler::DropDownEntries_t & FFDataHandler::getDropDownEntries() const
      86                 :            : {
      87                 :          0 :     return m_DropDownEntries;
      88                 :            : }
      89                 :            : 
      90                 :          0 : const OUString & FFDataHandler::getTextDefault() const
      91                 :            : {
      92                 :          0 :     return m_sTextDefault;
      93                 :            : }
      94                 :            : 
      95                 :         18 : void FFDataHandler::lcl_sprm(Sprm & r_Sprm)
      96                 :            : {
      97   [ +  -  -  -  :         18 :     switch(r_Sprm.getId())
          +  -  +  +  -  
             -  -  -  -  
                      + ]
      98                 :            :     {
      99                 :            :     case NS_ooxml::LN_CT_FFData_name:
     100                 :            :         {
     101         [ +  - ]:          3 :             m_sName = r_Sprm.getValue()->getString();
     102                 :            :         }
     103                 :          3 :         break;
     104                 :            :     case NS_ooxml::LN_CT_FFData_helpText:
     105                 :            :         {
     106                 :          0 :             resolveSprm(r_Sprm);
     107                 :            :         }
     108                 :          0 :         break;
     109                 :            :     case NS_ooxml::LN_CT_FFData_statusText:
     110                 :            :         {
     111                 :          0 :             resolveSprm(r_Sprm);
     112                 :            :         }
     113                 :          0 :         break;
     114                 :            :     case NS_ooxml::LN_CT_FFCheckBox_size:
     115                 :            :         {
     116         [ #  # ]:          0 :             m_nCheckboxHeight = r_Sprm.getValue()->getInt();
     117                 :            :         }
     118                 :          0 :         break;
     119                 :            :     case NS_ooxml::LN_CT_FFCheckBox_sizeAuto:
     120                 :            :         {
     121         [ +  - ]:          3 :             m_bCheckboxAutoHeight = r_Sprm.getValue()->getInt();
     122                 :            :         }
     123                 :          3 :         break;
     124                 :            :     case NS_ooxml::LN_CT_FFCheckBox_checked:
     125                 :            :         {
     126         [ #  # ]:          0 :             m_nCheckboxChecked = r_Sprm.getValue()->getInt();
     127                 :            :         }
     128                 :          0 :         break;
     129                 :            :     case NS_ooxml::LN_CT_FFCheckBox_default:
     130                 :            :         {
     131         [ +  - ]:          3 :             m_nCheckboxDefault = r_Sprm.getValue()->getInt();
     132                 :            :         }
     133                 :          3 :         break;
     134                 :            :     case NS_ooxml::LN_CT_FFData_checkBox:
     135                 :            :         {
     136                 :          3 :             resolveSprm(r_Sprm);
     137                 :            :         }
     138                 :          3 :         break;
     139                 :            :     case NS_ooxml::LN_CT_FFDDList_result:
     140                 :            :         {
     141         [ #  # ]:          0 :             m_sDropDownResult = r_Sprm.getValue()->getString();
     142                 :            :         }
     143                 :          0 :         break;
     144                 :            :     case NS_ooxml::LN_CT_FFDDList_listEntry:
     145                 :            :         {
     146 [ #  # ][ #  # ]:          0 :             m_DropDownEntries.push_back(r_Sprm.getValue()->getString());
     147                 :            :         }
     148                 :          0 :         break;
     149                 :            :     case NS_ooxml::LN_CT_FFData_ddList:
     150                 :            :         {
     151                 :          0 :             resolveSprm(r_Sprm);
     152                 :            :         }
     153                 :          0 :         break;
     154                 :            :     case NS_ooxml::LN_CT_FFTextInput_default:
     155                 :            :         {
     156         [ #  # ]:          0 :             m_sTextDefault = r_Sprm.getValue()->getString();
     157                 :            :         }
     158                 :          0 :         break;
     159                 :            :     case NS_ooxml::LN_CT_FFData_textInput:
     160                 :            :         {
     161                 :          0 :             resolveSprm(r_Sprm);
     162                 :            :         }
     163                 :          0 :         break;
     164                 :            :     default:
     165                 :            : #ifdef DEBUG_DOMAINMAPPER
     166                 :            :         dmapper_logger->element("unhandled");
     167                 :            : #endif
     168                 :          6 :         break;
     169                 :            :     }
     170                 :         18 : }
     171                 :            : 
     172                 :          3 : void FFDataHandler::resolveSprm(Sprm & r_Sprm)
     173                 :            : {
     174         [ +  - ]:          3 :     writerfilter::Reference<Properties>::Pointer_t pProperties = r_Sprm.getProps();
     175         [ +  - ]:          3 :     if( pProperties.get())
     176 [ +  - ][ +  - ]:          3 :         pProperties->resolve(*this);
     177                 :          3 : }
     178                 :            : 
     179                 :          0 : void FFDataHandler::lcl_attribute(Id name, Value & val)
     180                 :            : {
     181      [ #  #  # ]:          0 :     switch (name)
     182                 :            :     {
     183                 :            :     case NS_ooxml::LN_CT_FFHelpText_val:
     184                 :            :         {
     185                 :          0 :             m_sHelpText = val.getString();
     186                 :            :         }
     187                 :          0 :         break;
     188                 :            :     case NS_ooxml::LN_CT_FFStatusText_val:
     189                 :            :         {
     190                 :          0 :             m_sStatusText = val.getString();
     191                 :            :         }
     192                 :          0 :         break;
     193                 :            :     default:
     194                 :            : #ifdef DEBUG_DOMAINMAPPER
     195                 :            :         dmapper_logger->element("unhandled");
     196                 :            : #endif
     197                 :          0 :         break;
     198                 :            :     }
     199                 :          0 : }
     200                 :            : 
     201 [ +  - ][ +  - ]:         60 : }}
     202                 :            : 
     203                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10