1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
,
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
)
46 PagePropertySetContext::~PagePropertySetContext()
50 SvXMLImportContext
*PagePropertySetContext::CreateChildContext(
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
;
63 nPos
= CTF_PM_HEADERGRAPHICPOSITION
;
64 nFil
= CTF_PM_HEADERGRAPHICFILTER
;
69 nPos
= CTF_PM_FOOTERGRAPHICPOSITION
;
70 nFil
= CTF_PM_FOOTERGRAPHICFILTER
;
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!");
93 new XMLBackgroundImageContext( GetImport(), nPrefix
,
94 rLocalName
, xAttrList
,
99 mxMapper
->getPropertySetMapper()->FindEntryIndex(CTF_PM_FILLBITMAPMODE
),
103 case CTF_PM_TEXTCOLUMNS
:
104 pContext
= new XMLTextColumnsContext( GetImport(), nPrefix
,
105 rLocalName
, xAttrList
, rProp
,
109 case CTF_PM_FTN_LINE_WEIGHT
:
110 pContext
= new XMLFootnoteSeparatorImport(
111 GetImport(), nPrefix
, rLocalName
, rProperties
,
112 mxMapper
->getPropertySetMapper(), rProp
.mnIndex
);
117 pContext
= SvXMLPropertySetContext::CreateChildContext( nPrefix
, rLocalName
,
119 rProperties
, rProp
);
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */