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