tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / xmloff / source / style / PagePropertySetContext.cxx
blob583a5d14c32166f40708e796462dd61ac5bac7bc
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 <PageMasterStyleMap.hxx>
25 #include "XMLFootnoteSeparatorImport.hxx"
26 #include <xmloff/xmlimppr.hxx>
27 #include <xmloff/xmlprmap.hxx>
30 using namespace ::com::sun::star::uno;
31 using namespace ::com::sun::star;
33 PagePropertySetContext::PagePropertySetContext(
34 SvXMLImport& rImport, sal_Int32 nElement,
35 const Reference< xml::sax::XFastAttributeList > & xAttrList,
36 sal_uInt32 nFam,
37 ::std::vector< XMLPropertyState > &rProps,
38 const rtl::Reference < SvXMLImportPropertyMapper > &rMap,
39 sal_Int32 nStartIndex, sal_Int32 nEndIndex,
40 const PageContextType aTempType ) :
41 SvXMLPropertySetContext( rImport, nElement, xAttrList, nFam,
42 rProps, rMap, nStartIndex, nEndIndex )
44 aType = aTempType;
47 PagePropertySetContext::~PagePropertySetContext()
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 )
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;
77 switch( mxMapper->getPropertySetMapper()
78 ->GetEntryContextId( rProp.mnIndex ) )
80 case CTF_PM_GRAPHICURL:
81 case CTF_PM_HEADERGRAPHICURL:
82 case CTF_PM_FOOTERGRAPHICURL:
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;
100 case CTF_PM_TEXTCOLUMNS:
101 return new XMLTextColumnsContext(GetImport(), nElement, xAttrList, rProp, rProperties);
102 break;
104 case CTF_PM_FTN_LINE_WEIGHT:
105 return new XMLFootnoteSeparatorImport(
106 GetImport(), nElement, rProperties,
107 mxMapper->getPropertySetMapper(), rProp.mnIndex);
108 break;
111 return SvXMLPropertySetContext::createFastChildContext( nElement,
112 xAttrList,
113 rProperties, rProp );
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */