LCOV - code coverage report
Current view: top level - unoxml/source/dom - text.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 69 71 97.2 %
Date: 2015-06-13 12:38:46 Functions: 33 34 97.1 %
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             : #ifndef INCLUDED_UNOXML_SOURCE_DOM_TEXT_HXX
      21             : #define INCLUDED_UNOXML_SOURCE_DOM_TEXT_HXX
      22             : 
      23             : #include <libxml/tree.h>
      24             : 
      25             : #include <sal/types.h>
      26             : 
      27             : #include <cppuhelper/implbase1.hxx>
      28             : 
      29             : #include <com/sun/star/uno/Reference.h>
      30             : #include <com/sun/star/xml/dom/XNode.hpp>
      31             : #include <com/sun/star/xml/dom/XText.hpp>
      32             : 
      33             : #include <characterdata.hxx>
      34             : 
      35             : namespace DOM
      36             : {
      37             :     typedef ::cppu::ImplInheritanceHelper1< CCharacterData, css::xml::dom::XText > CText_Base;
      38             : 
      39      139562 :     class CText
      40             :         : public CText_Base
      41             :     {
      42             :     private:
      43             :         friend class CDocument;
      44             : 
      45             :     protected:
      46             :         CText(CDocument const& rDocument, ::osl::Mutex const& rMutex,
      47             :                 css::xml::dom::NodeType const& reNodeType, xmlNodePtr const& rpNode);
      48             :         CText(CDocument const& rDocument, ::osl::Mutex const& rMutex,
      49             :                 xmlNodePtr const pNode);
      50             : 
      51             :     public:
      52             : 
      53             :         virtual void saxify(const css::uno::Reference< css::xml::sax::XDocumentHandler >& i_xHandler) SAL_OVERRIDE;
      54             : 
      55             :         virtual void fastSaxify( Context& io_rContext ) SAL_OVERRIDE;
      56             : 
      57             :          // Breaks this node into two nodes at the specified offset, keeping
      58             :          // both in the tree as siblings.
      59             :          virtual css::uno::Reference< css::xml::dom::XText > SAL_CALL splitText(sal_Int32 offset)
      60             :              throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      61             : 
      62             : 
      63             :          // --- delegations for XCharacterData
      64           1 :         virtual void SAL_CALL appendData(const OUString& arg)
      65             :             throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
      66             :         {
      67           1 :             CCharacterData::appendData(arg);
      68           1 :         }
      69           2 :         virtual void SAL_CALL deleteData(sal_Int32 offset, sal_Int32 count)
      70             :             throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
      71             :         {
      72           2 :             CCharacterData::deleteData(offset, count);
      73           1 :         }
      74       33139 :         virtual OUString SAL_CALL getData() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
      75             :         {
      76       33139 :             return CCharacterData::getData();
      77             :         }
      78           1 :         virtual sal_Int32 SAL_CALL getLength() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
      79             :         {
      80           1 :             return CCharacterData::getLength();
      81             :         }
      82           2 :         virtual void SAL_CALL insertData(sal_Int32 offset, const OUString& arg)
      83             :             throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
      84             :         {
      85           2 :             CCharacterData::insertData(offset, arg);
      86           1 :         }
      87           2 :         virtual void SAL_CALL replaceData(sal_Int32 offset, sal_Int32 count, const OUString& arg)
      88             :             throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
      89             :         {
      90           2 :             CCharacterData::replaceData(offset, count, arg);
      91           1 :         }
      92         185 :         virtual void SAL_CALL setData(const OUString& data)
      93             :             throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
      94             :         {
      95         185 :             CCharacterData::setData(data);
      96         185 :         }
      97           2 :         virtual OUString SAL_CALL subStringData(sal_Int32 offset, sal_Int32 count)
      98             :             throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
      99             :         {
     100           2 :             return CCharacterData::subStringData(offset, count);
     101             :         }
     102             : 
     103             : 
     104             :          // --- overrides for XNode base
     105             :         virtual OUString SAL_CALL getNodeName()
     106             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     107             : 
     108             :         // --- resolve uno inheritance problems...
     109             :         // --- delegation for XNode base.
     110           2 :         virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL appendChild(const css::uno::Reference< css::xml::dom::XNode >& newChild)
     111             :             throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
     112             :         {
     113           2 :             return CCharacterData::appendChild(newChild);
     114             :         }
     115           2 :         virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL cloneNode(sal_Bool deep)
     116             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     117             :         {
     118           2 :             return CCharacterData::cloneNode(deep);
     119             :         }
     120           1 :         virtual css::uno::Reference< css::xml::dom::XNamedNodeMap > SAL_CALL getAttributes()
     121             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     122             :         {
     123           1 :             return CCharacterData::getAttributes();
     124             :         }
     125           1 :         virtual css::uno::Reference< css::xml::dom::XNodeList > SAL_CALL getChildNodes()
     126             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     127             :         {
     128           1 :             return CCharacterData::getChildNodes();
     129             :         }
     130        6998 :         virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getFirstChild()
     131             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     132             :         {
     133        6998 :             return CCharacterData::getFirstChild();
     134             :         }
     135           0 :         virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getLastChild()
     136             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     137             :         {
     138           0 :             return CCharacterData::getLastChild();
     139             :         }
     140           1 :         virtual OUString SAL_CALL getLocalName()
     141             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     142             :         {
     143           1 :             return CCharacterData::getLocalName();
     144             :         }
     145           1 :         virtual OUString SAL_CALL getNamespaceURI()
     146             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     147             :         {
     148           1 :             return CCharacterData::getNamespaceURI();
     149             :         }
     150        6999 :         virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getNextSibling()
     151             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     152             :         {
     153        6999 :             return CCharacterData::getNextSibling();
     154             :         }
     155       22262 :         virtual css::xml::dom::NodeType SAL_CALL getNodeType()
     156             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     157             :         {
     158       22262 :             return CCharacterData::getNodeType();
     159             :         }
     160       15271 :         virtual OUString SAL_CALL getNodeValue() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     161             :         {
     162       15271 :             return CCharacterData::getNodeValue();
     163             :         }
     164        7401 :         virtual css::uno::Reference< css::xml::dom::XDocument > SAL_CALL getOwnerDocument()
     165             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     166             :         {
     167        7401 :             return CCharacterData::getOwnerDocument();
     168             :         }
     169          22 :         virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getParentNode()
     170             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     171             :         {
     172          22 :             return CCharacterData::getParentNode();
     173             :         }
     174           1 :         virtual OUString SAL_CALL getPrefix()
     175             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     176             :         {
     177           1 :             return CCharacterData::getPrefix();
     178             :         }
     179           1 :         virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getPreviousSibling()
     180             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     181             :         {
     182           1 :             return CCharacterData::getPreviousSibling();
     183             :         }
     184           1 :         virtual sal_Bool SAL_CALL hasAttributes()
     185             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     186             :         {
     187           1 :             return CCharacterData::hasAttributes();
     188             :         }
     189           3 :         virtual sal_Bool SAL_CALL hasChildNodes()
     190             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     191             :         {
     192           3 :             return CCharacterData::hasChildNodes();
     193             :         }
     194           1 :         virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL insertBefore(
     195             :                 const css::uno::Reference< css::xml::dom::XNode >& newChild, const css::uno::Reference< css::xml::dom::XNode >& refChild)
     196             :             throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
     197             :         {
     198           1 :             return CCharacterData::insertBefore(newChild, refChild);
     199             :         }
     200           1 :         virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver)
     201             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     202             :         {
     203           1 :             return CCharacterData::isSupported(feature, ver);
     204             :         }
     205           1 :         virtual void SAL_CALL normalize()
     206             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     207             :         {
     208           1 :             CCharacterData::normalize();
     209           1 :         }
     210           2 :         virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL removeChild(const css::uno::Reference< css::xml::dom::XNode >& oldChild)
     211             :             throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
     212             :         {
     213           2 :             return CCharacterData::removeChild(oldChild);
     214             :         }
     215           1 :         virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL replaceChild(
     216             :                 const css::uno::Reference< css::xml::dom::XNode >& newChild, const css::uno::Reference< css::xml::dom::XNode >& oldChild)
     217             :             throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
     218             :         {
     219           1 :             return CCharacterData::replaceChild(newChild, oldChild);
     220             :         }
     221         184 :         virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
     222             :             throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
     223             :         {
     224         184 :             return CCharacterData::setNodeValue(nodeValue);
     225             :         }
     226           1 :         virtual void SAL_CALL setPrefix(const OUString& prefix)
     227             :             throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
     228             :         {
     229           1 :             return CCharacterData::setPrefix(prefix);
     230             :         }
     231             : 
     232             :     };
     233             : }
     234             : #endif
     235             : 
     236             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11