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 "XMLChartPropertyContext.hxx"
21 : #include "PropertyMap.hxx"
22 :
23 : #include "XMLSymbolImageContext.hxx"
24 : #include "XMLLabelSeparatorContext.hxx"
25 :
26 0 : TYPEINIT1( XMLChartPropertyContext, SvXMLImportContext );
27 :
28 : using namespace ::com::sun::star;
29 :
30 1761 : XMLChartPropertyContext::XMLChartPropertyContext(
31 : SvXMLImport& rImport,
32 : sal_uInt16 nPrfx,
33 : const OUString& rLName,
34 : const uno::Reference< xml::sax::XAttributeList > & xAttrList,
35 : sal_uInt32 nFamily,
36 : ::std::vector< XMLPropertyState >& rProps,
37 : const rtl::Reference< SvXMLImportPropertyMapper >& rMapper ) :
38 1761 : SvXMLPropertySetContext( rImport, nPrfx, rLName, xAttrList, nFamily, rProps, rMapper )
39 : {
40 1761 : }
41 :
42 3522 : XMLChartPropertyContext::~XMLChartPropertyContext()
43 3522 : {}
44 :
45 82 : SvXMLImportContext* XMLChartPropertyContext::CreateChildContext(
46 : sal_uInt16 nPrefix,
47 : const OUString& rLocalName,
48 : const uno::Reference< xml::sax::XAttributeList > & xAttrList,
49 : ::std::vector< XMLPropertyState > &rProperties,
50 : const XMLPropertyState& rProp )
51 : {
52 82 : SvXMLImportContext *pContext = 0;
53 :
54 82 : switch( mxMapper->getPropertySetMapper()->GetEntryContextId( rProp.mnIndex ) )
55 : {
56 : case XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE:
57 7 : pContext = new XMLSymbolImageContext( GetImport(), nPrefix, rLocalName, rProp, rProperties );
58 7 : break;
59 : case XML_SCH_CONTEXT_SPECIAL_LABEL_SEPARATOR:
60 75 : pContext = new XMLLabelSeparatorContext( GetImport(), nPrefix, rLocalName, rProp, rProperties );
61 75 : break;
62 : }
63 :
64 : // default / no context yet: create child context by base class
65 82 : if( !pContext )
66 : {
67 : pContext = SvXMLPropertySetContext::CreateChildContext(
68 0 : nPrefix, rLocalName, xAttrList, rProperties, rProp );
69 : }
70 :
71 82 : return pContext;
72 : }
73 :
74 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|