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