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 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_desktop.hxx" 26 #include "dp_misc.h" 27 #include "dp_parceldesc.hxx" 28 29 30 31 using namespace ::com::sun::star; 32 using namespace ::com::sun::star::uno; 33 34 using ::rtl::OUString; 35 36 namespace css = ::com::sun::star; 37 namespace dp_registry 38 { 39 namespace backend 40 { 41 namespace sfwk 42 { 43 44 45 // XDocumentHandler 46 void SAL_CALL 47 ParcelDescDocHandler::startDocument() 48 { 49 m_bIsParsed = false; 50 } 51 52 void SAL_CALL 53 ParcelDescDocHandler::endDocument() 54 { 55 m_bIsParsed = true; 56 } 57 58 void SAL_CALL 59 ParcelDescDocHandler::characters( const OUString & ) 60 { 61 } 62 63 void SAL_CALL 64 ParcelDescDocHandler::ignorableWhitespace( const OUString & ) 65 { 66 } 67 68 void SAL_CALL 69 ParcelDescDocHandler::processingInstruction( 70 const OUString &, const OUString & ) 71 { 72 } 73 74 void SAL_CALL 75 ParcelDescDocHandler::setDocumentLocator( 76 const Reference< xml::sax::XLocator >& ) 77 { 78 } 79 80 void SAL_CALL 81 ParcelDescDocHandler::startElement( const OUString& aName, 82 const Reference< xml::sax::XAttributeList > & xAttribs ) 83 { 84 85 dp_misc::TRACE(OUSTR("ParcelDescDocHandler::startElement() for ") + 86 aName + OUSTR("\n")); 87 if ( !skipIndex ) 88 { 89 if ( aName.equals( OUString::createFromAscii( "parcel" ) ) ) 90 { 91 m_sLang = xAttribs->getValueByName( OUString::createFromAscii( "language" ) ); 92 } 93 ++skipIndex; 94 } 95 else 96 { 97 dp_misc::TRACE(OUSTR("ParcelDescDocHandler::startElement() skipping for ") 98 + aName + OUSTR("\n")); 99 } 100 101 } 102 103 void SAL_CALL ParcelDescDocHandler::endElement( const OUString & aName ) 104 { 105 if ( skipIndex ) 106 { 107 --skipIndex; 108 dp_misc::TRACE(OUSTR("ParcelDescDocHandler::endElement() skipping for ") 109 + aName + OUSTR("\n")); 110 } 111 } 112 113 114 } 115 } 116 } 117