LCOV - code coverage report
Current view: top level - xmloff/source/draw - XMLShapePropertySetContext.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 29 31 93.5 %
Date: 2015-06-13 12:38:46 Functions: 5 10 50.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             : 
      20             : #include "XMLShapePropertySetContext.hxx"
      21             : #include <xmloff/xmlimp.hxx>
      22             : #include <xmloff/xmlnumi.hxx>
      23             : #include "xmltabi.hxx"
      24             : #include <xmloff/txtprmap.hxx>
      25             : 
      26             : #include "sdpropls.hxx"
      27             : 
      28             : using namespace ::com::sun::star;
      29             : using namespace ::com::sun::star::uno;
      30             : 
      31           0 : TYPEINIT1( XMLShapePropertySetContext, SvXMLPropertySetContext );
      32             : 
      33        5337 : XMLShapePropertySetContext::XMLShapePropertySetContext(
      34             :                  SvXMLImport& rImport, sal_uInt16 nPrfx,
      35             :                  const OUString& rLName,
      36             :                  const Reference< xml::sax::XAttributeList > & xAttrList,
      37             :                  sal_uInt32 nFam,
      38             :                  ::std::vector< XMLPropertyState > &rProps,
      39             :                  const rtl::Reference < SvXMLImportPropertyMapper > &rMap ) :
      40             :     SvXMLPropertySetContext( rImport, nPrfx, rLName, xAttrList, nFam,
      41             :                              rProps, rMap ),
      42        5337 :     mnBulletIndex(-1)
      43             : {
      44        5337 : }
      45             : 
      46       10092 : XMLShapePropertySetContext::~XMLShapePropertySetContext()
      47             : {
      48       10092 : }
      49             : 
      50        5337 : void XMLShapePropertySetContext::EndElement()
      51             : {
      52        5337 :     Reference< container::XIndexReplace > xNumRule;
      53        5337 :     if( mxBulletStyle.Is() )
      54             :     {
      55         180 :         SvxXMLListStyleContext* pBulletStyle = static_cast<SvxXMLListStyleContext*>(&mxBulletStyle);
      56         180 :         xNumRule = SvxXMLListStyleContext::CreateNumRule( GetImport().GetModel() );
      57         180 :         if( xNumRule.is() )
      58         180 :             pBulletStyle->FillUnoNumRule(xNumRule);
      59             :     }
      60             : 
      61       10674 :     Any aAny;
      62        5337 :     aAny <<= xNumRule;
      63             : 
      64       10674 :     XMLPropertyState aPropState( mnBulletIndex, aAny );
      65        5337 :     mrProperties.push_back( aPropState );
      66             : 
      67       10674 :     SvXMLPropertySetContext::EndElement();
      68        5337 : }
      69             : 
      70         598 : SvXMLImportContext *XMLShapePropertySetContext::CreateChildContext(
      71             :                    sal_uInt16 nPrefix,
      72             :                    const OUString& rLocalName,
      73             :                    const Reference< xml::sax::XAttributeList > & xAttrList,
      74             :                    ::std::vector< XMLPropertyState > &rProperties,
      75             :                    const XMLPropertyState& rProp )
      76             : {
      77         598 :     SvXMLImportContext *pContext = 0;
      78             : 
      79         598 :     switch( mxMapper->getPropertySetMapper()->GetEntryContextId( rProp.mnIndex ) )
      80             :     {
      81             :     case CTF_NUMBERINGRULES:
      82         180 :         mnBulletIndex = rProp.mnIndex;
      83         180 :         mxBulletStyle = pContext = new SvxXMLListStyleContext( GetImport(), nPrefix, rLocalName, xAttrList );
      84         180 :         break;
      85             :     case CTF_TABSTOP:
      86         418 :         pContext = new SvxXMLTabStopImportContext( GetImport(), nPrefix,
      87             :                                                    rLocalName, rProp,
      88         418 :                                                    rProperties );
      89         418 :         break;
      90             :     }
      91             : 
      92         598 :     if( !pContext )
      93             :         pContext = SvXMLPropertySetContext::CreateChildContext( nPrefix, rLocalName,
      94             :                                                             xAttrList,
      95           0 :                                                             rProperties, rProp );
      96             : 
      97         598 :     return pContext;
      98             : }
      99             : 
     100             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11