LCOV - code coverage report
Current view: top level - xmloff/source/chart - SchXMLTextListContext.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 35 0.0 %
Date: 2014-04-14 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 && IsXMLToken( rLocalName, XML_P ) )
      76           0 :         pContext = new SchXMLParagraphContext( GetImport(), rLocalName, m_rText );
      77             :     else
      78           0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
      79           0 :     return pContext;
      80             : }
      81             : 
      82           0 : SchXMLTextListContext::SchXMLTextListContext(
      83             :         SvXMLImport& rImport
      84             :         , const OUString& rLocalName
      85             :         , Sequence< OUString>& rTextList )
      86             :         : SvXMLImportContext( rImport, XML_NAMESPACE_TEXT, rLocalName )
      87             :         , m_rTextList( rTextList )
      88           0 :         , m_aTextVector()
      89             : {
      90           0 : }
      91             : 
      92           0 : SchXMLTextListContext::~SchXMLTextListContext()
      93             : {
      94           0 : }
      95             : 
      96           0 : void SchXMLTextListContext::StartElement( const Reference< xml::sax::XAttributeList >& /*xAttrList*/ )
      97             : {
      98           0 : }
      99             : 
     100           0 : void SchXMLTextListContext::EndElement()
     101             : {
     102           0 :     sal_Int32 nCount = m_aTextVector.size();
     103           0 :     m_rTextList.realloc(nCount);
     104           0 :     for( sal_Int32 nN=0; nN<nCount; nN++ )
     105           0 :         m_rTextList[nN]=m_aTextVector[nN];
     106           0 : }
     107             : 
     108           0 : SvXMLImportContext* SchXMLTextListContext::CreateChildContext(
     109             :     sal_uInt16 nPrefix, const OUString& rLocalName,
     110             :     const uno::Reference< xml::sax::XAttributeList >& )
     111             : {
     112           0 :     SvXMLImportContext* pContext = 0;
     113           0 :     if( nPrefix == XML_NAMESPACE_TEXT && IsXMLToken( rLocalName, XML_LIST_ITEM ) )
     114             :     {
     115           0 :         m_aTextVector.push_back( OUString() );
     116           0 :         pContext = new SchXMLListItemContext( GetImport(), rLocalName, m_aTextVector.back() );
     117             :     }
     118             :     else
     119           0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
     120           0 :     return pContext;
     121             : }
     122             : 
     123             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10