Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
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"
28 :
29 :
30 : using namespace ::com::sun::star::uno;
31 : using namespace ::com::sun::star::xml::sax;
32 : using namespace ::xmloff::token;
33 :
34 0 : TYPEINIT1( XMLControlOOoTransformerContext, XMLTransformerContext );
35 :
36 0 : XMLControlOOoTransformerContext::XMLControlOOoTransformerContext(
37 : XMLTransformerBase& rImp,
38 : const OUString& rQName ) :
39 0 : XMLTransformerContext( rImp, rQName )
40 : {
41 0 : }
42 :
43 0 : XMLControlOOoTransformerContext::~XMLControlOOoTransformerContext()
44 : {
45 0 : }
46 :
47 0 : void XMLControlOOoTransformerContext::StartElement(
48 : const Reference< XAttributeList >& rAttrList )
49 : {
50 0 : m_xAttrList = new XMLMutableAttributeList( rAttrList, sal_True );
51 0 : }
52 :
53 0 : XMLTransformerContext *XMLControlOOoTransformerContext::CreateChildContext(
54 : sal_uInt16 /*nPrefix*/,
55 : const OUString& /*rLocalName*/,
56 : const OUString& rQName,
57 : const Reference< XAttributeList >& rAttrList )
58 : {
59 0 : XMLTransformerContext *pContext = 0;
60 :
61 0 : if( m_aElemQName.isEmpty() )
62 : {
63 0 : pContext = new XMLIgnoreTransformerContext( GetTransformer(),
64 : rQName,
65 0 : sal_False, sal_False );
66 0 : m_aElemQName = rQName;
67 0 : static_cast< XMLMutableAttributeList * >( m_xAttrList.get() )
68 0 : ->AppendAttributeList( rAttrList );
69 0 : GetTransformer().ProcessAttrList( m_xAttrList,
70 : OOO_FORM_CONTROL_ACTIONS,
71 0 : sal_False );
72 0 : GetTransformer().GetDocHandler()->startElement( m_aElemQName,
73 0 : m_xAttrList );
74 : }
75 : else
76 : {
77 0 : pContext = new XMLIgnoreTransformerContext( GetTransformer(),
78 : rQName,
79 0 : sal_True, sal_True );
80 : }
81 0 : return pContext;
82 : }
83 :
84 0 : void XMLControlOOoTransformerContext::EndElement()
85 : {
86 0 : GetTransformer().GetDocHandler()->endElement( m_aElemQName );
87 0 : }
88 :
89 0 : void XMLControlOOoTransformerContext::Characters( const OUString& rChars )
90 : {
91 : // ignore
92 0 : if( !m_aElemQName.isEmpty() )
93 0 : XMLTransformerContext::Characters( rChars );
94 0 : }
95 :
96 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|