Update ooo320-m1
[ooovba.git] / xmloff / source / chart / XMLLabelSeparatorContext.cxx
blob804bb96cc8d3dbde59fc24abf8676c2ea8ecbb1b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XMLLabelSeparatorContext.cxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_xmloff.hxx"
33 #include "XMLLabelSeparatorContext.hxx"
35 #include "SchXMLParagraphContext.hxx"
36 #include <xmloff/xmltoken.hxx>
37 #include <xmloff/xmltkmap.hxx>
38 #include "xmlnmspe.hxx"
39 #include <xmloff/xmlimp.hxx>
40 #include <xmloff/nmspmap.hxx>
42 TYPEINIT1( XMLLabelSeparatorContext, XMLElementPropertyContext );
44 using namespace ::com::sun::star;
46 XMLLabelSeparatorContext::XMLLabelSeparatorContext(
47 SvXMLImport& rImport, sal_uInt16 nPrfx,
48 const ::rtl::OUString& rLocalName,
49 const XMLPropertyState& rProp,
50 ::std::vector< XMLPropertyState > &rProps ) :
51 XMLElementPropertyContext(
52 rImport, nPrfx, rLocalName, rProp, rProps ),
53 m_aSeparator()
57 XMLLabelSeparatorContext::~XMLLabelSeparatorContext()
60 void XMLLabelSeparatorContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& /*xAttrList*/ )
64 SvXMLImportContext* XMLLabelSeparatorContext::CreateChildContext(
65 sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName,
66 const uno::Reference< xml::sax::XAttributeList > & /*xAttrList*/ )
68 SvXMLImportContext* pContext = NULL;
69 if( xmloff::token::IsXMLToken( rLocalName, xmloff::token::XML_P ) )
71 pContext = new SchXMLParagraphContext( GetImport(),
72 rLocalName, m_aSeparator );
74 if( !pContext )
75 pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
77 return pContext;
80 void XMLLabelSeparatorContext::EndElement()
82 if( m_aSeparator.getLength() )
84 // aProp is a member of XMLElementPropertyContext
85 aProp.maValue <<= m_aSeparator;
86 SetInsert( sal_True );
89 XMLElementPropertyContext::EndElement();