1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <xmloff/unointerfacetouniqueidentifiermapper.hxx>
21 #include <xmloff/nmspmap.hxx>
22 #include "xmloff/xmlnmspe.hxx"
23 #include <xmloff/xmluconv.hxx>
24 #include <xmloff/xmltoken.hxx>
25 #include <xmloff/xmlmetae.hxx>
26 #include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
27 #include <com/sun/star/presentation/XPresentationSupplier.hpp>
28 #include <com/sun/star/presentation/XCustomPresentationSupplier.hpp>
29 #include <com/sun/star/geometry/RealPoint2D.hpp>
30 #include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
31 #include <com/sun/star/office/XAnnotationAccess.hpp>
32 #include <com/sun/star/lang/Locale.hpp>
33 #include <com/sun/star/uno/Any.hxx>
34 #include "sdxmlexp_impl.hxx"
35 #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
36 #include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
37 #include <com/sun/star/presentation/XHandoutMasterSupplier.hpp>
38 #include <com/sun/star/container/XIndexContainer.hpp>
39 #include <com/sun/star/view/PaperOrientation.hpp>
40 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
41 #include <com/sun/star/style/XStyle.hpp>
43 #include <com/sun/star/form/XFormsSupplier2.hpp>
44 #include <com/sun/star/presentation/XPresentationPage.hpp>
45 #include <com/sun/star/drawing/XMasterPageTarget.hpp>
46 #include <com/sun/star/text/XText.hpp>
47 #include <com/sun/star/chart/XChartDocument.hpp>
48 #include <com/sun/star/animations/XAnimationNodeSupplier.hpp>
49 #include <com/sun/star/container/XNamed.hpp>
50 #include <com/sun/star/util/Duration.hpp>
51 #include <com/sun/star/util/MeasureUnit.hpp>
52 #include <rtl/ustrbuf.hxx>
53 #include <tools/gen.hxx>
54 #include <tools/debug.hxx>
55 #include <sax/tools/converter.hxx>
56 #include <xmloff/xmlaustp.hxx>
57 #include <xmloff/families.hxx>
58 #include <xmloff/styleexp.hxx>
59 #include <xmloff/settingsstore.hxx>
60 #include "sdpropls.hxx"
61 #include <xmloff/xmlexppr.hxx>
62 #include <com/sun/star/beans/XPropertyState.hpp>
63 #include "xexptran.hxx"
65 #include <cppuhelper/implbase1.hxx>
66 #include <comphelper/extract.hxx>
67 #include <com/sun/star/lang/XServiceInfo.hpp>
68 #include "PropertySetMerger.hxx"
69 #include "layerexp.hxx"
71 #include "XMLNumberStylesExport.hxx"
73 #include <xmloff/animationexport.hxx>
75 #include <com/sun/star/document/XDocumentProperties.hpp>
76 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
78 using ::rtl::OUString
;
79 using ::rtl::OUStringBuffer
;
81 using namespace ::com::sun::star
;
82 using namespace ::com::sun::star::uno
;
83 using namespace ::com::sun::star::beans
;
84 using namespace ::com::sun::star::util
;
85 using namespace ::com::sun::star::container
;
86 using namespace ::com::sun::star::drawing
;
87 using namespace ::com::sun::star::office
;
88 using namespace ::com::sun::star::presentation
;
89 using namespace ::com::sun::star::geometry
;
90 using namespace ::com::sun::star::text
;
91 using namespace ::xmloff::token
;
94 //////////////////////////////////////////////////////////////////////////////
96 class ImpXMLEXPPageMasterInfo
98 sal_Int32 mnBorderBottom
;
99 sal_Int32 mnBorderLeft
;
100 sal_Int32 mnBorderRight
;
101 sal_Int32 mnBorderTop
;
104 view::PaperOrientation meOrientation
;
106 OUString msMasterPageName
;
109 ImpXMLEXPPageMasterInfo(const SdXMLExport
& rExp
, const Reference
<XDrawPage
>& xPage
);
110 sal_Bool
operator==(const ImpXMLEXPPageMasterInfo
& rInfo
) const;
111 void SetName(const OUString
& rStr
);
113 const OUString
& GetName() const { return msName
; }
114 const OUString
& GetMasterPageName() const { return msMasterPageName
; }
116 sal_Int32
GetBorderBottom() const { return mnBorderBottom
; }
117 sal_Int32
GetBorderLeft() const { return mnBorderLeft
; }
118 sal_Int32
GetBorderRight() const { return mnBorderRight
; }
119 sal_Int32
GetBorderTop() const { return mnBorderTop
; }
120 sal_Int32
GetWidth() const { return mnWidth
; }
121 sal_Int32
GetHeight() const { return mnHeight
; }
122 view::PaperOrientation
GetOrientation() const { return meOrientation
; }
125 ImpXMLEXPPageMasterInfo::ImpXMLEXPPageMasterInfo(
126 const SdXMLExport
& rExp
,
127 const Reference
<XDrawPage
>& xPage
)
134 meOrientation(rExp
.IsDraw() ? view::PaperOrientation_PORTRAIT
: view::PaperOrientation_LANDSCAPE
)
136 Reference
<beans::XPropertySet
> xPropSet(xPage
, UNO_QUERY
);
141 Reference
< beans::XPropertySetInfo
> xPropsInfo( xPropSet
->getPropertySetInfo() );
142 if( xPropsInfo
.is() && xPropsInfo
->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderBottom") )))
144 aAny
= xPropSet
->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderBottom")));
145 aAny
>>= mnBorderBottom
;
147 aAny
= xPropSet
->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderLeft")));
148 aAny
>>= mnBorderLeft
;
150 aAny
= xPropSet
->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderRight")));
151 aAny
>>= mnBorderRight
;
153 aAny
= xPropSet
->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderTop")));
154 aAny
>>= mnBorderTop
;
157 if( xPropsInfo
.is() && xPropsInfo
->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("Width") )))
159 aAny
= xPropSet
->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Width")));
162 aAny
= xPropSet
->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Height")));
166 if( xPropsInfo
.is() && xPropsInfo
->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("Orientation") )))
168 aAny
= xPropSet
->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Orientation")));
169 aAny
>>= meOrientation
;
173 Reference
<container::XNamed
> xMasterNamed(xPage
, UNO_QUERY
);
174 if(xMasterNamed
.is())
176 msMasterPageName
= xMasterNamed
->getName();
180 sal_Bool
ImpXMLEXPPageMasterInfo::operator==(const ImpXMLEXPPageMasterInfo
& rInfo
) const
182 return ((mnBorderBottom
== rInfo
.mnBorderBottom
)
183 && (mnBorderLeft
== rInfo
.mnBorderLeft
)
184 && (mnBorderRight
== rInfo
.mnBorderRight
)
185 && (mnBorderTop
== rInfo
.mnBorderTop
)
186 && (mnWidth
== rInfo
.mnWidth
)
187 && (mnHeight
== rInfo
.mnHeight
)
188 && (meOrientation
== rInfo
.meOrientation
));
191 void ImpXMLEXPPageMasterInfo::SetName(const OUString
& rStr
)
196 //////////////////////////////////////////////////////////////////////////////
198 #define IMP_AUTOLAYOUT_INFO_MAX (35L)
200 class ImpXMLAutoLayoutInfo
203 ImpXMLEXPPageMasterInfo
* mpPageMasterInfo
;
204 OUString msLayoutName
;
205 Rectangle maTitleRect
;
206 Rectangle maPresRect
;
211 ImpXMLAutoLayoutInfo(sal_uInt16 nTyp
, ImpXMLEXPPageMasterInfo
* pInf
);
213 sal_Bool
operator==(const ImpXMLAutoLayoutInfo
& rInfo
) const;
215 sal_uInt16
GetLayoutType() const { return mnType
; }
216 sal_Int32
GetGapX() const { return mnGapX
; }
217 sal_Int32
GetGapY() const { return mnGapY
; }
219 const OUString
& GetLayoutName() const { return msLayoutName
; }
220 void SetLayoutName(const OUString
& rNew
) { msLayoutName
= rNew
; }
222 const Rectangle
& GetTitleRectangle() const { return maTitleRect
; }
223 const Rectangle
& GetPresRectangle() const { return maPresRect
; }
225 static sal_Bool
IsCreateNecessary(sal_uInt16 nTyp
);
228 sal_Bool
ImpXMLAutoLayoutInfo::IsCreateNecessary(sal_uInt16 nTyp
)
230 if(nTyp
== 5 /* AUTOLAYOUT_ORG */
231 || nTyp
== 20 /* AUTOLAYOUT_NONE */
232 || nTyp
>= IMP_AUTOLAYOUT_INFO_MAX
)
237 sal_Bool
ImpXMLAutoLayoutInfo::operator==(const ImpXMLAutoLayoutInfo
& rInfo
) const
239 return ((mnType
== rInfo
.mnType
240 && mpPageMasterInfo
== rInfo
.mpPageMasterInfo
));
243 ImpXMLAutoLayoutInfo::ImpXMLAutoLayoutInfo(sal_uInt16 nTyp
, ImpXMLEXPPageMasterInfo
* pInf
)
245 mpPageMasterInfo(pInf
)
247 // create full info (initialze with typical values)
249 Size
aPageSize(28000, 21000);
250 Size
aPageInnerSize(28000, 21000);
254 aPagePos
= Point(mpPageMasterInfo
->GetBorderLeft(), mpPageMasterInfo
->GetBorderTop());
255 aPageSize
= Size(mpPageMasterInfo
->GetWidth(), mpPageMasterInfo
->GetHeight());
256 aPageInnerSize
= aPageSize
;
257 aPageInnerSize
.Width() -= mpPageMasterInfo
->GetBorderLeft() + mpPageMasterInfo
->GetBorderRight();
258 aPageInnerSize
.Height() -= mpPageMasterInfo
->GetBorderTop() + mpPageMasterInfo
->GetBorderBottom();
261 // title rectangle aligning
262 Point
aTitlePos(aPagePos
);
263 Size
aTitleSize(aPageInnerSize
);
265 if(mnType
== 21 /* AUTOLAYOUT_NOTES */)
267 aTitleSize
.Height() = (long) (aTitleSize
.Height() / 2.5);
268 Point aPos
= aTitlePos
;
269 aPos
.Y() += long( aTitleSize
.Height() * 0.083 );
270 Size aPartArea
= aTitleSize
;
273 // scale handout rectangle using actual page size
274 double fH
= (double) aPartArea
.Width() / aPageSize
.Width();
275 double fV
= (double) aPartArea
.Height() / aPageSize
.Height();
279 aSize
.Width() = (long) (fH
* aPageSize
.Width());
280 aSize
.Height() = (long) (fH
* aPageSize
.Height());
282 aPos
.X() += (aPartArea
.Width() - aSize
.Width()) / 2;
283 aPos
.Y() += (aPartArea
.Height()- aSize
.Height())/ 2;
288 else if(mnType
== 27 || mnType
== 28)
290 // AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART or
291 // AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE
293 aTitlePos
.X() + long( aTitleSize
.Width() * 0.0735 ),
294 aTitlePos
.Y() + long( aTitleSize
.Height() * 0.083 ));
296 long( aTitleSize
.Width() * 0.854 ),
297 long( aTitleSize
.Height() * 0.167 ));
298 Point
aLPos(aPagePos
);
299 Size
aLSize(aPageInnerSize
);
301 aLPos
.X() + long( aLSize
.Width() * 0.0735 ),
302 aLPos
.Y() + long( aLSize
.Height() * 0.472 ));
304 long( aLSize
.Width() * 0.854 ),
305 long( aLSize
.Height() * 0.444 ));
307 aTitlePos
.X() = (aClassicTPos
.X() + aClassicTSize
.Width()) - aClassicTSize
.Height();
308 aTitlePos
.Y() = aClassicTPos
.Y();
309 aTitleSize
.Width() = aClassicTSize
.Height();
310 aTitleSize
.Height() = (aClassicLPos
.Y() + aClassicLSize
.Height()) - aClassicTPos
.Y();
314 aTitlePos
.X() += long( aTitleSize
.Width() * 0.0735 );
315 aTitlePos
.Y() += long( aTitleSize
.Height() * 0.083 );
316 aTitleSize
.Width() = long( aTitleSize
.Width() * 0.854 );
317 aTitleSize
.Height() = long( aTitleSize
.Height() * 0.167 );
320 maTitleRect
.SetPos(aTitlePos
);
321 maTitleRect
.SetSize(aTitleSize
);
323 // layout rectangle aligning
324 Point
aLayoutPos(aPagePos
);
325 Size
aLayoutSize(aPageInnerSize
);
327 if(mnType
== 21 /* AUTOLAYOUT_NOTES */)
329 aLayoutPos
.X() += long( aLayoutSize
.Width() * 0.0735 );
330 aLayoutPos
.Y() += long( aLayoutSize
.Height() * 0.472 );
331 aLayoutSize
.Width() = long( aLayoutSize
.Width() * 0.854 );
332 aLayoutSize
.Height() = long( aLayoutSize
.Height() * 0.444 );
334 else if((mnType
>= 22 && mnType
<= 26) || (mnType
== 31)) // AUTOLAYOUT_HANDOUT
336 // keep info for inner area in maPresRect, put info for gap size
337 // to maTitleRect position
338 mnGapX
= (aPageSize
.Width() - aPageInnerSize
.Width()) / 2;
339 mnGapY
= (aPageSize
.Height() - aPageInnerSize
.Height()) / 2;
342 mnGapX
= aPageSize
.Width() / 10;
345 mnGapY
= aPageSize
.Height() / 10;
347 if(mnGapX
< aPageInnerSize
.Width() / 10)
348 mnGapX
= aPageInnerSize
.Width() / 10;
350 if(mnGapY
< aPageInnerSize
.Height() / 10)
351 mnGapY
= aPageInnerSize
.Height() / 10;
353 else if(mnType
== 27 || mnType
== 28)
355 // AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART or
356 // AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE
358 aTitlePos
.X() + long( aTitleSize
.Width() * 0.0735 ),
359 aTitlePos
.Y() + long( aTitleSize
.Height() * 0.083 ));
361 long( aTitleSize
.Width() * 0.854 ),
362 long( aTitleSize
.Height() * 0.167 ));
364 aLayoutPos
.X() + long( aLayoutSize
.Width() * 0.0735 ),
365 aLayoutPos
.Y() + long( aLayoutSize
.Height() * 0.472 ));
367 long( aLayoutSize
.Width() * 0.854 ),
368 long( aLayoutSize
.Height() * 0.444 ));
370 aLayoutPos
.X() = aClassicLPos
.X();
371 aLayoutPos
.Y() = aClassicTPos
.Y();
372 aLayoutSize
.Width() = (aClassicLPos
.X() + aClassicLSize
.Width())
373 - (aClassicTSize
.Height() + (aClassicLPos
.Y() - (aClassicTPos
.Y() + aClassicTSize
.Height())));
374 aLayoutSize
.Height() = (aClassicLPos
.Y() + aClassicLSize
.Height()) - aClassicTPos
.Y();
376 else if( mnType
== 32 )
378 // AUTOLAYOUT_ONLY_TEXT
379 aLayoutPos
= aTitlePos
;
380 aLayoutSize
.Width() = aTitleSize
.Width();
381 aLayoutSize
.Height() = long( aLayoutSize
.Height() * 0.825 );
385 aLayoutPos
.X() += long( aLayoutSize
.Width() * 0.0735 );
386 aLayoutPos
.Y() += long( aLayoutSize
.Height() * 0.278 );
387 aLayoutSize
.Width() = long( aLayoutSize
.Width() * 0.854 );
388 aLayoutSize
.Height() = long( aLayoutSize
.Height() * 0.630 );
391 maPresRect
.SetPos(aLayoutPos
);
392 maPresRect
.SetSize(aLayoutSize
);
395 //////////////////////////////////////////////////////////////////////////////
398 SdXMLExport::SdXMLExport(
399 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xServiceFactory
,
400 sal_Bool bIsDraw
, sal_uInt16 nExportFlags
)
401 : SvXMLExport( util::MeasureUnit::CM
, xServiceFactory
,
402 (bIsDraw
) ? XML_GRAPHICS
: XML_PRESENTATION
, nExportFlags
),
403 mnDocMasterPageCount(0L),
404 mnDocDrawPageCount(0L),
405 mnShapeStyleInfoIndex(0L),
407 mpPageMasterInfoList(new ImpXMLEXPPageMasterList()),
408 mpPageMasterUsageList(new ImpXMLEXPPageMasterList()),
409 mpNotesPageMasterUsageList(new ImpXMLEXPPageMasterList()),
410 mpHandoutPageMaster(NULL
),
411 mpAutoLayoutInfoList(new ImpXMLAutoLayoutInfoList()),
412 mpSdPropHdlFactory(0L),
413 mpPropertySetMapper(0L),
414 mpPresPagePropsMapper(0L),
416 mbFamilyGraphicUsed(sal_False
),
417 mbFamilyPresentationUsed(sal_False
),
418 msZIndex( GetXMLToken(XML_ZINDEX
) ),
419 msEmptyPres( RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ),
420 msModel( RTL_CONSTASCII_USTRINGPARAM("Model") ),
421 msStartShape( RTL_CONSTASCII_USTRINGPARAM("StartShape") ),
422 msEndShape( RTL_CONSTASCII_USTRINGPARAM("EndShape") ),
423 msPageLayoutNames( RTL_CONSTASCII_USTRINGPARAM("PageLayoutNames") )
430 void SAL_CALL
SdXMLExport::setSourceDocument( const Reference
< lang::XComponent
>& xDoc
)
431 throw(lang::IllegalArgumentException
, uno::RuntimeException
)
433 SvXMLExport::setSourceDocument( xDoc
);
435 const OUString aEmpty
;
437 // prepare factory parts
438 mpSdPropHdlFactory
= new XMLSdPropHdlFactory( GetModel(), *this );
439 if(mpSdPropHdlFactory
)
441 // set lock to avoid deletion
442 mpSdPropHdlFactory
->acquire();
445 const UniReference
< XMLPropertyHandlerFactory
> aFactoryRef
= mpSdPropHdlFactory
;
447 // construct PropertySetMapper
448 UniReference
< XMLPropertySetMapper
> xMapper
= new XMLShapePropertySetMapper( aFactoryRef
);
450 // get or create text paragraph export
451 GetTextParagraphExport();
452 mpPropertySetMapper
= new XMLShapeExportPropertyMapper( xMapper
, *this );
453 // set lock to avoid deletion
454 mpPropertySetMapper
->acquire();
456 // chain text attributes
457 mpPropertySetMapper
->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(*this));
459 // construct PresPagePropsMapper
460 xMapper
= new XMLPropertySetMapper((XMLPropertyMapEntry
*)aXMLSDPresPageProps
, aFactoryRef
);
462 mpPresPagePropsMapper
= new XMLPageExportPropertyMapper( xMapper
, *this );
463 if(mpPresPagePropsMapper
)
465 // set lock to avoid deletion
466 mpPresPagePropsMapper
->acquire();
471 GetAutoStylePool()->AddFamily(
472 XML_STYLE_FAMILY_SD_GRAPHICS_ID
,
473 OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME
)),
474 GetPropertySetMapper(),
475 OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_PREFIX
)));
476 GetAutoStylePool()->AddFamily(
477 XML_STYLE_FAMILY_SD_PRESENTATION_ID
,
478 OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_NAME
)),
479 GetPropertySetMapper(),
480 OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_PREFIX
)));
481 GetAutoStylePool()->AddFamily(
482 XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID
,
483 OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME
)),
484 GetPresPagePropsMapper(),
485 OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_DRAWINGPAGE_PREFIX
)));
486 // prepare access to styles
487 Reference
< style::XStyleFamiliesSupplier
> xFamSup( GetModel(), UNO_QUERY
);
490 mxDocStyleFamilies
= xFamSup
->getStyleFamilies();
493 // prepare access to master pages
494 Reference
< drawing::XMasterPagesSupplier
> xMasterPagesSupplier(GetModel(), UNO_QUERY
);
495 if(xMasterPagesSupplier
.is())
497 mxDocMasterPages
= mxDocMasterPages
.query( xMasterPagesSupplier
->getMasterPages() );
498 if(mxDocMasterPages
.is())
500 mnDocMasterPageCount
= mxDocMasterPages
->getCount();
501 maMasterPagesStyleNames
.insert( maMasterPagesStyleNames
.begin(), mnDocMasterPageCount
, aEmpty
);
505 // prepare access to draw pages
506 Reference
<XDrawPagesSupplier
> xDrawPagesSupplier(GetModel(), UNO_QUERY
);
507 if(xDrawPagesSupplier
.is())
509 mxDocDrawPages
= mxDocDrawPages
.query( xDrawPagesSupplier
->getDrawPages() );
510 if(mxDocDrawPages
.is())
512 mnDocDrawPageCount
= mxDocDrawPages
->getCount();
513 maDrawPagesStyleNames
.insert( maDrawPagesStyleNames
.begin(), mnDocDrawPageCount
, aEmpty
);
514 maDrawNotesPagesStyleNames
.insert( maDrawNotesPagesStyleNames
.begin(), mnDocDrawPageCount
, aEmpty
);
516 maDrawPagesAutoLayoutNames
.realloc( mnDocDrawPageCount
+ 1 );
518 HeaderFooterPageSettingsImpl aEmptySettings
;
519 maDrawPagesHeaderFooterSettings
.insert( maDrawPagesHeaderFooterSettings
.begin(), mnDocDrawPageCount
, aEmptySettings
);
520 maDrawNotesPagesHeaderFooterSettings
.insert( maDrawNotesPagesHeaderFooterSettings
.begin(), mnDocDrawPageCount
, aEmptySettings
);
524 // #82003# count all draw objects for use with progress bar.
525 // #88245# init mnObjectCount once, use counter itself as flag. It
526 // is initialized to 0.
531 // #91587# add handout master count
532 Reference
<presentation::XHandoutMasterSupplier
> xHandoutSupp(GetModel(), UNO_QUERY
);
533 if(xHandoutSupp
.is())
535 Reference
<XDrawPage
> xHandoutPage(xHandoutSupp
->getHandoutMasterPage());
536 if(xHandoutPage
.is())
538 Reference
<drawing::XShapes
> xShapes(xHandoutPage
, UNO_QUERY
);
539 if(xShapes
.is() && xShapes
->getCount())
541 mnObjectCount
+= ImpRecursiveObjectCount(xShapes
);
547 if(mxDocMasterPages
.is())
549 for(sal_Int32
a(0); a
< mnDocMasterPageCount
; a
++)
551 Any
aAny(mxDocMasterPages
->getByIndex(a
));
552 Reference
< drawing::XShapes
> xMasterPage
;
554 if((aAny
>>= xMasterPage
) && xMasterPage
.is())
556 mnObjectCount
+= ImpRecursiveObjectCount(xMasterPage
);
561 // #91587# take notes pages from master pages into account
562 Reference
<presentation::XPresentationPage
> xPresPage
;
563 if((aAny
>>= xPresPage
) && xPresPage
.is())
565 Reference
<XDrawPage
> xNotesPage(xPresPage
->getNotesPage());
568 Reference
<drawing::XShapes
> xShapes(xNotesPage
, UNO_QUERY
);
569 if(xShapes
.is() && xShapes
->getCount())
571 mnObjectCount
+= ImpRecursiveObjectCount(xShapes
);
579 if(mxDocDrawPages
.is())
581 for(sal_Int32
a(0); a
< mnDocDrawPageCount
; a
++)
583 Any
aAny(mxDocDrawPages
->getByIndex(a
));
584 Reference
< drawing::XShapes
> xPage
;
586 if((aAny
>>= xPage
) && xPage
.is())
588 mnObjectCount
+= ImpRecursiveObjectCount(xPage
);
593 // #91587# take notes pages from draw pages into account
594 Reference
<presentation::XPresentationPage
> xPresPage
;
595 if((aAny
>>= xPresPage
) && xPresPage
.is())
597 Reference
<XDrawPage
> xNotesPage(xPresPage
->getNotesPage());
600 Reference
<drawing::XShapes
> xShapes(xNotesPage
, UNO_QUERY
);
601 if(xShapes
.is() && xShapes
->getCount())
603 mnObjectCount
+= ImpRecursiveObjectCount(xShapes
);
611 // #82003# init progress bar
612 GetProgressBarHelper()->SetReference(mnObjectCount
);
616 _GetNamespaceMap().Add(
617 GetXMLToken(XML_NP_PRESENTATION
),
618 GetXMLToken(XML_N_PRESENTATION
),
619 XML_NAMESPACE_PRESENTATION
);
621 _GetNamespaceMap().Add(
622 GetXMLToken(XML_NP_SMIL
),
623 GetXMLToken(XML_N_SMIL_COMPAT
),
626 _GetNamespaceMap().Add(
627 GetXMLToken(XML_NP_ANIMATION
),
628 GetXMLToken(XML_N_ANIMATION
),
629 XML_NAMESPACE_ANIMATION
);
631 if( getDefaultVersion() > SvtSaveOptions::ODFVER_012
)
633 _GetNamespaceMap().Add(
634 GetXMLToken(XML_NP_OFFICE_EXT
),
635 GetXMLToken(XML_N_OFFICE_EXT
),
636 XML_NAMESPACE_OFFICE_EXT
);
639 GetShapeExport()->enableLayerExport();
641 // #88546# enable progress bar increments
642 GetShapeExport()->enableHandleProgressBar();
645 //////////////////////////////////////////////////////////////////////////////
646 // #82003# helper function for recursive object count
647 sal_uInt32
SdXMLExport::ImpRecursiveObjectCount(Reference
< drawing::XShapes
> xShapes
)
649 sal_uInt32
nRetval(0L);
653 sal_Int32 nCount
= xShapes
->getCount();
655 for(sal_Int32
a(0L); a
< nCount
; a
++)
657 Any
aAny(xShapes
->getByIndex(a
));
658 Reference
< drawing::XShapes
> xGroup
;
660 if((aAny
>>= xGroup
) && xGroup
.is())
662 // #93180# count group objects, too.
663 nRetval
+= 1 + ImpRecursiveObjectCount(xGroup
);
675 //////////////////////////////////////////////////////////////////////////////
677 SdXMLExport::~SdXMLExport()
679 // cleanup factory, decrease refcount. Should lead to destruction.
680 if(mpSdPropHdlFactory
)
682 mpSdPropHdlFactory
->release();
683 mpSdPropHdlFactory
= 0L;
686 // cleanup mapper, decrease refcount. Should lead to destruction.
687 if(mpPropertySetMapper
)
689 mpPropertySetMapper
->release();
690 mpPropertySetMapper
= 0L;
693 // cleanup presPage mapper, decrease refcount. Should lead to destruction.
694 if(mpPresPagePropsMapper
)
696 mpPresPagePropsMapper
->release();
697 mpPresPagePropsMapper
= 0L;
700 // clear evtl. temporary page master infos
701 if(mpPageMasterUsageList
)
703 // note: all items in this list are also in mpPageMasterInfoList
704 delete mpPageMasterUsageList
;
705 mpPageMasterUsageList
= 0L;
708 if(mpNotesPageMasterUsageList
)
710 // note: all items in this list are also in mpPageMasterInfoList
711 delete mpNotesPageMasterUsageList
;
712 mpNotesPageMasterUsageList
= 0L;
715 if(mpPageMasterInfoList
)
717 for ( size_t i
= 0, n
= mpPageMasterInfoList
->size(); i
< n
; ++i
)
718 delete mpPageMasterInfoList
->at( i
);
719 mpPageMasterInfoList
->clear();
720 delete mpPageMasterInfoList
;
721 mpPageMasterInfoList
= 0L;
724 // clear auto-layout infos
725 if(mpAutoLayoutInfoList
)
727 for ( size_t i
= 0, n
= mpAutoLayoutInfoList
->size(); i
< n
; ++i
)
728 delete mpAutoLayoutInfoList
->at( i
);
729 mpAutoLayoutInfoList
->clear();
730 delete mpAutoLayoutInfoList
;
731 mpAutoLayoutInfoList
= 0L;
735 //////////////////////////////////////////////////////////////////////////////
737 void SdXMLExport::ImpPrepAutoLayoutInfos()
743 Reference
< presentation::XHandoutMasterSupplier
> xHandoutSupp( GetModel(), UNO_QUERY
);
744 if( xHandoutSupp
.is() )
746 Reference
< XDrawPage
> xHandoutPage( xHandoutSupp
->getHandoutMasterPage() );
747 if( xHandoutPage
.is() )
749 if(ImpPrepAutoLayoutInfo(xHandoutPage
, aStr
))
750 maDrawPagesAutoLayoutNames
[0] = aStr
;
754 // prepare name creation
755 for (sal_Int32 nCnt
= 0; nCnt
< mnDocDrawPageCount
; nCnt
++)
757 Any
aAny(mxDocDrawPages
->getByIndex(nCnt
));
758 Reference
<XDrawPage
> xDrawPage
;
760 if((aAny
>>= xDrawPage
) && xDrawPage
.is())
762 if(ImpPrepAutoLayoutInfo(xDrawPage
, aStr
))
763 maDrawPagesAutoLayoutNames
[nCnt
+1] = aStr
;
769 sal_Bool
SdXMLExport::ImpPrepAutoLayoutInfo(const Reference
<XDrawPage
>& xPage
, OUString
& rName
)
772 sal_Bool
bRetval(sal_False
);
774 Reference
<beans::XPropertySet
> xPropSet(xPage
, UNO_QUERY
);
777 sal_uInt16 nType
= sal_uInt16();
780 aAny
= xPropSet
->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Layout")));
783 if(ImpXMLAutoLayoutInfo::IsCreateNecessary(nType
))
785 ImpXMLEXPPageMasterInfo
* pInfo
= 0L;
787 // get master-page info
788 Reference
< drawing::XMasterPageTarget
> xMasterPageInt(xPage
, UNO_QUERY
);
789 if(xMasterPageInt
.is())
791 Reference
<XDrawPage
> xUsedMasterPage(xMasterPageInt
->getMasterPage());
792 if(xUsedMasterPage
.is())
794 Reference
< container::XNamed
> xMasterNamed(xUsedMasterPage
, UNO_QUERY
);
795 if(xMasterNamed
.is())
797 OUString sMasterPageName
= xMasterNamed
->getName();
798 pInfo
= ImpGetPageMasterInfoByName(sMasterPageName
);
803 // create entry and look for existance
804 ImpXMLAutoLayoutInfo
* pNew
= new ImpXMLAutoLayoutInfo(nType
, pInfo
);
805 sal_Bool
bDidExist(sal_False
);
807 for( size_t nCnt
= 0; !bDidExist
&& nCnt
< mpAutoLayoutInfoList
->size(); nCnt
++)
809 if( *mpAutoLayoutInfoList
->at( nCnt
) == *pNew
)
812 pNew
= mpAutoLayoutInfoList
->at( nCnt
);
813 bDidExist
= sal_True
;
819 mpAutoLayoutInfoList
->push_back( pNew
);
820 OUString sNewName
= OUString(RTL_CONSTASCII_USTRINGPARAM("AL"));
821 sNewName
+= OUString::valueOf(sal_Int32( mpAutoLayoutInfoList
->size() - 1 ));
822 sNewName
+= OUString(RTL_CONSTASCII_USTRINGPARAM("T"));
823 sNewName
+= OUString::valueOf(sal_Int32(nType
));
824 pNew
->SetLayoutName(sNewName
);
827 rName
= pNew
->GetLayoutName();
836 //////////////////////////////////////////////////////////////////////////////
838 void SdXMLExport::ImpWriteAutoLayoutInfos()
840 if( !mpAutoLayoutInfoList
->empty() )
842 for(size_t nCnt
= 0; nCnt
< mpAutoLayoutInfoList
->size(); nCnt
++)
844 ImpXMLAutoLayoutInfo
* pInfo
= mpAutoLayoutInfoList
->at( nCnt
);
847 // prepare presentation-page layout attributes, style-name
848 AddAttribute(XML_NAMESPACE_STYLE
, XML_NAME
, pInfo
->GetLayoutName());
850 // write draw-style attributes
851 SvXMLElementExport
aDSE(*this, XML_NAMESPACE_STYLE
, XML_PRESENTATION_PAGE_LAYOUT
, sal_True
, sal_True
);
853 // write presentation placeholders
854 switch(pInfo
->GetLayoutType())
856 case 0 : // AUTOLAYOUT_TITLE
858 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
859 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderSubtitle
, pInfo
->GetPresRectangle());
862 case 1 : // AUTOLAYOUT_ENUM
864 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
865 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, pInfo
->GetPresRectangle());
868 case 2 : // AUTOLAYOUT_CHART
870 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
871 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart
, pInfo
->GetPresRectangle());
874 case 3 : // AUTOLAYOUT_2TEXT
876 Rectangle
aLeft(pInfo
->GetPresRectangle());
877 aLeft
.setWidth(long(aLeft
.GetWidth() * 0.488));
878 Rectangle
aRight(aLeft
);
879 aRight
.Left() = long(aRight
.Left() + aRight
.GetWidth() * 1.05);
881 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
882 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aLeft
);
883 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aRight
);
886 case 4 : // AUTOLAYOUT_TEXTCHART
888 Rectangle
aLeft(pInfo
->GetPresRectangle());
889 aLeft
.setWidth(long(aLeft
.GetWidth() * 0.488));
890 Rectangle
aRight(aLeft
);
891 aRight
.Left() = long(aRight
.Left() + aRight
.GetWidth() * 1.05);
893 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
894 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aLeft
);
895 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart
, aRight
);
898 case 6 : // AUTOLAYOUT_TEXTCLIP
900 Rectangle
aLeft(pInfo
->GetPresRectangle());
901 aLeft
.setWidth(long(aLeft
.GetWidth() * 0.488));
902 Rectangle
aRight(aLeft
);
903 aRight
.Left() = long(aRight
.Left() + aRight
.GetWidth() * 1.05);
905 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
906 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aLeft
);
907 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aRight
);
910 case 7 : // AUTOLAYOUT_CHARTTEXT
912 Rectangle
aLeft(pInfo
->GetPresRectangle());
913 aLeft
.setWidth(long(aLeft
.GetWidth() * 0.488));
914 Rectangle
aRight(aLeft
);
915 aRight
.Left() = long(aRight
.Left() + aRight
.GetWidth() * 1.05);
917 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
918 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart
, aLeft
);
919 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aRight
);
922 case 8 : // AUTOLAYOUT_TAB
924 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
925 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTable
, pInfo
->GetPresRectangle());
928 case 9 : // AUTOLAYOUT_CLIPTEXT
930 Rectangle
aLeft(pInfo
->GetPresRectangle());
931 aLeft
.setWidth(long(aLeft
.GetWidth() * 0.488));
932 Rectangle
aRight(aLeft
);
933 aRight
.Left() = long(aRight
.Left() + aRight
.GetWidth() * 1.05);
935 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
936 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aLeft
);
937 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aRight
);
940 case 10 : // AUTOLAYOUT_TEXTOBJ
942 Rectangle
aLeft(pInfo
->GetPresRectangle());
943 aLeft
.setWidth(long(aLeft
.GetWidth() * 0.488));
944 Rectangle
aRight(aLeft
);
945 aRight
.Left() = long(aRight
.Left() + aRight
.GetWidth() * 1.05);
947 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
948 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aLeft
);
949 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aRight
);
952 case 11 : // AUTOLAYOUT_OBJ
954 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
955 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, pInfo
->GetPresRectangle());
958 case 12 : // AUTOLAYOUT_TEXT2OBJ
960 Rectangle
aLeft(pInfo
->GetPresRectangle());
961 aLeft
.setWidth(long(aLeft
.GetWidth() * 0.488));
962 Rectangle
aRightTop(aLeft
);
963 aRightTop
.Left() = long(aRightTop
.Left() + aRightTop
.GetWidth() * 1.05);
964 aRightTop
.setHeight(long(aRightTop
.GetHeight() * 0.477));
965 Rectangle
aRightBottom(aRightTop
);
966 aRightBottom
.Top() = long(aRightBottom
.Top() + aRightBottom
.GetHeight() * 1.095);
968 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
969 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aLeft
);
970 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aRightTop
);
971 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aRightBottom
);
974 case 13 : // AUTOLAYOUT_OBJTEXT
976 Rectangle
aLeft(pInfo
->GetPresRectangle());
977 aLeft
.setWidth(long(aLeft
.GetWidth() * 0.488));
978 Rectangle
aRight(aLeft
);
979 aRight
.Left() = long(aRight
.Left() + aRight
.GetWidth() * 1.05);
981 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
982 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aLeft
);
983 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aRight
);
986 case 14 : // AUTOLAYOUT_OBJOVERTEXT
988 Rectangle
aTop(pInfo
->GetPresRectangle());
989 aTop
.setHeight(long(aTop
.GetHeight() * 0.477));
990 Rectangle
aBottom(aTop
);
991 aBottom
.Top() = long(aBottom
.Top() + aBottom
.GetHeight() * 1.095);
993 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
994 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aTop
);
995 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aBottom
);
998 case 15 : // AUTOLAYOUT_2OBJTEXT
1000 Rectangle
aLeftTop(pInfo
->GetPresRectangle());
1001 aLeftTop
.setWidth(long(aLeftTop
.GetWidth() * 0.488));
1002 Rectangle
aRight(aLeftTop
);
1003 aRight
.Left() = long(aRight
.Left() + aRight
.GetWidth() * 1.05);
1004 aLeftTop
.setHeight(long(aLeftTop
.GetHeight() * 0.477));
1005 Rectangle
aLeftBottom(aLeftTop
);
1006 aLeftBottom
.Top() = long(aLeftBottom
.Top() + aLeftBottom
.GetHeight() * 1.095);
1008 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1009 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aLeftTop
);
1010 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aLeftBottom
);
1011 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aRight
);
1014 case 16 : // AUTOLAYOUT_2OBJOVERTEXT
1016 Rectangle
aTopLeft(pInfo
->GetPresRectangle());
1017 aTopLeft
.setHeight(long(aTopLeft
.GetHeight() * 0.477));
1018 Rectangle
aBottom(aTopLeft
);
1019 aBottom
.Top() = long(aBottom
.Top() + aBottom
.GetHeight() * 1.095);
1020 aTopLeft
.setWidth(long(aTopLeft
.GetWidth() * 0.488));
1021 Rectangle
aTopRight(aTopLeft
);
1022 aTopRight
.Left() = long(aTopRight
.Left() + aTopRight
.GetWidth() * 1.05);
1024 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1025 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aTopLeft
);
1026 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aTopRight
);
1027 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aBottom
);
1030 case 17 : // AUTOLAYOUT_TEXTOVEROBJ
1032 Rectangle
aTop(pInfo
->GetPresRectangle());
1033 aTop
.setHeight(long(aTop
.GetHeight() * 0.477));
1034 Rectangle
aBottom(aTop
);
1035 aBottom
.Top() = long(aBottom
.Top() + aBottom
.GetHeight() * 1.095);
1037 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1038 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline
, aTop
);
1039 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aBottom
);
1042 case 18 : // AUTOLAYOUT_4OBJ
1044 Rectangle
aTopLeft(pInfo
->GetPresRectangle());
1045 aTopLeft
.setHeight(long(aTopLeft
.GetHeight() * 0.477));
1046 aTopLeft
.setWidth(long(aTopLeft
.GetWidth() * 0.488));
1047 Rectangle
aBottomLeft(aTopLeft
);
1048 aBottomLeft
.Top() = long(aBottomLeft
.Top() + aBottomLeft
.GetHeight() * 1.095);
1049 Rectangle
aTopRight(aTopLeft
);
1050 aTopRight
.Left() = long(aTopRight
.Left() + aTopRight
.GetWidth() * 1.05);
1051 Rectangle
aBottomRight(aTopRight
);
1052 aBottomRight
.Top() = long(aBottomRight
.Top() + aBottomRight
.GetHeight() * 1.095);
1054 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1055 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aTopLeft
);
1056 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aTopRight
);
1057 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aBottomLeft
);
1058 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject
, aBottomRight
);
1061 case 19 : // AUTOLAYOUT_ONLY_TITLE
1063 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1066 case 21 : // AUTOLAYOUT_NOTES
1068 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderPage
, pInfo
->GetTitleRectangle());
1069 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderNotes
, pInfo
->GetPresRectangle());
1072 case 22 : // AUTOLAYOUT_HANDOUT1
1073 case 23 : // AUTOLAYOUT_HANDOUT2
1074 case 24 : // AUTOLAYOUT_HANDOUT3
1075 case 25 : // AUTOLAYOUT_HANDOUT4
1076 case 26 : // AUTOLAYOUT_HANDOUT6
1077 case 31 : // AUTOLAYOUT_HANDOUT9
1079 sal_Int32 nColCnt
, nRowCnt
;
1080 sal_Int32 nGapX
= pInfo
->GetGapX();
1081 sal_Int32 nGapY
= pInfo
->GetGapY();
1083 switch(pInfo
->GetLayoutType())
1085 case 22 : nColCnt
= 1; nRowCnt
= 1; break;
1086 case 23 : nColCnt
= 1; nRowCnt
= 2; break;
1087 case 24 : nColCnt
= 1; nRowCnt
= 3; break;
1088 case 25 : nColCnt
= 2; nRowCnt
= 2; break;
1089 case 26 : nColCnt
= 3; nRowCnt
= 2; break;
1090 case 31 : nColCnt
= 3; nRowCnt
= 3; break;
1091 default: nColCnt
= 0; nRowCnt
= 0; break; // FIXME - What is correct values?
1094 Size
aPartSize(pInfo
->GetTitleRectangle().GetSize());
1095 Point
aPartPos(pInfo
->GetTitleRectangle().TopLeft());
1097 if(aPartSize
.Width() > aPartSize
.Height())
1099 sal_Int32
nZwi(nColCnt
);
1104 aPartSize
.Width() = (aPartSize
.Width() - ((nColCnt
- 1) * nGapX
)) / nColCnt
;
1105 aPartSize
.Height() = (aPartSize
.Height() - ((nRowCnt
- 1) * nGapY
)) / nRowCnt
;
1107 Point
aTmpPos(aPartPos
);
1109 for (sal_Int32 a
= 0; a
< nRowCnt
; a
++)
1111 aTmpPos
.X() = aPartPos
.X();
1113 for (sal_Int32 b
= 0; b
< nColCnt
; b
++)
1115 Rectangle
aTmpRect(aTmpPos
, aPartSize
);
1117 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderHandout
, aTmpRect
);
1118 aTmpPos
.X() += aPartSize
.Width() + nGapX
;
1121 aTmpPos
.Y() += aPartSize
.Height() + nGapY
;
1125 case 27 : // AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART
1127 Rectangle
aTop(pInfo
->GetPresRectangle());
1128 aTop
.setHeight(long(aTop
.GetHeight() * 0.488));
1129 Rectangle
aBottom(aTop
);
1130 aBottom
.Top() = long(aBottom
.Top() + aBottom
.GetHeight() * 1.05);
1132 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalTitle
, pInfo
->GetTitleRectangle());
1133 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline
, aTop
);
1134 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart
, aBottom
);
1137 case 28 : // AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE
1139 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalTitle
, pInfo
->GetTitleRectangle());
1140 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline
, pInfo
->GetPresRectangle());
1143 case 29 : // AUTOLAYOUT_TITLE_VERTICAL_OUTLINE
1145 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1146 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline
, pInfo
->GetPresRectangle());
1149 case 30 : // AUTOLAYOUT_TITLE_VERTICAL_OUTLINE_CLIPART
1151 Rectangle
aLeft(pInfo
->GetPresRectangle());
1152 aLeft
.setWidth(long(aLeft
.GetWidth() * 0.488));
1153 Rectangle
aRight(aLeft
);
1154 aRight
.Left() = long(aRight
.Left() + aRight
.GetWidth() * 1.05);
1156 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1157 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aLeft
);
1158 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline
, aRight
);
1161 case 32 : // AUTOLAYOUT_TITLE
1163 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderSubtitle
, pInfo
->GetPresRectangle());
1167 case 33 : // AUTOLAYOUT_4CLIPART
1169 Rectangle
aTopLeft(pInfo
->GetPresRectangle());
1170 aTopLeft
.setHeight(long(aTopLeft
.GetHeight() * 0.477));
1171 aTopLeft
.setWidth(long(aTopLeft
.GetWidth() * 0.488));
1172 Rectangle
aBottomLeft(aTopLeft
);
1173 aBottomLeft
.Top() = long(aBottomLeft
.Top() + aBottomLeft
.GetHeight() * 1.095);
1174 Rectangle
aTopRight(aTopLeft
);
1175 aTopRight
.Left() = long(aTopRight
.Left() + aTopRight
.GetWidth() * 1.05);
1176 Rectangle
aBottomRight(aTopRight
);
1177 aBottomRight
.Top() = long(aBottomRight
.Top() + aBottomRight
.GetHeight() * 1.095);
1179 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1180 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aTopLeft
);
1181 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aTopRight
);
1182 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aBottomLeft
);
1183 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aBottomRight
);
1187 case 34 : // AUTOLAYOUT_6CLIPART
1189 Rectangle
aTopLeft(pInfo
->GetPresRectangle());
1190 aTopLeft
.setHeight(long(aTopLeft
.GetHeight() * 0.477));
1191 aTopLeft
.setWidth(long(aTopLeft
.GetWidth() * 0.322));
1192 Rectangle
aTopCenter(aTopLeft
);
1193 aTopCenter
.Left() = long(aTopCenter
.Left() + aTopCenter
.GetWidth() * 1.05);
1194 Rectangle
aTopRight(aTopLeft
);
1195 aTopRight
.Left() = long(aTopRight
.Left() + aTopRight
.GetWidth() * 2 * 1.05);
1197 Rectangle
aBottomLeft(aTopLeft
);
1198 aBottomLeft
.Top() = long(aBottomLeft
.Top() + aBottomLeft
.GetHeight() * 1.095);
1199 Rectangle
aBottomCenter(aTopCenter
);
1200 aBottomCenter
.Top() = long(aBottomCenter
.Top() + aBottomCenter
.GetHeight() * 1.095);
1201 Rectangle
aBottomRight(aTopRight
);
1202 aBottomRight
.Top() = long(aBottomRight
.Top() + aBottomRight
.GetHeight() * 1.095);
1204 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle
, pInfo
->GetTitleRectangle());
1205 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aTopLeft
);
1206 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aTopCenter
);
1207 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aTopRight
);
1208 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aBottomLeft
);
1209 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aBottomCenter
);
1210 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic
, aBottomRight
);
1215 OSL_FAIL("XMLEXP: unknown autolayout export");
1224 //////////////////////////////////////////////////////////////////////////////
1226 void SdXMLExport::ImpWriteAutoLayoutPlaceholder(XmlPlaceholder ePl
, const Rectangle
& rRect
)
1229 OUStringBuffer sStringBuffer
;
1231 // prepare presentation-placeholder attributes, presentation:object
1234 case XmlPlaceholderTitle
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("title")); break;
1235 case XmlPlaceholderOutline
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("outline")); break;
1236 case XmlPlaceholderSubtitle
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("subtitle")); break;
1237 case XmlPlaceholderText
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("text")); break;
1238 case XmlPlaceholderGraphic
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("graphic")); break;
1239 case XmlPlaceholderObject
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("object")); break;
1240 case XmlPlaceholderChart
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("chart")); break;
1241 case XmlPlaceholderOrgchart
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("orgchart")); break;
1242 case XmlPlaceholderTable
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("table")); break;
1243 case XmlPlaceholderPage
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("page")); break;
1244 case XmlPlaceholderNotes
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("notes")); break;
1245 case XmlPlaceholderHandout
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("handout")); break;
1246 case XmlPlaceholderVerticalTitle
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("vertical_title")); break;
1247 case XmlPlaceholderVerticalOutline
: aStr
= OUString(RTL_CONSTASCII_USTRINGPARAM("vertical_outline")); break;
1250 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_OBJECT
, aStr
);
1252 // svg:x,y,width,height
1253 GetMM100UnitConverter().convertMeasureToXML(sStringBuffer
, rRect
.Left());
1254 aStr
= sStringBuffer
.makeStringAndClear();
1255 AddAttribute(XML_NAMESPACE_SVG
, XML_X
, aStr
);
1257 GetMM100UnitConverter().convertMeasureToXML(sStringBuffer
, rRect
.Top());
1258 aStr
= sStringBuffer
.makeStringAndClear();
1259 AddAttribute(XML_NAMESPACE_SVG
, XML_Y
, aStr
);
1261 GetMM100UnitConverter().convertMeasureToXML(sStringBuffer
,
1263 aStr
= sStringBuffer
.makeStringAndClear();
1264 AddAttribute(XML_NAMESPACE_SVG
, XML_WIDTH
, aStr
);
1266 GetMM100UnitConverter().convertMeasureToXML(sStringBuffer
,
1268 aStr
= sStringBuffer
.makeStringAndClear();
1269 AddAttribute(XML_NAMESPACE_SVG
, XML_HEIGHT
, aStr
);
1271 // write presentation-placeholder
1272 SvXMLElementExport
aPPL(*this, XML_NAMESPACE_PRESENTATION
, XML_PLACEHOLDER
, sal_True
, sal_True
);
1275 //////////////////////////////////////////////////////////////////////////////
1277 ImpXMLEXPPageMasterInfo
* SdXMLExport::ImpGetOrCreatePageMasterInfo( Reference
< XDrawPage
> xMasterPage
)
1279 bool bDoesExist
= false;
1281 ImpXMLEXPPageMasterInfo
* pNewInfo
= new ImpXMLEXPPageMasterInfo(*this, xMasterPage
);
1283 // compare with prev page-master infos
1284 for( size_t a
= 0; !bDoesExist
&& a
< mpPageMasterInfoList
->size(); a
++)
1286 if ( mpPageMasterInfoList
->at(a
)
1287 && *mpPageMasterInfoList
->at(a
) == *pNewInfo
1291 pNewInfo
= mpPageMasterInfoList
->at(a
);
1295 // add entry when not found same page-master infos
1297 mpPageMasterInfoList
->push_back( pNewInfo
);
1302 void SdXMLExport::ImpPrepPageMasterInfos()
1306 // create page master info for handout master page
1308 Reference
< XHandoutMasterSupplier
> xHMS( GetModel(), UNO_QUERY
);
1311 Reference
< XDrawPage
> xMasterPage( xHMS
->getHandoutMasterPage() );
1312 if( xMasterPage
.is() )
1313 mpHandoutPageMaster
= ImpGetOrCreatePageMasterInfo(xMasterPage
);
1317 // create page master infos for master pages
1318 if(mnDocMasterPageCount
)
1320 // look for needed page-masters, create these
1321 for (sal_Int32 nMPageId
= 0; nMPageId
< mnDocMasterPageCount
; nMPageId
++)
1323 Reference
< XDrawPage
> xMasterPage( mxDocMasterPages
->getByIndex(nMPageId
), UNO_QUERY
);
1324 ImpXMLEXPPageMasterInfo
* pNewInfo
= 0L;
1326 if(xMasterPage
.is())
1327 pNewInfo
= ImpGetOrCreatePageMasterInfo(xMasterPage
);
1329 mpPageMasterUsageList
->push_back( pNewInfo
);
1331 // look for page master of handout page
1335 Reference
< presentation::XPresentationPage
> xPresPage(xMasterPage
, UNO_QUERY
);
1338 Reference
< XDrawPage
> xNotesPage(xPresPage
->getNotesPage());
1341 pNewInfo
= ImpGetOrCreatePageMasterInfo(xNotesPage
);
1344 mpNotesPageMasterUsageList
->push_back( pNewInfo
);
1350 //////////////////////////////////////////////////////////////////////////////
1352 void SdXMLExport::ImpWritePageMasterInfos()
1354 // write created page-masters, create names for these
1355 for( size_t nCnt
= 0; nCnt
< mpPageMasterInfoList
->size(); nCnt
++)
1357 ImpXMLEXPPageMasterInfo
* pInfo
= mpPageMasterInfoList
->at(nCnt
);
1361 OUString sNewName
= OUString(RTL_CONSTASCII_USTRINGPARAM("PM"));
1363 sNewName
+= OUString::valueOf((sal_Int32
)nCnt
);
1364 pInfo
->SetName(sNewName
);
1366 // prepare page-master attributes
1368 OUStringBuffer sStringBuffer
;
1371 AddAttribute(XML_NAMESPACE_STYLE
, XML_NAME
, sString
);
1373 // write page-layout
1374 SvXMLElementExport
aPME(*this, XML_NAMESPACE_STYLE
, XML_PAGE_LAYOUT
, sal_True
, sal_True
);
1376 // prepare style:properties inside page-master
1377 GetMM100UnitConverter().convertMeasureToXML(sStringBuffer
,
1378 pInfo
->GetBorderTop());
1379 sString
= sStringBuffer
.makeStringAndClear();
1380 AddAttribute(XML_NAMESPACE_FO
, XML_MARGIN_TOP
, sString
);
1382 GetMM100UnitConverter().convertMeasureToXML(sStringBuffer
,
1383 pInfo
->GetBorderBottom());
1384 sString
= sStringBuffer
.makeStringAndClear();
1385 AddAttribute(XML_NAMESPACE_FO
, XML_MARGIN_BOTTOM
, sString
);
1387 GetMM100UnitConverter().convertMeasureToXML(sStringBuffer
,
1388 pInfo
->GetBorderLeft());
1389 sString
= sStringBuffer
.makeStringAndClear();
1390 AddAttribute(XML_NAMESPACE_FO
, XML_MARGIN_LEFT
, sString
);
1392 GetMM100UnitConverter().convertMeasureToXML(sStringBuffer
,
1393 pInfo
->GetBorderRight());
1394 sString
= sStringBuffer
.makeStringAndClear();
1395 AddAttribute(XML_NAMESPACE_FO
, XML_MARGIN_RIGHT
, sString
);
1397 GetMM100UnitConverter().convertMeasureToXML(sStringBuffer
,
1399 sString
= sStringBuffer
.makeStringAndClear();
1400 AddAttribute(XML_NAMESPACE_FO
, XML_PAGE_WIDTH
, sString
);
1402 GetMM100UnitConverter().convertMeasureToXML(sStringBuffer
,
1403 pInfo
->GetHeight());
1404 sString
= sStringBuffer
.makeStringAndClear();
1405 AddAttribute(XML_NAMESPACE_FO
, XML_PAGE_HEIGHT
, sString
);
1407 if(pInfo
->GetOrientation() == view::PaperOrientation_PORTRAIT
)
1408 AddAttribute(XML_NAMESPACE_STYLE
, XML_PRINT_ORIENTATION
, XML_PORTRAIT
);
1410 AddAttribute(XML_NAMESPACE_STYLE
, XML_PRINT_ORIENTATION
, XML_LANDSCAPE
);
1412 // write style:properties
1413 SvXMLElementExport
aPMF(*this, XML_NAMESPACE_STYLE
, XML_PAGE_LAYOUT_PROPERTIES
, sal_True
, sal_True
);
1418 //////////////////////////////////////////////////////////////////////////////
1420 ImpXMLEXPPageMasterInfo
* SdXMLExport::ImpGetPageMasterInfoByName(const OUString
& rName
)
1422 if(!rName
.isEmpty() && !mpPageMasterInfoList
->empty())
1424 for( size_t nCnt
= 0; nCnt
< mpPageMasterInfoList
->size(); nCnt
++)
1426 ImpXMLEXPPageMasterInfo
* pInfo
= mpPageMasterInfoList
->at(nCnt
);
1429 if(!pInfo
->GetMasterPageName().isEmpty() && rName
.equals(pInfo
->GetMasterPageName()))
1439 //////////////////////////////////////////////////////////////////////////////
1441 void SdXMLExport::ImpPrepDrawPageInfos()
1443 // create draw:style-name entries for page export
1444 // containing presentation page attributes AND background attributes
1445 // fixed family for page-styles is "drawing-page" (XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME)
1448 for(nCnt
= 0; nCnt
< mnDocDrawPageCount
; nCnt
++)
1450 Reference
<XDrawPage
> xDrawPage
;
1451 mxDocDrawPages
->getByIndex(nCnt
) >>= xDrawPage
;
1452 maDrawPagesStyleNames
[nCnt
] = ImpCreatePresPageStyleName( xDrawPage
);
1454 Reference
< presentation::XPresentationPage
> xPresPage(xDrawPage
, UNO_QUERY
);
1457 maDrawNotesPagesStyleNames
[nCnt
] = ImpCreatePresPageStyleName( xPresPage
->getNotesPage(), false );
1459 maDrawPagesHeaderFooterSettings
[nCnt
] = ImpPrepDrawPageHeaderFooterDecls( xDrawPage
);
1460 maDrawNotesPagesHeaderFooterSettings
[nCnt
] = ImpPrepDrawPageHeaderFooterDecls( xPresPage
->getNotesPage() );
1465 //////////////////////////////////////////////////////////////////////////////
1467 static OUString
findOrAppendImpl( std::vector
< OUString
>& rVector
, const OUString
& rText
, const sal_Char
* pPrefix
)
1469 // search rVector if there is already a string that equals rText
1470 std::vector
< OUString
>::iterator aIter
;
1472 for( nIndex
= 1, aIter
= rVector
.begin(); aIter
!= rVector
.end(); ++aIter
, ++nIndex
)
1474 if( (*aIter
) == rText
)
1478 // if nothing is found, append the string at the end of rVector
1479 if( aIter
== rVector
.end() )
1480 rVector
.push_back( rText
);
1482 // create a reference string with pPrefix and the index of the
1483 // found or created rText
1484 OUString
aStr( OUString::createFromAscii( pPrefix
) );
1485 aStr
+= OUString::valueOf( nIndex
);
1489 static OUString
findOrAppendImpl( std::vector
< DateTimeDeclImpl
>& rVector
, const OUString
& rText
, sal_Bool bFixed
, sal_Int32 nFormat
, const sal_Char
* pPrefix
)
1491 // search rVector if there is already a DateTimeDeclImpl with rText,bFixed and nFormat
1492 std::vector
< DateTimeDeclImpl
>::iterator aIter
;
1494 for( nIndex
= 1, aIter
= rVector
.begin(); aIter
!= rVector
.end(); ++aIter
, ++nIndex
)
1496 const DateTimeDeclImpl
& rDecl
= (*aIter
);
1497 if( (rDecl
.mbFixed
== bFixed
) &&
1498 (!bFixed
|| rDecl
.maStrText
== rText
) &&
1499 (bFixed
|| (rDecl
.mnFormat
== nFormat
) ) )
1503 // if nothing is found, append a new DateTimeDeclImpl
1504 if( aIter
== rVector
.end() )
1506 DateTimeDeclImpl aDecl
;
1507 aDecl
.maStrText
= rText
;
1508 aDecl
.mbFixed
= bFixed
;
1509 aDecl
.mnFormat
= nFormat
;
1510 rVector
.push_back( aDecl
);
1513 // create a reference string with pPrefix and the index of the
1514 // found or created DateTimeDeclImpl
1515 OUString
aStr( OUString::createFromAscii( pPrefix
) );
1516 aStr
+= OUString::valueOf( nIndex
);
1521 static const sal_Char
* gpStrHeaderTextPrefix
= "hdr";
1522 static const sal_Char
* gpStrFooterTextPrefix
= "ftr";
1523 static const sal_Char
* gpStrDateTimeTextPrefix
= "dtd";
1525 HeaderFooterPageSettingsImpl
SdXMLExport::ImpPrepDrawPageHeaderFooterDecls( const Reference
<XDrawPage
>& xDrawPage
)
1527 HeaderFooterPageSettingsImpl aSettings
;
1529 if( xDrawPage
.is() ) try
1531 Reference
< XPropertySet
> xSet( xDrawPage
, UNO_QUERY_THROW
);
1532 Reference
< XPropertySetInfo
> xInfo( xSet
->getPropertySetInfo() );
1536 const OUString
aStrHeaderTextProp( RTL_CONSTASCII_USTRINGPARAM( "HeaderText" ) );
1537 if( xInfo
->hasPropertyByName( aStrHeaderTextProp
) )
1539 xSet
->getPropertyValue( aStrHeaderTextProp
) >>= aStrText
;
1540 if( !aStrText
.isEmpty() )
1541 aSettings
.maStrHeaderDeclName
= findOrAppendImpl( maHeaderDeclsVector
, aStrText
, gpStrHeaderTextPrefix
);
1544 const OUString
aStrFooterTextProp( RTL_CONSTASCII_USTRINGPARAM( "FooterText" ) );
1545 if( xInfo
->hasPropertyByName( aStrFooterTextProp
) )
1547 xSet
->getPropertyValue( aStrFooterTextProp
) >>= aStrText
;
1548 if( !aStrText
.isEmpty() )
1549 aSettings
.maStrFooterDeclName
= findOrAppendImpl( maFooterDeclsVector
, aStrText
, gpStrFooterTextPrefix
);
1552 const OUString
aStrDateTimeTextProp( RTL_CONSTASCII_USTRINGPARAM( "DateTimeText" ) );
1553 if( xInfo
->hasPropertyByName( aStrDateTimeTextProp
) )
1555 sal_Bool bFixed
= false;
1556 sal_Int32 nFormat
= 0;
1557 xSet
->getPropertyValue( aStrDateTimeTextProp
) >>= aStrText
;
1558 xSet
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDateTimeFixed" ) ) ) >>= bFixed
;
1559 xSet
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DateTimeFormat" ) ) ) >>= nFormat
;
1561 if( !bFixed
|| !aStrText
.isEmpty() )
1563 aSettings
.maStrDateTimeDeclName
= findOrAppendImpl( maDateTimeDeclsVector
, aStrText
, bFixed
, nFormat
, gpStrDateTimeTextPrefix
);
1565 addDataStyle( nFormat
);
1569 catch(const Exception
&)
1571 OSL_FAIL( "SdXMLExport::ImpPrepDrawPageHeaderFooterDecls(), unexpected exception cought!" );
1577 //////////////////////////////////////////////////////////////////////////////
1579 void SdXMLExport::ImpWriteHeaderFooterDecls()
1581 OUStringBuffer sBuffer
;
1583 if( !maHeaderDeclsVector
.empty() )
1585 // export header decls
1586 const OUString
aPrefix( OUString::createFromAscii( gpStrHeaderTextPrefix
) );
1587 std::vector
< OUString
>::iterator aIter
;
1589 for( nIndex
= 1, aIter
= maHeaderDeclsVector
.begin(); aIter
!= maHeaderDeclsVector
.end(); ++aIter
, ++nIndex
)
1591 sBuffer
.append( aPrefix
);
1592 sBuffer
.append( nIndex
);
1593 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_NAME
, sBuffer
.makeStringAndClear());
1595 SvXMLElementExport
aElem(*this, XML_NAMESPACE_PRESENTATION
, XML_HEADER_DECL
, sal_True
, sal_True
);
1596 Characters((*aIter
));
1600 if( !maFooterDeclsVector
.empty() )
1602 // export footer decls
1603 const OUString
aPrefix( OUString::createFromAscii( gpStrFooterTextPrefix
) );
1604 std::vector
< OUString
>::iterator aIter
;
1606 for( nIndex
= 1, aIter
= maFooterDeclsVector
.begin(); aIter
!= maFooterDeclsVector
.end(); ++aIter
, ++nIndex
)
1608 sBuffer
.append( aPrefix
);
1609 sBuffer
.append( nIndex
);
1610 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_NAME
, sBuffer
.makeStringAndClear());
1612 SvXMLElementExport
aElem(*this, XML_NAMESPACE_PRESENTATION
, XML_FOOTER_DECL
, sal_False
, sal_False
);
1613 Characters((*aIter
));
1617 if( !maDateTimeDeclsVector
.empty() )
1619 // export footer decls
1620 const OUString
aPrefix( OUString::createFromAscii( gpStrDateTimeTextPrefix
) );
1621 std::vector
< DateTimeDeclImpl
>::iterator aIter
;
1623 for( nIndex
= 1, aIter
= maDateTimeDeclsVector
.begin(); aIter
!= maDateTimeDeclsVector
.end(); ++aIter
, ++nIndex
)
1625 const DateTimeDeclImpl
& rDecl
= (*aIter
);
1627 sBuffer
.append( aPrefix
);
1628 sBuffer
.append( nIndex
);
1629 AddAttribute( XML_NAMESPACE_PRESENTATION
, XML_NAME
, sBuffer
.makeStringAndClear());
1631 AddAttribute( XML_NAMESPACE_PRESENTATION
, XML_SOURCE
, rDecl
.mbFixed
? XML_FIXED
: XML_CURRENT_DATE
);
1633 if( !rDecl
.mbFixed
)
1634 AddAttribute( XML_NAMESPACE_STYLE
, XML_DATA_STYLE_NAME
, getDataStyleName( rDecl
.mnFormat
) );
1636 SvXMLElementExport
aElem(*this, XML_NAMESPACE_PRESENTATION
, XML_DATE_TIME_DECL
, sal_False
, sal_False
);
1638 Characters(rDecl
.maStrText
);
1643 void SdXMLExport::ImplExportHeaderFooterDeclAttributes( const HeaderFooterPageSettingsImpl
& aSettings
)
1645 if( !aSettings
.maStrHeaderDeclName
.isEmpty() )
1646 AddAttribute( XML_NAMESPACE_PRESENTATION
, XML_USE_HEADER_NAME
, aSettings
.maStrHeaderDeclName
);
1648 if( !aSettings
.maStrFooterDeclName
.isEmpty() )
1649 AddAttribute( XML_NAMESPACE_PRESENTATION
, XML_USE_FOOTER_NAME
, aSettings
.maStrFooterDeclName
);
1651 if( !aSettings
.maStrDateTimeDeclName
.isEmpty() )
1652 AddAttribute( XML_NAMESPACE_PRESENTATION
, XML_USE_DATE_TIME_NAME
, aSettings
.maStrDateTimeDeclName
);
1655 //////////////////////////////////////////////////////////////////////////////
1657 OUString
SdXMLExport::ImpCreatePresPageStyleName( Reference
<XDrawPage
> xDrawPage
, bool bExportBackground
/* = true */ )
1660 OUString sStyleName
;
1662 // create style for this page and add to auto style pool
1664 Reference
< beans::XPropertySet
> xPropSet1(xDrawPage
, UNO_QUERY
);
1667 Reference
< beans::XPropertySet
> xPropSet
;
1669 if( bExportBackground
)
1671 // since the background items are in a different propertyset
1672 // which itself is a property of the pages property set
1673 // we now merge these two propertysets if possible to simulate
1674 // a single propertyset with all draw page properties
1675 const OUString
aBackground(RTL_CONSTASCII_USTRINGPARAM("Background"));
1676 Reference
< beans::XPropertySet
> xPropSet2
;
1677 Reference
< beans::XPropertySetInfo
> xInfo( xPropSet1
->getPropertySetInfo() );
1678 if( xInfo
.is() && xInfo
->hasPropertyByName( aBackground
) )
1680 Any
aAny( xPropSet1
->getPropertyValue( aBackground
) );
1684 if( xPropSet2
.is() )
1685 xPropSet
= PropertySetMerger_CreateInstance( xPropSet1
, xPropSet2
);
1687 xPropSet
= xPropSet1
;
1691 xPropSet
= xPropSet1
;
1694 const UniReference
< SvXMLExportPropertyMapper
> aMapperRef( GetPresPagePropsMapper() );
1696 std::vector
< XMLPropertyState
> xPropStates( aMapperRef
->Filter( xPropSet
) );
1698 if( !xPropStates
.empty() )
1700 // there are filtered properties -> hard attributes
1701 // try to find this style in AutoStylePool
1702 sStyleName
= GetAutoStylePool()->Find(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID
, sStyleName
, xPropStates
);
1704 if(sStyleName
.isEmpty())
1706 // Style did not exist, add it to AutoStalePool
1707 sStyleName
= GetAutoStylePool()->Add(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID
, sStyleName
, xPropStates
);
1715 //////////////////////////////////////////////////////////////////////////////
1717 void SdXMLExport::ImpPrepMasterPageInfos()
1719 // create draw:style-name entries for master page export
1720 // containing only background attributes
1721 // fixed family for page-styles is "drawing-page" (XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME)
1724 for( nCnt
= 0; nCnt
< mnDocMasterPageCount
; nCnt
++)
1726 Reference
<XDrawPage
> xDrawPage
;
1727 mxDocMasterPages
->getByIndex(nCnt
) >>= xDrawPage
;
1728 maMasterPagesStyleNames
[nCnt
] = ImpCreatePresPageStyleName( xDrawPage
);
1733 Reference
< presentation::XHandoutMasterSupplier
> xHandoutSupp( GetModel(), UNO_QUERY
);
1734 if( xHandoutSupp
.is() )
1736 Reference
< XDrawPage
> xHandoutPage( xHandoutSupp
->getHandoutMasterPage() );
1737 if( xHandoutPage
.is() )
1739 maHandoutPageHeaderFooterSettings
= ImpPrepDrawPageHeaderFooterDecls( xHandoutPage
);
1740 maHandoutMasterStyleName
= ImpCreatePresPageStyleName( xHandoutPage
, false );
1746 //////////////////////////////////////////////////////////////////////////////
1747 void SdXMLExport::ImpWritePresentationStyles()
1751 for (sal_Int32 nCnt
= 0; nCnt
< mnDocMasterPageCount
; nCnt
++)
1753 Any
aAny(mxDocMasterPages
->getByIndex(nCnt
));
1754 Reference
<container::XNamed
> xNamed
;
1758 // write presentation styles (ONLY if presentation)
1759 if(IsImpress() && mxDocStyleFamilies
.is() && xNamed
.is())
1761 XMLStyleExport
aStEx(*this, OUString(), GetAutoStylePool().get());
1762 const UniReference
< SvXMLExportPropertyMapper
> aMapperRef( GetPropertySetMapper() );
1764 OUString
aPrefix( xNamed
->getName() );
1766 aPrefix
+= OUString(RTL_CONSTASCII_USTRINGPARAM("-"));
1767 aStEx
.exportStyleFamily(xNamed
->getName(),
1768 OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_NAME
)),
1769 aMapperRef
, sal_False
,
1770 XML_STYLE_FAMILY_SD_PRESENTATION_ID
, &aPrefix
);
1777 //////////////////////////////////////////////////////////////////////////////
1779 void SdXMLExport::SetProgress(sal_Int32 nProg
)
1781 // set progress view
1782 if(GetStatusIndicator().is())
1783 GetStatusIndicator()->setValue(nProg
);
1786 //////////////////////////////////////////////////////////////////////////////
1789 void SdXMLExport::_ExportMeta()
1791 uno::Sequence
<beans::NamedValue
> stats(1);
1792 stats
[0] = beans::NamedValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ObjectCount" )),
1793 uno::makeAny(mnObjectCount
));
1795 // update document statistics at the model
1796 uno::Reference
<document::XDocumentPropertiesSupplier
> xPropSup(GetModel(),
1797 uno::UNO_QUERY_THROW
);
1798 uno::Reference
<document::XDocumentProperties
> xDocProps(
1799 xPropSup
->getDocumentProperties());
1800 if (xDocProps
.is()) {
1801 xDocProps
->setDocumentStatistics(stats
);
1805 SvXMLExport::_ExportMeta();
1808 //////////////////////////////////////////////////////////////////////////////
1810 void SdXMLExport::_ExportContent()
1812 // export <pres:header-decl>, <pres:footer-decl> and <pres:date-time-decl> elements
1813 ImpWriteHeaderFooterDecls();
1816 for(sal_Int32
nPageInd(0); nPageInd
< mnDocDrawPageCount
; nPageInd
++)
1818 uno::Reference
<drawing::XDrawPage
> xDrawPage( mxDocDrawPages
->getByIndex(nPageInd
), uno::UNO_QUERY
);
1820 SetProgress(((nPageInd
+ 1) * 100) / mnDocDrawPageCount
);
1824 // prepare page attributes, name of page
1825 Reference
< container::XNamed
> xNamed(xDrawPage
, UNO_QUERY
);
1827 AddAttribute(XML_NAMESPACE_DRAW
, XML_NAME
, xNamed
->getName());
1829 // draw:style-name (presentation page attributes AND background attributes)
1830 if( !maDrawPagesStyleNames
[nPageInd
].isEmpty() )
1831 AddAttribute(XML_NAMESPACE_DRAW
, XML_STYLE_NAME
,
1832 maDrawPagesStyleNames
[nPageInd
]);
1834 // draw:master-page-name
1835 Reference
< drawing::XMasterPageTarget
> xMasterPageInt(xDrawPage
, UNO_QUERY
);
1836 if(xMasterPageInt
.is())
1838 Reference
<XDrawPage
> xUsedMasterPage(xMasterPageInt
->getMasterPage());
1839 if(xUsedMasterPage
.is())
1841 Reference
< container::XNamed
> xMasterNamed(xUsedMasterPage
, UNO_QUERY
);
1842 if(xMasterNamed
.is())
1844 AddAttribute(XML_NAMESPACE_DRAW
, XML_MASTER_PAGE_NAME
,
1845 EncodeStyleName( xMasterNamed
->getName()) );
1850 // presentation:page-layout-name
1851 if( IsImpress() && !maDrawPagesAutoLayoutNames
[nPageInd
+1].isEmpty())
1853 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_PRESENTATION_PAGE_LAYOUT_NAME
, maDrawPagesAutoLayoutNames
[nPageInd
+1] );
1856 Reference
< beans::XPropertySet
> xProps( xDrawPage
, UNO_QUERY
);
1861 OUString aBookmarkURL
;
1862 xProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "BookmarkURL" ) ) ) >>= aBookmarkURL
;
1864 if( !aBookmarkURL
.isEmpty() )
1866 sal_Int32 nIndex
= aBookmarkURL
.lastIndexOf( (sal_Unicode
)'#' );
1869 OUString
aFileName( aBookmarkURL
.copy( 0, nIndex
) );
1870 OUString
aBookmarkName( aBookmarkURL
.copy( nIndex
+1 ) );
1872 aBookmarkURL
= GetRelativeReference( aFileName
);
1873 aBookmarkURL
+= rtl::OUString(static_cast<sal_Unicode
>('#'));
1874 aBookmarkURL
+= aBookmarkName
;
1877 AddAttribute ( XML_NAMESPACE_XLINK
, XML_HREF
, aBookmarkURL
);
1878 AddAttribute ( XML_NAMESPACE_XLINK
, XML_TYPE
, XML_SIMPLE
);
1879 AddAttribute ( XML_NAMESPACE_XLINK
, XML_SHOW
, XML_REPLACE
);
1880 AddAttribute ( XML_NAMESPACE_XLINK
, XML_ACTUATE
, XML_ONREQUEST
);
1883 catch(const Exception
&)
1885 OSL_FAIL(" no \"BookmarkURL\" property at page?" );
1890 ImplExportHeaderFooterDeclAttributes( maDrawPagesHeaderFooterSettings
[nPageInd
] );
1893 OUString
sNavigationOrder( getNavigationOrder( xDrawPage
) );
1894 if( !sNavigationOrder
.isEmpty() )
1895 AddAttribute ( XML_NAMESPACE_DRAW
, XML_NAV_ORDER
, sNavigationOrder
);
1897 UniReference
< xmloff::AnimationsExporter
> xAnimationsExporter
;
1898 uno::Reference
< ::com::sun::star::animations::XAnimationNodeSupplier
> xAnimNodeSupplier
;
1900 // prepare animation export
1903 if( getExportFlags() & EXPORT_OASIS
)
1905 // export new animations for oasis format
1906 xAnimNodeSupplier
.set( xDrawPage
, UNO_QUERY
);
1908 // prepare animations exporter if impress
1909 if(xAnimNodeSupplier
.is())
1911 xAnimationsExporter
= new xmloff::AnimationsExporter( *this, xProps
);
1912 xAnimationsExporter
->prepare( xAnimNodeSupplier
->getAnimationNode() );
1917 // export old animations for ooo format
1918 UniReference
< XMLAnimationsExporter
> xAnimExport
= new XMLAnimationsExporter( GetShapeExport().get() );
1919 GetShapeExport()->setAnimationsExporter( xAnimExport
);
1924 const OUString aPageId
= getInterfaceToIdentifierMapper().getIdentifier( xDrawPage
);
1925 if( !aPageId
.isEmpty() )
1927 AddAttributeIdLegacy(XML_NAMESPACE_DRAW
, aPageId
);
1931 SvXMLElementExport
aDPG(*this, XML_NAMESPACE_DRAW
, XML_PAGE
, sal_True
, sal_True
);
1933 // write optional office:forms
1934 exportFormsElement( xDrawPage
);
1936 // write graphic objects on this page (if any)
1937 Reference
< drawing::XShapes
> xExportShapes(xDrawPage
, UNO_QUERY
);
1938 if(xExportShapes
.is() && xExportShapes
->getCount())
1939 GetShapeExport()->exportShapes( xExportShapes
);
1941 // write animations and presentation notes (ONLY if presentation)
1944 if(xAnimNodeSupplier
.is())
1946 xAnimationsExporter
->exportAnimations( xAnimNodeSupplier
->getAnimationNode() );
1951 UniReference
< XMLAnimationsExporter
> xAnimExport( GetShapeExport()->getAnimationsExporter() );
1952 if( xAnimExport
.is() )
1953 xAnimExport
->exportAnimations( *this );
1956 GetShapeExport()->setAnimationsExporter( xAnimExport
);
1960 Reference
< presentation::XPresentationPage
> xPresPage(xDrawPage
, UNO_QUERY
);
1963 Reference
< XDrawPage
> xNotesPage(xPresPage
->getNotesPage());
1966 Reference
< drawing::XShapes
> xShapes(xNotesPage
, UNO_QUERY
);
1969 if( !maDrawNotesPagesStyleNames
[nPageInd
].isEmpty() )
1970 AddAttribute(XML_NAMESPACE_DRAW
, XML_STYLE_NAME
, maDrawNotesPagesStyleNames
[nPageInd
]);
1972 ImplExportHeaderFooterDeclAttributes( maDrawNotesPagesHeaderFooterSettings
[nPageInd
] );
1974 // write presentation notes
1975 SvXMLElementExport
aPSY(*this, XML_NAMESPACE_PRESENTATION
, XML_NOTES
, sal_True
, sal_True
);
1977 // write optional office:forms
1978 exportFormsElement( xNotesPage
);
1980 // write shapes per se
1981 GetShapeExport()->exportShapes( xShapes
);
1987 exportAnnotations( xDrawPage
);
1992 exportPresentationSettings();
1995 //////////////////////////////////////////////////////////////////////////////
1997 void SdXMLExport::exportPresentationSettings()
2001 Reference
< XPresentationSupplier
> xPresSupplier( GetModel(), UNO_QUERY
);
2002 if( !xPresSupplier
.is() )
2005 Reference
< XPropertySet
> xPresProps( xPresSupplier
->getPresentation(), UNO_QUERY
);
2006 if( !xPresProps
.is() )
2009 sal_Bool bHasAttr
= sal_False
;
2011 sal_Bool bTemp
= false;
2014 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsShowAll" ) ) ) >>= bTemp
;
2017 OUString aFirstPage
;
2018 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "FirstPage" ) ) ) >>= aFirstPage
;
2019 if( !aFirstPage
.isEmpty() )
2021 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_START_PAGE
, aFirstPage
);
2022 bHasAttr
= sal_True
;
2026 OUString aCustomShow
;
2027 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "CustomShow" ) ) ) >>= aCustomShow
;
2028 if( !aCustomShow
.isEmpty() )
2030 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_SHOW
, aCustomShow
);
2031 bHasAttr
= sal_True
;
2036 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsEndless" ) ) ) >>= bTemp
;
2039 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_ENDLESS
, XML_TRUE
);
2040 bHasAttr
= sal_True
;
2042 sal_Int32 nPause
= 0;
2043 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Pause" ) ) ) >>= nPause
;
2045 util::Duration aDuration
;
2046 aDuration
.Seconds
= static_cast<sal_uInt16
>(nPause
);
2048 OUStringBuffer aOut
;
2049 ::sax::Converter::convertDuration(aOut
, aDuration
);
2050 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_PAUSE
, aOut
.makeStringAndClear() );
2053 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AllowAnimations" ) ) ) >>= bTemp
;
2056 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_ANIMATIONS
, XML_DISABLED
);
2057 bHasAttr
= sal_True
;
2060 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsAlwaysOnTop" ) ) ) >>= bTemp
;
2063 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_STAY_ON_TOP
, XML_TRUE
);
2064 bHasAttr
= sal_True
;
2067 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsAutomatic" ) ) ) >>= bTemp
;
2070 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_FORCE_MANUAL
, XML_TRUE
);
2071 bHasAttr
= sal_True
;
2074 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFullScreen" ) ) ) >>= bTemp
;
2077 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_FULL_SCREEN
, XML_FALSE
);
2078 bHasAttr
= sal_True
;
2081 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsMouseVisible" ) ) ) >>= bTemp
;
2084 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_MOUSE_VISIBLE
, XML_FALSE
);
2085 bHasAttr
= sal_True
;
2088 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "StartWithNavigator" ) ) ) >>= bTemp
;
2091 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_START_WITH_NAVIGATOR
, XML_TRUE
);
2092 bHasAttr
= sal_True
;
2095 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "UsePen" ) ) ) >>= bTemp
;
2098 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_MOUSE_AS_PEN
, XML_TRUE
);
2099 bHasAttr
= sal_True
;
2102 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsTransitionOnClick" ) ) ) >>= bTemp
;
2105 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_TRANSITION_ON_CLICK
, XML_DISABLED
);
2106 bHasAttr
= sal_True
;
2109 xPresProps
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsShowLogo" ) ) ) >>= bTemp
;
2112 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_SHOW_LOGO
, XML_TRUE
);
2113 bHasAttr
= sal_True
;
2116 Reference
< container::XNameContainer
> xShows
;
2117 Sequence
< OUString
> aShowNames
;
2118 const OUString
* pShowNames
= NULL
;
2119 sal_Int32 nShowCount
= 0;
2121 Reference
< XCustomPresentationSupplier
> xSup( GetModel(), UNO_QUERY
);
2124 xShows
= xSup
->getCustomPresentations();
2127 aShowNames
= xShows
->getElementNames();
2128 pShowNames
= aShowNames
.getArray();
2129 nShowCount
= aShowNames
.getLength();
2133 if( bHasAttr
|| nShowCount
!= 0 )
2135 SvXMLElementExport
aSettings(*this, XML_NAMESPACE_PRESENTATION
, XML_SETTINGS
, sal_True
, sal_True
);
2137 if( nShowCount
== 0 )
2140 Reference
< XIndexContainer
> xShow
;
2141 Reference
< XNamed
> xPageName
;
2143 OUStringBuffer sTmp
;
2145 for( sal_Int32 nIndex
= 0; nIndex
< nShowCount
; nIndex
++, pShowNames
++ )
2147 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_NAME
, *pShowNames
);
2149 xShows
->getByName( *pShowNames
) >>= xShow
;
2150 DBG_ASSERT( xShow
.is(), "invalid custom show!" );
2154 const sal_Int32 nPageCount
= xShow
->getCount();
2155 for( sal_Int32 nPage
= 0; nPage
< nPageCount
; nPage
++ )
2157 xShow
->getByIndex( nPage
) >>= xPageName
;
2159 if( !xPageName
.is() )
2162 if( sTmp
.getLength() != 0 )
2163 sTmp
.append( sal_Unicode( ',' ) );
2164 sTmp
.append( xPageName
->getName() );
2168 if( sTmp
.getLength() )
2169 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_PAGES
, sTmp
.makeStringAndClear() );
2171 SvXMLElementExport
aShows(*this, XML_NAMESPACE_PRESENTATION
, XML_SHOW
, sal_True
, sal_True
);
2175 catch(const uno::Exception
&)
2177 OSL_FAIL( "uno::Exception while exporting <presentation:settings>" );
2181 //////////////////////////////////////////////////////////////////////////////
2183 void SdXMLExport::_ExportStyles(sal_Bool bUsed
)
2185 GetPropertySetMapper()->SetAutoStyles( sal_False
);
2187 // export fill styles
2188 SvXMLExport::_ExportStyles( bUsed
);
2190 // write draw:style-name for object graphic-styles
2191 GetShapeExport()->ExportGraphicDefaults();
2193 // do not export in ODF 1.1 or older
2194 if( getDefaultVersion() >= SvtSaveOptions::ODFVER_012
)
2195 GetShapeExport()->GetShapeTableExport()->exportTableStyles();
2197 // write presentation styles
2198 ImpWritePresentationStyles();
2200 // prepare draw:auto-layout-name for page export
2201 ImpPrepAutoLayoutInfos();
2203 // write draw:auto-layout-name for page export
2204 ImpWriteAutoLayoutInfos();
2206 Reference
< beans::XPropertySet
> xInfoSet( getExportInfo() );
2209 Reference
< beans::XPropertySetInfo
> xInfoSetInfo( xInfoSet
->getPropertySetInfo() );
2213 if( xInfoSetInfo
->hasPropertyByName( msPageLayoutNames
) )
2215 aAny
<<= maDrawPagesAutoLayoutNames
;
2216 xInfoSet
->setPropertyValue( msPageLayoutNames
, aAny
);
2221 //////////////////////////////////////////////////////////////////////////////
2223 void SdXMLExport::_ExportAutoStyles()
2225 Reference
< beans::XPropertySet
> xInfoSet( getExportInfo() );
2228 Reference
< beans::XPropertySetInfo
> xInfoSetInfo( xInfoSet
->getPropertySetInfo() );
2230 if( xInfoSetInfo
->hasPropertyByName( msPageLayoutNames
) )
2232 xInfoSet
->getPropertyValue( msPageLayoutNames
) >>= maDrawPagesAutoLayoutNames
;
2236 GetPropertySetMapper()->SetAutoStyles( sal_True
);
2238 if( getExportFlags() & EXPORT_STYLES
)
2240 // #80012# PageMaster export moved from _ExportStyles
2241 // prepare page-master infos
2242 ImpPrepPageMasterInfos();
2244 // write page-master infos
2245 ImpWritePageMasterInfos();
2247 // prepare draw:style-name for master page export
2248 ImpPrepMasterPageInfos();
2251 if( getExportFlags() & EXPORT_CONTENT
)
2253 // prepare draw:style-name for page export
2254 ImpPrepDrawPageInfos();
2257 // export draw-page styles
2258 GetAutoStylePool()->exportXML(
2259 XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID
2261 GetMM100UnitConverter(),
2265 if( getExportFlags() & EXPORT_STYLES
)
2267 // create auto style infos for shapes on master handout page
2270 Reference
< presentation::XHandoutMasterSupplier
> xHandoutSupp( GetModel(), UNO_QUERY
);
2271 if( xHandoutSupp
.is() )
2273 Reference
< XDrawPage
> xHandoutPage( xHandoutSupp
->getHandoutMasterPage() );
2274 if( xHandoutPage
.is() )
2276 Reference
< drawing::XShapes
> xShapes(xHandoutPage
, UNO_QUERY
);
2277 if(xShapes
.is() && xShapes
->getCount())
2278 GetShapeExport()->collectShapesAutoStyles( xShapes
);
2283 // create auto style infos for objects on master pages
2284 for(sal_Int32
nMPageId(0L); nMPageId
< mnDocMasterPageCount
; nMPageId
++)
2286 Reference
< XDrawPage
> xMasterPage(mxDocMasterPages
->getByIndex(nMPageId
), UNO_QUERY
);
2288 if( xMasterPage
.is() )
2290 // collect layer information
2291 GetFormExport()->examineForms( xMasterPage
);
2293 // get MasterPage Name
2294 OUString aMasterPageNamePrefix
;
2295 Reference
< container::XNamed
> xNamed(xMasterPage
, UNO_QUERY
);
2298 aMasterPageNamePrefix
= xNamed
->getName();
2300 if(!aMasterPageNamePrefix
.isEmpty())
2302 aMasterPageNamePrefix
+= OUString(RTL_CONSTASCII_USTRINGPARAM("-"));
2304 GetShapeExport()->setPresentationStylePrefix( aMasterPageNamePrefix
);
2306 Reference
< drawing::XShapes
> xMasterShapes(xMasterPage
, UNO_QUERY
);
2307 if(xMasterShapes
.is() && xMasterShapes
->getCount())
2308 GetShapeExport()->collectShapesAutoStyles( xMasterShapes
);
2312 Reference
< presentation::XPresentationPage
> xPresPage(xMasterPage
, UNO_QUERY
);
2315 Reference
< XDrawPage
> xNotesPage(xPresPage
->getNotesPage());
2318 // collect layer information
2319 GetFormExport()->examineForms( xNotesPage
);
2321 Reference
< drawing::XShapes
> xShapes(xNotesPage
, UNO_QUERY
);
2322 if(xShapes
.is() && xShapes
->getCount())
2323 GetShapeExport()->collectShapesAutoStyles( xShapes
);
2327 collectAnnotationAutoStyles(xMasterPage
);
2332 if( getExportFlags() & EXPORT_CONTENT
)
2334 // prepare animations exporter if impress
2335 if(IsImpress() && ((getExportFlags() & EXPORT_OASIS
) == 0) )
2337 UniReference
< XMLAnimationsExporter
> xAnimExport
= new XMLAnimationsExporter( GetShapeExport().get() );
2338 GetShapeExport()->setAnimationsExporter( xAnimExport
);
2341 // create auto style infos for objects on pages
2342 for(sal_Int32
nPageInd(0); nPageInd
< mnDocDrawPageCount
; nPageInd
++)
2344 Reference
<XDrawPage
> xDrawPage( mxDocDrawPages
->getByIndex(nPageInd
), UNO_QUERY
);
2345 if( xDrawPage
.is() )
2347 // collect layer information
2348 GetFormExport()->examineForms( xDrawPage
);
2350 // get MasterPage Name
2351 OUString aMasterPageNamePrefix
;
2352 Reference
< drawing::XMasterPageTarget
> xMasterPageInt(xDrawPage
, UNO_QUERY
);
2353 if(xMasterPageInt
.is())
2355 Reference
<XDrawPage
> xUsedMasterPage(xMasterPageInt
->getMasterPage());
2356 if(xUsedMasterPage
.is())
2358 Reference
< container::XNamed
> xMasterNamed(xUsedMasterPage
, UNO_QUERY
);
2359 if(xMasterNamed
.is())
2361 aMasterPageNamePrefix
= xMasterNamed
->getName();
2365 if(!aMasterPageNamePrefix
.isEmpty())
2367 aMasterPageNamePrefix
+= OUString(RTL_CONSTASCII_USTRINGPARAM("-"));
2370 GetShapeExport()->setPresentationStylePrefix( aMasterPageNamePrefix
);
2372 // prepare object infos
2373 Reference
< drawing::XShapes
> xDrawShapes(xDrawPage
, UNO_QUERY
);
2374 if(xDrawShapes
.is() && xDrawShapes
->getCount())
2375 GetShapeExport()->collectShapesAutoStyles( xDrawShapes
);
2377 // prepare presentation notes page object infos (ONLY if presentation)
2380 Reference
< presentation::XPresentationPage
> xPresPage(xDrawPage
, UNO_QUERY
);
2383 Reference
< XDrawPage
> xNotesPage(xPresPage
->getNotesPage());
2386 // collect layer information
2387 GetFormExport()->examineForms( xNotesPage
);
2389 Reference
< drawing::XShapes
> xShapes(xNotesPage
, UNO_QUERY
);
2390 if(xShapes
.is() && xShapes
->getCount())
2391 GetShapeExport()->collectShapesAutoStyles( xShapes
);
2396 collectAnnotationAutoStyles( xDrawPage
);
2401 UniReference
< XMLAnimationsExporter
> xAnimExport
;
2402 GetShapeExport()->setAnimationsExporter( xAnimExport
);
2406 exportAutoDataStyles();
2408 GetShapeExport()->exportAutoStyles();
2410 sal_uInt16 nContentAutostyles
= EXPORT_CONTENT
| EXPORT_AUTOSTYLES
;
2411 if ( ( getExportFlags() & nContentAutostyles
) == nContentAutostyles
)
2412 GetFormExport()->exportAutoStyles( );
2415 GetTextParagraphExport()->exportTextAutoStyles();
2418 //////////////////////////////////////////////////////////////////////////////
2420 void SdXMLExport::_ExportMasterStyles()
2423 SdXMLayerExporter::exportLayer( *this );
2425 // export handout master page if impress
2428 Reference
< presentation::XHandoutMasterSupplier
> xHandoutSupp( GetModel(), UNO_QUERY
);
2429 if( xHandoutSupp
.is() )
2431 Reference
< XDrawPage
> xHandoutPage( xHandoutSupp
->getHandoutMasterPage() );
2432 if( xHandoutPage
.is() )
2434 // presentation:page-layout-name
2435 if( IsImpress() && !maDrawPagesAutoLayoutNames
[0].isEmpty())
2437 AddAttribute(XML_NAMESPACE_PRESENTATION
, XML_PRESENTATION_PAGE_LAYOUT_NAME
, EncodeStyleName( maDrawPagesAutoLayoutNames
[0] ));
2440 ImpXMLEXPPageMasterInfo
* pInfo
= mpHandoutPageMaster
;
2443 OUString sString
= pInfo
->GetName();
2444 AddAttribute(XML_NAMESPACE_STYLE
, XML_PAGE_LAYOUT_NAME
, sString
);
2448 if( !maHandoutMasterStyleName
.isEmpty() )
2449 AddAttribute(XML_NAMESPACE_DRAW
, XML_STYLE_NAME
, maHandoutMasterStyleName
);
2451 ImplExportHeaderFooterDeclAttributes( maHandoutPageHeaderFooterSettings
);
2454 SvXMLElementExport
aMPG(*this, XML_NAMESPACE_STYLE
, XML_HANDOUT_MASTER
, sal_True
, sal_True
);
2456 // write graphic objects on this master page (if any)
2457 Reference
< drawing::XShapes
> xShapes(xHandoutPage
, UNO_QUERY
);
2458 if(xShapes
.is() && xShapes
->getCount())
2459 GetShapeExport()->exportShapes( xShapes
);
2464 // export MasterPages in master-styles section
2465 for (sal_Int32 nMPageId
= 0; nMPageId
< mnDocMasterPageCount
; nMPageId
++)
2467 Reference
< XDrawPage
> xMasterPage( mxDocMasterPages
->getByIndex(nMPageId
), UNO_QUERY
);
2468 if(xMasterPage
.is())
2470 // prepare masterpage attributes
2471 OUString sMasterPageName
;
2472 Reference
< container::XNamed
> xNamed(xMasterPage
, UNO_QUERY
);
2475 sal_Bool bEncoded
= sal_False
;
2476 sMasterPageName
= xNamed
->getName();
2477 AddAttribute(XML_NAMESPACE_STYLE
, XML_NAME
,
2478 EncodeStyleName( sMasterPageName
, &bEncoded
));
2481 XML_NAMESPACE_STYLE
, XML_DISPLAY_NAME
,
2485 ImpXMLEXPPageMasterInfo
* pInfo
= mpPageMasterUsageList
->at( nMPageId
);
2488 OUString sString
= pInfo
->GetName();
2489 AddAttribute(XML_NAMESPACE_STYLE
, XML_PAGE_LAYOUT_NAME
, sString
);
2492 // draw:style-name (background attributes)
2493 if( !maMasterPagesStyleNames
[nMPageId
].isEmpty() )
2494 AddAttribute(XML_NAMESPACE_DRAW
, XML_STYLE_NAME
,
2495 maMasterPagesStyleNames
[nMPageId
]);
2498 SvXMLElementExport
aMPG(*this, XML_NAMESPACE_STYLE
, XML_MASTER_PAGE
, sal_True
, sal_True
);
2500 // write optional office:forms
2501 exportFormsElement( xMasterPage
);
2503 // write graphic objects on this master page (if any)
2504 Reference
< drawing::XShapes
> xMasterShapes(xMasterPage
, UNO_QUERY
);
2505 if(xMasterShapes
.is() && xMasterShapes
->getCount())
2506 GetShapeExport()->exportShapes( xMasterShapes
);
2508 // write presentation notes (ONLY if presentation)
2511 Reference
< presentation::XPresentationPage
> xPresPage(xMasterPage
, UNO_QUERY
);
2514 Reference
< XDrawPage
> xNotesPage(xPresPage
->getNotesPage());
2517 Reference
< drawing::XShapes
> xShapes(xNotesPage
, UNO_QUERY
);
2520 ImpXMLEXPPageMasterInfo
* pMasterInfo
= mpNotesPageMasterUsageList
->at( nMPageId
);
2523 OUString sString
= pMasterInfo
->GetName();
2524 AddAttribute(XML_NAMESPACE_STYLE
, XML_PAGE_LAYOUT_NAME
, sString
);
2527 // write presentation notes
2528 SvXMLElementExport
aPSY(*this, XML_NAMESPACE_PRESENTATION
, XML_NOTES
, sal_True
, sal_True
);
2530 // write optional office:forms
2531 exportFormsElement( xNotesPage
);
2533 // write shapes per se
2534 GetShapeExport()->exportShapes( xShapes
);
2539 exportAnnotations( xMasterPage
);
2544 void SdXMLExport::exportFormsElement( Reference
< XDrawPage
> xDrawPage
)
2546 if( xDrawPage
.is() )
2548 Reference
< form::XFormsSupplier2
> xFormsSupplier( xDrawPage
, UNO_QUERY
);
2549 if ( xFormsSupplier
.is() && xFormsSupplier
->hasForms() )
2552 ::xmloff::OOfficeFormsExport
aForms(*this);
2553 GetFormExport()->exportForms( xDrawPage
);
2556 if(! GetFormExport()->seekPage( xDrawPage
) )
2558 OSL_FAIL( "OFormLayerXMLExport::seekPage failed!" );
2563 void SdXMLExport::GetViewSettings(uno::Sequence
<beans::PropertyValue
>& rProps
)
2566 beans::PropertyValue
* pProps
= rProps
.getArray();
2569 Reference
< beans::XPropertySet
> xPropSet( GetModel(), UNO_QUERY
);
2570 if( !xPropSet
.is() )
2573 awt::Rectangle aVisArea
;
2574 xPropSet
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ) ) >>= aVisArea
;
2577 pProps
[i
].Name
= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaTop"));
2578 pProps
[i
++].Value
<<= aVisArea
.Y
;
2579 pProps
[i
].Name
= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaLeft"));
2580 pProps
[i
++].Value
<<= aVisArea
.X
;
2581 pProps
[i
].Name
= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaWidth"));
2582 pProps
[i
++].Value
<<= aVisArea
.Width
;
2583 pProps
[i
].Name
= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaHeight"));
2584 pProps
[i
++].Value
<<= aVisArea
.Height
;
2588 void SdXMLExport::GetConfigurationSettings(uno::Sequence
<beans::PropertyValue
>& rProps
)
2590 Reference
< lang::XMultiServiceFactory
> xFac( GetModel(), UNO_QUERY
);
2593 Reference
< beans::XPropertySet
> xProps( xFac
->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.Settings" ) ) ), UNO_QUERY
);
2595 SvXMLUnitConverter::convertPropertySet( rProps
, xProps
);
2596 DocumentSettingsSerializer
*pFilter
;
2597 pFilter
= dynamic_cast<DocumentSettingsSerializer
*>(xProps
.get());
2599 rProps
= pFilter
->filterStreamsToStorage( GetTargetStorage(), rProps
);
2603 //////////////////////////////////////////////////////////////////////////////
2605 void SdXMLExport::addDataStyle(const sal_Int32 nNumberFormat
, sal_Bool bTimeFormat
)
2607 sal_Int32 nFormat
= nNumberFormat
;
2608 if( (nNumberFormat
> 1) && (nNumberFormat
<= 0x0f) )
2613 if( maUsedTimeStyles
.count( nFormat
) == 0 )
2614 maUsedTimeStyles
.insert( nFormat
);
2618 if( maUsedDateStyles
.count( nFormat
) == 0 )
2619 maUsedDateStyles
.insert( nFormat
);
2623 //////////////////////////////////////////////////////////////////////////////
2625 void SdXMLExport::exportDataStyles()
2627 // there are no data styles to export in draw/impress yet
2630 //////////////////////////////////////////////////////////////////////////////
2632 void SdXMLExport::exportAutoDataStyles()
2634 SdXMLFormatMap::iterator
aIter( maUsedDateStyles
.begin() );
2635 SdXMLFormatMap::iterator
aEnd( maUsedDateStyles
.end() );
2637 while( aIter
!= aEnd
)
2638 SdXMLNumberStylesExporter::exportDateStyle( *this, (*aIter
++) );
2640 aIter
= maUsedTimeStyles
.begin();
2641 aEnd
= maUsedTimeStyles
.end();
2642 while( aIter
!= aEnd
)
2643 SdXMLNumberStylesExporter::exportTimeStyle( *this, (*aIter
++) );
2646 GetFormExport()->exportAutoControlNumberStyles();
2649 //////////////////////////////////////////////////////////////////////////////
2651 OUString
SdXMLExport::getDataStyleName(const sal_Int32 nNumberFormat
, sal_Bool bTimeFormat
) const
2655 return SdXMLNumberStylesExporter::getTimeStyleName( nNumberFormat
);
2659 return SdXMLNumberStylesExporter::getDateStyleName( nNumberFormat
);
2663 OUString
SdXMLExport::getNavigationOrder( const Reference
< XDrawPage
>& xDrawPage
)
2665 OUStringBuffer sNavOrder
;
2668 Reference
< XPropertySet
> xSet( xDrawPage
, UNO_QUERY_THROW
);
2669 Reference
< XIndexAccess
> xNavOrder( xSet
->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "NavigationOrder" ) ) ), UNO_QUERY_THROW
);
2671 Reference
< XIndexAccess
> xZOrderAccess( xDrawPage
, UNO_QUERY
);
2673 // only export navigation order if it is different from the z-order
2674 if( (xNavOrder
.get() != xZOrderAccess
.get()) && (xNavOrder
->getCount() == xDrawPage
->getCount()) )
2677 const sal_Int32 nCount
= xNavOrder
->getCount();
2678 for( nIndex
= 0; nIndex
< nCount
; ++nIndex
)
2680 OUString
sId( getInterfaceToIdentifierMapper().registerReference( Reference
< XInterface
>( xNavOrder
->getByIndex( nIndex
), UNO_QUERY
) ) );
2681 if( !sId
.isEmpty() )
2683 if( sNavOrder
.getLength() != 0 )
2684 sNavOrder
.append( (sal_Unicode
)' ' );
2685 sNavOrder
.append( sId
);
2690 catch(const Exception
&)
2693 return sNavOrder
.makeStringAndClear();
2696 //////////////////////////////////////////////////////////////////////////////
2698 void SdXMLExport::collectAnnotationAutoStyles( const Reference
<XDrawPage
>& xDrawPage
)
2700 Reference
< XAnnotationAccess
> xAnnotationAccess( xDrawPage
, UNO_QUERY
);
2701 if( xAnnotationAccess
.is() ) try
2703 Reference
< XAnnotationEnumeration
> xAnnotationEnumeration( xAnnotationAccess
->createAnnotationEnumeration() );
2704 if( xAnnotationEnumeration
.is() )
2706 while( xAnnotationEnumeration
->hasMoreElements() )
2708 Reference
< XAnnotation
> xAnnotation( xAnnotationEnumeration
->nextElement(), UNO_QUERY_THROW
);
2709 Reference
< XText
> xText( xAnnotation
->getTextRange() );
2710 if(xText
.is() && !xText
->getString().isEmpty())
2711 GetTextParagraphExport()->collectTextAutoStyles( xText
);
2715 catch(const Exception
&)
2717 OSL_FAIL("SdXMLExport::collectAnnotationAutoStyles(), exception caught during export of annotation auto styles");
2721 void SdXMLExport::exportAnnotations( const Reference
<XDrawPage
>& xDrawPage
)
2723 // do not export in ODF 1.2 or older
2724 if( getDefaultVersion() <= SvtSaveOptions::ODFVER_012
)
2727 Reference
< XAnnotationAccess
> xAnnotationAccess( xDrawPage
, UNO_QUERY
);
2728 if( xAnnotationAccess
.is() ) try
2730 Reference
< XAnnotationEnumeration
> xAnnotationEnumeration( xAnnotationAccess
->createAnnotationEnumeration() );
2731 if( xAnnotationEnumeration
.is() && xAnnotationEnumeration
->hasMoreElements() )
2733 OUStringBuffer sStringBuffer
;
2736 Reference
< XAnnotation
> xAnnotation( xAnnotationEnumeration
->nextElement(), UNO_QUERY_THROW
);
2738 RealPoint2D
aPosition( xAnnotation
->getPosition() );
2740 GetMM100UnitConverter().convertMeasureToXML(sStringBuffer
,
2741 static_cast<sal_Int32
>( aPosition
.X
* 100 ) );
2742 AddAttribute(XML_NAMESPACE_SVG
, XML_X
, sStringBuffer
.makeStringAndClear());
2744 GetMM100UnitConverter().convertMeasureToXML(sStringBuffer
,
2745 static_cast<sal_Int32
>( aPosition
.Y
* 100 ) );
2746 AddAttribute(XML_NAMESPACE_SVG
, XML_Y
, sStringBuffer
.makeStringAndClear());
2748 RealSize2D
aSize( xAnnotation
->getSize() );
2750 if( aSize
.Width
|| aSize
.Height
)
2752 GetMM100UnitConverter().convertMeasureToXML(sStringBuffer
,
2753 static_cast<sal_Int32
>( aSize
.Width
* 100 ) );
2754 AddAttribute(XML_NAMESPACE_SVG
, XML_WIDTH
, sStringBuffer
.makeStringAndClear());
2755 GetMM100UnitConverter().convertMeasureToXML(sStringBuffer
,
2756 static_cast<sal_Int32
>( aSize
.Height
* 100 ) );
2757 AddAttribute(XML_NAMESPACE_SVG
, XML_HEIGHT
, sStringBuffer
.makeStringAndClear());
2760 // annotation element + content
2761 SvXMLElementExport
aElem(*this, XML_NAMESPACE_OFFICE_EXT
, XML_ANNOTATION
, sal_False
, sal_True
);
2764 OUString
aAuthor( xAnnotation
->getAuthor() );
2765 if( !aAuthor
.isEmpty() )
2767 SvXMLElementExport
aCreatorElem( *this, XML_NAMESPACE_DC
, XML_CREATOR
, sal_True
, sal_False
);
2768 this->Characters(aAuthor
);
2773 DateTime
aDate( xAnnotation
->getDateTime() );
2774 ::sax::Converter::convertDateTime(sStringBuffer
, aDate
, true);
2775 SvXMLElementExport
aDateElem( *this, XML_NAMESPACE_DC
, XML_DATE
, sal_True
, sal_False
);
2776 Characters(sStringBuffer
.makeStringAndClear());
2779 com::sun::star::uno::Reference
< com::sun::star::text::XText
> xText( xAnnotation
->getTextRange() );
2781 this->GetTextParagraphExport()->exportText( xText
);
2783 while( xAnnotationEnumeration
->hasMoreElements() );
2786 catch(const Exception
&)
2788 OSL_FAIL("SdXMLExport::exportAnnotations(), exception caught during export of annotations");
2792 //////////////////////////////////////////////////////////////////////////////
2794 #define SERVICE( classname, servicename, implementationname, draw, flags )\
2795 uno::Sequence< OUString > SAL_CALL classname##_getSupportedServiceNames() throw()\
2797 const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( servicename ) );\
2798 const uno::Sequence< OUString > aSeq( &aServiceName, 1 );\
2801 OUString SAL_CALL classname##_getImplementationName() throw()\
2803 return OUString( RTL_CONSTASCII_USTRINGPARAM( implementationname ) );\
2805 uno::Reference< uno::XInterface > SAL_CALL classname##_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )\
2807 return (cppu::OWeakObject*)new SdXMLExport( rSMgr, draw, flags );\
2810 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
);
2811 SERVICE( XMLImpressStylesExportOasis
, "com.sun.star.comp.Impress.XMLOasisStylesExporter", "XMLImpressStylesExportOasis", sal_False
, EXPORT_OASIS
|EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
);
2812 SERVICE( XMLImpressContentExportOasis
, "com.sun.star.comp.Impress.XMLOasisContentExporter", "XMLImpressContentExportOasis", sal_False
, EXPORT_OASIS
|EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_FONTDECLS
);
2813 SERVICE( XMLImpressMetaExportOasis
, "com.sun.star.comp.Impress.XMLOasisMetaExporter", "XMLImpressMetaExportOasis", sal_False
, EXPORT_OASIS
|EXPORT_META
);
2814 SERVICE( XMLImpressSettingsExportOasis
, "com.sun.star.comp.Impress.XMLOasisSettingsExporter", "XMLImpressSettingsExportOasis", sal_False
, EXPORT_OASIS
|EXPORT_SETTINGS
);
2816 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
);
2817 SERVICE( XMLImpressStylesExportOOO
, "com.sun.star.comp.Impress.XMLStylesExporter", "XMLImpressStylesExportOOO", sal_False
, EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
);
2818 SERVICE( XMLImpressContentExportOOO
, "com.sun.star.comp.Impress.XMLContentExporter", "XMLImpressContentExportOOO", sal_False
, EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_FONTDECLS
);
2819 SERVICE( XMLImpressMetaExportOOO
, "com.sun.star.comp.Impress.XMLMetaExporter", "XMLImpressMetaExportOOO", sal_False
, EXPORT_META
);
2820 SERVICE( XMLImpressSettingsExportOOO
, "com.sun.star.comp.Impress.XMLSettingsExporter", "XMLImpressSettingsExportOOO", sal_False
, EXPORT_SETTINGS
);
2822 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
);
2823 SERVICE( XMLDrawStylesExportOasis
, "com.sun.star.comp.Draw.XMLOasisStylesExporter", "XMLDrawStylesExportOasis", sal_True
, EXPORT_OASIS
|EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
);
2824 SERVICE( XMLDrawContentExportOasis
, "com.sun.star.comp.Draw.XMLOasisContentExporter", "XMLDrawContentExportOasis", sal_True
, EXPORT_OASIS
|EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_FONTDECLS
);
2825 SERVICE( XMLDrawMetaExportOasis
, "com.sun.star.comp.Draw.XMLOasisMetaExporter", "XMLDrawMetaExportOasis", sal_True
, EXPORT_OASIS
|EXPORT_META
);
2826 SERVICE( XMLDrawSettingsExportOasis
, "com.sun.star.comp.Draw.XMLOasisSettingsExporter", "XMLDrawSettingsExportOasis", sal_True
, EXPORT_OASIS
|EXPORT_SETTINGS
);
2828 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
);
2829 SERVICE( XMLDrawStylesExportOOO
, "com.sun.star.comp.Draw.XMLStylesExporter", "XMLDrawStylesExportOOO", sal_True
, EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
);
2830 SERVICE( XMLDrawContentExportOOO
, "com.sun.star.comp.Draw.XMLContentExporter", "XMLDrawContentExportOOO", sal_True
, EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_FONTDECLS
);
2831 SERVICE( XMLDrawMetaExportOOO
, "com.sun.star.comp.Draw.XMLMetaExporter", "XMLDrawMetaExportOOO", sal_True
, EXPORT_META
);
2832 SERVICE( XMLDrawSettingsExportOOO
, "com.sun.star.comp.Draw.XMLSettingsExporter", "XMLDrawSettingsExportOOO", sal_True
, EXPORT_SETTINGS
);
2834 SERVICE( XMLDrawingLayerExport
, "com.sun.star.comp.DrawingLayer.XMLExporter", "XMLDrawingLayerExport", sal_True
, EXPORT_OASIS
|EXPORT_STYLES
|EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_FONTDECLS
|EXPORT_EMBEDDED
);
2835 SERVICE( XMLImpressClipboardExport
, "com.sun.star.comp.Impress.XMLClipboardExporter", "XMLImpressClipboardExport", sal_False
, EXPORT_OASIS
|EXPORT_STYLES
|EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_FONTDECLS
|EXPORT_EMBEDDED
);
2838 OUString SAL_CALL
SdXMLExport::getImplementationName() throw( uno::RuntimeException
)
2844 switch( getExportFlags())
2846 case EXPORT_META
|EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_SETTINGS
|EXPORT_FONTDECLS
|EXPORT_EMBEDDED
:
2847 return XMLDrawExportOOO_getImplementationName();
2848 case EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
:
2849 return XMLDrawStylesExportOOO_getImplementationName();
2850 case EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_FONTDECLS
:
2851 return XMLDrawContentExportOOO_getImplementationName();
2853 return XMLDrawMetaExportOOO_getImplementationName();
2854 case EXPORT_SETTINGS
:
2855 return XMLDrawSettingsExportOOO_getImplementationName();
2857 case EXPORT_OASIS
|EXPORT_META
|EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_SETTINGS
|EXPORT_FONTDECLS
|EXPORT_EMBEDDED
:
2858 return XMLDrawExportOasis_getImplementationName();
2859 case EXPORT_OASIS
|EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
:
2860 return XMLDrawStylesExportOasis_getImplementationName();
2861 case EXPORT_OASIS
|EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_FONTDECLS
:
2862 return XMLDrawContentExportOasis_getImplementationName();
2863 case EXPORT_OASIS
|EXPORT_META
:
2864 return XMLDrawMetaExportOasis_getImplementationName();
2865 case EXPORT_OASIS
|EXPORT_SETTINGS
:
2866 return XMLDrawSettingsExportOasis_getImplementationName();
2869 return XMLDrawExportOOO_getImplementationName();
2876 switch( getExportFlags())
2878 case EXPORT_META
|EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_SETTINGS
|EXPORT_FONTDECLS
|EXPORT_EMBEDDED
:
2879 return XMLImpressExportOOO_getImplementationName();
2880 case EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
:
2881 return XMLImpressStylesExportOOO_getImplementationName();
2882 case EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_FONTDECLS
:
2883 return XMLImpressContentExportOOO_getImplementationName();
2885 return XMLImpressMetaExportOOO_getImplementationName();
2886 case EXPORT_SETTINGS
:
2887 return XMLImpressSettingsExportOOO_getImplementationName();
2888 case EXPORT_OASIS
|EXPORT_META
|EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_SETTINGS
|EXPORT_FONTDECLS
|EXPORT_EMBEDDED
:
2889 return XMLImpressExportOasis_getImplementationName();
2890 case EXPORT_OASIS
|EXPORT_STYLES
|EXPORT_MASTERSTYLES
|EXPORT_AUTOSTYLES
:
2891 return XMLImpressStylesExportOasis_getImplementationName();
2892 case EXPORT_OASIS
|EXPORT_AUTOSTYLES
|EXPORT_CONTENT
|EXPORT_SCRIPTS
|EXPORT_FONTDECLS
:
2893 return XMLImpressContentExportOasis_getImplementationName();
2894 case EXPORT_OASIS
|EXPORT_META
:
2895 return XMLImpressMetaExportOasis_getImplementationName();
2896 case EXPORT_OASIS
|EXPORT_SETTINGS
:
2897 return XMLImpressSettingsExportOasis_getImplementationName();
2900 return XMLImpressExportOOO_getImplementationName();
2905 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */