LCOV - code coverage report
Current view: top level - unoxml/source/dom - text.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 69 71 97.2 %
Date: 2012-08-25 Functions: 33 34 97.1 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 1 2 50.0 %

           Branch data     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 DOM_TEXT_HXX
      21                 :            : #define 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                 :            : 
      36                 :            : using ::rtl::OUString;
      37                 :            : using namespace com::sun::star::uno;
      38                 :            : using namespace com::sun::star::xml::dom;
      39                 :            : 
      40                 :            : namespace DOM
      41                 :            : {
      42                 :            :     typedef ::cppu::ImplInheritanceHelper1< CCharacterData, XText > CText_Base;
      43                 :            : 
      44         [ -  + ]:      43602 :     class CText
      45                 :            :         : public CText_Base
      46                 :            :     {
      47                 :            :     private:
      48                 :            :         friend class CDocument;
      49                 :            : 
      50                 :            :     protected:
      51                 :            :         CText(CDocument const& rDocument, ::osl::Mutex const& rMutex,
      52                 :            :                 NodeType const& reNodeType, xmlNodePtr const& rpNode);
      53                 :            :         CText(CDocument const& rDocument, ::osl::Mutex const& rMutex,
      54                 :            :                 xmlNodePtr const pNode);
      55                 :            : 
      56                 :            :     public:
      57                 :            : 
      58                 :            :         virtual void saxify(const Reference< XDocumentHandler >& i_xHandler);
      59                 :            : 
      60                 :            :         virtual void fastSaxify( Context& io_rContext );
      61                 :            : 
      62                 :            :          // Breaks this node into two nodes at the specified offset, keeping
      63                 :            :          // both in the tree as siblings.
      64                 :            :          virtual Reference< XText > SAL_CALL splitText(sal_Int32 offset)
      65                 :            :              throw (RuntimeException);
      66                 :            : 
      67                 :            : 
      68                 :            :          // --- delegations for XCharacterData
      69                 :          2 :         virtual void SAL_CALL appendData(const OUString& arg)
      70                 :            :             throw (RuntimeException, DOMException)
      71                 :            :         {
      72                 :          2 :             CCharacterData::appendData(arg);
      73                 :          2 :         }
      74                 :          4 :         virtual void SAL_CALL deleteData(sal_Int32 offset, sal_Int32 count)
      75                 :            :             throw (RuntimeException, DOMException)
      76                 :            :         {
      77                 :          4 :             CCharacterData::deleteData(offset, count);
      78                 :          2 :         }
      79                 :       8460 :         virtual OUString SAL_CALL getData() throw (RuntimeException)
      80                 :            :         {
      81                 :       8460 :             return CCharacterData::getData();
      82                 :            :         }
      83                 :          2 :         virtual sal_Int32 SAL_CALL getLength() throw (RuntimeException)
      84                 :            :         {
      85                 :          2 :             return CCharacterData::getLength();
      86                 :            :         }
      87                 :          4 :         virtual void SAL_CALL insertData(sal_Int32 offset, const OUString& arg)
      88                 :            :             throw (RuntimeException, DOMException)
      89                 :            :         {
      90                 :          4 :             CCharacterData::insertData(offset, arg);
      91                 :          2 :         }
      92                 :          4 :         virtual void SAL_CALL replaceData(sal_Int32 offset, sal_Int32 count, const OUString& arg)
      93                 :            :             throw (RuntimeException, DOMException)
      94                 :            :         {
      95                 :          4 :             CCharacterData::replaceData(offset, count, arg);
      96                 :          2 :         }
      97                 :        165 :         virtual void SAL_CALL setData(const OUString& data)
      98                 :            :             throw (RuntimeException, DOMException)
      99                 :            :         {
     100                 :        165 :             CCharacterData::setData(data);
     101                 :        165 :         }
     102                 :          4 :         virtual OUString SAL_CALL subStringData(sal_Int32 offset, sal_Int32 count)
     103                 :            :             throw (RuntimeException, DOMException)
     104                 :            :         {
     105                 :          4 :             return CCharacterData::subStringData(offset, count);
     106                 :            :         }
     107                 :            : 
     108                 :            : 
     109                 :            :          // --- overrides for XNode base
     110                 :            :         virtual OUString SAL_CALL getNodeName()
     111                 :            :             throw (RuntimeException);
     112                 :            : 
     113                 :            :         // --- resolve uno inheritance problems...
     114                 :            :         // --- delegation for XNde base.
     115                 :          4 :         virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
     116                 :            :             throw (RuntimeException, DOMException)
     117                 :            :         {
     118                 :          4 :             return CCharacterData::appendChild(newChild);
     119                 :            :         }
     120                 :          4 :         virtual Reference< XNode > SAL_CALL cloneNode(sal_Bool deep)
     121                 :            :             throw (RuntimeException)
     122                 :            :         {
     123                 :          4 :             return CCharacterData::cloneNode(deep);
     124                 :            :         }
     125                 :          2 :         virtual Reference< XNamedNodeMap > SAL_CALL getAttributes()
     126                 :            :             throw (RuntimeException)
     127                 :            :         {
     128                 :          2 :             return CCharacterData::getAttributes();
     129                 :            :         }
     130                 :          2 :         virtual Reference< XNodeList > SAL_CALL getChildNodes()
     131                 :            :             throw (RuntimeException)
     132                 :            :         {
     133                 :          2 :             return CCharacterData::getChildNodes();
     134                 :            :         }
     135                 :        516 :         virtual Reference< XNode > SAL_CALL getFirstChild()
     136                 :            :             throw (RuntimeException)
     137                 :            :         {
     138                 :        516 :             return CCharacterData::getFirstChild();
     139                 :            :         }
     140                 :          0 :         virtual Reference< XNode > SAL_CALL getLastChild()
     141                 :            :             throw (RuntimeException)
     142                 :            :         {
     143                 :          0 :             return CCharacterData::getLastChild();
     144                 :            :         }
     145                 :          2 :         virtual OUString SAL_CALL getLocalName()
     146                 :            :             throw (RuntimeException)
     147                 :            :         {
     148                 :          2 :             return CCharacterData::getLocalName();
     149                 :            :         }
     150                 :          2 :         virtual OUString SAL_CALL getNamespaceURI()
     151                 :            :             throw (RuntimeException)
     152                 :            :         {
     153                 :          2 :             return CCharacterData::getNamespaceURI();
     154                 :            :         }
     155                 :        518 :         virtual Reference< XNode > SAL_CALL getNextSibling()
     156                 :            :             throw (RuntimeException)
     157                 :            :         {
     158                 :        518 :             return CCharacterData::getNextSibling();
     159                 :            :         }
     160                 :       2316 :         virtual NodeType SAL_CALL getNodeType()
     161                 :            :             throw (RuntimeException)
     162                 :            :         {
     163                 :       2316 :             return CCharacterData::getNodeType();
     164                 :            :         }
     165                 :       7130 :         virtual OUString SAL_CALL getNodeValue() throw (RuntimeException)
     166                 :            :         {
     167                 :       7130 :             return CCharacterData::getNodeValue();
     168                 :            :         }
     169                 :        912 :         virtual Reference< XDocument > SAL_CALL getOwnerDocument()
     170                 :            :             throw (RuntimeException)
     171                 :            :         {
     172                 :        912 :             return CCharacterData::getOwnerDocument();
     173                 :            :         }
     174                 :         44 :         virtual Reference< XNode > SAL_CALL getParentNode()
     175                 :            :             throw (RuntimeException)
     176                 :            :         {
     177                 :         44 :             return CCharacterData::getParentNode();
     178                 :            :         }
     179                 :          2 :         virtual OUString SAL_CALL getPrefix()
     180                 :            :             throw (RuntimeException)
     181                 :            :         {
     182                 :          2 :             return CCharacterData::getPrefix();
     183                 :            :         }
     184                 :          2 :         virtual Reference< XNode > SAL_CALL getPreviousSibling()
     185                 :            :             throw (RuntimeException)
     186                 :            :         {
     187                 :          2 :             return CCharacterData::getPreviousSibling();
     188                 :            :         }
     189                 :          2 :         virtual sal_Bool SAL_CALL hasAttributes()
     190                 :            :             throw (RuntimeException)
     191                 :            :         {
     192                 :          2 :             return CCharacterData::hasAttributes();
     193                 :            :         }
     194                 :          6 :         virtual sal_Bool SAL_CALL hasChildNodes()
     195                 :            :             throw (RuntimeException)
     196                 :            :         {
     197                 :          6 :             return CCharacterData::hasChildNodes();
     198                 :            :         }
     199                 :          2 :         virtual Reference< XNode > SAL_CALL insertBefore(
     200                 :            :                 const Reference< XNode >& newChild, const Reference< XNode >& refChild)
     201                 :            :             throw (RuntimeException, DOMException)
     202                 :            :         {
     203                 :          2 :             return CCharacterData::insertBefore(newChild, refChild);
     204                 :            :         }
     205                 :          2 :         virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver)
     206                 :            :             throw (RuntimeException)
     207                 :            :         {
     208                 :          2 :             return CCharacterData::isSupported(feature, ver);
     209                 :            :         }
     210                 :          2 :         virtual void SAL_CALL normalize()
     211                 :            :             throw (RuntimeException)
     212                 :            :         {
     213                 :          2 :             CCharacterData::normalize();
     214                 :          2 :         }
     215                 :          4 :         virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
     216                 :            :             throw (RuntimeException, DOMException)
     217                 :            :         {
     218                 :          4 :             return CCharacterData::removeChild(oldChild);
     219                 :            :         }
     220                 :          2 :         virtual Reference< XNode > SAL_CALL replaceChild(
     221                 :            :                 const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
     222                 :            :             throw (RuntimeException, DOMException)
     223                 :            :         {
     224                 :          2 :             return CCharacterData::replaceChild(newChild, oldChild);
     225                 :            :         }
     226                 :        163 :         virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
     227                 :            :             throw (RuntimeException, DOMException)
     228                 :            :         {
     229                 :        163 :             return CCharacterData::setNodeValue(nodeValue);
     230                 :            :         }
     231                 :          2 :         virtual void SAL_CALL setPrefix(const OUString& prefix)
     232                 :            :             throw (RuntimeException, DOMException)
     233                 :            :         {
     234                 :          2 :             return CCharacterData::setPrefix(prefix);
     235                 :            :         }
     236                 :            : 
     237                 :            :     };
     238                 :            : }
     239                 :            : #endif
     240                 :            : 
     241                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10