xref: /aoo4110/main/unoxml/source/dom/comment.cxx (revision b1cdbd2c)
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 <comment.hxx>
25 
26 #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
27 
28 
29 namespace DOM
30 {
CComment(CDocument const & rDocument,::osl::Mutex const & rMutex,xmlNodePtr const pNode)31     CComment::CComment(CDocument const& rDocument, ::osl::Mutex const& rMutex,
32             xmlNodePtr const pNode)
33         : CComment_Base(rDocument, rMutex, NodeType_COMMENT_NODE, pNode)
34     {
35     }
36 
saxify(const Reference<XDocumentHandler> & i_xHandler)37     void CComment::saxify(
38             const Reference< XDocumentHandler >& i_xHandler) {
39         if (!i_xHandler.is()) throw RuntimeException();
40         Reference< XExtendedDocumentHandler > xExtended(i_xHandler, UNO_QUERY);
41         if (xExtended.is()) {
42             xExtended->comment(getData());
43         }
44     }
45 
getNodeName()46     OUString SAL_CALL CComment::getNodeName()throw (RuntimeException)
47     {
48         return OUString::createFromAscii("#comment");
49     }
50 
getNodeValue()51     OUString SAL_CALL CComment::getNodeValue() throw (RuntimeException)
52     {
53         return CCharacterData::getData();
54     }
55 }
56