1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: PagePropertySetContext.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_xmloff.hxx"
33 #include <tools/debug.hxx>
34 #include "PagePropertySetContext.hxx"
35 #include "XMLBackgroundImageContext.hxx"
36 #include "XMLTextColumnsContext.hxx"
37 #ifndef _XMLOFF_PAGEMASTERSTYLEMAP_HXX
38 #include <xmloff/PageMasterStyleMap.hxx>
40 #include "XMLFootnoteSeparatorImport.hxx"
42 using ::rtl::OUString
;
44 using namespace ::com::sun::star::uno
;
45 using namespace ::com::sun::star
;
47 PagePropertySetContext::PagePropertySetContext(
48 SvXMLImport
& rImport
, sal_uInt16 nPrfx
,
49 const OUString
& rLName
,
50 const Reference
< xml::sax::XAttributeList
> & xAttrList
,
52 ::std::vector
< XMLPropertyState
> &rProps
,
53 const UniReference
< SvXMLImportPropertyMapper
> &rMap
,
54 sal_Int32 nStartIndex
, sal_Int32 nEndIndex
,
55 const PageContextType aTempType
) :
56 SvXMLPropertySetContext( rImport
, nPrfx
, rLName
, xAttrList
, nFam
,
57 rProps
, rMap
, nStartIndex
, nEndIndex
)
62 PagePropertySetContext::~PagePropertySetContext()
66 SvXMLImportContext
*PagePropertySetContext::CreateChildContext(
68 const OUString
& rLocalName
,
69 const Reference
< xml::sax::XAttributeList
> & xAttrList
,
70 ::std::vector
< XMLPropertyState
> &rProperties
,
71 const XMLPropertyState
& rProp
)
73 sal_Int32 nPos
= CTF_PM_GRAPHICPOSITION
;
74 sal_Int32 nFil
= CTF_PM_GRAPHICFILTER
;
79 nPos
= CTF_PM_HEADERGRAPHICPOSITION
;
80 nFil
= CTF_PM_HEADERGRAPHICFILTER
;
85 nPos
= CTF_PM_FOOTERGRAPHICPOSITION
;
86 nFil
= CTF_PM_FOOTERGRAPHICFILTER
;
92 SvXMLImportContext
*pContext
= 0;
94 switch( mxMapper
->getPropertySetMapper()
95 ->GetEntryContextId( rProp
.mnIndex
) )
97 case CTF_PM_GRAPHICURL
:
98 case CTF_PM_HEADERGRAPHICURL
:
99 case CTF_PM_FOOTERGRAPHICURL
:
100 DBG_ASSERT( rProp
.mnIndex
>= 2 &&
101 nPos
== mxMapper
->getPropertySetMapper()
102 ->GetEntryContextId( rProp
.mnIndex
-2 ) &&
103 nFil
== mxMapper
->getPropertySetMapper()
104 ->GetEntryContextId( rProp
.mnIndex
-1 ),
105 "invalid property map!");
107 new XMLBackgroundImageContext( GetImport(), nPrefix
,
108 rLocalName
, xAttrList
,
116 case CTF_PM_TEXTCOLUMNS
:
118 pContext
= new XMLTextColumnsContext( GetImport(), nPrefix
,
119 rLocalName
, xAttrList
, rProp
,
122 // create default context to skip content
123 pContext
= new SvXMLImportContext( GetImport(), nPrefix
, rLocalName
);
124 #endif // #ifndef SVX_LIGHT
127 case CTF_PM_FTN_LINE_WEIGTH
:
129 pContext
= new XMLFootnoteSeparatorImport(
130 GetImport(), nPrefix
, rLocalName
, rProperties
,
131 mxMapper
->getPropertySetMapper(), rProp
.mnIndex
);
133 // create default context to skip content
134 pContext
= new SvXMLImportContext( GetImport(), nPrefix
, rLocalName
);
135 #endif // #ifndef SVX_LIGHT
140 pContext
= SvXMLPropertySetContext::CreateChildContext( nPrefix
, rLocalName
,
142 rProperties
, rProp
);