bump product version to 5.0.4.1
[LibreOffice.git] / xmloff / source / style / PagePropertySetContext.cxx
blob9fa55fb4c47c7078508d26a01bbd4ce5695164b9
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 <tools/debug.hxx>
21 #include "PagePropertySetContext.hxx"
22 #include "XMLBackgroundImageContext.hxx"
23 #include "XMLTextColumnsContext.hxx"
24 #include <xmloff/PageMasterStyleMap.hxx>
25 #include "XMLFootnoteSeparatorImport.hxx"
28 using namespace ::com::sun::star::uno;
29 using namespace ::com::sun::star;
31 PagePropertySetContext::PagePropertySetContext(
32 SvXMLImport& rImport, sal_uInt16 nPrfx,
33 const OUString& rLName,
34 const Reference< xml::sax::XAttributeList > & xAttrList,
35 sal_uInt32 nFam,
36 ::std::vector< XMLPropertyState > &rProps,
37 const rtl::Reference < SvXMLImportPropertyMapper > &rMap,
38 sal_Int32 nStartIndex, sal_Int32 nEndIndex,
39 const PageContextType aTempType ) :
40 SvXMLPropertySetContext( rImport, nPrfx, rLName, xAttrList, nFam,
41 rProps, rMap, nStartIndex, nEndIndex )
43 aType = aTempType;
46 PagePropertySetContext::~PagePropertySetContext()
50 SvXMLImportContext *PagePropertySetContext::CreateChildContext(
51 sal_uInt16 nPrefix,
52 const OUString& rLocalName,
53 const Reference< xml::sax::XAttributeList > & xAttrList,
54 ::std::vector< XMLPropertyState > &rProperties,
55 const XMLPropertyState& rProp )
57 sal_Int32 nPos = CTF_PM_GRAPHICPOSITION;
58 sal_Int32 nFil = CTF_PM_GRAPHICFILTER;
59 switch ( aType )
61 case Header:
63 nPos = CTF_PM_HEADERGRAPHICPOSITION;
64 nFil = CTF_PM_HEADERGRAPHICFILTER;
66 break;
67 case Footer:
69 nPos = CTF_PM_FOOTERGRAPHICPOSITION;
70 nFil = CTF_PM_FOOTERGRAPHICFILTER;
72 break;
73 default:
74 break;
76 SvXMLImportContext *pContext = 0;
78 switch( mxMapper->getPropertySetMapper()
79 ->GetEntryContextId( rProp.mnIndex ) )
81 case CTF_PM_GRAPHICURL:
82 case CTF_PM_HEADERGRAPHICURL:
83 case CTF_PM_FOOTERGRAPHICURL:
84 DBG_ASSERT( rProp.mnIndex >= 2 &&
85 nPos == mxMapper->getPropertySetMapper()
86 ->GetEntryContextId( rProp.mnIndex-2 ) &&
87 nFil == mxMapper->getPropertySetMapper()
88 ->GetEntryContextId( rProp.mnIndex-1 ),
89 "invalid property map!");
90 (void)nPos;
91 (void)nFil;
92 pContext =
93 new XMLBackgroundImageContext( GetImport(), nPrefix,
94 rLocalName, xAttrList,
95 rProp,
96 rProp.mnIndex-2,
97 rProp.mnIndex-1,
98 -1,
99 mxMapper->getPropertySetMapper()->FindEntryIndex(CTF_PM_FILLBITMAPMODE),
100 rProperties );
101 break;
103 case CTF_PM_TEXTCOLUMNS:
104 pContext = new XMLTextColumnsContext( GetImport(), nPrefix,
105 rLocalName, xAttrList, rProp,
106 rProperties );
107 break;
109 case CTF_PM_FTN_LINE_WEIGHT:
110 pContext = new XMLFootnoteSeparatorImport(
111 GetImport(), nPrefix, rLocalName, rProperties,
112 mxMapper->getPropertySetMapper(), rProp.mnIndex);
113 break;
116 if( !pContext )
117 pContext = SvXMLPropertySetContext::CreateChildContext( nPrefix, rLocalName,
118 xAttrList,
119 rProperties, rProp );
121 return pContext;
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */