bump product version to 5.0.4.1
[LibreOffice.git] / xmloff / source / transform / ControlOOoTContext.cxx
blob0debacb3ae1647e11e830fd2b6d9d259ff54a235
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 <xmloff/xmlnmspe.hxx>
24 #include "ActionMapTypesOOo.hxx"
25 #include "ElemTransformerAction.hxx"
26 #include "TransformerActions.hxx"
27 #include "TransformerBase.hxx"
30 using namespace ::com::sun::star::uno;
31 using namespace ::com::sun::star::xml::sax;
32 using namespace ::xmloff::token;
34 TYPEINIT1( XMLControlOOoTransformerContext, XMLTransformerContext );
36 XMLControlOOoTransformerContext::XMLControlOOoTransformerContext(
37 XMLTransformerBase& rImp,
38 const OUString& rQName ) :
39 XMLTransformerContext( rImp, rQName )
43 XMLControlOOoTransformerContext::~XMLControlOOoTransformerContext()
47 void XMLControlOOoTransformerContext::StartElement(
48 const Reference< XAttributeList >& rAttrList )
50 m_xAttrList = new XMLMutableAttributeList( rAttrList, true );
53 XMLTransformerContext *XMLControlOOoTransformerContext::CreateChildContext(
54 sal_uInt16 /*nPrefix*/,
55 const OUString& /*rLocalName*/,
56 const OUString& rQName,
57 const Reference< XAttributeList >& rAttrList )
59 XMLTransformerContext *pContext = 0;
61 if( m_aElemQName.isEmpty() )
63 pContext = new XMLIgnoreTransformerContext( GetTransformer(),
64 rQName,
65 false, false );
66 m_aElemQName = rQName;
67 static_cast< XMLMutableAttributeList * >( m_xAttrList.get() )
68 ->AppendAttributeList( rAttrList );
69 GetTransformer().ProcessAttrList( m_xAttrList,
70 OOO_FORM_CONTROL_ACTIONS,
71 false );
72 GetTransformer().GetDocHandler()->startElement( m_aElemQName,
73 m_xAttrList );
75 else
77 pContext = new XMLIgnoreTransformerContext( GetTransformer(),
78 rQName,
79 true, true );
81 return pContext;
84 void XMLControlOOoTransformerContext::EndElement()
86 GetTransformer().GetDocHandler()->endElement( m_aElemQName );
89 void XMLControlOOoTransformerContext::Characters( const OUString& rChars )
91 // ignore
92 if( !m_aElemQName.isEmpty() )
93 XMLTransformerContext::Characters( rChars );
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */