LibreOffice Module xmloff (master)  1
XMLShapePropertySetContext.cxx
Go to the documentation of this file.
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 
21 #include <xmloff/xmlimp.hxx>
22 #include <xmloff/xmlnumi.hxx>
23 #include <xmltabi.hxx>
24 #include <xmlsdtypes.hxx>
25 #include <xmloff/txtprmap.hxx>
26 #include <xmloff/xmlimppr.hxx>
27 
28 #include <com/sun/star/container/XIndexReplace.hpp>
29 
30 using namespace ::com::sun::star;
31 using namespace ::com::sun::star::uno;
32 
33 
35  SvXMLImport& rImport, sal_uInt16 nPrfx,
36  const OUString& rLName,
37  const Reference< xml::sax::XAttributeList > & xAttrList,
38  sal_uInt32 nFam,
39  ::std::vector< XMLPropertyState > &rProps,
41  SvXMLPropertySetContext( rImport, nPrfx, rLName, xAttrList, nFam,
42  rProps, rMap ),
43  mnBulletIndex(-1)
44 {
45 }
46 
48 {
49 }
50 
52 {
53  Reference< container::XIndexReplace > xNumRule;
54  if( mxBulletStyle.is() )
55  {
56  SvxXMLListStyleContext* pBulletStyle = static_cast<SvxXMLListStyleContext*>(mxBulletStyle.get());
57  xNumRule = SvxXMLListStyleContext::CreateNumRule( GetImport().GetModel() );
58  if( xNumRule.is() )
59  pBulletStyle->FillUnoNumRule(xNumRule);
60  }
61 
62  XMLPropertyState aPropState( mnBulletIndex, Any(xNumRule) );
63  mrProperties.push_back( aPropState );
64 
66 }
67 
69  sal_uInt16 nPrefix,
70  const OUString& rLocalName,
71  const Reference< xml::sax::XAttributeList > & xAttrList,
72  ::std::vector< XMLPropertyState > &rProperties,
73  const XMLPropertyState& rProp )
74 {
75  SvXMLImportContextRef xContext;
76 
77  switch( mxMapper->getPropertySetMapper()->GetEntryContextId( rProp.mnIndex ) )
78  {
79  case CTF_NUMBERINGRULES:
80  mnBulletIndex = rProp.mnIndex;
81  mxBulletStyle = xContext = new SvxXMLListStyleContext( GetImport(), nPrefix, rLocalName, xAttrList );
82  break;
83  case CTF_TABSTOP:
84  xContext = new SvxXMLTabStopImportContext( GetImport(), nPrefix,
85  rLocalName, rProp,
86  rProperties );
87  break;
88  }
89 
90  if (!xContext)
91  xContext = SvXMLPropertySetContext::CreateChildContext( nPrefix, rLocalName,
92  xAttrList,
93  rProperties, rProp );
94 
95  return xContext;
96 }
97 
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void EndElement()
EndElement is called before a context will be destructed, but after an elements context has been pars...
Definition: xmlictxt.cxx:62
#define CTF_TABSTOP
Definition: txtprmap.hxx:55
#define CTF_NUMBERINGRULES
Definition: xmlsdtypes.hxx:123
void FillUnoNumRule(const css::uno::Reference< css::container::XIndexReplace > &rNumRule) const
Definition: xmlnumi.cxx:1070
SvXMLImport & GetImport()
Definition: xmlictxt.hxx:62
sal_Int32 mnIndex
Definition: maptype.hxx:124
static css::uno::Reference< css::container::XIndexReplace > CreateNumRule(const css::uno::Reference< css::frame::XModel > &rModel)
Definition: xmlnumi.cxx:1214
::std::vector< XMLPropertyState > & mrProperties
Definition: xmlprcon.hxx:36
rtl::Reference< SvXMLImportPropertyMapper > mxMapper
Definition: xmlprcon.hxx:37
XMLShapePropertySetContext(SvXMLImport &rImport, sal_uInt16 nPrfx, const OUString &rLName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList, sal_uInt32 nFam,::std::vector< XMLPropertyState > &rProps, const rtl::Reference< SvXMLImportPropertyMapper > &rMap)
virtual SvXMLImportContextRef CreateChildContext(sal_uInt16 nPrefix, const OUString &rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
Create a children element context.
Smart struct to transport an Any with an index to the appropriate property-name.
Definition: maptype.hxx:122
virtual void EndElement() override
EndElement is called before a context will be destructed, but after an elements context has been pars...
virtual SvXMLImportContextRef CreateChildContext(sal_uInt16 nPrefix, const OUString &rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList,::std::vector< XMLPropertyState > &rProperties, const XMLPropertyState &rProp) override