1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 XMLControlOOoTransformerContext::XMLControlOOoTransformerContext(
35 XMLTransformerBase
& rImp
,
36 const OUString
& rQName
) :
37 XMLTransformerContext( rImp
, rQName
)
41 XMLControlOOoTransformerContext::~XMLControlOOoTransformerContext()
45 void XMLControlOOoTransformerContext::StartElement(
46 const Reference
< XAttributeList
>& rAttrList
)
48 m_xAttrList
= new XMLMutableAttributeList( rAttrList
, true );
51 rtl::Reference
<XMLTransformerContext
> XMLControlOOoTransformerContext::CreateChildContext(
52 sal_uInt16
/*nPrefix*/,
53 const OUString
& /*rLocalName*/,
54 const OUString
& rQName
,
55 const Reference
< XAttributeList
>& rAttrList
)
57 rtl::Reference
<XMLTransformerContext
> pContext
;
59 if( m_aElemQName
.isEmpty() )
61 pContext
.set(new XMLIgnoreTransformerContext( GetTransformer(),
64 m_aElemQName
= rQName
;
65 static_cast< XMLMutableAttributeList
* >( m_xAttrList
.get() )
66 ->AppendAttributeList( rAttrList
);
67 GetTransformer().ProcessAttrList( m_xAttrList
,
68 OOO_FORM_CONTROL_ACTIONS
,
70 GetTransformer().GetDocHandler()->startElement( m_aElemQName
,
75 pContext
.set(new XMLIgnoreTransformerContext( GetTransformer(),
82 void XMLControlOOoTransformerContext::EndElement()
84 GetTransformer().GetDocHandler()->endElement( m_aElemQName
);
87 void XMLControlOOoTransformerContext::Characters( const OUString
& rChars
)
90 if( !m_aElemQName
.isEmpty() )
91 XMLTransformerContext::Characters( rChars
);
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */