LibreOffice Module xmloff (master) 1
sdxmlexp.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include <sal/config.h>
21
22#include <string_view>
23
24#include <xmloff/autolayout.hxx>
28#include <xmloff/xmluconv.hxx>
29#include <xmloff/xmltoken.hxx>
30#include <com/sun/star/lang/XMultiServiceFactory.hpp>
31#include <com/sun/star/presentation/XPresentationSupplier.hpp>
32#include <com/sun/star/presentation/XCustomPresentationSupplier.hpp>
33#include <com/sun/star/geometry/RealPoint2D.hpp>
34#include <com/sun/star/office/XAnnotationAccess.hpp>
35#include <com/sun/star/uno/Any.hxx>
36#include "sdxmlexp_impl.hxx"
37#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
38#include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
39#include <com/sun/star/presentation/XHandoutMasterSupplier.hpp>
40#include <com/sun/star/container/XIndexContainer.hpp>
41#include <com/sun/star/view/PaperOrientation.hpp>
42#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
43
44#include <com/sun/star/form/XFormsSupplier2.hpp>
45#include <com/sun/star/presentation/XPresentationPage.hpp>
46#include <com/sun/star/drawing/XMasterPageTarget.hpp>
47#include <com/sun/star/text/XText.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 <sal/log.hxx>
55#include <tools/gen.hxx>
57#include <xmloff/xmlaustp.hxx>
58#include <xmloff/families.hxx>
59#include <xmloff/styleexp.hxx>
63#include "sdpropls.hxx"
64#include <xmloff/xmlexppr.hxx>
65
66#include <PropertySetMerger.hxx>
67#include "layerexp.hxx"
68
70
72
73#include <com/sun/star/document/XDocumentProperties.hpp>
74#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
75#include <com/sun/star/util/Color.hpp>
77#include <o3tl/enumrange.hxx>
78
79using namespace ::com::sun::star;
80using namespace ::com::sun::star::uno;
81using namespace ::com::sun::star::beans;
82using namespace ::com::sun::star::util;
83using namespace ::com::sun::star::container;
84using namespace ::com::sun::star::drawing;
85using namespace ::com::sun::star::office;
86using namespace ::com::sun::star::presentation;
87using namespace ::com::sun::star::geometry;
88using namespace ::com::sun::star::text;
89using namespace ::xmloff::token;
90
92{
93 sal_Int32 mnBorderBottom;
94 sal_Int32 mnBorderLeft;
95 sal_Int32 mnBorderRight;
96 sal_Int32 mnBorderTop;
97 sal_Int32 mnWidth;
98 sal_Int32 mnHeight;
99 view::PaperOrientation meOrientation;
100 OUString msName;
102
103public:
104 ImpXMLEXPPageMasterInfo(const SdXMLExport& rExp, const Reference<XDrawPage>& xPage);
105 bool operator==(const ImpXMLEXPPageMasterInfo& rInfo) const;
106 void SetName(const OUString& rStr);
107
108 const OUString& GetName() const { return msName; }
109 const OUString& GetMasterPageName() const { return msMasterPageName; }
110
111 sal_Int32 GetBorderBottom() const { return mnBorderBottom; }
112 sal_Int32 GetBorderLeft() const { return mnBorderLeft; }
113 sal_Int32 GetBorderRight() const { return mnBorderRight; }
114 sal_Int32 GetBorderTop() const { return mnBorderTop; }
115 sal_Int32 GetWidth() const { return mnWidth; }
116 sal_Int32 GetHeight() const { return mnHeight; }
117 view::PaperOrientation GetOrientation() const { return meOrientation; }
118};
119
121 const SdXMLExport& rExp,
122 const Reference<XDrawPage>& xPage)
123: mnBorderBottom(0),
124 mnBorderLeft(0),
125 mnBorderRight(0),
126 mnBorderTop(0),
127 mnWidth(0),
128 mnHeight(0),
129 meOrientation(rExp.IsDraw() ? view::PaperOrientation_PORTRAIT : view::PaperOrientation_LANDSCAPE)
130{
131 Reference <beans::XPropertySet> xPropSet(xPage, UNO_QUERY);
132 if(xPropSet.is())
133 {
134 Any aAny;
135
136 Reference< beans::XPropertySetInfo > xPropsInfo( xPropSet->getPropertySetInfo() );
137 if( xPropsInfo.is() && xPropsInfo->hasPropertyByName("BorderBottom"))
138 {
139 aAny = xPropSet->getPropertyValue("BorderBottom");
140 aAny >>= mnBorderBottom;
141
142 aAny = xPropSet->getPropertyValue("BorderLeft");
143 aAny >>= mnBorderLeft;
144
145 aAny = xPropSet->getPropertyValue("BorderRight");
146 aAny >>= mnBorderRight;
147
148 aAny = xPropSet->getPropertyValue("BorderTop");
149 aAny >>= mnBorderTop;
150 }
151
152 if( xPropsInfo.is() && xPropsInfo->hasPropertyByName("Width"))
153 {
154 aAny = xPropSet->getPropertyValue("Width");
155 aAny >>= mnWidth;
156
157 aAny = xPropSet->getPropertyValue("Height");
158 aAny >>= mnHeight;
159 }
160
161 if( xPropsInfo.is() && xPropsInfo->hasPropertyByName("Orientation"))
162 {
163 aAny = xPropSet->getPropertyValue("Orientation");
164 aAny >>= meOrientation;
165 }
166 }
167
168 Reference <container::XNamed> xMasterNamed(xPage, UNO_QUERY);
169 if(xMasterNamed.is())
170 {
171 msMasterPageName = xMasterNamed->getName();
172 }
173}
174
176{
177 return ((mnBorderBottom == rInfo.mnBorderBottom)
178 && (mnBorderLeft == rInfo.mnBorderLeft)
179 && (mnBorderRight == rInfo.mnBorderRight)
180 && (mnBorderTop == rInfo.mnBorderTop)
181 && (mnWidth == rInfo.mnWidth)
182 && (mnHeight == rInfo.mnHeight)
183 && (meOrientation == rInfo.meOrientation));
184}
185
186void ImpXMLEXPPageMasterInfo::SetName(const OUString& rStr)
187{
188 msName = rStr;
189}
190
191#define IMP_AUTOLAYOUT_INFO_MAX (35L)
192
194{
195 sal_uInt16 mnType;
197 OUString msLayoutName;
200 sal_Int32 mnGapX;
201 sal_Int32 mnGapY;
202
203public:
204 ImpXMLAutoLayoutInfo(sal_uInt16 nTyp, ImpXMLEXPPageMasterInfo* pInf);
205
206 sal_uInt16 GetLayoutType() const { return mnType; }
208 sal_Int32 GetGapX() const { return mnGapX; }
209 sal_Int32 GetGapY() const { return mnGapY; }
210
211 const OUString& GetLayoutName() const { return msLayoutName; }
212 void SetLayoutName(const OUString& rNew) { msLayoutName = rNew; }
213
216
217 static bool IsCreateNecessary(sal_uInt16 nTyp);
218};
219
221{
222 if(nTyp == 5 /* AUTOLAYOUT_ORG */
223 || nTyp == 20 /* AUTOLAYOUT_NONE */
224 || nTyp >= IMP_AUTOLAYOUT_INFO_MAX)
225 return false;
226 return true;
227}
228
230 : mnType(nTyp)
231 , mpPageMasterInfo(pInf)
232 , mnGapX(0)
233 , mnGapY(0)
234{
235 // create full info (initialize with typical values)
236 Point aPagePos(0,0);
237 Size aPageSize(28000, 21000);
238 Size aPageInnerSize(28000, 21000);
239
241 {
244 aPageInnerSize = aPageSize;
247 }
248
249 // title rectangle aligning
250 Point aTitlePos(aPagePos);
251 Size aTitleSize(aPageInnerSize);
252
253 if(mnType == 21 /* AUTOLAYOUT_NOTES */)
254 {
255 aTitleSize.setHeight(static_cast<tools::Long>(aTitleSize.Height() / 2.5));
256 Point aPos = aTitlePos;
257 aPos.AdjustY( tools::Long( aTitleSize.Height() * 0.083 ) );
258 Size aPartArea = aTitleSize;
259 Size aSize;
260
261 // scale handout rectangle using actual page size
262 double fH = static_cast<double>(aPartArea.Width()) / aPageSize.Width();
263 double fV = static_cast<double>(aPartArea.Height()) / aPageSize.Height();
264
265 if ( fH > fV )
266 fH = fV;
267 aSize.setWidth( static_cast<tools::Long>(fH * aPageSize.Width()) );
268 aSize.setHeight( static_cast<tools::Long>(fH * aPageSize.Height()) );
269
270 aPos.AdjustX((aPartArea.Width() - aSize.Width()) / 2);
271 aPos.AdjustY((aPartArea.Height()- aSize.Height())/ 2);
272
273 aTitlePos = aPos;
274 aTitleSize = aSize;
275 }
277 {
278 Point aClassicTPos(
279 aTitlePos.X() + tools::Long( aTitleSize.Width() * 0.0735 ),
280 aTitlePos.Y() + tools::Long( aTitleSize.Height() * 0.083 ));
281 Size aClassicTSize(
282 tools::Long( aTitleSize.Width() * 0.854 ),
283 tools::Long( aTitleSize.Height() * 0.167 ));
284 Point aLPos(aPagePos);
285 Size aLSize(aPageInnerSize);
286 Point aClassicLPos(
287 aLPos.X() + tools::Long( aLSize.Width() * 0.0735 ),
288 aLPos.Y() + tools::Long( aLSize.Height() * 0.472 ));
289 Size aClassicLSize(
290 tools::Long( aLSize.Width() * 0.854 ),
291 tools::Long( aLSize.Height() * 0.444 ));
292
293 aTitlePos.setX( (aClassicTPos.X() + aClassicTSize.Width()) - aClassicTSize.Height() );
294 aTitlePos.setY( aClassicTPos.Y() );
295 aTitleSize.setWidth( aClassicTSize.Height() );
296 aTitleSize.setHeight( (aClassicLPos.Y() + aClassicLSize.Height()) - aClassicTPos.Y() );
297 }
298 else
299 {
300 aTitlePos.AdjustX( tools::Long( aTitleSize.Width() * 0.0735 ) );
301 aTitlePos.AdjustY( tools::Long( aTitleSize.Height() * 0.083 ) );
302 aTitleSize.setWidth( tools::Long( aTitleSize.Width() * 0.854 ) );
303 aTitleSize.setHeight( tools::Long( aTitleSize.Height() * 0.167 ) );
304 }
305
306 maTitleRect.SetPos(aTitlePos);
307 maTitleRect.SetSize(aTitleSize);
308
309 // layout rectangle aligning
310 Point aLayoutPos(aPagePos);
311 Size aLayoutSize(aPageInnerSize);
312
313 if(mnType == 21 /* AUTOLAYOUT_NOTES */)
314 {
315 aLayoutPos.AdjustX( tools::Long( aLayoutSize.Width() * 0.0735 ) );
316 aLayoutPos.AdjustY( tools::Long( aLayoutSize.Height() * 0.472 ) );
317 aLayoutSize.setWidth( tools::Long( aLayoutSize.Width() * 0.854 ) );
318 aLayoutSize.setHeight( tools::Long( aLayoutSize.Height() * 0.444 ) );
319 }
320 else if((mnType >= 22 && mnType <= 26) || (mnType == 31)) // AUTOLAYOUT_HANDOUT*
321 {
322 // keep info for inner area in maPresRect, put info for gap size
323 // to maTitleRect position
324 mnGapX = (aPageSize.Width() - aPageInnerSize.Width()) / 2;
325 mnGapY = (aPageSize.Height() - aPageInnerSize.Height()) / 2;
326
327 if(!mnGapX)
328 mnGapX = aPageSize.Width() / 10;
329
330 if(!mnGapY)
331 mnGapY = aPageSize.Height() / 10;
332
333 if(mnGapX < aPageInnerSize.Width() / 10)
334 mnGapX = aPageInnerSize.Width() / 10;
335
336 if(mnGapY < aPageInnerSize.Height() / 10)
337 mnGapY = aPageInnerSize.Height() / 10;
338 }
340 {
341 Point aClassicTPos(
342 aTitlePos.X() + tools::Long( aTitleSize.Width() * 0.0735 ),
343 aTitlePos.Y() + tools::Long( aTitleSize.Height() * 0.083 ));
344 Size aClassicTSize(
345 tools::Long( aTitleSize.Width() * 0.854 ),
346 tools::Long( aTitleSize.Height() * 0.167 ));
347 Point aClassicLPos(
348 aLayoutPos.X() + tools::Long( aLayoutSize.Width() * 0.0735 ),
349 aLayoutPos.Y() + tools::Long( aLayoutSize.Height() * 0.472 ));
350 Size aClassicLSize(
351 tools::Long( aLayoutSize.Width() * 0.854 ),
352 tools::Long( aLayoutSize.Height() * 0.444 ));
353
354 aLayoutPos.setX( aClassicLPos.X() );
355 aLayoutPos.setY( aClassicTPos.Y() );
356 aLayoutSize.setWidth( (aClassicLPos.X() + aClassicLSize.Width())
357 - (aClassicTSize.Height() + (aClassicLPos.Y() - (aClassicTPos.Y() + aClassicTSize.Height()))));
358 aLayoutSize.setHeight( (aClassicLPos.Y() + aClassicLSize.Height()) - aClassicTPos.Y() );
359 }
360 else if( mnType == AUTOLAYOUT_ONLY_TEXT )
361 {
362 aLayoutPos = aTitlePos;
363 aLayoutSize.setWidth( aTitleSize.Width() );
364 aLayoutSize.setHeight( tools::Long( aLayoutSize.Height() * 0.825 ) );
365 }
366 else
367 {
368 aLayoutPos.AdjustX( tools::Long( aLayoutSize.Width() * 0.0735 ) );
369 aLayoutPos.AdjustY( tools::Long( aLayoutSize.Height() * 0.278 ) );
370 aLayoutSize.setWidth( tools::Long( aLayoutSize.Width() * 0.854 ) );
371 aLayoutSize.setHeight( tools::Long( aLayoutSize.Height() * 0.630 ) );
372 }
373
374 maPresRect.SetPos(aLayoutPos);
375 maPresRect.SetSize(aLayoutSize);
376}
377
378constexpr OUStringLiteral gsPageLayoutNames( u"PageLayoutNames" );
379
381 const css::uno::Reference< css::uno::XComponentContext >& xContext,
382 OUString const & implementationName,
383 bool bIsDraw, SvXMLExportFlags nExportFlags )
384: SvXMLExport( xContext, implementationName, util::MeasureUnit::CM,
385 bIsDraw ? XML_GRAPHICS : XML_PRESENTATION, nExportFlags ),
386 mnDocMasterPageCount(0),
387 mnDocDrawPageCount(0),
388 mnObjectCount(0),
389 mpHandoutPageMaster(nullptr),
390 mbIsDraw(bIsDraw)
391{
392
393}
394
395// XExporter
396void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent >& xDoc )
397{
399
400 // prepare factory parts
402
403 // construct PropertySetMapper
405
406 // get or create text paragraph export
409
410 // chain text attributes
412
413 // construct PresPagePropsMapper
415
417
418 // add family name
419 GetAutoStylePool()->AddFamily(
424 GetAutoStylePool()->AddFamily(
429 GetAutoStylePool()->AddFamily(
434 // prepare access to styles
435 Reference< style::XStyleFamiliesSupplier > xFamSup( GetModel(), UNO_QUERY );
436 if(xFamSup.is())
437 {
438 mxDocStyleFamilies = xFamSup->getStyleFamilies();
439 }
440
441 // prepare access to master pages
442 Reference < drawing::XMasterPagesSupplier > xMasterPagesSupplier(GetModel(), UNO_QUERY);
443 if(xMasterPagesSupplier.is())
444 {
445 mxDocMasterPages = xMasterPagesSupplier->getMasterPages();
446 if(mxDocMasterPages.is())
447 {
450 }
451 }
452
453 // prepare access to draw pages
454 Reference <XDrawPagesSupplier> xDrawPagesSupplier(GetModel(), UNO_QUERY);
455 if(xDrawPagesSupplier.is())
456 {
457 mxDocDrawPages = xDrawPagesSupplier->getDrawPages();
458 if(mxDocDrawPages.is())
459 {
463 if( !mbIsDraw )
465
466 HeaderFooterPageSettingsImpl aEmptySettings;
469 }
470 }
471
472 // #82003# count all draw objects for use with progress bar.
473 // #88245# init mnObjectCount once, use counter itself as flag. It
474 // is initialized to 0.
475 if(!mnObjectCount)
476 {
477 if( IsImpress() )
478 {
479 // #91587# add handout master count
480 Reference<presentation::XHandoutMasterSupplier> xHandoutSupp(GetModel(), UNO_QUERY);
481 if(xHandoutSupp.is())
482 {
483 Reference<XDrawPage> xHandoutPage(xHandoutSupp->getHandoutMasterPage());
484 if(xHandoutPage.is() && xHandoutPage->getCount())
485 mnObjectCount += ImpRecursiveObjectCount(xHandoutPage);
486 }
487 }
488
489 if(mxDocMasterPages.is())
490 {
491 for(sal_Int32 a(0); a < mnDocMasterPageCount; a++)
492 {
493 Any aAny(mxDocMasterPages->getByIndex(a));
494 Reference< drawing::XShapes > xMasterPage;
495
496 if((aAny >>= xMasterPage) && xMasterPage.is())
497 {
499 }
500
501 if( IsImpress() )
502 {
503 // #91587# take notes pages from master pages into account
504 Reference<presentation::XPresentationPage> xPresPage;
505 if((aAny >>= xPresPage) && xPresPage.is())
506 {
507 Reference<XDrawPage> xNotesPage(xPresPage->getNotesPage());
508 if(xNotesPage.is() && xNotesPage->getCount())
510 }
511 }
512 }
513 }
514
515 if(mxDocDrawPages.is())
516 {
517 for(sal_Int32 a(0); a < mnDocDrawPageCount; a++)
518 {
519 Any aAny(mxDocDrawPages->getByIndex(a));
520 Reference< drawing::XShapes > xPage;
521
522 if((aAny >>= xPage) && xPage.is())
523 {
525 }
526
527 if( IsImpress() )
528 {
529 // #91587# take notes pages from draw pages into account
530 Reference<presentation::XPresentationPage> xPresPage;
531 if((aAny >>= xPresPage) && xPresPage.is())
532 {
533 Reference<XDrawPage> xNotesPage(xPresPage->getNotesPage());
534 if(xNotesPage.is() && xNotesPage->getCount())
536 }
537 }
538 }
539 }
540
541 // #82003# init progress bar
543 }
544
545 // add namespaces
550
553 GetXMLToken(XML_N_SMIL_COMPAT),
555
560
562 {
567 }
568
569 GetShapeExport()->enableLayerExport();
570
571 // #88546# enable progress bar increments
572 GetShapeExport()->enableHandleProgressBar();
573}
574
575// #82003# helper function for recursive object count
576sal_uInt32 SdXMLExport::ImpRecursiveObjectCount(const Reference< drawing::XShapes >& xShapes)
577{
578 sal_uInt32 nRetval(0);
579
580 if(xShapes.is())
581 {
582 sal_Int32 nCount = xShapes->getCount();
583
584 for(sal_Int32 a(0); a < nCount; a++)
585 {
586 Any aAny(xShapes->getByIndex(a));
587 Reference< drawing::XShapes > xGroup;
588
589 if((aAny >>= xGroup) && xGroup.is())
590 {
591 // #93180# count group objects, too.
592 nRetval += 1 + ImpRecursiveObjectCount(xGroup);
593 }
594 else
595 {
596 nRetval++;
597 }
598 }
599 }
600
601 return nRetval;
602}
603
605{
606 // cleanup factory, decrease refcount. Should lead to destruction.
607 mpSdPropHdlFactory.clear();
608
609 // cleanup mapper, decrease refcount. Should lead to destruction.
610 mpPropertySetMapper.clear();
611
612 // cleanup presPage mapper, decrease refcount. Should lead to destruction.
613 mpPresPagePropsMapper.clear();
614
615 mvPageMasterInfoList.clear();
616
617 // clear auto-layout infos
618 mvAutoLayoutInfoList.clear();
619}
620
622{
623 if(!IsImpress())
624 return;
625
626 OUString aStr;
627 auto DrawPagesAutoLayoutNamesRange = asNonConstRange(maDrawPagesAutoLayoutNames);
628 Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetModel(), UNO_QUERY );
629 if( xHandoutSupp.is() )
630 {
631 Reference< XDrawPage > xHandoutPage( xHandoutSupp->getHandoutMasterPage() );
632 if( xHandoutPage.is() )
633 {
634 if(ImpPrepAutoLayoutInfo(xHandoutPage, aStr))
635 DrawPagesAutoLayoutNamesRange[0] = aStr;
636 }
637 }
638
639 // prepare name creation
640 for (sal_Int32 nCnt = 0; nCnt < mnDocDrawPageCount; nCnt++)
641 {
642 Any aAny(mxDocDrawPages->getByIndex(nCnt));
643 Reference<XDrawPage> xDrawPage;
644
645 if((aAny >>= xDrawPage) && xDrawPage.is())
646 {
647 if(ImpPrepAutoLayoutInfo(xDrawPage, aStr))
648 DrawPagesAutoLayoutNamesRange[nCnt+1] = aStr;
649 }
650 }
651}
652
653bool SdXMLExport::ImpPrepAutoLayoutInfo(const Reference<XDrawPage>& xPage, OUString& rName)
654{
655 rName.clear();
656 bool bRetval(false);
657
658 Reference <beans::XPropertySet> xPropSet(xPage, UNO_QUERY);
659 if(xPropSet.is())
660 {
661 sal_uInt16 nType = sal_uInt16();
662 Any aAny = xPropSet->getPropertyValue("Layout");
663 if(aAny >>= nType)
664 {
666 {
667 ImpXMLEXPPageMasterInfo* pInfo = nullptr;
668
669 // get master-page info
670 Reference < drawing::XMasterPageTarget > xMasterPageInt(xPage, UNO_QUERY);
671 if(xMasterPageInt.is())
672 {
673 Reference<XDrawPage> xUsedMasterPage(xMasterPageInt->getMasterPage());
674 if(xUsedMasterPage.is())
675 {
676 Reference < container::XNamed > xMasterNamed(xUsedMasterPage, UNO_QUERY);
677 if(xMasterNamed.is())
678 {
679 OUString sMasterPageName = xMasterNamed->getName();
680 pInfo = ImpGetPageMasterInfoByName(sMasterPageName);
681 }
682 }
683 }
684
685 // create entry and look for existence
687 auto it = std::find_if(mvAutoLayoutInfoList.begin(), mvAutoLayoutInfoList.end(),
688 [=](std::unique_ptr<ImpXMLAutoLayoutInfo> const & rInfo) { return nType == rInfo->GetLayoutType() && pInfo == rInfo->GetPageMasterInfo(); });
689 if (it != mvAutoLayoutInfoList.end())
690 {
691 pNew = it->get();
692 }
693 else
694 {
695 pNew = new ImpXMLAutoLayoutInfo(nType, pInfo);
696 mvAutoLayoutInfoList.emplace_back( pNew );
697 OUString sNewName =
698 "AL" + OUString::number(mvAutoLayoutInfoList.size() - 1) +
699 "T" + OUString::number(nType);
700 pNew->SetLayoutName(sNewName);
701 }
702
703 rName = pNew->GetLayoutName();
704 bRetval = true;
705 }
706 }
707 }
708
709 return bRetval;
710}
711
713{
714 for(const auto & pInfo : mvAutoLayoutInfoList)
715 {
716 if(pInfo)
717 {
718 // prepare presentation-page layout attributes, style-name
719 AddAttribute(XML_NAMESPACE_STYLE, XML_NAME, pInfo->GetLayoutName());
720
721 // write draw-style attributes
723
724 // write presentation placeholders
725 switch(pInfo->GetLayoutType())
726 {
727 case AUTOLAYOUT_TITLE :
728 {
729 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
730 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderSubtitle, pInfo->GetPresRectangle());
731 break;
732 }
734 {
735 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
736 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, pInfo->GetPresRectangle());
737 break;
738 }
739 case AUTOLAYOUT_CHART :
740 {
741 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
742 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart, pInfo->GetPresRectangle());
743 break;
744 }
746 {
747 tools::Rectangle aLeft(pInfo->GetPresRectangle());
748 aLeft.setWidth(tools::Long(aLeft.GetWidth() * 0.488));
749 tools::Rectangle aRight(aLeft);
750 aRight.SetLeft(tools::Long(aRight.Left() + aRight.GetWidth() * 1.05));
751
752 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
755 break;
756 }
758 {
759 tools::Rectangle aLeft(pInfo->GetPresRectangle());
760 aLeft.setWidth(tools::Long(aLeft.GetWidth() * 0.488));
761 tools::Rectangle aRight(aLeft);
762 aRight.SetLeft( tools::Long(aRight.Left() + aRight.GetWidth() * 1.05) );
763
764 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
767 break;
768 }
770 {
771 tools::Rectangle aLeft(pInfo->GetPresRectangle());
772 aLeft.setWidth(tools::Long(aLeft.GetWidth() * 0.488));
773 tools::Rectangle aRight(aLeft);
774 aRight.SetLeft(tools::Long(aRight.Left() + aRight.GetWidth() * 1.05));
775
776 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
779 break;
780 }
782 {
783 tools::Rectangle aLeft(pInfo->GetPresRectangle());
784 aLeft.setWidth(tools::Long(aLeft.GetWidth() * 0.488));
785 tools::Rectangle aRight(aLeft);
786 aRight.SetLeft(tools::Long(aRight.Left() + aRight.GetWidth() * 1.05));
787
788 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
791 break;
792 }
793 case AUTOLAYOUT_TAB :
794 {
795 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
796 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTable, pInfo->GetPresRectangle());
797 break;
798 }
800 {
801 tools::Rectangle aLeft(pInfo->GetPresRectangle());
802 aLeft.setWidth(tools::Long(aLeft.GetWidth() * 0.488));
803 tools::Rectangle aRight(aLeft);
804 aRight.SetLeft(tools::Long(aRight.Left() + aRight.GetWidth() * 1.05));
805
806 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
809 break;
810 }
811 case AUTOLAYOUT_TEXTOBJ :
812 {
813 tools::Rectangle aLeft(pInfo->GetPresRectangle());
814 aLeft.setWidth(tools::Long(aLeft.GetWidth() * 0.488));
815 tools::Rectangle aRight(aLeft);
816 aRight.SetLeft(tools::Long(aRight.Left() + aRight.GetWidth() * 1.05));
817
818 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
821 break;
822 }
823 case AUTOLAYOUT_OBJ :
824 {
825 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
826 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, pInfo->GetPresRectangle());
827 break;
828 }
830 {
831 tools::Rectangle aLeft(pInfo->GetPresRectangle());
832 aLeft.setWidth(tools::Long(aLeft.GetWidth() * 0.488));
833 tools::Rectangle aRightTop(aLeft);
834 aRightTop.SetLeft(tools::Long(aRightTop.Left() + aRightTop.GetWidth() * 1.05));
835 aRightTop.setHeight(tools::Long(aRightTop.GetHeight() * 0.477));
836 tools::Rectangle aRightBottom(aRightTop);
837 aRightBottom.SetTop(tools::Long(aRightBottom.Top() + aRightBottom.GetHeight() * 1.095));
838
839 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
843 break;
844 }
845 case AUTOLAYOUT_OBJTEXT :
846 {
847 tools::Rectangle aLeft(pInfo->GetPresRectangle());
848 aLeft.setWidth(tools::Long(aLeft.GetWidth() * 0.488));
849 tools::Rectangle aRight(aLeft);
850 aRight.SetLeft(tools::Long(aRight.Left() + aRight.GetWidth() * 1.05));
851
852 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
855 break;
856 }
858 {
859 tools::Rectangle aTop(pInfo->GetPresRectangle());
860 aTop.setHeight(tools::Long(aTop.GetHeight() * 0.477));
861 tools::Rectangle aBottom(aTop);
862 aBottom.SetTop(tools::Long(aBottom.Top() + aBottom.GetHeight() * 1.095));
863
864 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
867 break;
868 }
870 {
871 tools::Rectangle aLeftTop(pInfo->GetPresRectangle());
872 aLeftTop.setWidth(tools::Long(aLeftTop.GetWidth() * 0.488));
873 tools::Rectangle aRight(aLeftTop);
874 aRight.SetLeft(tools::Long(aRight.Left() + aRight.GetWidth() * 1.05));
875 aLeftTop.setHeight(tools::Long(aLeftTop.GetHeight() * 0.477));
876 tools::Rectangle aLeftBottom(aLeftTop);
877 aLeftBottom.SetTop(tools::Long(aLeftBottom.Top() + aLeftBottom.GetHeight() * 1.095));
878
879 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
883 break;
884 }
886 {
887 tools::Rectangle aTopLeft(pInfo->GetPresRectangle());
888 aTopLeft.setHeight(tools::Long(aTopLeft.GetHeight() * 0.477));
889 tools::Rectangle aBottom(aTopLeft);
890 aBottom.SetTop(tools::Long(aBottom.Top() + aBottom.GetHeight() * 1.095));
891 aTopLeft.setWidth(tools::Long(aTopLeft.GetWidth() * 0.488));
892 tools::Rectangle aTopRight(aTopLeft);
893 aTopRight.SetLeft(tools::Long(aTopRight.Left() + aTopRight.GetWidth() * 1.05));
894
895 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
899 break;
900 }
902 {
903 tools::Rectangle aTop(pInfo->GetPresRectangle());
904 aTop.setHeight(tools::Long(aTop.GetHeight() * 0.477));
905 tools::Rectangle aBottom(aTop);
906 aBottom.SetTop(tools::Long(aBottom.Top() + aBottom.GetHeight() * 1.095));
907
908 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
911 break;
912 }
914 {
915 tools::Rectangle aTopLeft(pInfo->GetPresRectangle());
916 aTopLeft.setHeight(tools::Long(aTopLeft.GetHeight() * 0.477));
917 aTopLeft.setWidth(tools::Long(aTopLeft.GetWidth() * 0.488));
918 tools::Rectangle aBottomLeft(aTopLeft);
919 aBottomLeft.SetTop(tools::Long(aBottomLeft.Top() + aBottomLeft.GetHeight() * 1.095));
920 tools::Rectangle aTopRight(aTopLeft);
921 aTopRight.SetLeft(tools::Long(aTopRight.Left() + aTopRight.GetWidth() * 1.05));
922 tools::Rectangle aBottomRight(aTopRight);
923 aBottomRight.SetTop(tools::Long(aBottomRight.Top() + aBottomRight.GetHeight() * 1.095));
924
925 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
930 break;
931 }
933 {
934 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
935 break;
936 }
937 case AUTOLAYOUT_NOTES :
938 {
939 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderPage, pInfo->GetTitleRectangle());
940 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderNotes, pInfo->GetPresRectangle());
941 break;
942 }
949 {
950 sal_Int32 nColCnt, nRowCnt;
951 sal_Int32 nGapX = pInfo->GetGapX();
952 sal_Int32 nGapY = pInfo->GetGapY();
953
954 switch(pInfo->GetLayoutType())
955 {
956 case 22 : nColCnt = 1; nRowCnt = 1; break;
957 case 23 : nColCnt = 1; nRowCnt = 2; break;
958 case 24 : nColCnt = 1; nRowCnt = 3; break;
959 case 25 : nColCnt = 2; nRowCnt = 2; break;
960 case 26 : nColCnt = 3; nRowCnt = 2; break;
961 case 31 : nColCnt = 3; nRowCnt = 3; break;
962 default: nColCnt = 0; nRowCnt = 0; break; // FIXME - What is correct values?
963 }
964
965 Size aPartSize(pInfo->GetTitleRectangle().GetSize());
966 Point aPartPos(pInfo->GetTitleRectangle().TopLeft());
967
968 if(aPartSize.Width() > aPartSize.Height())
969 {
970 sal_Int32 nZwi(nColCnt);
971 nColCnt = nRowCnt;
972 nRowCnt = nZwi;
973 }
974
975 if (nColCnt == 0 || nRowCnt == 0)
976 break;
977
978 aPartSize.setWidth( (aPartSize.Width() - ((nColCnt - 1) * nGapX)) / nColCnt );
979 aPartSize.setHeight( (aPartSize.Height() - ((nRowCnt - 1) * nGapY)) / nRowCnt );
980
981 Point aTmpPos(aPartPos);
982
983 for (sal_Int32 a = 0; a < nRowCnt; a++)
984 {
985 aTmpPos.setX(aPartPos.X());
986
987 for (sal_Int32 b = 0; b < nColCnt; b++)
988 {
989 tools::Rectangle aTmpRect(aTmpPos, aPartSize);
990
992 aTmpPos.AdjustX( aPartSize.Width() + nGapX );
993 }
994
995 aTmpPos.AdjustY( aPartSize.Height() + nGapY );
996 }
997 break;
998 }
1000 {
1001 tools::Rectangle aTop(pInfo->GetPresRectangle());
1002 aTop.setHeight(tools::Long(aTop.GetHeight() * 0.488));
1003 tools::Rectangle aBottom(aTop);
1004 aBottom.SetTop(tools::Long(aBottom.Top() + aBottom.GetHeight() * 1.05));
1005
1009 break;
1010 }
1012 {
1015 break;
1016 }
1018 {
1019 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1021 break;
1022 }
1024 {
1025 tools::Rectangle aLeft(pInfo->GetPresRectangle());
1026 aLeft.setWidth(tools::Long(aLeft.GetWidth() * 0.488));
1027 tools::Rectangle aRight(aLeft);
1028 aRight.SetLeft(tools::Long(aRight.Left() + aRight.GetWidth() * 1.05));
1029
1030 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1033 break;
1034 }
1036 {
1037 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderSubtitle, pInfo->GetPresRectangle());
1038 break;
1039 }
1040
1041 case AUTOLAYOUT_4CLIPART :
1042 {
1043 tools::Rectangle aTopLeft(pInfo->GetPresRectangle());
1044 aTopLeft.setHeight(tools::Long(aTopLeft.GetHeight() * 0.477));
1045 aTopLeft.setWidth(tools::Long(aTopLeft.GetWidth() * 0.488));
1046 tools::Rectangle aBottomLeft(aTopLeft);
1047 aBottomLeft.SetTop(tools::Long(aBottomLeft.Top() + aBottomLeft.GetHeight() * 1.095));
1048 tools::Rectangle aTopRight(aTopLeft);
1049 aTopRight.SetLeft(tools::Long(aTopRight.Left() + aTopRight.GetWidth() * 1.05));
1050 tools::Rectangle aBottomRight(aTopRight);
1051 aBottomRight.SetTop(tools::Long(aBottomRight.Top() + aBottomRight.GetHeight() * 1.095));
1052
1053 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1058 break;
1059 }
1060
1062 {
1063 tools::Rectangle aTopLeft(pInfo->GetPresRectangle());
1064 aTopLeft.setHeight(tools::Long(aTopLeft.GetHeight() * 0.477));
1065 aTopLeft.setWidth(tools::Long(aTopLeft.GetWidth() * 0.322));
1066 tools::Rectangle aTopCenter(aTopLeft);
1067 aTopCenter.SetLeft(tools::Long(aTopCenter.Left() + aTopCenter.GetWidth() * 1.05));
1068 tools::Rectangle aTopRight(aTopLeft);
1069 aTopRight.SetLeft(tools::Long(aTopRight.Left() + aTopRight.GetWidth() * 2 * 1.05));
1070
1071 tools::Rectangle aBottomLeft(aTopLeft);
1072 aBottomLeft.SetTop(tools::Long(aBottomLeft.Top() + aBottomLeft.GetHeight() * 1.095));
1073 tools::Rectangle aBottomCenter(aTopCenter);
1074 aBottomCenter.SetTop(tools::Long(aBottomCenter.Top() + aBottomCenter.GetHeight() * 1.095));
1075 tools::Rectangle aBottomRight(aTopRight);
1076 aBottomRight.SetTop(tools::Long(aBottomRight.Top() + aBottomRight.GetHeight() * 1.095));
1077
1078 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
1085 break;
1086 }
1087 default:
1088 {
1089 OSL_FAIL("XMLEXP: unknown autolayout export");
1090 break;
1091 }
1092 }
1093 }
1094 }
1095}
1096
1098{
1099 OUString aStr;
1100 OUStringBuffer sStringBuffer;
1101
1102 // prepare presentation-placeholder attributes, presentation:object
1103 switch(ePl)
1104 {
1105 case XmlPlaceholderTitle: aStr = "title"; break;
1106 case XmlPlaceholderOutline: aStr = "outline"; break;
1107 case XmlPlaceholderSubtitle: aStr = "subtitle"; break;
1108 case XmlPlaceholderGraphic: aStr = "graphic"; break;
1109 case XmlPlaceholderObject: aStr = "object"; break;
1110 case XmlPlaceholderChart: aStr = "chart"; break;
1111 case XmlPlaceholderTable: aStr = "table"; break;
1112 case XmlPlaceholderPage: aStr = "page"; break;
1113 case XmlPlaceholderNotes: aStr = "notes"; break;
1114 case XmlPlaceholderHandout: aStr = "handout"; break;
1115 case XmlPlaceholderVerticalTitle: aStr = "vertical_title"; break;
1116 case XmlPlaceholderVerticalOutline: aStr = "vertical_outline"; break;
1117 }
1118
1120
1121 // svg:x,y,width,height
1122 GetMM100UnitConverter().convertMeasureToXML(sStringBuffer, rRect.Left());
1123 aStr = sStringBuffer.makeStringAndClear();
1125
1126 GetMM100UnitConverter().convertMeasureToXML(sStringBuffer, rRect.Top());
1127 aStr = sStringBuffer.makeStringAndClear();
1129
1131 rRect.GetWidth());
1132 aStr = sStringBuffer.makeStringAndClear();
1134
1136 rRect.GetHeight());
1137 aStr = sStringBuffer.makeStringAndClear();
1139
1140 // write presentation-placeholder
1142}
1143
1144ImpXMLEXPPageMasterInfo* SdXMLExport::ImpGetOrCreatePageMasterInfo( const Reference< XDrawPage >& xMasterPage )
1145{
1146 bool bDoesExist = false;
1147
1148 ImpXMLEXPPageMasterInfo* pNewInfo = new ImpXMLEXPPageMasterInfo(*this, xMasterPage);
1149
1150 // compare with prev page-master infos
1151 for( size_t a = 0; !bDoesExist && a < mvPageMasterInfoList.size(); a++)
1152 {
1153 if ( mvPageMasterInfoList.at(a)
1154 && *mvPageMasterInfoList.at(a) == *pNewInfo
1155 )
1156 {
1157 delete pNewInfo;
1158 pNewInfo = mvPageMasterInfoList.at(a).get();
1159 bDoesExist = true;
1160 }
1161 }
1162 // add entry when not found same page-master infos
1163 if(!bDoesExist)
1164 mvPageMasterInfoList.emplace_back( pNewInfo );
1165
1166 return pNewInfo;
1167}
1168
1170{
1171 if( IsImpress() )
1172 {
1173 // create page master info for handout master page
1174
1175 Reference< XHandoutMasterSupplier > xHMS( GetModel(), UNO_QUERY );
1176 if( xHMS.is() )
1177 {
1178 Reference< XDrawPage > xMasterPage( xHMS->getHandoutMasterPage() );
1179 if( xMasterPage.is() )
1181 }
1182 }
1183
1184 // create page master infos for master pages
1186 return;
1187
1188 // look for needed page-masters, create these
1189 for (sal_Int32 nMPageId = 0; nMPageId < mnDocMasterPageCount; nMPageId++)
1190 {
1191 Reference< XDrawPage > xMasterPage( mxDocMasterPages->getByIndex(nMPageId), UNO_QUERY );
1192 ImpXMLEXPPageMasterInfo* pNewInfo = nullptr;
1193
1194 if(xMasterPage.is())
1195 pNewInfo = ImpGetOrCreatePageMasterInfo(xMasterPage);
1196
1197 mvPageMasterUsageList.push_back( pNewInfo );
1198
1199 // look for page master of handout page
1200 if(IsImpress())
1201 {
1202 pNewInfo = nullptr;
1203 Reference< presentation::XPresentationPage > xPresPage(xMasterPage, UNO_QUERY);
1204 if(xPresPage.is())
1205 {
1206 Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage());
1207 if(xNotesPage.is())
1208 {
1209 pNewInfo = ImpGetOrCreatePageMasterInfo(xNotesPage);
1210 }
1211 }
1212 mvNotesPageMasterUsageList.push_back( pNewInfo );
1213 }
1214 }
1215}
1216
1218{
1219 // write created page-masters, create names for these
1220 for( size_t nCnt = 0; nCnt < mvPageMasterInfoList.size(); nCnt++)
1221 {
1222 ImpXMLEXPPageMasterInfo* pInfo = mvPageMasterInfoList.at(nCnt).get();
1223 if(pInfo)
1224 {
1225 // create name
1226 OUString sNewName = "PM" + OUString::number(nCnt);
1227 pInfo->SetName(sNewName);
1228
1229 // prepare page-master attributes
1230 OUString sString;
1231 OUStringBuffer sStringBuffer;
1232
1233 sString = sNewName;
1235
1236 // write page-layout
1237 SvXMLElementExport aPME(*this, XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT, true, true);
1238
1239 // prepare style:properties inside page-master
1241 pInfo->GetBorderTop());
1242 sString = sStringBuffer.makeStringAndClear();
1244
1246 pInfo->GetBorderBottom());
1247 sString = sStringBuffer.makeStringAndClear();
1249
1251 pInfo->GetBorderLeft());
1252 sString = sStringBuffer.makeStringAndClear();
1254
1256 pInfo->GetBorderRight());
1257 sString = sStringBuffer.makeStringAndClear();
1259
1261 pInfo->GetWidth());
1262 sString = sStringBuffer.makeStringAndClear();
1264
1266 pInfo->GetHeight());
1267 sString = sStringBuffer.makeStringAndClear();
1269
1270 if(pInfo->GetOrientation() == view::PaperOrientation_PORTRAIT)
1272 else
1274
1275 // write style:properties
1277 }
1278 }
1279}
1280
1282{
1283 if(!rName.empty())
1284 {
1285 for(const auto & pInfo : mvPageMasterInfoList)
1286 {
1287 if(pInfo)
1288 {
1289 if(!pInfo->GetMasterPageName().isEmpty() && rName == pInfo->GetMasterPageName())
1290 {
1291 return pInfo.get();
1292 }
1293 }
1294 }
1295 }
1296 return nullptr;
1297}
1298
1300{
1301 // create draw:style-name entries for page export
1302 // containing presentation page attributes AND background attributes
1303 // fixed family for page-styles is "drawing-page" (XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME)
1304
1305 sal_Int32 nCnt;
1306 for(nCnt = 0; nCnt < mnDocDrawPageCount; nCnt++)
1307 {
1308 Reference<XDrawPage> xDrawPage;
1309 mxDocDrawPages->getByIndex(nCnt) >>= xDrawPage;
1311
1312 Reference< presentation::XPresentationPage > xPresPage(xDrawPage, UNO_QUERY);
1313 if(xPresPage.is())
1314 {
1315 maDrawNotesPagesStyleNames[nCnt] = ImpCreatePresPageStyleName( xPresPage->getNotesPage(), false );
1316
1319 }
1320 }
1321}
1322
1323static OUString findOrAppendImpl( std::vector< OUString >& rVector, const OUString& rText, std::u16string_view pPrefix )
1324{
1325 // search rVector if there is already a string that equals rText
1326 auto aIter = std::find(rVector.begin(), rVector.end(), rText);
1327 sal_Int32 nIndex = std::distance(rVector.begin(), aIter) + 1;
1328
1329 // if nothing is found, append the string at the end of rVector
1330 if( aIter == rVector.end() )
1331 rVector.push_back( rText );
1332
1333 // create a reference string with pPrefix and the index of the
1334 // found or created rText
1335 return pPrefix + OUString::number( nIndex );
1336}
1337
1338static OUString findOrAppendImpl( std::vector< DateTimeDeclImpl >& rVector, const OUString& rText, bool bFixed, sal_Int32 nFormat, std::u16string_view pPrefix )
1339{
1340 // search rVector if there is already a DateTimeDeclImpl with rText,bFixed and nFormat
1341 auto aIter = std::find_if(rVector.begin(), rVector.end(),
1342 [bFixed, &rText, nFormat](const DateTimeDeclImpl& rDecl) {
1343 return (rDecl.mbFixed == bFixed) &&
1344 (!bFixed || (rDecl.maStrText == rText)) &&
1345 (bFixed || (rDecl.mnFormat == nFormat));
1346 });
1347 sal_Int32 nIndex = std::distance(rVector.begin(), aIter) + 1;
1348
1349 // if nothing is found, append a new DateTimeDeclImpl
1350 if( aIter == rVector.end() )
1351 {
1352 DateTimeDeclImpl aDecl;
1353 aDecl.maStrText = rText;
1354 aDecl.mbFixed = bFixed;
1355 aDecl.mnFormat = nFormat;
1356 rVector.push_back( aDecl );
1357 }
1358
1359 // create a reference string with pPrefix and the index of the
1360 // found or created DateTimeDeclImpl
1361 return pPrefix + OUString::number( nIndex );
1362}
1363
1364constexpr OUStringLiteral gpStrHeaderTextPrefix = u"hdr";
1365constexpr OUStringLiteral gpStrFooterTextPrefix = u"ftr";
1366constexpr OUStringLiteral gpStrDateTimeTextPrefix = u"dtd";
1367
1369{
1371
1372 if( xDrawPage.is() ) try
1373 {
1374 Reference< XPropertySet > xSet( xDrawPage, UNO_QUERY_THROW );
1375 Reference< XPropertySetInfo > xInfo( xSet->getPropertySetInfo() );
1376
1377 OUString aStrText;
1378
1379 static const OUStringLiteral aStrHeaderTextProp( u"HeaderText" );
1380 if( xInfo->hasPropertyByName( aStrHeaderTextProp ) )
1381 {
1382 xSet->getPropertyValue( aStrHeaderTextProp ) >>= aStrText;
1383 if( !aStrText.isEmpty() )
1385 }
1386
1387 static const OUStringLiteral aStrFooterTextProp( u"FooterText" );
1388 if( xInfo->hasPropertyByName( aStrFooterTextProp ) )
1389 {
1390 xSet->getPropertyValue( aStrFooterTextProp ) >>= aStrText;
1391 if( !aStrText.isEmpty() )
1393 }
1394
1395 static const OUStringLiteral aStrDateTimeTextProp( u"DateTimeText" );
1396 if( xInfo->hasPropertyByName( aStrDateTimeTextProp ) )
1397 {
1398 bool bFixed = false;
1399 sal_Int32 nFormat = 0;
1400 xSet->getPropertyValue( aStrDateTimeTextProp ) >>= aStrText;
1401 xSet->getPropertyValue("IsDateTimeFixed") >>= bFixed;
1402 xSet->getPropertyValue("DateTimeFormat") >>= nFormat;
1403
1404 if( !bFixed || !aStrText.isEmpty() )
1405 {
1407 if( !bFixed )
1408 addDataStyle( nFormat );
1409 }
1410 }
1411 }
1412 catch(const Exception&)
1413 {
1414 TOOLS_WARN_EXCEPTION("xmloff.draw", "");
1415 }
1416
1417 return aSettings;
1418}
1419
1421{
1422 OUStringBuffer sBuffer;
1423
1424 if( !maHeaderDeclsVector.empty() )
1425 {
1426 // export header decls
1427 const OUString aPrefix( gpStrHeaderTextPrefix );
1428 sal_Int32 nIndex = 1;
1429 for( const auto& rDecl : maHeaderDeclsVector )
1430 {
1431 sBuffer.append( aPrefix + OUString::number( nIndex ) );
1432 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_NAME, sBuffer.makeStringAndClear());
1433
1435 Characters(rDecl);
1436 ++nIndex;
1437 }
1438 }
1439
1440 if( !maFooterDeclsVector.empty() )
1441 {
1442 // export footer decls
1443 const OUString aPrefix( gpStrFooterTextPrefix );
1444 sal_Int32 nIndex = 1;
1445 for( const auto& rDecl : maFooterDeclsVector )
1446 {
1447 sBuffer.append( aPrefix + OUString::number( nIndex ) );
1448 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_NAME, sBuffer.makeStringAndClear());
1449
1451 Characters(rDecl);
1452 ++nIndex;
1453 }
1454 }
1455
1456 if( maDateTimeDeclsVector.empty() )
1457 return;
1458
1459 // export footer decls
1460 const OUString aPrefix( gpStrDateTimeTextPrefix );
1461 sal_Int32 nIndex = 1;
1462 for( const auto& rDecl : maDateTimeDeclsVector )
1463 {
1464 sBuffer.append( aPrefix + OUString::number( nIndex ) );
1465 AddAttribute( XML_NAMESPACE_PRESENTATION, XML_NAME, sBuffer.makeStringAndClear());
1466
1468
1469 if( !rDecl.mbFixed )
1471
1473 if( rDecl.mbFixed )
1474 Characters(rDecl.maStrText);
1475
1476 ++nIndex;
1477 }
1478}
1479
1481{
1482 if( !aSettings.maStrHeaderDeclName.isEmpty() )
1484
1485 if( !aSettings.maStrFooterDeclName.isEmpty() )
1487
1488 if( !aSettings.maStrDateTimeDeclName.isEmpty() )
1490}
1491
1492OUString SdXMLExport::ImpCreatePresPageStyleName( const Reference<XDrawPage>& xDrawPage, bool bExportBackground /* = true */ )
1493{
1494 // create name
1495 OUString sStyleName;
1496
1497 // create style for this page and add to auto style pool
1498
1499 Reference< beans::XPropertySet > xPropSet1(xDrawPage, UNO_QUERY);
1500 if(xPropSet1.is())
1501 {
1502 Reference< beans::XPropertySet > xPropSet;
1503
1504 if( bExportBackground )
1505 {
1506 // since the background items are in a different propertyset
1507 // which itself is a property of the pages property set
1508 // we now merge these two propertysets if possible to simulate
1509 // a single propertyset with all draw page properties
1510 static const OUStringLiteral aBackground(u"Background");
1511 Reference< beans::XPropertySet > xPropSet2;
1512 Reference< beans::XPropertySetInfo > xInfo( xPropSet1->getPropertySetInfo() );
1513 if( xInfo.is() && xInfo->hasPropertyByName( aBackground ) )
1514 {
1515 Any aAny( xPropSet1->getPropertyValue( aBackground ) );
1516 aAny >>= xPropSet2;
1517 }
1518
1519 if( xPropSet2.is() )
1520 xPropSet = PropertySetMerger_CreateInstance( xPropSet1, xPropSet2 );
1521 else
1522 xPropSet = xPropSet1;
1523 }
1524 else
1525 {
1526 xPropSet = xPropSet1;
1527 }
1528
1530
1531 std::vector<XMLPropertyState> aPropStates(aMapperRef->Filter(*this, xPropSet));
1532
1533 if( !aPropStates.empty() )
1534 {
1535 // there are filtered properties -> hard attributes
1536 // try to find this style in AutoStylePool
1537 sStyleName = GetAutoStylePool()->Find(XmlStyleFamily::SD_DRAWINGPAGE_ID, sStyleName, aPropStates);
1538
1539 if(sStyleName.isEmpty())
1540 {
1541 // Style did not exist, add it to AutoStalePool
1542 sStyleName = GetAutoStylePool()->Add(XmlStyleFamily::SD_DRAWINGPAGE_ID, sStyleName, std::move(aPropStates));
1543 }
1544 }
1545 }
1546
1547 return sStyleName;
1548}
1549
1551{
1552 // create draw:style-name entries for master page export
1553 // containing only background attributes
1554 // fixed family for page-styles is "drawing-page" (XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME)
1555
1556 sal_Int32 nCnt;
1557 for( nCnt = 0; nCnt < mnDocMasterPageCount; nCnt++)
1558 {
1559 Reference<XDrawPage> xDrawPage;
1560 mxDocMasterPages->getByIndex(nCnt) >>= xDrawPage;
1562 }
1563
1564 if( !IsImpress() )
1565 return;
1566
1567 Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetModel(), UNO_QUERY );
1568 if( xHandoutSupp.is() )
1569 {
1570 Reference< XDrawPage > xHandoutPage( xHandoutSupp->getHandoutMasterPage() );
1571 if( xHandoutPage.is() )
1572 {
1575 }
1576 }
1577}
1578
1580{
1581 if(!IsImpress())
1582 return;
1583
1584 for (sal_Int32 nCnt = 0; nCnt < mnDocMasterPageCount; nCnt++)
1585 {
1586 Any aAny(mxDocMasterPages->getByIndex(nCnt));
1587 Reference<container::XNamed> xNamed;
1588
1589 if(aAny >>= xNamed)
1590 {
1591 // write presentation styles (ONLY if presentation)
1592 if(IsImpress() && mxDocStyleFamilies.is() && xNamed.is())
1593 {
1596
1597 OUString aPrefix( xNamed->getName() + "-" );
1598
1599 aStEx->exportStyleFamily(xNamed->getName(),
1601 aMapperRef, false,
1603 }
1604 }
1605 }
1606}
1607
1609{
1610 uno::Sequence<beans::NamedValue> stats { { "ObjectCount", uno::Any(mnObjectCount) } };
1611
1612 // update document statistics at the model
1613 uno::Reference<document::XDocumentPropertiesSupplier> xPropSup(GetModel(),
1614 uno::UNO_QUERY_THROW);
1615 uno::Reference<document::XDocumentProperties> xDocProps(
1616 xPropSup->getDocumentProperties());
1617 if (xDocProps.is()) {
1618 xDocProps->setDocumentStatistics(stats);
1619 }
1620
1621 // call parent
1623}
1624
1626{
1627 GetFontAutoStylePool(); // make sure the pool is created
1629}
1630
1632{
1633 // export <pres:header-decl>, <pres:footer-decl> and <pres:date-time-decl> elements
1635
1636 // page export
1637 for(sal_Int32 nPageInd(0); nPageInd < mnDocDrawPageCount; nPageInd++)
1638 {
1639 uno::Reference<drawing::XDrawPage> xDrawPage( mxDocDrawPages->getByIndex(nPageInd), uno::UNO_QUERY );
1640
1641 // set progress view
1642 if(GetStatusIndicator().is())
1643 GetStatusIndicator()->setValue(((nPageInd + 1) * 100) / mnDocDrawPageCount);
1644
1645 if(xDrawPage.is())
1646 {
1647 // prepare page attributes, name of page
1648 Reference < container::XNamed > xNamed(xDrawPage, UNO_QUERY);
1649 if(xNamed.is())
1650 AddAttribute(XML_NAMESPACE_DRAW, XML_NAME, xNamed->getName());
1651
1652 // draw:style-name (presentation page attributes AND background attributes)
1653 if( !maDrawPagesStyleNames[nPageInd].isEmpty() )
1655 maDrawPagesStyleNames[nPageInd]);
1656
1657 // draw:master-page-name
1658 Reference < drawing::XMasterPageTarget > xMasterPageInt(xDrawPage, UNO_QUERY);
1659 if(xMasterPageInt.is())
1660 {
1661 Reference<XDrawPage> xUsedMasterPage(xMasterPageInt->getMasterPage());
1662 if(xUsedMasterPage.is())
1663 {
1664 Reference < container::XNamed > xMasterNamed(xUsedMasterPage, UNO_QUERY);
1665 if(xMasterNamed.is())
1666 {
1668 EncodeStyleName( xMasterNamed->getName()) );
1669 }
1670 }
1671 }
1672
1673 // presentation:page-layout-name
1674 if( IsImpress() && !maDrawPagesAutoLayoutNames[nPageInd+1].isEmpty())
1675 {
1677 }
1678
1679 Reference< beans::XPropertySet > xProps( xDrawPage, UNO_QUERY );
1680 if( xProps.is() )
1681 {
1682 try
1683 {
1684 OUString aBookmarkURL;
1685 xProps->getPropertyValue("BookmarkURL") >>= aBookmarkURL;
1686
1687 if( !aBookmarkURL.isEmpty() )
1688 {
1689 sal_Int32 nIndex = aBookmarkURL.lastIndexOf( '#' );
1690 if( nIndex != -1 )
1691 {
1692 OUString aFileName( aBookmarkURL.copy( 0, nIndex ) );
1693 std::u16string_view aBookmarkName( aBookmarkURL.subView( nIndex+1 ) );
1694
1695 aBookmarkURL = GetRelativeReference( aFileName ) + "#" + aBookmarkName;
1696 }
1697
1698 AddAttribute ( XML_NAMESPACE_XLINK, XML_HREF, aBookmarkURL);
1702 }
1703 }
1704 catch(const Exception&)
1705 {
1706 OSL_FAIL(" no \"BookmarkURL\" property at page?" );
1707 }
1708 }
1709
1710 if( IsImpress() )
1712
1713 OUString sNavigationOrder( getNavigationOrder( xDrawPage ) );
1714 if( !sNavigationOrder.isEmpty() )
1715 AddAttribute ( XML_NAMESPACE_DRAW, XML_NAV_ORDER, sNavigationOrder );
1716
1718 uno::Reference< css::animations::XAnimationNodeSupplier > xAnimNodeSupplier;
1719
1720 // prepare animation export
1721 if(IsImpress())
1722 {
1724 {
1725 // export new animations for oasis format
1726 xAnimNodeSupplier.set( xDrawPage, UNO_QUERY );
1727
1728 // prepare animations exporter if impress
1729 if(xAnimNodeSupplier.is())
1730 {
1731 xAnimationsExporter = new xmloff::AnimationsExporter( *this, xProps );
1732 xAnimationsExporter->prepare( xAnimNodeSupplier->getAnimationNode() );
1733 }
1734 }
1735 else
1736 {
1737 // export old animations for ooo format
1739 GetShapeExport()->setAnimationsExporter( xAnimExport );
1740 }
1741 }
1742
1743 // write draw:id
1744 const OUString aPageId = getInterfaceToIdentifierMapper().getIdentifier( xDrawPage );
1745 if( !aPageId.isEmpty() )
1746 {
1748 }
1749
1750 // write page
1751 SvXMLElementExport aDPG(*this, XML_NAMESPACE_DRAW, XML_PAGE, true, true);
1752
1753 // write optional office:forms
1754 exportFormsElement( xDrawPage );
1755
1756 // write graphic objects on this page (if any)
1757 if(xDrawPage.is() && xDrawPage->getCount())
1758 GetShapeExport()->exportShapes( xDrawPage );
1759
1760 // write animations and presentation notes (ONLY if presentation)
1761 if(IsImpress())
1762 {
1763 if(xAnimNodeSupplier.is())
1764 {
1765 xAnimationsExporter->exportAnimations( xAnimNodeSupplier->getAnimationNode() );
1766 }
1767 else
1768 {
1769 // animations
1770 rtl::Reference< XMLAnimationsExporter > xAnimExport( GetShapeExport()->getAnimationsExporter() );
1771 if( xAnimExport.is() )
1772 xAnimExport->exportAnimations( *this );
1773
1774 xAnimExport = nullptr;
1775 GetShapeExport()->setAnimationsExporter( xAnimExport );
1776 }
1777
1778 // presentations
1779 Reference< presentation::XPresentationPage > xPresPage(xDrawPage, UNO_QUERY);
1780 if(xPresPage.is())
1781 {
1782 Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage());
1783 if(xNotesPage.is())
1784 {
1785 if( !maDrawNotesPagesStyleNames[nPageInd].isEmpty() )
1787
1789
1790 // write presentation notes
1792
1793 // write optional office:forms
1794 exportFormsElement( xNotesPage );
1795
1796 // write shapes per se
1797 GetShapeExport()->exportShapes( xNotesPage );
1798 }
1799 }
1800 }
1801
1802 exportAnnotations( xDrawPage );
1803 }
1804 }
1805
1806 if( IsImpress() )
1808}
1809
1811{
1812 try
1813 {
1814 Reference< XPresentationSupplier > xPresSupplier( GetModel(), UNO_QUERY );
1815 if( !xPresSupplier.is() )
1816 return;
1817
1818 Reference< XPropertySet > xPresProps( xPresSupplier->getPresentation(), UNO_QUERY );
1819 if( !xPresProps.is() )
1820 return;
1821
1822 bool bHasAttr = false;
1823
1824 bool bTemp = false;
1825
1826 // export range
1827 xPresProps->getPropertyValue("IsShowAll") >>= bTemp;
1828 if( !bTemp )
1829 {
1830 OUString aFirstPage;
1831 xPresProps->getPropertyValue("FirstPage") >>= aFirstPage;
1832 if( !aFirstPage.isEmpty() )
1833 {
1835 bHasAttr = true;
1836 }
1837 else
1838 {
1839 OUString aCustomShow;
1840 xPresProps->getPropertyValue("CustomShow") >>= aCustomShow;
1841 if( !aCustomShow.isEmpty() )
1842 {
1844 bHasAttr = true;
1845 }
1846 }
1847 }
1848
1849 xPresProps->getPropertyValue("IsEndless") >>= bTemp;
1850 if( bTemp )
1851 {
1853 bHasAttr = true;
1854
1855 sal_Int32 nPause = 0;
1856 xPresProps->getPropertyValue("Pause") >>= nPause;
1857
1858 util::Duration aDuration;
1859 aDuration.Seconds = static_cast<sal_uInt16>(nPause);
1860
1861 OUStringBuffer aOut;
1862 ::sax::Converter::convertDuration(aOut, aDuration);
1863 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_PAUSE, aOut.makeStringAndClear() );
1864 }
1865
1866 xPresProps->getPropertyValue("AllowAnimations") >>= bTemp;
1867 if( !bTemp )
1868 {
1870 bHasAttr = true;
1871 }
1872
1873 xPresProps->getPropertyValue("IsAlwaysOnTop") >>= bTemp;
1874 if( bTemp )
1875 {
1877 bHasAttr = true;
1878 }
1879
1880 xPresProps->getPropertyValue("IsAutomatic") >>= bTemp;
1881 if( bTemp )
1882 {
1884 bHasAttr = true;
1885 }
1886
1887 xPresProps->getPropertyValue("IsFullScreen") >>= bTemp;
1888 if( !bTemp )
1889 {
1891 bHasAttr = true;
1892 }
1893
1894 // We need to always export this attribute, because the import had the wrong default (tdf#108824)
1895 xPresProps->getPropertyValue("IsMouseVisible") >>= bTemp;
1897 bHasAttr = true;
1898
1899 xPresProps->getPropertyValue("StartWithNavigator") >>= bTemp;
1900 if( bTemp )
1901 {
1903 bHasAttr = true;
1904 }
1905
1906 xPresProps->getPropertyValue("UsePen") >>= bTemp;
1907 if( bTemp )
1908 {
1910 bHasAttr = true;
1911 }
1912
1913 xPresProps->getPropertyValue("IsTransitionOnClick") >>= bTemp;
1914 if( !bTemp )
1915 {
1917 bHasAttr = true;
1918 }
1919
1920 xPresProps->getPropertyValue("IsShowLogo") >>= bTemp;
1921 if( bTemp )
1922 {
1924 bHasAttr = true;
1925 }
1926
1927 Reference< container::XNameContainer > xShows;
1928 Sequence< OUString > aShowNames;
1929 bool bHasNames = false;
1930
1931 Reference< XCustomPresentationSupplier > xSup( GetModel(), UNO_QUERY );
1932 if( xSup.is() )
1933 {
1934 xShows = xSup->getCustomPresentations();
1935 if( xShows.is() )
1936 {
1937 aShowNames = xShows->getElementNames();
1938 bHasNames = aShowNames.hasElements();
1939 }
1940 }
1941
1942 if( bHasAttr || bHasNames )
1943 {
1944 SvXMLElementExport aSettings(*this, XML_NAMESPACE_PRESENTATION, XML_SETTINGS, true, true);
1945
1946 if( !bHasNames )
1947 return;
1948
1949 Reference< XIndexContainer > xShow;
1950 Reference< XNamed > xPageName;
1951
1952 OUStringBuffer sTmp;
1953
1954 for( const auto& rShowName : std::as_const(aShowNames) )
1955 {
1957
1958 xShows->getByName( rShowName ) >>= xShow;
1959 SAL_WARN_IF( !xShow.is(), "xmloff", "invalid custom show!" );
1960 if( !xShow.is() )
1961 continue;
1962
1963 const sal_Int32 nPageCount = xShow->getCount();
1964 for( sal_Int32 nPage = 0; nPage < nPageCount; nPage++ )
1965 {
1966 xShow->getByIndex( nPage ) >>= xPageName;
1967
1968 if( !xPageName.is() )
1969 continue;
1970
1971 if( !sTmp.isEmpty() )
1972 sTmp.append( ',' );
1973 sTmp.append( xPageName->getName() );
1974
1975 }
1976
1977 if( !sTmp.isEmpty() )
1978 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_PAGES, sTmp.makeStringAndClear() );
1979
1980 SvXMLElementExport aShows(*this, XML_NAMESPACE_PRESENTATION, XML_SHOW, true, true);
1981 }
1982 }
1983 }
1984 catch(const uno::Exception&)
1985 {
1986 TOOLS_WARN_EXCEPTION("xmloff.draw", "while exporting <presentation:settings>");
1987 }
1988}
1989
1991{
1993
1994 // export fill styles
1996
1997 // write draw:style-name for object graphic-styles
1998 GetShapeExport()->ExportGraphicDefaults();
1999
2000 // do not export in ODF 1.1 or older
2002 GetShapeExport()->GetShapeTableExport()->exportTableStyles();
2003
2004 // write presentation styles
2006
2007 // prepare draw:auto-layout-name for page export
2009
2010 // write draw:auto-layout-name for page export
2012
2013 Reference< beans::XPropertySet > xInfoSet( getExportInfo() );
2014 if( xInfoSet.is() )
2015 {
2016 Reference< beans::XPropertySetInfo > xInfoSetInfo( xInfoSet->getPropertySetInfo() );
2017
2018 if( xInfoSetInfo->hasPropertyByName( gsPageLayoutNames ) )
2019 {
2020 xInfoSet->setPropertyValue( gsPageLayoutNames, Any(maDrawPagesAutoLayoutNames) );
2021 }
2022 }
2023}
2024
2026{
2029 return;
2030
2031 css::uno::Sequence<OUString> aAutoStylePropNames = GetAutoStylePool()->GetPropertyNames();
2032
2033 Reference< beans::XPropertySet > xInfoSet( getExportInfo() );
2034 if( xInfoSet.is() )
2035 {
2036 Reference< beans::XPropertySetInfo > xInfoSetInfo( xInfoSet->getPropertySetInfo() );
2037
2038 if( xInfoSetInfo->hasPropertyByName( gsPageLayoutNames ) )
2039 {
2040 xInfoSet->getPropertyValue( gsPageLayoutNames ) >>= maDrawPagesAutoLayoutNames;
2041 }
2042 }
2043
2045
2047 {
2048 // #80012# PageMaster export moved from _ExportStyles
2049 // prepare page-master infos
2051
2052 // prepare draw:style-name for master page export
2054 }
2055
2057 {
2058 // prepare draw:style-name for page export
2060 }
2061
2063 {
2064 // create auto style infos for shapes on master handout page
2065 if( IsImpress() )
2066 {
2067 Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetModel(), UNO_QUERY );
2068 if( xHandoutSupp.is() )
2069 {
2070 Reference< XDrawPage > xHandoutPage( xHandoutSupp->getHandoutMasterPage() );
2071 if( xHandoutPage.is() && xHandoutPage->getCount())
2072 GetShapeExport()->collectShapesAutoStyles( xHandoutPage, aAutoStylePropNames );
2073 }
2074 }
2075
2076 // create auto style infos for objects on master pages
2077 for(sal_Int32 nMPageId(0); nMPageId < mnDocMasterPageCount; nMPageId++)
2078 {
2079 Reference< XDrawPage > xMasterPage(mxDocMasterPages->getByIndex(nMPageId), UNO_QUERY );
2080
2081 if( xMasterPage.is() )
2082 {
2083 // collect layer information
2084 GetFormExport()->examineForms( xMasterPage );
2085
2086 // get MasterPage Name
2087 OUString aMasterPageNamePrefix;
2088 Reference < container::XNamed > xNamed(xMasterPage, UNO_QUERY);
2089 if(xNamed.is())
2090 {
2091 aMasterPageNamePrefix = xNamed->getName();
2092 }
2093 if(!aMasterPageNamePrefix.isEmpty())
2094 {
2095 aMasterPageNamePrefix += "-";
2096 }
2097 GetShapeExport()->setPresentationStylePrefix( aMasterPageNamePrefix );
2098
2099 if(xMasterPage.is() && xMasterPage->getCount())
2100 GetShapeExport()->collectShapesAutoStyles( xMasterPage, aAutoStylePropNames );
2101
2102 if(IsImpress())
2103 {
2104 Reference< presentation::XPresentationPage > xPresPage(xMasterPage, UNO_QUERY);
2105 if(xPresPage.is())
2106 {
2107 Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage());
2108 if(xNotesPage.is())
2109 {
2110 // collect layer information
2111 GetFormExport()->examineForms( xNotesPage );
2112
2113 if(xNotesPage->getCount())
2114 GetShapeExport()->collectShapesAutoStyles( xNotesPage, aAutoStylePropNames );
2115 }
2116 }
2117 }
2118 collectAnnotationAutoStyles(xMasterPage);
2119 }
2120 }
2121 }
2122
2124 {
2125 // prepare animations exporter if impress
2127 {
2129 GetShapeExport()->setAnimationsExporter( xAnimExport );
2130 }
2131
2132 // create auto style infos for objects on pages
2133 for(sal_Int32 nPageInd(0); nPageInd < mnDocDrawPageCount; nPageInd++)
2134 {
2135 Reference<XDrawPage> xDrawPage( mxDocDrawPages->getByIndex(nPageInd), UNO_QUERY );
2136 if( xDrawPage.is() )
2137 {
2138 // collect layer information
2139 GetFormExport()->examineForms( xDrawPage );
2140
2141 // get MasterPage Name
2142 OUString aMasterPageNamePrefix;
2143 Reference < drawing::XMasterPageTarget > xMasterPageInt(xDrawPage, UNO_QUERY);
2144 if(xMasterPageInt.is())
2145 {
2146 Reference<XDrawPage> xUsedMasterPage(xMasterPageInt->getMasterPage());
2147 if(xUsedMasterPage.is())
2148 {
2149 Reference < container::XNamed > xMasterNamed(xUsedMasterPage, UNO_QUERY);
2150 if(xMasterNamed.is())
2151 {
2152 aMasterPageNamePrefix = xMasterNamed->getName();
2153 }
2154 }
2155 }
2156 if(!aMasterPageNamePrefix.isEmpty())
2157 {
2158 aMasterPageNamePrefix += "-";
2159 }
2160
2161 GetShapeExport()->setPresentationStylePrefix( aMasterPageNamePrefix );
2162
2163 // prepare object infos
2164 if(xDrawPage.is() && xDrawPage->getCount())
2165 GetShapeExport()->collectShapesAutoStyles( xDrawPage, aAutoStylePropNames );
2166
2167 // prepare presentation notes page object infos (ONLY if presentation)
2168 if(IsImpress())
2169 {
2170 Reference< presentation::XPresentationPage > xPresPage(xDrawPage, UNO_QUERY);
2171 if(xPresPage.is())
2172 {
2173 Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage());
2174 if(xNotesPage.is())
2175 {
2176 // collect layer information
2177 GetFormExport()->examineForms( xNotesPage );
2178
2179 if(xNotesPage->getCount())
2180 GetShapeExport()->collectShapesAutoStyles( xNotesPage, aAutoStylePropNames );
2181 }
2182 }
2183 }
2184
2185 collectAnnotationAutoStyles( xDrawPage );
2186 }
2187 }
2188 if (IsImpress())
2189 {
2191 GetShapeExport()->setAnimationsExporter( xAnimExport );
2192 }
2193 }
2194
2195 mbAutoStylesCollected = true;
2196}
2197
2199{
2201
2203 {
2204 // write page-master infos
2206 }
2207
2208 // export draw-page styles
2210
2212
2213 GetShapeExport()->exportAutoStyles();
2214
2216 if ( ( getExportFlags() & nContentAutostyles ) == nContentAutostyles )
2217 GetFormExport()->exportAutoStyles( );
2218
2219 // ...for text
2220 GetTextParagraphExport()->exportTextAutoStyles();
2221}
2222
2224{
2225 // export layer
2227
2228 // export handout master page if impress
2229 if( IsImpress() )
2230 {
2231 Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetModel(), UNO_QUERY );
2232 if( xHandoutSupp.is() )
2233 {
2234 Reference< XDrawPage > xHandoutPage( xHandoutSupp->getHandoutMasterPage() );
2235 if( xHandoutPage.is() )
2236 {
2237 // presentation:page-layout-name
2238 if( IsImpress() && !maDrawPagesAutoLayoutNames[0].isEmpty())
2239 {
2241 }
2242
2244 if(pInfo)
2245 {
2246 const OUString& sString = pInfo->GetName();
2248 }
2249
2250 // draw:style-name
2251 if( !maHandoutMasterStyleName.isEmpty() )
2253
2255
2256 // write masterpage
2258
2259 // write graphic objects on this master page (if any)
2260 if(xHandoutPage.is() && xHandoutPage->getCount())
2261 GetShapeExport()->exportShapes( xHandoutPage );
2262 }
2263 }
2264 }
2265
2266 // export MasterPages in master-styles section
2267 for (sal_Int32 nMPageId = 0; nMPageId < mnDocMasterPageCount; nMPageId++)
2268 {
2269 Reference< XDrawPage > xMasterPage( mxDocMasterPages->getByIndex(nMPageId), UNO_QUERY );
2270 if(xMasterPage.is())
2271 {
2272 // prepare masterpage attributes
2273 Reference < container::XNamed > xNamed(xMasterPage, UNO_QUERY);
2274 if(xNamed.is())
2275 {
2276 bool bEncoded = false;
2277 OUString sMasterPageName = xNamed->getName();
2279 EncodeStyleName( sMasterPageName, &bEncoded ));
2280 if( bEncoded )
2283 sMasterPageName );
2284 }
2285
2286 ImpXMLEXPPageMasterInfo* pInfo = mvPageMasterUsageList.at( nMPageId );
2287 if(pInfo)
2288 {
2289 const OUString& sString = pInfo->GetName();
2291 }
2292
2293 // draw:style-name (background attributes)
2294 if( !maMasterPagesStyleNames[nMPageId].isEmpty() )
2296 maMasterPagesStyleNames[nMPageId]);
2297
2298 // write masterpage
2299 SvXMLElementExport aMPG(*this, XML_NAMESPACE_STYLE, XML_MASTER_PAGE, true, true);
2300
2301 // write optional office:forms
2302 exportFormsElement( xMasterPage );
2303
2304 // write optional loext:theme
2305 if (IsImpress())
2306 {
2307 ExportThemeElement(xMasterPage);
2308 }
2309
2310 // write graphic objects on this master page (if any)
2311 if(xMasterPage.is() && xMasterPage->getCount())
2312 GetShapeExport()->exportShapes( xMasterPage );
2313
2314 // write presentation notes (ONLY if presentation)
2315 if(IsImpress())
2316 {
2317 Reference< presentation::XPresentationPage > xPresPage(xMasterPage, UNO_QUERY);
2318 if(xPresPage.is())
2319 {
2320 Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage());
2321 if(xNotesPage.is())
2322 {
2323 ImpXMLEXPPageMasterInfo* pMasterInfo = mvNotesPageMasterUsageList.at( nMPageId );
2324 if(pMasterInfo)
2325 {
2326 const OUString& sString = pMasterInfo->GetName();
2328 }
2329
2330 // write presentation notes
2332
2333 // write optional office:forms
2334 exportFormsElement( xNotesPage );
2335
2336 // write shapes per se
2337 GetShapeExport()->exportShapes( xNotesPage );
2338 }
2339 }
2340 }
2341 exportAnnotations( xMasterPage );
2342 }
2343 }
2344}
2345
2346void SdXMLExport::exportFormsElement( const Reference< XDrawPage >& xDrawPage )
2347{
2348 if( !xDrawPage.is() )
2349 return;
2350
2351 Reference< form::XFormsSupplier2 > xFormsSupplier( xDrawPage, UNO_QUERY );
2352 if ( xFormsSupplier.is() && xFormsSupplier->hasForms() )
2353 {
2354 // write masterpage
2355 ::xmloff::OOfficeFormsExport aForms(*this);
2356 GetFormExport()->exportForms( xDrawPage );
2357 }
2358
2359 if(! GetFormExport()->seekPage( xDrawPage ) )
2360 {
2361 OSL_FAIL( "OFormLayerXMLExport::seekPage failed!" );
2362 }
2363}
2364
2365void SdXMLExport::ExportThemeElement(const uno::Reference<drawing::XDrawPage>& xDrawPage)
2366{
2368 {
2369 // Do not export in standard ODF 1.3 or older.
2370 return;
2371 }
2372
2373 uno::Reference<beans::XPropertySet> xPropertySet(xDrawPage, uno::UNO_QUERY);
2374 if (!xPropertySet.is())
2375 return;
2376
2377 uno::Reference<util::XTheme> xTheme;
2378 xPropertySet->getPropertyValue("Theme") >>= xTheme;
2379 if (!xTheme.is())
2380 return;
2381
2382 auto* pUnoTheme = dynamic_cast<UnoTheme*>(xTheme.get());
2383 if (!pUnoTheme)
2384 return;
2385
2386 auto const& rTheme = pUnoTheme->getTheme();
2387
2388 if (!rTheme.GetName().isEmpty())
2389 AddAttribute(XML_NAMESPACE_LO_EXT, XML_NAME, rTheme.GetName());
2390 SvXMLElementExport aTheme(*this, XML_NAMESPACE_LO_EXT, XML_THEME, true, true);
2391
2392 auto* pColorSet = rTheme.GetColorSet();
2393 if (!pColorSet->getName().isEmpty())
2394 AddAttribute(XML_NAMESPACE_LO_EXT, XML_NAME, pColorSet->getName());
2395 SvXMLElementExport aColorTable(*this, XML_NAMESPACE_LO_EXT, XML_COLOR_TABLE, true, true);
2396
2397 static const XMLTokenEnum aColorTokens[] =
2398 {
2399 XML_DK1, // Text 1
2400 XML_LT1, // Background 1
2401 XML_DK2, // Text 2
2402 XML_LT2, // Background 2
2409 XML_HLINK, // Hyperlink
2410 XML_FOLHLINK, // Followed hyperlink
2411 };
2412
2413 for (auto eThemeColorType : o3tl::enumrange<model::ThemeColorType>())
2414 {
2415 if (eThemeColorType == model::ThemeColorType::Unknown)
2416 continue;
2417
2418 auto nColor = size_t(eThemeColorType);
2419 AddAttribute(XML_NAMESPACE_LO_EXT, XML_NAME, GetXMLToken(aColorTokens[nColor]));
2420 OUStringBuffer sValue;
2421 sax::Converter::convertColor(sValue, pColorSet->getColor(eThemeColorType));
2422 AddAttribute(XML_NAMESPACE_LO_EXT, XML_COLOR, sValue.makeStringAndClear());
2423 SvXMLElementExport aColor(*this, XML_NAMESPACE_LO_EXT, XML_COLOR, true, true);
2424 }
2425}
2426
2427void SdXMLExport::GetViewSettings(uno::Sequence<beans::PropertyValue>& rProps)
2428{
2429 Reference< beans::XPropertySet > xPropSet( GetModel(), UNO_QUERY );
2430 if( !xPropSet.is() )
2431 return;
2432
2433 awt::Rectangle aVisArea;
2434 xPropSet->getPropertyValue("VisibleArea") >>= aVisArea;
2435
2436 rProps.realloc(4);
2437 beans::PropertyValue* pProps = rProps.getArray();
2438
2439 pProps[0].Name = "VisibleAreaTop";
2440 pProps[0].Value <<= aVisArea.Y;
2441 pProps[1].Name = "VisibleAreaLeft";
2442 pProps[1].Value <<= aVisArea.X;
2443 pProps[2].Name = "VisibleAreaWidth";
2444 pProps[2].Value <<= aVisArea.Width;
2445 pProps[3].Name = "VisibleAreaHeight";
2446 pProps[3].Value <<= aVisArea.Height;
2447
2448}
2449
2450void SdXMLExport::GetConfigurationSettings(uno::Sequence<beans::PropertyValue>& rProps)
2451{
2452 Reference< lang::XMultiServiceFactory > xFac( GetModel(), UNO_QUERY );
2453 if( !xFac.is() )
2454 return;
2455
2456 Reference< beans::XPropertySet > xProps( xFac->createInstance("com.sun.star.document.Settings"), UNO_QUERY );
2457 if( xProps.is() )
2459 DocumentSettingsSerializer *pFilter(dynamic_cast<DocumentSettingsSerializer *>(xProps.get()));
2460 if (!pFilter)
2461 return;
2462 const uno::Reference< embed::XStorage > xStorage(GetTargetStorage());
2463 if (!xStorage.is())
2464 return;
2465 rProps = pFilter->filterStreamsToStorage(xStorage, rProps);
2466}
2467
2468void SdXMLExport::addDataStyle(const sal_Int32 nNumberFormat, bool bTimeFormat )
2469{
2470 sal_Int32 nFormat = nNumberFormat;
2471 if( (nNumberFormat > 1) && (nNumberFormat <= 0x0f) )
2472 nFormat -= 2;
2473
2474 if( bTimeFormat )
2475 {
2476 maUsedTimeStyles.insert( nFormat );
2477 }
2478 else
2479 {
2480 maUsedDateStyles.insert( nFormat );
2481 }
2482}
2483
2485{
2486 // there are no data styles to export in draw/impress yet
2487}
2488
2490{
2491 for( const auto& rUsedDateStyle : maUsedDateStyles )
2492 SdXMLNumberStylesExporter::exportDateStyle( *this, rUsedDateStyle );
2493
2494 for( const auto& rUsedTimeStyle : maUsedTimeStyles )
2495 SdXMLNumberStylesExporter::exportTimeStyle( *this, rUsedTimeStyle );
2496
2497 if(HasFormExport())
2498 GetFormExport()->exportAutoControlNumberStyles();
2499}
2500
2501OUString SdXMLExport::getDataStyleName(const sal_Int32 nNumberFormat, bool bTimeFormat ) const
2502{
2503 if( bTimeFormat )
2504 {
2505 return SdXMLNumberStylesExporter::getTimeStyleName( nNumberFormat );
2506 }
2507 else
2508 {
2509 return SdXMLNumberStylesExporter::getDateStyleName( nNumberFormat );
2510 }
2511}
2512
2513OUString SdXMLExport::getNavigationOrder( const Reference< XDrawPage >& xDrawPage )
2514{
2515 OUStringBuffer sNavOrder;
2516 try
2517 {
2518 Reference< XPropertySet > xSet( xDrawPage, UNO_QUERY_THROW );
2519 Reference< XIndexAccess > xNavOrder( xSet->getPropertyValue("NavigationOrder"), UNO_QUERY_THROW );
2520
2521 Reference< XIndexAccess > xZOrderAccess = xDrawPage;
2522
2523 // only export navigation order if it is different from the z-order
2524 if( (xNavOrder.get() != xZOrderAccess.get()) && (xNavOrder->getCount() == xDrawPage->getCount()) )
2525 {
2526 sal_Int32 nIndex;
2527 const sal_Int32 nCount = xNavOrder->getCount();
2528 for( nIndex = 0; nIndex < nCount; ++nIndex )
2529 {
2530 OUString sId( getInterfaceToIdentifierMapper().registerReference( Reference< XInterface >( xNavOrder->getByIndex( nIndex ), UNO_QUERY ) ) );
2531 if( !sId.isEmpty() )
2532 {
2533 if( !sNavOrder.isEmpty() )
2534 sNavOrder.append( ' ' );
2535 sNavOrder.append( sId );
2536 }
2537 }
2538 }
2539 }
2540 catch(const Exception&)
2541 {
2542 }
2543 return sNavOrder.makeStringAndClear();
2544}
2545
2546void SdXMLExport::collectAnnotationAutoStyles( const Reference<XDrawPage>& xDrawPage )
2547{
2548 Reference< XAnnotationAccess > xAnnotationAccess( xDrawPage, UNO_QUERY );
2549 if( !xAnnotationAccess.is() ) return;
2550
2551 try
2552 {
2553 Reference< XAnnotationEnumeration > xAnnotationEnumeration( xAnnotationAccess->createAnnotationEnumeration() );
2554 if( xAnnotationEnumeration.is() )
2555 {
2556 while( xAnnotationEnumeration->hasMoreElements() )
2557 {
2558 Reference< XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement(), UNO_SET_THROW );
2559 Reference< XText > xText( xAnnotation->getTextRange() );
2560 if(xText.is() && !xText->getString().isEmpty())
2561 GetTextParagraphExport()->collectTextAutoStyles( xText );
2562 }
2563 }
2564 }
2565 catch(const Exception&)
2566 {
2567 TOOLS_WARN_EXCEPTION("xmloff.draw",
2568 "exception caught during export of annotation auto styles");
2569 }
2570}
2571
2572void SdXMLExport::exportAnnotations( const Reference<XDrawPage>& xDrawPage )
2573{
2574 // do not export in standard ODF 1.3 or older
2576 {
2577 return;
2578 }
2579
2580 Reference< XAnnotationAccess > xAnnotationAccess( xDrawPage, UNO_QUERY );
2581 if( !xAnnotationAccess.is() )
2582 return;
2583
2584 try
2585 {
2586 Reference< XAnnotationEnumeration > xAnnotationEnumeration( xAnnotationAccess->createAnnotationEnumeration() );
2587 if( xAnnotationEnumeration.is() && xAnnotationEnumeration->hasMoreElements() )
2588 {
2589 bool bRemovePersonalInfo = SvtSecurityOptions::IsOptionSet(
2591
2592 OUStringBuffer sStringBuffer;
2593 do
2594 {
2595 Reference< XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement(), UNO_SET_THROW );
2596
2597 RealPoint2D aPosition( xAnnotation->getPosition() );
2598
2600 static_cast<sal_Int32>( aPosition.X * 100 ) );
2601 AddAttribute(XML_NAMESPACE_SVG, XML_X, sStringBuffer.makeStringAndClear());
2602
2604 static_cast<sal_Int32>( aPosition.Y * 100 ) );
2605 AddAttribute(XML_NAMESPACE_SVG, XML_Y, sStringBuffer.makeStringAndClear());
2606
2607 RealSize2D aSize( xAnnotation->getSize() );
2608
2609 if( aSize.Width || aSize.Height )
2610 {
2612 static_cast<sal_Int32>( aSize.Width * 100 ) );
2613 AddAttribute(XML_NAMESPACE_SVG, XML_WIDTH, sStringBuffer.makeStringAndClear());
2615 static_cast<sal_Int32>( aSize.Height * 100 ) );
2616 AddAttribute(XML_NAMESPACE_SVG, XML_HEIGHT, sStringBuffer.makeStringAndClear());
2617 }
2618
2619 // annotation element + content
2621
2622 // author
2623 OUString aAuthor( xAnnotation->getAuthor() );
2624 if( !aAuthor.isEmpty() )
2625 {
2626 SvXMLElementExport aCreatorElem( *this, XML_NAMESPACE_DC, XML_CREATOR, true, false );
2627 Characters( bRemovePersonalInfo
2628 ? "Author" + OUString::number( SvXMLExport::GetInfoID(aAuthor) )
2629 : aAuthor );
2630 }
2631
2632 // initials
2633 OUString aInitials( xAnnotation->getInitials() );
2634 if( !aInitials.isEmpty() )
2635 {
2636 // OFFICE-3776 export meta:creator-initials for ODF 1.3
2637 SvXMLElementExport aInitialsElem( *this,
2644 true, false );
2645 Characters( bRemovePersonalInfo
2646 ? OUString::number( SvXMLExport::GetInfoID(aInitials) )
2647 : aInitials );
2648 }
2649
2650 {
2651 // date time
2652 css::util::DateTime aDate( bRemovePersonalInfo
2653 ? css::util::DateTime(0, 0, 0, 0, 1, 1, 1970, true) // Epoch time
2654 : xAnnotation->getDateTime() );
2655 ::sax::Converter::convertDateTime(sStringBuffer, aDate, nullptr, true);
2656 SvXMLElementExport aDateElem( *this, XML_NAMESPACE_DC, XML_DATE, true, false );
2657 Characters( sStringBuffer.makeStringAndClear() );
2658 }
2659
2660 css::uno::Reference < css::text::XText > xText( xAnnotation->getTextRange() );
2661 if( xText.is() )
2662 GetTextParagraphExport()->exportText( xText );
2663 }
2664 while( xAnnotationEnumeration->hasMoreElements() );
2665 }
2666 }
2667 catch(const Exception&)
2668 {
2669 TOOLS_WARN_EXCEPTION("xmloff.draw", "exception caught during export of annotations");
2670 }
2671}
2672
2673extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
2675 uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
2676{
2677 return cppu::acquire(new SdXMLExport(
2678 pCtx, "XMLImpressExportOasis", false,
2683}
2684
2685extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
2687 uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
2688{
2689 return cppu::acquire(new SdXMLExport(
2690 pCtx, "XMLImpressStylesExportOasis", false,
2693}
2694
2695extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
2697 uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
2698{
2699 return cppu::acquire(new SdXMLExport(pCtx, "XMLImpressContentExportOasis", false,
2703}
2704
2705extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
2707 uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
2708{
2709 return cppu::acquire(new SdXMLExport(pCtx, "XMLImpressMetaExportOasis", false,
2711}
2712
2713extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
2715 uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
2716{
2717 return cppu::acquire(new SdXMLExport(pCtx, "XMLImpressSettingsExportOasis", false,
2719}
2720
2721extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
2723 uno::Sequence<uno::Any> const& /*rSeq*/)
2724{
2725 return cppu::acquire(new SdXMLExport(
2726 pCtx, "XMLImpressExportOOO", false,
2731}
2732
2733extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
2735 uno::Sequence<uno::Any> const& /*rSeq*/)
2736{
2737 return cppu::acquire(new SdXMLExport(
2738 pCtx, "XMLDrawExportOOO", true,
2743}
2744
2745extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
2747 uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
2748{
2749 return cppu::acquire(new SdXMLExport(pCtx, "XMLDrawSettingsExportOasis", true,
2751}
2752
2753extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
2755 uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
2756{
2757 return cppu::acquire(new SdXMLExport(pCtx, "XMLDrawMetaExportOasis", true,
2759}
2760
2761extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
2763 uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
2764{
2765 return cppu::acquire(new SdXMLExport(pCtx, "XMLDrawContentExportOasis", true,
2769}
2770
2771extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
2773 uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
2774{
2775 return cppu::acquire(new SdXMLExport(
2776 pCtx, "XMLDrawStylesExportOasis", true,
2779}
2780
2781extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
2783 uno::Sequence<uno::Any> const& /*rSeq*/)
2784{
2785 return cppu::acquire(new SdXMLExport(
2786 pCtx, "XMLDrawExportOasis", true,
2791}
2792
2793extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
2795 uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
2796{
2797 return cppu::acquire(
2798 new SdXMLExport(pCtx, "XMLDrawingLayerExport", true,
2802}
2803
2804extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
2806 uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
2807{
2808 return cppu::acquire(
2809 new SdXMLExport(pCtx, "XMLImpressClipboardExport", /*bIsDraw=*/false,
2813}
2814
2816{
2817 bool bEmbedFonts = false;
2818 bool bEmbedUsedOnly = false;
2819 bool bEmbedLatinScript = true;
2820 bool bEmbedAsianScript = true;
2821 bool bEmbedComplexScript = true;
2822
2824 {
2825 try
2826 {
2827 Reference<lang::XMultiServiceFactory> xFactory(GetModel(), UNO_QUERY);
2828 Reference<beans::XPropertySet> xProps;
2829 Reference<beans::XPropertySetInfo> xInfo;
2830
2831 if (xFactory.is())
2832 xProps.set(xFactory->createInstance("com.sun.star.document.Settings"), UNO_QUERY);
2833 if (xProps.is())
2834 xInfo = xProps->getPropertySetInfo();
2835 if (xInfo.is() && xProps.is())
2836 {
2837 if (xInfo->hasPropertyByName("EmbedFonts"))
2838 xProps->getPropertyValue("EmbedFonts") >>= bEmbedFonts;
2839 if (xInfo->hasPropertyByName("EmbedOnlyUsedFonts"))
2840 xProps->getPropertyValue("EmbedOnlyUsedFonts") >>= bEmbedUsedOnly;
2841 if (xInfo->hasPropertyByName("EmbedLatinScriptFonts"))
2842 xProps->getPropertyValue("EmbedLatinScriptFonts") >>= bEmbedLatinScript;
2843 if (xInfo->hasPropertyByName("EmbedAsianScriptFonts"))
2844 xProps->getPropertyValue("EmbedAsianScriptFonts") >>= bEmbedAsianScript;
2845 if (xInfo->hasPropertyByName("EmbedComplexScriptFonts"))
2846 xProps->getPropertyValue("EmbedComplexScriptFonts") >>= bEmbedComplexScript;
2847 }
2848 } catch(...)
2849 {
2850 // clipboard document doesn't have shell so throws from getPropertyValue
2851 // gallery elements may not support com.sun.star.document.Settings so throws from createInstance
2852 }
2853 }
2854
2855 XMLFontAutoStylePool *pPool = new XMLFontAutoStylePool( *this, bEmbedFonts );
2856 pPool->setEmbedOnlyUsedFonts(bEmbedUsedOnly);
2857 pPool->setEmbedFontScripts(bEmbedLatinScript, bEmbedAsianScript, bEmbedComplexScript);
2858
2859 Reference< beans::XPropertySet > xProps( GetModel(), UNO_QUERY );
2860 if ( xProps.is() ) {
2861 Sequence<Any> aAnySeq;
2862 if( xProps->getPropertyValue("Fonts") >>= aAnySeq )
2863 {
2864 if( aAnySeq.getLength() % 5 == 0 )
2865 {
2866 int nLen = aAnySeq.getLength() / 5;
2867 int nSeqIndex = 0;
2868 for( int i = 0; i < nLen; i++ )
2869 {
2870 OUString sFamilyName, sStyleName;
2871 sal_Int16 eFamily(FAMILY_DONTKNOW),
2872 ePitch(PITCH_DONTKNOW),
2873 eCharSet(RTL_TEXTENCODING_DONTKNOW);
2874
2875 aAnySeq[nSeqIndex++] >>= sFamilyName;
2876 aAnySeq[nSeqIndex++] >>= sStyleName;
2877 aAnySeq[nSeqIndex++] >>= eFamily;
2878 aAnySeq[nSeqIndex++] >>= ePitch;
2879 aAnySeq[nSeqIndex++] >>= eCharSet;
2880
2881 pPool->Add( sFamilyName, sStyleName, FontFamily( eFamily ), FontPitch( ePitch ), rtl_TextEncoding( eCharSet ) );
2882 }
2883 }
2884 }
2885 }
2886
2887 return pPool;
2888}
2889
2890/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Reference< XPropertySet > PropertySetMerger_CreateInstance(const Reference< XPropertySet > &rPropSet1, const Reference< XPropertySet > &rPropSet2) noexcept
@ AUTOLAYOUT_CLIPTEXT
Definition: autolayout.hxx:36
@ AUTOLAYOUT_TITLE_2CONTENT_OVER_CONTENT
Title, 2 Content over Content.
Definition: autolayout.hxx:43
@ AUTOLAYOUT_4CLIPART
Definition: autolayout.hxx:60
@ AUTOLAYOUT_TITLE
Title Slide.
Definition: autolayout.hxx:27
@ AUTOLAYOUT_TEXTOBJ
Definition: autolayout.hxx:37
@ AUTOLAYOUT_HANDOUT1
Definition: autolayout.hxx:49
@ AUTOLAYOUT_TITLE_CONTENT_OVER_CONTENT
Title, Content over Content.
Definition: autolayout.hxx:41
@ AUTOLAYOUT_TITLE_2VTEXT
Title, 2 Vertical Content.
Definition: autolayout.hxx:57
@ AUTOLAYOUT_VTITLE_VCONTENT_OVER_VCONTENT
Vertical Title, Vertical Content over Vertical Content.
Definition: autolayout.hxx:54
@ AUTOLAYOUT_VTITLE_VCONTENT
Vertical Title, Vertical Content over Vertical Content.
Definition: autolayout.hxx:55
@ AUTOLAYOUT_TITLE_ONLY
Title Only.
Definition: autolayout.hxx:46
@ AUTOLAYOUT_TITLE_2CONTENT
Title and 2 Content.
Definition: autolayout.hxx:30
@ AUTOLAYOUT_ONLY_TEXT
Centered Text.
Definition: autolayout.hxx:59
@ AUTOLAYOUT_TITLE_6CONTENT
Title, 6 Content.
Definition: autolayout.hxx:61
@ AUTOLAYOUT_TAB
Definition: autolayout.hxx:35
@ AUTOLAYOUT_HANDOUT9
Definition: autolayout.hxx:58
@ AUTOLAYOUT_TITLE_2CONTENT_CONTENT
Title, 2 Content and Content.
Definition: autolayout.hxx:42
@ AUTOLAYOUT_TEXTCHART
Definition: autolayout.hxx:31
@ AUTOLAYOUT_HANDOUT2
Definition: autolayout.hxx:50
@ AUTOLAYOUT_TITLE_CONTENT_2CONTENT
Title, Content and 2 Content.
Definition: autolayout.hxx:39
@ AUTOLAYOUT_OBJ
Definition: autolayout.hxx:38
@ AUTOLAYOUT_HANDOUT4
Definition: autolayout.hxx:52
@ AUTOLAYOUT_OBJTEXT
Definition: autolayout.hxx:40
@ AUTOLAYOUT_CHARTTEXT
Definition: autolayout.hxx:34
@ AUTOLAYOUT_CHART
Definition: autolayout.hxx:29
@ AUTOLAYOUT_HANDOUT6
Definition: autolayout.hxx:53
@ AUTOLAYOUT_TEXTOVEROBJ
Definition: autolayout.hxx:44
@ AUTOLAYOUT_NOTES
Definition: autolayout.hxx:48
@ AUTOLAYOUT_TITLE_CONTENT
Title, Content.
Definition: autolayout.hxx:28
@ AUTOLAYOUT_HANDOUT3
Definition: autolayout.hxx:51
@ AUTOLAYOUT_TITLE_VCONTENT
Title, Vertical Content.
Definition: autolayout.hxx:56
@ AUTOLAYOUT_TEXTCLIP
Definition: autolayout.hxx:33
@ AUTOLAYOUT_TITLE_4CONTENT
Title, 4 Content.
Definition: autolayout.hxx:45
void SetLayoutName(const OUString &rNew)
Definition: sdxmlexp.cxx:212
sal_Int32 GetGapX() const
Definition: sdxmlexp.cxx:208
ImpXMLEXPPageMasterInfo * GetPageMasterInfo() const
Definition: sdxmlexp.cxx:207
ImpXMLAutoLayoutInfo(sal_uInt16 nTyp, ImpXMLEXPPageMasterInfo *pInf)
Definition: sdxmlexp.cxx:229
ImpXMLEXPPageMasterInfo * mpPageMasterInfo
Definition: sdxmlexp.cxx:196
sal_uInt16 GetLayoutType() const
Definition: sdxmlexp.cxx:206
tools::Rectangle maTitleRect
Definition: sdxmlexp.cxx:198
const OUString & GetLayoutName() const
Definition: sdxmlexp.cxx:211
static bool IsCreateNecessary(sal_uInt16 nTyp)
Definition: sdxmlexp.cxx:220
tools::Rectangle maPresRect
Definition: sdxmlexp.cxx:199
const tools::Rectangle & GetPresRectangle() const
Definition: sdxmlexp.cxx:215
sal_Int32 GetGapY() const
Definition: sdxmlexp.cxx:209
const tools::Rectangle & GetTitleRectangle() const
Definition: sdxmlexp.cxx:214
ImpXMLEXPPageMasterInfo(const SdXMLExport &rExp, const Reference< XDrawPage > &xPage)
Definition: sdxmlexp.cxx:120
const OUString & GetMasterPageName() const
Definition: sdxmlexp.cxx:109
sal_Int32 GetWidth() const
Definition: sdxmlexp.cxx:115
view::PaperOrientation GetOrientation() const
Definition: sdxmlexp.cxx:117
sal_Int32 mnBorderBottom
Definition: sdxmlexp.cxx:93
sal_Int32 GetBorderRight() const
Definition: sdxmlexp.cxx:113
sal_Int32 GetBorderTop() const
Definition: sdxmlexp.cxx:114
const OUString & GetName() const
Definition: sdxmlexp.cxx:108
sal_Int32 GetBorderBottom() const
Definition: sdxmlexp.cxx:111
sal_Int32 GetBorderLeft() const
Definition: sdxmlexp.cxx:112
view::PaperOrientation meOrientation
Definition: sdxmlexp.cxx:99
void SetName(const OUString &rStr)
Definition: sdxmlexp.cxx:186
sal_Int32 GetHeight() const
Definition: sdxmlexp.cxx:116
bool operator==(const ImpXMLEXPPageMasterInfo &rInfo) const
Definition: sdxmlexp.cxx:175
void SetReference(sal_Int32 nVal)
::std::vector< OUString > maDrawPagesStyleNames
void ImpWriteHeaderFooterDecls()
Definition: sdxmlexp.cxx:1420
css::uno::Reference< css::container::XIndexAccess > mxDocMasterPages
OUString maHandoutMasterStyleName
OUString ImpCreatePresPageStyleName(const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage, bool bExportBackground=true)
Definition: sdxmlexp.cxx:1492
::std::vector< OUString > maHeaderDeclsVector
virtual void ExportMasterStyles_() override
Override this method to export the contents of <style:master-styles>.
Definition: sdxmlexp.cxx:2223
void ImplExportHeaderFooterDeclAttributes(const HeaderFooterPageSettingsImpl &aSettings)
Definition: sdxmlexp.cxx:1480
SdXMLFormatMap maUsedDateStyles
XMLShapeExportPropertyMapper * GetPropertySetMapper() const
sal_uInt32 mnObjectCount
ImpXMLEXPPageMasterInfo * ImpGetOrCreatePageMasterInfo(const css::uno::Reference< css::drawing::XDrawPage > &xMasterPage)
Definition: sdxmlexp.cxx:1144
std::vector< std::unique_ptr< ImpXMLEXPPageMasterInfo > > mvPageMasterInfoList
::std::vector< OUString > maFooterDeclsVector
virtual void ExportFontDecls_() override
Override this method to export the font declarations The default implementation will export the conte...
Definition: sdxmlexp.cxx:1625
bool IsImpress() const
virtual XMLFontAutoStylePool * CreateFontAutoStylePool() override
Definition: sdxmlexp.cxx:2815
virtual void GetConfigurationSettings(css::uno::Sequence< css::beans::PropertyValue > &aProps) override
Definition: sdxmlexp.cxx:2450
ImpXMLEXPPageMasterInfo * mpHandoutPageMaster
void collectAnnotationAutoStyles(const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage)
Definition: sdxmlexp.cxx:2546
void exportFormsElement(const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage)
Definition: sdxmlexp.cxx:2346
rtl::Reference< XMLPageExportPropertyMapper > mpPresPagePropsMapper
void ImpWritePageMasterInfos()
Definition: sdxmlexp.cxx:1217
::std::vector< DateTimeDeclImpl > maDateTimeDeclsVector
virtual ~SdXMLExport() override
Definition: sdxmlexp.cxx:604
void collectAutoStyles() override
Definition: sdxmlexp.cxx:2025
::std::vector< OUString > maMasterPagesStyleNames
::std::vector< OUString > maDrawNotesPagesStyleNames
::std::vector< HeaderFooterPageSettingsImpl > maDrawPagesHeaderFooterSettings
virtual void ExportContent_() override
Override this method to export the content of <office:body>.
Definition: sdxmlexp.cxx:1631
virtual void GetViewSettings(css::uno::Sequence< css::beans::PropertyValue > &aProps) override
Definition: sdxmlexp.cxx:2427
::std::vector< HeaderFooterPageSettingsImpl > maDrawNotesPagesHeaderFooterSettings
OUString getNavigationOrder(const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage)
Definition: sdxmlexp.cxx:2513
virtual OUString getDataStyleName(const sal_Int32 nNumberFormat, bool bTimeFormat=false) const override
Definition: sdxmlexp.cxx:2501
css::uno::Reference< css::container::XIndexAccess > mxDocDrawPages
void ImpWriteAutoLayoutPlaceholder(XmlPlaceholder ePl, const tools::Rectangle &rRect)
Definition: sdxmlexp.cxx:1097
void ImpPrepAutoLayoutInfos()
Definition: sdxmlexp.cxx:621
void ImpWritePresentationStyles()
Definition: sdxmlexp.cxx:1579
virtual void ExportAutoStyles_() override
Override this method to export the contents of <style:auto-styles>.
Definition: sdxmlexp.cxx:2198
XMLPageExportPropertyMapper * GetPresPagePropsMapper() const
SdXMLExport(const css::uno::Reference< css::uno::XComponentContext > &xContext, OUString const &implementationName, bool bIsDraw, SvXMLExportFlags nExportFlags)
Definition: sdxmlexp.cxx:380
virtual void SAL_CALL setSourceDocument(const css::uno::Reference< css::lang::XComponent > &xDoc) override
Definition: sdxmlexp.cxx:396
sal_Int32 mnDocDrawPageCount
virtual void exportDataStyles() override
Definition: sdxmlexp.cxx:2484
virtual void exportAutoDataStyles() override
Definition: sdxmlexp.cxx:2489
bool ImpPrepAutoLayoutInfo(const css::uno::Reference< css::drawing::XDrawPage > &xPage, OUString &rName)
Definition: sdxmlexp.cxx:653
SdXMLFormatMap maUsedTimeStyles
virtual void ExportStyles_(bool bUsed) override
Override this method to export the content of <style:styles>.
Definition: sdxmlexp.cxx:1990
virtual void ExportMeta_() override
Override this method to export the content of <office:meta>.
Definition: sdxmlexp.cxx:1608
css::uno::Reference< css::container::XNameAccess > mxDocStyleFamilies
ImpXMLEXPPageMasterList mvNotesPageMasterUsageList
sal_Int32 mnDocMasterPageCount
void ImpPrepMasterPageInfos()
Definition: sdxmlexp.cxx:1550
rtl::Reference< XMLSdPropHdlFactory > mpSdPropHdlFactory
ImpXMLEXPPageMasterList mvPageMasterUsageList
void ImpPrepDrawPageInfos()
Definition: sdxmlexp.cxx:1299
virtual void addDataStyle(const sal_Int32 nNumberFormat, bool bTimeFormat=false) override
Definition: sdxmlexp.cxx:2468
void ImpPrepPageMasterInfos()
Definition: sdxmlexp.cxx:1169
void exportPresentationSettings()
Definition: sdxmlexp.cxx:1810
HeaderFooterPageSettingsImpl ImpPrepDrawPageHeaderFooterDecls(const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage)
Definition: sdxmlexp.cxx:1368
ImpXMLEXPPageMasterInfo * ImpGetPageMasterInfoByName(std::u16string_view rName)
Definition: sdxmlexp.cxx:1281
rtl::Reference< XMLShapeExportPropertyMapper > mpPropertySetMapper
std::vector< std::unique_ptr< ImpXMLAutoLayoutInfo > > mvAutoLayoutInfoList
HeaderFooterPageSettingsImpl maHandoutPageHeaderFooterSettings
void exportAnnotations(const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage)
Definition: sdxmlexp.cxx:2572
sal_uInt32 ImpRecursiveObjectCount(const css::uno::Reference< css::drawing::XShapes > &xShapes)
Definition: sdxmlexp.cxx:576
void ImpWriteAutoLayoutInfos()
Definition: sdxmlexp.cxx:712
css::uno::Sequence< OUString > maDrawPagesAutoLayoutNames
void ExportThemeElement(const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage)
Definition: sdxmlexp.cxx:2365
static void exportTimeStyle(SdXMLExport &rExport, sal_Int32 nStyle)
static void exportDateStyle(SdXMLExport &rExport, sal_Int32 nStyle)
static OUString getDateStyleName(const sal_Int32 nDateFormat)
static OUString getTimeStyleName(const sal_Int32 nTimeFormat)
static void exportLayer(SvXMLExport &rExport)
Definition: layerexp.cxx:42
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
ProgressBarHelper * GetProgressBarHelper()
Definition: xmlexp.cxx:1944
::comphelper::UnoInterfaceToUniqueIdentifierMapper & getInterfaceToIdentifierMapper()
Definition: xmlexp.cxx:2251
const css::uno::Reference< css::task::XStatusIndicator > & GetStatusIndicator() const
Definition: xmlexp.hxx:448
virtual void ExportStyles_(bool bUsed)
Override this method to export the content of <style:styles>.
Definition: xmlexp.cxx:1485
OUString GetRelativeReference(const OUString &rValue)
Definition: xmlexp.cxx:2060
bool HasFormExport() const
Definition: xmlexp.hxx:613
rtl::Reference< XMLTextParagraphExport > const & GetTextParagraphExport()
Definition: xmlexp.hxx:557
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
Definition: xmlexp.cxx:910
void Characters(const OUString &rChars)
Definition: xmlexp.cxx:2129
bool mbAutoStylesCollected
Definition: xmlexp.hxx:263
SvXMLExportFlags getExportFlags() const
Definition: xmlexp.hxx:473
SvXMLNamespaceMap & GetNamespaceMap_()
Definition: xmlexp.hxx:181
const css::uno::Reference< css::frame::XModel > & GetModel() const
Definition: xmlexp.hxx:411
void SAL_DLLPRIVATE AddAttributeIdLegacy(sal_uInt16 const nLegacyPrefix, OUString const &rValue)
add xml:id and legacy namespace id
Definition: xmlexp.cxx:2277
virtual void ExportMeta_()
Override this method to export the content of <office:meta>.
Definition: xmlexp.cxx:1419
rtl::Reference< XMLFontAutoStylePool > const & GetFontAutoStylePool()
Definition: xmlexp.hxx:597
virtual void ExportFontDecls_()
Override this method to export the font declarations The default implementation will export the conte...
Definition: xmlexp.cxx:1479
SvtSaveOptions::ODFSaneDefaultVersion getSaneDefaultVersion() const
returns the deterministic version for odf export
Definition: xmlexp.cxx:2267
virtual void SAL_CALL setSourceDocument(const css::uno::Reference< css::lang::XComponent > &xDoc) override
Definition: xmlexp.cxx:573
rtl::Reference< XMLShapeExport > const & GetShapeExport()
Definition: xmlexp.hxx:565
rtl::Reference< SvXMLAutoStylePoolP > const & GetAutoStylePool()
Definition: xmlexp.hxx:573
OUString EncodeStyleName(const OUString &rName, bool *pEncoded=nullptr) const
Definition: xmlexp.cxx:1937
css::uno::Reference< css::embed::XStorage > const & GetTargetStorage() const
Definition: xmlexp.cxx:2262
virtual void collectAutoStyles()
Definition: xmlexp.cxx:1684
const css::uno::Reference< css::beans::XPropertySet > & getExportInfo() const
Definition: xmlexp.hxx:446
rtl::Reference< xmloff::OFormLayerXMLExport > const & GetFormExport()
Definition: xmlexp.hxx:605
const SvXMLUnitConverter & GetMM100UnitConverter() const
Definition: xmlexp.hxx:391
size_t GetInfoID(const OUString sPersonalInfo) const
Definition: xmlexp.hxx:388
sal_uInt16 Add(const OUString &rPrefix, const OUString &rName, sal_uInt16 nKey=XML_NAMESPACE_UNKNOWN)
static void convertPropertySet(css::uno::Sequence< css::beans::PropertyValue > &rProps, const css::uno::Reference< css::beans::XPropertySet > &aProperties)
void convertMeasureToXML(OUStringBuffer &rBuffer, sal_Int32 nMeasure) const
convert measure to string: from meCoreMeasureUnit to meXMLMeasureUnit
Definition: xmluconv.cxx:207
model::Theme const & getTheme() const
void setEmbedFontScripts(bool bEmbedLatinScript, bool bEmbedAsianScript, bool bEmbedComplexScript)
void setEmbedOnlyUsedFonts(bool bEmbedUsedOnly)
OUString Add(const OUString &rFamilyName, const OUString &rStyleName, FontFamily nFamily, FontPitch nPitch, rtl_TextEncoding eEnc)
void SetAutoStyles(bool bIsInAutoStyles)
Definition: sdpropls.hxx:97
static SvXMLExportPropertyMapper * CreateParaExtPropMapper(SvXMLExport &rExport)
Definition: txtparae.cxx:1458
const OUString & getIdentifier(const css::uno::Reference< css::uno::XInterface > &rInterface) const
std::pair< const_iterator, bool > insert(Value &&x)
static void convertDateTime(OUStringBuffer &rBuffer, const css::util::DateTime &rDateTime, sal_Int16 const *pTimeZoneOffset, bool bAddTimeIf0AM=false)
static bool convertColor(sal_Int32 &rColor, std::u16string_view rValue)
static void convertDuration(OUStringBuffer &rBuffer, const double fTime)
constexpr tools::Long GetWidth() const
constexpr void SetLeft(tools::Long v)
constexpr void SetTop(tools::Long v)
constexpr tools::Long Top() const
void SetSize(const Size &)
void SetPos(const Point &rPoint)
void setWidth(tools::Long n)
constexpr tools::Long GetHeight() const
void setHeight(tools::Long n)
constexpr tools::Long Left() const
export helper for the office::forms element
int nCount
#define TOOLS_WARN_EXCEPTION(area, stream)
float u
Reference< XSingleServiceFactory > xFactory
constexpr OUStringLiteral XML_STYLE_FAMILY_SD_PRESENTATION_PREFIX
Definition: families.hxx:41
constexpr OUStringLiteral XML_STYLE_FAMILY_SD_DRAWINGPAGE_PREFIX
Definition: families.hxx:44
constexpr OUStringLiteral XML_STYLE_FAMILY_SD_GRAPHICS_NAME
Definition: families.hxx:38
constexpr OUStringLiteral XML_STYLE_FAMILY_SD_GRAPHICS_PREFIX
Definition: families.hxx:39
constexpr OUStringLiteral XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME
Definition: families.hxx:43
constexpr OUStringLiteral XML_STYLE_FAMILY_SD_PRESENTATION_NAME
Definition: families.hxx:40
FontPitch
PITCH_DONTKNOW
FontFamily
FAMILY_DONTKNOW
sal_Int32 nIndex
uno_Any a
#define SAL_WARN_IF(condition, area, stream)
aStr
bool IsOptionSet(EOption eOption)
@ Exception
int i
constexpr OUStringLiteral implementationName
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
long Long
Handling of tokens in XML:
XMLTokenEnum
The enumeration of all XML tokens.
Definition: xmltoken.hxx:50
@ XML_PRESENTATION_PAGE_LAYOUT
Definition: xmltoken.hxx:1548
@ XML_START_WITH_NAVIGATOR
Definition: xmltoken.hxx:1845
@ XML_NP_PRESENTATION
Definition: xmltoken.hxx:88
@ XML_PRESENTATION_PAGE_LAYOUT_NAME
Definition: xmltoken.hxx:1549
@ XML_USE_DATE_TIME_NAME
Definition: xmltoken.hxx:2454
@ XML_N_PRESENTATION
Definition: xmltoken.hxx:89
@ XML_PAGE_LAYOUT_PROPERTIES
Definition: xmltoken.hxx:2625
@ XML_TRANSITION_ON_CLICK
Definition: xmltoken.hxx:2027
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
Definition: xmltoken.cxx:3529
QPRO_FUNC_TYPE nType
sal_Int32 mnType
const XMLPropertyMapEntry aXMLSDPresPageProps[]
Definition: sdpropls.cxx:329
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Impress_XMLOasisContentExporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlexp.cxx:2696
constexpr OUStringLiteral gpStrFooterTextPrefix
Definition: sdxmlexp.cxx:1365
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Draw_XMLOasisMetaExporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlexp.cxx:2754
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Impress_XMLOasisSettingsExporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlexp.cxx:2714
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Draw_XMLOasisStylesExporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlexp.cxx:2772
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Impress_XMLOasisMetaExporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlexp.cxx:2706
static OUString findOrAppendImpl(std::vector< OUString > &rVector, const OUString &rText, std::u16string_view pPrefix)
Definition: sdxmlexp.cxx:1323
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Impress_XMLOasisStylesExporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlexp.cxx:2686
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Impress_XMLClipboardExporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlexp.cxx:2805
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Draw_XMLOasisSettingsExporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlexp.cxx:2746
constexpr OUStringLiteral gpStrDateTimeTextPrefix
Definition: sdxmlexp.cxx:1366
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Draw_XMLOasisContentExporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlexp.cxx:2762
#define IMP_AUTOLAYOUT_INFO_MAX
Definition: sdxmlexp.cxx:191
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_DrawingLayer_XMLExporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlexp.cxx:2794
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Impress_XMLOasisExporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlexp.cxx:2674
constexpr OUStringLiteral gsPageLayoutNames(u"PageLayoutNames")
constexpr OUStringLiteral gpStrHeaderTextPrefix
Definition: sdxmlexp.cxx:1364
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Draw_XMLOasisExporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlexp.cxx:2782
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Draw_XMLExporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlexp.cxx:2734
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Impress_XMLExporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlexp.cxx:2722
XmlPlaceholder
@ XmlPlaceholderVerticalTitle
@ XmlPlaceholderPage
@ XmlPlaceholderHandout
@ XmlPlaceholderNotes
@ XmlPlaceholderVerticalOutline
@ XmlPlaceholderTable
@ XmlPlaceholderObject
@ XmlPlaceholderTitle
@ XmlPlaceholderGraphic
@ XmlPlaceholderOutline
@ XmlPlaceholderChart
@ XmlPlaceholderSubtitle
double mnWidth
double mnHeight
OUString sId
SvXMLExportFlags
Definition: xmlexp.hxx:90
constexpr sal_uInt16 XML_NAMESPACE_DRAW
constexpr sal_uInt16 XML_NAMESPACE_META
constexpr sal_uInt16 XML_NAMESPACE_OFFICE_EXT
constexpr sal_uInt16 XML_NAMESPACE_SMIL
constexpr sal_uInt16 XML_NAMESPACE_DC
constexpr sal_uInt16 XML_NAMESPACE_XLINK
constexpr sal_uInt16 XML_NAMESPACE_ANIMATION
constexpr sal_uInt16 XML_NAMESPACE_SVG
constexpr sal_uInt16 XML_NAMESPACE_LO_EXT
constexpr sal_uInt16 XML_NAMESPACE_PRESENTATION
constexpr sal_uInt16 XML_NAMESPACE_STYLE
constexpr sal_uInt16 XML_NAMESPACE_FO