1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sdxmlexp.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_xmloff.hxx"
33 #include "unointerfacetouniqueidentifiermapper.hxx"
34 #include <xmloff/nmspmap.hxx>
35 #include "xmlnmspe.hxx"
36 #include <xmloff/xmluconv.hxx>
37 #include <xmloff/xmltoken.hxx>
38 #include <xmloff/xmlmetae.hxx>
39 #include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
40 #include <com/sun/star/presentation/XPresentationSupplier.hpp>
41 #include <com/sun/star/presentation/XCustomPresentationSupplier.hpp>
42 #include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
43 #include <com/sun/star/lang/Locale.hpp>
44 #include <com/sun/star/uno/Any.hxx>
45 #include "sdxmlexp_impl.hxx"
46 #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
47 #include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
48 #include <com/sun/star/presentation/XHandoutMasterSupplier.hpp>
49 #include <com/sun/star/container/XIndexContainer.hpp>
50 #include <com/sun/star/view/PaperOrientation.hpp>
51 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
52 #include <com/sun/star/style/XStyle.hpp>
54 #ifndef _COM_SUN_STAR_FORM_XFORMSUPPLIER2_HPP_
55 #include <com/sun/star/form/XFormsSupplier2.hpp>
57 #include <com/sun/star/presentation/XPresentationPage.hpp>
58 #include <com/sun/star/drawing/XMasterPageTarget.hpp>
59 #include <com/sun/star/text/XText.hpp>
60 #include <com/sun/star/chart/XChartDocument.hpp>
61 #include <com/sun/star/animations/XAnimationNodeSupplier.hpp>
62 #include <com/sun/star/container/XNamed.hpp>
63 #include <rtl/ustrbuf.hxx>
64 #include <tools/gen.hxx>
65 #include <tools/debug.hxx>
66 #include <xmloff/xmlaustp.hxx>
67 #include <xmloff/families.hxx>
68 #include <xmloff/styleexp.hxx>
69 #include "sdpropls.hxx"
70 #include <xmloff/xmlexppr.hxx>
71 #include <com/sun/star/beans/XPropertyState.hpp>
72 #include "xexptran.hxx"
74 #ifndef _CPPUHELPER_IMPLBASE1_HXX
75 #include <cppuhelper/implbase1.hxx>
77 #include <comphelper/extract.hxx>
78 #include <com/sun/star/lang/XServiceInfo.hpp>
79 #include "PropertySetMerger.hxx"
80 #include "layerexp.hxx"
83 #include "VisAreaExport.hxx"
84 #include "XMLNumberStylesExport.hxx"
85 #include <tools/list.hxx>
86 #include <tools/string.hxx>
88 #include "animationexport.hxx"
90 #include <com/sun/star/document/XDocumentProperties.hpp>
91 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
93 using ::rtl::OUString
;
94 using ::rtl::OUStringBuffer
;
96 using namespace ::com::sun::star
;
97 using namespace ::com::sun::star::uno
;
98 using namespace ::com::sun::star::beans
;
99 using namespace ::com::sun::star::container
;
100 using namespace ::com::sun::star::drawing
;
101 using namespace ::com::sun::star::presentation
;
102 using namespace ::xmloff::token
;
105 //////////////////////////////////////////////////////////////////////////////
107 class ImpXMLEXPPageMasterInfo
109 sal_Int32 mnBorderBottom
;
110 sal_Int32 mnBorderLeft
;
111 sal_Int32 mnBorderRight
;
112 sal_Int32 mnBorderTop
;
115 view::PaperOrientation meOrientation
;
117 OUString msMasterPageName
;
120 ImpXMLEXPPageMasterInfo(const SdXMLExport
& rExp
, const Reference
<XDrawPage
>& xPage
);
121 BOOL
operator==(const ImpXMLEXPPageMasterInfo
& rInfo
) const;
122 void SetName(const OUString
& rStr
);
124 const OUString
& GetName() const { return msName
; }
125 const OUString
& GetMasterPageName() const { return msMasterPageName
; }
127 sal_Int32
GetBorderBottom() const { return mnBorderBottom
; }
128 sal_Int32
GetBorderLeft() const { return mnBorderLeft
; }
129 sal_Int32
GetBorderRight() const { return mnBorderRight
; }
130 sal_Int32
GetBorderTop() const { return mnBorderTop
; }
131 sal_Int32
GetWidth() const { return mnWidth
; }
132 sal_Int32
GetHeight() const { return mnHeight
; }
133 view::PaperOrientation
GetOrientation() const { return meOrientation
; }
136 ImpXMLEXPPageMasterInfo::ImpXMLEXPPageMasterInfo(
137 const SdXMLExport
& rExp
,
138 const Reference
<XDrawPage
>& xPage
)
145 meOrientation(rExp
.IsDraw() ? view::PaperOrientation_PORTRAIT
: view::PaperOrientation_LANDSCAPE
)
147 Reference
<beans::XPropertySet
> xPropSet(xPage
, UNO_QUERY
);
152 Reference
< beans::XPropertySetInfo
> xPropsInfo( xPropSet
->getPropertySetInfo() );
153 if( xPropsInfo
.is() && xPropsInfo
->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderBottom") )))
155 aAny
= xPropSet
->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderBottom")));
156 aAny
>>= mnBorderBottom
;
158 aAny
= xPropSet
->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderLeft")));
159 aAny
>>= mnBorderLeft
;
161 aAny
= xPropSet
->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderRight")));
162 aAny
>>= mnBorderRight
;
164 aAny
= xPropSet
->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderTop")));
165 aAny
>>= mnBorderTop
;
168 if( xPropsInfo
.is() && xPropsInfo
->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("Width") )))
170 aAny
= xPropSet
->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Width")));
173 aAny
= xPropSet
->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Height")));
177 if( xPropsInfo
.is() && xPropsInfo
->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("Orientation") )))
179 aAny
= xPropSet
->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Orientation")));
180 aAny
>>= meOrientation
;
184 Reference
<container::XNamed
> xMasterNamed(xPage
, UNO_QUERY
);
185 if(xMasterNamed
.is())
187 msMasterPageName
= xMasterNamed
->getName();
191 BOOL
ImpXMLEXPPageMasterInfo::operator==(const ImpXMLEXPPageMasterInfo
& rInfo
) const
193 return ((mnBorderBottom
== rInfo
.mnBorderBottom
)
194 && (mnBorderLeft
== rInfo
.mnBorderLeft
)
195 && (mnBorderRight
== rInfo
.mnBorderRight
)
196 && (mnBorderTop
== rInfo
.mnBorderTop
)
197 && (mnWidth
== rInfo
.mnWidth
)
198 && (mnHeight
== rInfo
.mnHeight
)
199 && (meOrientation
== rInfo
.meOrientation
));
202 void ImpXMLEXPPageMasterInfo::SetName(const OUString
& rStr
)
207 DECLARE_LIST(ImpXMLEXPPageMasterList
, ImpXMLEXPPageMasterInfo
*)
209 //////////////////////////////////////////////////////////////////////////////
211 #define IMP_AUTOLAYOUT_INFO_MAX (35L)
213 class ImpXMLAutoLayoutInfo
216 ImpXMLEXPPageMasterInfo
* mpPageMasterInfo
;
217 OUString msLayoutName
;
218 Rectangle maTitleRect
;
219 Rectangle maPresRect
;
224 ImpXMLAutoLayoutInfo(sal_uInt16 nTyp
, ImpXMLEXPPageMasterInfo
* pInf
);
226 BOOL
operator==(const ImpXMLAutoLayoutInfo
& rInfo
) const;
228 sal_uInt16
GetLayoutType() const { return mnType
; }
229 sal_Int32
GetGapX() const { return mnGapX
; }
230 sal_Int32
GetGapY() const { return mnGapY
; }
232 const OUString
& GetLayoutName() const { return msLayoutName
; }
233 void SetLayoutName(const OUString
& rNew
) { msLayoutName
= rNew
; }
235 const Rectangle
& GetTitleRectangle() const { return maTitleRect
; }
236 const Rectangle
& GetPresRectangle() const { return maPresRect
; }
238 static BOOL
IsCreateNecessary(sal_uInt16 nTyp
);
241 BOOL
ImpXMLAutoLayoutInfo::IsCreateNecessary(sal_uInt16 nTyp
)
243 if(nTyp
== 5 /* AUTOLAYOUT_ORG */
244 || nTyp
== 20 /* AUTOLAYOUT_NONE */
245 || nTyp
>= IMP_AUTOLAYOUT_INFO_MAX
)
250 BOOL
ImpXMLAutoLayoutInfo::operator==(const ImpXMLAutoLayoutInfo
& rInfo
) const
252 return ((mnType
== rInfo
.mnType
253 && mpPageMasterInfo
== rInfo
.mpPageMasterInfo
));
256 ImpXMLAutoLayoutInfo::ImpXMLAutoLayoutInfo(sal_uInt16 nTyp
, ImpXMLEXPPageMasterInfo
* pInf
)
258 mpPageMasterInfo(pInf
)
260 // create full info (initialze with typical values)
262 Size
aPageSize(28000, 21000);
263 Size
aPageInnerSize(28000, 21000);
267 aPagePos
= Point(mpPageMasterInfo
->GetBorderLeft(), mpPageMasterInfo
->GetBorderTop());
268 aPageSize
= Size(mpPageMasterInfo
->GetWidth(), mpPageMasterInfo
->GetHeight());
269 aPageInnerSize
= aPageSize
;
270 aPageInnerSize
.Width() -= mpPageMasterInfo
->GetBorderLeft() + mpPageMasterInfo
->GetBorderRight();
271 aPageInnerSize
.Height() -= mpPageMasterInfo
->GetBorderTop() + mpPageMasterInfo
->GetBorderBottom();
274 // title rectangle aligning
275 Point
aTitlePos(aPagePos
);
276 Size
aTitleSize(aPageInnerSize
);
278 if(mnType
== 21 /* AUTOLAYOUT_NOTES */)
280 aTitleSize
.Height() = (long) (aTitleSize
.Height() / 2.5);
281 Point aPos
= aTitlePos
;
282 aPos
.Y() += long( aTitleSize
.Height() * 0.083 );
283 Size aPartArea
= aTitleSize
;
286 // tatsaechliche Seitengroesse in das Handout-Rechteck skalieren
287 double fH
= (double) aPartArea
.Width() / aPageSize
.Width();
288 double fV
= (double) aPartArea
.Height() / aPageSize
.Height();
292 aSize
.Width() = (long) (fH
* aPageSize
.Width());
293 aSize
.Height() = (long) (fH
* aPageSize
.Height());
295 aPos
.X() += (aPartArea
.Width() - aSize
.Width()) / 2;
296 aPos
.Y() += (aPartArea
.Height()- aSize
.Height())/ 2;
301 else if(mnType
== 27 || mnType
== 28)
303 // AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART or
304 // AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE
306 aTitlePos
.X() + long( aTitleSize
.Width() * 0.0735 ),
307 aTitlePos
.Y() + long( aTitleSize
.Height() * 0.083 ));
309 long( aTitleSize
.Width() * 0.854 ),
310 long( aTitleSize
.Height() * 0.167 ));
311 Point
aLPos(aPagePos
);
312 Size
aLSize(aPageInnerSize
);
314 aLPos
.X() + long( aLSize
.Width() * 0.0735 ),
315 aLPos
.Y() + long( aLSize
.Height() * 0.472 ));
317 long( aLSize
.Width() * 0.854 ),
318 long( aLSize
.Height() * 0.444 ));
320 aTitlePos
.X() = (aClassicTPos
.X() + aClassicTSize
.Width()) - aClassicTSize
.Height();
321 aTitlePos
.Y() = aClassicTPos
.Y();
322 aTitleSize
.Width() = aClassicTSize
.Height();
323 aTitleSize
.Height() = (aClassicLPos
.Y() + aClassicLSize
.Height()) - aClassicTPos
.Y();
327 aTitlePos
.X() += long( aTitleSize
.Width() * 0.0735 );
328 aTitlePos
.Y() += long( aTitleSize
.Height() * 0.083 );
329 aTitleSize
.Width() = long( aTitleSize
.Width() * 0.854 );
330 aTitleSize
.Height() = long( aTitleSize
.Height() * 0.167 );
333 maTitleRect
.SetPos(aTitlePos
);
334 maTitleRect
.SetSize(aTitleSize
);
336 // layout rectangle aligning
337 Point
aLayoutPos(aPagePos
);
338 Size
aLayoutSize(aPageInnerSize
);
340 if(mnType
== 21 /* AUTOLAYOUT_NOTES */)
342 aLayoutPos
.X() += long( aLayoutSize
.Width() * 0.0735 );
343 aLayoutPos
.Y() += long( aLayoutSize
.Height() * 0.472 );
344 aLayoutSize
.Width() = long( aLayoutSize
.Width() * 0.854 );
345 aLayoutSize
.Height() = long( aLayoutSize
.Height() * 0.444 );
347 else if((mnType
>= 22 && mnType
<= 26) || (mnType
== 31)) // AUTOLAYOUT_HANDOUT
349 // keep info for inner area in maPresRect, put info for gap size
350 // to maTitleRect position
351 mnGapX
= (aPageSize
.Width() - aPageInnerSize
.Width()) / 2;
352 mnGapY
= (aPageSize
.Height() - aPageInnerSize
.Height()) / 2;
355 mnGapX
= aPageSize
.Width() / 10;
358 mnGapY
= aPageSize
.Height() / 10;
360 if(mnGapX
< aPageInnerSize
.Width() / 10)
361 mnGapX
= aPageInnerSize
.Width() / 10;
363 if(mnGapY
< aPageInnerSize
.Height() / 10)
364 mnGapY
= aPageInnerSize
.Height() / 10;
366 else if(mnType
== 27 || mnType
== 28)
368 // AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART or
369 // AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE
371 aTitlePos
.X() + long( aTitleSize
.Width() * 0.0735 ),
372 aTitlePos
.Y() + long( aTitleSize
.Height() * 0.083 ));
374 long( aTitleSize
.Width() * 0.854 ),
375 long( aTitleSize
.Height() * 0.167 ));
377 aLayoutPos
.X() + long( aLayoutSize
.Width() * 0.0735 ),
378 aLayoutPos
.Y() + long( aLayoutSize
.Height() * 0.472 ));
380 long( aLayoutSize
.Width() * 0.854 ),
381 long( aLayoutSize
.Height() * 0.444 ));
383 aLayoutPos
.X() = aClassicLPos
.X();
384 aLayoutPos
.Y() = aClassicTPos
.Y();
385 aLayoutSize
.Width() = (aClassicLPos
.X() + aClassicLSize
.Width())
386 - (aClassicTSize
.Height() + (aClassicLPos
.Y() - (aClassicTPos
.Y() + aClassicTSize
.Height())));
387 aLayoutSize
.Height() = (aClassicLPos
.Y() + aClassicLSize
.Height()) - aClassicTPos
.Y();
389 else if( mnType
== 32 )
391 // AUTOLAYOUT_ONLY_TEXT
392 aLayoutPos
= aTitlePos
;
393 aLayoutSize
.Width() = aTitleSize
.Width();
394 aLayoutSize
.Height() = long( aLayoutSize
.Height() * 0.825 );
398 aLayoutPos
.X() += long( aLayoutSize
.Width() * 0.0735 );
399 aLayoutPos
.Y() += long( aLayoutSize
.Height() * 0.278 );
400 aLayoutSize
.Width() = long( aLayoutSize
.Width() * 0.854 );
401 aLayoutSize
.Height() = long( aLayoutSize
.Height() * 0.630 );
404 maPresRect
.SetPos(aLayoutPos
);
405 maPresRect
.SetSize(aLayoutSize
);
408 DECLARE_LIST(ImpXMLAutoLayoutInfoList
, ImpXMLAutoLayoutInfo
*)
410 //////////////////////////////////////////////////////////////////////////////
413 SdXMLExport::SdXMLExport(
414 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xServiceFactory
,
415 sal_Bool bIsDraw
, sal_uInt16 nExportFlags
)
416 : SvXMLExport( xServiceFactory
, MAP_CM
, bIsDraw
? XML_DRAWING
: XML_PRESENTATION
, nExportFlags
),
417 mnDocMasterPageCount(0L),
418 mnDocDrawPageCount(0L),
419 mnShapeStyleInfoIndex(0L),
421 mpPageMasterInfoList(new ImpXMLEXPPageMasterList(1, 4, 4)),
422 mpPageMasterUsageList(new ImpXMLEXPPageMasterList(1, 4, 4)),
423 mpNotesPageMasterUsageList(new ImpXMLEXPPageMasterList(1, 4, 4)),
424 mpHandoutPageMaster(NULL
),
425 mpAutoLayoutInfoList(new ImpXMLAutoLayoutInfoList(1, 4, 4)),
426 mpSdPropHdlFactory(0L),
427 mpPropertySetMapper(0L),
428 mpPresPagePropsMapper(0L),
430 mbFamilyGraphicUsed(FALSE
),
431 mbFamilyPresentationUsed(FALSE
),
432 msZIndex( GetXMLToken(XML_ZINDEX
) ),
433 msEmptyPres( RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ),
434 msModel( RTL_CONSTASCII_USTRINGPARAM("Model") ),
435 msStartShape( RTL_CONSTASCII_USTRINGPARAM("StartShape") ),
436 msEndShape( RTL_CONSTASCII_USTRINGPARAM("EndShape") ),
437 msPageLayoutNames( RTL_CONSTASCII_USTRINGPARAM("PageLayoutNames") )
444 void SAL_CALL
SdXMLExport::setSourceDocument( const Reference
< lang::XComponent
>& xDoc
)
445 throw(lang::IllegalArgumentException
, uno::RuntimeException
)
447 SvXMLExport::setSourceDocument( xDoc
);
449 const OUString aEmpty
;
451 // prepare factory parts
452 mpSdPropHdlFactory
= new XMLSdPropHdlFactory( GetModel(), *this );
453 if(mpSdPropHdlFactory
)
455 // set lock to avoid deletion
456 mpSdPropHdlFactory
->acquire();
459 const UniReference
< XMLPropertyHandlerFactory
> aFactoryRef
= mpSdPropHdlFactory
;
461 // construct PropertySetMapper
462 UniReference
< XMLPropertySetMapper
> xMapper
= new XMLShapePropertySetMapper( aFactoryRef
);
464 mpPropertySetMapper
= new XMLShapeExportPropertyMapper( xMapper
, (XMLTextListAutoStylePool
*)&GetTextParagraphExport()->GetListAutoStylePool(), *this );
465 // set lock to avoid deletion
466 mpPropertySetMapper
->acquire();
468 // chain text attributes
469 mpPropertySetMapper
->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(*this));
471 // construct PresPagePropsMapper
472 xMapper
= new XMLPropertySetMapper((XMLPropertyMapEntry
*)aXMLSDPresPageProps
, aFactoryRef
);
474 mpPresPagePropsMapper
= new XMLPageExportPropertyMapper( xMapper
, *this );
475 if(mpPresPagePropsMapper
)
477 // set lock to avoid deletion
478 mpPresPagePropsMapper
->acquire();
483 GetAutoStylePool()->AddFamily(
484 XML_STYLE_FAMILY_SD_GRAPHICS_ID
,
485 OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME
)),
486 GetPropertySetMapper(),
487 OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_PREFIX
)));
488 GetAutoStylePool()->AddFamily(
489 XML_STYLE_FAMILY_SD_PRESENTATION_ID
,
490 OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_NAME
)),
491 GetPropertySetMapper(),
492 OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_PREFIX
)));
493 GetAutoStylePool()->AddFamily(
494 XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID
,
495 OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME
)),
496 GetPresPagePropsMapper(),
497 OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_DRAWINGPAGE_PREFIX
)));
498 // prepare access to styles
499 Reference
< style::XStyleFamiliesSupplier
> xFamSup( GetModel(), UNO_QUERY
);
502 mxDocStyleFamilies
= xFamSup
->getStyleFamilies();
505 // prepare access to master pages
506 Reference
< drawing::XMasterPagesSupplier
> xMasterPagesSupplier(GetModel(), UNO_QUERY
);
507 if(xMasterPagesSupplier
.is())
509 mxDocMasterPages
= mxDocMasterPages
.query( xMasterPagesSupplier
->getMasterPages() );
510 if(mxDocMasterPages
.is())
512 mnDocMasterPageCount
= mxDocMasterPages
->getCount();
513 maMasterPagesStyleNames
.insert( maMasterPagesStyleNames
.begin(), mnDocMasterPageCount
, aEmpty
);
517 // prepare access to draw pages
518 Reference
<XDrawPagesSupplier
> xDrawPagesSupplier(GetModel(), UNO_QUERY
);
519 if(xDrawPagesSupplier
.is())
521 mxDocDrawPages
= mxDocDrawPages
.query( xDrawPagesSupplier
->getDrawPages() );
522 if(mxDocDrawPages
.is())
524 mnDocDrawPageCount
= mxDocDrawPages
->getCount();
525 maDrawPagesStyleNames
.insert( maDrawPagesStyleNames
.begin(), mnDocDrawPageCount
, aEmpty
);
526 maDrawNotesPagesStyleNames
.insert( maDrawNotesPagesStyleNames
.begin(), mnDocDrawPageCount
, aEmpty
);
528 maDrawPagesAutoLayoutNames
.realloc( mnDocDrawPageCount
+ 1 );
530 HeaderFooterPageSettingsImpl aEmptySettings
;
531 maDrawPagesHeaderFooterSettings
.insert( maDrawPagesHeaderFooterSettings
.begin(), mnDocDrawPageCount
, aEmptySettings
);
532 maDrawNotesPagesHeaderFooterSettings
.insert( maDrawNotesPagesHeaderFooterSettings
.begin(), mnDocDrawPageCount
, aEmptySettings
);
536 // #82003# count all draw objects for use with progress bar.
537 // #88245# init mnObjectCount once, use counter itself as flag. It
538 // is initialized to 0.
543 // #91587# add handout master count
544 Reference
<presentation::XHandoutMasterSupplier
> xHandoutSupp(GetModel(), UNO_QUERY
);
545 if(xHandoutSupp
.is())
547 Reference
<XDrawPage
> xHandoutPage(xHandoutSupp
->getHandoutMasterPage());
548 if(xHandoutPage
.is())
550 Reference
<drawing::XShapes
> xShapes(xHandoutPage
, UNO_QUERY
);
551 if(xShapes
.is() && xShapes
->getCount())
553 mnObjectCount
+= ImpRecursiveObjectCount(xShapes
);
559 if(mxDocMasterPages
.is())
561 for(sal_Int32
a(0); a
< mnDocMasterPageCount
; a
++)
563 Any
aAny(mxDocMasterPages
->getByIndex(a
));
564 Reference
< drawing::XShapes
> xMasterPage
;
566 if((aAny
>>= xMasterPage
) && xMasterPage
.is())
568 mnObjectCount
+= ImpRecursiveObjectCount(xMasterPage
);
573 // #91587# take notes pages from master pages into account
574 Reference
<presentation::XPresentationPage
> xPresPage
;
575 if((aAny
>>= xPresPage
) && xPresPage
.is())
577 Reference
<XDrawPage
> xNotesPage(xPresPage
->getNotesPage());
580 Reference
<drawing::XShapes
> xShapes(xNotesPage
, UNO_QUERY
);
581 if(xShapes
.is() && xShapes
->getCount())
583 mnObjectCount
+= ImpRecursiveObjectCount(xShapes
);
591 if(mxDocDrawPages
.is())
593 for(sal_Int32
a(0); a
< mnDocDrawPageCount
; a
++)
595 Any
aAny(mxDocDrawPages
->getByIndex(a
));
596 Reference
< drawing::XShapes
> xPage
;
598 if((aAny
>>= xPage
) && xPage
.is())
600 mnObjectCount
+= ImpRecursiveObjectCount(xPage
);
605 // #91587# take notes pages from draw pages into account
606 Reference
<presentation::XPresentationPage
> xPresPage
;
607 if((aAny
>>= xPresPage
) && xPresPage
.is())
609 Reference
<XDrawPage
> xNotesPage(xPresPage
->getNotesPage());
612 Reference
<drawing::XShapes
> xShapes(xNotesPage
, UNO_QUERY
);
613 if(xShapes
.is() && xShapes
->getCount())
615 mnObjectCount
+= ImpRecursiveObjectCount(xShapes
);
623 // #82003# init progress bar
624 GetProgressBarHelper()->SetReference(mnObjectCount
);
628 _GetNamespaceMap().Add(
629 GetXMLToken(XML_NP_PRESENTATION
),
630 GetXMLToken(XML_N_PRESENTATION
),
631 XML_NAMESPACE_PRESENTATION
);
633 _GetNamespaceMap().Add(
634 GetXMLToken(XML_NP_SMIL
),
635 GetXMLToken(XML_N_SMIL_COMPAT
),
638 _GetNamespaceMap().Add(
639 GetXMLToken(XML_NP_ANIMATION
),
640 GetXMLToken(XML_N_ANIMATION
),
641 XML_NAMESPACE_ANIMATION
);
643 GetShapeExport()->enableLayerExport();
645 // #88546# enable progress bar increments
646 GetShapeExport()->enableHandleProgressBar();
649 //////////////////////////////////////////////////////////////////////////////
650 // #82003# helper function for recursive object count
651 sal_uInt32
SdXMLExport::ImpRecursiveObjectCount(Reference
< drawing::XShapes
> xShapes
)
653 sal_uInt32
nRetval(0L);
657 sal_Int32 nCount
= xShapes
->getCount();
659 for(sal_Int32
a(0L); a
< nCount
; a
++)
661 Any
aAny(xShapes
->getByIndex(a
));
662 Reference
< drawing::XShapes
> xGroup
;
664 if((aAny
>>= xGroup
) && xGroup
.is())
666 // #93180# count group objects, too.
667 nRetval
+= 1 + ImpRecursiveObjectCount(xGroup
);
679 //////////////////////////////////////////////////////////////////////////////
681 __EXPORT
SdXMLExport::~SdXMLExport()
683 // cleanup factory, decrease refcount. Should lead to destruction.
684 if(mpSdPropHdlFactory
)
686 mpSdPropHdlFactory
->release();
687 mpSdPropHdlFactory
= 0L;
690 // cleanup mapper, decrease refcount. Should lead to destruction.
691 if(mpPropertySetMapper
)
693 mpPropertySetMapper
->release();
694 mpPropertySetMapper
= 0L;
697 // cleanup presPage mapper, decrease refcount. Should lead to destruction.
698 if(mpPresPagePropsMapper
)
700 mpPresPagePropsMapper
->release();
701 mpPresPagePropsMapper
= 0L;
704 // clear evtl. temporary page master infos
705 if(mpPageMasterInfoList
)
707 while(mpPageMasterInfoList
->Count())
708 delete mpPageMasterInfoList
->Remove(mpPageMasterInfoList
->Count() - 1L);
709 delete mpPageMasterInfoList
;
710 mpPageMasterInfoList
= 0L;
712 if(mpPageMasterUsageList
)
714 delete mpPageMasterUsageList
;
715 mpPageMasterUsageList
= 0L;
717 if(mpNotesPageMasterUsageList
)
719 delete mpNotesPageMasterUsageList
;
720 mpNotesPageMasterUsageList
= 0L;
723 // clear auto-layout infos
724 if(mpAutoLayoutInfoList
)
726 while(mpAutoLayoutInfoList
->Count())
727 delete mpAutoLayoutInfoList
->Remove(mpAutoLayoutInfoList
->Count() - 1L);
728 delete mpAutoLayoutInfoList
;
729 mpAutoLayoutInfoList
= 0L;
732 // #82003# status indicator stop is called exclusively
733 // from SdXMLFilter::Export() now.
735 // stop progress view
736 // if(GetStatusIndicator().is())
738 // GetStatusIndicator()->end();
739 // GetStatusIndicator()->reset();
743 //////////////////////////////////////////////////////////////////////////////
744 // to get default values in XPropertySet use this wrapper class
746 class ImpDefaultMapper
: public ::cppu::WeakAggImplHelper1
< beans::XPropertySet
>
748 Reference
< beans::XPropertyState
> mxState
;
749 Reference
< beans::XPropertySet
> mxSet
;
752 ImpDefaultMapper( Reference
< beans::XPropertyState
>& rxState
);
755 virtual Reference
< beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo() throw(uno::RuntimeException
);
756 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const Any
& aValue
) throw(beans::UnknownPropertyException
, beans::PropertyVetoException
, lang::IllegalArgumentException
, lang::WrappedTargetException
, uno::RuntimeException
);
757 virtual Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) throw(beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
);
759 // empty implementations
760 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const Reference
< beans::XPropertyChangeListener
>& xListener
) throw(beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
);
761 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const Reference
< beans::XPropertyChangeListener
>& aListener
) throw(beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
);
762 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
, const Reference
< beans::XVetoableChangeListener
>& aListener
) throw(beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
);
763 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
, const Reference
< beans::XVetoableChangeListener
>& aListener
) throw(beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
);
766 ImpDefaultMapper::ImpDefaultMapper( Reference
< beans::XPropertyState
>& rxState
)
767 : mxState( rxState
),
768 mxSet( rxState
, UNO_QUERY
)
772 Reference
< beans::XPropertySetInfo
> SAL_CALL
ImpDefaultMapper::getPropertySetInfo() throw(uno::RuntimeException
)
774 return mxSet
->getPropertySetInfo();
777 void SAL_CALL
ImpDefaultMapper::setPropertyValue( const OUString
& aPropertyName
, const Any
& /*aValue*/ ) throw(beans::UnknownPropertyException
, beans::PropertyVetoException
, lang::IllegalArgumentException
, lang::WrappedTargetException
, uno::RuntimeException
)
779 mxState
->setPropertyToDefault( aPropertyName
/*, aValue */ );
782 Any SAL_CALL
ImpDefaultMapper::getPropertyValue( const OUString
& PropertyName
) throw(beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
784 return mxState
->getPropertyDefault( PropertyName
);
787 // empty implementations
788 void SAL_CALL
ImpDefaultMapper::addPropertyChangeListener( const OUString
&, const Reference
< beans::XPropertyChangeListener
>& ) throw(beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
) {}
789 void SAL_CALL
ImpDefaultMapper::removePropertyChangeListener( const OUString
&, const Reference
< beans::XPropertyChangeListener
>& ) throw(beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
) {}
790 void SAL_CALL
ImpDefaultMapper::addVetoableChangeListener( const OUString
&, const Reference
< beans::XVetoableChangeListener
>& ) throw(beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
) {}
791 void SAL_CALL
ImpDefaultMapper::removeVetoableChangeListener( const OUString
&, const Reference
< beans::XVetoableChangeListener
>& ) throw(beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
) {}
793 //////////////////////////////////////////////////////////////////////////////
795 /* moved to shapeexport.cxx
796 void SdXMLExport::ImpWriteObjGraphicStyleInfos()
798 XMLStyleExport aStEx(*this, OUString(), GetAutoStylePool().get());
799 const UniReference< SvXMLExportPropertyMapper > aMapperRef( GetPropertySetMapper() );
801 // write graphic family default style
802 Reference< lang::XMultiServiceFactory > xFact( GetModel(), UNO_QUERY );
807 Reference< beans::XPropertySet > xDefaults( xFact->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Defaults") ) ), UNO_QUERY );
810 aStEx.exportDefaultStyle( xDefaults, OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)), aMapperRef );
812 // write graphic family styles
813 aStEx.exportStyleFamily(XML_STYLE_FAMILY_SD_GRAPHICS_NAME, OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)), aMapperRef, FALSE, XML_STYLE_FAMILY_SD_GRAPHICS_ID);
816 catch( lang::ServiceNotRegisteredException& )
822 //////////////////////////////////////////////////////////////////////////////
824 void SdXMLExport::ImpPrepAutoLayoutInfos()
830 Reference
< presentation::XHandoutMasterSupplier
> xHandoutSupp( GetModel(), UNO_QUERY
);
831 if( xHandoutSupp
.is() )
833 Reference
< XDrawPage
> xHandoutPage( xHandoutSupp
->getHandoutMasterPage() );
834 if( xHandoutPage
.is() )
836 if(ImpPrepAutoLayoutInfo(xHandoutPage
, aStr
))
837 maDrawPagesAutoLayoutNames
[0] = aStr
;
841 // prepare name creation
842 for(sal_Int32 nCnt
= 0L; nCnt
< mnDocDrawPageCount
; nCnt
++)
844 Any
aAny(mxDocDrawPages
->getByIndex(nCnt
));
845 Reference
<XDrawPage
> xDrawPage
;
847 if((aAny
>>= xDrawPage
) && xDrawPage
.is())
849 if(ImpPrepAutoLayoutInfo(xDrawPage
, aStr
))
850 maDrawPagesAutoLayoutNames
[nCnt
+1] = aStr
;
856 BOOL
SdXMLExport::ImpPrepAutoLayoutInfo(const Reference
<XDrawPage
>& xPage
, OUString
& rName
)
861 Reference
<beans::XPropertySet
> xPropSet(xPage
, UNO_QUERY
);
864 sal_uInt16 nType
= sal_uInt16();
867 aAny
= xPropSet
->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Layout")));
870 if(ImpXMLAutoLayoutInfo::IsCreateNecessary(nType
))
872 ImpXMLEXPPageMasterInfo
* pInfo
= 0L;
874 // get master-page info
875 Reference
< drawing::XMasterPageTarget
> xMasterPageInt(xPage
, UNO_QUERY
);
876 if(xMasterPageInt
.is())
878 Reference
<XDrawPage
> xUsedMasterPage(xMasterPageInt
->getMasterPage());
879 if(xUsedMasterPage
.is())
881 Reference
< container::XNamed
> xMasterNamed(xUsedMasterPage
, UNO_QUERY
);
882 if(xMasterNamed
.is())
884 OUString sMasterPageName
= xMasterNamed
->getName();
885 pInfo
= ImpGetPageMasterInfoByName(sMasterPageName
);
890 // create entry and look for existance
891 ImpXMLAutoLayoutInfo
* pNew
= new ImpXMLAutoLayoutInfo(nType
, pInfo
);
892 BOOL
bDidExist(FALSE
);
894 for(sal_uInt32 nCnt
= 0L; !bDidExist
&& nCnt
< mpAutoLayoutInfoList
->Count(); nCnt
++)
896 if(*mpAutoLayoutInfoList
->GetObject(nCnt
) == *pNew
)
899 pNew
= mpAutoLayoutInfoList
->GetObject(nCnt
);
906 mpAutoLayoutInfoList
->Insert(pNew
, LIST_APPEND
);
907 OUString sNewName
= OUString(RTL_CONSTASCII_USTRINGPARAM("AL"));
908 sNewName
+= OUString::valueOf(sal_Int32(mpAutoLayoutInfoList
->Count() - 1));
909 sNewName
+= OUString(RTL_CONSTASCII_USTRINGPARAM("T"));
910 sNewName
+= OUString::valueOf(sal_Int32(nType
));
911 pNew
->SetLayoutName(sNewName
);
914 rName
= pNew
->GetLayoutName();
923 //////////////////////////////////////////////////////////////////////////////
925 void SdXMLExport::ImpWriteAutoLayoutInfos()
927 if(mpAutoLayoutInfoList
->Count())
929 for(sal_uInt32 nCnt
= 0L; nCnt
< mpAutoLayoutInfoList
->Count(); nCnt
++)
931 ImpXMLAutoLayoutInfo
* pInfo
= mpAutoLayoutInfoList
->GetObject(nCnt
);
934 // prepare presentation-page layout attributes, style-name
935 AddAttribute(XML_NAMESPACE_STYLE
, XML_NAME
, pInfo
->GetLayoutName());
937 // write draw-style attributes
938 SvXMLElementExport
aDSE(*this, XML_NAMESPACE_STYLE
, XML_PRESENTATION_PAGE_LAYOUT
, sal_True
, sal_True
);
940 // write presentation placeholders
941 switch(pInfo
->GetLayoutType())
943 case 0 : // AUTOLAYOUT_TITLE
945 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
946 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderSubtitle
, pInfo
->GetPresRectangle());
949 case 1 : // AUTOLAYOUT_ENUM
951 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
952 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, pInfo
->GetPresRectangle());
955 case 2 : // AUTOLAYOUT_CHART
957 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
958 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart
, pInfo
->GetPresRectangle());
961 case 3 : // AUTOLAYOUT_2TEXT
963 Rectangle
aLeft(pInfo
->GetPresRectangle());
964 aLeft
.setWidth(long(aLeft
.GetWidth() * 0.488));
965 Rectangle
aRight(aLeft
);
966 aRight
.Left() = long(aRight
.Left() + aRight
.GetWidth() * 1.05);
968 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
969 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aLeft
);
970 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aRight
);
973 case 4 : // AUTOLAYOUT_TEXTCHART
975 Rectangle
aLeft(pInfo
->GetPresRectangle());
976 aLeft
.setWidth(long(aLeft
.GetWidth() * 0.488));
977 Rectangle
aRight(aLeft
);
978 aRight
.Left() = long(aRight
.Left() + aRight
.GetWidth() * 1.05);
980 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
981 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aLeft
);
982 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart
, aRight
);
985 case 6 : // AUTOLAYOUT_TEXTCLIP
987 Rectangle
aLeft(pInfo
->GetPresRectangle());
988 aLeft
.setWidth(long(aLeft
.GetWidth() * 0.488));
989 Rectangle
aRight(aLeft
);
990 aRight
.Left() = long(aRight
.Left() + aRight
.GetWidth() * 1.05);
992 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
993 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aLeft
);
994 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aRight
);
997 case 7 : // AUTOLAYOUT_CHARTTEXT
999 Rectangle
aLeft(pInfo
->GetPresRectangle());
1000 aLeft
.setWidth(long(aLeft
.GetWidth() * 0.488));
1001 Rectangle
aRight(aLeft
);
1002 aRight
.Left() = long(aRight
.Left() + aRight
.GetWidth() * 1.05);
1004 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1005 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart
, aLeft
);
1006 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aRight
);
1009 case 8 : // AUTOLAYOUT_TAB
1011 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1012 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTable
, pInfo
->GetPresRectangle());
1015 case 9 : // AUTOLAYOUT_CLIPTEXT
1017 Rectangle
aLeft(pInfo
->GetPresRectangle());
1018 aLeft
.setWidth(long(aLeft
.GetWidth() * 0.488));
1019 Rectangle
aRight(aLeft
);
1020 aRight
.Left() = long(aRight
.Left() + aRight
.GetWidth() * 1.05);
1022 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1023 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aLeft
);
1024 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aRight
);
1027 case 10 : // AUTOLAYOUT_TEXTOBJ
1029 Rectangle
aLeft(pInfo
->GetPresRectangle());
1030 aLeft
.setWidth(long(aLeft
.GetWidth() * 0.488));
1031 Rectangle
aRight(aLeft
);
1032 aRight
.Left() = long(aRight
.Left() + aRight
.GetWidth() * 1.05);
1034 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1035 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aLeft
);
1036 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aRight
);
1039 case 11 : // AUTOLAYOUT_OBJ
1041 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1042 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, pInfo
->GetPresRectangle());
1045 case 12 : // AUTOLAYOUT_TEXT2OBJ
1047 Rectangle
aLeft(pInfo
->GetPresRectangle());
1048 aLeft
.setWidth(long(aLeft
.GetWidth() * 0.488));
1049 Rectangle
aRightTop(aLeft
);
1050 aRightTop
.Left() = long(aRightTop
.Left() + aRightTop
.GetWidth() * 1.05);
1051 aRightTop
.setHeight(long(aRightTop
.GetHeight() * 0.477));
1052 Rectangle
aRightBottom(aRightTop
);
1053 aRightBottom
.Top() = long(aRightBottom
.Top() + aRightBottom
.GetHeight() * 1.095);
1055 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1056 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aLeft
);
1057 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aRightTop
);
1058 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aRightBottom
);
1061 case 13 : // AUTOLAYOUT_OBJTEXT
1063 Rectangle
aLeft(pInfo
->GetPresRectangle());
1064 aLeft
.setWidth(long(aLeft
.GetWidth() * 0.488));
1065 Rectangle
aRight(aLeft
);
1066 aRight
.Left() = long(aRight
.Left() + aRight
.GetWidth() * 1.05);
1068 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1069 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aLeft
);
1070 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aRight
);
1073 case 14 : // AUTOLAYOUT_OBJOVERTEXT
1075 Rectangle
aTop(pInfo
->GetPresRectangle());
1076 aTop
.setHeight(long(aTop
.GetHeight() * 0.477));
1077 Rectangle
aBottom(aTop
);
1078 aBottom
.Top() = long(aBottom
.Top() + aBottom
.GetHeight() * 1.095);
1080 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1081 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aTop
);
1082 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aBottom
);
1085 case 15 : // AUTOLAYOUT_2OBJTEXT
1087 Rectangle
aLeftTop(pInfo
->GetPresRectangle());
1088 aLeftTop
.setWidth(long(aLeftTop
.GetWidth() * 0.488));
1089 Rectangle
aRight(aLeftTop
);
1090 aRight
.Left() = long(aRight
.Left() + aRight
.GetWidth() * 1.05);
1091 aLeftTop
.setHeight(long(aLeftTop
.GetHeight() * 0.477));
1092 Rectangle
aLeftBottom(aLeftTop
);
1093 aLeftBottom
.Top() = long(aLeftBottom
.Top() + aLeftBottom
.GetHeight() * 1.095);
1095 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1096 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aLeftTop
);
1097 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aLeftBottom
);
1098 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aRight
);
1101 case 16 : // AUTOLAYOUT_2OBJOVERTEXT
1103 Rectangle
aTopLeft(pInfo
->GetPresRectangle());
1104 aTopLeft
.setHeight(long(aTopLeft
.GetHeight() * 0.477));
1105 Rectangle
aBottom(aTopLeft
);
1106 aBottom
.Top() = long(aBottom
.Top() + aBottom
.GetHeight() * 1.095);
1107 aTopLeft
.setWidth(long(aTopLeft
.GetWidth() * 0.488));
1108 Rectangle
aTopRight(aTopLeft
);
1109 aTopRight
.Left() = long(aTopRight
.Left() + aTopRight
.GetWidth() * 1.05);
1111 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1112 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aTopLeft
);
1113 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aTopRight
);
1114 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aBottom
);
1117 case 17 : // AUTOLAYOUT_TEXTOVEROBJ
1119 Rectangle
aTop(pInfo
->GetPresRectangle());
1120 aTop
.setHeight(long(aTop
.GetHeight() * 0.477));
1121 Rectangle
aBottom(aTop
);
1122 aBottom
.Top() = long(aBottom
.Top() + aBottom
.GetHeight() * 1.095);
1124 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1125 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aTop
);
1126 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aBottom
);
1129 case 18 : // AUTOLAYOUT_4OBJ
1131 Rectangle
aTopLeft(pInfo
->GetPresRectangle());
1132 aTopLeft
.setHeight(long(aTopLeft
.GetHeight() * 0.477));
1133 aTopLeft
.setWidth(long(aTopLeft
.GetWidth() * 0.488));
1134 Rectangle
aBottomLeft(aTopLeft
);
1135 aBottomLeft
.Top() = long(aBottomLeft
.Top() + aBottomLeft
.GetHeight() * 1.095);
1136 Rectangle
aTopRight(aTopLeft
);
1137 aTopRight
.Left() = long(aTopRight
.Left() + aTopRight
.GetWidth() * 1.05);
1138 Rectangle
aBottomRight(aTopRight
);
1139 aBottomRight
.Top() = long(aBottomRight
.Top() + aBottomRight
.GetHeight() * 1.095);
1141 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1142 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aTopLeft
);
1143 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aTopRight
);
1144 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aBottomLeft
);
1145 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aBottomRight
);
1148 case 19 : // AUTOLAYOUT_ONLY_TITLE
1150 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1153 case 21 : // AUTOLAYOUT_NOTES
1155 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderPage
, pInfo
->GetTitleRectangle());
1156 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderNotes
, pInfo
->GetPresRectangle());
1159 case 22 : // AUTOLAYOUT_HANDOUT1
1160 case 23 : // AUTOLAYOUT_HANDOUT2
1161 case 24 : // AUTOLAYOUT_HANDOUT3
1162 case 25 : // AUTOLAYOUT_HANDOUT4
1163 case 26 : // AUTOLAYOUT_HANDOUT6
1164 case 31 : // AUTOLAYOUT_HANDOUT9
1166 sal_Int32 nColCnt
, nRowCnt
;
1167 sal_Int32 nGapX
= pInfo
->GetGapX();
1168 sal_Int32 nGapY
= pInfo
->GetGapY();
1170 switch(pInfo
->GetLayoutType())
1172 case 22 : nColCnt
= 1; nRowCnt
= 1; break;
1173 case 23 : nColCnt
= 1; nRowCnt
= 2; break;
1174 case 24 : nColCnt
= 1; nRowCnt
= 3; break;
1175 case 25 : nColCnt
= 2; nRowCnt
= 2; break;
1176 case 26 : nColCnt
= 3; nRowCnt
= 2; break;
1177 case 31 : nColCnt
= 3; nRowCnt
= 3; break;
1178 default: nColCnt
= 0; nRowCnt
= 0; break; // FIXME - What is correct values?
1181 Size
aPartSize(pInfo
->GetTitleRectangle().GetSize());
1182 Point
aPartPos(pInfo
->GetTitleRectangle().TopLeft());
1184 if(aPartSize
.Width() > aPartSize
.Height())
1186 sal_Int32
nZwi(nColCnt
);
1191 aPartSize
.Width() = (aPartSize
.Width() - ((nColCnt
- 1) * nGapX
)) / nColCnt
;
1192 aPartSize
.Height() = (aPartSize
.Height() - ((nRowCnt
- 1) * nGapY
)) / nRowCnt
;
1194 Point
aTmpPos(aPartPos
);
1196 for(sal_Int32 a
= 0L; a
< nRowCnt
; a
++)
1198 aTmpPos
.X() = aPartPos
.X();
1200 for(sal_Int32 b
= 0L; b
< nColCnt
; b
++)
1202 Rectangle
aTmpRect(aTmpPos
, aPartSize
);
1204 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderHandout
, aTmpRect
);
1205 aTmpPos
.X() += aPartSize
.Width() + nGapX
;
1208 aTmpPos
.Y() += aPartSize
.Height() + nGapY
;
1212 case 27 : // AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART
1214 Rectangle
aTop(pInfo
->GetPresRectangle());
1215 aTop
.setHeight(long(aTop
.GetHeight() * 0.488));
1216 Rectangle
aBottom(aTop
);
1217 aBottom
.Top() = long(aBottom
.Top() + aBottom
.GetHeight() * 1.05);
1219 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalTitle
, pInfo
->GetTitleRectangle());
1220 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline
, aTop
);
1221 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart
, aBottom
);
1224 case 28 : // AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE
1226 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalTitle
, pInfo
->GetTitleRectangle());
1227 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline
, pInfo
->GetPresRectangle());
1230 case 29 : // AUTOLAYOUT_TITLE_VERTICAL_OUTLINE
1232 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1233 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline
, pInfo
->GetPresRectangle());
1236 case 30 : // AUTOLAYOUT_TITLE_VERTICAL_OUTLINE_CLIPART
1238 Rectangle
aLeft(pInfo
->GetPresRectangle());
1239 aLeft
.setWidth(long(aLeft
.GetWidth() * 0.488));
1240 Rectangle
aRight(aLeft
);
1241 aRight
.Left() = long(aRight
.Left() + aRight
.GetWidth() * 1.05);
1243 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1244 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aLeft
);
1245 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline
, aRight
);
1248 case 32 : // AUTOLAYOUT_TITLE
1250 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderSubtitle
, pInfo
->GetPresRectangle());
1254 case 33 : // AUTOLAYOUT_4CLIPART
1256 Rectangle
aTopLeft(pInfo
->GetPresRectangle());
1257 aTopLeft
.setHeight(long(aTopLeft
.GetHeight() * 0.477));
1258 aTopLeft
.setWidth(long(aTopLeft
.GetWidth() * 0.488));
1259 Rectangle
aBottomLeft(aTopLeft
);
1260 aBottomLeft
.Top() = long(aBottomLeft
.Top() + aBottomLeft
.GetHeight() * 1.095);
1261 Rectangle
aTopRight(aTopLeft
);
1262 aTopRight
.Left() = long(aTopRight
.Left() + aTopRight
.GetWidth() * 1.05);
1263 Rectangle
aBottomRight(aTopRight
);
1264 aBottomRight
.Top() = long(aBottomRight
.Top() + aBottomRight
.GetHeight() * 1.095);
1266 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1267 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aTopLeft
);
1268 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aTopRight
);
1269 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aBottomLeft
);
1270 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aBottomRight
);
1274 case 34 : // AUTOLAYOUT_6CLIPART
1276 Rectangle
aTopLeft(pInfo
->GetPresRectangle());
1277 aTopLeft
.setHeight(long(aTopLeft
.GetHeight() * 0.477));
1278 aTopLeft
.setWidth(long(aTopLeft
.GetWidth() * 0.322));
1279 Rectangle
aTopCenter(aTopLeft
);
1280 aTopCenter
.Left() = long(aTopCenter
.Left() + aTopCenter
.GetWidth() * 1.05);
1281 Rectangle
aTopRight(aTopLeft
);
1282 aTopRight
.Left() = long(aTopRight
.Left() + aTopRight
.GetWidth() * 2 * 1.05);
1284 Rectangle
aBottomLeft(aTopLeft
);
1285 aBottomLeft
.Top() = long(aBottomLeft
.Top() + aBottomLeft
.GetHeight() * 1.095);
1286 Rectangle
aBottomCenter(aTopCenter
);
1287 aBottomCenter
.Top() = long(aBottomCenter
.Top() + aBottomCenter
.GetHeight() * 1.095);
1288 Rectangle
aBottomRight(aTopRight
);
1289 aBottomRight
.Top() = long(aBottomRight
.Top() + aBottomRight
.GetHeight() * 1.095);
1291 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1292 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aTopLeft
);
1293 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aTopCenter
);
1294 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aTopRight
);
1295 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aBottomLeft
);
1296 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aBottomCenter
);
1297 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aBottomRight
);
1302 DBG_ERROR("XMLEXP: unknown autolayout export");
1311 //////////////////////////////////////////////////////////////////////////////
1313 void SdXMLExport::ImpWriteAutoLayoutPlaceholder(XmlPlaceholder ePl
, const Rectangle
& rRect
)
1316 OUStringBuffer sStringBuffer
;
1318 // prepare presentation-placeholder attributes, presentation:object
1321 case XmlPlaceholderTitle
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("title")); break;
1322 case XmlPlaceholderOutline
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("outline")); break;
1323 case XmlPlaceholderSubtitle
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("subtitle")); break;
1324 case XmlPlaceholderText
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("text")); break;
1325 case XmlPlaceholderGraphic
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("graphic")); break;
1326 case XmlPlaceholderObject
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("object")); break;
1327 case XmlPlaceholderChart
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("chart")); break;
1328 case XmlPlaceholderOrgchart
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("orgchart")); break;
1329 case XmlPlaceholderTable
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("table")); break;
1330 case XmlPlaceholderPage
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("page")); break;
1331 case XmlPlaceholderNotes
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("notes")); break;
1332 case XmlPlaceholderHandout
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("handout")); break;
1333 case XmlPlaceholderVerticalTitle
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("vertical_title")); break;
1334 case XmlPlaceholderVerticalOutline
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("vertical_outline")); break;
1337 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_OBJECT
, aStr
);
1339 // svg:x,y,width,height
1340 GetMM100UnitConverter().convertMeasure(sStringBuffer
, rRect
.Left());
1341 aStr
= sStringBuffer
.makeStringAndClear();
1342 AddAttribute(XML_NAMESPACE_SVG
, XML_X
, aStr
);
1344 GetMM100UnitConverter().convertMeasure(sStringBuffer
, rRect
.Top());
1345 aStr
= sStringBuffer
.makeStringAndClear();
1346 AddAttribute(XML_NAMESPACE_SVG
, XML_Y
, aStr
);
1348 GetMM100UnitConverter().convertMeasure(sStringBuffer
, rRect
.GetWidth());
1349 aStr
= sStringBuffer
.makeStringAndClear();
1350 AddAttribute(XML_NAMESPACE_SVG
, XML_WIDTH
, aStr
);
1352 GetMM100UnitConverter().convertMeasure(sStringBuffer
, rRect
.GetHeight());
1353 aStr
= sStringBuffer
.makeStringAndClear();
1354 AddAttribute(XML_NAMESPACE_SVG
, XML_HEIGHT
, aStr
);
1356 // write presentation-placeholder
1357 SvXMLElementExport
aPPL(*this, XML_NAMESPACE_PRESENTATION
, XML_PLACEHOLDER
, sal_True
, sal_True
);
1360 //////////////////////////////////////////////////////////////////////////////
1362 ImpXMLEXPPageMasterInfo
* SdXMLExport::ImpGetOrCreatePageMasterInfo( Reference
< XDrawPage
> xMasterPage
)
1364 bool bDoesExist
= false;
1366 ImpXMLEXPPageMasterInfo
* pNewInfo
= new ImpXMLEXPPageMasterInfo(*this, xMasterPage
);
1368 // compare with prev page-master infos
1369 for(sal_uInt32 a
= 0; !bDoesExist
&& a
< mpPageMasterInfoList
->Count(); a
++)
1371 if(mpPageMasterInfoList
->GetObject(a
)
1372 && *mpPageMasterInfoList
->GetObject(a
) == *pNewInfo
)
1375 pNewInfo
= mpPageMasterInfoList
->GetObject(a
);
1379 // add entry when not found same page-master infos
1381 mpPageMasterInfoList
->Insert(pNewInfo
, LIST_APPEND
);
1386 void SdXMLExport::ImpPrepPageMasterInfos()
1390 // create page master info for handout master page
1392 Reference
< XHandoutMasterSupplier
> xHMS( GetModel(), UNO_QUERY
);
1395 Reference
< XDrawPage
> xMasterPage( xHMS
->getHandoutMasterPage() );
1396 if( xMasterPage
.is() )
1397 mpHandoutPageMaster
= ImpGetOrCreatePageMasterInfo(xMasterPage
);
1401 // create page master infos for master pages
1402 if(mnDocMasterPageCount
)
1404 // look for needed page-masters, create these
1405 for(sal_Int32 nMPageId
= 0L; nMPageId
< mnDocMasterPageCount
; nMPageId
++)
1407 Reference
< XDrawPage
> xMasterPage( mxDocMasterPages
->getByIndex(nMPageId
), UNO_QUERY
);
1408 ImpXMLEXPPageMasterInfo
* pNewInfo
= 0L;
1410 if(xMasterPage
.is())
1411 pNewInfo
= ImpGetOrCreatePageMasterInfo(xMasterPage
);
1413 mpPageMasterUsageList
->Insert(pNewInfo
, LIST_APPEND
);
1415 // look for page master of handout page
1419 Reference
< presentation::XPresentationPage
> xPresPage(xMasterPage
, UNO_QUERY
);
1422 Reference
< XDrawPage
> xNotesPage(xPresPage
->getNotesPage());
1425 pNewInfo
= ImpGetOrCreatePageMasterInfo(xNotesPage
);
1428 mpNotesPageMasterUsageList
->Insert( pNewInfo
, LIST_APPEND
);
1434 //////////////////////////////////////////////////////////////////////////////
1436 void SdXMLExport::ImpWritePageMasterInfos()
1438 // write created page-masters, create names for these
1439 for(sal_uInt32 nCnt
= 0L; nCnt
< mpPageMasterInfoList
->Count(); nCnt
++)
1441 ImpXMLEXPPageMasterInfo
* pInfo
= mpPageMasterInfoList
->GetObject(nCnt
);
1445 OUString sNewName
= OUString(RTL_CONSTASCII_USTRINGPARAM("PM"));
1447 sNewName
+= OUString::valueOf((sal_Int32
)nCnt
);
1448 pInfo
->SetName(sNewName
);
1450 // prepare page-master attributes
1452 OUStringBuffer sStringBuffer
;
1455 AddAttribute(XML_NAMESPACE_STYLE
, XML_NAME
, sString
);
1457 // write page-layout
1458 SvXMLElementExport
aPME(*this, XML_NAMESPACE_STYLE
, XML_PAGE_LAYOUT
, sal_True
, sal_True
);
1460 // prepare style:properties inside page-master
1461 GetMM100UnitConverter().convertMeasure(sStringBuffer
, pInfo
->GetBorderTop());
1462 sString
= sStringBuffer
.makeStringAndClear();
1463 AddAttribute(XML_NAMESPACE_FO
, XML_MARGIN_TOP
, sString
);
1465 GetMM100UnitConverter().convertMeasure(sStringBuffer
, pInfo
->GetBorderBottom());
1466 sString
= sStringBuffer
.makeStringAndClear();
1467 AddAttribute(XML_NAMESPACE_FO
, XML_MARGIN_BOTTOM
, sString
);
1469 GetMM100UnitConverter().convertMeasure(sStringBuffer
, pInfo
->GetBorderLeft());
1470 sString
= sStringBuffer
.makeStringAndClear();
1471 AddAttribute(XML_NAMESPACE_FO
, XML_MARGIN_LEFT
, sString
);
1473 GetMM100UnitConverter().convertMeasure(sStringBuffer
, pInfo
->GetBorderRight());
1474 sString
= sStringBuffer
.makeStringAndClear();
1475 AddAttribute(XML_NAMESPACE_FO
, XML_MARGIN_RIGHT
, sString
);
1477 GetMM100UnitConverter().convertMeasure(sStringBuffer
, pInfo
->GetWidth());
1478 sString
= sStringBuffer
.makeStringAndClear();
1479 AddAttribute(XML_NAMESPACE_FO
, XML_PAGE_WIDTH
, sString
);
1481 GetMM100UnitConverter().convertMeasure(sStringBuffer
, pInfo
->GetHeight());
1482 sString
= sStringBuffer
.makeStringAndClear();
1483 AddAttribute(XML_NAMESPACE_FO
, XML_PAGE_HEIGHT
, sString
);
1485 if(pInfo
->GetOrientation() == view::PaperOrientation_PORTRAIT
)
1486 AddAttribute(XML_NAMESPACE_STYLE
, XML_PRINT_ORIENTATION
, XML_PORTRAIT
);
1488 AddAttribute(XML_NAMESPACE_STYLE
, XML_PRINT_ORIENTATION
, XML_LANDSCAPE
);
1490 // write style:properties
1491 SvXMLElementExport
aPMF(*this, XML_NAMESPACE_STYLE
, XML_PAGE_LAYOUT_PROPERTIES
, sal_True
, sal_True
);
1496 //////////////////////////////////////////////////////////////////////////////
1498 ImpXMLEXPPageMasterInfo
* SdXMLExport::ImpGetPageMasterInfoByName(const OUString
& rName
)
1500 if(rName
.getLength() && mpPageMasterInfoList
->Count())
1502 for(sal_uInt32 nCnt
= 0L; nCnt
< mpPageMasterInfoList
->Count(); nCnt
++)
1504 ImpXMLEXPPageMasterInfo
* pInfo
= mpPageMasterInfoList
->GetObject(nCnt
);
1507 if(pInfo
->GetMasterPageName().getLength() && rName
.equals(pInfo
->GetMasterPageName()))
1517 //////////////////////////////////////////////////////////////////////////////
1519 void SdXMLExport::ImpPrepDrawPageInfos()
1521 // create draw:style-name entries for page export
1522 // containing presentation page attributes AND background attributes
1523 // fixed family for page-styles is "drawing-page" (XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME)
1526 for(nCnt
= 0; nCnt
< mnDocDrawPageCount
; nCnt
++)
1528 Reference
<XDrawPage
> xDrawPage
;
1529 mxDocDrawPages
->getByIndex(nCnt
) >>= xDrawPage
;
1530 maDrawPagesStyleNames
[nCnt
] = ImpCreatePresPageStyleName( xDrawPage
);
1532 Reference
< presentation::XPresentationPage
> xPresPage(xDrawPage
, UNO_QUERY
);
1535 maDrawNotesPagesStyleNames
[nCnt
] = ImpCreatePresPageStyleName( xPresPage
->getNotesPage(), false );
1537 maDrawPagesHeaderFooterSettings
[nCnt
] = ImpPrepDrawPageHeaderFooterDecls( xDrawPage
);
1538 maDrawNotesPagesHeaderFooterSettings
[nCnt
] = ImpPrepDrawPageHeaderFooterDecls( xPresPage
->getNotesPage() );
1543 //////////////////////////////////////////////////////////////////////////////
1545 static OUString
findOrAppendImpl( std::vector
< OUString
>& rVector
, const OUString
& rText
, const sal_Char
* pPrefix
)
1547 // search rVector if there is already a string that equals rText
1548 std::vector
< OUString
>::iterator aIter
;
1550 for( nIndex
= 1, aIter
= rVector
.begin(); aIter
!= rVector
.end(); aIter
++, nIndex
++ )
1552 if( (*aIter
) == rText
)
1556 // if nothing is found, append the string at the end of rVector
1557 if( aIter
== rVector
.end() )
1558 rVector
.push_back( rText
);
1560 // create a reference string with pPrefix and the index of the
1561 // found or created rText
1562 OUString
aStr( OUString::createFromAscii( pPrefix
) );
1563 aStr
+= OUString::valueOf( nIndex
);
1567 static OUString
findOrAppendImpl( std::vector
< DateTimeDeclImpl
>& rVector
, const OUString
& rText
, sal_Bool bFixed
, sal_Int32 nFormat
, const sal_Char
* pPrefix
)
1569 // search rVector if there is already a DateTimeDeclImpl with rText,bFixed and nFormat
1570 std::vector
< DateTimeDeclImpl
>::iterator aIter
;
1572 for( nIndex
= 1, aIter
= rVector
.begin(); aIter
!= rVector
.end(); aIter
++, nIndex
++ )
1574 const DateTimeDeclImpl
& rDecl
= (*aIter
);
1575 if( (rDecl
.mbFixed
== bFixed
) &&
1576 (!bFixed
|| rDecl
.maStrText
== rText
) &&
1577 (bFixed
|| (rDecl
.mnFormat
== nFormat
) ) )
1581 // if nothing is found, append a new DateTimeDeclImpl
1582 if( aIter
== rVector
.end() )
1584 DateTimeDeclImpl aDecl
;
1585 aDecl
.maStrText
= rText
;
1586 aDecl
.mbFixed
= bFixed
;
1587 aDecl
.mnFormat
= nFormat
;
1588 rVector
.push_back( aDecl
);
1591 // create a reference string with pPrefix and the index of the
1592 // found or created DateTimeDeclImpl
1593 OUString
aStr( OUString::createFromAscii( pPrefix
) );
1594 aStr
+= OUString::valueOf( nIndex
);
1599 static const sal_Char
* gpStrHeaderTextPrefix
= "hdr";
1600 static const sal_Char
* gpStrFooterTextPrefix
= "ftr";
1601 static const sal_Char
* gpStrDateTimeTextPrefix
= "dtd";
1603 HeaderFooterPageSettingsImpl
SdXMLExport::ImpPrepDrawPageHeaderFooterDecls( const Reference
<XDrawPage
>& xDrawPage
)
1605 HeaderFooterPageSettingsImpl aSettings
;
1607 if( xDrawPage
.is() ) try
1609 Reference
< XPropertySet
> xSet( xDrawPage
, UNO_QUERY_THROW
);
1610 Reference
< XPropertySetInfo
> xInfo( xSet
->getPropertySetInfo() );
1614 const OUString
aStrHeaderTextProp( RTL_CONSTASCII_USTRINGPARAM( "HeaderText" ) );
1615 if( xInfo
->hasPropertyByName( aStrHeaderTextProp
) )
1617 xSet
->getPropertyValue( aStrHeaderTextProp
) >>= aStrText
;
1618 if( aStrText
.getLength() )
1619 aSettings
.maStrHeaderDeclName
= findOrAppendImpl( maHeaderDeclsVector
, aStrText
, gpStrHeaderTextPrefix
);
1622 const OUString
aStrFooterTextProp( RTL_CONSTASCII_USTRINGPARAM( "FooterText" ) );
1623 if( xInfo
->hasPropertyByName( aStrFooterTextProp
) )
1625 xSet
->getPropertyValue( aStrFooterTextProp
) >>= aStrText
;
1626 if( aStrText
.getLength() )
1627 aSettings
.maStrFooterDeclName
= findOrAppendImpl( maFooterDeclsVector
, aStrText
, gpStrFooterTextPrefix
);
1630 const OUString
aStrDateTimeTextProp( RTL_CONSTASCII_USTRINGPARAM( "DateTimeText" ) );
1631 if( xInfo
->hasPropertyByName( aStrDateTimeTextProp
) )
1633 sal_Bool bFixed
= false;
1634 sal_Int32 nFormat
= 0;
1635 xSet
->getPropertyValue( aStrDateTimeTextProp
) >>= aStrText
;
1636 xSet
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDateTimeFixed" ) ) ) >>= bFixed
;
1637 xSet
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DateTimeFormat" ) ) ) >>= nFormat
;
1639 if( !bFixed
|| aStrText
.getLength() )
1641 aSettings
.maStrDateTimeDeclName
= findOrAppendImpl( maDateTimeDeclsVector
, aStrText
, bFixed
, nFormat
, gpStrDateTimeTextPrefix
);
1643 addDataStyle( nFormat
);
1647 catch( Exception
& e
)
1650 DBG_ERROR( "SdXMLExport::ImpPrepDrawPageHeaderFooterDecls(), unexpected exception cought!" );
1656 //////////////////////////////////////////////////////////////////////////////
1658 void SdXMLExport::ImpWriteHeaderFooterDecls()
1660 OUStringBuffer sBuffer
;
1662 if( !maHeaderDeclsVector
.empty() )
1664 // export header decls
1665 const OUString
aPrefix( OUString::createFromAscii( gpStrHeaderTextPrefix
) );
1666 std::vector
< OUString
>::iterator aIter
;
1668 for( nIndex
= 1, aIter
= maHeaderDeclsVector
.begin(); aIter
!= maHeaderDeclsVector
.end(); aIter
++, nIndex
++ )
1670 sBuffer
.append( aPrefix
);
1671 sBuffer
.append( nIndex
);
1672 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_NAME
, sBuffer
.makeStringAndClear());
1674 SvXMLElementExport
aElem(*this, XML_NAMESPACE_PRESENTATION
, XML_HEADER_DECL
, sal_True
, sal_True
);
1675 Characters((*aIter
));
1679 if( !maFooterDeclsVector
.empty() )
1681 // export footer decls
1682 const OUString
aPrefix( OUString::createFromAscii( gpStrFooterTextPrefix
) );
1683 std::vector
< OUString
>::iterator aIter
;
1685 for( nIndex
= 1, aIter
= maFooterDeclsVector
.begin(); aIter
!= maFooterDeclsVector
.end(); aIter
++, nIndex
++ )
1687 sBuffer
.append( aPrefix
);
1688 sBuffer
.append( nIndex
);
1689 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_NAME
, sBuffer
.makeStringAndClear());
1691 SvXMLElementExport
aElem(*this, XML_NAMESPACE_PRESENTATION
, XML_FOOTER_DECL
, sal_False
, sal_False
);
1692 Characters((*aIter
));
1696 if( !maDateTimeDeclsVector
.empty() )
1698 // export footer decls
1699 const OUString
aPrefix( OUString::createFromAscii( gpStrDateTimeTextPrefix
) );
1700 std::vector
< DateTimeDeclImpl
>::iterator aIter
;
1702 for( nIndex
= 1, aIter
= maDateTimeDeclsVector
.begin(); aIter
!= maDateTimeDeclsVector
.end(); aIter
++, nIndex
++ )
1704 const DateTimeDeclImpl
& rDecl
= (*aIter
);
1706 sBuffer
.append( aPrefix
);
1707 sBuffer
.append( nIndex
);
1708 AddAttribute( XML_NAMESPACE_PRESENTATION
, XML_NAME
, sBuffer
.makeStringAndClear());
1710 AddAttribute( XML_NAMESPACE_PRESENTATION
, XML_SOURCE
, rDecl
.mbFixed
? XML_FIXED
: XML_CURRENT_DATE
);
1712 if( !rDecl
.mbFixed
)
1713 AddAttribute( XML_NAMESPACE_STYLE
, XML_DATA_STYLE_NAME
, getDataStyleName( rDecl
.mnFormat
) );
1715 SvXMLElementExport
aElem(*this, XML_NAMESPACE_PRESENTATION
, XML_DATE_TIME_DECL
, sal_False
, sal_False
);
1717 Characters(rDecl
.maStrText
);
1722 void SdXMLExport::ImplExportHeaderFooterDeclAttributes( const HeaderFooterPageSettingsImpl
& aSettings
)
1724 if( aSettings
.maStrHeaderDeclName
.getLength() )
1725 AddAttribute( XML_NAMESPACE_PRESENTATION
, XML_USE_HEADER_NAME
, aSettings
.maStrHeaderDeclName
);
1727 if( aSettings
.maStrFooterDeclName
.getLength() )
1728 AddAttribute( XML_NAMESPACE_PRESENTATION
, XML_USE_FOOTER_NAME
, aSettings
.maStrFooterDeclName
);
1730 if( aSettings
.maStrDateTimeDeclName
.getLength() )
1731 AddAttribute( XML_NAMESPACE_PRESENTATION
, XML_USE_DATE_TIME_NAME
, aSettings
.maStrDateTimeDeclName
);
1734 //////////////////////////////////////////////////////////////////////////////
1736 OUString
SdXMLExport::ImpCreatePresPageStyleName( Reference
<XDrawPage
> xDrawPage
, bool bExportBackground
/* = true */ )
1739 OUString sStyleName
;
1741 // create style for this page and add to auto style pool
1743 Reference
< beans::XPropertySet
> xPropSet1(xDrawPage
, UNO_QUERY
);
1746 Reference
< beans::XPropertySet
> xPropSet
;
1748 if( bExportBackground
)
1750 // since the background items are in a different propertyset
1751 // which itself is a property of the pages property set
1752 // we now merge these two propertysets if possible to simulate
1753 // a single propertyset with all draw page properties
1754 const OUString
aBackground(RTL_CONSTASCII_USTRINGPARAM("Background"));
1755 Reference
< beans::XPropertySet
> xPropSet2
;
1756 Reference
< beans::XPropertySetInfo
> xInfo( xPropSet1
->getPropertySetInfo() );
1757 if( xInfo
.is() && xInfo
->hasPropertyByName( aBackground
) )
1759 Any
aAny( xPropSet1
->getPropertyValue( aBackground
) );
1763 if( xPropSet2
.is() )
1764 xPropSet
= PropertySetMerger_CreateInstance( xPropSet1
, xPropSet2
);
1766 xPropSet
= xPropSet1
;
1770 xPropSet
= xPropSet1
;
1773 const UniReference
< SvXMLExportPropertyMapper
> aMapperRef( GetPresPagePropsMapper() );
1775 std::vector
< XMLPropertyState
> xPropStates( aMapperRef
->Filter( xPropSet
) );
1777 if( !xPropStates
.empty() )
1779 // there are filtered properties -> hard attributes
1780 // try to find this style in AutoStylePool
1781 sStyleName
= GetAutoStylePool()->Find(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID
, sStyleName
, xPropStates
);
1783 if(!sStyleName
.getLength())
1785 // Style did not exist, add it to AutoStalePool
1786 sStyleName
= GetAutoStylePool()->Add(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID
, sStyleName
, xPropStates
);
1794 //////////////////////////////////////////////////////////////////////////////
1796 void SdXMLExport::ImpPrepMasterPageInfos()
1798 // create draw:style-name entries for master page export
1799 // containing only background attributes
1800 // fixed family for page-styles is "drawing-page" (XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME)
1803 for( nCnt
= 0; nCnt
< mnDocMasterPageCount
; nCnt
++)
1805 Reference
<XDrawPage
> xDrawPage
;
1806 mxDocMasterPages
->getByIndex(nCnt
) >>= xDrawPage
;
1807 maMasterPagesStyleNames
[nCnt
] = ImpCreatePresPageStyleName( xDrawPage
);
1812 Reference
< presentation::XHandoutMasterSupplier
> xHandoutSupp( GetModel(), UNO_QUERY
);
1813 if( xHandoutSupp
.is() )
1815 Reference
< XDrawPage
> xHandoutPage( xHandoutSupp
->getHandoutMasterPage() );
1816 if( xHandoutPage
.is() )
1818 maHandoutPageHeaderFooterSettings
= ImpPrepDrawPageHeaderFooterDecls( xHandoutPage
);
1819 maHandoutMasterStyleName
= ImpCreatePresPageStyleName( xHandoutPage
, false );
1825 //////////////////////////////////////////////////////////////////////////////
1826 void SdXMLExport::ImpWritePresentationStyles()
1830 for(sal_Int32 nCnt
= 0L; nCnt
< mnDocMasterPageCount
; nCnt
++)
1832 Any
aAny(mxDocMasterPages
->getByIndex(nCnt
));
1833 Reference
<container::XNamed
> xNamed
;
1837 // write presentation styles (ONLY if presentation)
1838 if(IsImpress() && mxDocStyleFamilies
.is() && xNamed
.is())
1840 XMLStyleExport
aStEx(*this, OUString(), GetAutoStylePool().get());
1841 const UniReference
< SvXMLExportPropertyMapper
> aMapperRef( GetPropertySetMapper() );
1843 OUString
aPrefix( xNamed
->getName() );
1845 aPrefix
+= OUString(RTL_CONSTASCII_USTRINGPARAM("-"));
1846 aStEx
.exportStyleFamily(xNamed
->getName(),
1847 OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_NAME
)),
1849 XML_STYLE_FAMILY_SD_PRESENTATION_ID
, &aPrefix
);
1856 //////////////////////////////////////////////////////////////////////////////
1858 void SdXMLExport::SetProgress(sal_Int32 nProg
)
1860 // set progress view
1861 if(GetStatusIndicator().is())
1862 GetStatusIndicator()->setValue(nProg
);
1865 //////////////////////////////////////////////////////////////////////////////
1868 void SdXMLExport::_ExportMeta()
1870 uno::Sequence
<beans::NamedValue
> stats(1);
1871 stats
[0] = beans::NamedValue(::rtl::OUString::createFromAscii("ObjectCount"),
1872 uno::makeAny(mnObjectCount
));
1874 // update document statistics at the model
1875 uno::Reference
<document::XDocumentPropertiesSupplier
> xPropSup(GetModel(),
1876 uno::UNO_QUERY_THROW
);
1877 uno::Reference
<document::XDocumentProperties
> xDocProps(
1878 xPropSup
->getDocumentProperties());
1879 if (xDocProps
.is()) {
1880 xDocProps
->setDocumentStatistics(stats
);
1884 SvXMLExport::_ExportMeta();
1887 //////////////////////////////////////////////////////////////////////////////
1889 void SdXMLExport::_ExportContent()
1891 // export <pres:header-decl>, <pres:footer-decl> and <pres:date-time-decl> elements
1892 ImpWriteHeaderFooterDecls();
1895 for(sal_Int32
nPageInd(0); nPageInd
< mnDocDrawPageCount
; nPageInd
++)
1897 uno::Reference
<drawing::XDrawPage
> xDrawPage( mxDocDrawPages
->getByIndex(nPageInd
), uno::UNO_QUERY
);
1899 SetProgress(((nPageInd
+ 1) * 100) / mnDocDrawPageCount
);
1903 // prepare page attributes, name of page
1904 Reference
< container::XNamed
> xNamed(xDrawPage
, UNO_QUERY
);
1906 AddAttribute(XML_NAMESPACE_DRAW
, XML_NAME
, xNamed
->getName());
1908 // draw:style-name (presentation page attributes AND background attributes)
1909 if( maDrawPagesStyleNames
[nPageInd
].getLength() )
1910 AddAttribute(XML_NAMESPACE_DRAW
, XML_STYLE_NAME
,
1911 maDrawPagesStyleNames
[nPageInd
]);
1913 // draw:master-page-name
1914 Reference
< drawing::XMasterPageTarget
> xMasterPageInt(xDrawPage
, UNO_QUERY
);
1915 if(xMasterPageInt
.is())
1917 Reference
<XDrawPage
> xUsedMasterPage(xMasterPageInt
->getMasterPage());
1918 if(xUsedMasterPage
.is())
1920 Reference
< container::XNamed
> xMasterNamed(xUsedMasterPage
, UNO_QUERY
);
1921 if(xMasterNamed
.is())
1923 AddAttribute(XML_NAMESPACE_DRAW
, XML_MASTER_PAGE_NAME
,
1924 EncodeStyleName( xMasterNamed
->getName()) );
1929 // presentation:page-layout-name
1930 if( IsImpress() && maDrawPagesAutoLayoutNames
[nPageInd
+1].getLength())
1932 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_PRESENTATION_PAGE_LAYOUT_NAME
, maDrawPagesAutoLayoutNames
[nPageInd
+1] );
1935 Reference
< beans::XPropertySet
> xProps( xDrawPage
, UNO_QUERY
);
1940 OUString aBookmarkURL
;
1941 xProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "BookmarkURL" ) ) ) >>= aBookmarkURL
;
1943 if( aBookmarkURL
.getLength() )
1945 sal_Int32 nIndex
= aBookmarkURL
.lastIndexOf( (sal_Unicode
)'#' );
1948 OUString
aFileName( aBookmarkURL
.copy( 0, nIndex
) );
1949 OUString
aBookmarkName( aBookmarkURL
.copy( nIndex
+1 ) );
1951 aBookmarkURL
= GetRelativeReference( aFileName
);
1952 aBookmarkURL
+= String( '#' );
1953 aBookmarkURL
+= aBookmarkName
;
1956 AddAttribute ( XML_NAMESPACE_XLINK
, XML_HREF
, aBookmarkURL
);
1957 AddAttribute ( XML_NAMESPACE_XLINK
, XML_TYPE
, XML_SIMPLE
);
1958 AddAttribute ( XML_NAMESPACE_XLINK
, XML_SHOW
, XML_REPLACE
);
1959 AddAttribute ( XML_NAMESPACE_XLINK
, XML_ACTUATE
, XML_ONREQUEST
);
1964 DBG_ERROR(" no \"BookmarkURL\" property at page?" );
1969 ImplExportHeaderFooterDeclAttributes( maDrawPagesHeaderFooterSettings
[nPageInd
] );
1972 OUString
sNavigationOrder( getNavigationOrder( xDrawPage
) );
1973 if( sNavigationOrder
.getLength() != 0 )
1974 AddAttribute ( XML_NAMESPACE_DRAW
, XML_NAV_ORDER
, sNavigationOrder
);
1976 UniReference
< xmloff::AnimationsExporter
> xAnimationsExporter
;
1977 uno::Reference
< ::com::sun::star::animations::XAnimationNodeSupplier
> xAnimNodeSupplier
;
1979 // prepare animation export
1982 if( getExportFlags() & EXPORT_OASIS
)
1984 // export new animations for oasis format
1985 xAnimNodeSupplier
.set( xDrawPage
, UNO_QUERY
);
1987 // prepare animations exporter if impress
1988 if(xAnimNodeSupplier
.is())
1990 xAnimationsExporter
= new xmloff::AnimationsExporter( *this, xProps
);
1991 xAnimationsExporter
->prepare( xAnimNodeSupplier
->getAnimationNode() );
1996 // export old animations for ooo format
1997 UniReference
< XMLAnimationsExporter
> xAnimExport
= new XMLAnimationsExporter( GetShapeExport().get() );
1998 GetShapeExport()->setAnimationsExporter( xAnimExport
);
2003 const OUString aPageId
= getInterfaceToIdentifierMapper().getIdentifier( xDrawPage
);
2004 if( aPageId
.getLength() != 0 )
2005 AddAttribute ( XML_NAMESPACE_DRAW
, XML_ID
, aPageId
);
2008 SvXMLElementExport
aDPG(*this, XML_NAMESPACE_DRAW
, XML_PAGE
, sal_True
, sal_True
);
2010 // write optional office:forms
2011 exportFormsElement( xDrawPage
);
2013 // write graphic objects on this page (if any)
2014 Reference
< drawing::XShapes
> xExportShapes(xDrawPage
, UNO_QUERY
);
2015 if(xExportShapes
.is() && xExportShapes
->getCount())
2016 GetShapeExport()->exportShapes( xExportShapes
);
2018 // write animations and presentation notes (ONLY if presentation)
2021 if(xAnimNodeSupplier
.is())
2023 xAnimationsExporter
->exportAnimations( xAnimNodeSupplier
->getAnimationNode() );
2028 UniReference
< XMLAnimationsExporter
> xAnimExport( GetShapeExport()->getAnimationsExporter() );
2029 if( xAnimExport
.is() )
2030 xAnimExport
->exportAnimations( *this );
2033 GetShapeExport()->setAnimationsExporter( xAnimExport
);
2037 Reference
< presentation::XPresentationPage
> xPresPage(xDrawPage
, UNO_QUERY
);
2040 Reference
< XDrawPage
> xNotesPage(xPresPage
->getNotesPage());
2043 Reference
< drawing::XShapes
> xShapes(xNotesPage
, UNO_QUERY
);
2046 if( maDrawNotesPagesStyleNames
[nPageInd
].getLength() )
2047 AddAttribute(XML_NAMESPACE_DRAW
, XML_STYLE_NAME
, maDrawNotesPagesStyleNames
[nPageInd
]);
2049 ImplExportHeaderFooterDeclAttributes( maDrawNotesPagesHeaderFooterSettings
[nPageInd
] );
2051 // write presentation notes
2052 SvXMLElementExport
aPSY(*this, XML_NAMESPACE_PRESENTATION
, XML_NOTES
, sal_True
, sal_True
);
2054 // write optional office:forms
2055 exportFormsElement( xNotesPage
);
2057 // write shapes per se
2058 GetShapeExport()->exportShapes( xShapes
);
2067 exportPresentationSettings();
2070 //////////////////////////////////////////////////////////////////////////////
2072 void SdXMLExport::exportPresentationSettings()
2076 Reference
< XPresentationSupplier
> xPresSupplier( GetModel(), UNO_QUERY
);
2077 if( !xPresSupplier
.is() )
2080 Reference
< XPropertySet
> xPresProps( xPresSupplier
->getPresentation(), UNO_QUERY
);
2081 if( !xPresProps
.is() )
2084 sal_Bool bHasAttr
= sal_False
;
2086 sal_Bool bTemp
= false;
2089 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsShowAll" ) ) ) >>= bTemp
;
2092 OUString aFirstPage
;
2093 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "FirstPage" ) ) ) >>= aFirstPage
;
2094 if( aFirstPage
.getLength() )
2096 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_START_PAGE
, aFirstPage
);
2097 bHasAttr
= sal_True
;
2101 OUString aCustomShow
;
2102 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "CustomShow" ) ) ) >>= aCustomShow
;
2103 if( aCustomShow
.getLength() )
2105 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_SHOW
, aCustomShow
);
2106 bHasAttr
= sal_True
;
2111 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsEndless" ) ) ) >>= bTemp
;
2114 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_ENDLESS
, XML_TRUE
);
2115 bHasAttr
= sal_True
;
2117 sal_Int32 nPause
= 0;
2118 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Pause" ) ) ) >>= nPause
;
2120 util::DateTime
aTime( 0, (sal_uInt16
)nPause
, 0, 0, 0, 0, 0 );
2122 OUStringBuffer aOut
;
2123 SvXMLUnitConverter::convertTime( aOut
, aTime
);
2124 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_PAUSE
, aOut
.makeStringAndClear() );
2127 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AllowAnimations" ) ) ) >>= bTemp
;
2130 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_ANIMATIONS
, XML_DISABLED
);
2131 bHasAttr
= sal_True
;
2134 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsAlwaysOnTop" ) ) ) >>= bTemp
;
2137 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_STAY_ON_TOP
, XML_TRUE
);
2138 bHasAttr
= sal_True
;
2141 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsAutomatic" ) ) ) >>= bTemp
;
2144 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_FORCE_MANUAL
, XML_TRUE
);
2145 bHasAttr
= sal_True
;
2148 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFullScreen" ) ) ) >>= bTemp
;
2151 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_FULL_SCREEN
, XML_FALSE
);
2152 bHasAttr
= sal_True
;
2155 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsMouseVisible" ) ) ) >>= bTemp
;
2158 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_MOUSE_VISIBLE
, XML_FALSE
);
2159 bHasAttr
= sal_True
;
2162 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "StartWithNavigator" ) ) ) >>= bTemp
;
2165 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_START_WITH_NAVIGATOR
, XML_TRUE
);
2166 bHasAttr
= sal_True
;
2169 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "UsePen" ) ) ) >>= bTemp
;
2172 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_MOUSE_AS_PEN
, XML_TRUE
);
2173 bHasAttr
= sal_True
;
2176 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsTransitionOnClick" ) ) ) >>= bTemp
;
2179 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_TRANSITION_ON_CLICK
, XML_DISABLED
);
2180 bHasAttr
= sal_True
;
2183 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsShowLogo" ) ) ) >>= bTemp
;
2186 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_SHOW_LOGO
, XML_TRUE
);
2187 bHasAttr
= sal_True
;
2190 Reference
< container::XNameContainer
> xShows
;
2191 Sequence
< OUString
> aShowNames
;
2192 const OUString
* pShowNames
= NULL
;
2193 sal_Int32 nShowCount
= 0;
2195 Reference
< XCustomPresentationSupplier
> xSup( GetModel(), UNO_QUERY
);
2198 xShows
= xSup
->getCustomPresentations();
2201 aShowNames
= xShows
->getElementNames();
2202 pShowNames
= aShowNames
.getArray();
2203 nShowCount
= aShowNames
.getLength();
2207 if( bHasAttr
|| nShowCount
!= 0 )
2209 SvXMLElementExport
aSettings(*this, XML_NAMESPACE_PRESENTATION
, XML_SETTINGS
, sal_True
, sal_True
);
2211 if( nShowCount
== 0 )
2214 Reference
< XIndexContainer
> xShow
;
2215 Reference
< XNamed
> xPageName
;
2217 OUStringBuffer sTmp
;
2219 for( sal_Int32 nIndex
= 0; nIndex
< nShowCount
; nIndex
++, pShowNames
++ )
2221 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_NAME
, *pShowNames
);
2223 xShows
->getByName( *pShowNames
) >>= xShow
;
2224 DBG_ASSERT( xShow
.is(), "invalid custom show!" );
2228 const sal_Int32 nPageCount
= xShow
->getCount();
2229 for( sal_Int32 nPage
= 0; nPage
< nPageCount
; nPage
++ )
2231 xShow
->getByIndex( nPage
) >>= xPageName
;
2233 if( !xPageName
.is() )
2236 if( sTmp
.getLength() != 0 )
2237 sTmp
.append( sal_Unicode( ',' ) );
2238 sTmp
.append( xPageName
->getName() );
2242 if( sTmp
.getLength() )
2243 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_PAGES
, sTmp
.makeStringAndClear() );
2245 SvXMLElementExport
aShows(*this, XML_NAMESPACE_PRESENTATION
, XML_SHOW
, sal_True
, sal_True
);
2249 catch( uno::Exception
)
2251 DBG_ERROR( "uno::Exception while exporting <presentation:settings>" );
2255 //////////////////////////////////////////////////////////////////////////////
2257 void SdXMLExport::_ExportStyles(BOOL bUsed
)
2259 GetPropertySetMapper()->SetAutoStyles( sal_False
);
2261 // export fill styles
2262 SvXMLExport::_ExportStyles( bUsed
);
2264 // write draw:style-name for object graphic-styles
2265 GetShapeExport()->ExportGraphicDefaults();
2267 GetShapeExport()->GetShapeTableExport()->exportTableStyles();
2269 // write presentation styles
2270 ImpWritePresentationStyles();
2272 // prepare draw:auto-layout-name for page export
2273 ImpPrepAutoLayoutInfos();
2275 // write draw:auto-layout-name for page export
2276 ImpWriteAutoLayoutInfos();
2278 Reference
< beans::XPropertySet
> xInfoSet( getExportInfo() );
2281 Reference
< beans::XPropertySetInfo
> xInfoSetInfo( xInfoSet
->getPropertySetInfo() );
2285 if( xInfoSetInfo
->hasPropertyByName( msPageLayoutNames
) )
2287 aAny
<<= maDrawPagesAutoLayoutNames
;
2288 xInfoSet
->setPropertyValue( msPageLayoutNames
, aAny
);
2293 //////////////////////////////////////////////////////////////////////////////
2295 void SdXMLExport::_ExportAutoStyles()
2297 Reference
< beans::XPropertySet
> xInfoSet( getExportInfo() );
2300 Reference
< beans::XPropertySetInfo
> xInfoSetInfo( xInfoSet
->getPropertySetInfo() );
2302 if( xInfoSetInfo
->hasPropertyByName( msPageLayoutNames
) )
2304 xInfoSet
->getPropertyValue( msPageLayoutNames
) >>= maDrawPagesAutoLayoutNames
;
2308 GetPropertySetMapper()->SetAutoStyles( sal_True
);
2310 if( getExportFlags() & EXPORT_STYLES
)
2312 // #80012# PageMaster export moved from _ExportStyles
2313 // prepare page-master infos
2314 ImpPrepPageMasterInfos();
2316 // write page-master infos
2317 ImpWritePageMasterInfos();
2319 // prepare draw:style-name for master page export
2320 ImpPrepMasterPageInfos();
2323 if( getExportFlags() & EXPORT_CONTENT
)
2325 // prepare draw:style-name for page export
2326 ImpPrepDrawPageInfos();
2329 // export draw-page styles
2330 GetAutoStylePool()->exportXML(
2331 XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID
2333 GetMM100UnitConverter(),
2337 if( getExportFlags() & EXPORT_STYLES
)
2339 // create auto style infos for shapes on master handout page
2342 Reference
< presentation::XHandoutMasterSupplier
> xHandoutSupp( GetModel(), UNO_QUERY
);
2343 if( xHandoutSupp
.is() )
2345 Reference
< XDrawPage
> xHandoutPage( xHandoutSupp
->getHandoutMasterPage() );
2346 if( xHandoutPage
.is() )
2348 Reference
< drawing::XShapes
> xShapes(xHandoutPage
, UNO_QUERY
);
2349 if(xShapes
.is() && xShapes
->getCount())
2350 GetShapeExport()->collectShapesAutoStyles( xShapes
);
2355 // create auto style infos for objects on master pages
2356 for(sal_Int32
nMPageId(0L); nMPageId
< mnDocMasterPageCount
; nMPageId
++)
2358 Any
aAny(mxDocMasterPages
->getByIndex(nMPageId
));
2359 Reference
< XDrawPage
> xMasterPage
;
2361 if((aAny
>>= xMasterPage
) && xMasterPage
.is() )
2363 // collect layer information
2364 GetFormExport()->examineForms( xMasterPage
);
2366 // get MasterPage Name
2367 OUString aMasterPageNamePrefix
;
2368 Reference
< container::XNamed
> xNamed(xMasterPage
, UNO_QUERY
);
2371 aMasterPageNamePrefix
= xNamed
->getName();
2373 if(aMasterPageNamePrefix
.getLength())
2375 aMasterPageNamePrefix
+= OUString(RTL_CONSTASCII_USTRINGPARAM("-"));
2377 GetShapeExport()->setPresentationStylePrefix( aMasterPageNamePrefix
);
2379 Reference
< drawing::XShapes
> xMasterShapes(xMasterPage
, UNO_QUERY
);
2380 if(xMasterShapes
.is() && xMasterShapes
->getCount())
2381 GetShapeExport()->collectShapesAutoStyles( xMasterShapes
);
2385 Reference
< presentation::XPresentationPage
> xPresPage(xMasterPage
, UNO_QUERY
);
2388 Reference
< XDrawPage
> xNotesPage(xPresPage
->getNotesPage());
2391 // collect layer information
2392 GetFormExport()->examineForms( xNotesPage
);
2394 Reference
< drawing::XShapes
> xShapes(xNotesPage
, UNO_QUERY
);
2395 if(xShapes
.is() && xShapes
->getCount())
2396 GetShapeExport()->collectShapesAutoStyles( xShapes
);
2404 if( getExportFlags() & EXPORT_CONTENT
)
2406 // prepare animations exporter if impress
2407 if(IsImpress() && ((getExportFlags() & EXPORT_OASIS
) == 0) )
2409 UniReference
< XMLAnimationsExporter
> xAnimExport
= new XMLAnimationsExporter( GetShapeExport().get() );
2410 GetShapeExport()->setAnimationsExporter( xAnimExport
);
2413 // create auto style infos for objects on pages
2414 for(sal_Int32
nPageInd(0); nPageInd
< mnDocDrawPageCount
; nPageInd
++)
2416 Any
aAny(mxDocDrawPages
->getByIndex(nPageInd
));
2417 Reference
<XDrawPage
> xDrawPage
;
2419 if((aAny
>>= xDrawPage
) && xDrawPage
.is() )
2421 // collect layer information
2422 GetFormExport()->examineForms( xDrawPage
);
2424 // get MasterPage Name
2425 OUString aMasterPageNamePrefix
;
2426 Reference
< drawing::XMasterPageTarget
> xMasterPageInt(xDrawPage
, UNO_QUERY
);
2427 if(xMasterPageInt
.is())
2429 Reference
<XDrawPage
> xUsedMasterPage(xMasterPageInt
->getMasterPage());
2430 if(xUsedMasterPage
.is())
2432 Reference
< container::XNamed
> xMasterNamed(xUsedMasterPage
, UNO_QUERY
);
2433 if(xMasterNamed
.is())
2435 aMasterPageNamePrefix
= xMasterNamed
->getName();
2439 if(aMasterPageNamePrefix
.getLength())
2441 aMasterPageNamePrefix
+= OUString(RTL_CONSTASCII_USTRINGPARAM("-"));
2444 GetShapeExport()->setPresentationStylePrefix( aMasterPageNamePrefix
);
2446 // prepare object infos
2447 Reference
< drawing::XShapes
> xDrawShapes(xDrawPage
, UNO_QUERY
);
2448 if(xDrawShapes
.is() && xDrawShapes
->getCount())
2449 GetShapeExport()->collectShapesAutoStyles( xDrawShapes
);
2451 // prepare presentation notes page object infos (ONLY if presentation)
2454 Reference
< presentation::XPresentationPage
> xPresPage(xDrawPage
, UNO_QUERY
);
2457 Reference
< XDrawPage
> xNotesPage(xPresPage
->getNotesPage());
2460 // collect layer information
2461 GetFormExport()->examineForms( xNotesPage
);
2463 Reference
< drawing::XShapes
> xShapes(xNotesPage
, UNO_QUERY
);
2464 if(xShapes
.is() && xShapes
->getCount())
2465 GetShapeExport()->collectShapesAutoStyles( xShapes
);
2473 UniReference
< XMLAnimationsExporter
> xAnimExport
;
2474 GetShapeExport()->setAnimationsExporter( xAnimExport
);
2478 exportAutoDataStyles();
2480 GetShapeExport()->exportAutoStyles();
2482 sal_uInt16 nContentAutostyles
= EXPORT_CONTENT
| EXPORT_AUTOSTYLES
;
2483 if ( ( getExportFlags() & nContentAutostyles
) == nContentAutostyles
)
2484 GetFormExport()->exportAutoStyles( );
2487 GetTextParagraphExport()->exportTextAutoStyles();
2490 //////////////////////////////////////////////////////////////////////////////
2492 void SdXMLExport::_ExportMasterStyles()
2495 SdXMLayerExporter::exportLayer( *this );
2497 // export handout master page if impress
2500 Reference
< presentation::XHandoutMasterSupplier
> xHandoutSupp( GetModel(), UNO_QUERY
);
2501 if( xHandoutSupp
.is() )
2503 Reference
< XDrawPage
> xHandoutPage( xHandoutSupp
->getHandoutMasterPage() );
2504 if( xHandoutPage
.is() )
2506 // presentation:page-layout-name
2507 if( IsImpress() && maDrawPagesAutoLayoutNames
[0].getLength())
2509 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_PRESENTATION_PAGE_LAYOUT_NAME
, EncodeStyleName( maDrawPagesAutoLayoutNames
[0] ));
2512 ImpXMLEXPPageMasterInfo
* pInfo
= mpHandoutPageMaster
;
2515 OUString sString
= pInfo
->GetName();
2516 AddAttribute(XML_NAMESPACE_STYLE
, XML_PAGE_LAYOUT_NAME
, sString
);
2520 if( maHandoutMasterStyleName
.getLength() )
2521 AddAttribute(XML_NAMESPACE_DRAW
, XML_STYLE_NAME
, maHandoutMasterStyleName
);
2523 ImplExportHeaderFooterDeclAttributes( maHandoutPageHeaderFooterSettings
);
2526 SvXMLElementExport
aMPG(*this, XML_NAMESPACE_STYLE
, XML_HANDOUT_MASTER
, sal_True
, sal_True
);
2528 // write graphic objects on this master page (if any)
2529 Reference
< drawing::XShapes
> xShapes(xHandoutPage
, UNO_QUERY
);
2530 if(xShapes
.is() && xShapes
->getCount())
2531 GetShapeExport()->exportShapes( xShapes
);
2536 // export MasterPages in master-styles section
2537 for(sal_Int32 nMPageId
= 0L; nMPageId
< mnDocMasterPageCount
; nMPageId
++)
2539 Any
aAny(mxDocMasterPages
->getByIndex(nMPageId
));
2540 Reference
< XDrawPage
> xMasterPage
;
2542 if((aAny
>>= xMasterPage
) && xMasterPage
.is())
2544 // prepare masterpage attributes
2545 OUString sMasterPageName
;
2546 Reference
< container::XNamed
> xNamed(xMasterPage
, UNO_QUERY
);
2549 sal_Bool bEncoded
= sal_False
;
2550 sMasterPageName
= xNamed
->getName();
2551 AddAttribute(XML_NAMESPACE_STYLE
, XML_NAME
,
2552 EncodeStyleName( sMasterPageName
, &bEncoded
));
2555 XML_NAMESPACE_STYLE
, XML_DISPLAY_NAME
,
2559 ImpXMLEXPPageMasterInfo
* pInfo
= mpPageMasterUsageList
->GetObject(nMPageId
);
2562 OUString sString
= pInfo
->GetName();
2563 AddAttribute(XML_NAMESPACE_STYLE
, XML_PAGE_LAYOUT_NAME
, sString
);
2566 // draw:style-name (background attributes)
2567 if( maMasterPagesStyleNames
[nMPageId
].getLength() )
2568 AddAttribute(XML_NAMESPACE_DRAW
, XML_STYLE_NAME
,
2569 maMasterPagesStyleNames
[nMPageId
]);
2572 SvXMLElementExport
aMPG(*this, XML_NAMESPACE_STYLE
, XML_MASTER_PAGE
, sal_True
, sal_True
);
2574 // write optional office:forms
2575 exportFormsElement( xMasterPage
);
2577 // write graphic objects on this master page (if any)
2578 Reference
< drawing::XShapes
> xMasterShapes(xMasterPage
, UNO_QUERY
);
2579 if(xMasterShapes
.is() && xMasterShapes
->getCount())
2580 GetShapeExport()->exportShapes( xMasterShapes
);
2582 // write presentation notes (ONLY if presentation)
2585 Reference
< presentation::XPresentationPage
> xPresPage(xMasterPage
, UNO_QUERY
);
2588 Reference
< XDrawPage
> xNotesPage(xPresPage
->getNotesPage());
2591 Reference
< drawing::XShapes
> xShapes(xNotesPage
, UNO_QUERY
);
2594 ImpXMLEXPPageMasterInfo
* pMasterInfo
= mpNotesPageMasterUsageList
->GetObject(nMPageId
);
2597 OUString sString
= pMasterInfo
->GetName();
2598 AddAttribute(XML_NAMESPACE_STYLE
, XML_PAGE_LAYOUT_NAME
, sString
);
2601 // write presentation notes
2602 SvXMLElementExport
aPSY(*this, XML_NAMESPACE_PRESENTATION
, XML_NOTES
, sal_True
, sal_True
);
2604 // write optional office:forms
2605 exportFormsElement( xNotesPage
);
2607 // write shapes per se
2608 GetShapeExport()->exportShapes( xShapes
);
2617 void SdXMLExport::exportFormsElement( Reference
< XDrawPage
> xDrawPage
)
2619 if( xDrawPage
.is() )
2621 Reference
< form::XFormsSupplier2
> xFormsSupplier( xDrawPage
, UNO_QUERY
);
2622 if ( xFormsSupplier
.is() && xFormsSupplier
->hasForms() )
2625 ::xmloff::OOfficeFormsExport
aForms(*this);
2626 GetFormExport()->exportForms( xDrawPage
);
2629 if(! GetFormExport()->seekPage( xDrawPage
) )
2631 DBG_ERROR( "OFormLayerXMLExport::seekPage failed!" );
2636 void SdXMLExport::GetViewSettings(uno::Sequence
<beans::PropertyValue
>& rProps
)
2639 beans::PropertyValue
* pProps
= rProps
.getArray();
2642 // SvXMLElementExport aViewSettingsElem(*this, XML_NAMESPACE_DRAW, XML_VIEW_SETTINGS, sal_True, sal_True);
2644 Reference
< beans::XPropertySet
> xPropSet( GetModel(), UNO_QUERY
);
2645 if( !xPropSet
.is() )
2648 awt::Rectangle aVisArea
;
2649 xPropSet
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ) ) >>= aVisArea
;
2652 xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "MapUnit" ) ) ) >>= nMapUnit;
2656 pProps
[i
].Name
= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaTop"));
2657 pProps
[i
++].Value
<<= aVisArea
.Y
;
2658 pProps
[i
].Name
= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaLeft"));
2659 pProps
[i
++].Value
<<= aVisArea
.X
;
2660 pProps
[i
].Name
= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaWidth"));
2661 pProps
[i
++].Value
<<= aVisArea
.Width
;
2662 pProps
[i
].Name
= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaHeight"));
2663 pProps
[i
++].Value
<<= aVisArea
.Height
;
2667 void SdXMLExport::GetConfigurationSettings(uno::Sequence
<beans::PropertyValue
>& rProps
)
2669 Reference
< lang::XMultiServiceFactory
> xFac( GetModel(), UNO_QUERY
);
2672 Reference
< beans::XPropertySet
> xProps( xFac
->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.Settings" ) ) ), UNO_QUERY
);
2674 SvXMLUnitConverter::convertPropertySet( rProps
, xProps
);
2678 //////////////////////////////////////////////////////////////////////////////
2680 void SdXMLExport::addDataStyle(const sal_Int32 nNumberFormat
, sal_Bool bTimeFormat
)
2682 sal_Int32 nFormat
= nNumberFormat
;
2683 if( (nNumberFormat
> 1) && (nNumberFormat
<= 0x0f) )
2688 if( maUsedTimeStyles
.count( nFormat
) == 0 )
2689 maUsedTimeStyles
.insert( nFormat
);
2693 if( maUsedDateStyles
.count( nFormat
) == 0 )
2694 maUsedDateStyles
.insert( nFormat
);
2698 //////////////////////////////////////////////////////////////////////////////
2700 void SdXMLExport::exportDataStyles()
2702 // there are no data styles to export in draw/impress yet
2705 //////////////////////////////////////////////////////////////////////////////
2707 void SdXMLExport::exportAutoDataStyles()
2709 SdXMLFormatMap::iterator
aIter( maUsedDateStyles
.begin() );
2710 SdXMLFormatMap::iterator
aEnd( maUsedDateStyles
.end() );
2712 while( aIter
!= aEnd
)
2713 SdXMLNumberStylesExporter::exportDateStyle( *this, (*aIter
++) );
2715 aIter
= maUsedTimeStyles
.begin();
2716 aEnd
= maUsedTimeStyles
.end();
2717 while( aIter
!= aEnd
)
2718 SdXMLNumberStylesExporter::exportTimeStyle( *this, (*aIter
++) );
2721 GetFormExport()->exportAutoControlNumberStyles();
2724 //////////////////////////////////////////////////////////////////////////////
2726 OUString
SdXMLExport::getDataStyleName(const sal_Int32 nNumberFormat
, sal_Bool bTimeFormat
) const
2730 return SdXMLNumberStylesExporter::getTimeStyleName( nNumberFormat
);
2734 return SdXMLNumberStylesExporter::getDateStyleName( nNumberFormat
);
2738 OUString
SdXMLExport::getNavigationOrder( const Reference
< XDrawPage
>& xDrawPage
)
2740 OUStringBuffer sNavOrder
;
2743 Reference
< XPropertySet
> xSet( xDrawPage
, UNO_QUERY_THROW
);
2744 Reference
< XIndexAccess
> xNavOrder( xSet
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "NavigationOrder" ) ) ), UNO_QUERY_THROW
);
2746 Reference
< XIndexAccess
> xZOrderAccess( xDrawPage
, UNO_QUERY
);
2748 // only export navigation order if it is different from the z-order
2749 if( (xNavOrder
.get() != xZOrderAccess
.get()) && (xNavOrder
->getCount() == xDrawPage
->getCount()) )
2752 const sal_Int32 nCount
= xNavOrder
->getCount();
2753 for( nIndex
= 0; nIndex
< nCount
; ++nIndex
)
2755 OUString
sId( getInterfaceToIdentifierMapper().registerReference( Reference
< XInterface
>( xNavOrder
->getByIndex( nIndex
), UNO_QUERY
) ) );
2756 if( sId
.getLength() != 0 )
2758 if( sNavOrder
.getLength() != 0 )
2759 sNavOrder
.append( (sal_Unicode
)' ' );
2760 sNavOrder
.append( sId
);
2768 return sNavOrder
.makeStringAndClear();
2771 //////////////////////////////////////////////////////////////////////////////
2773 #define SERVICE( classname, servicename, implementationname, draw, flags )\
2774 uno::Sequence< OUString > SAL_CALL classname##_getSupportedServiceNames() throw()\
2776 const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( servicename ) );\
2777 const uno::Sequence< OUString > aSeq( &aServiceName, 1 );\
2780 OUString SAL_CALL classname##_getImplementationName() throw()\
2782 return OUString( RTL_CONSTASCII_USTRINGPARAM( implementationname ) );\
2784 uno::Reference< uno::XInterface > SAL_CALL classname##_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )\
2786 return (cppu::OWeakObject*)new SdXMLExport( rSMgr, draw, flags );\
2789 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
);
2790 SERVICE( XMLImpressStylesExportOasis
, "com.sun.star.comp.Impress.XMLOasisStylesExporter", "XMLImpressStylesExportOasis", sal_False
, EXPORT_OASIS
|EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
);
2791 SERVICE( XMLImpressContentExportOasis
, "com.sun.star.comp.Impress.XMLOasisContentExporter", "XMLImpressContentExportOasis", sal_False
, EXPORT_OASIS
|EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_FONTDECLS
);
2792 SERVICE( XMLImpressMetaExportOasis
, "com.sun.star.comp.Impress.XMLOasisMetaExporter", "XMLImpressMetaExportOasis", sal_False
, EXPORT_OASIS
|EXPORT_META
);
2793 SERVICE( XMLImpressSettingsExportOasis
, "com.sun.star.comp.Impress.XMLOasisSettingsExporter", "XMLImpressSettingsExportOasis", sal_False
, EXPORT_OASIS
|EXPORT_SETTINGS
);
2795 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
);
2796 SERVICE( XMLImpressStylesExportOOO
, "com.sun.star.comp.Impress.XMLStylesExporter", "XMLImpressStylesExportOOO", sal_False
, EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
);
2797 SERVICE( XMLImpressContentExportOOO
, "com.sun.star.comp.Impress.XMLContentExporter", "XMLImpressContentExportOOO", sal_False
, EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_FONTDECLS
);
2798 SERVICE( XMLImpressMetaExportOOO
, "com.sun.star.comp.Impress.XMLMetaExporter", "XMLImpressMetaExportOOO", sal_False
, EXPORT_META
);
2799 SERVICE( XMLImpressSettingsExportOOO
, "com.sun.star.comp.Impress.XMLSettingsExporter", "XMLImpressSettingsExportOOO", sal_False
, EXPORT_SETTINGS
);
2801 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
);
2802 SERVICE( XMLDrawStylesExportOasis
, "com.sun.star.comp.Draw.XMLOasisStylesExporter", "XMLDrawStylesExportOasis", sal_True
, EXPORT_OASIS
|EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
);
2803 SERVICE( XMLDrawContentExportOasis
, "com.sun.star.comp.Draw.XMLOasisContentExporter", "XMLDrawContentExportOasis", sal_True
, EXPORT_OASIS
|EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_FONTDECLS
);
2804 SERVICE( XMLDrawMetaExportOasis
, "com.sun.star.comp.Draw.XMLOasisMetaExporter", "XMLDrawMetaExportOasis", sal_True
, EXPORT_OASIS
|EXPORT_META
);
2805 SERVICE( XMLDrawSettingsExportOasis
, "com.sun.star.comp.Draw.XMLOasisSettingsExporter", "XMLDrawSettingsExportOasis", sal_True
, EXPORT_OASIS
|EXPORT_SETTINGS
);
2807 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
);
2808 SERVICE( XMLDrawStylesExportOOO
, "com.sun.star.comp.Draw.XMLStylesExporter", "XMLDrawStylesExportOOO", sal_True
, EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
);
2809 SERVICE( XMLDrawContentExportOOO
, "com.sun.star.comp.Draw.XMLContentExporter", "XMLDrawContentExportOOO", sal_True
, EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_FONTDECLS
);
2810 SERVICE( XMLDrawMetaExportOOO
, "com.sun.star.comp.Draw.XMLMetaExporter", "XMLDrawMetaExportOOO", sal_True
, EXPORT_META
);
2811 SERVICE( XMLDrawSettingsExportOOO
, "com.sun.star.comp.Draw.XMLSettingsExporter", "XMLDrawSettingsExportOOO", sal_True
, EXPORT_SETTINGS
);
2813 SERVICE( XMLDrawingLayerExport
, "com.sun.star.comp.DrawingLayer.XMLExporter", "XMLDrawingLayerExport", sal_True
, EXPORT_OASIS
|EXPORT_STYLES
|EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_FONTDECLS
|EXPORT_EMBEDDED
);
2814 SERVICE( XMLImpressClipboardExport
, "com.sun.star.comp.Impress.XMLClipboardExporter", "XMLImpressClipboardExport", sal_False
, EXPORT_OASIS
|EXPORT_STYLES
|EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_FONTDECLS
|EXPORT_EMBEDDED
);
2817 OUString SAL_CALL
SdXMLExport::getImplementationName() throw( uno::RuntimeException
)
2823 switch( getExportFlags())
2825 case EXPORT_META
|EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_SETTINGS
|EXPORT_FONTDECLS
|EXPORT_EMBEDDED
:
2826 return XMLDrawExportOOO_getImplementationName();
2827 case EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
:
2828 return XMLDrawStylesExportOOO_getImplementationName();
2829 case EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_FONTDECLS
:
2830 return XMLDrawContentExportOOO_getImplementationName();
2832 return XMLDrawMetaExportOOO_getImplementationName();
2833 case EXPORT_SETTINGS
:
2834 return XMLDrawSettingsExportOOO_getImplementationName();
2836 case EXPORT_OASIS
|EXPORT_META
|EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_SETTINGS
|EXPORT_FONTDECLS
|EXPORT_EMBEDDED
:
2837 return XMLDrawExportOasis_getImplementationName();
2838 case EXPORT_OASIS
|EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
:
2839 return XMLDrawStylesExportOasis_getImplementationName();
2840 case EXPORT_OASIS
|EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_FONTDECLS
:
2841 return XMLDrawContentExportOasis_getImplementationName();
2842 case EXPORT_OASIS
|EXPORT_META
:
2843 return XMLDrawMetaExportOasis_getImplementationName();
2844 case EXPORT_OASIS
|EXPORT_SETTINGS
:
2845 return XMLDrawSettingsExportOasis_getImplementationName();
2848 return XMLDrawExportOOO_getImplementationName();
2855 switch( getExportFlags())
2857 case EXPORT_META
|EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_SETTINGS
|EXPORT_FONTDECLS
|EXPORT_EMBEDDED
:
2858 return XMLImpressExportOOO_getImplementationName();
2859 case EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
:
2860 return XMLImpressStylesExportOOO_getImplementationName();
2861 case EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_FONTDECLS
:
2862 return XMLImpressContentExportOOO_getImplementationName();
2864 return XMLImpressMetaExportOOO_getImplementationName();
2865 case EXPORT_SETTINGS
:
2866 return XMLImpressSettingsExportOOO_getImplementationName();
2867 case EXPORT_OASIS
|EXPORT_META
|EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_SETTINGS
|EXPORT_FONTDECLS
|EXPORT_EMBEDDED
:
2868 return XMLImpressExportOasis_getImplementationName();
2869 case EXPORT_OASIS
|EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
:
2870 return XMLImpressStylesExportOasis_getImplementationName();
2871 case EXPORT_OASIS
|EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_FONTDECLS
:
2872 return XMLImpressContentExportOasis_getImplementationName();
2873 case EXPORT_OASIS
|EXPORT_META
:
2874 return XMLImpressMetaExportOasis_getImplementationName();
2875 case EXPORT_OASIS
|EXPORT_SETTINGS
:
2876 return XMLImpressSettingsExportOasis_getImplementationName();
2879 return XMLImpressExportOOO_getImplementationName();