1*e9cbe144SAndrew Rist /************************************************************** 2*e9cbe144SAndrew Rist * 3*e9cbe144SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*e9cbe144SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*e9cbe144SAndrew Rist * distributed with this work for additional information 6*e9cbe144SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*e9cbe144SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*e9cbe144SAndrew Rist * "License"); you may not use this file except in compliance 9*e9cbe144SAndrew Rist * with the License. You may obtain a copy of the License at 10*e9cbe144SAndrew Rist * 11*e9cbe144SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*e9cbe144SAndrew Rist * 13*e9cbe144SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*e9cbe144SAndrew Rist * software distributed under the License is distributed on an 15*e9cbe144SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*e9cbe144SAndrew Rist * KIND, either express or implied. See the License for the 17*e9cbe144SAndrew Rist * specific language governing permissions and limitations 18*e9cbe144SAndrew Rist * under the License. 19*e9cbe144SAndrew Rist * 20*e9cbe144SAndrew Rist *************************************************************/ 21*e9cbe144SAndrew Rist 22*e9cbe144SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #include <comment.hxx> 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp> 27cdf0e10cSrcweir 28cdf0e10cSrcweir 29cdf0e10cSrcweir namespace DOM 30cdf0e10cSrcweir { CComment(CDocument const & rDocument,::osl::Mutex const & rMutex,xmlNodePtr const pNode)31cdf0e10cSrcweir CComment::CComment(CDocument const& rDocument, ::osl::Mutex const& rMutex, 32cdf0e10cSrcweir xmlNodePtr const pNode) 33cdf0e10cSrcweir : CComment_Base(rDocument, rMutex, NodeType_COMMENT_NODE, pNode) 34cdf0e10cSrcweir { 35cdf0e10cSrcweir } 36cdf0e10cSrcweir saxify(const Reference<XDocumentHandler> & i_xHandler)37cdf0e10cSrcweir void CComment::saxify( 38cdf0e10cSrcweir const Reference< XDocumentHandler >& i_xHandler) { 39cdf0e10cSrcweir if (!i_xHandler.is()) throw RuntimeException(); 40cdf0e10cSrcweir Reference< XExtendedDocumentHandler > xExtended(i_xHandler, UNO_QUERY); 41cdf0e10cSrcweir if (xExtended.is()) { 42cdf0e10cSrcweir xExtended->comment(getData()); 43cdf0e10cSrcweir } 44cdf0e10cSrcweir } 45cdf0e10cSrcweir getNodeName()46cdf0e10cSrcweir OUString SAL_CALL CComment::getNodeName()throw (RuntimeException) 47cdf0e10cSrcweir { 48cdf0e10cSrcweir return OUString::createFromAscii("#comment"); 49cdf0e10cSrcweir } 50cdf0e10cSrcweir getNodeValue()51cdf0e10cSrcweir OUString SAL_CALL CComment::getNodeValue() throw (RuntimeException) 52cdf0e10cSrcweir { 53cdf0e10cSrcweir return CCharacterData::getData(); 54cdf0e10cSrcweir } 55cdf0e10cSrcweir } 56