LCOV - code coverage report
Current view: top level - xmloff/source/chart - SchXMLTextListContext.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 0 36 0.0 %
Date: 2015-06-13 12:38:46 Functions: 0 12 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             : 
      20             : #include "SchXMLImport.hxx"
      21             : #include "SchXMLTextListContext.hxx"
      22             : #include "SchXMLParagraphContext.hxx"
      23             : 
      24             : #include <xmloff/xmlnmspe.hxx>
      25             : #include <xmloff/xmltoken.hxx>
      26             : #include <xmloff/nmspmap.hxx>
      27             : 
      28             : using ::com::sun::star::uno::Sequence;
      29             : using ::com::sun::star::uno::Reference;
      30             : using namespace com::sun::star;
      31             : using namespace ::xmloff::token;
      32             : 
      33             : class SchXMLListItemContext : public SvXMLImportContext
      34             : {
      35             : public:
      36             :     SchXMLListItemContext( SvXMLImport& rImport, const OUString& rLocalName, OUString& rText );
      37             :     virtual ~SchXMLListItemContext();
      38             :     virtual void StartElement( const Reference< xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE;
      39             :     virtual void EndElement() SAL_OVERRIDE;
      40             : 
      41             :     virtual SvXMLImportContext* CreateChildContext(
      42             :         sal_uInt16 nPrefix,
      43             :         const OUString& rLocalName,
      44             :         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ) SAL_OVERRIDE;
      45             : 
      46             : private:
      47             :     OUString& m_rText;
      48             : };
      49             : 
      50           0 : SchXMLListItemContext::SchXMLListItemContext(
      51             :         SvXMLImport& rImport
      52             :         , const OUString& rLocalName
      53             :         , OUString& rText )
      54             :         : SvXMLImportContext( rImport, XML_NAMESPACE_TEXT, rLocalName )
      55           0 :         , m_rText( rText )
      56             : {
      57           0 : }
      58             : 
      59           0 : SchXMLListItemContext::~SchXMLListItemContext()
      60           0 : {}
      61             : 
      62           0 : void SchXMLListItemContext::StartElement( const Reference< xml::sax::XAttributeList >& /*xAttrList*/ )
      63             : {
      64           0 : }
      65             : 
      66           0 : void SchXMLListItemContext::EndElement()
      67             : {
      68           0 : }
      69             : 
      70           0 : SvXMLImportContext* SchXMLListItemContext::CreateChildContext(
      71             :     sal_uInt16 nPrefix, const OUString& rLocalName,
      72             :     const uno::Reference< xml::sax::XAttributeList >& )
      73             : {
      74           0 :     SvXMLImportContext* pContext = 0;
      75           0 :     if( (nPrefix == XML_NAMESPACE_TEXT ||
      76           0 :                 nPrefix == XML_NAMESPACE_LO_EXT) && IsXMLToken( rLocalName, XML_P ) )
      77           0 :         pContext = new SchXMLParagraphContext( GetImport(), rLocalName, m_rText );
      78             :     else
      79           0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
      80           0 :     return pContext;
      81             : }
      82             : 
      83           0 : SchXMLTextListContext::SchXMLTextListContext(
      84             :         SvXMLImport& rImport
      85             :         , const OUString& rLocalName
      86             :         , Sequence< OUString>& rTextList )
      87             :         : SvXMLImportContext( rImport, XML_NAMESPACE_TEXT, rLocalName )
      88             :         , m_rTextList( rTextList )
      89           0 :         , m_aTextVector()
      90             : {
      91           0 : }
      92             : 
      93           0 : SchXMLTextListContext::~SchXMLTextListContext()
      94             : {
      95           0 : }
      96             : 
      97           0 : void SchXMLTextListContext::StartElement( const Reference< xml::sax::XAttributeList >& /*xAttrList*/ )
      98             : {
      99           0 : }
     100             : 
     101           0 : void SchXMLTextListContext::EndElement()
     102             : {
     103           0 :     sal_Int32 nCount = m_aTextVector.size();
     104           0 :     m_rTextList.realloc(nCount);
     105           0 :     for( sal_Int32 nN=0; nN<nCount; nN++ )
     106           0 :         m_rTextList[nN]=m_aTextVector[nN];
     107           0 : }
     108             : 
     109           0 : SvXMLImportContext* SchXMLTextListContext::CreateChildContext(
     110             :     sal_uInt16 nPrefix, const OUString& rLocalName,
     111             :     const uno::Reference< xml::sax::XAttributeList >& )
     112             : {
     113           0 :     SvXMLImportContext* pContext = 0;
     114           0 :     if( nPrefix == XML_NAMESPACE_TEXT && IsXMLToken( rLocalName, XML_LIST_ITEM ) )
     115             :     {
     116           0 :         m_aTextVector.push_back( OUString() );
     117           0 :         pContext = new SchXMLListItemContext( GetImport(), rLocalName, m_aTextVector.back() );
     118             :     }
     119             :     else
     120           0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
     121           0 :     return pContext;
     122             : }
     123             : 
     124             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11