nss: upgrade to release 3.73
[LibreOffice.git] / xmloff / source / transform / ControlOOoTContext.cxx
blob1391b7225af20b050c57b1b550fd2f24700d6522
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "ControlOOoTContext.hxx"
21 #include "IgnoreTContext.hxx"
22 #include "MutableAttrList.hxx"
23 #include "ActionMapTypesOOo.hxx"
24 #include "TransformerBase.hxx"
27 using namespace ::com::sun::star::uno;
28 using namespace ::com::sun::star::xml::sax;
29 using namespace ::xmloff::token;
31 XMLControlOOoTransformerContext::XMLControlOOoTransformerContext(
32 XMLTransformerBase& rImp,
33 const OUString& rQName ) :
34 XMLTransformerContext( rImp, rQName )
38 void XMLControlOOoTransformerContext::StartElement(
39 const Reference< XAttributeList >& rAttrList )
41 m_xAttrList = new XMLMutableAttributeList( rAttrList, true );
44 rtl::Reference<XMLTransformerContext> XMLControlOOoTransformerContext::CreateChildContext(
45 sal_uInt16 /*nPrefix*/,
46 const OUString& /*rLocalName*/,
47 const OUString& rQName,
48 const Reference< XAttributeList >& rAttrList )
50 rtl::Reference<XMLTransformerContext> pContext;
52 if( m_aElemQName.isEmpty() )
54 pContext.set(new XMLIgnoreTransformerContext( GetTransformer(),
55 rQName,
56 false, false ));
57 m_aElemQName = rQName;
58 static_cast< XMLMutableAttributeList * >( m_xAttrList.get() )
59 ->AppendAttributeList( rAttrList );
60 GetTransformer().ProcessAttrList( m_xAttrList,
61 OOO_FORM_CONTROL_ACTIONS,
62 false );
63 GetTransformer().GetDocHandler()->startElement( m_aElemQName,
64 m_xAttrList );
66 else
68 pContext.set(new XMLIgnoreTransformerContext( GetTransformer(),
69 rQName,
70 true, true ));
72 return pContext;
75 void XMLControlOOoTransformerContext::EndElement()
77 GetTransformer().GetDocHandler()->endElement( m_aElemQName );
80 void XMLControlOOoTransformerContext::Characters( const OUString& rChars )
82 // ignore
83 if( !m_aElemQName.isEmpty() )
84 XMLTransformerContext::Characters( rChars );
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */