xref: /aoo42x/main/xmloff/source/draw/sdxmlexp.cxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_xmloff.hxx"
30*cdf0e10cSrcweir #include "unointerfacetouniqueidentifiermapper.hxx"
31*cdf0e10cSrcweir #include <xmloff/nmspmap.hxx>
32*cdf0e10cSrcweir #include "xmloff/xmlnmspe.hxx"
33*cdf0e10cSrcweir #include <xmloff/xmluconv.hxx>
34*cdf0e10cSrcweir #include <xmloff/xmltoken.hxx>
35*cdf0e10cSrcweir #include <xmloff/xmlmetae.hxx>
36*cdf0e10cSrcweir #include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
37*cdf0e10cSrcweir #include <com/sun/star/presentation/XPresentationSupplier.hpp>
38*cdf0e10cSrcweir #include <com/sun/star/presentation/XCustomPresentationSupplier.hpp>
39*cdf0e10cSrcweir #include <com/sun/star/geometry/RealPoint2D.hpp>
40*cdf0e10cSrcweir #include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
41*cdf0e10cSrcweir #include <com/sun/star/office/XAnnotationAccess.hpp>
42*cdf0e10cSrcweir #include <com/sun/star/lang/Locale.hpp>
43*cdf0e10cSrcweir #include <com/sun/star/uno/Any.hxx>
44*cdf0e10cSrcweir #include "sdxmlexp_impl.hxx"
45*cdf0e10cSrcweir #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
46*cdf0e10cSrcweir #include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
47*cdf0e10cSrcweir #include <com/sun/star/presentation/XHandoutMasterSupplier.hpp>
48*cdf0e10cSrcweir #include <com/sun/star/container/XIndexContainer.hpp>
49*cdf0e10cSrcweir #include <com/sun/star/view/PaperOrientation.hpp>
50*cdf0e10cSrcweir #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
51*cdf0e10cSrcweir #include <com/sun/star/style/XStyle.hpp>
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir #include <com/sun/star/form/XFormsSupplier2.hpp>
54*cdf0e10cSrcweir #include <com/sun/star/presentation/XPresentationPage.hpp>
55*cdf0e10cSrcweir #include <com/sun/star/drawing/XMasterPageTarget.hpp>
56*cdf0e10cSrcweir #include <com/sun/star/text/XText.hpp>
57*cdf0e10cSrcweir #include <com/sun/star/chart/XChartDocument.hpp>
58*cdf0e10cSrcweir #include <com/sun/star/animations/XAnimationNodeSupplier.hpp>
59*cdf0e10cSrcweir #include <com/sun/star/container/XNamed.hpp>
60*cdf0e10cSrcweir #include <rtl/ustrbuf.hxx>
61*cdf0e10cSrcweir #include <tools/gen.hxx>
62*cdf0e10cSrcweir #include <tools/debug.hxx>
63*cdf0e10cSrcweir #include <xmloff/xmlaustp.hxx>
64*cdf0e10cSrcweir #include <xmloff/families.hxx>
65*cdf0e10cSrcweir #include <xmloff/styleexp.hxx>
66*cdf0e10cSrcweir #include "sdpropls.hxx"
67*cdf0e10cSrcweir #include <xmloff/xmlexppr.hxx>
68*cdf0e10cSrcweir #include <com/sun/star/beans/XPropertyState.hpp>
69*cdf0e10cSrcweir #include "xexptran.hxx"
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir #ifndef _CPPUHELPER_IMPLBASE1_HXX
72*cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
73*cdf0e10cSrcweir #endif
74*cdf0e10cSrcweir #include <comphelper/extract.hxx>
75*cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
76*cdf0e10cSrcweir #include "PropertySetMerger.hxx"
77*cdf0e10cSrcweir #include "layerexp.hxx"
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir 
80*cdf0e10cSrcweir #include "xmloff/VisAreaExport.hxx"
81*cdf0e10cSrcweir #include "XMLNumberStylesExport.hxx"
82*cdf0e10cSrcweir #include <tools/list.hxx>
83*cdf0e10cSrcweir #include <tools/string.hxx>
84*cdf0e10cSrcweir 
85*cdf0e10cSrcweir #include "animationexport.hxx"
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir #include <com/sun/star/document/XDocumentProperties.hpp>
88*cdf0e10cSrcweir #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir using ::rtl::OUString;
91*cdf0e10cSrcweir using ::rtl::OUStringBuffer;
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir using namespace ::com::sun::star;
94*cdf0e10cSrcweir using namespace ::com::sun::star::uno;
95*cdf0e10cSrcweir using namespace ::com::sun::star::beans;
96*cdf0e10cSrcweir using namespace ::com::sun::star::util;
97*cdf0e10cSrcweir using namespace ::com::sun::star::container;
98*cdf0e10cSrcweir using namespace ::com::sun::star::drawing;
99*cdf0e10cSrcweir using namespace ::com::sun::star::office;
100*cdf0e10cSrcweir using namespace ::com::sun::star::presentation;
101*cdf0e10cSrcweir using namespace ::com::sun::star::geometry;
102*cdf0e10cSrcweir using namespace ::com::sun::star::text;
103*cdf0e10cSrcweir using namespace ::xmloff::token;
104*cdf0e10cSrcweir 
105*cdf0e10cSrcweir 
106*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir class ImpXMLEXPPageMasterInfo
109*cdf0e10cSrcweir {
110*cdf0e10cSrcweir 	sal_Int32					mnBorderBottom;
111*cdf0e10cSrcweir 	sal_Int32					mnBorderLeft;
112*cdf0e10cSrcweir 	sal_Int32					mnBorderRight;
113*cdf0e10cSrcweir 	sal_Int32					mnBorderTop;
114*cdf0e10cSrcweir 	sal_Int32					mnWidth;
115*cdf0e10cSrcweir 	sal_Int32					mnHeight;
116*cdf0e10cSrcweir 	view::PaperOrientation		meOrientation;
117*cdf0e10cSrcweir 	OUString					msName;
118*cdf0e10cSrcweir 	OUString					msMasterPageName;
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir public:
121*cdf0e10cSrcweir 	ImpXMLEXPPageMasterInfo(const SdXMLExport& rExp, const Reference<XDrawPage>& xPage);
122*cdf0e10cSrcweir 	sal_Bool operator==(const ImpXMLEXPPageMasterInfo& rInfo) const;
123*cdf0e10cSrcweir 	void SetName(const OUString& rStr);
124*cdf0e10cSrcweir 
125*cdf0e10cSrcweir 	const OUString& GetName() const { return msName; }
126*cdf0e10cSrcweir 	const OUString& GetMasterPageName() const { return msMasterPageName; }
127*cdf0e10cSrcweir 
128*cdf0e10cSrcweir 	sal_Int32 GetBorderBottom() const { return mnBorderBottom; }
129*cdf0e10cSrcweir 	sal_Int32 GetBorderLeft() const { return mnBorderLeft; }
130*cdf0e10cSrcweir 	sal_Int32 GetBorderRight() const { return mnBorderRight; }
131*cdf0e10cSrcweir 	sal_Int32 GetBorderTop() const { return mnBorderTop; }
132*cdf0e10cSrcweir 	sal_Int32 GetWidth() const { return mnWidth; }
133*cdf0e10cSrcweir 	sal_Int32 GetHeight() const { return mnHeight; }
134*cdf0e10cSrcweir 	view::PaperOrientation GetOrientation() const { return meOrientation; }
135*cdf0e10cSrcweir };
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir ImpXMLEXPPageMasterInfo::ImpXMLEXPPageMasterInfo(
138*cdf0e10cSrcweir 	const SdXMLExport& rExp,
139*cdf0e10cSrcweir 	const Reference<XDrawPage>& xPage)
140*cdf0e10cSrcweir :	mnBorderBottom(0),
141*cdf0e10cSrcweir 	mnBorderLeft(0),
142*cdf0e10cSrcweir 	mnBorderRight(0),
143*cdf0e10cSrcweir 	mnBorderTop(0),
144*cdf0e10cSrcweir 	mnWidth(0),
145*cdf0e10cSrcweir 	mnHeight(0),
146*cdf0e10cSrcweir 	meOrientation(rExp.IsDraw() ? view::PaperOrientation_PORTRAIT : view::PaperOrientation_LANDSCAPE)
147*cdf0e10cSrcweir {
148*cdf0e10cSrcweir 	Reference <beans::XPropertySet> xPropSet(xPage, UNO_QUERY);
149*cdf0e10cSrcweir 	if(xPropSet.is())
150*cdf0e10cSrcweir 	{
151*cdf0e10cSrcweir 		Any aAny;
152*cdf0e10cSrcweir 
153*cdf0e10cSrcweir 		Reference< beans::XPropertySetInfo > xPropsInfo( xPropSet->getPropertySetInfo() );
154*cdf0e10cSrcweir 		if( xPropsInfo.is() && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderBottom") )))
155*cdf0e10cSrcweir 		{
156*cdf0e10cSrcweir 			aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderBottom")));
157*cdf0e10cSrcweir 			aAny >>= mnBorderBottom;
158*cdf0e10cSrcweir 
159*cdf0e10cSrcweir 			aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderLeft")));
160*cdf0e10cSrcweir 			aAny >>= mnBorderLeft;
161*cdf0e10cSrcweir 
162*cdf0e10cSrcweir 			aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderRight")));
163*cdf0e10cSrcweir 			aAny >>= mnBorderRight;
164*cdf0e10cSrcweir 
165*cdf0e10cSrcweir 			aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderTop")));
166*cdf0e10cSrcweir 			aAny >>= mnBorderTop;
167*cdf0e10cSrcweir 		}
168*cdf0e10cSrcweir 
169*cdf0e10cSrcweir 		if( xPropsInfo.is() && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("Width") )))
170*cdf0e10cSrcweir 		{
171*cdf0e10cSrcweir 			aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Width")));
172*cdf0e10cSrcweir 			aAny >>= mnWidth;
173*cdf0e10cSrcweir 
174*cdf0e10cSrcweir 			aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Height")));
175*cdf0e10cSrcweir 			aAny >>= mnHeight;
176*cdf0e10cSrcweir 		}
177*cdf0e10cSrcweir 
178*cdf0e10cSrcweir 		if( xPropsInfo.is() && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("Orientation") )))
179*cdf0e10cSrcweir 		{
180*cdf0e10cSrcweir 			aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Orientation")));
181*cdf0e10cSrcweir 			aAny >>= meOrientation;
182*cdf0e10cSrcweir 		}
183*cdf0e10cSrcweir 	}
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir 	Reference <container::XNamed> xMasterNamed(xPage, UNO_QUERY);
186*cdf0e10cSrcweir 	if(xMasterNamed.is())
187*cdf0e10cSrcweir 	{
188*cdf0e10cSrcweir 		msMasterPageName = xMasterNamed->getName();
189*cdf0e10cSrcweir 	}
190*cdf0e10cSrcweir }
191*cdf0e10cSrcweir 
192*cdf0e10cSrcweir sal_Bool ImpXMLEXPPageMasterInfo::operator==(const ImpXMLEXPPageMasterInfo& rInfo) const
193*cdf0e10cSrcweir {
194*cdf0e10cSrcweir 	return ((mnBorderBottom == rInfo.mnBorderBottom)
195*cdf0e10cSrcweir 		&& (mnBorderLeft == rInfo.mnBorderLeft)
196*cdf0e10cSrcweir 		&& (mnBorderRight == rInfo.mnBorderRight)
197*cdf0e10cSrcweir 		&& (mnBorderTop == rInfo.mnBorderTop)
198*cdf0e10cSrcweir 		&& (mnWidth == rInfo.mnWidth)
199*cdf0e10cSrcweir 		&& (mnHeight == rInfo.mnHeight)
200*cdf0e10cSrcweir 		&& (meOrientation == rInfo.meOrientation));
201*cdf0e10cSrcweir }
202*cdf0e10cSrcweir 
203*cdf0e10cSrcweir void ImpXMLEXPPageMasterInfo::SetName(const OUString& rStr)
204*cdf0e10cSrcweir {
205*cdf0e10cSrcweir 	msName = rStr;
206*cdf0e10cSrcweir }
207*cdf0e10cSrcweir 
208*cdf0e10cSrcweir DECLARE_LIST(ImpXMLEXPPageMasterList, ImpXMLEXPPageMasterInfo*)
209*cdf0e10cSrcweir 
210*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
211*cdf0e10cSrcweir 
212*cdf0e10cSrcweir #define	IMP_AUTOLAYOUT_INFO_MAX			(35L)
213*cdf0e10cSrcweir 
214*cdf0e10cSrcweir class ImpXMLAutoLayoutInfo
215*cdf0e10cSrcweir {
216*cdf0e10cSrcweir 	sal_uInt16					mnType;
217*cdf0e10cSrcweir 	ImpXMLEXPPageMasterInfo*	mpPageMasterInfo;
218*cdf0e10cSrcweir 	OUString					msLayoutName;
219*cdf0e10cSrcweir 	Rectangle					maTitleRect;
220*cdf0e10cSrcweir 	Rectangle					maPresRect;
221*cdf0e10cSrcweir 	sal_Int32					mnGapX;
222*cdf0e10cSrcweir 	sal_Int32					mnGapY;
223*cdf0e10cSrcweir 
224*cdf0e10cSrcweir public:
225*cdf0e10cSrcweir 	ImpXMLAutoLayoutInfo(sal_uInt16 nTyp, ImpXMLEXPPageMasterInfo* pInf);
226*cdf0e10cSrcweir 
227*cdf0e10cSrcweir 	sal_Bool operator==(const ImpXMLAutoLayoutInfo& rInfo) const;
228*cdf0e10cSrcweir 
229*cdf0e10cSrcweir 	sal_uInt16 GetLayoutType() const { return mnType; }
230*cdf0e10cSrcweir 	sal_Int32 GetGapX() const { return mnGapX; }
231*cdf0e10cSrcweir 	sal_Int32 GetGapY() const { return mnGapY; }
232*cdf0e10cSrcweir 
233*cdf0e10cSrcweir 	const OUString& GetLayoutName() const { return msLayoutName; }
234*cdf0e10cSrcweir 	void SetLayoutName(const OUString& rNew) { msLayoutName = rNew; }
235*cdf0e10cSrcweir 
236*cdf0e10cSrcweir 	const Rectangle& GetTitleRectangle() const { return maTitleRect; }
237*cdf0e10cSrcweir 	const Rectangle& GetPresRectangle() const { return maPresRect; }
238*cdf0e10cSrcweir 
239*cdf0e10cSrcweir 	static sal_Bool IsCreateNecessary(sal_uInt16 nTyp);
240*cdf0e10cSrcweir };
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir sal_Bool ImpXMLAutoLayoutInfo::IsCreateNecessary(sal_uInt16 nTyp)
243*cdf0e10cSrcweir {
244*cdf0e10cSrcweir 	if(nTyp == 5 /* AUTOLAYOUT_ORG */
245*cdf0e10cSrcweir 		|| nTyp == 20 /* AUTOLAYOUT_NONE */
246*cdf0e10cSrcweir 		|| nTyp >= IMP_AUTOLAYOUT_INFO_MAX)
247*cdf0e10cSrcweir 		return sal_False;
248*cdf0e10cSrcweir 	return sal_True;
249*cdf0e10cSrcweir }
250*cdf0e10cSrcweir 
251*cdf0e10cSrcweir sal_Bool ImpXMLAutoLayoutInfo::operator==(const ImpXMLAutoLayoutInfo& rInfo) const
252*cdf0e10cSrcweir {
253*cdf0e10cSrcweir 	return ((mnType == rInfo.mnType
254*cdf0e10cSrcweir 		&& mpPageMasterInfo == rInfo.mpPageMasterInfo));
255*cdf0e10cSrcweir }
256*cdf0e10cSrcweir 
257*cdf0e10cSrcweir ImpXMLAutoLayoutInfo::ImpXMLAutoLayoutInfo(sal_uInt16 nTyp, ImpXMLEXPPageMasterInfo* pInf)
258*cdf0e10cSrcweir :	mnType(nTyp),
259*cdf0e10cSrcweir 	mpPageMasterInfo(pInf)
260*cdf0e10cSrcweir {
261*cdf0e10cSrcweir 	// create full info (initialze with typical values)
262*cdf0e10cSrcweir 	Point aPagePos(0,0);
263*cdf0e10cSrcweir 	Size aPageSize(28000, 21000);
264*cdf0e10cSrcweir 	Size aPageInnerSize(28000, 21000);
265*cdf0e10cSrcweir 
266*cdf0e10cSrcweir 	if(mpPageMasterInfo)
267*cdf0e10cSrcweir 	{
268*cdf0e10cSrcweir 		aPagePos = Point(mpPageMasterInfo->GetBorderLeft(), mpPageMasterInfo->GetBorderTop());
269*cdf0e10cSrcweir 		aPageSize = Size(mpPageMasterInfo->GetWidth(), mpPageMasterInfo->GetHeight());
270*cdf0e10cSrcweir 		aPageInnerSize = aPageSize;
271*cdf0e10cSrcweir 		aPageInnerSize.Width() -= mpPageMasterInfo->GetBorderLeft() + mpPageMasterInfo->GetBorderRight();
272*cdf0e10cSrcweir 		aPageInnerSize.Height() -= mpPageMasterInfo->GetBorderTop() + mpPageMasterInfo->GetBorderBottom();
273*cdf0e10cSrcweir 	}
274*cdf0e10cSrcweir 
275*cdf0e10cSrcweir 	// title rectangle aligning
276*cdf0e10cSrcweir 	Point aTitlePos(aPagePos);
277*cdf0e10cSrcweir 	Size aTitleSize(aPageInnerSize);
278*cdf0e10cSrcweir 
279*cdf0e10cSrcweir 	if(mnType == 21 /* AUTOLAYOUT_NOTES */)
280*cdf0e10cSrcweir 	{
281*cdf0e10cSrcweir 		aTitleSize.Height() = (long) (aTitleSize.Height() / 2.5);
282*cdf0e10cSrcweir 		Point aPos = aTitlePos;
283*cdf0e10cSrcweir 		aPos.Y() += long( aTitleSize.Height() * 0.083 );
284*cdf0e10cSrcweir 		Size aPartArea = aTitleSize;
285*cdf0e10cSrcweir 		Size aSize;
286*cdf0e10cSrcweir 
287*cdf0e10cSrcweir 		// tatsaechliche Seitengroesse in das Handout-Rechteck skalieren
288*cdf0e10cSrcweir 		double fH = (double) aPartArea.Width()  / aPageSize.Width();
289*cdf0e10cSrcweir 		double fV = (double) aPartArea.Height() / aPageSize.Height();
290*cdf0e10cSrcweir 
291*cdf0e10cSrcweir 		if ( fH > fV )
292*cdf0e10cSrcweir 			fH = fV;
293*cdf0e10cSrcweir 		aSize.Width()  = (long) (fH * aPageSize.Width());
294*cdf0e10cSrcweir 		aSize.Height() = (long) (fH * aPageSize.Height());
295*cdf0e10cSrcweir 
296*cdf0e10cSrcweir 		aPos.X() += (aPartArea.Width() - aSize.Width()) / 2;
297*cdf0e10cSrcweir 		aPos.Y() += (aPartArea.Height()- aSize.Height())/ 2;
298*cdf0e10cSrcweir 
299*cdf0e10cSrcweir 		aTitlePos = aPos;
300*cdf0e10cSrcweir 		aTitleSize = aSize;
301*cdf0e10cSrcweir 	}
302*cdf0e10cSrcweir 	else if(mnType == 27 || mnType == 28)
303*cdf0e10cSrcweir 	{
304*cdf0e10cSrcweir 		// AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART or
305*cdf0e10cSrcweir 		// AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE
306*cdf0e10cSrcweir 		Point aClassicTPos(
307*cdf0e10cSrcweir 			aTitlePos.X() + long( aTitleSize.Width() * 0.0735 ),
308*cdf0e10cSrcweir 			aTitlePos.Y() + long( aTitleSize.Height() * 0.083 ));
309*cdf0e10cSrcweir 		Size aClassicTSize(
310*cdf0e10cSrcweir 			long( aTitleSize.Width() * 0.854 ),
311*cdf0e10cSrcweir 			long( aTitleSize.Height() * 0.167 ));
312*cdf0e10cSrcweir 		Point aLPos(aPagePos);
313*cdf0e10cSrcweir 		Size aLSize(aPageInnerSize);
314*cdf0e10cSrcweir 		Point aClassicLPos(
315*cdf0e10cSrcweir 			aLPos.X() + long( aLSize.Width() * 0.0735 ),
316*cdf0e10cSrcweir 			aLPos.Y() + long( aLSize.Height() * 0.472 ));
317*cdf0e10cSrcweir 		Size aClassicLSize(
318*cdf0e10cSrcweir 			long( aLSize.Width() * 0.854 ),
319*cdf0e10cSrcweir 			long( aLSize.Height() * 0.444 ));
320*cdf0e10cSrcweir 
321*cdf0e10cSrcweir 		aTitlePos.X() = (aClassicTPos.X() + aClassicTSize.Width()) - aClassicTSize.Height();
322*cdf0e10cSrcweir 		aTitlePos.Y() = aClassicTPos.Y();
323*cdf0e10cSrcweir 		aTitleSize.Width() = aClassicTSize.Height();
324*cdf0e10cSrcweir 		aTitleSize.Height() = (aClassicLPos.Y() + aClassicLSize.Height()) - aClassicTPos.Y();
325*cdf0e10cSrcweir 	}
326*cdf0e10cSrcweir 	else
327*cdf0e10cSrcweir 	{
328*cdf0e10cSrcweir 		aTitlePos.X() += long( aTitleSize.Width() * 0.0735 );
329*cdf0e10cSrcweir 		aTitlePos.Y() += long( aTitleSize.Height() * 0.083 );
330*cdf0e10cSrcweir 		aTitleSize.Width() = long( aTitleSize.Width() * 0.854 );
331*cdf0e10cSrcweir 		aTitleSize.Height() = long( aTitleSize.Height() * 0.167 );
332*cdf0e10cSrcweir 	}
333*cdf0e10cSrcweir 
334*cdf0e10cSrcweir 	maTitleRect.SetPos(aTitlePos);
335*cdf0e10cSrcweir 	maTitleRect.SetSize(aTitleSize);
336*cdf0e10cSrcweir 
337*cdf0e10cSrcweir 	// layout rectangle aligning
338*cdf0e10cSrcweir 	Point aLayoutPos(aPagePos);
339*cdf0e10cSrcweir 	Size aLayoutSize(aPageInnerSize);
340*cdf0e10cSrcweir 
341*cdf0e10cSrcweir 	if(mnType == 21 /* AUTOLAYOUT_NOTES */)
342*cdf0e10cSrcweir 	{
343*cdf0e10cSrcweir 		aLayoutPos.X() += long( aLayoutSize.Width() * 0.0735 );
344*cdf0e10cSrcweir 		aLayoutPos.Y() += long( aLayoutSize.Height() * 0.472 );
345*cdf0e10cSrcweir 		aLayoutSize.Width() = long( aLayoutSize.Width() * 0.854 );
346*cdf0e10cSrcweir 		aLayoutSize.Height() = long( aLayoutSize.Height() * 0.444 );
347*cdf0e10cSrcweir 	}
348*cdf0e10cSrcweir 	else if((mnType >= 22 && mnType <= 26) || (mnType == 31)) // AUTOLAYOUT_HANDOUT
349*cdf0e10cSrcweir 	{
350*cdf0e10cSrcweir 		// keep info for inner area in maPresRect, put info for gap size
351*cdf0e10cSrcweir 		// to maTitleRect position
352*cdf0e10cSrcweir 		mnGapX = (aPageSize.Width() - aPageInnerSize.Width()) / 2;
353*cdf0e10cSrcweir 		mnGapY = (aPageSize.Height() - aPageInnerSize.Height()) / 2;
354*cdf0e10cSrcweir 
355*cdf0e10cSrcweir 		if(!mnGapX)
356*cdf0e10cSrcweir 			mnGapX = aPageSize.Width() / 10;
357*cdf0e10cSrcweir 
358*cdf0e10cSrcweir 		if(!mnGapY)
359*cdf0e10cSrcweir 			mnGapY = aPageSize.Height() / 10;
360*cdf0e10cSrcweir 
361*cdf0e10cSrcweir 		if(mnGapX < aPageInnerSize.Width() / 10)
362*cdf0e10cSrcweir 			mnGapX = aPageInnerSize.Width() / 10;
363*cdf0e10cSrcweir 
364*cdf0e10cSrcweir 		if(mnGapY < aPageInnerSize.Height() / 10)
365*cdf0e10cSrcweir 			mnGapY = aPageInnerSize.Height() / 10;
366*cdf0e10cSrcweir 	}
367*cdf0e10cSrcweir 	else if(mnType == 27 || mnType == 28)
368*cdf0e10cSrcweir 	{
369*cdf0e10cSrcweir 		// AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART or
370*cdf0e10cSrcweir 		// AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE
371*cdf0e10cSrcweir 		Point aClassicTPos(
372*cdf0e10cSrcweir 			aTitlePos.X() + long( aTitleSize.Width() * 0.0735 ),
373*cdf0e10cSrcweir 			aTitlePos.Y() + long( aTitleSize.Height() * 0.083 ));
374*cdf0e10cSrcweir 		Size aClassicTSize(
375*cdf0e10cSrcweir 			long( aTitleSize.Width() * 0.854 ),
376*cdf0e10cSrcweir 			long( aTitleSize.Height() * 0.167 ));
377*cdf0e10cSrcweir 		Point aClassicLPos(
378*cdf0e10cSrcweir 			aLayoutPos.X() + long( aLayoutSize.Width() * 0.0735 ),
379*cdf0e10cSrcweir 			aLayoutPos.Y() + long( aLayoutSize.Height() * 0.472 ));
380*cdf0e10cSrcweir 		Size aClassicLSize(
381*cdf0e10cSrcweir 			long( aLayoutSize.Width() * 0.854 ),
382*cdf0e10cSrcweir 			long( aLayoutSize.Height() * 0.444 ));
383*cdf0e10cSrcweir 
384*cdf0e10cSrcweir 		aLayoutPos.X() = aClassicLPos.X();
385*cdf0e10cSrcweir 		aLayoutPos.Y() = aClassicTPos.Y();
386*cdf0e10cSrcweir 		aLayoutSize.Width() = (aClassicLPos.X() + aClassicLSize.Width())
387*cdf0e10cSrcweir 			- (aClassicTSize.Height() + (aClassicLPos.Y() - (aClassicTPos.Y() + aClassicTSize.Height())));
388*cdf0e10cSrcweir 		aLayoutSize.Height() = (aClassicLPos.Y() + aClassicLSize.Height()) - aClassicTPos.Y();
389*cdf0e10cSrcweir 	}
390*cdf0e10cSrcweir     else if( mnType == 32 )
391*cdf0e10cSrcweir     {
392*cdf0e10cSrcweir         // AUTOLAYOUT_ONLY_TEXT
393*cdf0e10cSrcweir         aLayoutPos = aTitlePos;
394*cdf0e10cSrcweir         aLayoutSize.Width() = aTitleSize.Width();
395*cdf0e10cSrcweir         aLayoutSize.Height() = long( aLayoutSize.Height() * 0.825 );
396*cdf0e10cSrcweir     }
397*cdf0e10cSrcweir 	else
398*cdf0e10cSrcweir 	{
399*cdf0e10cSrcweir 		aLayoutPos.X() += long( aLayoutSize.Width() * 0.0735 );
400*cdf0e10cSrcweir 		aLayoutPos.Y() += long( aLayoutSize.Height() * 0.278 );
401*cdf0e10cSrcweir 		aLayoutSize.Width() = long( aLayoutSize.Width() * 0.854 );
402*cdf0e10cSrcweir 		aLayoutSize.Height() = long( aLayoutSize.Height() * 0.630 );
403*cdf0e10cSrcweir 	}
404*cdf0e10cSrcweir 
405*cdf0e10cSrcweir 	maPresRect.SetPos(aLayoutPos);
406*cdf0e10cSrcweir 	maPresRect.SetSize(aLayoutSize);
407*cdf0e10cSrcweir }
408*cdf0e10cSrcweir 
409*cdf0e10cSrcweir DECLARE_LIST(ImpXMLAutoLayoutInfoList, ImpXMLAutoLayoutInfo*)
410*cdf0e10cSrcweir 
411*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
412*cdf0e10cSrcweir 
413*cdf0e10cSrcweir // #110680#
414*cdf0e10cSrcweir SdXMLExport::SdXMLExport(
415*cdf0e10cSrcweir 	const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
416*cdf0e10cSrcweir 	sal_Bool bIsDraw, sal_uInt16 nExportFlags )
417*cdf0e10cSrcweir :	SvXMLExport( xServiceFactory, MAP_CM, bIsDraw ? XML_DRAWING : XML_PRESENTATION, nExportFlags ),
418*cdf0e10cSrcweir 	mnDocMasterPageCount(0L),
419*cdf0e10cSrcweir 	mnDocDrawPageCount(0L),
420*cdf0e10cSrcweir 	mnShapeStyleInfoIndex(0L),
421*cdf0e10cSrcweir 	mnObjectCount(0L),
422*cdf0e10cSrcweir 	mpPageMasterInfoList(new ImpXMLEXPPageMasterList(1, 4, 4)),
423*cdf0e10cSrcweir 	mpPageMasterUsageList(new ImpXMLEXPPageMasterList(1, 4, 4)),
424*cdf0e10cSrcweir 	mpNotesPageMasterUsageList(new ImpXMLEXPPageMasterList(1, 4, 4)),
425*cdf0e10cSrcweir 	mpHandoutPageMaster(NULL),
426*cdf0e10cSrcweir 	mpAutoLayoutInfoList(new ImpXMLAutoLayoutInfoList(1, 4, 4)),
427*cdf0e10cSrcweir 	mpSdPropHdlFactory(0L),
428*cdf0e10cSrcweir 	mpPropertySetMapper(0L),
429*cdf0e10cSrcweir 	mpPresPagePropsMapper(0L),
430*cdf0e10cSrcweir 	mbIsDraw(bIsDraw),
431*cdf0e10cSrcweir 	mbFamilyGraphicUsed(sal_False),
432*cdf0e10cSrcweir 	mbFamilyPresentationUsed(sal_False),
433*cdf0e10cSrcweir 	msZIndex( GetXMLToken(XML_ZINDEX) ),
434*cdf0e10cSrcweir 	msEmptyPres( RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ),
435*cdf0e10cSrcweir 	msModel( RTL_CONSTASCII_USTRINGPARAM("Model") ),
436*cdf0e10cSrcweir 	msStartShape( RTL_CONSTASCII_USTRINGPARAM("StartShape") ),
437*cdf0e10cSrcweir 	msEndShape( RTL_CONSTASCII_USTRINGPARAM("EndShape") ),
438*cdf0e10cSrcweir 	msPageLayoutNames( RTL_CONSTASCII_USTRINGPARAM("PageLayoutNames") )
439*cdf0e10cSrcweir {
440*cdf0e10cSrcweir 
441*cdf0e10cSrcweir 
442*cdf0e10cSrcweir }
443*cdf0e10cSrcweir 
444*cdf0e10cSrcweir // XExporter
445*cdf0e10cSrcweir void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent >& xDoc )
446*cdf0e10cSrcweir 	throw(lang::IllegalArgumentException, uno::RuntimeException)
447*cdf0e10cSrcweir {
448*cdf0e10cSrcweir 	SvXMLExport::setSourceDocument( xDoc );
449*cdf0e10cSrcweir 
450*cdf0e10cSrcweir 	const OUString aEmpty;
451*cdf0e10cSrcweir 
452*cdf0e10cSrcweir 	// prepare factory parts
453*cdf0e10cSrcweir 	mpSdPropHdlFactory = new XMLSdPropHdlFactory( GetModel(), *this );
454*cdf0e10cSrcweir 	if(mpSdPropHdlFactory)
455*cdf0e10cSrcweir 	{
456*cdf0e10cSrcweir 		// set lock to avoid deletion
457*cdf0e10cSrcweir 		mpSdPropHdlFactory->acquire();
458*cdf0e10cSrcweir 
459*cdf0e10cSrcweir 		// build one ref
460*cdf0e10cSrcweir 		const UniReference< XMLPropertyHandlerFactory > aFactoryRef = mpSdPropHdlFactory;
461*cdf0e10cSrcweir 
462*cdf0e10cSrcweir 		// construct PropertySetMapper
463*cdf0e10cSrcweir 		UniReference < XMLPropertySetMapper > xMapper =	new XMLShapePropertySetMapper( aFactoryRef);
464*cdf0e10cSrcweir 
465*cdf0e10cSrcweir 		mpPropertySetMapper = new XMLShapeExportPropertyMapper( xMapper, (XMLTextListAutoStylePool*)&GetTextParagraphExport()->GetListAutoStylePool(), *this );
466*cdf0e10cSrcweir 		// set lock to avoid deletion
467*cdf0e10cSrcweir 		mpPropertySetMapper->acquire();
468*cdf0e10cSrcweir 
469*cdf0e10cSrcweir 		// chain text attributes
470*cdf0e10cSrcweir 		mpPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(*this));
471*cdf0e10cSrcweir 
472*cdf0e10cSrcweir 		// construct PresPagePropsMapper
473*cdf0e10cSrcweir 		xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, aFactoryRef);
474*cdf0e10cSrcweir 
475*cdf0e10cSrcweir 		mpPresPagePropsMapper = new XMLPageExportPropertyMapper( xMapper, *this  );
476*cdf0e10cSrcweir 		if(mpPresPagePropsMapper)
477*cdf0e10cSrcweir 		{
478*cdf0e10cSrcweir 			// set lock to avoid deletion
479*cdf0e10cSrcweir 			mpPresPagePropsMapper->acquire();
480*cdf0e10cSrcweir 		}
481*cdf0e10cSrcweir 	}
482*cdf0e10cSrcweir 
483*cdf0e10cSrcweir 	// add family name
484*cdf0e10cSrcweir   	GetAutoStylePool()->AddFamily(
485*cdf0e10cSrcweir 		XML_STYLE_FAMILY_SD_GRAPHICS_ID,
486*cdf0e10cSrcweir 		OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)),
487*cdf0e10cSrcweir   		GetPropertySetMapper(),
488*cdf0e10cSrcweir   		OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_PREFIX)));
489*cdf0e10cSrcweir 	GetAutoStylePool()->AddFamily(
490*cdf0e10cSrcweir 		XML_STYLE_FAMILY_SD_PRESENTATION_ID,
491*cdf0e10cSrcweir 		OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_NAME)),
492*cdf0e10cSrcweir   		GetPropertySetMapper(),
493*cdf0e10cSrcweir   		OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_PREFIX)));
494*cdf0e10cSrcweir 	GetAutoStylePool()->AddFamily(
495*cdf0e10cSrcweir 		XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID,
496*cdf0e10cSrcweir 		OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME)),
497*cdf0e10cSrcweir   		GetPresPagePropsMapper(),
498*cdf0e10cSrcweir   		OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_DRAWINGPAGE_PREFIX)));
499*cdf0e10cSrcweir 	// prepare access to styles
500*cdf0e10cSrcweir 	Reference< style::XStyleFamiliesSupplier > xFamSup( GetModel(), UNO_QUERY );
501*cdf0e10cSrcweir 	if(xFamSup.is())
502*cdf0e10cSrcweir 	{
503*cdf0e10cSrcweir 		mxDocStyleFamilies = xFamSup->getStyleFamilies();
504*cdf0e10cSrcweir 	}
505*cdf0e10cSrcweir 
506*cdf0e10cSrcweir 	// prepare access to master pages
507*cdf0e10cSrcweir 	Reference < drawing::XMasterPagesSupplier > xMasterPagesSupplier(GetModel(), UNO_QUERY);
508*cdf0e10cSrcweir 	if(xMasterPagesSupplier.is())
509*cdf0e10cSrcweir 	{
510*cdf0e10cSrcweir 		mxDocMasterPages = mxDocMasterPages.query( xMasterPagesSupplier->getMasterPages() );
511*cdf0e10cSrcweir 		if(mxDocMasterPages.is())
512*cdf0e10cSrcweir 		{
513*cdf0e10cSrcweir 			mnDocMasterPageCount = mxDocMasterPages->getCount();
514*cdf0e10cSrcweir 			maMasterPagesStyleNames.insert( maMasterPagesStyleNames.begin(), mnDocMasterPageCount, aEmpty );
515*cdf0e10cSrcweir 		}
516*cdf0e10cSrcweir 	}
517*cdf0e10cSrcweir 
518*cdf0e10cSrcweir 	// prepare access to draw pages
519*cdf0e10cSrcweir 	Reference <XDrawPagesSupplier> xDrawPagesSupplier(GetModel(), UNO_QUERY);
520*cdf0e10cSrcweir 	if(xDrawPagesSupplier.is())
521*cdf0e10cSrcweir 	{
522*cdf0e10cSrcweir 		mxDocDrawPages = mxDocDrawPages.query( xDrawPagesSupplier->getDrawPages() );
523*cdf0e10cSrcweir 		if(mxDocDrawPages.is())
524*cdf0e10cSrcweir 		{
525*cdf0e10cSrcweir 			mnDocDrawPageCount = mxDocDrawPages->getCount();
526*cdf0e10cSrcweir 			maDrawPagesStyleNames.insert( maDrawPagesStyleNames.begin(), mnDocDrawPageCount, aEmpty );
527*cdf0e10cSrcweir 			maDrawNotesPagesStyleNames.insert( maDrawNotesPagesStyleNames.begin(), mnDocDrawPageCount, aEmpty );
528*cdf0e10cSrcweir 			if( !mbIsDraw )
529*cdf0e10cSrcweir 				maDrawPagesAutoLayoutNames.realloc( mnDocDrawPageCount + 1 );
530*cdf0e10cSrcweir 
531*cdf0e10cSrcweir 			HeaderFooterPageSettingsImpl aEmptySettings;
532*cdf0e10cSrcweir 			maDrawPagesHeaderFooterSettings.insert( maDrawPagesHeaderFooterSettings.begin(), mnDocDrawPageCount, aEmptySettings );
533*cdf0e10cSrcweir 			maDrawNotesPagesHeaderFooterSettings.insert( maDrawNotesPagesHeaderFooterSettings.begin(), mnDocDrawPageCount, aEmptySettings );
534*cdf0e10cSrcweir 		}
535*cdf0e10cSrcweir 	}
536*cdf0e10cSrcweir 
537*cdf0e10cSrcweir 	// #82003# count all draw objects for use with progress bar.
538*cdf0e10cSrcweir 	// #88245# init mnObjectCount once, use counter itself as flag. It
539*cdf0e10cSrcweir 	// is initialized to 0.
540*cdf0e10cSrcweir 	if(!mnObjectCount)
541*cdf0e10cSrcweir 	{
542*cdf0e10cSrcweir 		if( IsImpress() )
543*cdf0e10cSrcweir 		{
544*cdf0e10cSrcweir  			// #91587# add handout master count
545*cdf0e10cSrcweir 			Reference<presentation::XHandoutMasterSupplier> xHandoutSupp(GetModel(), UNO_QUERY);
546*cdf0e10cSrcweir 			if(xHandoutSupp.is())
547*cdf0e10cSrcweir 			{
548*cdf0e10cSrcweir 				Reference<XDrawPage> xHandoutPage(xHandoutSupp->getHandoutMasterPage());
549*cdf0e10cSrcweir 				if(xHandoutPage.is())
550*cdf0e10cSrcweir 				{
551*cdf0e10cSrcweir 					Reference<drawing::XShapes> xShapes(xHandoutPage, UNO_QUERY);
552*cdf0e10cSrcweir 					if(xShapes.is() && xShapes->getCount())
553*cdf0e10cSrcweir 					{
554*cdf0e10cSrcweir 						mnObjectCount += ImpRecursiveObjectCount(xShapes);
555*cdf0e10cSrcweir 					}
556*cdf0e10cSrcweir 				}
557*cdf0e10cSrcweir 			}
558*cdf0e10cSrcweir 		}
559*cdf0e10cSrcweir 
560*cdf0e10cSrcweir 		if(mxDocMasterPages.is())
561*cdf0e10cSrcweir 		{
562*cdf0e10cSrcweir 			for(sal_Int32 a(0); a < mnDocMasterPageCount; a++)
563*cdf0e10cSrcweir 			{
564*cdf0e10cSrcweir 				Any aAny(mxDocMasterPages->getByIndex(a));
565*cdf0e10cSrcweir 				Reference< drawing::XShapes > xMasterPage;
566*cdf0e10cSrcweir 
567*cdf0e10cSrcweir 				if((aAny >>= xMasterPage) && xMasterPage.is())
568*cdf0e10cSrcweir 				{
569*cdf0e10cSrcweir 					mnObjectCount += ImpRecursiveObjectCount(xMasterPage);
570*cdf0e10cSrcweir 				}
571*cdf0e10cSrcweir 
572*cdf0e10cSrcweir 				if( IsImpress() )
573*cdf0e10cSrcweir 				{
574*cdf0e10cSrcweir 					// #91587# take notes pages from master pages into account
575*cdf0e10cSrcweir 					Reference<presentation::XPresentationPage> xPresPage;
576*cdf0e10cSrcweir 					if((aAny >>= xPresPage) && xPresPage.is())
577*cdf0e10cSrcweir 					{
578*cdf0e10cSrcweir 						Reference<XDrawPage> xNotesPage(xPresPage->getNotesPage());
579*cdf0e10cSrcweir 						if(xNotesPage.is())
580*cdf0e10cSrcweir 						{
581*cdf0e10cSrcweir 							Reference<drawing::XShapes> xShapes(xNotesPage, UNO_QUERY);
582*cdf0e10cSrcweir 							if(xShapes.is() && xShapes->getCount())
583*cdf0e10cSrcweir 							{
584*cdf0e10cSrcweir 								mnObjectCount += ImpRecursiveObjectCount(xShapes);
585*cdf0e10cSrcweir 							}
586*cdf0e10cSrcweir 						}
587*cdf0e10cSrcweir 					}
588*cdf0e10cSrcweir 				}
589*cdf0e10cSrcweir 			}
590*cdf0e10cSrcweir 		}
591*cdf0e10cSrcweir 
592*cdf0e10cSrcweir 		if(mxDocDrawPages.is())
593*cdf0e10cSrcweir 		{
594*cdf0e10cSrcweir 			for(sal_Int32 a(0); a < mnDocDrawPageCount; a++)
595*cdf0e10cSrcweir 			{
596*cdf0e10cSrcweir 				Any aAny(mxDocDrawPages->getByIndex(a));
597*cdf0e10cSrcweir 				Reference< drawing::XShapes > xPage;
598*cdf0e10cSrcweir 
599*cdf0e10cSrcweir 				if((aAny >>= xPage) && xPage.is())
600*cdf0e10cSrcweir 				{
601*cdf0e10cSrcweir 					mnObjectCount += ImpRecursiveObjectCount(xPage);
602*cdf0e10cSrcweir 				}
603*cdf0e10cSrcweir 
604*cdf0e10cSrcweir 				if( IsImpress() )
605*cdf0e10cSrcweir 				{
606*cdf0e10cSrcweir 					// #91587# take notes pages from draw pages into account
607*cdf0e10cSrcweir 					Reference<presentation::XPresentationPage> xPresPage;
608*cdf0e10cSrcweir 					if((aAny >>= xPresPage) && xPresPage.is())
609*cdf0e10cSrcweir 					{
610*cdf0e10cSrcweir 						Reference<XDrawPage> xNotesPage(xPresPage->getNotesPage());
611*cdf0e10cSrcweir 						if(xNotesPage.is())
612*cdf0e10cSrcweir 						{
613*cdf0e10cSrcweir 							Reference<drawing::XShapes> xShapes(xNotesPage, UNO_QUERY);
614*cdf0e10cSrcweir 							if(xShapes.is() && xShapes->getCount())
615*cdf0e10cSrcweir 							{
616*cdf0e10cSrcweir 								mnObjectCount += ImpRecursiveObjectCount(xShapes);
617*cdf0e10cSrcweir 							}
618*cdf0e10cSrcweir 						}
619*cdf0e10cSrcweir 					}
620*cdf0e10cSrcweir 				}
621*cdf0e10cSrcweir 			}
622*cdf0e10cSrcweir 		}
623*cdf0e10cSrcweir 
624*cdf0e10cSrcweir 		// #82003# init progress bar
625*cdf0e10cSrcweir 		GetProgressBarHelper()->SetReference(mnObjectCount);
626*cdf0e10cSrcweir 	}
627*cdf0e10cSrcweir 
628*cdf0e10cSrcweir 	// add namespaces
629*cdf0e10cSrcweir 	_GetNamespaceMap().Add(
630*cdf0e10cSrcweir 		GetXMLToken(XML_NP_PRESENTATION),
631*cdf0e10cSrcweir         GetXMLToken(XML_N_PRESENTATION),
632*cdf0e10cSrcweir 		XML_NAMESPACE_PRESENTATION);
633*cdf0e10cSrcweir 
634*cdf0e10cSrcweir 	_GetNamespaceMap().Add(
635*cdf0e10cSrcweir 		GetXMLToken(XML_NP_SMIL),
636*cdf0e10cSrcweir         GetXMLToken(XML_N_SMIL_COMPAT),
637*cdf0e10cSrcweir 		XML_NAMESPACE_SMIL);
638*cdf0e10cSrcweir 
639*cdf0e10cSrcweir 	_GetNamespaceMap().Add(
640*cdf0e10cSrcweir 		GetXMLToken(XML_NP_ANIMATION),
641*cdf0e10cSrcweir         GetXMLToken(XML_N_ANIMATION),
642*cdf0e10cSrcweir 		XML_NAMESPACE_ANIMATION);
643*cdf0e10cSrcweir 
644*cdf0e10cSrcweir     if( getDefaultVersion() > SvtSaveOptions::ODFVER_012 )
645*cdf0e10cSrcweir     {
646*cdf0e10cSrcweir 	    _GetNamespaceMap().Add(
647*cdf0e10cSrcweir 		    GetXMLToken(XML_NP_OFFICE_EXT),
648*cdf0e10cSrcweir             GetXMLToken(XML_N_OFFICE_EXT),
649*cdf0e10cSrcweir 		    XML_NAMESPACE_OFFICE_EXT);
650*cdf0e10cSrcweir 
651*cdf0e10cSrcweir 	    _GetNamespaceMap().Add(
652*cdf0e10cSrcweir 		    GetXMLToken(XML_NP_DRAW_EXT),
653*cdf0e10cSrcweir             GetXMLToken(XML_N_DRAW_EXT),
654*cdf0e10cSrcweir 		    XML_NAMESPACE_DRAW_EXT);
655*cdf0e10cSrcweir 	}
656*cdf0e10cSrcweir 
657*cdf0e10cSrcweir 	GetShapeExport()->enableLayerExport();
658*cdf0e10cSrcweir 
659*cdf0e10cSrcweir 	// #88546# enable progress bar increments
660*cdf0e10cSrcweir 	GetShapeExport()->enableHandleProgressBar();
661*cdf0e10cSrcweir }
662*cdf0e10cSrcweir 
663*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
664*cdf0e10cSrcweir // #82003# helper function for recursive object count
665*cdf0e10cSrcweir sal_uInt32 SdXMLExport::ImpRecursiveObjectCount(Reference< drawing::XShapes > xShapes)
666*cdf0e10cSrcweir {
667*cdf0e10cSrcweir 	sal_uInt32 nRetval(0L);
668*cdf0e10cSrcweir 
669*cdf0e10cSrcweir 	if(xShapes.is())
670*cdf0e10cSrcweir 	{
671*cdf0e10cSrcweir 		sal_Int32 nCount = xShapes->getCount();
672*cdf0e10cSrcweir 
673*cdf0e10cSrcweir 		for(sal_Int32 a(0L); a < nCount; a++)
674*cdf0e10cSrcweir 		{
675*cdf0e10cSrcweir 			Any aAny(xShapes->getByIndex(a));
676*cdf0e10cSrcweir 			Reference< drawing::XShapes > xGroup;
677*cdf0e10cSrcweir 
678*cdf0e10cSrcweir 			if((aAny >>= xGroup) && xGroup.is())
679*cdf0e10cSrcweir 			{
680*cdf0e10cSrcweir 				// #93180# count group objects, too.
681*cdf0e10cSrcweir 				nRetval += 1 + ImpRecursiveObjectCount(xGroup);
682*cdf0e10cSrcweir 			}
683*cdf0e10cSrcweir 			else
684*cdf0e10cSrcweir 			{
685*cdf0e10cSrcweir 				nRetval++;
686*cdf0e10cSrcweir 			}
687*cdf0e10cSrcweir 		}
688*cdf0e10cSrcweir 	}
689*cdf0e10cSrcweir 
690*cdf0e10cSrcweir 	return nRetval;
691*cdf0e10cSrcweir }
692*cdf0e10cSrcweir 
693*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
694*cdf0e10cSrcweir 
695*cdf0e10cSrcweir __EXPORT SdXMLExport::~SdXMLExport()
696*cdf0e10cSrcweir {
697*cdf0e10cSrcweir 	// cleanup factory, decrease refcount. Should lead to destruction.
698*cdf0e10cSrcweir 	if(mpSdPropHdlFactory)
699*cdf0e10cSrcweir 	{
700*cdf0e10cSrcweir 		mpSdPropHdlFactory->release();
701*cdf0e10cSrcweir 		mpSdPropHdlFactory = 0L;
702*cdf0e10cSrcweir 	}
703*cdf0e10cSrcweir 
704*cdf0e10cSrcweir 	// cleanup mapper, decrease refcount. Should lead to destruction.
705*cdf0e10cSrcweir 	if(mpPropertySetMapper)
706*cdf0e10cSrcweir 	{
707*cdf0e10cSrcweir 		mpPropertySetMapper->release();
708*cdf0e10cSrcweir 		mpPropertySetMapper = 0L;
709*cdf0e10cSrcweir 	}
710*cdf0e10cSrcweir 
711*cdf0e10cSrcweir 	// cleanup presPage mapper, decrease refcount. Should lead to destruction.
712*cdf0e10cSrcweir 	if(mpPresPagePropsMapper)
713*cdf0e10cSrcweir 	{
714*cdf0e10cSrcweir 		mpPresPagePropsMapper->release();
715*cdf0e10cSrcweir 		mpPresPagePropsMapper = 0L;
716*cdf0e10cSrcweir 	}
717*cdf0e10cSrcweir 
718*cdf0e10cSrcweir 	// clear evtl. temporary page master infos
719*cdf0e10cSrcweir 	if(mpPageMasterInfoList)
720*cdf0e10cSrcweir 	{
721*cdf0e10cSrcweir 		while(mpPageMasterInfoList->Count())
722*cdf0e10cSrcweir 			delete mpPageMasterInfoList->Remove(mpPageMasterInfoList->Count() - 1L);
723*cdf0e10cSrcweir 		delete mpPageMasterInfoList;
724*cdf0e10cSrcweir 		mpPageMasterInfoList = 0L;
725*cdf0e10cSrcweir 	}
726*cdf0e10cSrcweir 	if(mpPageMasterUsageList)
727*cdf0e10cSrcweir 	{
728*cdf0e10cSrcweir 		delete mpPageMasterUsageList;
729*cdf0e10cSrcweir 		mpPageMasterUsageList = 0L;
730*cdf0e10cSrcweir 	}
731*cdf0e10cSrcweir 	if(mpNotesPageMasterUsageList)
732*cdf0e10cSrcweir 	{
733*cdf0e10cSrcweir 		delete mpNotesPageMasterUsageList;
734*cdf0e10cSrcweir 		mpNotesPageMasterUsageList = 0L;
735*cdf0e10cSrcweir 	}
736*cdf0e10cSrcweir 
737*cdf0e10cSrcweir 	// clear auto-layout infos
738*cdf0e10cSrcweir 	if(mpAutoLayoutInfoList)
739*cdf0e10cSrcweir 	{
740*cdf0e10cSrcweir 		while(mpAutoLayoutInfoList->Count())
741*cdf0e10cSrcweir 			delete mpAutoLayoutInfoList->Remove(mpAutoLayoutInfoList->Count() - 1L);
742*cdf0e10cSrcweir 		delete mpAutoLayoutInfoList;
743*cdf0e10cSrcweir 		mpAutoLayoutInfoList = 0L;
744*cdf0e10cSrcweir 	}
745*cdf0e10cSrcweir 
746*cdf0e10cSrcweir // #82003# status indicator stop is called exclusively
747*cdf0e10cSrcweir // from SdXMLFilter::Export() now.
748*cdf0e10cSrcweir //
749*cdf0e10cSrcweir // stop progress view
750*cdf0e10cSrcweir //	if(GetStatusIndicator().is())
751*cdf0e10cSrcweir //	{
752*cdf0e10cSrcweir //		GetStatusIndicator()->end();
753*cdf0e10cSrcweir //		GetStatusIndicator()->reset();
754*cdf0e10cSrcweir //	}
755*cdf0e10cSrcweir }
756*cdf0e10cSrcweir 
757*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
758*cdf0e10cSrcweir // to get default values in XPropertySet use this wrapper class
759*cdf0e10cSrcweir 
760*cdf0e10cSrcweir class ImpDefaultMapper : public ::cppu::WeakAggImplHelper1< beans::XPropertySet >
761*cdf0e10cSrcweir {
762*cdf0e10cSrcweir 	Reference< beans::XPropertyState >		mxState;
763*cdf0e10cSrcweir 	Reference< beans::XPropertySet >		mxSet;
764*cdf0e10cSrcweir 
765*cdf0e10cSrcweir public:
766*cdf0e10cSrcweir 	ImpDefaultMapper( Reference< beans::XPropertyState >& rxState );
767*cdf0e10cSrcweir 
768*cdf0e10cSrcweir 	// Methods
769*cdf0e10cSrcweir 	virtual Reference< beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(uno::RuntimeException);
770*cdf0e10cSrcweir 	virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const Any& aValue ) throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException);
771*cdf0e10cSrcweir 	virtual Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
772*cdf0e10cSrcweir 
773*cdf0e10cSrcweir 	// empty implementations
774*cdf0e10cSrcweir 	virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const Reference< beans::XPropertyChangeListener >& xListener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
775*cdf0e10cSrcweir 	virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const Reference< beans::XPropertyChangeListener >& aListener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
776*cdf0e10cSrcweir 	virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const Reference< beans::XVetoableChangeListener >& aListener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
777*cdf0e10cSrcweir 	virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const Reference< beans::XVetoableChangeListener >& aListener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
778*cdf0e10cSrcweir };
779*cdf0e10cSrcweir 
780*cdf0e10cSrcweir ImpDefaultMapper::ImpDefaultMapper( Reference< beans::XPropertyState >& rxState )
781*cdf0e10cSrcweir :	mxState( rxState ),
782*cdf0e10cSrcweir 	mxSet( rxState, UNO_QUERY )
783*cdf0e10cSrcweir {
784*cdf0e10cSrcweir }
785*cdf0e10cSrcweir 
786*cdf0e10cSrcweir Reference< beans::XPropertySetInfo > SAL_CALL ImpDefaultMapper::getPropertySetInfo() throw(uno::RuntimeException)
787*cdf0e10cSrcweir {
788*cdf0e10cSrcweir 	return mxSet->getPropertySetInfo();
789*cdf0e10cSrcweir }
790*cdf0e10cSrcweir 
791*cdf0e10cSrcweir void SAL_CALL ImpDefaultMapper::setPropertyValue( const OUString& aPropertyName, const Any& /*aValue*/ ) throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
792*cdf0e10cSrcweir {
793*cdf0e10cSrcweir 	mxState->setPropertyToDefault( aPropertyName /*, aValue */ );
794*cdf0e10cSrcweir }
795*cdf0e10cSrcweir 
796*cdf0e10cSrcweir Any SAL_CALL ImpDefaultMapper::getPropertyValue( const OUString& PropertyName ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
797*cdf0e10cSrcweir {
798*cdf0e10cSrcweir 	return mxState->getPropertyDefault(  PropertyName  );
799*cdf0e10cSrcweir }
800*cdf0e10cSrcweir 
801*cdf0e10cSrcweir // empty implementations
802*cdf0e10cSrcweir void SAL_CALL ImpDefaultMapper::addPropertyChangeListener( const OUString&, const Reference< beans::XPropertyChangeListener >& ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) {}
803*cdf0e10cSrcweir void SAL_CALL ImpDefaultMapper::removePropertyChangeListener( const OUString&, const Reference< beans::XPropertyChangeListener >& ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) {}
804*cdf0e10cSrcweir void SAL_CALL ImpDefaultMapper::addVetoableChangeListener( const OUString&, const Reference< beans::XVetoableChangeListener >& ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) {}
805*cdf0e10cSrcweir void SAL_CALL ImpDefaultMapper::removeVetoableChangeListener( const OUString&, const Reference< beans::XVetoableChangeListener >& ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) {}
806*cdf0e10cSrcweir 
807*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
808*cdf0e10cSrcweir 
809*cdf0e10cSrcweir /* moved to shapeexport.cxx
810*cdf0e10cSrcweir void SdXMLExport::ImpWriteObjGraphicStyleInfos()
811*cdf0e10cSrcweir {
812*cdf0e10cSrcweir 	XMLStyleExport aStEx(*this, OUString(), GetAutoStylePool().get());
813*cdf0e10cSrcweir 	const UniReference< SvXMLExportPropertyMapper > aMapperRef( GetPropertySetMapper() );
814*cdf0e10cSrcweir 
815*cdf0e10cSrcweir 	// write graphic family default style
816*cdf0e10cSrcweir 	Reference< lang::XMultiServiceFactory > xFact( GetModel(), UNO_QUERY );
817*cdf0e10cSrcweir 	if( xFact.is() )
818*cdf0e10cSrcweir 	{
819*cdf0e10cSrcweir 		try
820*cdf0e10cSrcweir 		{
821*cdf0e10cSrcweir 			Reference< beans::XPropertySet > xDefaults( xFact->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Defaults") ) ), UNO_QUERY );
822*cdf0e10cSrcweir 			if( xDefaults.is() )
823*cdf0e10cSrcweir 			{
824*cdf0e10cSrcweir 				aStEx.exportDefaultStyle( xDefaults, OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)), aMapperRef );
825*cdf0e10cSrcweir 
826*cdf0e10cSrcweir 				// write graphic family styles
827*cdf0e10cSrcweir 				aStEx.exportStyleFamily(XML_STYLE_FAMILY_SD_GRAPHICS_NAME, OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)), aMapperRef, sal_False, XML_STYLE_FAMILY_SD_GRAPHICS_ID);
828*cdf0e10cSrcweir 			}
829*cdf0e10cSrcweir 		}
830*cdf0e10cSrcweir 		catch( lang::ServiceNotRegisteredException& )
831*cdf0e10cSrcweir 		{
832*cdf0e10cSrcweir 		}
833*cdf0e10cSrcweir 	}
834*cdf0e10cSrcweir }
835*cdf0e10cSrcweir */
836*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
837*cdf0e10cSrcweir 
838*cdf0e10cSrcweir void SdXMLExport::ImpPrepAutoLayoutInfos()
839*cdf0e10cSrcweir {
840*cdf0e10cSrcweir 	if(IsImpress())
841*cdf0e10cSrcweir 	{
842*cdf0e10cSrcweir 		OUString aStr;
843*cdf0e10cSrcweir 
844*cdf0e10cSrcweir 		Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetModel(), UNO_QUERY );
845*cdf0e10cSrcweir 		if( xHandoutSupp.is() )
846*cdf0e10cSrcweir 		{
847*cdf0e10cSrcweir 			Reference< XDrawPage > xHandoutPage( xHandoutSupp->getHandoutMasterPage() );
848*cdf0e10cSrcweir 			if( xHandoutPage.is() )
849*cdf0e10cSrcweir 			{
850*cdf0e10cSrcweir 				if(ImpPrepAutoLayoutInfo(xHandoutPage, aStr))
851*cdf0e10cSrcweir 					maDrawPagesAutoLayoutNames[0] = aStr;
852*cdf0e10cSrcweir 			}
853*cdf0e10cSrcweir 		}
854*cdf0e10cSrcweir 
855*cdf0e10cSrcweir 		// prepare name creation
856*cdf0e10cSrcweir         for (sal_Int32 nCnt = 0; nCnt < mnDocDrawPageCount; nCnt++)
857*cdf0e10cSrcweir 		{
858*cdf0e10cSrcweir 			Any aAny(mxDocDrawPages->getByIndex(nCnt));
859*cdf0e10cSrcweir 			Reference<XDrawPage> xDrawPage;
860*cdf0e10cSrcweir 
861*cdf0e10cSrcweir 			if((aAny >>= xDrawPage) && xDrawPage.is())
862*cdf0e10cSrcweir 			{
863*cdf0e10cSrcweir 				if(ImpPrepAutoLayoutInfo(xDrawPage, aStr))
864*cdf0e10cSrcweir 					maDrawPagesAutoLayoutNames[nCnt+1] = aStr;
865*cdf0e10cSrcweir 			}
866*cdf0e10cSrcweir 		}
867*cdf0e10cSrcweir 	}
868*cdf0e10cSrcweir }
869*cdf0e10cSrcweir 
870*cdf0e10cSrcweir sal_Bool SdXMLExport::ImpPrepAutoLayoutInfo(const Reference<XDrawPage>& xPage, OUString& rName)
871*cdf0e10cSrcweir {
872*cdf0e10cSrcweir 	rName = OUString();
873*cdf0e10cSrcweir 	sal_Bool bRetval(sal_False);
874*cdf0e10cSrcweir 
875*cdf0e10cSrcweir 	Reference <beans::XPropertySet> xPropSet(xPage, UNO_QUERY);
876*cdf0e10cSrcweir 	if(xPropSet.is())
877*cdf0e10cSrcweir 	{
878*cdf0e10cSrcweir 		sal_uInt16 nType = sal_uInt16();
879*cdf0e10cSrcweir 		Any aAny;
880*cdf0e10cSrcweir 
881*cdf0e10cSrcweir 		aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Layout")));
882*cdf0e10cSrcweir 		if(aAny >>= nType)
883*cdf0e10cSrcweir 		{
884*cdf0e10cSrcweir 			if(ImpXMLAutoLayoutInfo::IsCreateNecessary(nType))
885*cdf0e10cSrcweir 			{
886*cdf0e10cSrcweir 				ImpXMLEXPPageMasterInfo* pInfo = 0L;
887*cdf0e10cSrcweir 
888*cdf0e10cSrcweir 				// get master-page info
889*cdf0e10cSrcweir 				Reference < drawing::XMasterPageTarget > xMasterPageInt(xPage, UNO_QUERY);
890*cdf0e10cSrcweir 				if(xMasterPageInt.is())
891*cdf0e10cSrcweir 				{
892*cdf0e10cSrcweir 					Reference<XDrawPage> xUsedMasterPage(xMasterPageInt->getMasterPage());
893*cdf0e10cSrcweir 					if(xUsedMasterPage.is())
894*cdf0e10cSrcweir 					{
895*cdf0e10cSrcweir 						Reference < container::XNamed > xMasterNamed(xUsedMasterPage, UNO_QUERY);
896*cdf0e10cSrcweir 						if(xMasterNamed.is())
897*cdf0e10cSrcweir 						{
898*cdf0e10cSrcweir 							OUString sMasterPageName = xMasterNamed->getName();
899*cdf0e10cSrcweir 							pInfo = ImpGetPageMasterInfoByName(sMasterPageName);
900*cdf0e10cSrcweir 						}
901*cdf0e10cSrcweir 					}
902*cdf0e10cSrcweir 				}
903*cdf0e10cSrcweir 
904*cdf0e10cSrcweir 				// create entry and look for existance
905*cdf0e10cSrcweir 				ImpXMLAutoLayoutInfo* pNew = new ImpXMLAutoLayoutInfo(nType, pInfo);
906*cdf0e10cSrcweir 				sal_Bool bDidExist(sal_False);
907*cdf0e10cSrcweir 
908*cdf0e10cSrcweir 				for(sal_uInt32 nCnt = 0L; !bDidExist && nCnt < mpAutoLayoutInfoList->Count(); nCnt++)
909*cdf0e10cSrcweir 				{
910*cdf0e10cSrcweir 					if(*mpAutoLayoutInfoList->GetObject(nCnt) == *pNew)
911*cdf0e10cSrcweir 					{
912*cdf0e10cSrcweir 						delete pNew;
913*cdf0e10cSrcweir 						pNew = mpAutoLayoutInfoList->GetObject(nCnt);
914*cdf0e10cSrcweir 						bDidExist = sal_True;
915*cdf0e10cSrcweir 					}
916*cdf0e10cSrcweir 				}
917*cdf0e10cSrcweir 
918*cdf0e10cSrcweir 				if(!bDidExist)
919*cdf0e10cSrcweir 				{
920*cdf0e10cSrcweir 					mpAutoLayoutInfoList->Insert(pNew, LIST_APPEND);
921*cdf0e10cSrcweir 					OUString sNewName = OUString(RTL_CONSTASCII_USTRINGPARAM("AL"));
922*cdf0e10cSrcweir 					sNewName += OUString::valueOf(sal_Int32(mpAutoLayoutInfoList->Count() - 1));
923*cdf0e10cSrcweir 					sNewName += OUString(RTL_CONSTASCII_USTRINGPARAM("T"));
924*cdf0e10cSrcweir 					sNewName += OUString::valueOf(sal_Int32(nType));
925*cdf0e10cSrcweir 					pNew->SetLayoutName(sNewName);
926*cdf0e10cSrcweir 				}
927*cdf0e10cSrcweir 
928*cdf0e10cSrcweir 				rName = pNew->GetLayoutName();
929*cdf0e10cSrcweir 				bRetval = sal_True;
930*cdf0e10cSrcweir 			}
931*cdf0e10cSrcweir 		}
932*cdf0e10cSrcweir 	}
933*cdf0e10cSrcweir 
934*cdf0e10cSrcweir 	return bRetval;
935*cdf0e10cSrcweir }
936*cdf0e10cSrcweir 
937*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
938*cdf0e10cSrcweir 
939*cdf0e10cSrcweir void SdXMLExport::ImpWriteAutoLayoutInfos()
940*cdf0e10cSrcweir {
941*cdf0e10cSrcweir 	if(mpAutoLayoutInfoList->Count())
942*cdf0e10cSrcweir 	{
943*cdf0e10cSrcweir 		for(sal_uInt32 nCnt = 0L; nCnt < mpAutoLayoutInfoList->Count(); nCnt++)
944*cdf0e10cSrcweir 		{
945*cdf0e10cSrcweir 			ImpXMLAutoLayoutInfo* pInfo = mpAutoLayoutInfoList->GetObject(nCnt);
946*cdf0e10cSrcweir 			if(pInfo)
947*cdf0e10cSrcweir 			{
948*cdf0e10cSrcweir 				// prepare presentation-page layout attributes, style-name
949*cdf0e10cSrcweir 				AddAttribute(XML_NAMESPACE_STYLE, XML_NAME, pInfo->GetLayoutName());
950*cdf0e10cSrcweir 
951*cdf0e10cSrcweir 				// write draw-style attributes
952*cdf0e10cSrcweir 				SvXMLElementExport aDSE(*this, XML_NAMESPACE_STYLE, XML_PRESENTATION_PAGE_LAYOUT, sal_True, sal_True);
953*cdf0e10cSrcweir 
954*cdf0e10cSrcweir 				// write presentation placeholders
955*cdf0e10cSrcweir 				switch(pInfo->GetLayoutType())
956*cdf0e10cSrcweir 				{
957*cdf0e10cSrcweir 					case 0 : // AUTOLAYOUT_TITLE
958*cdf0e10cSrcweir 					{
959*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
960*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderSubtitle, pInfo->GetPresRectangle());
961*cdf0e10cSrcweir 						break;
962*cdf0e10cSrcweir 					}
963*cdf0e10cSrcweir 					case 1 : // AUTOLAYOUT_ENUM
964*cdf0e10cSrcweir 					{
965*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
966*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, pInfo->GetPresRectangle());
967*cdf0e10cSrcweir 						break;
968*cdf0e10cSrcweir 					}
969*cdf0e10cSrcweir 					case 2 : // AUTOLAYOUT_CHART
970*cdf0e10cSrcweir 					{
971*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
972*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart, pInfo->GetPresRectangle());
973*cdf0e10cSrcweir 						break;
974*cdf0e10cSrcweir 					}
975*cdf0e10cSrcweir 					case 3 : // AUTOLAYOUT_2TEXT
976*cdf0e10cSrcweir 					{
977*cdf0e10cSrcweir 						Rectangle aLeft(pInfo->GetPresRectangle());
978*cdf0e10cSrcweir 						aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
979*cdf0e10cSrcweir 						Rectangle aRight(aLeft);
980*cdf0e10cSrcweir 						aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
981*cdf0e10cSrcweir 
982*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
983*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft);
984*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight);
985*cdf0e10cSrcweir 						break;
986*cdf0e10cSrcweir 					}
987*cdf0e10cSrcweir 					case 4 : // AUTOLAYOUT_TEXTCHART
988*cdf0e10cSrcweir 					{
989*cdf0e10cSrcweir 						Rectangle aLeft(pInfo->GetPresRectangle());
990*cdf0e10cSrcweir 						aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
991*cdf0e10cSrcweir 						Rectangle aRight(aLeft);
992*cdf0e10cSrcweir 						aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
993*cdf0e10cSrcweir 
994*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
995*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft);
996*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart, aRight);
997*cdf0e10cSrcweir 						break;
998*cdf0e10cSrcweir 					}
999*cdf0e10cSrcweir 					case 6 : // AUTOLAYOUT_TEXTCLIP
1000*cdf0e10cSrcweir 					{
1001*cdf0e10cSrcweir 						Rectangle aLeft(pInfo->GetPresRectangle());
1002*cdf0e10cSrcweir 						aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
1003*cdf0e10cSrcweir 						Rectangle aRight(aLeft);
1004*cdf0e10cSrcweir 						aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
1005*cdf0e10cSrcweir 
1006*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1007*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft);
1008*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aRight);
1009*cdf0e10cSrcweir 						break;
1010*cdf0e10cSrcweir 					}
1011*cdf0e10cSrcweir 					case 7 : // AUTOLAYOUT_CHARTTEXT
1012*cdf0e10cSrcweir 					{
1013*cdf0e10cSrcweir 						Rectangle aLeft(pInfo->GetPresRectangle());
1014*cdf0e10cSrcweir 						aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
1015*cdf0e10cSrcweir 						Rectangle aRight(aLeft);
1016*cdf0e10cSrcweir 						aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
1017*cdf0e10cSrcweir 
1018*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1019*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart, aLeft);
1020*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight);
1021*cdf0e10cSrcweir 						break;
1022*cdf0e10cSrcweir 					}
1023*cdf0e10cSrcweir 					case 8 : // AUTOLAYOUT_TAB
1024*cdf0e10cSrcweir 					{
1025*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1026*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTable, pInfo->GetPresRectangle());
1027*cdf0e10cSrcweir 						break;
1028*cdf0e10cSrcweir 					}
1029*cdf0e10cSrcweir 					case 9 : // AUTOLAYOUT_CLIPTEXT
1030*cdf0e10cSrcweir 					{
1031*cdf0e10cSrcweir 						Rectangle aLeft(pInfo->GetPresRectangle());
1032*cdf0e10cSrcweir 						aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
1033*cdf0e10cSrcweir 						Rectangle aRight(aLeft);
1034*cdf0e10cSrcweir 						aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
1035*cdf0e10cSrcweir 
1036*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1037*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aLeft);
1038*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight);
1039*cdf0e10cSrcweir 						break;
1040*cdf0e10cSrcweir 					}
1041*cdf0e10cSrcweir 					case 10 : // AUTOLAYOUT_TEXTOBJ
1042*cdf0e10cSrcweir 					{
1043*cdf0e10cSrcweir 						Rectangle aLeft(pInfo->GetPresRectangle());
1044*cdf0e10cSrcweir 						aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
1045*cdf0e10cSrcweir 						Rectangle aRight(aLeft);
1046*cdf0e10cSrcweir 						aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
1047*cdf0e10cSrcweir 
1048*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1049*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft);
1050*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aRight);
1051*cdf0e10cSrcweir 						break;
1052*cdf0e10cSrcweir 					}
1053*cdf0e10cSrcweir 					case 11 : // AUTOLAYOUT_OBJ
1054*cdf0e10cSrcweir 					{
1055*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1056*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, pInfo->GetPresRectangle());
1057*cdf0e10cSrcweir 						break;
1058*cdf0e10cSrcweir 					}
1059*cdf0e10cSrcweir 					case 12 : // AUTOLAYOUT_TEXT2OBJ
1060*cdf0e10cSrcweir 					{
1061*cdf0e10cSrcweir 						Rectangle aLeft(pInfo->GetPresRectangle());
1062*cdf0e10cSrcweir 						aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
1063*cdf0e10cSrcweir 						Rectangle aRightTop(aLeft);
1064*cdf0e10cSrcweir 						aRightTop.Left() = long(aRightTop.Left() + aRightTop.GetWidth() * 1.05);
1065*cdf0e10cSrcweir 						aRightTop.setHeight(long(aRightTop.GetHeight() * 0.477));
1066*cdf0e10cSrcweir 						Rectangle aRightBottom(aRightTop);
1067*cdf0e10cSrcweir 						aRightBottom.Top() = long(aRightBottom.Top() + aRightBottom.GetHeight() * 1.095);
1068*cdf0e10cSrcweir 
1069*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1070*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft);
1071*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aRightTop);
1072*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aRightBottom);
1073*cdf0e10cSrcweir 						break;
1074*cdf0e10cSrcweir 					}
1075*cdf0e10cSrcweir 					case 13 : // AUTOLAYOUT_OBJTEXT
1076*cdf0e10cSrcweir 					{
1077*cdf0e10cSrcweir 						Rectangle aLeft(pInfo->GetPresRectangle());
1078*cdf0e10cSrcweir 						aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
1079*cdf0e10cSrcweir 						Rectangle aRight(aLeft);
1080*cdf0e10cSrcweir 						aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
1081*cdf0e10cSrcweir 
1082*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1083*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aLeft);
1084*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight);
1085*cdf0e10cSrcweir 						break;
1086*cdf0e10cSrcweir 					}
1087*cdf0e10cSrcweir 					case 14 : // AUTOLAYOUT_OBJOVERTEXT
1088*cdf0e10cSrcweir 					{
1089*cdf0e10cSrcweir 						Rectangle aTop(pInfo->GetPresRectangle());
1090*cdf0e10cSrcweir 						aTop.setHeight(long(aTop.GetHeight() * 0.477));
1091*cdf0e10cSrcweir 						Rectangle aBottom(aTop);
1092*cdf0e10cSrcweir 						aBottom.Top() = long(aBottom.Top() + aBottom.GetHeight() * 1.095);
1093*cdf0e10cSrcweir 
1094*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1095*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTop);
1096*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aBottom);
1097*cdf0e10cSrcweir 						break;
1098*cdf0e10cSrcweir 					}
1099*cdf0e10cSrcweir 					case 15 : // AUTOLAYOUT_2OBJTEXT
1100*cdf0e10cSrcweir 					{
1101*cdf0e10cSrcweir 						Rectangle aLeftTop(pInfo->GetPresRectangle());
1102*cdf0e10cSrcweir 						aLeftTop.setWidth(long(aLeftTop.GetWidth() * 0.488));
1103*cdf0e10cSrcweir 						Rectangle aRight(aLeftTop);
1104*cdf0e10cSrcweir 						aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
1105*cdf0e10cSrcweir 						aLeftTop.setHeight(long(aLeftTop.GetHeight() * 0.477));
1106*cdf0e10cSrcweir 						Rectangle aLeftBottom(aLeftTop);
1107*cdf0e10cSrcweir 						aLeftBottom.Top() = long(aLeftBottom.Top() + aLeftBottom.GetHeight() * 1.095);
1108*cdf0e10cSrcweir 
1109*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1110*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aLeftTop);
1111*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aLeftBottom);
1112*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight);
1113*cdf0e10cSrcweir 						break;
1114*cdf0e10cSrcweir 					}
1115*cdf0e10cSrcweir 					case 16 : // AUTOLAYOUT_2OBJOVERTEXT
1116*cdf0e10cSrcweir 					{
1117*cdf0e10cSrcweir 						Rectangle aTopLeft(pInfo->GetPresRectangle());
1118*cdf0e10cSrcweir 						aTopLeft.setHeight(long(aTopLeft.GetHeight() * 0.477));
1119*cdf0e10cSrcweir 						Rectangle aBottom(aTopLeft);
1120*cdf0e10cSrcweir 						aBottom.Top() = long(aBottom.Top() + aBottom.GetHeight() * 1.095);
1121*cdf0e10cSrcweir 						aTopLeft.setWidth(long(aTopLeft.GetWidth() * 0.488));
1122*cdf0e10cSrcweir 						Rectangle aTopRight(aTopLeft);
1123*cdf0e10cSrcweir 						aTopRight.Left() = long(aTopRight.Left() + aTopRight.GetWidth() * 1.05);
1124*cdf0e10cSrcweir 
1125*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1126*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTopLeft);
1127*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTopRight);
1128*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aBottom);
1129*cdf0e10cSrcweir 						break;
1130*cdf0e10cSrcweir 					}
1131*cdf0e10cSrcweir 					case 17 : // AUTOLAYOUT_TEXTOVEROBJ
1132*cdf0e10cSrcweir 					{
1133*cdf0e10cSrcweir 						Rectangle aTop(pInfo->GetPresRectangle());
1134*cdf0e10cSrcweir 						aTop.setHeight(long(aTop.GetHeight() * 0.477));
1135*cdf0e10cSrcweir 						Rectangle aBottom(aTop);
1136*cdf0e10cSrcweir 						aBottom.Top() = long(aBottom.Top() + aBottom.GetHeight() * 1.095);
1137*cdf0e10cSrcweir 
1138*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1139*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aTop);
1140*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aBottom);
1141*cdf0e10cSrcweir 						break;
1142*cdf0e10cSrcweir 					}
1143*cdf0e10cSrcweir 					case 18 : // AUTOLAYOUT_4OBJ
1144*cdf0e10cSrcweir 					{
1145*cdf0e10cSrcweir 						Rectangle aTopLeft(pInfo->GetPresRectangle());
1146*cdf0e10cSrcweir 						aTopLeft.setHeight(long(aTopLeft.GetHeight() * 0.477));
1147*cdf0e10cSrcweir 						aTopLeft.setWidth(long(aTopLeft.GetWidth() * 0.488));
1148*cdf0e10cSrcweir 						Rectangle aBottomLeft(aTopLeft);
1149*cdf0e10cSrcweir 						aBottomLeft.Top() = long(aBottomLeft.Top() + aBottomLeft.GetHeight() * 1.095);
1150*cdf0e10cSrcweir 						Rectangle aTopRight(aTopLeft);
1151*cdf0e10cSrcweir 						aTopRight.Left() = long(aTopRight.Left() + aTopRight.GetWidth() * 1.05);
1152*cdf0e10cSrcweir 						Rectangle aBottomRight(aTopRight);
1153*cdf0e10cSrcweir 						aBottomRight.Top() = long(aBottomRight.Top() + aBottomRight.GetHeight() * 1.095);
1154*cdf0e10cSrcweir 
1155*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1156*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTopLeft);
1157*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTopRight);
1158*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aBottomLeft);
1159*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aBottomRight);
1160*cdf0e10cSrcweir 						break;
1161*cdf0e10cSrcweir 					}
1162*cdf0e10cSrcweir 					case 19 : // AUTOLAYOUT_ONLY_TITLE
1163*cdf0e10cSrcweir 					{
1164*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1165*cdf0e10cSrcweir 						break;
1166*cdf0e10cSrcweir 					}
1167*cdf0e10cSrcweir 					case 21 : // AUTOLAYOUT_NOTES
1168*cdf0e10cSrcweir 					{
1169*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderPage, pInfo->GetTitleRectangle());
1170*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderNotes, pInfo->GetPresRectangle());
1171*cdf0e10cSrcweir 						break;
1172*cdf0e10cSrcweir 					}
1173*cdf0e10cSrcweir 					case 22 : // AUTOLAYOUT_HANDOUT1
1174*cdf0e10cSrcweir 					case 23 : // AUTOLAYOUT_HANDOUT2
1175*cdf0e10cSrcweir 					case 24 : // AUTOLAYOUT_HANDOUT3
1176*cdf0e10cSrcweir 					case 25 : // AUTOLAYOUT_HANDOUT4
1177*cdf0e10cSrcweir 					case 26 : // AUTOLAYOUT_HANDOUT6
1178*cdf0e10cSrcweir 					case 31 : // AUTOLAYOUT_HANDOUT9
1179*cdf0e10cSrcweir 					{
1180*cdf0e10cSrcweir 						sal_Int32 nColCnt, nRowCnt;
1181*cdf0e10cSrcweir 						sal_Int32 nGapX = pInfo->GetGapX();
1182*cdf0e10cSrcweir 						sal_Int32 nGapY = pInfo->GetGapY();
1183*cdf0e10cSrcweir 
1184*cdf0e10cSrcweir 						switch(pInfo->GetLayoutType())
1185*cdf0e10cSrcweir 						{
1186*cdf0e10cSrcweir 							case 22 : nColCnt = 1; nRowCnt = 1; break;
1187*cdf0e10cSrcweir 							case 23 : nColCnt = 1; nRowCnt = 2; break;
1188*cdf0e10cSrcweir 							case 24 : nColCnt = 1; nRowCnt = 3; break;
1189*cdf0e10cSrcweir 							case 25 : nColCnt = 2; nRowCnt = 2; break;
1190*cdf0e10cSrcweir 							case 26 : nColCnt = 3; nRowCnt = 2; break;
1191*cdf0e10cSrcweir 							case 31 : nColCnt = 3; nRowCnt = 3; break;
1192*cdf0e10cSrcweir 							default:  nColCnt = 0; nRowCnt = 0; break;  // FIXME - What is correct values?
1193*cdf0e10cSrcweir 						}
1194*cdf0e10cSrcweir 
1195*cdf0e10cSrcweir 						Size aPartSize(pInfo->GetTitleRectangle().GetSize());
1196*cdf0e10cSrcweir 						Point aPartPos(pInfo->GetTitleRectangle().TopLeft());
1197*cdf0e10cSrcweir 
1198*cdf0e10cSrcweir 						if(aPartSize.Width() > aPartSize.Height())
1199*cdf0e10cSrcweir 						{
1200*cdf0e10cSrcweir 							sal_Int32 nZwi(nColCnt);
1201*cdf0e10cSrcweir 							nColCnt = nRowCnt;
1202*cdf0e10cSrcweir 							nRowCnt = nZwi;
1203*cdf0e10cSrcweir 						}
1204*cdf0e10cSrcweir 
1205*cdf0e10cSrcweir 						aPartSize.Width() = (aPartSize.Width() - ((nColCnt - 1) * nGapX)) / nColCnt;
1206*cdf0e10cSrcweir 						aPartSize.Height() = (aPartSize.Height() - ((nRowCnt - 1) * nGapY)) / nRowCnt;
1207*cdf0e10cSrcweir 
1208*cdf0e10cSrcweir 						Point aTmpPos(aPartPos);
1209*cdf0e10cSrcweir 
1210*cdf0e10cSrcweir                         for (sal_Int32 a = 0; a < nRowCnt; a++)
1211*cdf0e10cSrcweir 						{
1212*cdf0e10cSrcweir 							aTmpPos.X() = aPartPos.X();
1213*cdf0e10cSrcweir 
1214*cdf0e10cSrcweir                             for (sal_Int32 b = 0; b < nColCnt; b++)
1215*cdf0e10cSrcweir 							{
1216*cdf0e10cSrcweir 								Rectangle aTmpRect(aTmpPos, aPartSize);
1217*cdf0e10cSrcweir 
1218*cdf0e10cSrcweir 								ImpWriteAutoLayoutPlaceholder(XmlPlaceholderHandout, aTmpRect);
1219*cdf0e10cSrcweir 								aTmpPos.X() += aPartSize.Width() + nGapX;
1220*cdf0e10cSrcweir 							}
1221*cdf0e10cSrcweir 
1222*cdf0e10cSrcweir 							aTmpPos.Y() += aPartSize.Height() + nGapY;
1223*cdf0e10cSrcweir 						}
1224*cdf0e10cSrcweir 						break;
1225*cdf0e10cSrcweir 					}
1226*cdf0e10cSrcweir 					case 27 : // AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART
1227*cdf0e10cSrcweir 					{
1228*cdf0e10cSrcweir 						Rectangle aTop(pInfo->GetPresRectangle());
1229*cdf0e10cSrcweir 						aTop.setHeight(long(aTop.GetHeight() * 0.488));
1230*cdf0e10cSrcweir 						Rectangle aBottom(aTop);
1231*cdf0e10cSrcweir 						aBottom.Top() = long(aBottom.Top() + aBottom.GetHeight() * 1.05);
1232*cdf0e10cSrcweir 
1233*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalTitle, pInfo->GetTitleRectangle());
1234*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline, aTop);
1235*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart, aBottom);
1236*cdf0e10cSrcweir 						break;
1237*cdf0e10cSrcweir 					}
1238*cdf0e10cSrcweir 					case 28 : // AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE
1239*cdf0e10cSrcweir 					{
1240*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalTitle, pInfo->GetTitleRectangle());
1241*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline, pInfo->GetPresRectangle());
1242*cdf0e10cSrcweir 						break;
1243*cdf0e10cSrcweir 					}
1244*cdf0e10cSrcweir 					case 29 : // AUTOLAYOUT_TITLE_VERTICAL_OUTLINE
1245*cdf0e10cSrcweir 					{
1246*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1247*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline, pInfo->GetPresRectangle());
1248*cdf0e10cSrcweir 						break;
1249*cdf0e10cSrcweir 					}
1250*cdf0e10cSrcweir 					case 30 : // AUTOLAYOUT_TITLE_VERTICAL_OUTLINE_CLIPART
1251*cdf0e10cSrcweir 					{
1252*cdf0e10cSrcweir 						Rectangle aLeft(pInfo->GetPresRectangle());
1253*cdf0e10cSrcweir 						aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
1254*cdf0e10cSrcweir 						Rectangle aRight(aLeft);
1255*cdf0e10cSrcweir 						aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
1256*cdf0e10cSrcweir 
1257*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1258*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aLeft);
1259*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline, aRight);
1260*cdf0e10cSrcweir 						break;
1261*cdf0e10cSrcweir 					}
1262*cdf0e10cSrcweir 					case 32 : // AUTOLAYOUT_TITLE
1263*cdf0e10cSrcweir 					{
1264*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderSubtitle, pInfo->GetPresRectangle());
1265*cdf0e10cSrcweir 						break;
1266*cdf0e10cSrcweir 					}
1267*cdf0e10cSrcweir 
1268*cdf0e10cSrcweir                     case 33 : // AUTOLAYOUT_4CLIPART
1269*cdf0e10cSrcweir 					{
1270*cdf0e10cSrcweir 						Rectangle aTopLeft(pInfo->GetPresRectangle());
1271*cdf0e10cSrcweir 						aTopLeft.setHeight(long(aTopLeft.GetHeight() * 0.477));
1272*cdf0e10cSrcweir 						aTopLeft.setWidth(long(aTopLeft.GetWidth() * 0.488));
1273*cdf0e10cSrcweir 						Rectangle aBottomLeft(aTopLeft);
1274*cdf0e10cSrcweir 						aBottomLeft.Top() = long(aBottomLeft.Top() + aBottomLeft.GetHeight() * 1.095);
1275*cdf0e10cSrcweir 						Rectangle aTopRight(aTopLeft);
1276*cdf0e10cSrcweir 						aTopRight.Left() = long(aTopRight.Left() + aTopRight.GetWidth() * 1.05);
1277*cdf0e10cSrcweir 						Rectangle aBottomRight(aTopRight);
1278*cdf0e10cSrcweir 						aBottomRight.Top() = long(aBottomRight.Top() + aBottomRight.GetHeight() * 1.095);
1279*cdf0e10cSrcweir 
1280*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1281*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aTopLeft);
1282*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aTopRight);
1283*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aBottomLeft);
1284*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aBottomRight);
1285*cdf0e10cSrcweir 						break;
1286*cdf0e10cSrcweir 					}
1287*cdf0e10cSrcweir 
1288*cdf0e10cSrcweir                     case 34 : // AUTOLAYOUT_6CLIPART
1289*cdf0e10cSrcweir 					{
1290*cdf0e10cSrcweir 						Rectangle aTopLeft(pInfo->GetPresRectangle());
1291*cdf0e10cSrcweir 						aTopLeft.setHeight(long(aTopLeft.GetHeight() * 0.477));
1292*cdf0e10cSrcweir 						aTopLeft.setWidth(long(aTopLeft.GetWidth() * 0.322));
1293*cdf0e10cSrcweir 						Rectangle aTopCenter(aTopLeft);
1294*cdf0e10cSrcweir 						aTopCenter.Left() = long(aTopCenter.Left() + aTopCenter.GetWidth() * 1.05);
1295*cdf0e10cSrcweir 						Rectangle aTopRight(aTopLeft);
1296*cdf0e10cSrcweir 						aTopRight.Left() = long(aTopRight.Left() + aTopRight.GetWidth() * 2 * 1.05);
1297*cdf0e10cSrcweir 
1298*cdf0e10cSrcweir 						Rectangle aBottomLeft(aTopLeft);
1299*cdf0e10cSrcweir 						aBottomLeft.Top() = long(aBottomLeft.Top() + aBottomLeft.GetHeight() * 1.095);
1300*cdf0e10cSrcweir 						Rectangle aBottomCenter(aTopCenter);
1301*cdf0e10cSrcweir 						aBottomCenter.Top() = long(aBottomCenter.Top() + aBottomCenter.GetHeight() * 1.095);
1302*cdf0e10cSrcweir 						Rectangle aBottomRight(aTopRight);
1303*cdf0e10cSrcweir 						aBottomRight.Top() = long(aBottomRight.Top() + aBottomRight.GetHeight() * 1.095);
1304*cdf0e10cSrcweir 
1305*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1306*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aTopLeft);
1307*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aTopCenter);
1308*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aTopRight);
1309*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aBottomLeft);
1310*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aBottomCenter);
1311*cdf0e10cSrcweir 						ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aBottomRight);
1312*cdf0e10cSrcweir 						break;
1313*cdf0e10cSrcweir 					}
1314*cdf0e10cSrcweir 					default:
1315*cdf0e10cSrcweir 					{
1316*cdf0e10cSrcweir 						DBG_ERROR("XMLEXP: unknown autolayout export");
1317*cdf0e10cSrcweir 						break;
1318*cdf0e10cSrcweir 					}
1319*cdf0e10cSrcweir 				}
1320*cdf0e10cSrcweir 			}
1321*cdf0e10cSrcweir 		}
1322*cdf0e10cSrcweir 	}
1323*cdf0e10cSrcweir }
1324*cdf0e10cSrcweir 
1325*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
1326*cdf0e10cSrcweir 
1327*cdf0e10cSrcweir void SdXMLExport::ImpWriteAutoLayoutPlaceholder(XmlPlaceholder ePl, const Rectangle& rRect)
1328*cdf0e10cSrcweir {
1329*cdf0e10cSrcweir 	OUString aStr;
1330*cdf0e10cSrcweir 	OUStringBuffer sStringBuffer;
1331*cdf0e10cSrcweir 
1332*cdf0e10cSrcweir 	// prepare presentation-placeholder attributes, presentation:object
1333*cdf0e10cSrcweir 	switch(ePl)
1334*cdf0e10cSrcweir 	{
1335*cdf0e10cSrcweir 		case XmlPlaceholderTitle: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("title")); break;
1336*cdf0e10cSrcweir 		case XmlPlaceholderOutline: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("outline")); break;
1337*cdf0e10cSrcweir 		case XmlPlaceholderSubtitle: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("subtitle")); break;
1338*cdf0e10cSrcweir 		case XmlPlaceholderText: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("text")); break;
1339*cdf0e10cSrcweir 		case XmlPlaceholderGraphic: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("graphic")); break;
1340*cdf0e10cSrcweir 		case XmlPlaceholderObject: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("object")); break;
1341*cdf0e10cSrcweir 		case XmlPlaceholderChart: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("chart")); break;
1342*cdf0e10cSrcweir 		case XmlPlaceholderOrgchart: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("orgchart")); break;
1343*cdf0e10cSrcweir 		case XmlPlaceholderTable: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("table")); break;
1344*cdf0e10cSrcweir 		case XmlPlaceholderPage: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("page")); break;
1345*cdf0e10cSrcweir 		case XmlPlaceholderNotes: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("notes")); break;
1346*cdf0e10cSrcweir 		case XmlPlaceholderHandout: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("handout")); break;
1347*cdf0e10cSrcweir 		case XmlPlaceholderVerticalTitle: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("vertical_title")); break;
1348*cdf0e10cSrcweir 		case XmlPlaceholderVerticalOutline: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("vertical_outline")); break;
1349*cdf0e10cSrcweir 	}
1350*cdf0e10cSrcweir 
1351*cdf0e10cSrcweir 	AddAttribute(XML_NAMESPACE_PRESENTATION, XML_OBJECT, aStr);
1352*cdf0e10cSrcweir 
1353*cdf0e10cSrcweir 	// svg:x,y,width,height
1354*cdf0e10cSrcweir 	GetMM100UnitConverter().convertMeasure(sStringBuffer, rRect.Left());
1355*cdf0e10cSrcweir 	aStr = sStringBuffer.makeStringAndClear();
1356*cdf0e10cSrcweir 	AddAttribute(XML_NAMESPACE_SVG, XML_X, aStr);
1357*cdf0e10cSrcweir 
1358*cdf0e10cSrcweir 	GetMM100UnitConverter().convertMeasure(sStringBuffer, rRect.Top());
1359*cdf0e10cSrcweir 	aStr = sStringBuffer.makeStringAndClear();
1360*cdf0e10cSrcweir 	AddAttribute(XML_NAMESPACE_SVG, XML_Y, aStr);
1361*cdf0e10cSrcweir 
1362*cdf0e10cSrcweir 	GetMM100UnitConverter().convertMeasure(sStringBuffer, rRect.GetWidth());
1363*cdf0e10cSrcweir 	aStr = sStringBuffer.makeStringAndClear();
1364*cdf0e10cSrcweir 	AddAttribute(XML_NAMESPACE_SVG, XML_WIDTH, aStr);
1365*cdf0e10cSrcweir 
1366*cdf0e10cSrcweir 	GetMM100UnitConverter().convertMeasure(sStringBuffer, rRect.GetHeight());
1367*cdf0e10cSrcweir 	aStr = sStringBuffer.makeStringAndClear();
1368*cdf0e10cSrcweir 	AddAttribute(XML_NAMESPACE_SVG, XML_HEIGHT, aStr);
1369*cdf0e10cSrcweir 
1370*cdf0e10cSrcweir 	// write presentation-placeholder
1371*cdf0e10cSrcweir 	SvXMLElementExport aPPL(*this, XML_NAMESPACE_PRESENTATION, XML_PLACEHOLDER, sal_True, sal_True);
1372*cdf0e10cSrcweir }
1373*cdf0e10cSrcweir 
1374*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
1375*cdf0e10cSrcweir 
1376*cdf0e10cSrcweir ImpXMLEXPPageMasterInfo* SdXMLExport::ImpGetOrCreatePageMasterInfo( Reference< XDrawPage > xMasterPage )
1377*cdf0e10cSrcweir {
1378*cdf0e10cSrcweir 	bool bDoesExist = false;
1379*cdf0e10cSrcweir 
1380*cdf0e10cSrcweir 	ImpXMLEXPPageMasterInfo* pNewInfo = new ImpXMLEXPPageMasterInfo(*this, xMasterPage);
1381*cdf0e10cSrcweir 
1382*cdf0e10cSrcweir 	// compare with prev page-master infos
1383*cdf0e10cSrcweir 	for(sal_uInt32 a = 0; !bDoesExist && a < mpPageMasterInfoList->Count(); a++)
1384*cdf0e10cSrcweir 	{
1385*cdf0e10cSrcweir 		if(mpPageMasterInfoList->GetObject(a)
1386*cdf0e10cSrcweir 			&& *mpPageMasterInfoList->GetObject(a) == *pNewInfo)
1387*cdf0e10cSrcweir 		{
1388*cdf0e10cSrcweir 			delete pNewInfo;
1389*cdf0e10cSrcweir 			pNewInfo = mpPageMasterInfoList->GetObject(a);
1390*cdf0e10cSrcweir 			bDoesExist = true;
1391*cdf0e10cSrcweir 		}
1392*cdf0e10cSrcweir 	}
1393*cdf0e10cSrcweir 	// add entry when not found same page-master infos
1394*cdf0e10cSrcweir 	if(!bDoesExist)
1395*cdf0e10cSrcweir 		mpPageMasterInfoList->Insert(pNewInfo, LIST_APPEND);
1396*cdf0e10cSrcweir 
1397*cdf0e10cSrcweir 	return pNewInfo;
1398*cdf0e10cSrcweir }
1399*cdf0e10cSrcweir 
1400*cdf0e10cSrcweir void SdXMLExport::ImpPrepPageMasterInfos()
1401*cdf0e10cSrcweir {
1402*cdf0e10cSrcweir 	if( IsImpress() )
1403*cdf0e10cSrcweir 	{
1404*cdf0e10cSrcweir 		// create page master info for handout master page
1405*cdf0e10cSrcweir 
1406*cdf0e10cSrcweir 		Reference< XHandoutMasterSupplier > xHMS( GetModel(), UNO_QUERY );
1407*cdf0e10cSrcweir 		if( xHMS.is() )
1408*cdf0e10cSrcweir 		{
1409*cdf0e10cSrcweir 			Reference< XDrawPage > xMasterPage( xHMS->getHandoutMasterPage() );
1410*cdf0e10cSrcweir 			if( xMasterPage.is() )
1411*cdf0e10cSrcweir 				mpHandoutPageMaster = ImpGetOrCreatePageMasterInfo(xMasterPage);
1412*cdf0e10cSrcweir 		}
1413*cdf0e10cSrcweir 	}
1414*cdf0e10cSrcweir 
1415*cdf0e10cSrcweir 	// create page master infos for master pages
1416*cdf0e10cSrcweir 	if(mnDocMasterPageCount)
1417*cdf0e10cSrcweir 	{
1418*cdf0e10cSrcweir 		// look for needed page-masters, create these
1419*cdf0e10cSrcweir         for (sal_Int32 nMPageId = 0; nMPageId < mnDocMasterPageCount; nMPageId++)
1420*cdf0e10cSrcweir 		{
1421*cdf0e10cSrcweir 			Reference< XDrawPage > xMasterPage( mxDocMasterPages->getByIndex(nMPageId), UNO_QUERY );
1422*cdf0e10cSrcweir 			ImpXMLEXPPageMasterInfo* pNewInfo = 0L;
1423*cdf0e10cSrcweir 
1424*cdf0e10cSrcweir 			if(xMasterPage.is())
1425*cdf0e10cSrcweir 				pNewInfo = ImpGetOrCreatePageMasterInfo(xMasterPage);
1426*cdf0e10cSrcweir 
1427*cdf0e10cSrcweir 			mpPageMasterUsageList->Insert(pNewInfo, LIST_APPEND);
1428*cdf0e10cSrcweir 
1429*cdf0e10cSrcweir 			// look for page master of handout page
1430*cdf0e10cSrcweir 			if(IsImpress())
1431*cdf0e10cSrcweir 			{
1432*cdf0e10cSrcweir 				pNewInfo = NULL;
1433*cdf0e10cSrcweir 				Reference< presentation::XPresentationPage > xPresPage(xMasterPage, UNO_QUERY);
1434*cdf0e10cSrcweir 				if(xPresPage.is())
1435*cdf0e10cSrcweir 				{
1436*cdf0e10cSrcweir 					Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage());
1437*cdf0e10cSrcweir 					if(xNotesPage.is())
1438*cdf0e10cSrcweir 					{
1439*cdf0e10cSrcweir 						pNewInfo = ImpGetOrCreatePageMasterInfo(xNotesPage);
1440*cdf0e10cSrcweir 					}
1441*cdf0e10cSrcweir 				}
1442*cdf0e10cSrcweir 				mpNotesPageMasterUsageList->Insert( pNewInfo, LIST_APPEND );
1443*cdf0e10cSrcweir 			}
1444*cdf0e10cSrcweir 		}
1445*cdf0e10cSrcweir 	}
1446*cdf0e10cSrcweir }
1447*cdf0e10cSrcweir 
1448*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
1449*cdf0e10cSrcweir 
1450*cdf0e10cSrcweir void SdXMLExport::ImpWritePageMasterInfos()
1451*cdf0e10cSrcweir {
1452*cdf0e10cSrcweir 	// write created page-masters, create names for these
1453*cdf0e10cSrcweir 	for(sal_uInt32 nCnt = 0L; nCnt < mpPageMasterInfoList->Count(); nCnt++)
1454*cdf0e10cSrcweir 	{
1455*cdf0e10cSrcweir 		ImpXMLEXPPageMasterInfo* pInfo = mpPageMasterInfoList->GetObject(nCnt);
1456*cdf0e10cSrcweir 		if(pInfo)
1457*cdf0e10cSrcweir 		{
1458*cdf0e10cSrcweir 			// create name
1459*cdf0e10cSrcweir 			OUString sNewName = OUString(RTL_CONSTASCII_USTRINGPARAM("PM"));
1460*cdf0e10cSrcweir 
1461*cdf0e10cSrcweir 			sNewName += OUString::valueOf((sal_Int32)nCnt);
1462*cdf0e10cSrcweir 			pInfo->SetName(sNewName);
1463*cdf0e10cSrcweir 
1464*cdf0e10cSrcweir 			// prepare page-master attributes
1465*cdf0e10cSrcweir 			OUString sString;
1466*cdf0e10cSrcweir 			OUStringBuffer sStringBuffer;
1467*cdf0e10cSrcweir 
1468*cdf0e10cSrcweir 			sString = sNewName;
1469*cdf0e10cSrcweir 			AddAttribute(XML_NAMESPACE_STYLE, XML_NAME, sString);
1470*cdf0e10cSrcweir 
1471*cdf0e10cSrcweir 			// write page-layout
1472*cdf0e10cSrcweir 			SvXMLElementExport aPME(*this, XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT, sal_True, sal_True);
1473*cdf0e10cSrcweir 
1474*cdf0e10cSrcweir 			// prepare style:properties inside page-master
1475*cdf0e10cSrcweir 			GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetBorderTop());
1476*cdf0e10cSrcweir 			sString = sStringBuffer.makeStringAndClear();
1477*cdf0e10cSrcweir 			AddAttribute(XML_NAMESPACE_FO, XML_MARGIN_TOP, sString);
1478*cdf0e10cSrcweir 
1479*cdf0e10cSrcweir 			GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetBorderBottom());
1480*cdf0e10cSrcweir 			sString = sStringBuffer.makeStringAndClear();
1481*cdf0e10cSrcweir 			AddAttribute(XML_NAMESPACE_FO, XML_MARGIN_BOTTOM, sString);
1482*cdf0e10cSrcweir 
1483*cdf0e10cSrcweir 			GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetBorderLeft());
1484*cdf0e10cSrcweir 			sString = sStringBuffer.makeStringAndClear();
1485*cdf0e10cSrcweir 			AddAttribute(XML_NAMESPACE_FO, XML_MARGIN_LEFT, sString);
1486*cdf0e10cSrcweir 
1487*cdf0e10cSrcweir 			GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetBorderRight());
1488*cdf0e10cSrcweir 			sString = sStringBuffer.makeStringAndClear();
1489*cdf0e10cSrcweir 			AddAttribute(XML_NAMESPACE_FO, XML_MARGIN_RIGHT, sString);
1490*cdf0e10cSrcweir 
1491*cdf0e10cSrcweir 			GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetWidth());
1492*cdf0e10cSrcweir 			sString = sStringBuffer.makeStringAndClear();
1493*cdf0e10cSrcweir 			AddAttribute(XML_NAMESPACE_FO, XML_PAGE_WIDTH, sString);
1494*cdf0e10cSrcweir 
1495*cdf0e10cSrcweir 			GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetHeight());
1496*cdf0e10cSrcweir 			sString = sStringBuffer.makeStringAndClear();
1497*cdf0e10cSrcweir 			AddAttribute(XML_NAMESPACE_FO, XML_PAGE_HEIGHT, sString);
1498*cdf0e10cSrcweir 
1499*cdf0e10cSrcweir 			if(pInfo->GetOrientation() == view::PaperOrientation_PORTRAIT)
1500*cdf0e10cSrcweir 				AddAttribute(XML_NAMESPACE_STYLE, XML_PRINT_ORIENTATION, XML_PORTRAIT);
1501*cdf0e10cSrcweir 			else
1502*cdf0e10cSrcweir 				AddAttribute(XML_NAMESPACE_STYLE, XML_PRINT_ORIENTATION, XML_LANDSCAPE);
1503*cdf0e10cSrcweir 
1504*cdf0e10cSrcweir 			// write style:properties
1505*cdf0e10cSrcweir 			SvXMLElementExport aPMF(*this, XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT_PROPERTIES, sal_True, sal_True);
1506*cdf0e10cSrcweir 		}
1507*cdf0e10cSrcweir 	}
1508*cdf0e10cSrcweir }
1509*cdf0e10cSrcweir 
1510*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
1511*cdf0e10cSrcweir 
1512*cdf0e10cSrcweir ImpXMLEXPPageMasterInfo* SdXMLExport::ImpGetPageMasterInfoByName(const OUString& rName)
1513*cdf0e10cSrcweir {
1514*cdf0e10cSrcweir 	if(rName.getLength() && mpPageMasterInfoList->Count())
1515*cdf0e10cSrcweir 	{
1516*cdf0e10cSrcweir 		for(sal_uInt32 nCnt = 0L; nCnt < mpPageMasterInfoList->Count(); nCnt++)
1517*cdf0e10cSrcweir 		{
1518*cdf0e10cSrcweir 			ImpXMLEXPPageMasterInfo* pInfo = mpPageMasterInfoList->GetObject(nCnt);
1519*cdf0e10cSrcweir 			if(pInfo)
1520*cdf0e10cSrcweir 			{
1521*cdf0e10cSrcweir 				if(pInfo->GetMasterPageName().getLength() && rName.equals(pInfo->GetMasterPageName()))
1522*cdf0e10cSrcweir 				{
1523*cdf0e10cSrcweir 					return pInfo;
1524*cdf0e10cSrcweir 				}
1525*cdf0e10cSrcweir 			}
1526*cdf0e10cSrcweir 		}
1527*cdf0e10cSrcweir 	}
1528*cdf0e10cSrcweir 	return 0L;
1529*cdf0e10cSrcweir }
1530*cdf0e10cSrcweir 
1531*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
1532*cdf0e10cSrcweir 
1533*cdf0e10cSrcweir void SdXMLExport::ImpPrepDrawPageInfos()
1534*cdf0e10cSrcweir {
1535*cdf0e10cSrcweir 	// create draw:style-name entries for page export
1536*cdf0e10cSrcweir 	// containing presentation page attributes AND background attributes
1537*cdf0e10cSrcweir 	// fixed family for page-styles is "drawing-page" (XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME)
1538*cdf0e10cSrcweir 
1539*cdf0e10cSrcweir 	sal_Int32 nCnt;
1540*cdf0e10cSrcweir 	for(nCnt = 0; nCnt < mnDocDrawPageCount; nCnt++)
1541*cdf0e10cSrcweir 	{
1542*cdf0e10cSrcweir 		Reference<XDrawPage> xDrawPage;
1543*cdf0e10cSrcweir 		mxDocDrawPages->getByIndex(nCnt) >>= xDrawPage;
1544*cdf0e10cSrcweir 		maDrawPagesStyleNames[nCnt] = ImpCreatePresPageStyleName( xDrawPage );
1545*cdf0e10cSrcweir 
1546*cdf0e10cSrcweir 		Reference< presentation::XPresentationPage > xPresPage(xDrawPage, UNO_QUERY);
1547*cdf0e10cSrcweir 		if(xPresPage.is())
1548*cdf0e10cSrcweir 		{
1549*cdf0e10cSrcweir 			maDrawNotesPagesStyleNames[nCnt] = ImpCreatePresPageStyleName( xPresPage->getNotesPage(), false );
1550*cdf0e10cSrcweir 
1551*cdf0e10cSrcweir 			maDrawPagesHeaderFooterSettings[nCnt] = ImpPrepDrawPageHeaderFooterDecls( xDrawPage );
1552*cdf0e10cSrcweir 			maDrawNotesPagesHeaderFooterSettings[nCnt] = ImpPrepDrawPageHeaderFooterDecls( xPresPage->getNotesPage() );
1553*cdf0e10cSrcweir 		}
1554*cdf0e10cSrcweir 	}
1555*cdf0e10cSrcweir }
1556*cdf0e10cSrcweir 
1557*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
1558*cdf0e10cSrcweir 
1559*cdf0e10cSrcweir static OUString findOrAppendImpl( std::vector< OUString >& rVector, const OUString& rText, const sal_Char* pPrefix )
1560*cdf0e10cSrcweir {
1561*cdf0e10cSrcweir 	// search rVector if there is already a string that equals rText
1562*cdf0e10cSrcweir 	std::vector< OUString >::iterator aIter;
1563*cdf0e10cSrcweir 	sal_Int32 nIndex;
1564*cdf0e10cSrcweir 	for( nIndex = 1, aIter = rVector.begin(); aIter != rVector.end(); aIter++, nIndex++ )
1565*cdf0e10cSrcweir 	{
1566*cdf0e10cSrcweir 		if( (*aIter) == rText )
1567*cdf0e10cSrcweir 			break;
1568*cdf0e10cSrcweir 	}
1569*cdf0e10cSrcweir 
1570*cdf0e10cSrcweir 	// if nothing is found, append the string at the end of rVector
1571*cdf0e10cSrcweir 	if( aIter == rVector.end() )
1572*cdf0e10cSrcweir 		rVector.push_back( rText );
1573*cdf0e10cSrcweir 
1574*cdf0e10cSrcweir 	// create a reference string with pPrefix and the index of the
1575*cdf0e10cSrcweir 	// found or created rText
1576*cdf0e10cSrcweir 	OUString aStr( OUString::createFromAscii( pPrefix ) );
1577*cdf0e10cSrcweir 	aStr += OUString::valueOf( nIndex );
1578*cdf0e10cSrcweir 	return aStr;
1579*cdf0e10cSrcweir }
1580*cdf0e10cSrcweir 
1581*cdf0e10cSrcweir static OUString findOrAppendImpl( std::vector< DateTimeDeclImpl >& rVector, const OUString& rText, sal_Bool bFixed, sal_Int32 nFormat, const sal_Char* pPrefix )
1582*cdf0e10cSrcweir {
1583*cdf0e10cSrcweir 	// search rVector if there is already a DateTimeDeclImpl with rText,bFixed and nFormat
1584*cdf0e10cSrcweir 	std::vector< DateTimeDeclImpl >::iterator aIter;
1585*cdf0e10cSrcweir 	sal_Int32 nIndex;
1586*cdf0e10cSrcweir 	for( nIndex = 1, aIter = rVector.begin(); aIter != rVector.end(); aIter++, nIndex++ )
1587*cdf0e10cSrcweir 	{
1588*cdf0e10cSrcweir 		const DateTimeDeclImpl& rDecl = (*aIter);
1589*cdf0e10cSrcweir 		if( (rDecl.mbFixed == bFixed ) &&
1590*cdf0e10cSrcweir 			(!bFixed || rDecl.maStrText == rText) &&
1591*cdf0e10cSrcweir 			(bFixed || (rDecl.mnFormat == nFormat) ) )
1592*cdf0e10cSrcweir 			break;
1593*cdf0e10cSrcweir 	}
1594*cdf0e10cSrcweir 
1595*cdf0e10cSrcweir 	// if nothing is found, append a new DateTimeDeclImpl
1596*cdf0e10cSrcweir 	if( aIter == rVector.end() )
1597*cdf0e10cSrcweir 	{
1598*cdf0e10cSrcweir 		DateTimeDeclImpl aDecl;
1599*cdf0e10cSrcweir 		aDecl.maStrText = rText;
1600*cdf0e10cSrcweir 		aDecl.mbFixed = bFixed;
1601*cdf0e10cSrcweir 		aDecl.mnFormat = nFormat;
1602*cdf0e10cSrcweir 		rVector.push_back( aDecl );
1603*cdf0e10cSrcweir 	}
1604*cdf0e10cSrcweir 
1605*cdf0e10cSrcweir 	// create a reference string with pPrefix and the index of the
1606*cdf0e10cSrcweir 	// found or created DateTimeDeclImpl
1607*cdf0e10cSrcweir 	OUString aStr( OUString::createFromAscii( pPrefix ) );
1608*cdf0e10cSrcweir 	aStr += OUString::valueOf( nIndex );
1609*cdf0e10cSrcweir 	return aStr;
1610*cdf0e10cSrcweir 
1611*cdf0e10cSrcweir }
1612*cdf0e10cSrcweir 
1613*cdf0e10cSrcweir static const sal_Char* gpStrHeaderTextPrefix = "hdr";
1614*cdf0e10cSrcweir static const sal_Char* gpStrFooterTextPrefix = "ftr";
1615*cdf0e10cSrcweir static const sal_Char* gpStrDateTimeTextPrefix = "dtd";
1616*cdf0e10cSrcweir 
1617*cdf0e10cSrcweir HeaderFooterPageSettingsImpl SdXMLExport::ImpPrepDrawPageHeaderFooterDecls( const Reference<XDrawPage>& xDrawPage )
1618*cdf0e10cSrcweir {
1619*cdf0e10cSrcweir 	HeaderFooterPageSettingsImpl aSettings;
1620*cdf0e10cSrcweir 
1621*cdf0e10cSrcweir 	if( xDrawPage.is() ) try
1622*cdf0e10cSrcweir 	{
1623*cdf0e10cSrcweir 		Reference< XPropertySet > xSet( xDrawPage, UNO_QUERY_THROW );
1624*cdf0e10cSrcweir 		Reference< XPropertySetInfo > xInfo( xSet->getPropertySetInfo() );
1625*cdf0e10cSrcweir 
1626*cdf0e10cSrcweir 		OUString aStrText;
1627*cdf0e10cSrcweir 
1628*cdf0e10cSrcweir 		const OUString aStrHeaderTextProp( RTL_CONSTASCII_USTRINGPARAM( "HeaderText" ) );
1629*cdf0e10cSrcweir 		if( xInfo->hasPropertyByName( aStrHeaderTextProp ) )
1630*cdf0e10cSrcweir 		{
1631*cdf0e10cSrcweir 			xSet->getPropertyValue( aStrHeaderTextProp  ) >>= aStrText;
1632*cdf0e10cSrcweir 			if( aStrText.getLength() )
1633*cdf0e10cSrcweir 				aSettings.maStrHeaderDeclName = findOrAppendImpl( maHeaderDeclsVector, aStrText, gpStrHeaderTextPrefix );
1634*cdf0e10cSrcweir 		}
1635*cdf0e10cSrcweir 
1636*cdf0e10cSrcweir 		const OUString aStrFooterTextProp( RTL_CONSTASCII_USTRINGPARAM( "FooterText" ) );
1637*cdf0e10cSrcweir 		if( xInfo->hasPropertyByName( aStrFooterTextProp ) )
1638*cdf0e10cSrcweir 		{
1639*cdf0e10cSrcweir 			xSet->getPropertyValue( aStrFooterTextProp ) >>= aStrText;
1640*cdf0e10cSrcweir 			if( aStrText.getLength() )
1641*cdf0e10cSrcweir 				aSettings.maStrFooterDeclName = findOrAppendImpl( maFooterDeclsVector, aStrText, gpStrFooterTextPrefix );
1642*cdf0e10cSrcweir 		}
1643*cdf0e10cSrcweir 
1644*cdf0e10cSrcweir 		const OUString aStrDateTimeTextProp( RTL_CONSTASCII_USTRINGPARAM( "DateTimeText" ) );
1645*cdf0e10cSrcweir 		if( xInfo->hasPropertyByName( aStrDateTimeTextProp ) )
1646*cdf0e10cSrcweir 		{
1647*cdf0e10cSrcweir 			sal_Bool bFixed = false;
1648*cdf0e10cSrcweir 			sal_Int32 nFormat = 0;
1649*cdf0e10cSrcweir 			xSet->getPropertyValue( aStrDateTimeTextProp ) >>= aStrText;
1650*cdf0e10cSrcweir 			xSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDateTimeFixed" ) ) ) >>= bFixed;
1651*cdf0e10cSrcweir 			xSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DateTimeFormat" ) ) ) >>= nFormat;
1652*cdf0e10cSrcweir 
1653*cdf0e10cSrcweir 			if( !bFixed || aStrText.getLength() )
1654*cdf0e10cSrcweir 			{
1655*cdf0e10cSrcweir 				aSettings.maStrDateTimeDeclName = findOrAppendImpl( maDateTimeDeclsVector, aStrText, bFixed, nFormat, gpStrDateTimeTextPrefix );
1656*cdf0e10cSrcweir 				if( !bFixed )
1657*cdf0e10cSrcweir 					addDataStyle( nFormat );
1658*cdf0e10cSrcweir 			}
1659*cdf0e10cSrcweir 		}
1660*cdf0e10cSrcweir 	}
1661*cdf0e10cSrcweir 	catch( Exception& e )
1662*cdf0e10cSrcweir 	{
1663*cdf0e10cSrcweir 		(void)e;
1664*cdf0e10cSrcweir 		DBG_ERROR( "SdXMLExport::ImpPrepDrawPageHeaderFooterDecls(), unexpected exception cought!" );
1665*cdf0e10cSrcweir 	}
1666*cdf0e10cSrcweir 
1667*cdf0e10cSrcweir 	return aSettings;
1668*cdf0e10cSrcweir }
1669*cdf0e10cSrcweir 
1670*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
1671*cdf0e10cSrcweir 
1672*cdf0e10cSrcweir void SdXMLExport::ImpWriteHeaderFooterDecls()
1673*cdf0e10cSrcweir {
1674*cdf0e10cSrcweir 	OUStringBuffer sBuffer;
1675*cdf0e10cSrcweir 
1676*cdf0e10cSrcweir 	if( !maHeaderDeclsVector.empty() )
1677*cdf0e10cSrcweir 	{
1678*cdf0e10cSrcweir 		// export header decls
1679*cdf0e10cSrcweir 		const OUString aPrefix( OUString::createFromAscii( gpStrHeaderTextPrefix ) );
1680*cdf0e10cSrcweir 		std::vector< OUString >::iterator aIter;
1681*cdf0e10cSrcweir 		sal_Int32 nIndex;
1682*cdf0e10cSrcweir 		for( nIndex = 1, aIter = maHeaderDeclsVector.begin(); aIter != maHeaderDeclsVector.end(); aIter++, nIndex++ )
1683*cdf0e10cSrcweir 		{
1684*cdf0e10cSrcweir 			sBuffer.append( aPrefix );
1685*cdf0e10cSrcweir 			sBuffer.append( nIndex );
1686*cdf0e10cSrcweir 			AddAttribute(XML_NAMESPACE_PRESENTATION, XML_NAME, sBuffer.makeStringAndClear());
1687*cdf0e10cSrcweir 
1688*cdf0e10cSrcweir 			SvXMLElementExport aElem(*this, XML_NAMESPACE_PRESENTATION, XML_HEADER_DECL, sal_True, sal_True);
1689*cdf0e10cSrcweir 			Characters((*aIter));
1690*cdf0e10cSrcweir 		}
1691*cdf0e10cSrcweir 	}
1692*cdf0e10cSrcweir 
1693*cdf0e10cSrcweir 	if( !maFooterDeclsVector.empty() )
1694*cdf0e10cSrcweir 	{
1695*cdf0e10cSrcweir 		// export footer decls
1696*cdf0e10cSrcweir 		const OUString aPrefix( OUString::createFromAscii( gpStrFooterTextPrefix ) );
1697*cdf0e10cSrcweir 		std::vector< OUString >::iterator aIter;
1698*cdf0e10cSrcweir 		sal_Int32 nIndex;
1699*cdf0e10cSrcweir 		for( nIndex = 1, aIter = maFooterDeclsVector.begin(); aIter != maFooterDeclsVector.end(); aIter++, nIndex++ )
1700*cdf0e10cSrcweir 		{
1701*cdf0e10cSrcweir 			sBuffer.append( aPrefix );
1702*cdf0e10cSrcweir 			sBuffer.append( nIndex );
1703*cdf0e10cSrcweir 			AddAttribute(XML_NAMESPACE_PRESENTATION, XML_NAME, sBuffer.makeStringAndClear());
1704*cdf0e10cSrcweir 
1705*cdf0e10cSrcweir 			SvXMLElementExport aElem(*this, XML_NAMESPACE_PRESENTATION, XML_FOOTER_DECL, sal_False, sal_False);
1706*cdf0e10cSrcweir 			Characters((*aIter));
1707*cdf0e10cSrcweir 		}
1708*cdf0e10cSrcweir 	}
1709*cdf0e10cSrcweir 
1710*cdf0e10cSrcweir 	if( !maDateTimeDeclsVector.empty() )
1711*cdf0e10cSrcweir 	{
1712*cdf0e10cSrcweir 		// export footer decls
1713*cdf0e10cSrcweir 		const OUString aPrefix( OUString::createFromAscii( gpStrDateTimeTextPrefix ) );
1714*cdf0e10cSrcweir 		std::vector< DateTimeDeclImpl >::iterator aIter;
1715*cdf0e10cSrcweir 		sal_Int32 nIndex;
1716*cdf0e10cSrcweir 		for( nIndex = 1, aIter = maDateTimeDeclsVector.begin(); aIter != maDateTimeDeclsVector.end(); aIter++, nIndex++ )
1717*cdf0e10cSrcweir 		{
1718*cdf0e10cSrcweir 			const DateTimeDeclImpl& rDecl = (*aIter);
1719*cdf0e10cSrcweir 
1720*cdf0e10cSrcweir 			sBuffer.append( aPrefix );
1721*cdf0e10cSrcweir 			sBuffer.append( nIndex );
1722*cdf0e10cSrcweir 			AddAttribute( XML_NAMESPACE_PRESENTATION, XML_NAME, sBuffer.makeStringAndClear());
1723*cdf0e10cSrcweir 
1724*cdf0e10cSrcweir 			AddAttribute( XML_NAMESPACE_PRESENTATION, XML_SOURCE, rDecl.mbFixed ? XML_FIXED : XML_CURRENT_DATE );
1725*cdf0e10cSrcweir 
1726*cdf0e10cSrcweir 			if( !rDecl.mbFixed )
1727*cdf0e10cSrcweir 				AddAttribute( XML_NAMESPACE_STYLE, XML_DATA_STYLE_NAME, getDataStyleName( rDecl.mnFormat ) );
1728*cdf0e10cSrcweir 
1729*cdf0e10cSrcweir 			SvXMLElementExport aElem(*this, XML_NAMESPACE_PRESENTATION, XML_DATE_TIME_DECL, sal_False, sal_False);
1730*cdf0e10cSrcweir 			if( rDecl.mbFixed )
1731*cdf0e10cSrcweir 				Characters(rDecl.maStrText);
1732*cdf0e10cSrcweir 		}
1733*cdf0e10cSrcweir 	}
1734*cdf0e10cSrcweir }
1735*cdf0e10cSrcweir 
1736*cdf0e10cSrcweir void SdXMLExport::ImplExportHeaderFooterDeclAttributes( const HeaderFooterPageSettingsImpl& aSettings )
1737*cdf0e10cSrcweir {
1738*cdf0e10cSrcweir 	if( aSettings.maStrHeaderDeclName.getLength() )
1739*cdf0e10cSrcweir 		AddAttribute( XML_NAMESPACE_PRESENTATION, XML_USE_HEADER_NAME, aSettings.maStrHeaderDeclName );
1740*cdf0e10cSrcweir 
1741*cdf0e10cSrcweir 	if( aSettings.maStrFooterDeclName.getLength() )
1742*cdf0e10cSrcweir 		AddAttribute( XML_NAMESPACE_PRESENTATION, XML_USE_FOOTER_NAME, aSettings.maStrFooterDeclName );
1743*cdf0e10cSrcweir 
1744*cdf0e10cSrcweir 	if( aSettings.maStrDateTimeDeclName.getLength() )
1745*cdf0e10cSrcweir 		AddAttribute( XML_NAMESPACE_PRESENTATION, XML_USE_DATE_TIME_NAME, aSettings.maStrDateTimeDeclName );
1746*cdf0e10cSrcweir }
1747*cdf0e10cSrcweir 
1748*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
1749*cdf0e10cSrcweir 
1750*cdf0e10cSrcweir OUString SdXMLExport::ImpCreatePresPageStyleName( Reference<XDrawPage> xDrawPage, bool bExportBackground /* = true */ )
1751*cdf0e10cSrcweir {
1752*cdf0e10cSrcweir 	// create name
1753*cdf0e10cSrcweir 	OUString sStyleName;
1754*cdf0e10cSrcweir 
1755*cdf0e10cSrcweir 	// create style for this page and add to auto style pool
1756*cdf0e10cSrcweir 
1757*cdf0e10cSrcweir 	Reference< beans::XPropertySet > xPropSet1(xDrawPage, UNO_QUERY);
1758*cdf0e10cSrcweir 	if(xPropSet1.is())
1759*cdf0e10cSrcweir 	{
1760*cdf0e10cSrcweir 		Reference< beans::XPropertySet > xPropSet;
1761*cdf0e10cSrcweir 
1762*cdf0e10cSrcweir 		if( bExportBackground )
1763*cdf0e10cSrcweir 		{
1764*cdf0e10cSrcweir 			// since the background items are in a different propertyset
1765*cdf0e10cSrcweir 			// which itself is a property of the pages property set
1766*cdf0e10cSrcweir 			// we now merge these two propertysets if possible to simulate
1767*cdf0e10cSrcweir 			// a single propertyset with all draw page properties
1768*cdf0e10cSrcweir 			const OUString aBackground(RTL_CONSTASCII_USTRINGPARAM("Background"));
1769*cdf0e10cSrcweir 			Reference< beans::XPropertySet > xPropSet2;
1770*cdf0e10cSrcweir 			Reference< beans::XPropertySetInfo > xInfo( xPropSet1->getPropertySetInfo() );
1771*cdf0e10cSrcweir 			if( xInfo.is() && xInfo->hasPropertyByName( aBackground ) )
1772*cdf0e10cSrcweir 			{
1773*cdf0e10cSrcweir 				Any aAny( xPropSet1->getPropertyValue( aBackground ) );
1774*cdf0e10cSrcweir 				aAny >>= xPropSet2;
1775*cdf0e10cSrcweir 			}
1776*cdf0e10cSrcweir 
1777*cdf0e10cSrcweir 			if( xPropSet2.is() )
1778*cdf0e10cSrcweir 				xPropSet = PropertySetMerger_CreateInstance( xPropSet1, xPropSet2 );
1779*cdf0e10cSrcweir 			else
1780*cdf0e10cSrcweir 				xPropSet = xPropSet1;
1781*cdf0e10cSrcweir 		}
1782*cdf0e10cSrcweir 		else
1783*cdf0e10cSrcweir 		{
1784*cdf0e10cSrcweir 			xPropSet = xPropSet1;
1785*cdf0e10cSrcweir 		}
1786*cdf0e10cSrcweir 
1787*cdf0e10cSrcweir 		const UniReference< SvXMLExportPropertyMapper > aMapperRef( GetPresPagePropsMapper() );
1788*cdf0e10cSrcweir 
1789*cdf0e10cSrcweir 		std::vector< XMLPropertyState > xPropStates( aMapperRef->Filter( xPropSet ) );
1790*cdf0e10cSrcweir 
1791*cdf0e10cSrcweir 		if( !xPropStates.empty() )
1792*cdf0e10cSrcweir 		{
1793*cdf0e10cSrcweir 			// there are filtered properties -> hard attributes
1794*cdf0e10cSrcweir 			// try to find this style in AutoStylePool
1795*cdf0e10cSrcweir 			sStyleName = GetAutoStylePool()->Find(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, sStyleName, xPropStates);
1796*cdf0e10cSrcweir 
1797*cdf0e10cSrcweir 			if(!sStyleName.getLength())
1798*cdf0e10cSrcweir 			{
1799*cdf0e10cSrcweir 				// Style did not exist, add it to AutoStalePool
1800*cdf0e10cSrcweir 				sStyleName = GetAutoStylePool()->Add(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, sStyleName, xPropStates);
1801*cdf0e10cSrcweir 			}
1802*cdf0e10cSrcweir 		}
1803*cdf0e10cSrcweir 	}
1804*cdf0e10cSrcweir 
1805*cdf0e10cSrcweir 	return sStyleName;
1806*cdf0e10cSrcweir }
1807*cdf0e10cSrcweir 
1808*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
1809*cdf0e10cSrcweir 
1810*cdf0e10cSrcweir void SdXMLExport::ImpPrepMasterPageInfos()
1811*cdf0e10cSrcweir {
1812*cdf0e10cSrcweir 	// create draw:style-name entries for master page export
1813*cdf0e10cSrcweir 	// containing only background attributes
1814*cdf0e10cSrcweir 	// fixed family for page-styles is "drawing-page" (XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME)
1815*cdf0e10cSrcweir 
1816*cdf0e10cSrcweir 	sal_Int32 nCnt;
1817*cdf0e10cSrcweir 	for( nCnt = 0; nCnt < mnDocMasterPageCount; nCnt++)
1818*cdf0e10cSrcweir 	{
1819*cdf0e10cSrcweir 		Reference<XDrawPage> xDrawPage;
1820*cdf0e10cSrcweir 		mxDocMasterPages->getByIndex(nCnt) >>= xDrawPage;
1821*cdf0e10cSrcweir 		maMasterPagesStyleNames[nCnt] = ImpCreatePresPageStyleName( xDrawPage );
1822*cdf0e10cSrcweir 	}
1823*cdf0e10cSrcweir 
1824*cdf0e10cSrcweir 	if( IsImpress() )
1825*cdf0e10cSrcweir 	{
1826*cdf0e10cSrcweir 		Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetModel(), UNO_QUERY );
1827*cdf0e10cSrcweir 		if( xHandoutSupp.is() )
1828*cdf0e10cSrcweir 		{
1829*cdf0e10cSrcweir 			Reference< XDrawPage > xHandoutPage( xHandoutSupp->getHandoutMasterPage() );
1830*cdf0e10cSrcweir 			if( xHandoutPage.is() )
1831*cdf0e10cSrcweir 			{
1832*cdf0e10cSrcweir 				maHandoutPageHeaderFooterSettings = ImpPrepDrawPageHeaderFooterDecls( xHandoutPage );
1833*cdf0e10cSrcweir 				maHandoutMasterStyleName = ImpCreatePresPageStyleName( xHandoutPage, false );
1834*cdf0e10cSrcweir 			}
1835*cdf0e10cSrcweir 		}
1836*cdf0e10cSrcweir 	}
1837*cdf0e10cSrcweir }
1838*cdf0e10cSrcweir 
1839*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
1840*cdf0e10cSrcweir void SdXMLExport::ImpWritePresentationStyles()
1841*cdf0e10cSrcweir {
1842*cdf0e10cSrcweir 	if(IsImpress())
1843*cdf0e10cSrcweir 	{
1844*cdf0e10cSrcweir         for (sal_Int32 nCnt = 0; nCnt < mnDocMasterPageCount; nCnt++)
1845*cdf0e10cSrcweir 		{
1846*cdf0e10cSrcweir 			Any aAny(mxDocMasterPages->getByIndex(nCnt));
1847*cdf0e10cSrcweir 			Reference<container::XNamed> xNamed;
1848*cdf0e10cSrcweir 
1849*cdf0e10cSrcweir 			if(aAny >>= xNamed)
1850*cdf0e10cSrcweir 			{
1851*cdf0e10cSrcweir 				// write presentation styles (ONLY if presentation)
1852*cdf0e10cSrcweir 				if(IsImpress() && mxDocStyleFamilies.is() && xNamed.is())
1853*cdf0e10cSrcweir 				{
1854*cdf0e10cSrcweir 					XMLStyleExport aStEx(*this, OUString(), GetAutoStylePool().get());
1855*cdf0e10cSrcweir 					const UniReference< SvXMLExportPropertyMapper > aMapperRef( GetPropertySetMapper() );
1856*cdf0e10cSrcweir 
1857*cdf0e10cSrcweir 					OUString aPrefix( xNamed->getName() );
1858*cdf0e10cSrcweir 
1859*cdf0e10cSrcweir 					aPrefix += OUString(RTL_CONSTASCII_USTRINGPARAM("-"));
1860*cdf0e10cSrcweir 					aStEx.exportStyleFamily(xNamed->getName(),
1861*cdf0e10cSrcweir 						OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_NAME)),
1862*cdf0e10cSrcweir                         aMapperRef, sal_False,
1863*cdf0e10cSrcweir 						XML_STYLE_FAMILY_SD_PRESENTATION_ID, &aPrefix);
1864*cdf0e10cSrcweir 				}
1865*cdf0e10cSrcweir 			}
1866*cdf0e10cSrcweir 		}
1867*cdf0e10cSrcweir 	}
1868*cdf0e10cSrcweir }
1869*cdf0e10cSrcweir 
1870*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
1871*cdf0e10cSrcweir 
1872*cdf0e10cSrcweir void SdXMLExport::SetProgress(sal_Int32 nProg)
1873*cdf0e10cSrcweir {
1874*cdf0e10cSrcweir 	// set progress view
1875*cdf0e10cSrcweir 	if(GetStatusIndicator().is())
1876*cdf0e10cSrcweir 		GetStatusIndicator()->setValue(nProg);
1877*cdf0e10cSrcweir }
1878*cdf0e10cSrcweir 
1879*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
1880*cdf0e10cSrcweir // #82003#
1881*cdf0e10cSrcweir 
1882*cdf0e10cSrcweir void SdXMLExport::_ExportMeta()
1883*cdf0e10cSrcweir {
1884*cdf0e10cSrcweir     uno::Sequence<beans::NamedValue> stats(1);
1885*cdf0e10cSrcweir     stats[0] = beans::NamedValue(::rtl::OUString::createFromAscii("ObjectCount"),
1886*cdf0e10cSrcweir                 uno::makeAny(mnObjectCount));
1887*cdf0e10cSrcweir 
1888*cdf0e10cSrcweir     // update document statistics at the model
1889*cdf0e10cSrcweir     uno::Reference<document::XDocumentPropertiesSupplier> xPropSup(GetModel(),
1890*cdf0e10cSrcweir         uno::UNO_QUERY_THROW);
1891*cdf0e10cSrcweir     uno::Reference<document::XDocumentProperties> xDocProps(
1892*cdf0e10cSrcweir         xPropSup->getDocumentProperties());
1893*cdf0e10cSrcweir     if (xDocProps.is()) {
1894*cdf0e10cSrcweir         xDocProps->setDocumentStatistics(stats);
1895*cdf0e10cSrcweir     }
1896*cdf0e10cSrcweir 
1897*cdf0e10cSrcweir 	// call parent
1898*cdf0e10cSrcweir 	SvXMLExport::_ExportMeta();
1899*cdf0e10cSrcweir }
1900*cdf0e10cSrcweir 
1901*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
1902*cdf0e10cSrcweir 
1903*cdf0e10cSrcweir void SdXMLExport::_ExportContent()
1904*cdf0e10cSrcweir {
1905*cdf0e10cSrcweir 	// export <pres:header-decl>, <pres:footer-decl> and <pres:date-time-decl> elements
1906*cdf0e10cSrcweir 	ImpWriteHeaderFooterDecls();
1907*cdf0e10cSrcweir 
1908*cdf0e10cSrcweir 	// page export
1909*cdf0e10cSrcweir 	for(sal_Int32 nPageInd(0); nPageInd < mnDocDrawPageCount; nPageInd++)
1910*cdf0e10cSrcweir 	{
1911*cdf0e10cSrcweir 		uno::Reference<drawing::XDrawPage> xDrawPage( mxDocDrawPages->getByIndex(nPageInd), uno::UNO_QUERY );
1912*cdf0e10cSrcweir 
1913*cdf0e10cSrcweir 		SetProgress(((nPageInd + 1) * 100) / mnDocDrawPageCount);
1914*cdf0e10cSrcweir 
1915*cdf0e10cSrcweir 		if(xDrawPage.is())
1916*cdf0e10cSrcweir 		{
1917*cdf0e10cSrcweir 			// prepare page attributes, name of page
1918*cdf0e10cSrcweir 			Reference < container::XNamed > xNamed(xDrawPage, UNO_QUERY);
1919*cdf0e10cSrcweir 			if(xNamed.is())
1920*cdf0e10cSrcweir 				AddAttribute(XML_NAMESPACE_DRAW, XML_NAME, xNamed->getName());
1921*cdf0e10cSrcweir 
1922*cdf0e10cSrcweir 			// draw:style-name (presentation page attributes AND background attributes)
1923*cdf0e10cSrcweir 			if( maDrawPagesStyleNames[nPageInd].getLength() )
1924*cdf0e10cSrcweir 				AddAttribute(XML_NAMESPACE_DRAW, XML_STYLE_NAME,
1925*cdf0e10cSrcweir 						maDrawPagesStyleNames[nPageInd]);
1926*cdf0e10cSrcweir 
1927*cdf0e10cSrcweir 			// draw:master-page-name
1928*cdf0e10cSrcweir 			Reference < drawing::XMasterPageTarget > xMasterPageInt(xDrawPage, UNO_QUERY);
1929*cdf0e10cSrcweir 			if(xMasterPageInt.is())
1930*cdf0e10cSrcweir 			{
1931*cdf0e10cSrcweir 				Reference<XDrawPage> xUsedMasterPage(xMasterPageInt->getMasterPage());
1932*cdf0e10cSrcweir 				if(xUsedMasterPage.is())
1933*cdf0e10cSrcweir 				{
1934*cdf0e10cSrcweir 					Reference < container::XNamed > xMasterNamed(xUsedMasterPage, UNO_QUERY);
1935*cdf0e10cSrcweir 					if(xMasterNamed.is())
1936*cdf0e10cSrcweir 					{
1937*cdf0e10cSrcweir 						AddAttribute(XML_NAMESPACE_DRAW, XML_MASTER_PAGE_NAME,
1938*cdf0e10cSrcweir 							EncodeStyleName( xMasterNamed->getName()) );
1939*cdf0e10cSrcweir 					}
1940*cdf0e10cSrcweir 				}
1941*cdf0e10cSrcweir 			}
1942*cdf0e10cSrcweir 
1943*cdf0e10cSrcweir 			// presentation:page-layout-name
1944*cdf0e10cSrcweir 			if( IsImpress() && maDrawPagesAutoLayoutNames[nPageInd+1].getLength())
1945*cdf0e10cSrcweir 			{
1946*cdf0e10cSrcweir 				AddAttribute(XML_NAMESPACE_PRESENTATION, XML_PRESENTATION_PAGE_LAYOUT_NAME, maDrawPagesAutoLayoutNames[nPageInd+1] );
1947*cdf0e10cSrcweir 			}
1948*cdf0e10cSrcweir 
1949*cdf0e10cSrcweir 			Reference< beans::XPropertySet > xProps( xDrawPage, UNO_QUERY );
1950*cdf0e10cSrcweir 			if( xProps.is() )
1951*cdf0e10cSrcweir 			{
1952*cdf0e10cSrcweir 				try
1953*cdf0e10cSrcweir 				{
1954*cdf0e10cSrcweir 					OUString aBookmarkURL;
1955*cdf0e10cSrcweir 					xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "BookmarkURL" ) ) ) >>= aBookmarkURL;
1956*cdf0e10cSrcweir 
1957*cdf0e10cSrcweir 					if( aBookmarkURL.getLength() )
1958*cdf0e10cSrcweir 					{
1959*cdf0e10cSrcweir 						sal_Int32 nIndex = aBookmarkURL.lastIndexOf( (sal_Unicode)'#' );
1960*cdf0e10cSrcweir 						if( nIndex != -1 )
1961*cdf0e10cSrcweir 						{
1962*cdf0e10cSrcweir 							OUString aFileName( aBookmarkURL.copy( 0, nIndex ) );
1963*cdf0e10cSrcweir 							OUString aBookmarkName( aBookmarkURL.copy( nIndex+1 ) );
1964*cdf0e10cSrcweir 
1965*cdf0e10cSrcweir 							aBookmarkURL = GetRelativeReference( aFileName );
1966*cdf0e10cSrcweir 							aBookmarkURL += String( '#' );
1967*cdf0e10cSrcweir 							aBookmarkURL += aBookmarkName;
1968*cdf0e10cSrcweir 						}
1969*cdf0e10cSrcweir 
1970*cdf0e10cSrcweir 						AddAttribute ( XML_NAMESPACE_XLINK, XML_HREF, aBookmarkURL);
1971*cdf0e10cSrcweir 						AddAttribute ( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
1972*cdf0e10cSrcweir 						AddAttribute ( XML_NAMESPACE_XLINK, XML_SHOW, XML_REPLACE );
1973*cdf0e10cSrcweir 						AddAttribute ( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONREQUEST );
1974*cdf0e10cSrcweir 					}
1975*cdf0e10cSrcweir 				}
1976*cdf0e10cSrcweir 				catch( Exception& )
1977*cdf0e10cSrcweir 				{
1978*cdf0e10cSrcweir 					DBG_ERROR(" no \"BookmarkURL\" property at page?" );
1979*cdf0e10cSrcweir 				}
1980*cdf0e10cSrcweir 			}
1981*cdf0e10cSrcweir 
1982*cdf0e10cSrcweir 			if( IsImpress() )
1983*cdf0e10cSrcweir 				ImplExportHeaderFooterDeclAttributes( maDrawPagesHeaderFooterSettings[nPageInd] );
1984*cdf0e10cSrcweir 
1985*cdf0e10cSrcweir 
1986*cdf0e10cSrcweir 			OUString sNavigationOrder( getNavigationOrder( xDrawPage ) );
1987*cdf0e10cSrcweir 			if( sNavigationOrder.getLength() != 0 )
1988*cdf0e10cSrcweir 				AddAttribute ( XML_NAMESPACE_DRAW, XML_NAV_ORDER, sNavigationOrder );
1989*cdf0e10cSrcweir 
1990*cdf0e10cSrcweir 			UniReference< xmloff::AnimationsExporter >	xAnimationsExporter;
1991*cdf0e10cSrcweir 			uno::Reference< ::com::sun::star::animations::XAnimationNodeSupplier > xAnimNodeSupplier;
1992*cdf0e10cSrcweir 
1993*cdf0e10cSrcweir 			// prepare animation export
1994*cdf0e10cSrcweir 			if(IsImpress())
1995*cdf0e10cSrcweir 			{
1996*cdf0e10cSrcweir 				if( getExportFlags() & EXPORT_OASIS )
1997*cdf0e10cSrcweir 				{
1998*cdf0e10cSrcweir 					// export new animations for oasis format
1999*cdf0e10cSrcweir 					xAnimNodeSupplier.set( xDrawPage, UNO_QUERY );
2000*cdf0e10cSrcweir 
2001*cdf0e10cSrcweir 					// prepare animations exporter if impress
2002*cdf0e10cSrcweir 					if(xAnimNodeSupplier.is())
2003*cdf0e10cSrcweir 					{
2004*cdf0e10cSrcweir 						xAnimationsExporter = new xmloff::AnimationsExporter( *this, xProps );
2005*cdf0e10cSrcweir 						xAnimationsExporter->prepare( xAnimNodeSupplier->getAnimationNode() );
2006*cdf0e10cSrcweir 					}
2007*cdf0e10cSrcweir 				}
2008*cdf0e10cSrcweir 				else
2009*cdf0e10cSrcweir 				{
2010*cdf0e10cSrcweir 					// export old animations for ooo format
2011*cdf0e10cSrcweir 					UniReference< XMLAnimationsExporter > xAnimExport = new XMLAnimationsExporter( GetShapeExport().get() );
2012*cdf0e10cSrcweir 					GetShapeExport()->setAnimationsExporter( xAnimExport );
2013*cdf0e10cSrcweir 				}
2014*cdf0e10cSrcweir 			}
2015*cdf0e10cSrcweir 
2016*cdf0e10cSrcweir 			// write draw:id
2017*cdf0e10cSrcweir 	        const OUString aPageId = getInterfaceToIdentifierMapper().getIdentifier( xDrawPage );
2018*cdf0e10cSrcweir 			if( aPageId.getLength() != 0 )
2019*cdf0e10cSrcweir             {
2020*cdf0e10cSrcweir                 AddAttributeIdLegacy(XML_NAMESPACE_DRAW, aPageId);
2021*cdf0e10cSrcweir             }
2022*cdf0e10cSrcweir 
2023*cdf0e10cSrcweir 			// write page
2024*cdf0e10cSrcweir 			SvXMLElementExport aDPG(*this, XML_NAMESPACE_DRAW, XML_PAGE, sal_True, sal_True);
2025*cdf0e10cSrcweir 
2026*cdf0e10cSrcweir 			// write optional office:forms
2027*cdf0e10cSrcweir 			exportFormsElement( xDrawPage );
2028*cdf0e10cSrcweir 
2029*cdf0e10cSrcweir 			// write graphic objects on this page (if any)
2030*cdf0e10cSrcweir 			Reference< drawing::XShapes > xExportShapes(xDrawPage, UNO_QUERY);
2031*cdf0e10cSrcweir 			if(xExportShapes.is() && xExportShapes->getCount())
2032*cdf0e10cSrcweir 				GetShapeExport()->exportShapes( xExportShapes );
2033*cdf0e10cSrcweir 
2034*cdf0e10cSrcweir 			// write animations and presentation notes (ONLY if presentation)
2035*cdf0e10cSrcweir 			if(IsImpress())
2036*cdf0e10cSrcweir 			{
2037*cdf0e10cSrcweir 				if(xAnimNodeSupplier.is())
2038*cdf0e10cSrcweir 				{
2039*cdf0e10cSrcweir 					xAnimationsExporter->exportAnimations( xAnimNodeSupplier->getAnimationNode() );
2040*cdf0e10cSrcweir 				}
2041*cdf0e10cSrcweir 				else
2042*cdf0e10cSrcweir 				{
2043*cdf0e10cSrcweir 					// animations
2044*cdf0e10cSrcweir 					UniReference< XMLAnimationsExporter > xAnimExport( GetShapeExport()->getAnimationsExporter() );
2045*cdf0e10cSrcweir 					if( xAnimExport.is() )
2046*cdf0e10cSrcweir 						xAnimExport->exportAnimations( *this );
2047*cdf0e10cSrcweir 
2048*cdf0e10cSrcweir 					xAnimExport = NULL;
2049*cdf0e10cSrcweir 					GetShapeExport()->setAnimationsExporter( xAnimExport );
2050*cdf0e10cSrcweir 				}
2051*cdf0e10cSrcweir 
2052*cdf0e10cSrcweir 				// presentations
2053*cdf0e10cSrcweir 				Reference< presentation::XPresentationPage > xPresPage(xDrawPage, UNO_QUERY);
2054*cdf0e10cSrcweir 				if(xPresPage.is())
2055*cdf0e10cSrcweir 				{
2056*cdf0e10cSrcweir 					Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage());
2057*cdf0e10cSrcweir 					if(xNotesPage.is())
2058*cdf0e10cSrcweir 					{
2059*cdf0e10cSrcweir 						Reference< drawing::XShapes > xShapes(xNotesPage, UNO_QUERY);
2060*cdf0e10cSrcweir 						if(xShapes.is())
2061*cdf0e10cSrcweir 						{
2062*cdf0e10cSrcweir 							if( maDrawNotesPagesStyleNames[nPageInd].getLength() )
2063*cdf0e10cSrcweir 								AddAttribute(XML_NAMESPACE_DRAW, XML_STYLE_NAME, maDrawNotesPagesStyleNames[nPageInd]);
2064*cdf0e10cSrcweir 
2065*cdf0e10cSrcweir 							ImplExportHeaderFooterDeclAttributes( maDrawNotesPagesHeaderFooterSettings[nPageInd] );
2066*cdf0e10cSrcweir 
2067*cdf0e10cSrcweir 							// write presentation notes
2068*cdf0e10cSrcweir 							SvXMLElementExport aPSY(*this, XML_NAMESPACE_PRESENTATION, XML_NOTES, sal_True, sal_True);
2069*cdf0e10cSrcweir 
2070*cdf0e10cSrcweir 							// write optional office:forms
2071*cdf0e10cSrcweir 							exportFormsElement( xNotesPage );
2072*cdf0e10cSrcweir 
2073*cdf0e10cSrcweir 							// write shapes per se
2074*cdf0e10cSrcweir 							GetShapeExport()->exportShapes( xShapes );
2075*cdf0e10cSrcweir 						}
2076*cdf0e10cSrcweir 					}
2077*cdf0e10cSrcweir 				}
2078*cdf0e10cSrcweir 			}
2079*cdf0e10cSrcweir 
2080*cdf0e10cSrcweir 			exportAnnotations( xDrawPage );
2081*cdf0e10cSrcweir 		}
2082*cdf0e10cSrcweir 	}
2083*cdf0e10cSrcweir 
2084*cdf0e10cSrcweir 	if( IsImpress() )
2085*cdf0e10cSrcweir 		exportPresentationSettings();
2086*cdf0e10cSrcweir }
2087*cdf0e10cSrcweir 
2088*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
2089*cdf0e10cSrcweir 
2090*cdf0e10cSrcweir void SdXMLExport::exportPresentationSettings()
2091*cdf0e10cSrcweir {
2092*cdf0e10cSrcweir 	try
2093*cdf0e10cSrcweir 	{
2094*cdf0e10cSrcweir 		Reference< XPresentationSupplier > xPresSupplier( GetModel(), UNO_QUERY );
2095*cdf0e10cSrcweir 		if( !xPresSupplier.is() )
2096*cdf0e10cSrcweir 			return;
2097*cdf0e10cSrcweir 
2098*cdf0e10cSrcweir 		Reference< XPropertySet > xPresProps( xPresSupplier->getPresentation(), UNO_QUERY );
2099*cdf0e10cSrcweir 		if( !xPresProps.is() )
2100*cdf0e10cSrcweir 			return;
2101*cdf0e10cSrcweir 
2102*cdf0e10cSrcweir 		sal_Bool bHasAttr = sal_False;
2103*cdf0e10cSrcweir 
2104*cdf0e10cSrcweir 		sal_Bool bTemp = false;
2105*cdf0e10cSrcweir 
2106*cdf0e10cSrcweir 		// export range
2107*cdf0e10cSrcweir 		xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsShowAll" ) ) ) >>= bTemp;
2108*cdf0e10cSrcweir 		if( !bTemp )
2109*cdf0e10cSrcweir 		{
2110*cdf0e10cSrcweir 			OUString aFirstPage;
2111*cdf0e10cSrcweir 			xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "FirstPage" ) ) ) >>= aFirstPage;
2112*cdf0e10cSrcweir 			if( aFirstPage.getLength() )
2113*cdf0e10cSrcweir 			{
2114*cdf0e10cSrcweir 				AddAttribute(XML_NAMESPACE_PRESENTATION, XML_START_PAGE, aFirstPage );
2115*cdf0e10cSrcweir 				bHasAttr = sal_True;
2116*cdf0e10cSrcweir 			}
2117*cdf0e10cSrcweir 			else
2118*cdf0e10cSrcweir 			{
2119*cdf0e10cSrcweir 				OUString aCustomShow;
2120*cdf0e10cSrcweir 				xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "CustomShow" ) ) ) >>= aCustomShow;
2121*cdf0e10cSrcweir 				if( aCustomShow.getLength() )
2122*cdf0e10cSrcweir 				{
2123*cdf0e10cSrcweir 					AddAttribute(XML_NAMESPACE_PRESENTATION, XML_SHOW, aCustomShow );
2124*cdf0e10cSrcweir 					bHasAttr = sal_True;
2125*cdf0e10cSrcweir 				}
2126*cdf0e10cSrcweir 			}
2127*cdf0e10cSrcweir 		}
2128*cdf0e10cSrcweir 
2129*cdf0e10cSrcweir 		xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsEndless" ) ) ) >>= bTemp;
2130*cdf0e10cSrcweir 		if( bTemp )
2131*cdf0e10cSrcweir 		{
2132*cdf0e10cSrcweir 			AddAttribute(XML_NAMESPACE_PRESENTATION, XML_ENDLESS, XML_TRUE );
2133*cdf0e10cSrcweir 			bHasAttr = sal_True;
2134*cdf0e10cSrcweir 
2135*cdf0e10cSrcweir 			sal_Int32 nPause = 0;
2136*cdf0e10cSrcweir 			xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Pause" ) ) ) >>= nPause;
2137*cdf0e10cSrcweir 
2138*cdf0e10cSrcweir 			util::DateTime aTime( 0, (sal_uInt16)nPause, 0, 0, 0, 0, 0 );
2139*cdf0e10cSrcweir 
2140*cdf0e10cSrcweir 			OUStringBuffer aOut;
2141*cdf0e10cSrcweir 			SvXMLUnitConverter::convertTime( aOut, aTime );
2142*cdf0e10cSrcweir 			AddAttribute(XML_NAMESPACE_PRESENTATION, XML_PAUSE, aOut.makeStringAndClear() );
2143*cdf0e10cSrcweir 		}
2144*cdf0e10cSrcweir 
2145*cdf0e10cSrcweir 		xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AllowAnimations" ) ) ) >>= bTemp;
2146*cdf0e10cSrcweir 		if( !bTemp )
2147*cdf0e10cSrcweir 		{
2148*cdf0e10cSrcweir 			AddAttribute(XML_NAMESPACE_PRESENTATION, XML_ANIMATIONS, XML_DISABLED );
2149*cdf0e10cSrcweir 			bHasAttr = sal_True;
2150*cdf0e10cSrcweir 		}
2151*cdf0e10cSrcweir 
2152*cdf0e10cSrcweir 		xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsAlwaysOnTop" ) ) ) >>= bTemp;
2153*cdf0e10cSrcweir 		if( bTemp )
2154*cdf0e10cSrcweir 		{
2155*cdf0e10cSrcweir 			AddAttribute(XML_NAMESPACE_PRESENTATION, XML_STAY_ON_TOP, XML_TRUE );
2156*cdf0e10cSrcweir 			bHasAttr = sal_True;
2157*cdf0e10cSrcweir 		}
2158*cdf0e10cSrcweir 
2159*cdf0e10cSrcweir 		xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsAutomatic" ) ) ) >>= bTemp;
2160*cdf0e10cSrcweir 		if( bTemp )
2161*cdf0e10cSrcweir 		{
2162*cdf0e10cSrcweir 			AddAttribute(XML_NAMESPACE_PRESENTATION, XML_FORCE_MANUAL, XML_TRUE );
2163*cdf0e10cSrcweir 			bHasAttr = sal_True;
2164*cdf0e10cSrcweir 		}
2165*cdf0e10cSrcweir 
2166*cdf0e10cSrcweir 		xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFullScreen" ) ) ) >>= bTemp;
2167*cdf0e10cSrcweir 		if( !bTemp )
2168*cdf0e10cSrcweir 		{
2169*cdf0e10cSrcweir 			AddAttribute(XML_NAMESPACE_PRESENTATION, XML_FULL_SCREEN, XML_FALSE );
2170*cdf0e10cSrcweir 			bHasAttr = sal_True;
2171*cdf0e10cSrcweir 		}
2172*cdf0e10cSrcweir 
2173*cdf0e10cSrcweir 		xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsMouseVisible" ) ) ) >>= bTemp;
2174*cdf0e10cSrcweir 		if( !bTemp )
2175*cdf0e10cSrcweir 		{
2176*cdf0e10cSrcweir 			AddAttribute(XML_NAMESPACE_PRESENTATION, XML_MOUSE_VISIBLE, XML_FALSE );
2177*cdf0e10cSrcweir 			bHasAttr = sal_True;
2178*cdf0e10cSrcweir 		}
2179*cdf0e10cSrcweir 
2180*cdf0e10cSrcweir 		xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "StartWithNavigator" ) ) ) >>= bTemp;
2181*cdf0e10cSrcweir 		if( bTemp )
2182*cdf0e10cSrcweir 		{
2183*cdf0e10cSrcweir 			AddAttribute(XML_NAMESPACE_PRESENTATION, XML_START_WITH_NAVIGATOR, XML_TRUE );
2184*cdf0e10cSrcweir 			bHasAttr = sal_True;
2185*cdf0e10cSrcweir 		}
2186*cdf0e10cSrcweir 
2187*cdf0e10cSrcweir 		xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "UsePen" ) ) ) >>= bTemp;
2188*cdf0e10cSrcweir 		if( bTemp )
2189*cdf0e10cSrcweir 		{
2190*cdf0e10cSrcweir 			AddAttribute(XML_NAMESPACE_PRESENTATION, XML_MOUSE_AS_PEN, XML_TRUE );
2191*cdf0e10cSrcweir 			bHasAttr = sal_True;
2192*cdf0e10cSrcweir 		}
2193*cdf0e10cSrcweir 
2194*cdf0e10cSrcweir 		xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsTransitionOnClick" ) ) ) >>= bTemp;
2195*cdf0e10cSrcweir 		if( !bTemp )
2196*cdf0e10cSrcweir 		{
2197*cdf0e10cSrcweir 			AddAttribute(XML_NAMESPACE_PRESENTATION, XML_TRANSITION_ON_CLICK, XML_DISABLED );
2198*cdf0e10cSrcweir 			bHasAttr = sal_True;
2199*cdf0e10cSrcweir 		}
2200*cdf0e10cSrcweir 
2201*cdf0e10cSrcweir 		xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsShowLogo" ) ) ) >>= bTemp;
2202*cdf0e10cSrcweir 		if( bTemp )
2203*cdf0e10cSrcweir 		{
2204*cdf0e10cSrcweir 			AddAttribute(XML_NAMESPACE_PRESENTATION, XML_SHOW_LOGO, XML_TRUE );
2205*cdf0e10cSrcweir 			bHasAttr = sal_True;
2206*cdf0e10cSrcweir 		}
2207*cdf0e10cSrcweir 
2208*cdf0e10cSrcweir 		Reference< container::XNameContainer > xShows;
2209*cdf0e10cSrcweir 		Sequence< OUString > aShowNames;
2210*cdf0e10cSrcweir 		const OUString* pShowNames = NULL;
2211*cdf0e10cSrcweir 		sal_Int32 nShowCount = 0;
2212*cdf0e10cSrcweir 
2213*cdf0e10cSrcweir 		Reference< XCustomPresentationSupplier > xSup( GetModel(), UNO_QUERY );
2214*cdf0e10cSrcweir 		if( xSup.is() )
2215*cdf0e10cSrcweir 		{
2216*cdf0e10cSrcweir 			xShows = xSup->getCustomPresentations();
2217*cdf0e10cSrcweir 			if( xShows.is() )
2218*cdf0e10cSrcweir 			{
2219*cdf0e10cSrcweir 				aShowNames = xShows->getElementNames();
2220*cdf0e10cSrcweir 				pShowNames = aShowNames.getArray();
2221*cdf0e10cSrcweir 				nShowCount = aShowNames.getLength();
2222*cdf0e10cSrcweir 			}
2223*cdf0e10cSrcweir 		}
2224*cdf0e10cSrcweir 
2225*cdf0e10cSrcweir 		if( bHasAttr || nShowCount != 0 )
2226*cdf0e10cSrcweir 		{
2227*cdf0e10cSrcweir 			SvXMLElementExport aSettings(*this, XML_NAMESPACE_PRESENTATION, XML_SETTINGS, sal_True, sal_True);
2228*cdf0e10cSrcweir 
2229*cdf0e10cSrcweir 			if( nShowCount == 0 )
2230*cdf0e10cSrcweir 				return;
2231*cdf0e10cSrcweir 
2232*cdf0e10cSrcweir 			Reference< XIndexContainer > xShow;
2233*cdf0e10cSrcweir 			Reference< XNamed > xPageName;
2234*cdf0e10cSrcweir 
2235*cdf0e10cSrcweir 			OUStringBuffer sTmp;
2236*cdf0e10cSrcweir 
2237*cdf0e10cSrcweir 			for( sal_Int32 nIndex = 0; nIndex < nShowCount; nIndex++, pShowNames++ )
2238*cdf0e10cSrcweir 			{
2239*cdf0e10cSrcweir 				AddAttribute(XML_NAMESPACE_PRESENTATION, XML_NAME, *pShowNames );
2240*cdf0e10cSrcweir 
2241*cdf0e10cSrcweir 				xShows->getByName( *pShowNames ) >>= xShow;
2242*cdf0e10cSrcweir 				DBG_ASSERT( xShow.is(), "invalid custom show!" );
2243*cdf0e10cSrcweir 				if( !xShow.is() )
2244*cdf0e10cSrcweir 					continue;
2245*cdf0e10cSrcweir 
2246*cdf0e10cSrcweir 				const sal_Int32 nPageCount = xShow->getCount();
2247*cdf0e10cSrcweir 				for( sal_Int32 nPage = 0; nPage < nPageCount; nPage++ )
2248*cdf0e10cSrcweir 				{
2249*cdf0e10cSrcweir 					xShow->getByIndex( nPage ) >>= xPageName;
2250*cdf0e10cSrcweir 
2251*cdf0e10cSrcweir 					if( !xPageName.is() )
2252*cdf0e10cSrcweir 						continue;
2253*cdf0e10cSrcweir 
2254*cdf0e10cSrcweir 					if( sTmp.getLength() != 0 )
2255*cdf0e10cSrcweir 						sTmp.append( sal_Unicode( ',' ) );
2256*cdf0e10cSrcweir 					sTmp.append( xPageName->getName() );
2257*cdf0e10cSrcweir 
2258*cdf0e10cSrcweir 				}
2259*cdf0e10cSrcweir 
2260*cdf0e10cSrcweir 				if( sTmp.getLength() )
2261*cdf0e10cSrcweir 					AddAttribute(XML_NAMESPACE_PRESENTATION, XML_PAGES, sTmp.makeStringAndClear() );
2262*cdf0e10cSrcweir 
2263*cdf0e10cSrcweir 				SvXMLElementExport aShows(*this, XML_NAMESPACE_PRESENTATION, XML_SHOW, sal_True, sal_True);
2264*cdf0e10cSrcweir 			}
2265*cdf0e10cSrcweir 		}
2266*cdf0e10cSrcweir 	}
2267*cdf0e10cSrcweir 	catch( uno::Exception )
2268*cdf0e10cSrcweir 	{
2269*cdf0e10cSrcweir 		DBG_ERROR( "uno::Exception while exporting <presentation:settings>" );
2270*cdf0e10cSrcweir 	}
2271*cdf0e10cSrcweir }
2272*cdf0e10cSrcweir 
2273*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
2274*cdf0e10cSrcweir 
2275*cdf0e10cSrcweir void SdXMLExport::_ExportStyles(sal_Bool bUsed)
2276*cdf0e10cSrcweir {
2277*cdf0e10cSrcweir 	GetPropertySetMapper()->SetAutoStyles( sal_False );
2278*cdf0e10cSrcweir 
2279*cdf0e10cSrcweir 	// export fill styles
2280*cdf0e10cSrcweir 	SvXMLExport::_ExportStyles( bUsed );
2281*cdf0e10cSrcweir 
2282*cdf0e10cSrcweir 	// write draw:style-name for object graphic-styles
2283*cdf0e10cSrcweir 	GetShapeExport()->ExportGraphicDefaults();
2284*cdf0e10cSrcweir 
2285*cdf0e10cSrcweir 	// do not export in ODF 1.1 or older
2286*cdf0e10cSrcweir 	if( getDefaultVersion() >= SvtSaveOptions::ODFVER_012 )
2287*cdf0e10cSrcweir 		GetShapeExport()->GetShapeTableExport()->exportTableStyles();
2288*cdf0e10cSrcweir 
2289*cdf0e10cSrcweir 	// write presentation styles
2290*cdf0e10cSrcweir 	ImpWritePresentationStyles();
2291*cdf0e10cSrcweir 
2292*cdf0e10cSrcweir 	// prepare draw:auto-layout-name for page export
2293*cdf0e10cSrcweir 	ImpPrepAutoLayoutInfos();
2294*cdf0e10cSrcweir 
2295*cdf0e10cSrcweir 	// write draw:auto-layout-name for page export
2296*cdf0e10cSrcweir 	ImpWriteAutoLayoutInfos();
2297*cdf0e10cSrcweir 
2298*cdf0e10cSrcweir 	Reference< beans::XPropertySet > xInfoSet( getExportInfo() );
2299*cdf0e10cSrcweir 	if( xInfoSet.is() )
2300*cdf0e10cSrcweir 	{
2301*cdf0e10cSrcweir 		Reference< beans::XPropertySetInfo > xInfoSetInfo( xInfoSet->getPropertySetInfo() );
2302*cdf0e10cSrcweir 
2303*cdf0e10cSrcweir 		Any aAny;
2304*cdf0e10cSrcweir 
2305*cdf0e10cSrcweir 		if( xInfoSetInfo->hasPropertyByName( msPageLayoutNames ) )
2306*cdf0e10cSrcweir 		{
2307*cdf0e10cSrcweir 			aAny <<= maDrawPagesAutoLayoutNames;
2308*cdf0e10cSrcweir 			xInfoSet->setPropertyValue( msPageLayoutNames, aAny );
2309*cdf0e10cSrcweir 		}
2310*cdf0e10cSrcweir 	}
2311*cdf0e10cSrcweir }
2312*cdf0e10cSrcweir 
2313*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
2314*cdf0e10cSrcweir 
2315*cdf0e10cSrcweir void SdXMLExport::_ExportAutoStyles()
2316*cdf0e10cSrcweir {
2317*cdf0e10cSrcweir 	Reference< beans::XPropertySet > xInfoSet( getExportInfo() );
2318*cdf0e10cSrcweir 	if( xInfoSet.is() )
2319*cdf0e10cSrcweir 	{
2320*cdf0e10cSrcweir 		Reference< beans::XPropertySetInfo > xInfoSetInfo( xInfoSet->getPropertySetInfo() );
2321*cdf0e10cSrcweir 
2322*cdf0e10cSrcweir 		if( xInfoSetInfo->hasPropertyByName( msPageLayoutNames ) )
2323*cdf0e10cSrcweir 		{
2324*cdf0e10cSrcweir 			xInfoSet->getPropertyValue( msPageLayoutNames ) >>= maDrawPagesAutoLayoutNames;
2325*cdf0e10cSrcweir 		}
2326*cdf0e10cSrcweir 	}
2327*cdf0e10cSrcweir 
2328*cdf0e10cSrcweir 	GetPropertySetMapper()->SetAutoStyles( sal_True );
2329*cdf0e10cSrcweir 
2330*cdf0e10cSrcweir 	if( getExportFlags() & EXPORT_STYLES )
2331*cdf0e10cSrcweir 	{
2332*cdf0e10cSrcweir 		// #80012# PageMaster export moved from _ExportStyles
2333*cdf0e10cSrcweir 		// prepare page-master infos
2334*cdf0e10cSrcweir 		ImpPrepPageMasterInfos();
2335*cdf0e10cSrcweir 
2336*cdf0e10cSrcweir 		// write page-master infos
2337*cdf0e10cSrcweir 		ImpWritePageMasterInfos();
2338*cdf0e10cSrcweir 
2339*cdf0e10cSrcweir 		// prepare draw:style-name for master page export
2340*cdf0e10cSrcweir 		ImpPrepMasterPageInfos();
2341*cdf0e10cSrcweir 	}
2342*cdf0e10cSrcweir 
2343*cdf0e10cSrcweir 	if( getExportFlags() & EXPORT_CONTENT )
2344*cdf0e10cSrcweir 	{
2345*cdf0e10cSrcweir 		// prepare draw:style-name for page export
2346*cdf0e10cSrcweir 		ImpPrepDrawPageInfos();
2347*cdf0e10cSrcweir 	}
2348*cdf0e10cSrcweir 
2349*cdf0e10cSrcweir 	// export draw-page styles
2350*cdf0e10cSrcweir 	GetAutoStylePool()->exportXML(
2351*cdf0e10cSrcweir 		XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID
2352*cdf0e10cSrcweir 		, GetDocHandler(),
2353*cdf0e10cSrcweir 		GetMM100UnitConverter(),
2354*cdf0e10cSrcweir 		GetNamespaceMap()
2355*cdf0e10cSrcweir         );
2356*cdf0e10cSrcweir 
2357*cdf0e10cSrcweir 	if( getExportFlags() & EXPORT_STYLES )
2358*cdf0e10cSrcweir 	{
2359*cdf0e10cSrcweir 		// create auto style infos for shapes on master handout page
2360*cdf0e10cSrcweir 		if( IsImpress() )
2361*cdf0e10cSrcweir 		{
2362*cdf0e10cSrcweir 			Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetModel(), UNO_QUERY );
2363*cdf0e10cSrcweir 			if( xHandoutSupp.is() )
2364*cdf0e10cSrcweir 			{
2365*cdf0e10cSrcweir 				Reference< XDrawPage > xHandoutPage( xHandoutSupp->getHandoutMasterPage() );
2366*cdf0e10cSrcweir 				if( xHandoutPage.is() )
2367*cdf0e10cSrcweir 				{
2368*cdf0e10cSrcweir 					Reference< drawing::XShapes > xShapes(xHandoutPage, UNO_QUERY);
2369*cdf0e10cSrcweir 					if(xShapes.is() && xShapes->getCount())
2370*cdf0e10cSrcweir 						GetShapeExport()->collectShapesAutoStyles( xShapes );
2371*cdf0e10cSrcweir 				}
2372*cdf0e10cSrcweir 			}
2373*cdf0e10cSrcweir 		}
2374*cdf0e10cSrcweir 
2375*cdf0e10cSrcweir 		// create auto style infos for objects on master pages
2376*cdf0e10cSrcweir 		for(sal_Int32 nMPageId(0L); nMPageId < mnDocMasterPageCount; nMPageId++)
2377*cdf0e10cSrcweir 		{
2378*cdf0e10cSrcweir 			Reference< XDrawPage > xMasterPage(mxDocMasterPages->getByIndex(nMPageId), UNO_QUERY );
2379*cdf0e10cSrcweir 
2380*cdf0e10cSrcweir 			if( xMasterPage.is() )
2381*cdf0e10cSrcweir 			{
2382*cdf0e10cSrcweir 				// collect layer information
2383*cdf0e10cSrcweir 				GetFormExport()->examineForms( xMasterPage );
2384*cdf0e10cSrcweir 
2385*cdf0e10cSrcweir 				// get MasterPage Name
2386*cdf0e10cSrcweir 				OUString aMasterPageNamePrefix;
2387*cdf0e10cSrcweir 				Reference < container::XNamed > xNamed(xMasterPage, UNO_QUERY);
2388*cdf0e10cSrcweir 				if(xNamed.is())
2389*cdf0e10cSrcweir 				{
2390*cdf0e10cSrcweir 					aMasterPageNamePrefix = xNamed->getName();
2391*cdf0e10cSrcweir 				}
2392*cdf0e10cSrcweir 				if(aMasterPageNamePrefix.getLength())
2393*cdf0e10cSrcweir 				{
2394*cdf0e10cSrcweir 					aMasterPageNamePrefix += OUString(RTL_CONSTASCII_USTRINGPARAM("-"));
2395*cdf0e10cSrcweir 				}
2396*cdf0e10cSrcweir 				GetShapeExport()->setPresentationStylePrefix( aMasterPageNamePrefix );
2397*cdf0e10cSrcweir 
2398*cdf0e10cSrcweir 				Reference< drawing::XShapes > xMasterShapes(xMasterPage, UNO_QUERY);
2399*cdf0e10cSrcweir 				if(xMasterShapes.is() && xMasterShapes->getCount())
2400*cdf0e10cSrcweir 					GetShapeExport()->collectShapesAutoStyles( xMasterShapes );
2401*cdf0e10cSrcweir 
2402*cdf0e10cSrcweir 				if(IsImpress())
2403*cdf0e10cSrcweir 				{
2404*cdf0e10cSrcweir 					Reference< presentation::XPresentationPage > xPresPage(xMasterPage, UNO_QUERY);
2405*cdf0e10cSrcweir 					if(xPresPage.is())
2406*cdf0e10cSrcweir 					{
2407*cdf0e10cSrcweir 						Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage());
2408*cdf0e10cSrcweir 						if(xNotesPage.is())
2409*cdf0e10cSrcweir 						{
2410*cdf0e10cSrcweir 							// collect layer information
2411*cdf0e10cSrcweir 							GetFormExport()->examineForms( xNotesPage );
2412*cdf0e10cSrcweir 
2413*cdf0e10cSrcweir 							Reference< drawing::XShapes > xShapes(xNotesPage, UNO_QUERY);
2414*cdf0e10cSrcweir 							if(xShapes.is() && xShapes->getCount())
2415*cdf0e10cSrcweir 								GetShapeExport()->collectShapesAutoStyles( xShapes );
2416*cdf0e10cSrcweir 						}
2417*cdf0e10cSrcweir 					}
2418*cdf0e10cSrcweir 				}
2419*cdf0e10cSrcweir 				collectAnnotationAutoStyles(xMasterPage);
2420*cdf0e10cSrcweir 			}
2421*cdf0e10cSrcweir 		}
2422*cdf0e10cSrcweir 	}
2423*cdf0e10cSrcweir 
2424*cdf0e10cSrcweir 	if( getExportFlags() & EXPORT_CONTENT )
2425*cdf0e10cSrcweir 	{
2426*cdf0e10cSrcweir 		// prepare animations exporter if impress
2427*cdf0e10cSrcweir 		if(IsImpress() && ((getExportFlags() & EXPORT_OASIS) == 0) )
2428*cdf0e10cSrcweir 		{
2429*cdf0e10cSrcweir 			UniReference< XMLAnimationsExporter > xAnimExport = new XMLAnimationsExporter( GetShapeExport().get() );
2430*cdf0e10cSrcweir 			GetShapeExport()->setAnimationsExporter( xAnimExport );
2431*cdf0e10cSrcweir 		}
2432*cdf0e10cSrcweir 
2433*cdf0e10cSrcweir 		// create auto style infos for objects on pages
2434*cdf0e10cSrcweir 		for(sal_Int32 nPageInd(0); nPageInd < mnDocDrawPageCount; nPageInd++)
2435*cdf0e10cSrcweir 		{
2436*cdf0e10cSrcweir 			Reference<XDrawPage> xDrawPage( mxDocDrawPages->getByIndex(nPageInd), UNO_QUERY );
2437*cdf0e10cSrcweir 			if( xDrawPage.is() )
2438*cdf0e10cSrcweir 			{
2439*cdf0e10cSrcweir 				// collect layer information
2440*cdf0e10cSrcweir 				GetFormExport()->examineForms( xDrawPage );
2441*cdf0e10cSrcweir 
2442*cdf0e10cSrcweir 				// get MasterPage Name
2443*cdf0e10cSrcweir 				OUString aMasterPageNamePrefix;
2444*cdf0e10cSrcweir 				Reference < drawing::XMasterPageTarget > xMasterPageInt(xDrawPage, UNO_QUERY);
2445*cdf0e10cSrcweir 				if(xMasterPageInt.is())
2446*cdf0e10cSrcweir 				{
2447*cdf0e10cSrcweir 					Reference<XDrawPage> xUsedMasterPage(xMasterPageInt->getMasterPage());
2448*cdf0e10cSrcweir 					if(xUsedMasterPage.is())
2449*cdf0e10cSrcweir 					{
2450*cdf0e10cSrcweir 						Reference < container::XNamed > xMasterNamed(xUsedMasterPage, UNO_QUERY);
2451*cdf0e10cSrcweir 						if(xMasterNamed.is())
2452*cdf0e10cSrcweir 						{
2453*cdf0e10cSrcweir 							aMasterPageNamePrefix = xMasterNamed->getName();
2454*cdf0e10cSrcweir 						}
2455*cdf0e10cSrcweir 					}
2456*cdf0e10cSrcweir 				}
2457*cdf0e10cSrcweir 				if(aMasterPageNamePrefix.getLength())
2458*cdf0e10cSrcweir 				{
2459*cdf0e10cSrcweir 					aMasterPageNamePrefix += OUString(RTL_CONSTASCII_USTRINGPARAM("-"));
2460*cdf0e10cSrcweir 				}
2461*cdf0e10cSrcweir 
2462*cdf0e10cSrcweir 				GetShapeExport()->setPresentationStylePrefix( aMasterPageNamePrefix );
2463*cdf0e10cSrcweir 
2464*cdf0e10cSrcweir 				// prepare object infos
2465*cdf0e10cSrcweir 				Reference< drawing::XShapes > xDrawShapes(xDrawPage, UNO_QUERY);
2466*cdf0e10cSrcweir 				if(xDrawShapes.is() && xDrawShapes->getCount())
2467*cdf0e10cSrcweir 					GetShapeExport()->collectShapesAutoStyles( xDrawShapes );
2468*cdf0e10cSrcweir 
2469*cdf0e10cSrcweir 				// prepare presentation notes page object infos (ONLY if presentation)
2470*cdf0e10cSrcweir 				if(IsImpress())
2471*cdf0e10cSrcweir 				{
2472*cdf0e10cSrcweir 					Reference< presentation::XPresentationPage > xPresPage(xDrawPage, UNO_QUERY);
2473*cdf0e10cSrcweir 					if(xPresPage.is())
2474*cdf0e10cSrcweir 					{
2475*cdf0e10cSrcweir 						Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage());
2476*cdf0e10cSrcweir 						if(xNotesPage.is())
2477*cdf0e10cSrcweir 						{
2478*cdf0e10cSrcweir 							// collect layer information
2479*cdf0e10cSrcweir 							GetFormExport()->examineForms( xNotesPage );
2480*cdf0e10cSrcweir 
2481*cdf0e10cSrcweir 							Reference< drawing::XShapes > xShapes(xNotesPage, UNO_QUERY);
2482*cdf0e10cSrcweir 							if(xShapes.is() && xShapes->getCount())
2483*cdf0e10cSrcweir 								GetShapeExport()->collectShapesAutoStyles( xShapes );
2484*cdf0e10cSrcweir 						}
2485*cdf0e10cSrcweir 					}
2486*cdf0e10cSrcweir 				}
2487*cdf0e10cSrcweir 
2488*cdf0e10cSrcweir 				collectAnnotationAutoStyles( xDrawPage );
2489*cdf0e10cSrcweir 			}
2490*cdf0e10cSrcweir 		}
2491*cdf0e10cSrcweir 		if(IsImpress())
2492*cdf0e10cSrcweir 		{
2493*cdf0e10cSrcweir 			UniReference< XMLAnimationsExporter > xAnimExport;
2494*cdf0e10cSrcweir 			GetShapeExport()->setAnimationsExporter( xAnimExport );
2495*cdf0e10cSrcweir 		}
2496*cdf0e10cSrcweir 	}
2497*cdf0e10cSrcweir 
2498*cdf0e10cSrcweir 	exportAutoDataStyles();
2499*cdf0e10cSrcweir 
2500*cdf0e10cSrcweir 	GetShapeExport()->exportAutoStyles();
2501*cdf0e10cSrcweir 
2502*cdf0e10cSrcweir 	sal_uInt16 nContentAutostyles = EXPORT_CONTENT | EXPORT_AUTOSTYLES;
2503*cdf0e10cSrcweir 	if ( ( getExportFlags() & nContentAutostyles ) == nContentAutostyles )
2504*cdf0e10cSrcweir 		GetFormExport()->exportAutoStyles( );
2505*cdf0e10cSrcweir 
2506*cdf0e10cSrcweir 	// ...for text
2507*cdf0e10cSrcweir 	GetTextParagraphExport()->exportTextAutoStyles();
2508*cdf0e10cSrcweir }
2509*cdf0e10cSrcweir 
2510*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
2511*cdf0e10cSrcweir 
2512*cdf0e10cSrcweir void SdXMLExport::_ExportMasterStyles()
2513*cdf0e10cSrcweir {
2514*cdf0e10cSrcweir 	// export layer
2515*cdf0e10cSrcweir 	SdXMLayerExporter::exportLayer( *this );
2516*cdf0e10cSrcweir 
2517*cdf0e10cSrcweir 	// export handout master page if impress
2518*cdf0e10cSrcweir 	if( IsImpress() )
2519*cdf0e10cSrcweir 	{
2520*cdf0e10cSrcweir 		Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetModel(), UNO_QUERY );
2521*cdf0e10cSrcweir 		if( xHandoutSupp.is() )
2522*cdf0e10cSrcweir 		{
2523*cdf0e10cSrcweir 			Reference< XDrawPage > xHandoutPage( xHandoutSupp->getHandoutMasterPage() );
2524*cdf0e10cSrcweir 			if( xHandoutPage.is() )
2525*cdf0e10cSrcweir 			{
2526*cdf0e10cSrcweir 				// presentation:page-layout-name
2527*cdf0e10cSrcweir 				if( IsImpress() && maDrawPagesAutoLayoutNames[0].getLength())
2528*cdf0e10cSrcweir 				{
2529*cdf0e10cSrcweir 					AddAttribute(XML_NAMESPACE_PRESENTATION, XML_PRESENTATION_PAGE_LAYOUT_NAME, EncodeStyleName( maDrawPagesAutoLayoutNames[0] ));
2530*cdf0e10cSrcweir 				}
2531*cdf0e10cSrcweir 
2532*cdf0e10cSrcweir 				ImpXMLEXPPageMasterInfo* pInfo = mpHandoutPageMaster;
2533*cdf0e10cSrcweir 				if(pInfo)
2534*cdf0e10cSrcweir 				{
2535*cdf0e10cSrcweir 					OUString sString = pInfo->GetName();
2536*cdf0e10cSrcweir 					AddAttribute(XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT_NAME, sString );
2537*cdf0e10cSrcweir 				}
2538*cdf0e10cSrcweir 
2539*cdf0e10cSrcweir 				// draw:style-name
2540*cdf0e10cSrcweir 				if( maHandoutMasterStyleName.getLength() )
2541*cdf0e10cSrcweir 					AddAttribute(XML_NAMESPACE_DRAW, XML_STYLE_NAME, maHandoutMasterStyleName);
2542*cdf0e10cSrcweir 
2543*cdf0e10cSrcweir 				ImplExportHeaderFooterDeclAttributes( maHandoutPageHeaderFooterSettings );
2544*cdf0e10cSrcweir 
2545*cdf0e10cSrcweir 				// write masterpage
2546*cdf0e10cSrcweir 				SvXMLElementExport aMPG(*this, XML_NAMESPACE_STYLE, XML_HANDOUT_MASTER, sal_True, sal_True);
2547*cdf0e10cSrcweir 
2548*cdf0e10cSrcweir 				// write graphic objects on this master page (if any)
2549*cdf0e10cSrcweir 				Reference< drawing::XShapes > xShapes(xHandoutPage, UNO_QUERY);
2550*cdf0e10cSrcweir 				if(xShapes.is() && xShapes->getCount())
2551*cdf0e10cSrcweir 					GetShapeExport()->exportShapes( xShapes );
2552*cdf0e10cSrcweir 			}
2553*cdf0e10cSrcweir 		}
2554*cdf0e10cSrcweir 	}
2555*cdf0e10cSrcweir 
2556*cdf0e10cSrcweir 	// export MasterPages in master-styles section
2557*cdf0e10cSrcweir     for (sal_Int32 nMPageId = 0; nMPageId < mnDocMasterPageCount; nMPageId++)
2558*cdf0e10cSrcweir 	{
2559*cdf0e10cSrcweir 		Reference< XDrawPage > xMasterPage( mxDocMasterPages->getByIndex(nMPageId), UNO_QUERY );
2560*cdf0e10cSrcweir 		if(xMasterPage.is())
2561*cdf0e10cSrcweir 		{
2562*cdf0e10cSrcweir 			// prepare masterpage attributes
2563*cdf0e10cSrcweir 			OUString sMasterPageName;
2564*cdf0e10cSrcweir 			Reference < container::XNamed > xNamed(xMasterPage, UNO_QUERY);
2565*cdf0e10cSrcweir 			if(xNamed.is())
2566*cdf0e10cSrcweir 			{
2567*cdf0e10cSrcweir 				sal_Bool bEncoded = sal_False;
2568*cdf0e10cSrcweir 				sMasterPageName = xNamed->getName();
2569*cdf0e10cSrcweir 				AddAttribute(XML_NAMESPACE_STYLE, XML_NAME,
2570*cdf0e10cSrcweir 					EncodeStyleName( sMasterPageName, &bEncoded ));
2571*cdf0e10cSrcweir 				if( bEncoded )
2572*cdf0e10cSrcweir                 	AddAttribute(
2573*cdf0e10cSrcweir 						XML_NAMESPACE_STYLE, XML_DISPLAY_NAME,
2574*cdf0e10cSrcweir 						sMasterPageName );
2575*cdf0e10cSrcweir 			}
2576*cdf0e10cSrcweir 
2577*cdf0e10cSrcweir 			ImpXMLEXPPageMasterInfo* pInfo = mpPageMasterUsageList->GetObject(nMPageId);
2578*cdf0e10cSrcweir 			if(pInfo)
2579*cdf0e10cSrcweir 			{
2580*cdf0e10cSrcweir 				OUString sString = pInfo->GetName();
2581*cdf0e10cSrcweir 				AddAttribute(XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT_NAME, sString );
2582*cdf0e10cSrcweir 			}
2583*cdf0e10cSrcweir 
2584*cdf0e10cSrcweir 			// draw:style-name (background attributes)
2585*cdf0e10cSrcweir 			if( maMasterPagesStyleNames[nMPageId].getLength() )
2586*cdf0e10cSrcweir 				AddAttribute(XML_NAMESPACE_DRAW, XML_STYLE_NAME,
2587*cdf0e10cSrcweir 						maMasterPagesStyleNames[nMPageId]);
2588*cdf0e10cSrcweir 
2589*cdf0e10cSrcweir 			// write masterpage
2590*cdf0e10cSrcweir 			SvXMLElementExport aMPG(*this, XML_NAMESPACE_STYLE, XML_MASTER_PAGE, sal_True, sal_True);
2591*cdf0e10cSrcweir 
2592*cdf0e10cSrcweir 			// write optional office:forms
2593*cdf0e10cSrcweir 			exportFormsElement( xMasterPage );
2594*cdf0e10cSrcweir 
2595*cdf0e10cSrcweir 			// write graphic objects on this master page (if any)
2596*cdf0e10cSrcweir 			Reference< drawing::XShapes > xMasterShapes(xMasterPage, UNO_QUERY);
2597*cdf0e10cSrcweir 			if(xMasterShapes.is() && xMasterShapes->getCount())
2598*cdf0e10cSrcweir 				GetShapeExport()->exportShapes( xMasterShapes );
2599*cdf0e10cSrcweir 
2600*cdf0e10cSrcweir 			// write presentation notes (ONLY if presentation)
2601*cdf0e10cSrcweir 			if(IsImpress())
2602*cdf0e10cSrcweir 			{
2603*cdf0e10cSrcweir 				Reference< presentation::XPresentationPage > xPresPage(xMasterPage, UNO_QUERY);
2604*cdf0e10cSrcweir 				if(xPresPage.is())
2605*cdf0e10cSrcweir 				{
2606*cdf0e10cSrcweir 					Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage());
2607*cdf0e10cSrcweir 					if(xNotesPage.is())
2608*cdf0e10cSrcweir 					{
2609*cdf0e10cSrcweir 						Reference< drawing::XShapes > xShapes(xNotesPage, UNO_QUERY);
2610*cdf0e10cSrcweir 						if(xShapes.is())
2611*cdf0e10cSrcweir 						{
2612*cdf0e10cSrcweir 							ImpXMLEXPPageMasterInfo* pMasterInfo = mpNotesPageMasterUsageList->GetObject(nMPageId);
2613*cdf0e10cSrcweir 							if(pMasterInfo)
2614*cdf0e10cSrcweir 							{
2615*cdf0e10cSrcweir 								OUString sString = pMasterInfo->GetName();
2616*cdf0e10cSrcweir 								AddAttribute(XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT_NAME, sString);
2617*cdf0e10cSrcweir 							}
2618*cdf0e10cSrcweir 
2619*cdf0e10cSrcweir 							// write presentation notes
2620*cdf0e10cSrcweir 							SvXMLElementExport aPSY(*this, XML_NAMESPACE_PRESENTATION, XML_NOTES, sal_True, sal_True);
2621*cdf0e10cSrcweir 
2622*cdf0e10cSrcweir 							// write optional office:forms
2623*cdf0e10cSrcweir 							exportFormsElement( xNotesPage );
2624*cdf0e10cSrcweir 
2625*cdf0e10cSrcweir 							// write shapes per se
2626*cdf0e10cSrcweir 							GetShapeExport()->exportShapes( xShapes );
2627*cdf0e10cSrcweir 						}
2628*cdf0e10cSrcweir 					}
2629*cdf0e10cSrcweir 				}
2630*cdf0e10cSrcweir 			}
2631*cdf0e10cSrcweir 			exportAnnotations( xMasterPage );
2632*cdf0e10cSrcweir 		}
2633*cdf0e10cSrcweir 	}
2634*cdf0e10cSrcweir }
2635*cdf0e10cSrcweir 
2636*cdf0e10cSrcweir void SdXMLExport::exportFormsElement( Reference< XDrawPage > xDrawPage )
2637*cdf0e10cSrcweir {
2638*cdf0e10cSrcweir 	if( xDrawPage.is() )
2639*cdf0e10cSrcweir 	{
2640*cdf0e10cSrcweir 		Reference< form::XFormsSupplier2 > xFormsSupplier( xDrawPage, UNO_QUERY );
2641*cdf0e10cSrcweir 		if ( xFormsSupplier.is() && xFormsSupplier->hasForms() )
2642*cdf0e10cSrcweir 		{
2643*cdf0e10cSrcweir 			// write masterpage
2644*cdf0e10cSrcweir 			::xmloff::OOfficeFormsExport aForms(*this);
2645*cdf0e10cSrcweir 			GetFormExport()->exportForms( xDrawPage );
2646*cdf0e10cSrcweir 		}
2647*cdf0e10cSrcweir 
2648*cdf0e10cSrcweir 		if(! GetFormExport()->seekPage( xDrawPage ) )
2649*cdf0e10cSrcweir 		{
2650*cdf0e10cSrcweir 			DBG_ERROR( "OFormLayerXMLExport::seekPage failed!" );
2651*cdf0e10cSrcweir 		}
2652*cdf0e10cSrcweir 	}
2653*cdf0e10cSrcweir }
2654*cdf0e10cSrcweir 
2655*cdf0e10cSrcweir void SdXMLExport::GetViewSettings(uno::Sequence<beans::PropertyValue>& rProps)
2656*cdf0e10cSrcweir {
2657*cdf0e10cSrcweir 	rProps.realloc(4);
2658*cdf0e10cSrcweir 	beans::PropertyValue* pProps = rProps.getArray();
2659*cdf0e10cSrcweir 	if(pProps)
2660*cdf0e10cSrcweir 	{
2661*cdf0e10cSrcweir //		SvXMLElementExport aViewSettingsElem(*this, XML_NAMESPACE_DRAW, XML_VIEW_SETTINGS, sal_True, sal_True);
2662*cdf0e10cSrcweir 
2663*cdf0e10cSrcweir 		Reference< beans::XPropertySet > xPropSet( GetModel(), UNO_QUERY );
2664*cdf0e10cSrcweir 		if( !xPropSet.is() )
2665*cdf0e10cSrcweir 			return;
2666*cdf0e10cSrcweir 
2667*cdf0e10cSrcweir 		awt::Rectangle aVisArea;
2668*cdf0e10cSrcweir 		xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ) ) >>= aVisArea;
2669*cdf0e10cSrcweir /*
2670*cdf0e10cSrcweir 		sal_Int16 nMapUnit;
2671*cdf0e10cSrcweir 		xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "MapUnit" ) ) ) >>= nMapUnit;
2672*cdf0e10cSrcweir */
2673*cdf0e10cSrcweir 
2674*cdf0e10cSrcweir 		sal_uInt16 i = 0;
2675*cdf0e10cSrcweir 		pProps[i].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaTop"));
2676*cdf0e10cSrcweir 		pProps[i++].Value <<= aVisArea.Y;
2677*cdf0e10cSrcweir 		pProps[i].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaLeft"));
2678*cdf0e10cSrcweir 		pProps[i++].Value <<= aVisArea.X;
2679*cdf0e10cSrcweir 		pProps[i].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaWidth"));
2680*cdf0e10cSrcweir 		pProps[i++].Value <<= aVisArea.Width;
2681*cdf0e10cSrcweir 		pProps[i].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaHeight"));
2682*cdf0e10cSrcweir 		pProps[i++].Value <<= aVisArea.Height;
2683*cdf0e10cSrcweir 	}
2684*cdf0e10cSrcweir }
2685*cdf0e10cSrcweir 
2686*cdf0e10cSrcweir void SdXMLExport::GetConfigurationSettings(uno::Sequence<beans::PropertyValue>& rProps)
2687*cdf0e10cSrcweir {
2688*cdf0e10cSrcweir 	Reference< lang::XMultiServiceFactory > xFac( GetModel(), UNO_QUERY );
2689*cdf0e10cSrcweir 	if( xFac.is() )
2690*cdf0e10cSrcweir 	{
2691*cdf0e10cSrcweir 		Reference< beans::XPropertySet > xProps( xFac->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.Settings" ) ) ), UNO_QUERY );
2692*cdf0e10cSrcweir 		if( xProps.is() )
2693*cdf0e10cSrcweir 			SvXMLUnitConverter::convertPropertySet( rProps, xProps );
2694*cdf0e10cSrcweir 	}
2695*cdf0e10cSrcweir }
2696*cdf0e10cSrcweir 
2697*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
2698*cdf0e10cSrcweir 
2699*cdf0e10cSrcweir void SdXMLExport::addDataStyle(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat )
2700*cdf0e10cSrcweir {
2701*cdf0e10cSrcweir 	sal_Int32 nFormat = nNumberFormat;
2702*cdf0e10cSrcweir 	if( (nNumberFormat > 1) && (nNumberFormat <= 0x0f) )
2703*cdf0e10cSrcweir 		nFormat -= 2;
2704*cdf0e10cSrcweir 
2705*cdf0e10cSrcweir 	if( bTimeFormat )
2706*cdf0e10cSrcweir 	{
2707*cdf0e10cSrcweir 		if( maUsedTimeStyles.count( nFormat ) == 0 )
2708*cdf0e10cSrcweir 			maUsedTimeStyles.insert( nFormat );
2709*cdf0e10cSrcweir 	}
2710*cdf0e10cSrcweir 	else
2711*cdf0e10cSrcweir 	{
2712*cdf0e10cSrcweir 		if( maUsedDateStyles.count( nFormat ) == 0 )
2713*cdf0e10cSrcweir 			maUsedDateStyles.insert( nFormat );
2714*cdf0e10cSrcweir 	}
2715*cdf0e10cSrcweir }
2716*cdf0e10cSrcweir 
2717*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
2718*cdf0e10cSrcweir 
2719*cdf0e10cSrcweir void SdXMLExport::exportDataStyles()
2720*cdf0e10cSrcweir {
2721*cdf0e10cSrcweir 	// there are no data styles to export in draw/impress yet
2722*cdf0e10cSrcweir }
2723*cdf0e10cSrcweir 
2724*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
2725*cdf0e10cSrcweir 
2726*cdf0e10cSrcweir void SdXMLExport::exportAutoDataStyles()
2727*cdf0e10cSrcweir {
2728*cdf0e10cSrcweir 	SdXMLFormatMap::iterator aIter( maUsedDateStyles.begin() );
2729*cdf0e10cSrcweir 	SdXMLFormatMap::iterator aEnd( maUsedDateStyles.end() );
2730*cdf0e10cSrcweir 
2731*cdf0e10cSrcweir 	while( aIter != aEnd )
2732*cdf0e10cSrcweir 		SdXMLNumberStylesExporter::exportDateStyle( *this, (*aIter++) );
2733*cdf0e10cSrcweir 
2734*cdf0e10cSrcweir 	aIter = maUsedTimeStyles.begin();
2735*cdf0e10cSrcweir 	aEnd = maUsedTimeStyles.end();
2736*cdf0e10cSrcweir 	while( aIter != aEnd )
2737*cdf0e10cSrcweir 		SdXMLNumberStylesExporter::exportTimeStyle( *this, (*aIter++) );
2738*cdf0e10cSrcweir 
2739*cdf0e10cSrcweir 	if(HasFormExport())
2740*cdf0e10cSrcweir 		GetFormExport()->exportAutoControlNumberStyles();
2741*cdf0e10cSrcweir }
2742*cdf0e10cSrcweir 
2743*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
2744*cdf0e10cSrcweir 
2745*cdf0e10cSrcweir OUString SdXMLExport::getDataStyleName(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat ) const
2746*cdf0e10cSrcweir {
2747*cdf0e10cSrcweir 	if( bTimeFormat )
2748*cdf0e10cSrcweir 	{
2749*cdf0e10cSrcweir 		return SdXMLNumberStylesExporter::getTimeStyleName( nNumberFormat );
2750*cdf0e10cSrcweir 	}
2751*cdf0e10cSrcweir 	else
2752*cdf0e10cSrcweir 	{
2753*cdf0e10cSrcweir 		return SdXMLNumberStylesExporter::getDateStyleName( nNumberFormat );
2754*cdf0e10cSrcweir 	}
2755*cdf0e10cSrcweir }
2756*cdf0e10cSrcweir 
2757*cdf0e10cSrcweir OUString SdXMLExport::getNavigationOrder( const Reference< XDrawPage >& xDrawPage )
2758*cdf0e10cSrcweir {
2759*cdf0e10cSrcweir 	OUStringBuffer sNavOrder;
2760*cdf0e10cSrcweir 	try
2761*cdf0e10cSrcweir 	{
2762*cdf0e10cSrcweir 		Reference< XPropertySet > xSet( xDrawPage, UNO_QUERY_THROW );
2763*cdf0e10cSrcweir 		Reference< XIndexAccess > xNavOrder( xSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "NavigationOrder" ) ) ), UNO_QUERY_THROW );
2764*cdf0e10cSrcweir 
2765*cdf0e10cSrcweir 		Reference< XIndexAccess > xZOrderAccess( xDrawPage, UNO_QUERY );
2766*cdf0e10cSrcweir 
2767*cdf0e10cSrcweir 		// only export navigation order if it is different from the z-order
2768*cdf0e10cSrcweir 		if( (xNavOrder.get() != xZOrderAccess.get()) && (xNavOrder->getCount() == xDrawPage->getCount())  )
2769*cdf0e10cSrcweir 		{
2770*cdf0e10cSrcweir 			sal_Int32 nIndex;
2771*cdf0e10cSrcweir 			const sal_Int32 nCount = xNavOrder->getCount();
2772*cdf0e10cSrcweir 			for( nIndex = 0; nIndex < nCount; ++nIndex )
2773*cdf0e10cSrcweir 			{
2774*cdf0e10cSrcweir 				OUString sId( getInterfaceToIdentifierMapper().registerReference( Reference< XInterface >( xNavOrder->getByIndex( nIndex ), UNO_QUERY ) ) );
2775*cdf0e10cSrcweir 				if( sId.getLength() != 0 )
2776*cdf0e10cSrcweir 				{
2777*cdf0e10cSrcweir 					if( sNavOrder.getLength() != 0 )
2778*cdf0e10cSrcweir 						sNavOrder.append( (sal_Unicode)' ' );
2779*cdf0e10cSrcweir 					sNavOrder.append( sId );
2780*cdf0e10cSrcweir 				}
2781*cdf0e10cSrcweir 			}
2782*cdf0e10cSrcweir 		}
2783*cdf0e10cSrcweir 	}
2784*cdf0e10cSrcweir 	catch( Exception& )
2785*cdf0e10cSrcweir 	{
2786*cdf0e10cSrcweir 	}
2787*cdf0e10cSrcweir 	return sNavOrder.makeStringAndClear();
2788*cdf0e10cSrcweir }
2789*cdf0e10cSrcweir 
2790*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
2791*cdf0e10cSrcweir 
2792*cdf0e10cSrcweir void SdXMLExport::collectAnnotationAutoStyles( const Reference<XDrawPage>& xDrawPage )
2793*cdf0e10cSrcweir {
2794*cdf0e10cSrcweir     Reference< XAnnotationAccess > xAnnotationAccess( xDrawPage, UNO_QUERY );
2795*cdf0e10cSrcweir     if( xAnnotationAccess.is() ) try
2796*cdf0e10cSrcweir     {
2797*cdf0e10cSrcweir         Reference< XAnnotationEnumeration > xAnnotationEnumeration( xAnnotationAccess->createAnnotationEnumeration() );
2798*cdf0e10cSrcweir         if( xAnnotationEnumeration.is() )
2799*cdf0e10cSrcweir         {
2800*cdf0e10cSrcweir             while( xAnnotationEnumeration->hasMoreElements() )
2801*cdf0e10cSrcweir             {
2802*cdf0e10cSrcweir                 Reference< XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement(), UNO_QUERY_THROW );
2803*cdf0e10cSrcweir                 Reference< XText > xText( xAnnotation->getTextRange() );
2804*cdf0e10cSrcweir 				if(xText.is() && xText->getString().getLength())
2805*cdf0e10cSrcweir 					GetTextParagraphExport()->collectTextAutoStyles( xText );
2806*cdf0e10cSrcweir 			}
2807*cdf0e10cSrcweir         }
2808*cdf0e10cSrcweir     }
2809*cdf0e10cSrcweir     catch( Exception& )
2810*cdf0e10cSrcweir     {
2811*cdf0e10cSrcweir         DBG_ERROR("SdXMLExport::collectAnnotationAutoStyles(), exception caught during export of annotation auto styles");
2812*cdf0e10cSrcweir     }
2813*cdf0e10cSrcweir }
2814*cdf0e10cSrcweir 
2815*cdf0e10cSrcweir void SdXMLExport::exportAnnotations( const Reference<XDrawPage>& xDrawPage )
2816*cdf0e10cSrcweir {
2817*cdf0e10cSrcweir     // do not export in ODF 1.2 or older
2818*cdf0e10cSrcweir     if( getDefaultVersion() <= SvtSaveOptions::ODFVER_012 )
2819*cdf0e10cSrcweir         return;
2820*cdf0e10cSrcweir 
2821*cdf0e10cSrcweir     Reference< XAnnotationAccess > xAnnotationAccess( xDrawPage, UNO_QUERY );
2822*cdf0e10cSrcweir     if( xAnnotationAccess.is() ) try
2823*cdf0e10cSrcweir     {
2824*cdf0e10cSrcweir         Reference< XAnnotationEnumeration > xAnnotationEnumeration( xAnnotationAccess->createAnnotationEnumeration() );
2825*cdf0e10cSrcweir         if( xAnnotationEnumeration.is() && xAnnotationEnumeration->hasMoreElements() )
2826*cdf0e10cSrcweir         {
2827*cdf0e10cSrcweir             OUStringBuffer sStringBuffer;
2828*cdf0e10cSrcweir             do
2829*cdf0e10cSrcweir             {
2830*cdf0e10cSrcweir                 Reference< XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement(), UNO_QUERY_THROW );
2831*cdf0e10cSrcweir 
2832*cdf0e10cSrcweir                 RealPoint2D aPosition( xAnnotation->getPosition() );
2833*cdf0e10cSrcweir 
2834*cdf0e10cSrcweir                	GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast<sal_Int32>( aPosition.X * 100 ) );
2835*cdf0e10cSrcweir             	AddAttribute(XML_NAMESPACE_SVG, XML_X, sStringBuffer.makeStringAndClear());
2836*cdf0e10cSrcweir 
2837*cdf0e10cSrcweir                	GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast<sal_Int32>( aPosition.Y * 100 ) );
2838*cdf0e10cSrcweir             	AddAttribute(XML_NAMESPACE_SVG, XML_Y, sStringBuffer.makeStringAndClear());
2839*cdf0e10cSrcweir 
2840*cdf0e10cSrcweir                 RealSize2D aSize( xAnnotation->getSize() );
2841*cdf0e10cSrcweir 
2842*cdf0e10cSrcweir                 if( aSize.Width || aSize.Height )
2843*cdf0e10cSrcweir                 {
2844*cdf0e10cSrcweir                    	GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast<sal_Int32>( aSize.Width * 100 ) );
2845*cdf0e10cSrcweir                 	AddAttribute(XML_NAMESPACE_SVG, XML_WIDTH, sStringBuffer.makeStringAndClear());
2846*cdf0e10cSrcweir                    	GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast<sal_Int32>( aSize.Height * 100 ) );
2847*cdf0e10cSrcweir                 	AddAttribute(XML_NAMESPACE_SVG, XML_HEIGHT, sStringBuffer.makeStringAndClear());
2848*cdf0e10cSrcweir                 }
2849*cdf0e10cSrcweir 
2850*cdf0e10cSrcweir                 // annotation element + content
2851*cdf0e10cSrcweir                 SvXMLElementExport aElem(*this, XML_NAMESPACE_OFFICE_EXT, XML_ANNOTATION, sal_False, sal_True);
2852*cdf0e10cSrcweir 
2853*cdf0e10cSrcweir                 // author
2854*cdf0e10cSrcweir                 OUString aAuthor( xAnnotation->getAuthor() );
2855*cdf0e10cSrcweir                 if( aAuthor.getLength() )
2856*cdf0e10cSrcweir                 {
2857*cdf0e10cSrcweir 	                SvXMLElementExport aCreatorElem( *this, XML_NAMESPACE_DC, XML_CREATOR, sal_True, sal_False );
2858*cdf0e10cSrcweir 	                this->Characters(aAuthor);
2859*cdf0e10cSrcweir                 }
2860*cdf0e10cSrcweir 
2861*cdf0e10cSrcweir 				{
2862*cdf0e10cSrcweir 					// date time
2863*cdf0e10cSrcweir 					DateTime aDate( xAnnotation->getDateTime() );
2864*cdf0e10cSrcweir 					GetMM100UnitConverter().convertDateTime(sStringBuffer, aDate, sal_True);
2865*cdf0e10cSrcweir 					SvXMLElementExport aDateElem( *this, XML_NAMESPACE_DC, XML_DATE, sal_True, sal_False );
2866*cdf0e10cSrcweir 					Characters(sStringBuffer.makeStringAndClear());
2867*cdf0e10cSrcweir 				}
2868*cdf0e10cSrcweir 
2869*cdf0e10cSrcweir                 com::sun::star::uno::Reference < com::sun::star::text::XText > xText( xAnnotation->getTextRange() );
2870*cdf0e10cSrcweir                 if( xText.is() )
2871*cdf0e10cSrcweir 	                this->GetTextParagraphExport()->exportText( xText );
2872*cdf0e10cSrcweir             }
2873*cdf0e10cSrcweir             while( xAnnotationEnumeration->hasMoreElements() );
2874*cdf0e10cSrcweir         }
2875*cdf0e10cSrcweir     }
2876*cdf0e10cSrcweir     catch( Exception& )
2877*cdf0e10cSrcweir     {
2878*cdf0e10cSrcweir         DBG_ERROR("SdXMLExport::exportAnnotations(), exception caught during export of annotations");
2879*cdf0e10cSrcweir     }
2880*cdf0e10cSrcweir }
2881*cdf0e10cSrcweir 
2882*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
2883*cdf0e10cSrcweir 
2884*cdf0e10cSrcweir #define SERVICE( classname, servicename, implementationname, draw, flags )\
2885*cdf0e10cSrcweir uno::Sequence< OUString > SAL_CALL classname##_getSupportedServiceNames() throw()\
2886*cdf0e10cSrcweir {\
2887*cdf0e10cSrcweir 	const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( servicename ) );\
2888*cdf0e10cSrcweir 	const uno::Sequence< OUString > aSeq( &aServiceName, 1 );\
2889*cdf0e10cSrcweir 	return aSeq;\
2890*cdf0e10cSrcweir }\
2891*cdf0e10cSrcweir OUString SAL_CALL classname##_getImplementationName() throw()\
2892*cdf0e10cSrcweir {\
2893*cdf0e10cSrcweir 	return OUString( RTL_CONSTASCII_USTRINGPARAM( implementationname ) );\
2894*cdf0e10cSrcweir }\
2895*cdf0e10cSrcweir uno::Reference< uno::XInterface > SAL_CALL classname##_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )\
2896*cdf0e10cSrcweir {\
2897*cdf0e10cSrcweir 	return (cppu::OWeakObject*)new SdXMLExport( rSMgr, draw, flags );\
2898*cdf0e10cSrcweir }
2899*cdf0e10cSrcweir 
2900*cdf0e10cSrcweir SERVICE( XMLImpressExportOasis, "com.sun.star.comp.Impress.XMLOasisExporter", "XMLImpressExportOasis", sal_False, EXPORT_OASIS|EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED );
2901*cdf0e10cSrcweir SERVICE( XMLImpressStylesExportOasis, "com.sun.star.comp.Impress.XMLOasisStylesExporter", "XMLImpressStylesExportOasis", sal_False, EXPORT_OASIS|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES );
2902*cdf0e10cSrcweir SERVICE( XMLImpressContentExportOasis, "com.sun.star.comp.Impress.XMLOasisContentExporter", "XMLImpressContentExportOasis", sal_False, EXPORT_OASIS|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS );
2903*cdf0e10cSrcweir SERVICE( XMLImpressMetaExportOasis, "com.sun.star.comp.Impress.XMLOasisMetaExporter", "XMLImpressMetaExportOasis", sal_False, EXPORT_OASIS|EXPORT_META );
2904*cdf0e10cSrcweir SERVICE( XMLImpressSettingsExportOasis, "com.sun.star.comp.Impress.XMLOasisSettingsExporter", "XMLImpressSettingsExportOasis", sal_False, EXPORT_OASIS|EXPORT_SETTINGS );
2905*cdf0e10cSrcweir 
2906*cdf0e10cSrcweir SERVICE( XMLImpressExportOOO, "com.sun.star.comp.Impress.XMLExporter", "XMLImpressExportOOO", sal_False, EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED );
2907*cdf0e10cSrcweir SERVICE( XMLImpressStylesExportOOO, "com.sun.star.comp.Impress.XMLStylesExporter", "XMLImpressStylesExportOOO", sal_False, EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES );
2908*cdf0e10cSrcweir SERVICE( XMLImpressContentExportOOO, "com.sun.star.comp.Impress.XMLContentExporter", "XMLImpressContentExportOOO", sal_False, EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS );
2909*cdf0e10cSrcweir SERVICE( XMLImpressMetaExportOOO, "com.sun.star.comp.Impress.XMLMetaExporter", "XMLImpressMetaExportOOO", sal_False, EXPORT_META );
2910*cdf0e10cSrcweir SERVICE( XMLImpressSettingsExportOOO, "com.sun.star.comp.Impress.XMLSettingsExporter", "XMLImpressSettingsExportOOO", sal_False, EXPORT_SETTINGS );
2911*cdf0e10cSrcweir 
2912*cdf0e10cSrcweir SERVICE( XMLDrawExportOasis, "com.sun.star.comp.Draw.XMLOasisExporter", "XMLDrawExportOasis", sal_True, EXPORT_OASIS|EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED );
2913*cdf0e10cSrcweir SERVICE( XMLDrawStylesExportOasis, "com.sun.star.comp.Draw.XMLOasisStylesExporter", "XMLDrawStylesExportOasis", sal_True, EXPORT_OASIS|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES );
2914*cdf0e10cSrcweir SERVICE( XMLDrawContentExportOasis, "com.sun.star.comp.Draw.XMLOasisContentExporter", "XMLDrawContentExportOasis", sal_True, EXPORT_OASIS|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS );
2915*cdf0e10cSrcweir SERVICE( XMLDrawMetaExportOasis, "com.sun.star.comp.Draw.XMLOasisMetaExporter", "XMLDrawMetaExportOasis", sal_True, EXPORT_OASIS|EXPORT_META );
2916*cdf0e10cSrcweir SERVICE( XMLDrawSettingsExportOasis, "com.sun.star.comp.Draw.XMLOasisSettingsExporter", "XMLDrawSettingsExportOasis", sal_True, EXPORT_OASIS|EXPORT_SETTINGS );
2917*cdf0e10cSrcweir 
2918*cdf0e10cSrcweir SERVICE( XMLDrawExportOOO, "com.sun.star.comp.Draw.XMLExporter", "XMLDrawExportOOO", sal_True, EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED );
2919*cdf0e10cSrcweir SERVICE( XMLDrawStylesExportOOO, "com.sun.star.comp.Draw.XMLStylesExporter", "XMLDrawStylesExportOOO", sal_True, EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES );
2920*cdf0e10cSrcweir SERVICE( XMLDrawContentExportOOO, "com.sun.star.comp.Draw.XMLContentExporter", "XMLDrawContentExportOOO", sal_True, EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS );
2921*cdf0e10cSrcweir SERVICE( XMLDrawMetaExportOOO, "com.sun.star.comp.Draw.XMLMetaExporter", "XMLDrawMetaExportOOO", sal_True, EXPORT_META );
2922*cdf0e10cSrcweir SERVICE( XMLDrawSettingsExportOOO, "com.sun.star.comp.Draw.XMLSettingsExporter", "XMLDrawSettingsExportOOO", sal_True, EXPORT_SETTINGS );
2923*cdf0e10cSrcweir 
2924*cdf0e10cSrcweir SERVICE( XMLDrawingLayerExport, "com.sun.star.comp.DrawingLayer.XMLExporter", "XMLDrawingLayerExport", sal_True, EXPORT_OASIS|EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_FONTDECLS|EXPORT_EMBEDDED );
2925*cdf0e10cSrcweir SERVICE( XMLImpressClipboardExport, "com.sun.star.comp.Impress.XMLClipboardExporter", "XMLImpressClipboardExport", sal_False, EXPORT_OASIS|EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_FONTDECLS|EXPORT_EMBEDDED );
2926*cdf0e10cSrcweir 
2927*cdf0e10cSrcweir // XServiceInfo
2928*cdf0e10cSrcweir OUString SAL_CALL SdXMLExport::getImplementationName() throw( uno::RuntimeException )
2929*cdf0e10cSrcweir {
2930*cdf0e10cSrcweir     if( IsDraw())
2931*cdf0e10cSrcweir     {
2932*cdf0e10cSrcweir         // Draw
2933*cdf0e10cSrcweir 
2934*cdf0e10cSrcweir         switch( getExportFlags())
2935*cdf0e10cSrcweir         {
2936*cdf0e10cSrcweir             case EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED:
2937*cdf0e10cSrcweir                 return XMLDrawExportOOO_getImplementationName();
2938*cdf0e10cSrcweir             case EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES:
2939*cdf0e10cSrcweir                 return XMLDrawStylesExportOOO_getImplementationName();
2940*cdf0e10cSrcweir             case EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS:
2941*cdf0e10cSrcweir                 return XMLDrawContentExportOOO_getImplementationName();
2942*cdf0e10cSrcweir             case EXPORT_META:
2943*cdf0e10cSrcweir                 return XMLDrawMetaExportOOO_getImplementationName();
2944*cdf0e10cSrcweir             case EXPORT_SETTINGS:
2945*cdf0e10cSrcweir                 return XMLDrawSettingsExportOOO_getImplementationName();
2946*cdf0e10cSrcweir 
2947*cdf0e10cSrcweir 			case EXPORT_OASIS|EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED:
2948*cdf0e10cSrcweir                 return XMLDrawExportOasis_getImplementationName();
2949*cdf0e10cSrcweir             case EXPORT_OASIS|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES:
2950*cdf0e10cSrcweir                 return XMLDrawStylesExportOasis_getImplementationName();
2951*cdf0e10cSrcweir             case EXPORT_OASIS|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS:
2952*cdf0e10cSrcweir                 return XMLDrawContentExportOasis_getImplementationName();
2953*cdf0e10cSrcweir             case EXPORT_OASIS|EXPORT_META:
2954*cdf0e10cSrcweir                 return XMLDrawMetaExportOasis_getImplementationName();
2955*cdf0e10cSrcweir             case EXPORT_OASIS|EXPORT_SETTINGS:
2956*cdf0e10cSrcweir                 return XMLDrawSettingsExportOasis_getImplementationName();
2957*cdf0e10cSrcweir 
2958*cdf0e10cSrcweir 			default:
2959*cdf0e10cSrcweir                 return XMLDrawExportOOO_getImplementationName();
2960*cdf0e10cSrcweir         }
2961*cdf0e10cSrcweir     }
2962*cdf0e10cSrcweir     else
2963*cdf0e10cSrcweir     {
2964*cdf0e10cSrcweir         // Impress
2965*cdf0e10cSrcweir 
2966*cdf0e10cSrcweir         switch( getExportFlags())
2967*cdf0e10cSrcweir         {
2968*cdf0e10cSrcweir             case EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED:
2969*cdf0e10cSrcweir                 return XMLImpressExportOOO_getImplementationName();
2970*cdf0e10cSrcweir             case EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES:
2971*cdf0e10cSrcweir                 return XMLImpressStylesExportOOO_getImplementationName();
2972*cdf0e10cSrcweir             case EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS:
2973*cdf0e10cSrcweir                 return XMLImpressContentExportOOO_getImplementationName();
2974*cdf0e10cSrcweir             case EXPORT_META:
2975*cdf0e10cSrcweir                 return XMLImpressMetaExportOOO_getImplementationName();
2976*cdf0e10cSrcweir             case EXPORT_SETTINGS:
2977*cdf0e10cSrcweir                 return XMLImpressSettingsExportOOO_getImplementationName();
2978*cdf0e10cSrcweir             case EXPORT_OASIS|EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED:
2979*cdf0e10cSrcweir                 return XMLImpressExportOasis_getImplementationName();
2980*cdf0e10cSrcweir             case EXPORT_OASIS|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES:
2981*cdf0e10cSrcweir                 return XMLImpressStylesExportOasis_getImplementationName();
2982*cdf0e10cSrcweir             case EXPORT_OASIS|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS:
2983*cdf0e10cSrcweir                 return XMLImpressContentExportOasis_getImplementationName();
2984*cdf0e10cSrcweir             case EXPORT_OASIS|EXPORT_META:
2985*cdf0e10cSrcweir                 return XMLImpressMetaExportOasis_getImplementationName();
2986*cdf0e10cSrcweir             case EXPORT_OASIS|EXPORT_SETTINGS:
2987*cdf0e10cSrcweir                 return XMLImpressSettingsExportOasis_getImplementationName();
2988*cdf0e10cSrcweir 
2989*cdf0e10cSrcweir 			default:
2990*cdf0e10cSrcweir                 return XMLImpressExportOOO_getImplementationName();
2991*cdf0e10cSrcweir         }
2992*cdf0e10cSrcweir     }
2993*cdf0e10cSrcweir }
2994