LCOV - code coverage report
Current view: top level - unoxml/source/dom - text.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 69 71 97.2 %
Date: 2014-11-03 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      209280 :     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           2 :         virtual void SAL_CALL appendData(const OUString& arg)
      65             :             throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
      66             :         {
      67           2 :             CCharacterData::appendData(arg);
      68           2 :         }
      69           4 :         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           4 :             CCharacterData::deleteData(offset, count);
      73           2 :         }
      74       48486 :         virtual OUString SAL_CALL getData() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
      75             :         {
      76       48486 :             return CCharacterData::getData();
      77             :         }
      78           2 :         virtual sal_Int32 SAL_CALL getLength() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
      79             :         {
      80           2 :             return CCharacterData::getLength();
      81             :         }
      82           4 :         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           4 :             CCharacterData::insertData(offset, arg);
      86           2 :         }
      87           4 :         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           4 :             CCharacterData::replaceData(offset, count, arg);
      91           2 :         }
      92         194 :         virtual void SAL_CALL setData(const OUString& data)
      93             :             throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
      94             :         {
      95         194 :             CCharacterData::setData(data);
      96         194 :         }
      97           4 :         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           4 :             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           4 :         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           4 :             return CCharacterData::appendChild(newChild);
     114             :         }
     115           4 :         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           4 :             return CCharacterData::cloneNode(deep);
     119             :         }
     120           2 :         virtual css::uno::Reference< css::xml::dom::XNamedNodeMap > SAL_CALL getAttributes()
     121             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     122             :         {
     123           2 :             return CCharacterData::getAttributes();
     124             :         }
     125           2 :         virtual css::uno::Reference< css::xml::dom::XNodeList > SAL_CALL getChildNodes()
     126             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     127             :         {
     128           2 :             return CCharacterData::getChildNodes();
     129             :         }
     130       11762 :         virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getFirstChild()
     131             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     132             :         {
     133       11762 :             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           2 :         virtual OUString SAL_CALL getLocalName()
     141             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     142             :         {
     143           2 :             return CCharacterData::getLocalName();
     144             :         }
     145           2 :         virtual OUString SAL_CALL getNamespaceURI()
     146             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     147             :         {
     148           2 :             return CCharacterData::getNamespaceURI();
     149             :         }
     150       11764 :         virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getNextSibling()
     151             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     152             :         {
     153       11764 :             return CCharacterData::getNextSibling();
     154             :         }
     155       34366 :         virtual css::xml::dom::NodeType SAL_CALL getNodeType()
     156             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     157             :         {
     158       34366 :             return CCharacterData::getNodeType();
     159             :         }
     160       22618 :         virtual OUString SAL_CALL getNodeValue() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     161             :         {
     162       22618 :             return CCharacterData::getNodeValue();
     163             :         }
     164       12216 :         virtual css::uno::Reference< css::xml::dom::XDocument > SAL_CALL getOwnerDocument()
     165             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     166             :         {
     167       12216 :             return CCharacterData::getOwnerDocument();
     168             :         }
     169          44 :         virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getParentNode()
     170             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     171             :         {
     172          44 :             return CCharacterData::getParentNode();
     173             :         }
     174           2 :         virtual OUString SAL_CALL getPrefix()
     175             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     176             :         {
     177           2 :             return CCharacterData::getPrefix();
     178             :         }
     179           2 :         virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getPreviousSibling()
     180             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     181             :         {
     182           2 :             return CCharacterData::getPreviousSibling();
     183             :         }
     184           2 :         virtual sal_Bool SAL_CALL hasAttributes()
     185             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     186             :         {
     187           2 :             return CCharacterData::hasAttributes();
     188             :         }
     189           6 :         virtual sal_Bool SAL_CALL hasChildNodes()
     190             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     191             :         {
     192           6 :             return CCharacterData::hasChildNodes();
     193             :         }
     194           2 :         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           2 :             return CCharacterData::insertBefore(newChild, refChild);
     199             :         }
     200           2 :         virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver)
     201             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     202             :         {
     203           2 :             return CCharacterData::isSupported(feature, ver);
     204             :         }
     205           2 :         virtual void SAL_CALL normalize()
     206             :             throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     207             :         {
     208           2 :             CCharacterData::normalize();
     209           2 :         }
     210           4 :         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           4 :             return CCharacterData::removeChild(oldChild);
     214             :         }
     215           2 :         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           2 :             return CCharacterData::replaceChild(newChild, oldChild);
     220             :         }
     221         192 :         virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
     222             :             throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
     223             :         {
     224         192 :             return CCharacterData::setNodeValue(nodeValue);
     225             :         }
     226           2 :         virtual void SAL_CALL setPrefix(const OUString& prefix)
     227             :             throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
     228             :         {
     229           2 :             return CCharacterData::setPrefix(prefix);
     230             :         }
     231             : 
     232             :     };
     233             : }
     234             : #endif
     235             : 
     236             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10