xref: /trunk/main/unoxml/source/dom/text.cxx (revision e9cbe144)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #include <text.hxx>
25 
26 
27 namespace DOM
28 {
CText(CDocument const & rDocument,::osl::Mutex const & rMutex,NodeType const & reNodeType,xmlNodePtr const & rpNode)29     CText::CText(CDocument const& rDocument, ::osl::Mutex const& rMutex,
30             NodeType const& reNodeType, xmlNodePtr const& rpNode)
31         : CText_Base(rDocument, rMutex, reNodeType, rpNode)
32     {
33     }
34 
CText(CDocument const & rDocument,::osl::Mutex const & rMutex,xmlNodePtr const pNode)35     CText::CText(CDocument const& rDocument, ::osl::Mutex const& rMutex,
36             xmlNodePtr const pNode)
37         : CText_Base(rDocument, rMutex, NodeType_TEXT_NODE, pNode)
38     {
39     }
40 
saxify(const Reference<XDocumentHandler> & i_xHandler)41     void CText::saxify(
42             const Reference< XDocumentHandler >& i_xHandler) {
43         if (!i_xHandler.is()) throw RuntimeException();
44         i_xHandler->characters(getData());
45     }
46 
fastSaxify(Context & io_rContext)47     void CText::fastSaxify( Context& io_rContext )
48     {
49         if (io_rContext.mxCurrentHandler.is())
50         {
51             try
52             {
53                 io_rContext.mxCurrentHandler->characters( getData() );
54             }
55             catch( Exception& )
56             {}
57         }
58     }
59 
getNodeName()60     OUString SAL_CALL CText::getNodeName() throw (RuntimeException)
61     {
62         return OUString::createFromAscii("#text");
63     }
64 
splitText(sal_Int32)65     Reference< XText > SAL_CALL CText::splitText(sal_Int32 /*offset*/)
66          throw (RuntimeException)
67     {
68         OSL_ENSURE(false, "CText::splitText: not implemented (#i113683#)");
69         return Reference< XText >(this);
70     }
71 }
72