22#include <oox/token/namespaces.hxx>
23#include <oox/token/tokens.hxx>
33#include <rtl/ustrbuf.hxx>
36#include <tools/datetime.hxx>
37#include <com/sun/star/animations/TransitionType.hpp>
38#include <com/sun/star/animations/TransitionSubType.hpp>
39#include <com/sun/star/beans/XPropertySetInfo.hpp>
40#include <com/sun/star/drawing/FillStyle.hpp>
41#include <com/sun/star/drawing/XDrawPages.hpp>
42#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
43#include <com/sun/star/embed/ElementModes.hpp>
44#include <com/sun/star/geometry/RealPoint2D.hpp>
45#include <com/sun/star/office/XAnnotationEnumeration.hpp>
46#include <com/sun/star/office/XAnnotationAccess.hpp>
47#include <com/sun/star/presentation/AnimationSpeed.hpp>
48#include <com/sun/star/util/DateTime.hpp>
49#include <com/sun/star/task/XStatusIndicator.hpp>
50#include <com/sun/star/frame/XModel.hpp>
51#include <com/sun/star/lang/XMultiServiceFactory.hpp>
52#include <com/sun/star/presentation/XCustomPresentationSupplier.hpp>
53#include <com/sun/star/container/XIndexContainer.hpp>
54#include <com/sun/star/container/XNamed.hpp>
55#include <com/sun/star/presentation/XPresentationSupplier.hpp>
63#include "../ppt/pptanimations.hxx"
76#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
77#include <com/sun/star/document/XStorageBasedDocument.hpp>
79#if OSL_DEBUG_LEVEL > 1
80#include <com/sun/star/drawing/RectanglePoint.hpp>
84#define PNMSS FSNS(XML_xmlns, XML_a), this->getNamespaceURL(OOX_NS(dml)), \
85 FSNS(XML_xmlns, XML_p), this->getNamespaceURL(OOX_NS(ppt)), \
86 FSNS(XML_xmlns, XML_r), this->getNamespaceURL(OOX_NS(officeRel)), \
87 FSNS(XML_xmlns, XML_p14), this->getNamespaceURL(OOX_NS(p14)), \
88 FSNS(XML_xmlns, XML_p15), this->getNamespaceURL(OOX_NS(p15)), \
89 FSNS(XML_xmlns, XML_mc), this->getNamespaceURL(OOX_NS(mce))
92#define PPRNMSS FSNS(XML_xmlns, XML_a), this->getNamespaceURL(OOX_NS(dml)), \
93 FSNS(XML_xmlns, XML_r), this->getNamespaceURL(OOX_NS(officeRel)), \
94 FSNS(XML_xmlns, XML_p), this->getNamespaceURL(OOX_NS(ppt))
107using namespace ::
ppt;
108using ::com::sun::star::beans::XPropertySet;
109using ::com::sun::star::beans::XPropertySetInfo;
110using ::sax_fastparser::FSHelperPtr;
114#if OSL_DEBUG_LEVEL > 1
115void dump_pset(Reference< XPropertySet >
const& rXPropSet);
147void WriteSndAc(
const FSHelperPtr& pFS,
const OUString& sSoundRelId,
const OUString& sSoundName)
149 pFS->startElementNS(XML_p, XML_sndAc);
150 pFS->startElementNS(XML_p, XML_stSnd);
151 pFS->singleElementNS(XML_p, XML_snd,
FSNS(XML_r, XML_embed),
154 pFS->endElement(
FSNS(XML_p, XML_stSnd));
155 pFS->endElement(
FSNS(XML_p, XML_sndAc));
160 switch (ePlaceholder)
181 SAL_INFO(
"sd.eppt",
"warning: unhandled placeholder type: " << ePlaceholder);
194 LAYOUT_TITLE_CONTENT,
195 LAYOUT_TITLE_2CONTENT,
197 LAYOUT_CENTERED_TEXT,
198 LAYOUT_TITLE_2CONTENT_CONTENT,
199 LAYOUT_TITLE_CONTENT_2CONTENT,
200 LAYOUT_TITLE_2CONTENT_OVER_CONTENT,
201 LAYOUT_TITLE_CONTENT_OVER_CONTENT,
202 LAYOUT_TITLE_4CONTENT,
203 LAYOUT_TITLE_6CONTENT,
218 { 20,
"Blank Slide",
"blank" },
219 { 0,
"Title Slide",
"tx" },
220 { 1,
"Title, Content",
"obj" },
221 { 3,
"Title, 2 Content",
"twoObj" },
222 { 19,
"Title Only",
"titleOnly" },
223 { 32,
"Centered Text",
"objOnly" },
224 { 15,
"Title, 2 Content and Content",
"twoObjAndObj" },
225 { 12,
"Title Content and 2 Content",
"objAndTwoObj" },
226 { 16,
"Title, 2 Content over Content",
"twoObjOverTx" },
227 { 14,
"Title, Content over Content",
"objOverTx" },
228 { 18,
"Title, 4 Content",
"fourObj" },
229 { 34,
"Title, 6 Content",
"blank" }
232int PowerPointExport::GetPPTXLayoutId(
int nOffset)
234 int nId = LAYOUT_BLANK;
236 SAL_INFO(
"sd.eppt",
"GetPPTXLayoutId " << nOffset);
241 nId = LAYOUT_TITLE_SLIDE;
244 nId = LAYOUT_TITLE_CONTENT;
247 nId = LAYOUT_TITLE_2CONTENT;
253 nId = LAYOUT_TITLE_2CONTENT_CONTENT;
256 nId = LAYOUT_TITLE_CONTENT_2CONTENT;
259 nId = LAYOUT_TITLE_2CONTENT_OVER_CONTENT;
262 nId = LAYOUT_TITLE_CONTENT_OVER_CONTENT;
265 nId = LAYOUT_TITLE_4CONTENT;
268 nId = LAYOUT_CENTERED_TEXT;
271 nId = LAYOUT_TITLE_6CONTENT;
303 GetFS()->singleElementNS(XML_p, XML_nvPr);
310 OUString sShapeType = xShape->getShapeType();
312 SAL_INFO(
"sd.eppt",
"shape(text) : " << sShapeType.toUtf8());
314 if (sShapeType ==
"com.sun.star.drawing.TextShape" || sShapeType ==
"com.sun.star.drawing.GraphicObjectShape")
316 ShapeExport::WriteTextShape(xShape);
318 else if (sShapeType ==
"com.sun.star.presentation.DateTimeShape")
321 ShapeExport::WriteTextShape(xShape);
323 else if (sShapeType ==
"com.sun.star.presentation.FooterShape")
326 ShapeExport::WriteTextShape(xShape);
328 else if (sShapeType ==
"com.sun.star.presentation.HeaderShape")
331 ShapeExport::WriteTextShape(xShape);
333 else if (sShapeType ==
"com.sun.star.presentation.NotesShape")
338 ShapeExport::WriteTextShape(xShape);
340 else if (sShapeType ==
"com.sun.star.presentation.OutlinerShape")
343 ShapeExport::WriteTextShape(xShape);
345 else if (sShapeType ==
"com.sun.star.presentation.SlideNumberShape")
348 ShapeExport::WriteTextShape(xShape);
350 else if (sShapeType ==
"com.sun.star.presentation.TitleTextShape")
353 ShapeExport::WriteTextShape(xShape);
356 SAL_WARN(
"sd.eppt",
"PowerPointShapeExport::WriteTextShape: shape of type '" << sShapeType <<
"' is ignored");
363 OUString sShapeType = xShape->getShapeType();
365 SAL_INFO(
"sd.eppt",
"shape(unknown): " << sShapeType.toUtf8());
367 if (sShapeType ==
"com.sun.star.presentation.PageShape")
371 else if (sShapeType ==
"com.sun.star.presentation.SubtitleShape")
376 ShapeExport::WriteTextShape(xShape);
380 SAL_WARN(
"sd.eppt",
"unknown shape not handled: " << sShapeType.toUtf8());
387 , mnLayoutFileIdMax(1)
388 , mnSlideIdMax(1 << 8)
389 , mnSlideMasterIdMax(1U << 31)
390 , mnAnimationNodeIdMax(1)
392 , mbCreateNotes(false)
393 , mnPlaceholderIndexMax(1)
406 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
mXModel, uno::UNO_QUERY);
407 uno::Reference<document::XDocumentProperties> xDocProps = xDPS->getDocumentProperties();
411 bool bSecurityOptOpenReadOnly =
false;
412 uno::Reference< lang::XMultiServiceFactory >
xFactory(
mXModel, uno::UNO_QUERY);
413 uno::Reference< beans::XPropertySet > xSettings(
xFactory->createInstance(
"com.sun.star.document.Settings"), uno::UNO_QUERY);
416 xSettings->getPropertyValue(
"LoadReadonly") >>= bSecurityOptOpenReadOnly;
437 rGraphicExportCache.push();
453 aMediaType =
"application/vnd.ms-powerpoint.template.macroEnabled.main+xml";
457 aMediaType =
"application/vnd.ms-powerpoint.presentation.macroEnabled.main+xml";
464 aMediaType =
"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml";
468 aMediaType =
"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml";
476 u"theme/theme1.xml");
483 PropertyValue aProperty;
484 aProperty.Name =
"BaseURI";
516 serializer->endDocument();
522 rGraphicExportCache.pop();
538 Reference<XCustomPresentationSupplier> aXCPSup(
mXModel, css::uno::UNO_QUERY);
539 if (!aXCPSup.is() || !aXCPSup->getCustomPresentations()->hasElements())
544 Reference<XDrawPagesSupplier> xDPS(
getModel(), uno::UNO_QUERY_THROW);
545 Reference<XDrawPages> xDrawPages(xDPS->getDrawPages(), uno::UNO_SET_THROW);
546 Reference<XNameContainer> aXNameCont(aXCPSup->getCustomPresentations());
547 const Sequence<OUString> aNameSeq(aXNameCont->getElementNames());
550 sal_uInt32 nCustomShowIndex = 0;
551 sal_Int32 nSlideCount = xDrawPages->getCount();
553 for (OUString
const& customShowName : aNameSeq)
555 mPresentationFS->startElementNS(XML_p, XML_custShow, XML_name, customShowName, XML_id,
556 OUString::number(nCustomShowIndex++));
558 mAny = aXNameCont->getByName(customShowName);
559 Reference<XIndexContainer> aXIContainer;
560 if (
mAny >>= aXIContainer)
564 sal_Int32 nCustomShowSlideCount = aXIContainer->getCount();
565 for (sal_Int32
i = 0;
i < nCustomShowSlideCount; ++
i)
567 Reference<XDrawPage> aXCustomShowDrawPage;
568 aXIContainer->getByIndex(
i) >>= aXCustomShowDrawPage;
569 Reference<XNamed> aXName(aXCustomShowDrawPage, UNO_QUERY_THROW);
570 OUString sCustomShowSlideName = aXName->getName();
572 for (sal_Int32 j = 0; j < nSlideCount; ++j)
574 Reference<XDrawPage> xDrawPage;
575 xDrawPages->getByIndex(j) >>= xDrawPage;
576 Reference<XNamed> xNamed(xDrawPage, UNO_QUERY_THROW);
577 OUString sSlideName = xNamed->getName();
579 if (sCustomShowSlideName == sSlideName)
600 if (aFillStyle == FillStyle_NONE ||
601 aFillStyle == FillStyle_HATCH)
604 pFS->startElementNS(XML_p, XML_bg);
605 pFS->startElementNS(XML_p, XML_bgPr);
611 pFS->endElementNS(XML_p, XML_bgPr);
612 pFS->endElementNS(XML_p, XML_bg);
617 <p:cNvPr id=\"1\" name=\"\"/>\
623 <a:off x=\"0\" y=\"0\"/>\
624 <a:ext cx=\"0\" cy=\"0\"/>\
625 <a:chOff x=\"0\" y=\"0\"/>\
626 <a:chExt cx=\"0\" cy=\"0\"/>\
632 const char* pDirection =
nullptr;
655 const char* pDirection =
nullptr;
688 FadeEffect eFadeEffect = FadeEffect_NONE;
690 mAny >>= eFadeEffect;
692 sal_Int16 nTransitionType = 0, nTransitionSubtype = 0;
697 OUString sSoundRelId;
704 sal_Int32 nTransitionFadeColor = 0;
706 mAny >>= nTransitionFadeColor;
707 nPPTTransitionType =
GetTransition(nTransitionType, nTransitionSubtype, eFadeEffect, nTransitionFadeColor, nDirection);
710 if (!nPPTTransitionType && eFadeEffect != FadeEffect_NONE)
716 bool bOOXmlSpecificTransition =
false;
718 sal_Int32 nTransition = 0;
719 const char* pDirection =
nullptr;
720 const char* pOrientation =
nullptr;
721 const char* pThruBlk =
nullptr;
722 const char* pSpokes =
nullptr;
724 char pSpokesTmp[2] =
"0";
727 sal_Int32 nTransition14 = 0;
728 const char* pDirection14 =
nullptr;
729 const char* pInverted =
nullptr;
730 const char* pPattern =
nullptr;
733 const char* pPresetTransition =
nullptr;
735 if (!nPPTTransitionType)
737 switch (nTransitionType)
739 case animations::TransitionType::BARWIPE:
741 if (nTransitionSubtype == animations::TransitionSubType::FADEOVERCOLOR)
743 nTransition = XML_cut;
745 bOOXmlSpecificTransition =
true;
749 case animations::TransitionType::MISCSHAPEWIPE:
751 switch (nTransitionSubtype)
753 case animations::TransitionSubType::TOPTOBOTTOM:
754 nTransition = XML_fade;
755 nTransition14 = XML_flip;
757 bOOXmlSpecificTransition =
true;
759 case animations::TransitionSubType::BOTTOMRIGHT:
760 nTransition = XML_fade;
761 nTransition14 = XML_switch;
763 bOOXmlSpecificTransition =
true;
766 nTransition = XML_fade;
767 nTransition14 = XML_vortex;
768 bOOXmlSpecificTransition =
true;
770 case animations::TransitionSubType::HORIZONTAL:
771 nTransition = XML_fade;
772 nTransition14 = XML_ripple;
773 bOOXmlSpecificTransition =
true;
775 case animations::TransitionSubType::LEFTTORIGHT:
776 nTransition = XML_fade;
777 pPresetTransition =
"fallOver";
778 bOOXmlSpecificTransition =
true;
780 case animations::TransitionSubType::CORNERSIN:
783 case animations::TransitionSubType::CORNERSOUT:
784 nTransition = XML_fade;
785 nTransition14 = XML_prism;
786 bOOXmlSpecificTransition =
true;
788 case animations::TransitionSubType::DIAMOND:
789 nTransition = XML_fade;
790 nTransition14 = XML_glitter;
792 pPattern =
"hexagon";
793 bOOXmlSpecificTransition =
true;
795 case animations::TransitionSubType::HEART:
796 nTransition = XML_fade;
797 nTransition14 = XML_honeycomb;
798 bOOXmlSpecificTransition =
true;
806 AnimationSpeed animationSpeed = AnimationSpeed_MEDIUM;
807 const char* speed =
nullptr;
808 sal_Int32 advanceTiming = -1;
809 sal_Int32 changeType = 0;
811 sal_Int32 nTransitionDuration = -1;
812 bool isTransitionDurationSet =
false;
817 double fTransitionDuration = -1.0;
818 mAny >>= fTransitionDuration;
819 if (fTransitionDuration >= 0)
821 nTransitionDuration = fTransitionDuration * 1000.0;
824 if (nTransitionDuration <= 500)
829 else if (nTransitionDuration >= 1000)
838 bool isStandardValue = nTransitionDuration == 500
839 || nTransitionDuration == 750
840 || nTransitionDuration == 1000;
843 isTransitionDurationSet =
true;
848 mAny >>= animationSpeed;
850 switch (animationSpeed)
853 case AnimationSpeed_MEDIUM:
856 case AnimationSpeed_SLOW:
859 case AnimationSpeed_FAST:
865 if (!nPPTTransitionType && !bOOXmlSpecificTransition && !isTransitionDurationSet)
873 mAny >>= advanceTiming;
875 if (!bOOXmlSpecificTransition)
877 switch (nPPTTransitionType)
880 nTransition = XML_blinds;
881 pDirection = (nDirection == 0) ?
"vert" :
"horz";
884 nTransition = XML_checker;
885 pDirection = (nDirection == 1) ?
"vert" :
"horz";
888 nTransition = XML_circle;
891 nTransition = XML_comb;
892 pDirection = (nDirection == 1) ?
"vert" :
"horz";
895 nTransition = XML_cover;
899 nTransition = XML_diamond;
902 nTransition = XML_dissolve;
905 nTransition = XML_fade;
909 nTransition = XML_fade;
912 nTransition = XML_newsflash;
915 nTransition = XML_plus;
918 nTransition = XML_pull;
922 nTransition = XML_push;
926 nTransition = XML_random;
929 nTransition = XML_randomBar;
930 pDirection = (nDirection == 1) ?
"vert" :
"horz";
933 nTransition = XML_split;
934 pDirection = (nDirection & 1) ?
"in" :
"out";
935 pOrientation = (nDirection < 2) ?
"horz" :
"vert";
938 nTransition = XML_strips;
942 nTransition = XML_wedge;
945 nTransition = XML_wheel;
946 if (nDirection != 4 && nDirection <= 9)
948 pSpokesTmp[0] =
'0' + nDirection;
949 pSpokes = pSpokesTmp;
953 nTransition = XML_wipe;
957 nTransition = XML_zoom;
958 pDirection = (nDirection == 1) ?
"in" :
"out";
961 nTransition14 = XML_flash;
962 nTransition = XML_fade;
963 bOOXmlSpecificTransition =
true;
973 bool isAdvanceTimingSet = advanceTiming != -1;
974 if (nTransition14 || pPresetTransition || isTransitionDurationSet)
976 const char* pRequiresNS = (nTransition14 || isTransitionDurationSet) ?
"p14" :
"p15";
978 pFS->startElement(
FSNS(XML_mc, XML_AlternateContent));
979 pFS->startElement(
FSNS(XML_mc, XML_Choice), XML_Requires, pRequiresNS);
981 if(isTransitionDurationSet && isAdvanceTimingSet)
983 pFS->startElementNS(XML_p, XML_transition,
985 XML_advTm, OString::number(advanceTiming * 1000),
986 FSNS(XML_p14, XML_dur), OString::number(nTransitionDuration));
988 else if(isTransitionDurationSet)
990 pFS->startElementNS(XML_p, XML_transition,
992 FSNS(XML_p14, XML_dur), OString::number(nTransitionDuration));
994 else if(isAdvanceTimingSet)
996 pFS->startElementNS(XML_p, XML_transition,
998 XML_advTm, OString::number(advanceTiming * 1000));
1002 pFS->startElementNS(XML_p, XML_transition, XML_spd, speed);
1007 pFS->singleElementNS(XML_p14, nTransition14,
1008 XML_isInverted, pInverted,
1009 XML_dir, pDirection14,
1010 XML_pattern, pPattern);
1012 else if (pPresetTransition)
1014 pFS->singleElementNS(XML_p15, XML_prstTrans,
1015 XML_prst, pPresetTransition);
1017 else if (isTransitionDurationSet && nTransition)
1019 pFS->singleElementNS(XML_p, nTransition,
1020 XML_dir, pDirection,
1021 XML_orient, pOrientation,
1022 XML_spokes, pSpokes,
1023 XML_thruBlk, pThruBlk);
1026 if (!sSoundRelId.isEmpty())
1027 WriteSndAc(pFS, sSoundRelId, sSoundName);
1029 pFS->endElement(
FSNS(XML_p, XML_transition));
1031 pFS->endElement(
FSNS(XML_mc, XML_Choice));
1032 pFS->startElement(
FSNS(XML_mc, XML_Fallback));
1035 pFS->startElementNS(XML_p, XML_transition,
1041 pFS->singleElementNS(XML_p, nTransition,
1042 XML_dir, pDirection,
1043 XML_orient, pOrientation,
1044 XML_spokes, pSpokes,
1045 XML_thruBlk, pThruBlk);
1048 if (!sSoundRelId.isEmpty())
1049 WriteSndAc(pFS, sSoundRelId, sSoundName);
1051 pFS->endElementNS(XML_p, XML_transition);
1053 if (nTransition14 || pPresetTransition || isTransitionDurationSet)
1055 pFS->endElement(
FSNS(XML_mc, XML_Fallback));
1056 pFS->endElement(
FSNS(XML_mc, XML_AlternateContent));
1062 OUStringBuffer sRet;
1066 sRet.append(
sName[0]);
1067 size_t nStart = 0, nOffset;
1069 while ((nOffset =
sName.find(
' ', nStart)) != std::u16string_view::npos)
1071 if (nOffset + 1 <
sName.size())
1072 sRet.append(
sName[ nOffset + 1 ]);
1073 nStart = nOffset + 1;
1077 return sRet.makeStringAndClear();
1086 "application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml");
1089 u"commentAuthors.xml");
1091 pFS->startElementNS(XML_p, XML_cmAuthorLst,
1094 for (
const AuthorsMap::value_type&
i :
maAuthors)
1096 pFS->singleElementNS(XML_p, XML_cmAuthor,
1097 XML_id, OString::number(
i.second.nId),
1100 XML_lastIdx, OString::number(
i.second.nLastIndex),
1101 XML_clrIdx, OString::number(
i.second.nId));
1104 pFS->endElementNS(XML_p, XML_cmAuthorLst);
1121 nLastIndex = ++
maAuthors[ sAuthor ].nLastIndex;
1128 Reference<XPresentationSupplier> xPresentationSupplier(
mXModel, uno::UNO_QUERY);
1129 if (!xPresentationSupplier.is())
1132 Reference<beans::XPropertySet> xPresentationProps(xPresentationSupplier->getPresentation(),
1134 bool bEndlessVal = xPresentationProps->getPropertyValue(
"IsEndless").get<
bool>();
1135 bool bChangeManually = xPresentationProps->getPropertyValue(
"IsAutomatic").get<
bool>();
1136 OUString sFirstPage = xPresentationProps->getPropertyValue(
"FirstPage").get<OUString>();
1137 OUString sCustomShow = xPresentationProps->getPropertyValue(
"CustomShow").get<OUString>();
1140 "ppt/presProps.xml",
1141 "application/vnd.openxmlformats-officedocument.presentationml.presProps+xml");
1146 pFS->startElementNS(XML_p, XML_presentationPr,
PPRNMSS);
1150 XML_showNarration,
"1");
1152 Reference<drawing::XDrawPagesSupplier> xDPS(
mXModel, uno::UNO_QUERY_THROW);
1153 Reference<drawing::XDrawPages> xDrawPages(xDPS->getDrawPages(), uno::UNO_SET_THROW);
1154 if (!sFirstPage.isEmpty())
1156 sal_Int32 nStartSlide = 1;
1157 sal_Int32 nEndSlide = xDrawPages->getCount();
1158 for (sal_Int32
i = 0;
i < nEndSlide;
i++)
1160 Reference<drawing::XDrawPage> xDrawPage;
1161 xDrawPages->getByIndex(
i) >>= xDrawPage;
1162 Reference<container::XNamed> xNamed(xDrawPage, uno::UNO_QUERY_THROW);
1163 if (xNamed->getName() == sFirstPage)
1165 nStartSlide =
i + 1;
1170 pFS->singleElementNS(XML_p, XML_sldRg, XML_st, OUString::number(nStartSlide), XML_end,
1171 OUString::number(nEndSlide));
1174 if (!sCustomShow.isEmpty())
1176 css::uno::Reference<css::presentation::XCustomPresentationSupplier>
1177 XCustPresentationSupplier(
mXModel, css::uno::UNO_QUERY_THROW);
1178 css::uno::Reference<css::container::XNameContainer> mxCustShows;
1179 mxCustShows = XCustPresentationSupplier->getCustomPresentations();
1180 const css::uno::Sequence<OUString> aNameSeq(mxCustShows->getElementNames());
1182 sal_Int32 nCustShowIndex = 0;
1183 for (sal_Int32
i = 0;
i < aNameSeq.getLength();
i++)
1185 if (aNameSeq[
i] == sCustomShow)
1192 pFS->singleElementNS(XML_p, XML_custShow, XML_id, OUString::number(nCustShowIndex));
1195 pFS->endElementNS(XML_p, XML_showPr);
1197 pFS->endElementNS(XML_p, XML_presentationPr);
1204 Reference< XAnnotationAccess > xAnnotationAccess(
mXDrawPage, uno::UNO_QUERY);
1205 if (xAnnotationAccess.is())
1207 Reference< XAnnotationEnumeration > xAnnotationEnumeration(xAnnotationAccess->createAnnotationEnumeration());
1209 if (xAnnotationEnumeration->hasMoreElements())
1212 "ppt/comments/comment" + OUString::number(nPageNum + 1) +
".xml",
1213 "application/vnd.openxmlformats-officedocument.presentationml.comments+xml");
1215 pFS->startElementNS(XML_p, XML_cmLst,
1220 Reference< XAnnotation > xAnnotation(xAnnotationEnumeration->nextElement());
1221 util::DateTime aDateTime(xAnnotation->getDateTime());
1222 RealPoint2D aRealPoint2D(xAnnotation->getPosition());
1223 Reference< XText > xText(xAnnotation->getTextRange());
1224 sal_Int32 nLastIndex;
1226 char cDateTime[
sizeof(
"-32768-65535-65535T65535:65535:65535.4294967295")];
1229 snprintf(cDateTime,
sizeof cDateTime,
"%02" SAL_PRIdINT32
"-%02" SAL_PRIuUINT32
"-%02" SAL_PRIuUINT32
"T%02" SAL_PRIuUINT32
":%02" SAL_PRIuUINT32
":%02" SAL_PRIuUINT32
".%09" SAL_PRIuUINT32, sal_Int32(aDateTime.Year), sal_uInt32(aDateTime.Month), sal_uInt32(aDateTime.Day), sal_uInt32(aDateTime.Hours), sal_uInt32(aDateTime.Minutes), sal_uInt32(aDateTime.Seconds), aDateTime.NanoSeconds);
1231 pFS->startElementNS(XML_p, XML_cm,
1232 XML_authorId, OString::number(
nId),
1234 XML_idx, OString::number(nLastIndex));
1236 pFS->singleElementNS(XML_p, XML_pos,
1240 pFS->startElementNS(XML_p, XML_text);
1241 pFS->write(xText->getString());
1242 pFS->endElementNS(XML_p, XML_text);
1244 pFS->endElementNS(XML_p, XML_cm);
1247 while (xAnnotationEnumeration->hasMoreElements());
1249 pFS->endElementNS(XML_p, XML_cmLst);
1265 uno::Reference<document::XStorageBasedDocument> xStorageBasedDocument(
getModel(), uno::UNO_QUERY);
1266 if (!xStorageBasedDocument.is())
1269 uno::Reference<embed::XStorage> xDocumentStorage = xStorageBasedDocument->getDocumentStorage();
1270 OUString aMacrosName(
"_MS_VBA_Macros");
1271 if (!xDocumentStorage.is() || !xDocumentStorage->hasByName(aMacrosName))
1274 const sal_Int32 nOpenMode = embed::ElementModes::READ;
1275 uno::Reference<io::XInputStream> xMacrosStream(xDocumentStorage->openStreamElement(aMacrosName, nOpenMode), uno::UNO_QUERY);
1276 if (!xMacrosStream.is())
1279 uno::Reference<io::XOutputStream> xOutputStream =
openFragmentStream(
"ppt/vbaProject.bin",
"application/vnd.ms-office.vbaProject");
1288 Sequence<PropertyValue> aInfo;
1293 Reference<XPropertySet> xDocSettings(
1294 xFactory->createInstance(
"com.sun.star.document.Settings"), UNO_QUERY);
1295 xDocSettings->getPropertyValue(
"ModifyPasswordInfo") >>= aInfo;
1301 if (aInfo.hasElements())
1303 OUString sAlgorithm, sSalt,
sHash;
1305 for (
auto& prop : aInfo)
1307 if (prop.Name ==
"algorithm-name")
1308 prop.Value >>= sAlgorithm;
1309 else if (prop.Name ==
"salt")
1310 prop.Value >>= sSalt;
1311 else if (prop.Name ==
"iteration-count")
1313 else if (prop.Name ==
"hash")
1314 prop.Value >>=
sHash;
1316 if (!sAlgorithm.isEmpty() && !sSalt.isEmpty() && !
sHash.isEmpty())
1318 sal_Int32 nAlgorithmSid = 0;
1319 if (sAlgorithm ==
"MD2")
1321 else if (sAlgorithm ==
"MD4")
1323 else if (sAlgorithm ==
"MD5")
1325 else if (sAlgorithm ==
"SHA-1")
1327 else if (sAlgorithm ==
"MAC")
1329 else if (sAlgorithm ==
"RIPEMD")
1331 else if (sAlgorithm ==
"RIPEMD-160")
1333 else if (sAlgorithm ==
"HMAC")
1335 else if (sAlgorithm ==
"SHA-256")
1337 else if (sAlgorithm ==
"SHA-384")
1339 else if (sAlgorithm ==
"SHA-512")
1342 if (nAlgorithmSid != 0)
1344 XML_cryptProviderType,
"rsaAES",
1345 XML_cryptAlgorithmClass,
"hash",
1346 XML_cryptAlgorithmType,
"typeAny",
1347 XML_cryptAlgorithmSid, OString::number(nAlgorithmSid),
1348 XML_spinCount, OString::number(
nCount),
1349 XML_saltData, sSalt,
1350 XML_hashData,
sHash);
1356 bool bHasBackground, Reference< XPropertySet >
const& aXBackgroundPropSet)
1358 SAL_INFO(
"sd.eppt",
"write slide: " << nPageNum <<
"\n----------------");
1367 Concat2View(
"slides/slide" + OUString::number(nPageNum + 1) +
".xml"));
1371 FSNS(XML_r, XML_id), sRelId);
1379 "ppt/slides/slide" + OUString::number(nPageNum + 1) +
".xml",
1380 "application/vnd.openxmlformats-officedocument.presentationml.slide+xml");
1386 const char* pShow =
nullptr;
1387 const char* pShowMasterShape =
nullptr;
1392 if ((
mAny >>= bShow) && !bShow)
1398 bool bShowMasterShape(
false);
1399 if ((
mAny >>= bShowMasterShape) && !bShowMasterShape)
1400 pShowMasterShape =
"0";
1403 pFS->startElementNS(XML_p, XML_sld,
PNMSS, XML_show, pShow, XML_showMasterSp, pShowMasterShape);
1405 pFS->startElementNS(XML_p, XML_cSld);
1415 pFS->endElementNS(XML_p, XML_cSld);
1420 pFS->endElementNS(XML_p, XML_sld);
1425 Concat2View(
"../slideLayouts/slideLayout" +
1433 Concat2View(
"../comments/comment" + OUString::number(nPageNum + 1) +
".xml"));
1435 SAL_INFO(
"sd.eppt",
"----------------");
1443 SAL_INFO(
"sd.eppt",
"write Notes " << nPageNum <<
"\n----------------");
1446 "ppt/notesSlides/notesSlide" +
1447 OUString::number(nPageNum + 1) +
1449 "application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml");
1451 pFS->startElementNS(XML_p, XML_notes,
PNMSS);
1453 pFS->startElementNS(XML_p, XML_cSld);
1457 pFS->endElementNS(XML_p, XML_cSld);
1459 pFS->endElementNS(XML_p, XML_notes);
1464 Concat2View(
"../slides/slide" + OUString::number(nPageNum + 1) +
".xml"));
1470 Concat2View(
"../notesSlides/notesSlide" + OUString::number(nPageNum + 1) +
".xml"));
1475 u"../notesMasters/notesMaster1.xml");
1477 SAL_INFO(
"sd.eppt",
"-----------------");
1485 OUString sRelId =
addRelation(pFS->getOutputStream(),
1487 Concat2View(
"../slideLayouts/slideLayout" + OUString::number(nLayoutFileId) +
".xml"));
1489 pFS->singleElementNS(XML_p, XML_sldLayoutId,
1491 FSNS(XML_r, XML_id), sRelId);
1496 SAL_INFO(
"sd.eppt",
"write master slide: " << nPageNum <<
"\n--------------");
1504 Concat2View(
"slideMasters/slideMaster" + OUString::number(nPageNum + 1) +
".xml"));
1508 FSNS(XML_r, XML_id), sRelId);
1515 OUString::number(nPageNum + 1) +
".xml",
1516 "application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml");
1531 Concat2View(
"../theme/theme" + OUString::number(nPageNum + 1) +
".xml"));
1533 pFS->startElementNS(XML_p, XML_sldMaster,
PNMSS);
1535 pFS->startElementNS(XML_p, XML_cSld);
1537 if (aXBackgroundPropSet)
1541 pFS->endElementNS(XML_p, XML_cSld);
1544 pFS->singleElementNS(XML_p, XML_clrMap,
1549 XML_accent1,
"accent1",
1550 XML_accent2,
"accent2",
1551 XML_accent3,
"accent3",
1552 XML_accent4,
"accent4",
1553 XML_accent5,
"accent5",
1554 XML_accent6,
"accent6",
1556 XML_folHlink,
"folHlink");
1559 pFS->startElementNS(XML_p, XML_sldLayoutIdLst);
1561 for (
int i = 0;
i < LAYOUT_SIZE;
i++)
1564 if (nLayoutFileId > 0)
1575 pFS->endElementNS(XML_p, XML_sldLayoutIdLst);
1577 pFS->endElementNS(XML_p, XML_sldMaster);
1579 SAL_INFO(
"sd.eppt",
"----------------");
1586 SAL_INFO(
"sd.eppt",
"GetLayoutFileId offset: " << nOffset <<
" master: " << nMasterNum);
1587 if (
mLayoutInfo[ nOffset ].mnFileIdArray.size() <= nMasterNum)
1595 SAL_INFO(
"sd.eppt",
"write layout: " << nOffset);
1597 Reference< drawing::XDrawPagesSupplier > xDPS(
getModel(), uno::UNO_QUERY);
1598 Reference< drawing::XDrawPages > xDrawPages = xDPS->getDrawPages();
1599 Reference< drawing::XDrawPage > xSlide = xDrawPages->insertNewByIndex(xDrawPages->getCount());
1603 printf(
"new page created\n");
1606 Reference< beans::XPropertySet > xPropSet(xSlide, uno::UNO_QUERY);
1608#if OSL_DEBUG_LEVEL > 1
1619 if (
mLayoutInfo[ nOffset ].mnFileIdArray[ nMasterNum ] != 0)
1625 "application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml");
1630 Concat2View(
"../slideMasters/slideMaster" + OUString::number(nMasterNum + 1) +
".xml"));
1632 pFS->startElementNS(XML_p, XML_sldLayout,
1637 pFS->startElementNS(XML_p, XML_cSld,
1642 pFS->endElementNS(XML_p, XML_cSld);
1644 pFS->endElementNS(XML_p, XML_sldLayout);
1650 xDrawPages->remove(xSlide);
1662 pFS->startElementNS(XML_p, XML_spTree);
1671 for (sal_uInt32
i = 0;
i < nGroups;
i++)
1673 SAL_INFO(
"sd.eppt",
"leave group");
1680 const bool bIsDiagram(
nullptr != pDiagramCandidate && pDiagramCandidate->
isDiagram());
1691 pFS->endElementNS(XML_p, XML_spTree);
1704 SAL_INFO(
"sd.eppt",
"WritePlaceholder " << bMaster <<
" " << ShapeExport::NonEmptyText(xShape));
1709 Reference<XPropertySet> xShapeProps(xShape, UNO_QUERY);
1710 if (xShapeProps->getPropertyValue(
"IsPresentationObject").get<
bool>())
1726 Reference<XPropertySet> xProps(xShape, UNO_QUERY);
1727 bool bUseBackground(
false);
1728 if (xProps.is() && xProps->getPropertySetInfo()->hasPropertyByName(
"FillUseSlideBackground"))
1729 xProps->getPropertyValue(
"FillUseSlideBackground") >>= bUseBackground;
1732 mpFS->startElementNS(XML_p, XML_sp, XML_useBgFill,
"1");
1734 mpFS->startElementNS(XML_p, XML_sp);
1737 mpFS->startElementNS(XML_p, XML_nvSpPr);
1738 const OString aPlaceholderID(
"PlaceHolder " + OString::number(
mnShapeIdMax++));
1740 mpFS->startElementNS(XML_p, XML_cNvSpPr);
1741 mpFS->singleElementNS(XML_a, XML_spLocks, XML_noGrp,
"1");
1742 mpFS->endElementNS(XML_p, XML_cNvSpPr);
1743 mpFS->startElementNS(XML_p, XML_nvPr);
1745 bool bUsePlaceholderIndex
1747 const char* pType = getPlaceholderTypeName(ePlaceholder);
1749 SAL_INFO(
"sd.eppt",
"write placeholder " << pType);
1750 if (bUsePlaceholderIndex)
1752 mpFS->singleElementNS(
1753 XML_p, XML_ph,
XML_type, pType, XML_idx,
1761 mpFS->singleElementNS(XML_p, XML_ph);
1765 mpFS->endElementNS(XML_p, XML_nvPr);
1766 mpFS->endElementNS(XML_p, XML_nvSpPr);
1769 mpFS->startElementNS(XML_p, XML_spPr);
1780 bool bHas3DEffectinShape =
false;
1781 uno::Sequence<beans::PropertyValue> grabBag;
1782 if (xProps->getPropertySetInfo()->hasPropertyByName(
"InteropGrabBag"))
1783 xProps->getPropertyValue(
"InteropGrabBag") >>= grabBag;
1785 for (
auto const& it : std::as_const(grabBag))
1786 if (it.Name ==
"3DEffectProperties")
1787 bHas3DEffectinShape =
true;
1789 if( bHas3DEffectinShape)
1792 mpFS->endElementNS(XML_p, XML_spPr);
1796 mpFS->endElementNS(XML_p, XML_sp);
1803 const Reference<XPropertySet>& rXPagePropSet)
1805 mpFS->startElementNS(XML_p, XML_sp);
1808 mpFS->startElementNS(XML_p, XML_nvSpPr);
1809 const OString aPlaceholderID(
"PlaceHolder " + OString::number(
mnShapeIdMax++));
1810 GetFS()->singleElementNS(XML_p, XML_cNvPr, XML_id, OString::number(
mnShapeIdMax), XML_name,
1813 mpFS->startElementNS(XML_p, XML_cNvSpPr);
1814 mpFS->singleElementNS(XML_a, XML_spLocks, XML_noGrp,
"1");
1815 mpFS->endElementNS(XML_p, XML_cNvSpPr);
1816 mpFS->startElementNS(XML_p, XML_nvPr);
1818 const char* pType = getPlaceholderTypeName(ePlaceholder);
1819 mpFS->singleElementNS(XML_p, XML_ph,
XML_type, pType, XML_idx,
1820 OString::number(nReferencedPlaceholderIdx));
1821 mpFS->endElementNS(XML_p, XML_nvPr);
1822 mpFS->endElementNS(XML_p, XML_nvSpPr);
1825 mpFS->startElementNS(XML_p, XML_spPr);
1826 mpFS->endElementNS(XML_p, XML_spPr);
1830 mpFS->endElementNS(XML_p, XML_sp);
1838 mpFS->startElementNS(XML_p, XML_txBody);
1839 mpFS->singleElementNS(XML_a, XML_bodyPr);
1840 mpFS->startElementNS(XML_a, XML_p);
1842 switch (ePlaceholder)
1848 OUString aFooterText;
1851 aFooterText =
"Footer";
1855 xPagePropSet->getPropertyValue(
"FooterText") >>= aFooterText;
1857 mpFS->startElementNS(XML_a, XML_r);
1858 mpFS->startElementNS(XML_a, XML_t);
1859 mpFS->writeEscaped(aFooterText);
1860 mpFS->endElementNS(XML_a, XML_t);
1861 mpFS->endElementNS(XML_a, XML_r);
1867 sal_Int32 nSlideNum = 0;
1874 xPagePropSet->getPropertyValue(
"Number") >>= nSlideNum;
1875 aSlideNum = OUString::number(nSlideNum);
1878 mpFS->startElementNS(XML_a, XML_fld, XML_id, aUUID,
XML_type,
"slidenum");
1879 mpFS->startElementNS(XML_a, XML_t);
1880 mpFS->writeEscaped(aSlideNum);
1881 mpFS->endElementNS(XML_a, XML_t);
1882 mpFS->endElementNS(XML_a, XML_fld);
1887 OUString aDateTimeType =
"datetime1";
1888 bool bIsDateTimeFixed =
false;
1889 xPagePropSet->getPropertyValue(
"IsDateTimeFixed") >>= bIsDateTimeFixed;
1891 OUString aDateTimeText =
"Date";
1894 if(ePageType !=
LAYOUT && !bIsDateTimeFixed)
1896 sal_Int32 nDateTimeFormat = 0;
1897 xPagePropSet->getPropertyValue(
"DateTimeFormat") >>= nDateTimeFormat;
1905 if (aDateTimeType ==
"datetime")
1906 aDateTimeType =
"datetime1";
1911 aDateTime, aDateTime, eDate,
1912 eTime, *(
SD_MOD()->GetNumberFormatter()),
1916 if(!bIsDateTimeFixed)
1919 mpFS->startElementNS(XML_a, XML_fld, XML_id, aUUID,
XML_type, aDateTimeType);
1923 xPagePropSet->getPropertyValue(
"DateTimeText") >>= aDateTimeText;
1924 mpFS->startElementNS(XML_a, XML_r);
1927 mpFS->startElementNS(XML_a, XML_rPr, XML_lang, rLanguageTag.
getBcp47MS());
1928 mpFS->endElementNS(XML_a, XML_rPr);
1930 mpFS->startElementNS(XML_a, XML_t);
1931 mpFS->writeEscaped(aDateTimeText);
1932 mpFS->endElementNS(XML_a, XML_t);
1934 mpFS->endElementNS(XML_a, bIsDateTimeFixed ? XML_r : XML_fld);
1938 SAL_INFO(
"sd.eppt",
"warning: no defined textbody for referenced placeholder type: "
1941 mpFS->endElementNS(XML_a, XML_p);
1942 mpFS->endElementNS(XML_p, XML_txBody);
1952 sal_Int32 nColor = 0;
1956 case PredefinedClrSchemeId::dk2:
1959 case PredefinedClrSchemeId::lt2:
1962 case PredefinedClrSchemeId::accent1:
1965 case PredefinedClrSchemeId::accent2:
1968 case PredefinedClrSchemeId::accent3:
1971 case PredefinedClrSchemeId::accent4:
1974 case PredefinedClrSchemeId::accent5:
1977 case PredefinedClrSchemeId::accent6:
1980 case PredefinedClrSchemeId::hlink:
1983 case PredefinedClrSchemeId::folHlink:
1988 OUString sOpenColorScheme =
"<a:" +
sName +
">";
1989 pFS->write(sOpenColorScheme);
1991 pFS->singleElementNS(XML_a, XML_srgbClr, XML_val,
I32SHEX(nColor));
1993 OUString sCloseColorScheme =
"</a:" +
sName +
">";
1994 pFS->write(sCloseColorScheme);
2002 OUString sThemePath =
"ppt/theme/theme" + OUString::number(nThemeNum + 1) +
".xml";
2006 aThemeExport.
write(sThemePath, *pTheme);
2030 SAL_INFO(
"sd.eppt",
"write Notes master\n---------------");
2036 u"notesMasters/notesMaster1.xml");
2039 FSNS(XML_r, XML_id), sRelId);
2045 "application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml");
2053 if (pDefaultColorSet)
2055 auto pTheme = std::make_shared<model::Theme>(
"Office Theme");
2056 pTheme->setColorSet(std::make_shared<model::ColorSet>(*pDefaultColorSet));
2063 Concat2View(
"../theme/theme" + OUString::number(
mnMasterPages + 1) +
".xml"));
2066 pFS->startElementNS(XML_p, XML_notesMaster,
PNMSS);
2068 pFS->startElementNS(XML_p, XML_cSld);
2070 Reference< XPropertySet > aXBackgroundPropSet;
2072 (
mAny >>= aXBackgroundPropSet))
2077 pFS->endElementNS(XML_p, XML_cSld);
2080 pFS->singleElementNS(XML_p, XML_clrMap,
2085 XML_accent1,
"accent1",
2086 XML_accent2,
"accent2",
2087 XML_accent3,
"accent3",
2088 XML_accent4,
"accent4",
2089 XML_accent5,
"accent5",
2090 XML_accent6,
"accent6",
2092 XML_folHlink,
"folHlink");
2094 pFS->endElementNS(XML_p, XML_notesMaster);
2096 SAL_INFO(
"sd.eppt",
"----------------");
2105 if (!sUrl.endsWithIgnoreAsciiCase(
".wav"))
2108 uno::Reference<io::XInputStream> xAudioStream;
2111 if (sUrl.startsWith(
"vnd.sun.star.Package:"))
2113 uno::Reference<document::XStorageBasedDocument> xStorageBasedDocument(
getModel(), uno::UNO_QUERY);
2114 if (!xStorageBasedDocument.is())
2117 uno::Reference<embed::XStorage> xDocumentStorage = xStorageBasedDocument->getDocumentStorage();
2118 if (!xDocumentStorage.is())
2122 css::embed::ElementModes::READ, aProxy);
2125 xAudioStream =
xStream->getInputStream();
2135 if (!xAudioStream.is())
2138 int nLastSlash = sUrl.lastIndexOf(
'/');
2139 sName = sUrl.copy(nLastSlash >= 0 ? nLastSlash + 1 : 0);
2141 OUString sPath =
"../media/" +
sName;
2145 uno::Reference<io::XOutputStream> xOutputStream =
openFragmentStream(sPath.replaceAt(0, 2,
u"/ppt"),
2153 return ShapeExport::GetShapeID(rXShape, &
maShapeMap);
2171 return "com.sun.star.comp.Impress.oox.PowerPointExport";
2176 SAL_INFO(
"sd.eppt",
"writing Diagram " + OUString::number(nDiagramId));
2177 pFS->startElementNS(XML_p, XML_graphicFrame);
2179 pFS->endElementNS(XML_p, XML_graphicFrame);
2184 bool bCheckProps = ePageType ==
NORMAL;
2185 Reference<XShape> xShape;
2191 && (aAny >>= aText) && !aText.isEmpty()))
2215 && !aText.isEmpty())
2216 ||
mXPagePropSet->getPropertyValue(
"IsDateTimeFixed") ==
false)))
2283extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
2285 uno::Sequence<css::uno::Any>
const& rArguments)
2290#if OSL_DEBUG_LEVEL > 1
2293 Reference< XPropertySetInfo > info = rXPropSet->getPropertySetInfo();
2294 Sequence< beans::Property >
props = info->getProperties();
2296 for (
int i=0;
i <
props.getLength();
i++)
2305 RectanglePoint pointValue;
2307 if (
value >>= strValue)
2308 SAL_INFO(
"sd.eppt",
name <<
" = \"" << strValue <<
"\"");
2309 else if (
value >>= intValue)
2310 SAL_INFO(
"sd.eppt",
name <<
" = " << intValue <<
"(hex : " << std::hex << intValue <<
")");
2311 else if (
value >>= boolValue)
2312 SAL_INFO(
"sd.eppt",
name <<
" = " << boolValue <<
" (bool)");
2313 else if (
value >>= pointValue)
2314 SAL_INFO(
"sd.eppt",
name <<
" = " <<
static_cast<int>(pointValue) <<
" (RectanglePoint)");
2316 SAL_INFO(
"sd.eppt",
"??? <unhandled type>");
PropertiesInfo aProperties
constexpr auto convertMm100ToMasterUnit(N n)
const LanguageTag & GetLanguageTag() const
static const AllSettings & GetSettings()
sal_uInt32 GetGroupsClosed()
sal_uInt32 GetCurrentGroupIndex() const
void ResetGroupTable(sal_uInt32 nCount)
LanguageType getLanguageType(bool bResolveSystem=true) const
OUString getBcp47MS() const
css::uno::Reference< css::drawing::XShapes > mXShapes
bool GetPageByIndex(sal_uInt32 nIndex, PageType)
css::awt::Size maPageSize
css::uno::Reference< css::beans::XPropertySet > mXPagePropSet
css::uno::Reference< css::task::XStatusIndicator > mXStatusIndicator
static sal_Int32 GetLayoutOffset(const css::uno::Reference< css::beans::XPropertySet > &rXPropSet)
void exportPPT(const std::vector< css::beans::PropertyValue > &)
static sal_Int8 GetTransition(sal_Int16 nTransitionType, sal_Int16 nTransitionSubtype, css::presentation::FadeEffect eEffect, sal_Int32 nTransitionFadeColor, sal_uInt8 &nDirection)
bool ContainsOtherShapeThanPlaceholders()
sal_uInt32 mnPages
number of Slides ( w/o master pages & notes & handout )
css::uno::Reference< css::frame::XModel > mXModel
css::uno::Reference< css::drawing::XDrawPage > mXDrawPage
css::awt::Size maNotesPageSize
css::awt::Size maDestPageSize
bool GetShapeByIndex(sal_uInt32 nIndex, bool bGroup)
css::uno::Reference< css::drawing::XShape > mXShape
static bool GetPropertyValue(css::uno::Any &rAny, const css::uno::Reference< css::beans::XPropertySet > &, const OUString &rPropertyName, bool bTestPropertyAvailability=false)
bool ImplGetPropertyValue(const OUString &rString)
SdrObject * GetPresObj(PresObjKind eObjKind, int nIndex=1, bool bFuzzySearch=false)
returns the nIndex'th object from the given PresObjKind, index starts with 1
static SdPage * getImplementation(const css::uno::Reference< css::drawing::XDrawPage > &xPage)
returns the SdPage implementation for the given XDrawPage or 0 if not available
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
std::shared_ptr< model::Theme > const & GetTheme() const
SdrPage & TRG_GetMasterPage() const
SdrPageProperties & getSdrPageProperties()
static OUString GetFormatted(Date const &rDate, tools::Time const &rTime, SvxDateFormat eDateFormat, SvxTimeFormat eTimeFormat, SvNumberFormatter &rFormatter, LanguageType eLanguage)
static void CopyInputToOutput(const css::uno::Reference< css::io::XInputStream > &xInput, const css::uno::Reference< css::io::XOutputStream > &xOutput)
static css::uno::Reference< css::io::XStream > GetStreamAtPackageURL(const css::uno::Reference< css::embed::XStorage > &xStorage, const OUString &rURL, sal_uInt32 const nOpenMode, LifecycleProxy const &rNastiness)
static css::uno::Reference< css::io::XInputStream > GetInputStreamFromURL(const OUString &aURL, const css::uno::Reference< css::uno::XComponentContext > &context)
TValueType getUnpackedValueOrDefault(const OUString &sKey, const TValueType &aDefault) const
void write(OUString const &rPath, model::Theme const &rTheme)
const OUString & getFileUrl() const
const css::uno::Reference< css::frame::XModel > & getModel() const
void commitStorage() const
const css::uno::Reference< css::task::XStatusIndicator > & getStatusIndicator() const
const css::uno::Reference< css::uno::XComponentContext > & getComponentContext() const
virtual bool importDocument() noexcept override
static int GetPPTXLayoutId(int nOffset)
virtual ::oox::ole::VbaProject * implCreateVbaProject() const override
virtual bool ImplCreateDocument() override
sal_Int32 GetAuthorIdAndLastIndex(const OUString &sAuthor, sal_Int32 &nLastIndex)
sal_Int32 mnLayoutFileIdMax
sal_uInt32 mnAnimationNodeIdMax
void writeDocumentProperties()
LayoutInfo mLayoutInfo[EPP_LAYOUT_SIZE]
::sax_fastparser::FSHelperPtr mPresentationFS
std::unordered_map< css::uno::Reference< css::drawing::XShape >, sal_Int32 > maPlaceholderShapeToIndexMap
Map of placeholder indexes for Master placeholders.
virtual void ImplWriteNotes(sal_uInt32 nPageNum) override
static const char * Get8Direction(sal_uInt8 nDirection)
sal_Int32 GetShapeID(const css::uno::Reference< css::drawing::XShape > &rXShape)
void WriteShapeTree(const ::sax_fastparser::FSHelperPtr &pFS, PageType ePageType, bool bMaster)
virtual bool ImplCreateMainNotes() override
static const char * GetSideDirection(sal_uInt8 nDirection)
void embedEffectAudio(const FSHelperPtr &pFS, const OUString &sUrl, OUString &sRelId, OUString &sName)
virtual void ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum, sal_uInt16 nMode, bool bHasBackground, css::uno::Reference< css::beans::XPropertySet > const &aXBackgroundPropSet) override
sal_Int32 GetLayoutFileId(sal_Int32 nOffset, sal_uInt32 nMasterNum)
static void WriteDiagram(const FSHelperPtr &pFS, PowerPointShapeExport &rDML, const css::uno::Reference< css::drawing::XShape > &rXShape, int nDiagramId)
void WritePlaceholderReferenceShapes(PowerPointShapeExport &rDML, PageType ePageType)
bool mbPptm
Should we export as .pptm, ie. do we contain macros?
PowerPointExport(const css::uno::Reference< css::uno::XComponentContext > &rContext, const css::uno::Sequence< css::uno::Any > &rArguments)
void WriteModifyVerifier()
std::vector< ::sax_fastparser::FSHelperPtr > mpSlidesFSArray
::oox::drawingml::ShapeExport::ShapeHashMap maShapeMap
bool WriteComments(sal_uInt32 nPageNum)
void WriteCustomSlideShow()
sal_Int32 mnPlaceholderIndexMax
Last used placeholder index.
sal_Int32 GetNextAnimationNodeID()
sal_uInt32 GetNewSlideMasterId()
virtual void ImplWriteSlideMaster(sal_uInt32 nPageNum, css::uno::Reference< css::beans::XPropertySet > const &aXBackgroundPropSet) override
sal_uInt32 GetNewSlideId()
static void WriteDefaultColorSchemes(const FSHelperPtr &pFS)
void WriteTransition(const ::sax_fastparser::FSHelperPtr &pFS)
void WritePresentationProps()
css::uno::Reference< css::drawing::XShape > GetReferencedPlaceholderXShape(const PlaceholderType eType, PageType ePageType) const
void ImplWriteBackground(const ::sax_fastparser::FSHelperPtr &pFS, const css::uno::Reference< css::beans::XPropertySet > &aXBackgroundPropSet)
virtual bool exportDocument() override
void AddLayoutIdAndRelation(const ::sax_fastparser::FSHelperPtr &pFS, sal_Int32 nLayoutFileId)
virtual OUString SAL_CALL getImplementationName() override
void ImplWritePPTXLayout(sal_Int32 nOffset, sal_uInt32 nMasterNum)
void WriteVBA()
If this is PPTM, output the VBA stream.
std::vector< OUString > maRelId
static const char * GetCornerDirection(sal_uInt8 nDirection)
sal_Int32 CreateNewPlaceholderIndex(const css::uno::Reference< css::drawing::XShape > &rXShape)
Create a new placeholder index for a master placeholder shape.
void WriteTheme(sal_Int32 nThemeNum, model::Theme *pTheme)
virtual ~PowerPointExport() override
ShapeExport & WriteNonVisualProperties(const Reference< XShape > &xShape) override
ShapeExport & WriteUnknownShape(const Reference< XShape > &xShape) override
ShapeExport & WriteTextShape(const Reference< XShape > &xShape) override
void SetMaster(bool bMaster)
PowerPointExport & mrExport
ShapeExport & WritePlaceholderShape(const Reference< XShape > &xShape, PlaceholderType ePlaceholder)
bool WritePlaceholder(const Reference< XShape > &xShape, PlaceholderType ePlaceholder, bool bMaster)
ShapeExport & WritePlaceholderReferenceShape(PlaceholderType ePlaceholder, sal_Int32 nReferencedPlaceholderIdx, PageType ePageType, const Reference< XPropertySet > &rXPagePropSet)
Writes a placeholder shape that references the placeholder on the master slide.
ShapeExport & WritePageShape(const Reference< XShape > &xShape, PageType ePageType, bool bPresObj)
PowerPointShapeExport(FSHelperPtr pFS, ShapeHashMap *pShapeMap, PowerPointExport *pFB)
void SetPageType(PageType ePageType)
ShapeExport & WritePlaceholderReferenceTextBody(PlaceholderType ePlaceholder, PageType ePageType, const Reference< XPropertySet > xPagePropSet)
Writes textbody of a placeholder that references the placeholder on the master slide.
::sax_fastparser::FSHelperPtr openFragmentStreamWithSerializer(const OUString &rStreamName, const OUString &rMediaType)
OUString addRelation(const OUString &rType, std::u16string_view rTarget)
css::uno::Reference< css::io::XOutputStream > openFragmentStream(const OUString &rStreamName, const OUString &rMediaType)
OUString getNamespaceURL(sal_Int32 nNSID) const
void exportCustomFragments()
void exportDocumentProperties(const css::uno::Reference< css::document::XDocumentProperties > &xProperties, bool bSecurityOptOpenReadOnly)
void WriteDiagram(const css::uno::Reference< css::drawing::XShape > &rXShape, int nDiagramId)
void WriteShapeEffects(const css::uno::Reference< css::beans::XPropertySet > &rXPropSet)
static void ResetMlCounters()
::sax_fastparser::FSHelperPtr mpFS
void Write3DEffects(const css::uno::Reference< css::beans::XPropertySet > &rXPropSet, bool bIsText)
void WriteBlipFill(const css::uno::Reference< css::beans::XPropertySet > &rXPropSet, const OUString &sURLPropName, const css::awt::Size &rSize={})
void WriteFill(const css::uno::Reference< css::beans::XPropertySet > &xPropSet, const css::awt::Size &rSize={})
const ::sax_fastparser::FSHelperPtr & GetFS() const
::oox::core::XmlFilterBase * GetFB()
void WriteShapeTransformation(const css::uno::Reference< css::drawing::XShape > &rXShape, sal_Int32 nXmlNamespace, bool bFlipH=false, bool bFlipV=false, bool bSuppressRotation=false, bool bSuppressFlipping=false, bool bFlippedBeforeRotation=false)
void WritePresetShape(const OString &pShape, std::vector< std::pair< sal_Int32, sal_Int32 > > &rAvList)
void WriteOutline(const css::uno::Reference< css::beans::XPropertySet > &rXPropSet, css::uno::Reference< css::frame::XModel > const &xModel=nullptr)
static OUString GetDatetimeTypeFromDateTime(SvxDateFormat eDate, SvxTimeFormat eTime)
void SetBackgroundDark(bool bIsDark)
static GraphicExportCache & get()
std::unordered_map< css::uno::Reference< css::drawing::XShape >, sal_Int32 > ShapeHashMap
ShapeExport & WriteNonVisualDrawingProperties(const css::uno::Reference< css::drawing::XShape > &xShape, const char *sName)
ShapeExport & WriteShape(const css::uno::Reference< css::drawing::XShape > &xShape)
ShapeExport & WriteTextBox(const css::uno::Reference< css::uno::XInterface > &xIface, sal_Int32 nXmlNamespace, bool bWritePropertiesAsLstStyles=false)
const model::ColorSet & getColorSet(sal_uInt32 nIndex) const
#define TOOLS_WARN_EXCEPTION(area, stream)
Reference< XSingleServiceFactory > xFactory
constexpr sal_Int32 FSNS(sal_Int32 namespc, sal_Int32 element)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
enum SAL_DLLPUBLIC_RTTI FillStyle
OString generateGUIDString()
void WriteAnimations(const FSHelperPtr &pFS, const Reference< XDrawPage > &rXDrawPage, PowerPointExport &rExport)
std::u16string_view getPredefinedClrNames(PredefinedClrSchemeId eID)
OUString getRelationship(Relationship eRelationship)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
const char * UseIf(const char *s, bool bUse)
std::shared_ptr< FastSerializerHelper > FSHelperPtr
bool getOutputStream(ProgramOptions const &options, OString const &extension, std::ostream **ppOutputStream, OString &targetSourceFileName, OString &tmpSourceFileName)
#define PPT_TRANSITION_TYPE_PLUS
#define PPT_TRANSITION_TYPE_CIRCLE
#define PPT_TRANSITION_TYPE_RANDOM
#define PPT_TRANSITION_TYPE_PULL
#define PPT_TRANSITION_TYPE_WIPE
#define PPT_TRANSITION_TYPE_PUSH
#define PPT_TRANSITION_TYPE_ZOOM
#define PPT_TRANSITION_TYPE_SPLIT
#define PPT_TRANSITION_TYPE_DIAMOND
#define PPT_TRANSITION_TYPE_COVER
#define PPT_TRANSITION_TYPE_BLINDS
#define PPT_TRANSITION_TYPE_NEWSFLASH
#define PPT_TRANSITION_TYPE_SMOOTHFADE
#define PPT_TRANSITION_TYPE_DISSOLVE
#define PPT_TRANSITION_TYPE_WHEEL
#define PPT_TRANSITION_TYPE_WEDGE
#define PPT_TRANSITION_TYPE_COMB
#define PPT_TRANSITION_TYPE_FLASH
#define PPT_TRANSITION_TYPE_RANDOM_BARS
#define PPT_TRANSITION_TYPE_STRIPS
#define PPT_TRANSITION_TYPE_FADE
#define PPT_TRANSITION_TYPE_NONE
#define PPT_TRANSITION_TYPE_CHECKER
SAL_DLLPUBLIC_EXPORT uno::XInterface * css_comp_Impress_oox_PowerPointExport(uno::XComponentContext *rxCtxt, uno::Sequence< css::uno::Any > const &rArguments)
const PPTXLayoutInfo aLayoutInfo[LAYOUT_SIZE]
static OUString lcl_GetInitials(std::u16string_view sName)
void dump_pset(Reference< XPropertySet > const &rXPropSet)
std::vector< sal_Int32 > mnFileIdArray
SVXCORE_DLLPUBLIC css::uno::Reference< css::drawing::XShape > GetXShapeForSdrObject(SdrObject *pObj) noexcept
OString I32SHEX(sal_Int32 x)