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