Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include "ControlOOoTContext.hxx"
30 : : #include "IgnoreTContext.hxx"
31 : : #include "MutableAttrList.hxx"
32 : : #include "xmloff/xmlnmspe.hxx"
33 : : #include "ActionMapTypesOOo.hxx"
34 : : #include "ElemTransformerAction.hxx"
35 : : #include "TransformerActions.hxx"
36 : : #include "TransformerBase.hxx"
37 : :
38 : : using ::rtl::OUString;
39 : :
40 : : using namespace ::com::sun::star::uno;
41 : : using namespace ::com::sun::star::xml::sax;
42 : : using namespace ::xmloff::token;
43 : :
44 [ # # ][ # # ]: 0 : TYPEINIT1( XMLControlOOoTransformerContext, XMLTransformerContext );
45 : :
46 : 26 : XMLControlOOoTransformerContext::XMLControlOOoTransformerContext(
47 : : XMLTransformerBase& rImp,
48 : : const OUString& rQName ) :
49 : 26 : XMLTransformerContext( rImp, rQName )
50 : : {
51 : 26 : }
52 : :
53 : 26 : XMLControlOOoTransformerContext::~XMLControlOOoTransformerContext()
54 : : {
55 [ - + ]: 52 : }
56 : :
57 : 26 : void XMLControlOOoTransformerContext::StartElement(
58 : : const Reference< XAttributeList >& rAttrList )
59 : : {
60 [ + - ][ + - ]: 26 : m_xAttrList = new XMLMutableAttributeList( rAttrList, sal_True );
61 : 26 : }
62 : :
63 : 26 : XMLTransformerContext *XMLControlOOoTransformerContext::CreateChildContext(
64 : : sal_uInt16 /*nPrefix*/,
65 : : const OUString& /*rLocalName*/,
66 : : const OUString& rQName,
67 : : const Reference< XAttributeList >& rAttrList )
68 : : {
69 : 26 : XMLTransformerContext *pContext = 0;
70 : :
71 [ + - ]: 26 : if( m_aElemQName.isEmpty() )
72 : : {
73 : 26 : pContext = new XMLIgnoreTransformerContext( GetTransformer(),
74 : : rQName,
75 [ + - ]: 26 : sal_False, sal_False );
76 : 26 : m_aElemQName = rQName;
77 : 26 : static_cast< XMLMutableAttributeList * >( m_xAttrList.get() )
78 [ + - ]: 26 : ->AppendAttributeList( rAttrList );
79 : 26 : GetTransformer().ProcessAttrList( m_xAttrList,
80 : : OOO_FORM_CONTROL_ACTIONS,
81 : 26 : sal_False );
82 : 26 : GetTransformer().GetDocHandler()->startElement( m_aElemQName,
83 : 26 : m_xAttrList );
84 : : }
85 : : else
86 : : {
87 : 0 : pContext = new XMLIgnoreTransformerContext( GetTransformer(),
88 : : rQName,
89 [ # # ]: 0 : sal_True, sal_True );
90 : : }
91 : 26 : return pContext;
92 : : }
93 : :
94 : 26 : void XMLControlOOoTransformerContext::EndElement()
95 : : {
96 : 26 : GetTransformer().GetDocHandler()->endElement( m_aElemQName );
97 : 26 : }
98 : :
99 : 24 : void XMLControlOOoTransformerContext::Characters( const OUString& rChars )
100 : : {
101 : : // ignore
102 [ + + ]: 24 : if( !m_aElemQName.isEmpty() )
103 : 12 : XMLTransformerContext::Characters( rChars );
104 : 24 : }
105 : :
106 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|