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