LCOV - code coverage report
Current view: top level - reportdesign/source/filter/xml - xmlComponent.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 0 22 0.0 %
Date: 2015-06-13 12:38:46 Functions: 0 3 0.0 %
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             : #include "xmlComponent.hxx"
      20             : #include "xmlfilter.hxx"
      21             : #include <xmloff/xmltoken.hxx>
      22             : #include <xmloff/xmlnmspe.hxx>
      23             : #include <xmloff/xmluconv.hxx>
      24             : #include <xmloff/nmspmap.hxx>
      25             : #include "xmlEnums.hxx"
      26             : #include "xmlHelper.hxx"
      27             : #include "xmlstrings.hrc"
      28             : #include "xmlStyleImport.hxx"
      29             : #include <ucbhelper/content.hxx>
      30             : #include <tools/debug.hxx>
      31             : #include <comphelper/namecontainer.hxx>
      32             : #include <comphelper/genericpropertyset.hxx>
      33             : #include <com/sun/star/awt/FontDescriptor.hpp>
      34             : #include <com/sun/star/report/XReportControlModel.hpp>
      35             : #include <com/sun/star/beans/PropertyAttribute.hpp>
      36             : 
      37             : namespace rptxml
      38             : {
      39             :     using namespace ::comphelper;
      40             :     using namespace ::com::sun::star;
      41             :     using namespace ::com::sun::star::uno;
      42             :     using namespace ::com::sun::star::beans;
      43             :     using namespace ::com::sun::star::report;
      44             :     using namespace ::com::sun::star::xml::sax;
      45           0 : OXMLComponent::OXMLComponent( ORptFilter& _rImport
      46             :                 ,sal_uInt16 nPrfx
      47             :                 ,const OUString& _sLocalName
      48             :                 ,const Reference< XAttributeList > & _xAttrList
      49             :                 ,const Reference< XReportComponent > & _xComponent
      50             :                 ) :
      51             :     SvXMLImportContext( _rImport, nPrfx, _sLocalName )
      52           0 :     ,m_xComponent(_xComponent)
      53             : {
      54             :     OSL_ENSURE(_xAttrList.is(),"Attribute list is NULL!");
      55             :     OSL_ENSURE(m_xComponent.is(),"Component is NULL!");
      56             : 
      57           0 :     const SvXMLNamespaceMap& rMap = _rImport.GetNamespaceMap();
      58           0 :     const SvXMLTokenMap& rTokenMap = _rImport.GetComponentElemTokenMap();
      59             : 
      60           0 :     const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0;
      61             : 
      62           0 :     for(sal_Int16 i = 0; i < nLength; ++i)
      63             :     {
      64             :         try
      65             :         {
      66           0 :             OUString sLocalName;
      67           0 :             const OUString sAttrName = _xAttrList->getNameByIndex( i );
      68           0 :             const sal_uInt16 nPrefix = rMap.GetKeyByAttrName( sAttrName,&sLocalName );
      69           0 :             const OUString sValue = _xAttrList->getValueByIndex( i );
      70             : 
      71           0 :             switch( rTokenMap.Get( nPrefix, sLocalName ) )
      72             :             {
      73             :                 case XML_TOK_NAME:
      74           0 :                     m_xComponent->setName(sValue);
      75           0 :                     break;
      76             :                 case XML_TOK_TEXT_STYLE_NAME:
      77           0 :                     m_sTextStyleName = sValue;
      78           0 :                     break;
      79             :                 case XML_TOK_TRANSFORM:
      80           0 :                     break;
      81             :                 default:
      82           0 :                     break;
      83           0 :             }
      84             :         }
      85           0 :         catch(const Exception&)
      86             :         {
      87             :             OSL_FAIL("Exception catched while putting props into report component!");
      88             :         }
      89             :     }
      90           0 : }
      91             : 
      92             : 
      93           0 : OXMLComponent::~OXMLComponent()
      94             : {
      95           0 : }
      96             : 
      97             : 
      98             : } // namespace rptxml
      99             : 
     100             : 
     101             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11