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