bump product version to 5.0.4.1
[LibreOffice.git] / xmloff / source / draw / XMLShapePropertySetContext.cxx
blobf4f988024dfb1e066bb7a8a4be8aec26acb321d4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 "XMLShapePropertySetContext.hxx"
21 #include <xmloff/xmlimp.hxx>
22 #include <xmloff/xmlnumi.hxx>
23 #include "xmltabi.hxx"
24 #include <xmloff/txtprmap.hxx>
26 #include "sdpropls.hxx"
28 using namespace ::com::sun::star;
29 using namespace ::com::sun::star::uno;
31 TYPEINIT1( XMLShapePropertySetContext, SvXMLPropertySetContext );
33 XMLShapePropertySetContext::XMLShapePropertySetContext(
34 SvXMLImport& rImport, sal_uInt16 nPrfx,
35 const OUString& rLName,
36 const Reference< xml::sax::XAttributeList > & xAttrList,
37 sal_uInt32 nFam,
38 ::std::vector< XMLPropertyState > &rProps,
39 const rtl::Reference < SvXMLImportPropertyMapper > &rMap ) :
40 SvXMLPropertySetContext( rImport, nPrfx, rLName, xAttrList, nFam,
41 rProps, rMap ),
42 mnBulletIndex(-1)
46 XMLShapePropertySetContext::~XMLShapePropertySetContext()
50 void XMLShapePropertySetContext::EndElement()
52 Reference< container::XIndexReplace > xNumRule;
53 if( mxBulletStyle.Is() )
55 SvxXMLListStyleContext* pBulletStyle = static_cast<SvxXMLListStyleContext*>(&mxBulletStyle);
56 xNumRule = SvxXMLListStyleContext::CreateNumRule( GetImport().GetModel() );
57 if( xNumRule.is() )
58 pBulletStyle->FillUnoNumRule(xNumRule);
61 Any aAny;
62 aAny <<= xNumRule;
64 XMLPropertyState aPropState( mnBulletIndex, aAny );
65 mrProperties.push_back( aPropState );
67 SvXMLPropertySetContext::EndElement();
70 SvXMLImportContext *XMLShapePropertySetContext::CreateChildContext(
71 sal_uInt16 nPrefix,
72 const OUString& rLocalName,
73 const Reference< xml::sax::XAttributeList > & xAttrList,
74 ::std::vector< XMLPropertyState > &rProperties,
75 const XMLPropertyState& rProp )
77 SvXMLImportContext *pContext = 0;
79 switch( mxMapper->getPropertySetMapper()->GetEntryContextId( rProp.mnIndex ) )
81 case CTF_NUMBERINGRULES:
82 mnBulletIndex = rProp.mnIndex;
83 mxBulletStyle = pContext = new SvxXMLListStyleContext( GetImport(), nPrefix, rLocalName, xAttrList );
84 break;
85 case CTF_TABSTOP:
86 pContext = new SvxXMLTabStopImportContext( GetImport(), nPrefix,
87 rLocalName, rProp,
88 rProperties );
89 break;
92 if( !pContext )
93 pContext = SvXMLPropertySetContext::CreateChildContext( nPrefix, rLocalName,
94 xAttrList,
95 rProperties, rProp );
97 return pContext;
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */