LibreOffice Module xmloff (master)  1
PagePropertySetContext.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 
20 #include <tools/debug.hxx>
24 #include <PageMasterStyleMap.hxx>
26 #include <xmloff/xmlimppr.hxx>
27 #include <xmloff/xmlprmap.hxx>
28 
29 
30 using namespace ::com::sun::star::uno;
31 using namespace ::com::sun::star;
32 
34  SvXMLImport& rImport, sal_Int32 nElement,
35  const Reference< xml::sax::XFastAttributeList > & xAttrList,
36  sal_uInt32 nFam,
37  ::std::vector< XMLPropertyState > &rProps,
39  sal_Int32 nStartIndex, sal_Int32 nEndIndex,
40  const PageContextType aTempType ) :
41  SvXMLPropertySetContext( rImport, nElement, xAttrList, nFam,
42  rProps, rMap, nStartIndex, nEndIndex )
43 {
44  aType = aTempType;
45 }
46 
48 {
49 }
50 
51 css::uno::Reference< css::xml::sax::XFastContextHandler > PagePropertySetContext::createFastChildContext(
52  sal_Int32 nElement,
53  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList,
54  ::std::vector< XMLPropertyState > &rProperties,
55  const XMLPropertyState& rProp )
56 {
57  sal_Int32 nPos = CTF_PM_GRAPHICPOSITION;
58  sal_Int32 nFil = CTF_PM_GRAPHICFILTER;
59  switch ( aType )
60  {
61  case Header:
62  {
65  }
66  break;
67  case Footer:
68  {
71  }
72  break;
73  default:
74  break;
75  }
76 
77  switch( mxMapper->getPropertySetMapper()
78  ->GetEntryContextId( rProp.mnIndex ) )
79  {
80  case CTF_PM_GRAPHICURL:
83  DBG_ASSERT( rProp.mnIndex >= 2 &&
84  nPos == mxMapper->getPropertySetMapper()
85  ->GetEntryContextId( rProp.mnIndex-2 ) &&
86  nFil == mxMapper->getPropertySetMapper()
87  ->GetEntryContextId( rProp.mnIndex-1 ),
88  "invalid property map!");
89  return
90  new XMLBackgroundImageContext( GetImport(), nElement,
91  xAttrList,
92  rProp,
93  rProp.mnIndex-2,
94  rProp.mnIndex-1,
95  -1,
96  mxMapper->getPropertySetMapper()->FindEntryIndex(CTF_PM_FILLBITMAPMODE),
97  rProperties );
98  break;
99 
100  case CTF_PM_TEXTCOLUMNS:
101  return new XMLTextColumnsContext( GetImport(), nElement,
102  xAttrList, rProp,
103  rProperties );
104  break;
105 
107  return new XMLFootnoteSeparatorImport(
108  GetImport(), nElement, rProperties,
109  mxMapper->getPropertySetMapper(), rProp.mnIndex);
110  break;
111  }
112 
114  xAttrList,
115  rProperties, rProp );
116 }
117 
118 
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define CTF_PM_HEADERGRAPHICPOSITION
#define CTF_PM_FTN_LINE_WEIGHT
SvXMLImport & GetImport()
Definition: xmlictxt.hxx:59
#define CTF_PM_HEADERGRAPHICURL
sal_Int32 mnIndex
Definition: maptype.hxx:124
#define CTF_PM_FILLBITMAPMODE
#define CTF_PM_FOOTERGRAPHICURL
#define CTF_PM_GRAPHICFILTER
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
Definition: xmlprcon.cxx:55
#define CTF_PM_GRAPHICURL
#define CTF_PM_FOOTERGRAPHICPOSITION
Import the footnote-separator element in page styles.
#define DBG_ASSERT(sCon, aError)
#define CTF_PM_FOOTERGRAPHICFILTER
rtl::Reference< SvXMLImportPropertyMapper > mxMapper
Definition: xmlprcon.hxx:37
Footer
virtual ~PagePropertySetContext() override
#define CTF_PM_GRAPHICPOSITION
Header
Smart struct to transport an Any with an index to the appropriate property-name.
Definition: maptype.hxx:122
PagePropertySetContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, sal_uInt32 nFam,::std::vector< XMLPropertyState > &rProps, const rtl::Reference< SvXMLImportPropertyMapper > &rMap, sal_Int32 nStartIndex, sal_Int32 nEndIndex, const PageContextType aType)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList,::std::vector< XMLPropertyState > &rProperties, const XMLPropertyState &rProp) override
This method is called from this instance implementation of CreateChildContext if the element matches ...
#define CTF_PM_HEADERGRAPHICFILTER
#define CTF_PM_TEXTCOLUMNS
sal_uInt16 nPos