File: | home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx |
Warning: | line 829, column 13 Value stored to 'bOOXmlSpecificTransition' is never read |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
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 <stdio.h> |
21 | #include <oox/drawingml/clrscheme.hxx> |
22 | #include <oox/token/namespaces.hxx> |
23 | #include <oox/token/tokens.hxx> |
24 | #include <oox/token/relationship.hxx> |
25 | #include <oox/ole/vbaproject.hxx> |
26 | #include "epptooxml.hxx" |
27 | #include <oox/export/shapes.hxx> |
28 | |
29 | #include <comphelper/sequenceashashmap.hxx> |
30 | #include <comphelper/storagehelper.hxx> |
31 | #include <sax/fshelper.hxx> |
32 | #include <rtl/ustrbuf.hxx> |
33 | #include <sal/log.hxx> |
34 | #include <com/sun/star/animations/TransitionType.hpp> |
35 | #include <com/sun/star/animations/TransitionSubType.hpp> |
36 | #include <com/sun/star/beans/XPropertySetInfo.hpp> |
37 | #include <com/sun/star/drawing/FillStyle.hpp> |
38 | #include <com/sun/star/drawing/XDrawPages.hpp> |
39 | #include <com/sun/star/drawing/XDrawPagesSupplier.hpp> |
40 | #include <com/sun/star/embed/ElementModes.hpp> |
41 | #include <com/sun/star/geometry/RealPoint2D.hpp> |
42 | #include <com/sun/star/office/XAnnotationEnumeration.hpp> |
43 | #include <com/sun/star/office/XAnnotationAccess.hpp> |
44 | #include <com/sun/star/presentation/AnimationSpeed.hpp> |
45 | #include <com/sun/star/util/DateTime.hpp> |
46 | #include <com/sun/star/task/XStatusIndicator.hpp> |
47 | #include <com/sun/star/frame/XModel.hpp> |
48 | #include <com/sun/star/lang/XMultiServiceFactory.hpp> |
49 | |
50 | #include <oox/export/utils.hxx> |
51 | |
52 | #include "pptx-animations.hxx" |
53 | #include "../ppt/pptanimations.hxx" |
54 | |
55 | #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> |
56 | #include <com/sun/star/document/XStorageBasedDocument.hpp> |
57 | #include <utility> |
58 | #if OSL_DEBUG_LEVEL1 > 1 |
59 | #include <com/sun/star/drawing/RectanglePoint.hpp> |
60 | #endif |
61 | |
62 | // presentation namespaces |
63 | #define PNMSSFSNS(XML_xmlns, XML_a), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_dml)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_p), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_ppt)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_r), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_officeRel)), (((rtl_TextEncoding) 76))).getStr( ), FSNS(XML_xmlns, XML_p14), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_p14)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_p15), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_p15)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_mc), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_mce)), (((rtl_TextEncoding) 76))).getStr() FSNS(XML_xmlns, XML_a), OUStringToOString(this->getNamespaceURL(OOX_NS(dml)(::oox::NMSP_dml)), RTL_TEXTENCODING_UTF8(((rtl_TextEncoding) 76))).getStr(), \ |
64 | FSNS(XML_xmlns, XML_p), OUStringToOString(this->getNamespaceURL(OOX_NS(ppt)(::oox::NMSP_ppt)), RTL_TEXTENCODING_UTF8(((rtl_TextEncoding) 76))).getStr(), \ |
65 | FSNS(XML_xmlns, XML_r), OUStringToOString(this->getNamespaceURL(OOX_NS(officeRel)(::oox::NMSP_officeRel)), RTL_TEXTENCODING_UTF8(((rtl_TextEncoding) 76))).getStr(), \ |
66 | FSNS(XML_xmlns, XML_p14), OUStringToOString(this->getNamespaceURL(OOX_NS(p14)(::oox::NMSP_p14)), RTL_TEXTENCODING_UTF8(((rtl_TextEncoding) 76))).getStr(), \ |
67 | FSNS(XML_xmlns, XML_p15), OUStringToOString(this->getNamespaceURL(OOX_NS(p15)(::oox::NMSP_p15)), RTL_TEXTENCODING_UTF8(((rtl_TextEncoding) 76))).getStr(), \ |
68 | FSNS(XML_xmlns, XML_mc), OUStringToOString(this->getNamespaceURL(OOX_NS(mce)(::oox::NMSP_mce)), RTL_TEXTENCODING_UTF8(((rtl_TextEncoding) 76))).getStr() |
69 | |
70 | |
71 | using namespace ::com::sun::star; |
72 | using namespace ::com::sun::star::animations; |
73 | using namespace ::com::sun::star::beans; |
74 | using namespace ::com::sun::star::container; |
75 | using namespace ::com::sun::star::drawing; |
76 | using namespace ::com::sun::star::geometry; |
77 | using namespace ::com::sun::star::presentation; |
78 | using namespace ::com::sun::star::office; |
79 | using namespace ::com::sun::star::text; |
80 | using namespace ::com::sun::star::uno; |
81 | using namespace ::com::sun::star::util; |
82 | using namespace ::ppt; |
83 | using ::com::sun::star::beans::XPropertySet; |
84 | using ::com::sun::star::beans::XPropertySetInfo; |
85 | using ::sax_fastparser::FSHelperPtr; |
86 | using namespace oox::drawingml; |
87 | using namespace oox::core; |
88 | |
89 | #if OSL_DEBUG_LEVEL1 > 1 |
90 | void dump_pset(Reference< XPropertySet > const& rXPropSet); |
91 | #endif |
92 | |
93 | namespace oox::core |
94 | { |
95 | |
96 | class PowerPointShapeExport : public ShapeExport |
97 | { |
98 | PowerPointExport& mrExport; |
99 | PageType mePageType; |
100 | bool mbMaster; |
101 | public: |
102 | PowerPointShapeExport(FSHelperPtr pFS, ShapeHashMap* pShapeMap, PowerPointExport* pFB); |
103 | void SetMaster(bool bMaster); |
104 | void SetPageType(PageType ePageType); |
105 | ShapeExport& WriteNonVisualProperties(const Reference< XShape >& xShape) override; |
106 | ShapeExport& WriteTextShape(const Reference< XShape >& xShape) override; |
107 | ShapeExport& WriteUnknownShape(const Reference< XShape >& xShape) override; |
108 | ShapeExport& WritePlaceholderShape(const Reference< XShape >& xShape, PlaceholderType ePlaceholder); |
109 | ShapeExport& WritePageShape(const Reference< XShape >& xShape, PageType ePageType, bool bPresObj); |
110 | |
111 | // helper parts |
112 | bool WritePlaceholder(const Reference< XShape >& xShape, PlaceholderType ePlaceholder, bool bMaster); |
113 | }; |
114 | |
115 | |
116 | namespace |
117 | { |
118 | void WriteSndAc(const FSHelperPtr& pFS, const OUString& sSoundRelId, const OUString& sSoundName) |
119 | { |
120 | pFS->startElementNS(XML_p, XML_sndAc); |
121 | pFS->startElementNS(XML_p, XML_stSnd); |
122 | pFS->singleElementNS(XML_p, XML_snd, FSNS(XML_r, XML_embed), |
123 | sax_fastparser::UseIf(sSoundRelId, !sSoundRelId.isEmpty()), XML_name, |
124 | sax_fastparser::UseIf(sSoundName, !sSoundName.isEmpty())); |
125 | pFS->endElement(FSNS(XML_p, XML_stSnd)); |
126 | pFS->endElement(FSNS(XML_p, XML_sndAc)); |
127 | } |
128 | } |
129 | |
130 | } |
131 | |
132 | namespace { |
133 | |
134 | enum PPTXLayout |
135 | { |
136 | LAYOUT_BLANK, |
137 | LAYOUT_TITLE_SLIDE, |
138 | LAYOUT_TITLE_CONTENT, |
139 | LAYOUT_TITLE_2CONTENT, |
140 | LAYOUT_TITLE, |
141 | LAYOUT_CENTERED_TEXT, |
142 | LAYOUT_TITLE_2CONTENT_CONTENT, |
143 | LAYOUT_TITLE_CONTENT_2CONTENT, |
144 | LAYOUT_TITLE_2CONTENT_OVER_CONTENT, |
145 | LAYOUT_TITLE_CONTENT_OVER_CONTENT, |
146 | LAYOUT_TITLE_4CONTENT, |
147 | LAYOUT_TITLE_6CONTENT, |
148 | LAYOUT_SIZE |
149 | }; |
150 | |
151 | struct PPTXLayoutInfo |
152 | { |
153 | int nType; |
154 | const char* sName; |
155 | const char* sType; |
156 | }; |
157 | |
158 | } |
159 | |
160 | const PPTXLayoutInfo aLayoutInfo[LAYOUT_SIZE] = |
161 | { |
162 | { 20, "Blank Slide", "blank" }, |
163 | { 0, "Title Slide", "tx" }, |
164 | { 1, "Title, Content", "obj" }, |
165 | { 3, "Title, 2 Content", "twoObj" }, |
166 | { 19, "Title Only", "titleOnly" }, |
167 | { 32, "Centered Text", "objOnly" }, // not exactly, but close |
168 | { 15, "Title, 2 Content and Content", "twoObjAndObj" }, |
169 | { 12, "Title Content and 2 Content", "objAndTwoObj" }, |
170 | { 16, "Title, 2 Content over Content", "twoObjOverTx" }, // not exactly, but close |
171 | { 14, "Title, Content over Content", "objOverTx" }, // not exactly, but close |
172 | { 18, "Title, 4 Content", "fourObj" }, |
173 | { 34, "Title, 6 Content", "blank" } // not defined => blank |
174 | }; |
175 | |
176 | int PowerPointExport::GetPPTXLayoutId(int nOffset) |
177 | { |
178 | int nId = LAYOUT_BLANK; |
179 | |
180 | SAL_INFO("sd.eppt", "GetPPTXLayoutId " << nOffset)do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "GetPPTXLayoutId " << nOffset) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "180" ": "), ::sal::detail::unwrapStream( ::sal::detail:: StreamStart() << "GetPPTXLayoutId " << nOffset), 0 ); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << "GetPPTXLayoutId " << nOffset; ::sal::detail:: log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "180" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "GetPPTXLayoutId " << nOffset) == 1) { ::sal_detail_log ( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "180" ": "), ::sal::detail::unwrapStream( ::sal::detail:: StreamStart() << "GetPPTXLayoutId " << nOffset), 0 ); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << "GetPPTXLayoutId " << nOffset; ::sal::detail:: log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "180" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
181 | |
182 | switch (nOffset) |
183 | { |
184 | case 0: |
185 | nId = LAYOUT_TITLE_SLIDE; |
186 | break; |
187 | case 1: |
188 | nId = LAYOUT_TITLE_CONTENT; |
189 | break; |
190 | case 3: |
191 | nId = LAYOUT_TITLE_2CONTENT; |
192 | break; |
193 | case 19: |
194 | nId = LAYOUT_TITLE; |
195 | break; |
196 | case 15: |
197 | nId = LAYOUT_TITLE_2CONTENT_CONTENT; |
198 | break; |
199 | case 12: |
200 | nId = LAYOUT_TITLE_CONTENT_2CONTENT; |
201 | break; |
202 | case 16: |
203 | nId = LAYOUT_TITLE_2CONTENT_OVER_CONTENT; |
204 | break; |
205 | case 14: |
206 | nId = LAYOUT_TITLE_CONTENT_OVER_CONTENT; |
207 | break; |
208 | case 18: |
209 | nId = LAYOUT_TITLE_4CONTENT; |
210 | break; |
211 | case 32: |
212 | nId = LAYOUT_CENTERED_TEXT; |
213 | break; |
214 | case 34: |
215 | nId = LAYOUT_TITLE_6CONTENT; |
216 | break; |
217 | case 20: |
218 | default: |
219 | nId = LAYOUT_BLANK; |
220 | break; |
221 | } |
222 | |
223 | return nId; |
224 | } |
225 | |
226 | PowerPointShapeExport::PowerPointShapeExport(FSHelperPtr pFS, ShapeHashMap* pShapeMap, |
227 | PowerPointExport* pFB) |
228 | : ShapeExport(XML_p, std::move(pFS), pShapeMap, pFB) |
229 | , mrExport(*pFB) |
230 | , mePageType(UNDEFINED) |
231 | , mbMaster(false) |
232 | { |
233 | } |
234 | |
235 | void PowerPointShapeExport::SetMaster(bool bMaster) |
236 | { |
237 | mbMaster = bMaster; |
238 | } |
239 | |
240 | void PowerPointShapeExport::SetPageType(PageType ePageType) |
241 | { |
242 | mePageType = ePageType; |
243 | } |
244 | |
245 | ShapeExport& PowerPointShapeExport::WriteNonVisualProperties(const Reference< XShape >&) |
246 | { |
247 | GetFS()->singleElementNS(XML_p, XML_nvPr); |
248 | |
249 | return *this; |
250 | } |
251 | |
252 | ShapeExport& PowerPointShapeExport::WriteTextShape(const Reference< XShape >& xShape) |
253 | { |
254 | OUString sShapeType = xShape->getShapeType(); |
255 | |
256 | SAL_INFO("sd.eppt", "shape(text) : " << sShapeType.toUtf8())do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "shape(text) : " << sShapeType.toUtf8()) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "256" ": "), ::sal::detail::unwrapStream( ::sal::detail:: StreamStart() << "shape(text) : " << sShapeType.toUtf8 ()), 0); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << "shape(text) : " << sShapeType.toUtf8(); ::sal ::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "256" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "shape(text) : " << sShapeType.toUtf8()) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt" ), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "256" ": "), ::sal::detail::unwrapStream( ::sal::detail:: StreamStart() << "shape(text) : " << sShapeType.toUtf8 ()), 0); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << "shape(text) : " << sShapeType.toUtf8(); ::sal ::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "256" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
257 | |
258 | if (sShapeType == "com.sun.star.drawing.TextShape" || sShapeType == "com.sun.star.drawing.GraphicObjectShape") |
259 | { |
260 | ShapeExport::WriteTextShape(xShape); |
261 | } |
262 | else if (sShapeType == "com.sun.star.presentation.DateTimeShape") |
263 | { |
264 | if (!WritePlaceholder(xShape, DateAndTime, mbMaster)) |
265 | ShapeExport::WriteTextShape(xShape); |
266 | } |
267 | else if (sShapeType == "com.sun.star.presentation.FooterShape") |
268 | { |
269 | if (!WritePlaceholder(xShape, Footer, mbMaster)) |
270 | ShapeExport::WriteTextShape(xShape); |
271 | } |
272 | else if (sShapeType == "com.sun.star.presentation.HeaderShape") |
273 | { |
274 | if (!WritePlaceholder(xShape, Header, mbMaster)) |
275 | ShapeExport::WriteTextShape(xShape); |
276 | } |
277 | else if (sShapeType == "com.sun.star.presentation.NotesShape") |
278 | { |
279 | if (mePageType == NOTICE && mrExport.GetPresObj()) |
280 | WritePlaceholderShape(xShape, Notes); |
281 | else |
282 | ShapeExport::WriteTextShape(xShape); |
283 | } |
284 | else if (sShapeType == "com.sun.star.presentation.OutlinerShape") |
285 | { |
286 | if (!WritePlaceholder(xShape, Outliner, mbMaster)) |
287 | ShapeExport::WriteTextShape(xShape); |
288 | } |
289 | else if (sShapeType == "com.sun.star.presentation.SlideNumberShape") |
290 | { |
291 | if (!WritePlaceholder(xShape, SlideNumber, mbMaster)) |
292 | ShapeExport::WriteTextShape(xShape); |
293 | } |
294 | else if (sShapeType == "com.sun.star.presentation.TitleTextShape") |
295 | { |
296 | if (!WritePlaceholder(xShape, Title, mbMaster)) |
297 | ShapeExport::WriteTextShape(xShape); |
298 | } |
299 | else |
300 | SAL_WARN("sd.eppt", "PowerPointShapeExport::WriteTextShape: shape of type '" << sShapeType << "' is ignored")do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_WARN , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "PowerPointShapeExport::WriteTextShape: shape of type '" << sShapeType << "' is ignored") == 1) { ::sal_detail_log ( (::SAL_DETAIL_LOG_LEVEL_WARN), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "300" ": "), ::sal::detail::unwrapStream( ::sal::detail:: StreamStart() << "PowerPointShapeExport::WriteTextShape: shape of type '" << sShapeType << "' is ignored"), 0); } else { :: std::ostringstream sal_detail_stream; sal_detail_stream << "PowerPointShapeExport::WriteTextShape: shape of type '" << sShapeType << "' is ignored"; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_WARN ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "300" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "PowerPointShapeExport::WriteTextShape: shape of type '" << sShapeType << "' is ignored") == 1) { ::sal_detail_log ( (::SAL_DETAIL_LOG_LEVEL_WARN), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "300" ": "), ::sal::detail::unwrapStream( ::sal::detail:: StreamStart() << "PowerPointShapeExport::WriteTextShape: shape of type '" << sShapeType << "' is ignored"), 0); } else { :: std::ostringstream sal_detail_stream; sal_detail_stream << "PowerPointShapeExport::WriteTextShape: shape of type '" << sShapeType << "' is ignored"; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_WARN ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "300" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
301 | |
302 | return *this; |
303 | } |
304 | |
305 | ShapeExport& PowerPointShapeExport::WriteUnknownShape(const Reference< XShape >& xShape) |
306 | { |
307 | OUString sShapeType = xShape->getShapeType(); |
308 | |
309 | SAL_INFO("sd.eppt", "shape(unknown): " << sShapeType.toUtf8())do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "shape(unknown): " << sShapeType.toUtf8()) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "309" ": "), ::sal::detail::unwrapStream( ::sal::detail:: StreamStart() << "shape(unknown): " << sShapeType .toUtf8()), 0); } else { ::std::ostringstream sal_detail_stream ; sal_detail_stream << "shape(unknown): " << sShapeType .toUtf8(); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "309" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "shape(unknown): " << sShapeType.toUtf8()) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt" ), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "309" ": "), ::sal::detail::unwrapStream( ::sal::detail:: StreamStart() << "shape(unknown): " << sShapeType .toUtf8()), 0); } else { ::std::ostringstream sal_detail_stream ; sal_detail_stream << "shape(unknown): " << sShapeType .toUtf8(); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "309" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
310 | |
311 | if (sShapeType == "com.sun.star.presentation.PageShape") |
312 | { |
313 | WritePageShape(xShape, mePageType, mrExport.GetPresObj()); |
314 | } |
315 | else if (sShapeType == "com.sun.star.presentation.SubtitleShape") |
316 | { |
317 | if(mePageType != MASTER) |
318 | { |
319 | if (!WritePlaceholder(xShape, Subtitle, mbMaster)) |
320 | ShapeExport::WriteTextShape(xShape); |
321 | } |
322 | } |
323 | else |
324 | SAL_WARN("sd.eppt", "unknown shape not handled: " << sShapeType.toUtf8())do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_WARN , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "unknown shape not handled: " << sShapeType.toUtf8()) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_WARN ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "324" ": "), ::sal::detail::unwrapStream( ::sal::detail:: StreamStart() << "unknown shape not handled: " << sShapeType.toUtf8()), 0); } else { ::std::ostringstream sal_detail_stream ; sal_detail_stream << "unknown shape not handled: " << sShapeType.toUtf8(); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_WARN ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "324" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "unknown shape not handled: " << sShapeType .toUtf8()) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_WARN ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "324" ": "), ::sal::detail::unwrapStream( ::sal::detail:: StreamStart() << "unknown shape not handled: " << sShapeType.toUtf8()), 0); } else { ::std::ostringstream sal_detail_stream ; sal_detail_stream << "unknown shape not handled: " << sShapeType.toUtf8(); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_WARN ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "324" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
325 | |
326 | return *this; |
327 | } |
328 | |
329 | PowerPointExport::PowerPointExport(const Reference< XComponentContext >& rContext, const uno::Sequence<uno::Any>& rArguments) |
330 | : XmlFilterBase(rContext) |
331 | , PPTWriterBase() |
332 | , mnLayoutFileIdMax(1) |
333 | , mnSlideIdMax(1 << 8) |
334 | , mnSlideMasterIdMax(1U << 31) |
335 | , mnAnimationNodeIdMax(1) |
336 | , mnDiagramId(1) |
337 | , mbCreateNotes(false) |
338 | { |
339 | comphelper::SequenceAsHashMap aArgumentsMap(rArguments); |
340 | mbPptm = aArgumentsMap.getUnpackedValueOrDefault("IsPPTM", false); |
341 | mbExportTemplate = aArgumentsMap.getUnpackedValueOrDefault("IsTemplate", false); |
342 | } |
343 | |
344 | PowerPointExport::~PowerPointExport() |
345 | { |
346 | } |
347 | |
348 | void PowerPointExport::writeDocumentProperties() |
349 | { |
350 | uno::Reference<document::XDocumentPropertiesSupplier> xDPS(mXModel, uno::UNO_QUERY); |
351 | uno::Reference<document::XDocumentProperties> xDocProps = xDPS->getDocumentProperties(); |
352 | |
353 | if (xDocProps.is()) |
354 | { |
355 | bool bSecurityOptOpenReadOnly = false; |
356 | uno::Reference< lang::XMultiServiceFactory > xFactory(mXModel, uno::UNO_QUERY); |
357 | uno::Reference< beans::XPropertySet > xSettings(xFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY); |
358 | try |
359 | { |
360 | xSettings->getPropertyValue("LoadReadonly") >>= bSecurityOptOpenReadOnly; |
361 | } |
362 | catch( Exception& ) |
363 | { |
364 | } |
365 | exportDocumentProperties(xDocProps, bSecurityOptOpenReadOnly); |
366 | } |
367 | |
368 | exportCustomFragments(); |
369 | } |
370 | |
371 | bool PowerPointExport::importDocument() throw() |
372 | { |
373 | return false; |
374 | } |
375 | |
376 | bool PowerPointExport::exportDocument() |
377 | { |
378 | DrawingML::ResetCounters(); |
379 | maShapeMap.clear(); |
380 | |
381 | mXModel = getModel(); |
382 | |
383 | //write document properties |
384 | writeDocumentProperties(); |
385 | |
386 | addRelation(oox::getRelationship(Relationship::OFFICEDOCUMENT), "ppt/presentation.xml"); |
387 | |
388 | OUString aMediaType; |
389 | if (mbPptm) |
390 | { |
391 | if (mbExportTemplate) |
392 | { |
393 | aMediaType = "application/vnd.ms-powerpoint.template.macroEnabled.main+xml"; |
394 | } |
395 | else |
396 | { |
397 | aMediaType = "application/vnd.ms-powerpoint.presentation.macroEnabled.main+xml"; |
398 | } |
399 | } |
400 | else |
401 | { |
402 | if (mbExportTemplate) |
403 | { |
404 | aMediaType = "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml"; |
405 | } |
406 | else |
407 | { |
408 | aMediaType = "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml"; |
409 | } |
410 | } |
411 | |
412 | mPresentationFS = openFragmentStreamWithSerializer("ppt/presentation.xml", aMediaType); |
413 | |
414 | addRelation(mPresentationFS->getOutputStream(), |
415 | oox::getRelationship(Relationship::THEME), |
416 | "theme/theme1.xml"); |
417 | |
418 | mPresentationFS->startElementNS(XML_p, XML_presentation, PNMSSFSNS(XML_xmlns, XML_a), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_dml)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_p), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_ppt)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_r), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_officeRel)), (((rtl_TextEncoding) 76))).getStr( ), FSNS(XML_xmlns, XML_p14), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_p14)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_p15), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_p15)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_mc), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_mce)), (((rtl_TextEncoding) 76))).getStr()); |
419 | |
420 | mXStatusIndicator = getStatusIndicator(); |
421 | |
422 | std::vector< PropertyValue > aProperties; |
423 | PropertyValue aProperty; |
424 | aProperty.Name = "BaseURI"; |
425 | aProperty.Value <<= getFileUrl(); |
426 | aProperties.push_back(aProperty); |
427 | |
428 | exportPPT(aProperties); |
429 | |
430 | mPresentationFS->singleElementNS(XML_p, XML_sldSz, |
431 | XML_cx, OString::number(PPTtoEMU(maDestPageSize.Width)), |
432 | XML_cy, OString::number(PPTtoEMU(maDestPageSize.Height))); |
433 | // for some reason if added before slides list it will not load the slides (alas with error reports) in mso |
434 | mPresentationFS->singleElementNS(XML_p, XML_notesSz, |
435 | XML_cx, OString::number(PPTtoEMU(maNotesPageSize.Width)), |
436 | XML_cy, OString::number(PPTtoEMU(maNotesPageSize.Height))); |
437 | |
438 | WriteAuthors(); |
439 | |
440 | WriteVBA(); |
441 | |
442 | mPresentationFS->endElementNS(XML_p, XML_presentation); |
443 | mPresentationFS.reset(); |
444 | // Free all FSHelperPtr, to flush data before committing storage |
445 | mpSlidesFSArray.clear(); |
446 | |
447 | commitStorage(); |
448 | |
449 | maShapeMap.clear(); |
450 | maAuthors.clear(); |
451 | |
452 | return true; |
453 | } |
454 | |
455 | ::oox::ole::VbaProject* PowerPointExport::implCreateVbaProject() const |
456 | { |
457 | return new ::oox::ole::VbaProject(getComponentContext(), getModel(), "Impress"); |
458 | } |
459 | |
460 | void PowerPointExport::ImplWriteBackground(const FSHelperPtr& pFS, const Reference< XPropertySet >& rXPropSet) |
461 | { |
462 | FillStyle aFillStyle(FillStyle_NONE); |
463 | if (ImplGetPropertyValue(rXPropSet, "FillStyle")) |
464 | mAny >>= aFillStyle; |
465 | |
466 | if (aFillStyle == FillStyle_NONE || |
467 | aFillStyle == FillStyle_HATCH) |
468 | return; |
469 | |
470 | pFS->startElementNS(XML_p, XML_bg); |
471 | pFS->startElementNS(XML_p, XML_bgPr); |
472 | |
473 | PowerPointShapeExport aDML(pFS, &maShapeMap, this); |
474 | aDML.SetBackgroundDark(mbIsBackgroundDark); |
475 | aDML.WriteFill(rXPropSet); |
476 | |
477 | pFS->endElementNS(XML_p, XML_bgPr); |
478 | pFS->endElementNS(XML_p, XML_bg); |
479 | } |
480 | |
481 | #define MAIN_GROUP"<p:nvGrpSpPr> <p:cNvPr id=\"1\" name=\"\"/> <p:cNvGrpSpPr/> <p:nvPr/> </p:nvGrpSpPr> <p:grpSpPr> <a:xfrm> <a:off x=\"0\" y=\"0\"/> <a:ext cx=\"0\" cy=\"0\"/> <a:chOff x=\"0\" y=\"0\"/> <a:chExt cx=\"0\" cy=\"0\"/> </a:xfrm> </p:grpSpPr>" \ |
482 | "<p:nvGrpSpPr>\ |
483 | <p:cNvPr id=\"1\" name=\"\"/>\ |
484 | <p:cNvGrpSpPr/>\ |
485 | <p:nvPr/>\ |
486 | </p:nvGrpSpPr>\ |
487 | <p:grpSpPr>\ |
488 | <a:xfrm>\ |
489 | <a:off x=\"0\" y=\"0\"/>\ |
490 | <a:ext cx=\"0\" cy=\"0\"/>\ |
491 | <a:chOff x=\"0\" y=\"0\"/>\ |
492 | <a:chExt cx=\"0\" cy=\"0\"/>\ |
493 | </a:xfrm>\ |
494 | </p:grpSpPr>" |
495 | |
496 | const char* PowerPointExport::GetSideDirection(sal_uInt8 nDirection) |
497 | { |
498 | const char* pDirection = nullptr; |
499 | |
500 | switch (nDirection) |
501 | { |
502 | case 0: |
503 | pDirection = "l"; |
504 | break; |
505 | case 1: |
506 | pDirection = "u"; |
507 | break; |
508 | case 2: |
509 | pDirection = "r"; |
510 | break; |
511 | case 3: |
512 | pDirection = "d"; |
513 | break; |
514 | } |
515 | |
516 | return pDirection; |
517 | } |
518 | |
519 | const char* PowerPointExport::GetCornerDirection(sal_uInt8 nDirection) |
520 | { |
521 | const char* pDirection = nullptr; |
522 | |
523 | switch (nDirection) |
524 | { |
525 | case 4: |
526 | pDirection = "lu"; |
527 | break; |
528 | case 5: |
529 | pDirection = "ru"; |
530 | break; |
531 | case 6: |
532 | pDirection = "ld"; |
533 | break; |
534 | case 7: |
535 | pDirection = "rd"; |
536 | break; |
537 | } |
538 | |
539 | return pDirection; |
540 | } |
541 | |
542 | const char* PowerPointExport::Get8Direction(sal_uInt8 nDirection) |
543 | { |
544 | const char* pDirection = GetSideDirection(nDirection); |
545 | |
546 | if (!pDirection) |
547 | pDirection = GetCornerDirection(nDirection); |
548 | |
549 | return pDirection; |
550 | } |
551 | |
552 | void PowerPointExport::WriteTransition(const FSHelperPtr& pFS) |
553 | { |
554 | FadeEffect eFadeEffect = FadeEffect_NONE; |
555 | if (ImplGetPropertyValue(mXPagePropSet, "Effect")) |
556 | mAny >>= eFadeEffect; |
557 | |
558 | sal_Int16 nTransitionType = 0, nTransitionSubtype = 0; |
559 | sal_Int8 nPPTTransitionType = 0; |
560 | sal_uInt8 nDirection = 0; |
561 | |
562 | OUString sSoundUrl; |
563 | OUString sSoundRelId; |
564 | OUString sSoundName; |
565 | |
566 | if (ImplGetPropertyValue(mXPagePropSet, "TransitionType") && (mAny >>= nTransitionType) && |
567 | ImplGetPropertyValue(mXPagePropSet, "TransitionSubtype") && (mAny >>= nTransitionSubtype)) |
568 | { |
569 | // FADEOVERCOLOR with black -> fade, with white -> flash |
570 | sal_Int32 nTransitionFadeColor = 0; |
571 | if( ImplGetPropertyValue(mXPagePropSet, "TransitionFadeColor")) |
572 | mAny >>= nTransitionFadeColor; |
573 | nPPTTransitionType = GetTransition(nTransitionType, nTransitionSubtype, eFadeEffect, nTransitionFadeColor, nDirection); |
574 | } |
575 | |
576 | if (!nPPTTransitionType && eFadeEffect != FadeEffect_NONE) |
577 | nPPTTransitionType = GetTransition(eFadeEffect, nDirection); |
578 | |
579 | if (ImplGetPropertyValue(mXPagePropSet, "Sound") && (mAny >>= sSoundUrl)) |
580 | embedEffectAudio(pFS, sSoundUrl, sSoundRelId, sSoundName); |
581 | |
582 | bool bOOXmlSpecificTransition = false; |
583 | |
584 | sal_Int32 nTransition = 0; |
585 | const char* pDirection = nullptr; |
586 | const char* pOrientation = nullptr; |
587 | const char* pThruBlk = nullptr; |
588 | const char* pSpokes = nullptr; |
589 | |
590 | char pSpokesTmp[2] = "0"; |
591 | |
592 | // p14 |
593 | sal_Int32 nTransition14 = 0; |
594 | const char* pDirection14 = nullptr; |
595 | const char* pInverted = nullptr; |
596 | const char* pPattern = nullptr; // diamond or hexagon |
597 | |
598 | //p15 |
599 | const char* pPresetTransition = nullptr; |
600 | |
601 | if (!nPPTTransitionType) |
602 | { |
603 | switch (nTransitionType) |
604 | { |
605 | case animations::TransitionType::BARWIPE: |
606 | { |
607 | if (nTransitionSubtype == animations::TransitionSubType::FADEOVERCOLOR) |
608 | { |
609 | nTransition = XML_cut; |
610 | pThruBlk = "true"; |
611 | bOOXmlSpecificTransition = true; |
612 | } |
613 | break; |
614 | } |
615 | case animations::TransitionType::MISCSHAPEWIPE: |
616 | { |
617 | switch (nTransitionSubtype) |
618 | { |
619 | case animations::TransitionSubType::TOPTOBOTTOM: // Turn around |
620 | nTransition = XML_fade; |
621 | nTransition14 = XML_flip; |
622 | pDirection14 = "l"; |
623 | bOOXmlSpecificTransition = true; |
624 | break; |
625 | case animations::TransitionSubType::BOTTOMRIGHT: // Rochade |
626 | nTransition = XML_fade; |
627 | nTransition14 = XML_switch; |
628 | pDirection14 = "r"; |
629 | bOOXmlSpecificTransition = true; |
630 | break; |
631 | case animations::TransitionSubType::VERTICAL: // Vortex |
632 | nTransition = XML_fade; |
633 | nTransition14 = XML_vortex; |
634 | bOOXmlSpecificTransition = true; |
635 | break; |
636 | case animations::TransitionSubType::HORIZONTAL: // Ripple |
637 | nTransition = XML_fade; |
638 | nTransition14 = XML_ripple; |
639 | bOOXmlSpecificTransition = true; |
640 | break; |
641 | case animations::TransitionSubType::LEFTTORIGHT: // Fall |
642 | nTransition = XML_fade; |
643 | pPresetTransition = "fallOver"; |
644 | bOOXmlSpecificTransition = true; |
645 | break; |
646 | case animations::TransitionSubType::CORNERSIN: // Inside turning cube |
647 | pInverted = "true"; |
648 | [[fallthrough]]; |
649 | case animations::TransitionSubType::CORNERSOUT: // Outside turning cube |
650 | nTransition = XML_fade; |
651 | nTransition14 = XML_prism; |
652 | bOOXmlSpecificTransition = true; |
653 | break; |
654 | case animations::TransitionSubType::DIAMOND: // Glitter |
655 | nTransition = XML_fade; |
656 | nTransition14 = XML_glitter; |
657 | pDirection14 = "l"; |
658 | pPattern = "hexagon"; |
659 | bOOXmlSpecificTransition = true; |
660 | break; |
661 | case animations::TransitionSubType::HEART: // Honeycomb |
662 | nTransition = XML_fade; |
663 | nTransition14 = XML_honeycomb; |
664 | bOOXmlSpecificTransition = true; |
665 | break; |
666 | } |
667 | break; |
668 | } |
669 | } |
670 | } |
671 | |
672 | AnimationSpeed animationSpeed = AnimationSpeed_MEDIUM; |
673 | const char* speed = nullptr; |
674 | sal_Int32 advanceTiming = -1; |
675 | sal_Int32 changeType = 0; |
676 | |
677 | sal_Int32 nTransitionDuration = -1; |
678 | bool isTransitionDurationSet = false; |
679 | |
680 | // try to use TransitionDuration instead of old Speed property |
681 | if (ImplGetPropertyValue(mXPagePropSet, "TransitionDuration")) |
682 | { |
683 | double fTransitionDuration = -1.0; |
684 | mAny >>= fTransitionDuration; |
685 | if (fTransitionDuration >= 0) |
686 | { |
687 | nTransitionDuration = fTransitionDuration * 1000.0; |
688 | |
689 | // override values because in MS formats meaning of fast/medium/slow is different |
690 | if (nTransitionDuration <= 500) |
691 | { |
692 | // fast is default |
693 | speed = nullptr; |
694 | } |
695 | else if (nTransitionDuration >= 1000) |
696 | { |
697 | speed = "slow"; |
698 | } |
699 | else |
700 | { |
701 | speed = "med"; |
702 | } |
703 | |
704 | bool isStandardValue = nTransitionDuration == 500 |
705 | || nTransitionDuration == 750 |
706 | || nTransitionDuration == 1000; |
707 | |
708 | if(!isStandardValue) |
709 | isTransitionDurationSet = true; |
710 | } |
711 | } |
712 | else if (ImplGetPropertyValue(mXPagePropSet, "Speed")) |
713 | { |
714 | mAny >>= animationSpeed; |
715 | |
716 | switch (animationSpeed) |
717 | { |
718 | default: |
719 | case AnimationSpeed_MEDIUM: |
720 | speed = "med"; |
721 | break; |
722 | case AnimationSpeed_SLOW: |
723 | speed = "slow"; |
724 | break; |
725 | case AnimationSpeed_FAST: |
726 | break; |
727 | } |
728 | } |
729 | |
730 | // check if we resolved what transition to export or time is set |
731 | if (!nPPTTransitionType && !bOOXmlSpecificTransition && !isTransitionDurationSet) |
732 | return; |
733 | |
734 | if (ImplGetPropertyValue(mXPagePropSet, "Change")) |
735 | mAny >>= changeType; |
736 | |
737 | // 1 means automatic, 2 half automatic - not sure what it means - at least I don't see it in UI |
738 | if (changeType == 1 && ImplGetPropertyValue(mXPagePropSet, "Duration")) |
739 | mAny >>= advanceTiming; |
740 | |
741 | if (!bOOXmlSpecificTransition) |
742 | { |
743 | switch (nPPTTransitionType) |
744 | { |
745 | case PPT_TRANSITION_TYPE_BLINDS2: |
746 | nTransition = XML_blinds; |
747 | pDirection = (nDirection == 0) ? "vert" : "horz"; |
748 | break; |
749 | case PPT_TRANSITION_TYPE_CHECKER3: |
750 | nTransition = XML_checker; |
751 | pDirection = (nDirection == 1) ? "vert" : "horz"; |
752 | break; |
753 | case PPT_TRANSITION_TYPE_CIRCLE27: |
754 | nTransition = XML_circle; |
755 | break; |
756 | case PPT_TRANSITION_TYPE_COMB21: |
757 | nTransition = XML_comb; |
758 | pDirection = (nDirection == 1) ? "vert" : "horz"; |
759 | break; |
760 | case PPT_TRANSITION_TYPE_COVER4: |
761 | nTransition = XML_cover; |
762 | pDirection = Get8Direction(nDirection); |
763 | break; |
764 | case PPT_TRANSITION_TYPE_DIAMOND17: |
765 | nTransition = XML_diamond; |
766 | break; |
767 | case PPT_TRANSITION_TYPE_DISSOLVE5: |
768 | nTransition = XML_dissolve; |
769 | break; |
770 | case PPT_TRANSITION_TYPE_FADE6: |
771 | nTransition = XML_fade; |
772 | pThruBlk = "true"; |
773 | break; |
774 | case PPT_TRANSITION_TYPE_SMOOTHFADE23: |
775 | nTransition = XML_fade; |
776 | break; |
777 | case PPT_TRANSITION_TYPE_NEWSFLASH22: |
778 | nTransition = XML_newsflash; |
779 | break; |
780 | case PPT_TRANSITION_TYPE_PLUS18: |
781 | nTransition = XML_plus; |
782 | break; |
783 | case PPT_TRANSITION_TYPE_PULL7: |
784 | nTransition = XML_pull; |
785 | pDirection = Get8Direction(nDirection); |
786 | break; |
787 | case PPT_TRANSITION_TYPE_PUSH20: |
788 | nTransition = XML_push; |
789 | pDirection = GetSideDirection(nDirection); |
790 | break; |
791 | case PPT_TRANSITION_TYPE_RANDOM1: |
792 | nTransition = XML_random; |
793 | break; |
794 | case PPT_TRANSITION_TYPE_RANDOM_BARS8: |
795 | nTransition = XML_randomBar; |
796 | pDirection = (nDirection == 1) ? "vert" : "horz"; |
797 | break; |
798 | case PPT_TRANSITION_TYPE_SPLIT13: |
799 | nTransition = XML_split; |
800 | pDirection = (nDirection & 1) ? "in" : "out"; |
801 | pOrientation = (nDirection < 2) ? "horz" : "vert"; |
802 | break; |
803 | case PPT_TRANSITION_TYPE_STRIPS9: |
804 | nTransition = XML_strips; |
805 | pDirection = GetCornerDirection(nDirection); |
806 | break; |
807 | case PPT_TRANSITION_TYPE_WEDGE19: |
808 | nTransition = XML_wedge; |
809 | break; |
810 | case PPT_TRANSITION_TYPE_WHEEL26: |
811 | nTransition = XML_wheel; |
812 | if (nDirection != 4 && nDirection <= 9) |
813 | { |
814 | pSpokesTmp[0] = '0' + nDirection; |
815 | pSpokes = pSpokesTmp; |
816 | } |
817 | break; |
818 | case PPT_TRANSITION_TYPE_WIPE10: |
819 | nTransition = XML_wipe; |
820 | pDirection = GetSideDirection(nDirection); |
821 | break; |
822 | case PPT_TRANSITION_TYPE_ZOOM11: |
823 | nTransition = XML_zoom; |
824 | pDirection = (nDirection == 1) ? "in" : "out"; |
825 | break; |
826 | case PPT_TRANSITION_TYPE_FLASH30: |
827 | nTransition14 = XML_flash; |
828 | nTransition = XML_fade; |
829 | bOOXmlSpecificTransition = true; |
Value stored to 'bOOXmlSpecificTransition' is never read | |
830 | break; |
831 | // coverity[dead_error_line] - following conditions exist to avoid compiler warning |
832 | case PPT_TRANSITION_TYPE_NONE0: |
833 | default: |
834 | nTransition = 0; |
835 | break; |
836 | } |
837 | } |
838 | |
839 | bool isAdvanceTimingSet = advanceTiming != -1; |
840 | if (nTransition14 || pPresetTransition || isTransitionDurationSet) |
841 | { |
842 | const char* pRequiresNS = (nTransition14 || isTransitionDurationSet) ? "p14" : "p15"; |
843 | |
844 | pFS->startElement(FSNS(XML_mc, XML_AlternateContent)); |
845 | pFS->startElement(FSNS(XML_mc, XML_Choice), XML_Requires, pRequiresNS); |
846 | |
847 | if(isTransitionDurationSet && isAdvanceTimingSet) |
848 | { |
849 | pFS->startElementNS(XML_p, XML_transition, |
850 | XML_spd, speed, |
851 | XML_advTm, OString::number(advanceTiming * 1000), |
852 | FSNS(XML_p14, XML_dur), OString::number(nTransitionDuration)); |
853 | } |
854 | else if(isTransitionDurationSet) |
855 | { |
856 | pFS->startElementNS(XML_p, XML_transition, |
857 | XML_spd, speed, |
858 | FSNS(XML_p14, XML_dur), OString::number(nTransitionDuration)); |
859 | } |
860 | else if(isAdvanceTimingSet) |
861 | { |
862 | pFS->startElementNS(XML_p, XML_transition, |
863 | XML_spd, speed, |
864 | XML_advTm, OString::number(advanceTiming * 1000)); |
865 | } |
866 | else |
867 | { |
868 | pFS->startElementNS(XML_p, XML_transition, XML_spd, speed); |
869 | } |
870 | |
871 | if (nTransition14) |
872 | { |
873 | pFS->singleElementNS(XML_p14, nTransition14, |
874 | XML_isInverted, pInverted, |
875 | XML_dir, pDirection14, |
876 | XML_pattern, pPattern); |
877 | } |
878 | else if (pPresetTransition) |
879 | { |
880 | pFS->singleElementNS(XML_p15, XML_prstTrans, |
881 | XML_prst, pPresetTransition); |
882 | } |
883 | else if (isTransitionDurationSet && nTransition) |
884 | { |
885 | pFS->singleElementNS(XML_p, nTransition, |
886 | XML_dir, pDirection, |
887 | XML_orient, pOrientation, |
888 | XML_spokes, pSpokes, |
889 | XML_thruBlk, pThruBlk); |
890 | } |
891 | |
892 | if (!sSoundRelId.isEmpty()) |
893 | WriteSndAc(pFS, sSoundRelId, sSoundName); |
894 | |
895 | pFS->endElement(FSNS(XML_p, XML_transition)); |
896 | |
897 | pFS->endElement(FSNS(XML_mc, XML_Choice)); |
898 | pFS->startElement(FSNS(XML_mc, XML_Fallback)); |
899 | } |
900 | |
901 | pFS->startElementNS(XML_p, XML_transition, |
902 | XML_spd, speed, |
903 | XML_advTm, sax_fastparser::UseIf(OString::number(advanceTiming * 1000), isAdvanceTimingSet)); |
904 | |
905 | if (nTransition) |
906 | { |
907 | pFS->singleElementNS(XML_p, nTransition, |
908 | XML_dir, pDirection, |
909 | XML_orient, pOrientation, |
910 | XML_spokes, pSpokes, |
911 | XML_thruBlk, pThruBlk); |
912 | } |
913 | |
914 | if (!sSoundRelId.isEmpty()) |
915 | WriteSndAc(pFS, sSoundRelId, sSoundName); |
916 | |
917 | pFS->endElementNS(XML_p, XML_transition); |
918 | |
919 | if (nTransition14 || pPresetTransition || isTransitionDurationSet) |
920 | { |
921 | pFS->endElement(FSNS(XML_mc, XML_Fallback)); |
922 | pFS->endElement(FSNS(XML_mc, XML_AlternateContent)); |
923 | } |
924 | } |
925 | |
926 | static OUString lcl_GetInitials(const OUString& sName) |
927 | { |
928 | OUStringBuffer sRet; |
929 | |
930 | if (!sName.isEmpty()) |
931 | { |
932 | sRet.append(sName[0]); |
933 | sal_Int32 nStart = 0, nOffset; |
934 | |
935 | while ((nOffset = sName.indexOf(' ', nStart)) != -1) |
936 | { |
937 | if (nOffset + 1 < sName.getLength()) |
938 | sRet.append(sName[ nOffset + 1 ]); |
939 | nStart = nOffset + 1; |
940 | } |
941 | } |
942 | |
943 | return sRet.makeStringAndClear(); |
944 | } |
945 | |
946 | void PowerPointExport::WriteAuthors() |
947 | { |
948 | if (maAuthors.empty()) |
949 | return; |
950 | |
951 | FSHelperPtr pFS = openFragmentStreamWithSerializer("ppt/commentAuthors.xml", |
952 | "application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml"); |
953 | addRelation(mPresentationFS->getOutputStream(), |
954 | oox::getRelationship(Relationship::COMMENTAUTHORS), |
955 | "commentAuthors.xml"); |
956 | |
957 | pFS->startElementNS(XML_p, XML_cmAuthorLst, |
958 | FSNS(XML_xmlns, XML_p), getNamespaceURL(OOX_NS(ppt)(::oox::NMSP_ppt))); |
959 | |
960 | for (const AuthorsMap::value_type& i : maAuthors) |
961 | { |
962 | pFS->singleElementNS(XML_p, XML_cmAuthor, |
963 | XML_id, OString::number(i.second.nId), |
964 | XML_name, i.first, |
965 | XML_initials, lcl_GetInitials(i.first), |
966 | XML_lastIdx, OString::number(i.second.nLastIndex), |
967 | XML_clrIdx, OString::number(i.second.nId)); |
968 | } |
969 | |
970 | pFS->endElementNS(XML_p, XML_cmAuthorLst); |
971 | } |
972 | |
973 | sal_Int32 PowerPointExport::GetAuthorIdAndLastIndex(const OUString& sAuthor, sal_Int32& nLastIndex) |
974 | { |
975 | if (maAuthors.count(sAuthor) <= 0) |
976 | { |
977 | struct AuthorComments aAuthorComments; |
978 | |
979 | aAuthorComments.nId = maAuthors.size(); |
980 | aAuthorComments.nLastIndex = 0; |
981 | |
982 | maAuthors[ sAuthor ] = aAuthorComments; |
983 | } |
984 | |
985 | nLastIndex = ++maAuthors[ sAuthor ].nLastIndex; |
986 | |
987 | return maAuthors[ sAuthor ].nId; |
988 | } |
989 | |
990 | bool PowerPointExport::WriteComments(sal_uInt32 nPageNum) |
991 | { |
992 | Reference< XAnnotationAccess > xAnnotationAccess(mXDrawPage, uno::UNO_QUERY); |
993 | if (xAnnotationAccess.is()) |
994 | { |
995 | Reference< XAnnotationEnumeration > xAnnotationEnumeration(xAnnotationAccess->createAnnotationEnumeration()); |
996 | |
997 | if (xAnnotationEnumeration->hasMoreElements()) |
998 | { |
999 | FSHelperPtr pFS = openFragmentStreamWithSerializer(OUStringBuffer() |
1000 | .append("ppt/comments/comment") |
1001 | .append(static_cast<sal_Int32>(nPageNum) + 1) |
1002 | .append(".xml") |
1003 | .makeStringAndClear(), |
1004 | "application/vnd.openxmlformats-officedocument.presentationml.comments+xml"); |
1005 | |
1006 | pFS->startElementNS(XML_p, XML_cmLst, |
1007 | FSNS(XML_xmlns, XML_p), this->getNamespaceURL(OOX_NS(ppt)(::oox::NMSP_ppt))); |
1008 | |
1009 | do |
1010 | { |
1011 | Reference< XAnnotation > xAnnotation(xAnnotationEnumeration->nextElement()); |
1012 | DateTime aDateTime(xAnnotation->getDateTime()); |
1013 | RealPoint2D aRealPoint2D(xAnnotation->getPosition()); |
1014 | Reference< XText > xText(xAnnotation->getTextRange()); |
1015 | sal_Int32 nLastIndex; |
1016 | sal_Int32 nId = GetAuthorIdAndLastIndex(xAnnotation->getAuthor(), nLastIndex); |
1017 | char cDateTime[sizeof("-32768-65535-65535T65535:65535:65535.4294967295")]; |
1018 | // reserve enough space for hypothetical max length |
1019 | |
1020 | snprintf(cDateTime, sizeof cDateTime, "%02" SAL_PRIdINT32"d" "-%02" SAL_PRIuUINT32"u" "-%02" SAL_PRIuUINT32"u" "T%02" SAL_PRIuUINT32"u" ":%02" SAL_PRIuUINT32"u" ":%02" SAL_PRIuUINT32"u" ".%09" SAL_PRIuUINT32"u", 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); |
1021 | |
1022 | pFS->startElementNS(XML_p, XML_cm, |
1023 | XML_authorId, OString::number(nId), |
1024 | XML_dt, cDateTime, |
1025 | XML_idx, OString::number(nLastIndex)); |
1026 | |
1027 | pFS->singleElementNS(XML_p, XML_pos, |
1028 | XML_x, OString::number(static_cast<sal_Int64>((57600*aRealPoint2D.X + 1270)/2540.0)), |
1029 | XML_y, OString::number(static_cast<sal_Int64>((57600*aRealPoint2D.Y + 1270)/2540.0))); |
1030 | |
1031 | pFS->startElementNS(XML_p, XML_text); |
1032 | pFS->write(xText->getString()); |
1033 | pFS->endElementNS(XML_p, XML_text); |
1034 | |
1035 | pFS->endElementNS(XML_p, XML_cm); |
1036 | |
1037 | } |
1038 | while (xAnnotationEnumeration->hasMoreElements()); |
1039 | |
1040 | pFS->endElementNS(XML_p, XML_cmLst); |
1041 | |
1042 | return true; |
1043 | } |
1044 | } |
1045 | |
1046 | return false; |
1047 | } |
1048 | |
1049 | void PowerPointExport::WriteVBA() |
1050 | { |
1051 | if (!mbPptm) |
1052 | return; |
1053 | |
1054 | uno::Reference<document::XStorageBasedDocument> xStorageBasedDocument(getModel(), uno::UNO_QUERY); |
1055 | if (!xStorageBasedDocument.is()) |
1056 | return; |
1057 | |
1058 | uno::Reference<embed::XStorage> xDocumentStorage = xStorageBasedDocument->getDocumentStorage(); |
1059 | OUString aMacrosName("_MS_VBA_Macros"); |
1060 | if (!xDocumentStorage.is() || !xDocumentStorage->hasByName(aMacrosName)) |
1061 | return; |
1062 | |
1063 | const sal_Int32 nOpenMode = embed::ElementModes::READ; |
1064 | uno::Reference<io::XInputStream> xMacrosStream(xDocumentStorage->openStreamElement(aMacrosName, nOpenMode), uno::UNO_QUERY); |
1065 | if (!xMacrosStream.is()) |
1066 | return; |
1067 | |
1068 | uno::Reference<io::XOutputStream> xOutputStream = openFragmentStream("ppt/vbaProject.bin", "application/vnd.ms-office.vbaProject"); |
1069 | comphelper::OStorageHelper::CopyInputToOutput(xMacrosStream, xOutputStream); |
1070 | |
1071 | // Write the relationship. |
1072 | addRelation(mPresentationFS->getOutputStream(), oox::getRelationship(Relationship::VBAPROJECT), "vbaProject.bin"); |
1073 | } |
1074 | |
1075 | void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum, sal_uInt16 /* nMode */, |
1076 | bool bHasBackground, Reference< XPropertySet > const& aXBackgroundPropSet) |
1077 | { |
1078 | SAL_INFO("sd.eppt", "write slide: " << nPageNum << "\n----------------")do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "write slide: " << nPageNum << "\n----------------") == 1) { ::sal_detail_log ( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1078" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "write slide: " << nPageNum << "\n----------------"), 0); } else { ::std::ostringstream sal_detail_stream ; sal_detail_stream << "write slide: " << nPageNum << "\n----------------"; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1078" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "write slide: " << nPageNum << "\n----------------" ) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt" ), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1078" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "write slide: " << nPageNum << "\n----------------"), 0); } else { ::std::ostringstream sal_detail_stream ; sal_detail_stream << "write slide: " << nPageNum << "\n----------------"; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1078" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
1079 | |
1080 | // slides list |
1081 | if (nPageNum == 0) |
1082 | mPresentationFS->startElementNS(XML_p, XML_sldIdLst); |
1083 | |
1084 | // add explicit relation of presentation to this slide |
1085 | OUString sRelId = addRelation(mPresentationFS->getOutputStream(), |
1086 | oox::getRelationship(Relationship::SLIDE), |
1087 | OUStringBuffer() |
1088 | .append("slides/slide") |
1089 | .append(static_cast<sal_Int32>(nPageNum) + 1) |
1090 | .append(".xml") |
1091 | .makeStringAndClear()); |
1092 | |
1093 | mPresentationFS->singleElementNS(XML_p, XML_sldId, |
1094 | XML_id, OString::number(GetNewSlideId()), |
1095 | FSNS(XML_r, XML_id), sRelId); |
1096 | |
1097 | if (nPageNum == mnPages - 1) |
1098 | mPresentationFS->endElementNS(XML_p, XML_sldIdLst); |
1099 | |
1100 | FSHelperPtr pFS = openFragmentStreamWithSerializer(OUStringBuffer() |
1101 | .append("ppt/slides/slide") |
1102 | .append(static_cast<sal_Int32>(nPageNum) + 1) |
1103 | .append(".xml") |
1104 | .makeStringAndClear(), |
1105 | "application/vnd.openxmlformats-officedocument.presentationml.slide+xml"); |
1106 | |
1107 | if (mpSlidesFSArray.size() < mnPages) |
1108 | mpSlidesFSArray.resize(mnPages); |
1109 | mpSlidesFSArray[ nPageNum ] = pFS; |
1110 | |
1111 | const char* pShow = nullptr; |
1112 | |
1113 | if (ImplGetPropertyValue(mXPagePropSet, "Visible")) |
1114 | { |
1115 | bool bShow(false); |
1116 | if ((mAny >>= bShow) && !bShow) |
1117 | pShow = "0"; |
1118 | } |
1119 | |
1120 | pFS->startElementNS(XML_p, XML_sld, PNMSSFSNS(XML_xmlns, XML_a), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_dml)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_p), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_ppt)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_r), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_officeRel)), (((rtl_TextEncoding) 76))).getStr( ), FSNS(XML_xmlns, XML_p14), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_p14)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_p15), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_p15)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_mc), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_mce)), (((rtl_TextEncoding) 76))).getStr(), XML_show, pShow); |
1121 | |
1122 | pFS->startElementNS(XML_p, XML_cSld); |
1123 | |
1124 | // background |
1125 | if (bHasBackground) |
1126 | { |
1127 | ImplWriteBackground(pFS, aXBackgroundPropSet); |
1128 | } |
1129 | |
1130 | WriteShapeTree(pFS, NORMAL, false); |
1131 | |
1132 | pFS->endElementNS(XML_p, XML_cSld); |
1133 | |
1134 | WriteTransition(pFS); |
1135 | WriteAnimations(pFS, mXDrawPage, *this); |
1136 | |
1137 | pFS->endElementNS(XML_p, XML_sld); |
1138 | |
1139 | // add implicit relation to slide layout |
1140 | addRelation(pFS->getOutputStream(), |
1141 | oox::getRelationship(Relationship::SLIDELAYOUT), |
1142 | OUStringBuffer() |
1143 | .append("../slideLayouts/slideLayout") |
1144 | .append(GetLayoutFileId(GetPPTXLayoutId(GetLayoutOffset(mXPagePropSet)), nMasterNum)) |
1145 | .append(".xml") |
1146 | .makeStringAndClear()); |
1147 | |
1148 | if (WriteComments(nPageNum)) |
1149 | // add implicit relation to slide comments |
1150 | addRelation(pFS->getOutputStream(), |
1151 | oox::getRelationship(Relationship::COMMENTS), |
1152 | OUStringBuffer() |
1153 | .append("../comments/comment") |
1154 | .append(static_cast<sal_Int32>(nPageNum) + 1) |
1155 | .append(".xml") |
1156 | .makeStringAndClear()); |
1157 | |
1158 | SAL_INFO("sd.eppt", "----------------")do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "----------------") == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt" ), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1158" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "----------------"), 0); } else { :: std::ostringstream sal_detail_stream; sal_detail_stream << "----------------"; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1158" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "----------------") == 1) { ::sal_detail_log( (:: SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1158" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "----------------"), 0); } else { :: std::ostringstream sal_detail_stream; sal_detail_stream << "----------------"; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1158" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
1159 | } |
1160 | |
1161 | void PowerPointExport::ImplWriteNotes(sal_uInt32 nPageNum) |
1162 | { |
1163 | if (!mbCreateNotes || !ContainsOtherShapeThanPlaceholders()) |
1164 | return; |
1165 | |
1166 | SAL_INFO("sd.eppt", "write Notes " << nPageNum << "\n----------------")do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "write Notes " << nPageNum << "\n----------------") == 1) { ::sal_detail_log ( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1166" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "write Notes " << nPageNum << "\n----------------"), 0); } else { ::std::ostringstream sal_detail_stream ; sal_detail_stream << "write Notes " << nPageNum << "\n----------------"; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1166" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "write Notes " << nPageNum << "\n----------------" ) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt" ), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1166" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "write Notes " << nPageNum << "\n----------------"), 0); } else { ::std::ostringstream sal_detail_stream ; sal_detail_stream << "write Notes " << nPageNum << "\n----------------"; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1166" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
1167 | |
1168 | FSHelperPtr pFS = openFragmentStreamWithSerializer(OUStringBuffer() |
1169 | .append("ppt/notesSlides/notesSlide") |
1170 | .append(static_cast<sal_Int32>(nPageNum) + 1) |
1171 | .append(".xml") |
1172 | .makeStringAndClear(), |
1173 | "application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml"); |
1174 | |
1175 | pFS->startElementNS(XML_p, XML_notes, PNMSSFSNS(XML_xmlns, XML_a), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_dml)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_p), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_ppt)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_r), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_officeRel)), (((rtl_TextEncoding) 76))).getStr( ), FSNS(XML_xmlns, XML_p14), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_p14)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_p15), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_p15)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_mc), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_mce)), (((rtl_TextEncoding) 76))).getStr()); |
1176 | |
1177 | pFS->startElementNS(XML_p, XML_cSld); |
1178 | |
1179 | WriteShapeTree(pFS, NOTICE, false); |
1180 | |
1181 | pFS->endElementNS(XML_p, XML_cSld); |
1182 | |
1183 | pFS->endElementNS(XML_p, XML_notes); |
1184 | |
1185 | // add implicit relation to slide |
1186 | addRelation(pFS->getOutputStream(), |
1187 | oox::getRelationship(Relationship::SLIDE), |
1188 | OUStringBuffer() |
1189 | .append("../slides/slide") |
1190 | .append(static_cast<sal_Int32>(nPageNum) + 1) |
1191 | .append(".xml") |
1192 | .makeStringAndClear()); |
1193 | |
1194 | // add slide implicit relation to notes |
1195 | if (nPageNum < mpSlidesFSArray.size()) |
1196 | addRelation(mpSlidesFSArray[ nPageNum ]->getOutputStream(), |
1197 | oox::getRelationship(Relationship::NOTESSLIDE), |
1198 | OUStringBuffer() |
1199 | .append("../notesSlides/notesSlide") |
1200 | .append(static_cast<sal_Int32>(nPageNum) + 1) |
1201 | .append(".xml") |
1202 | .makeStringAndClear()); |
1203 | |
1204 | // add implicit relation to notes master |
1205 | addRelation(pFS->getOutputStream(), |
1206 | oox::getRelationship(Relationship::NOTESMASTER), |
1207 | "../notesMasters/notesMaster1.xml"); |
1208 | |
1209 | SAL_INFO("sd.eppt", "-----------------")do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "-----------------") == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt" ), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1209" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "-----------------"), 0); } else { :: std::ostringstream sal_detail_stream; sal_detail_stream << "-----------------"; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1209" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "-----------------") == 1) { ::sal_detail_log( (:: SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1209" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "-----------------"), 0); } else { :: std::ostringstream sal_detail_stream; sal_detail_stream << "-----------------"; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1209" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
1210 | } |
1211 | |
1212 | void PowerPointExport::AddLayoutIdAndRelation(const FSHelperPtr& pFS, sal_Int32 nLayoutFileId) |
1213 | { |
1214 | // add implicit relation of slide master to slide layout |
1215 | OUString sRelId = addRelation(pFS->getOutputStream(), |
1216 | oox::getRelationship(Relationship::SLIDELAYOUT), |
1217 | OUStringBuffer() |
1218 | .append("../slideLayouts/slideLayout") |
1219 | .append(nLayoutFileId) |
1220 | .append(".xml") |
1221 | .makeStringAndClear()); |
1222 | |
1223 | pFS->singleElementNS(XML_p, XML_sldLayoutId, |
1224 | XML_id, OString::number(GetNewSlideMasterId()), |
1225 | FSNS(XML_r, XML_id), sRelId); |
1226 | } |
1227 | |
1228 | void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 nPageNum, Reference< XPropertySet > const& aXBackgroundPropSet) |
1229 | { |
1230 | SAL_INFO("sd.eppt", "write master slide: " << nPageNum << "\n--------------")do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "write master slide: " << nPageNum << "\n--------------") == 1) { ::sal_detail_log ( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1230" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "write master slide: " << nPageNum << "\n--------------"), 0); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << "write master slide: " << nPageNum << "\n--------------"; ::sal::detail ::log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1230" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "write master slide: " << nPageNum << "\n--------------") == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1230" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "write master slide: " << nPageNum << "\n--------------"), 0); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << "write master slide: " << nPageNum << "\n--------------"; ::sal::detail ::log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1230" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
1231 | |
1232 | // slides list |
1233 | if (nPageNum == 0) |
1234 | mPresentationFS->startElementNS(XML_p, XML_sldMasterIdLst); |
1235 | |
1236 | OUString sRelId = addRelation(mPresentationFS->getOutputStream(), |
1237 | oox::getRelationship(Relationship::SLIDEMASTER), |
1238 | OUStringBuffer() |
1239 | .append("slideMasters/slideMaster") |
1240 | .append(static_cast<sal_Int32>(nPageNum) + 1) |
1241 | .append(".xml") |
1242 | .makeStringAndClear()); |
1243 | |
1244 | mPresentationFS->singleElementNS(XML_p, XML_sldMasterId, |
1245 | XML_id, OString::number(GetNewSlideMasterId()), |
1246 | FSNS(XML_r, XML_id), sRelId); |
1247 | |
1248 | if (nPageNum == mnMasterPages - 1) |
1249 | mPresentationFS->endElementNS(XML_p, XML_sldMasterIdLst); |
1250 | |
1251 | FSHelperPtr pFS = |
1252 | openFragmentStreamWithSerializer(OUStringBuffer() |
1253 | .append("ppt/slideMasters/slideMaster") |
1254 | .append(static_cast<sal_Int32>(nPageNum) + 1) |
1255 | .append(".xml") |
1256 | .makeStringAndClear(), |
1257 | "application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml"); |
1258 | |
1259 | // write theme per master |
1260 | WriteTheme(nPageNum); |
1261 | |
1262 | // add implicit relation to the presentation theme |
1263 | addRelation(pFS->getOutputStream(), |
1264 | oox::getRelationship(Relationship::THEME), |
1265 | OUStringBuffer() |
1266 | .append("../theme/theme") |
1267 | .append(static_cast<sal_Int32>(nPageNum) + 1) |
1268 | .append(".xml") |
1269 | .makeStringAndClear()); |
1270 | |
1271 | pFS->startElementNS(XML_p, XML_sldMaster, PNMSSFSNS(XML_xmlns, XML_a), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_dml)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_p), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_ppt)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_r), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_officeRel)), (((rtl_TextEncoding) 76))).getStr( ), FSNS(XML_xmlns, XML_p14), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_p14)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_p15), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_p15)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_mc), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_mce)), (((rtl_TextEncoding) 76))).getStr()); |
1272 | |
1273 | pFS->startElementNS(XML_p, XML_cSld); |
1274 | |
1275 | if (aXBackgroundPropSet) |
1276 | ImplWriteBackground(pFS, aXBackgroundPropSet); |
1277 | WriteShapeTree(pFS, MASTER, true); |
1278 | |
1279 | pFS->endElementNS(XML_p, XML_cSld); |
1280 | |
1281 | // color map - now it uses colors from hardcoded theme, once we eventually generate theme, this might need update |
1282 | pFS->singleElementNS(XML_p, XML_clrMap, |
1283 | XML_bg1, "lt1", |
1284 | XML_bg2, "lt2", |
1285 | XML_tx1, "dk1", |
1286 | XML_tx2, "dk2", |
1287 | XML_accent1, "accent1", |
1288 | XML_accent2, "accent2", |
1289 | XML_accent3, "accent3", |
1290 | XML_accent4, "accent4", |
1291 | XML_accent5, "accent5", |
1292 | XML_accent6, "accent6", |
1293 | XML_hlink, "hlink", |
1294 | XML_folHlink, "folHlink"); |
1295 | |
1296 | // use master's id type as they have same range, mso does that as well |
1297 | pFS->startElementNS(XML_p, XML_sldLayoutIdLst); |
1298 | |
1299 | for (int i = 0; i < LAYOUT_SIZE; i++) |
1300 | { |
1301 | sal_Int32 nLayoutFileId = GetLayoutFileId(i, nPageNum); |
1302 | if (nLayoutFileId > 0) |
1303 | { |
1304 | AddLayoutIdAndRelation(pFS, nLayoutFileId); |
1305 | } |
1306 | else |
1307 | { |
1308 | ImplWritePPTXLayout(i, nPageNum); |
1309 | AddLayoutIdAndRelation(pFS, GetLayoutFileId(i, nPageNum)); |
1310 | } |
1311 | } |
1312 | |
1313 | pFS->endElementNS(XML_p, XML_sldLayoutIdLst); |
1314 | |
1315 | pFS->endElementNS(XML_p, XML_sldMaster); |
1316 | |
1317 | SAL_INFO("sd.eppt", "----------------")do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "----------------") == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt" ), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1317" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "----------------"), 0); } else { :: std::ostringstream sal_detail_stream; sal_detail_stream << "----------------"; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1317" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "----------------") == 1) { ::sal_detail_log( (:: SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1317" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "----------------"), 0); } else { :: std::ostringstream sal_detail_stream; sal_detail_stream << "----------------"; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1317" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
1318 | } |
1319 | |
1320 | sal_Int32 PowerPointExport::GetLayoutFileId(sal_Int32 nOffset, sal_uInt32 nMasterNum) |
1321 | { |
1322 | SAL_INFO("sd.eppt", "GetLayoutFileId offset: " << nOffset << " master: " << nMasterNum)do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "GetLayoutFileId offset: " << nOffset << " master: " << nMasterNum) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt" ), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1322" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "GetLayoutFileId offset: " << nOffset << " master: " << nMasterNum), 0); } else { ::std ::ostringstream sal_detail_stream; sal_detail_stream << "GetLayoutFileId offset: " << nOffset << " master: " << nMasterNum; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1322" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "GetLayoutFileId offset: " << nOffset << " master: " << nMasterNum) == 1) { ::sal_detail_log( ( ::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1322" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "GetLayoutFileId offset: " << nOffset << " master: " << nMasterNum), 0); } else { ::std ::ostringstream sal_detail_stream; sal_detail_stream << "GetLayoutFileId offset: " << nOffset << " master: " << nMasterNum; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1322" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
1323 | if (mLayoutInfo[ nOffset ].mnFileIdArray.size() <= nMasterNum) |
1324 | return 0; |
1325 | |
1326 | return mLayoutInfo[ nOffset ].mnFileIdArray[ nMasterNum ]; |
1327 | } |
1328 | |
1329 | void PowerPointExport::ImplWritePPTXLayout(sal_Int32 nOffset, sal_uInt32 nMasterNum) |
1330 | { |
1331 | SAL_INFO("sd.eppt", "write layout: " << nOffset)do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "write layout: " << nOffset) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1331" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "write layout: " << nOffset), 0 ); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << "write layout: " << nOffset; ::sal::detail::log ( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1331" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "write layout: " << nOffset) == 1) { ::sal_detail_log ( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1331" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "write layout: " << nOffset), 0 ); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << "write layout: " << nOffset; ::sal::detail::log ( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1331" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
1332 | |
1333 | Reference< drawing::XDrawPagesSupplier > xDPS(getModel(), uno::UNO_QUERY); |
1334 | Reference< drawing::XDrawPages > xDrawPages = xDPS->getDrawPages(); |
1335 | Reference< drawing::XDrawPage > xSlide = xDrawPages->insertNewByIndex(xDrawPages->getCount()); |
1336 | |
1337 | #ifdef DEBUG |
1338 | if (xSlide.is()) |
1339 | printf("new page created\n"); |
1340 | #endif |
1341 | |
1342 | Reference< beans::XPropertySet > xPropSet(xSlide, uno::UNO_QUERY); |
1343 | xPropSet->setPropertyValue("Layout", makeAny(short(aLayoutInfo[ nOffset ].nType))); |
1344 | #if OSL_DEBUG_LEVEL1 > 1 |
1345 | dump_pset(xPropSet); |
1346 | #endif |
1347 | mXPagePropSet.set(xSlide, UNO_QUERY); |
1348 | mXShapes = xSlide; |
1349 | |
1350 | if (mLayoutInfo[ nOffset ].mnFileIdArray.size() < mnMasterPages) |
1351 | { |
1352 | mLayoutInfo[ nOffset ].mnFileIdArray.resize(mnMasterPages); |
1353 | } |
1354 | |
1355 | if (mLayoutInfo[ nOffset ].mnFileIdArray[ nMasterNum ] != 0) |
1356 | return; |
1357 | |
1358 | FSHelperPtr pFS |
1359 | = openFragmentStreamWithSerializer(OUStringBuffer() |
1360 | .append("ppt/slideLayouts/slideLayout") |
1361 | .append(mnLayoutFileIdMax) |
1362 | .append(".xml") |
1363 | .makeStringAndClear(), |
1364 | "application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"); |
1365 | |
1366 | // add implicit relation of slide layout to slide master |
1367 | addRelation(pFS->getOutputStream(), |
1368 | oox::getRelationship(Relationship::SLIDEMASTER), |
1369 | OUStringBuffer() |
1370 | .append("../slideMasters/slideMaster") |
1371 | .append(static_cast<sal_Int32>(nMasterNum) + 1) |
1372 | .append(".xml") |
1373 | .makeStringAndClear()); |
1374 | |
1375 | pFS->startElementNS(XML_p, XML_sldLayout, |
1376 | PNMSSFSNS(XML_xmlns, XML_a), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_dml)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_p), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_ppt)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_r), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_officeRel)), (((rtl_TextEncoding) 76))).getStr( ), FSNS(XML_xmlns, XML_p14), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_p14)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_p15), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_p15)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_mc), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_mce)), (((rtl_TextEncoding) 76))).getStr(), |
1377 | XML_type, aLayoutInfo[ nOffset ].sType, |
1378 | XML_preserve, "1"); |
1379 | |
1380 | pFS->startElementNS(XML_p, XML_cSld, |
1381 | XML_name, aLayoutInfo[ nOffset ].sName); |
1382 | //pFS->write( MINIMAL_SPTREE ); // TODO: write actual shape tree |
1383 | WriteShapeTree(pFS, LAYOUT, true); |
1384 | |
1385 | pFS->endElementNS(XML_p, XML_cSld); |
1386 | |
1387 | pFS->endElementNS(XML_p, XML_sldLayout); |
1388 | |
1389 | mLayoutInfo[ nOffset ].mnFileIdArray[ nMasterNum ] = mnLayoutFileIdMax; |
1390 | |
1391 | mnLayoutFileIdMax ++; |
1392 | |
1393 | xDrawPages->remove(xSlide); |
1394 | } |
1395 | |
1396 | void PowerPointExport::WriteShapeTree(const FSHelperPtr& pFS, PageType ePageType, bool bMaster) |
1397 | { |
1398 | PowerPointShapeExport aDML(pFS, &maShapeMap, this); |
1399 | aDML.SetMaster(bMaster); |
1400 | aDML.SetPageType(ePageType); |
1401 | aDML.SetBackgroundDark(mbIsBackgroundDark); |
1402 | |
1403 | pFS->startElementNS(XML_p, XML_spTree); |
1404 | pFS->write(MAIN_GROUP"<p:nvGrpSpPr> <p:cNvPr id=\"1\" name=\"\"/> <p:cNvGrpSpPr/> <p:nvPr/> </p:nvGrpSpPr> <p:grpSpPr> <a:xfrm> <a:off x=\"0\" y=\"0\"/> <a:ext cx=\"0\" cy=\"0\"/> <a:chOff x=\"0\" y=\"0\"/> <a:chExt cx=\"0\" cy=\"0\"/> </a:xfrm> </p:grpSpPr>"); |
1405 | |
1406 | ResetGroupTable(mXShapes->getCount()); |
1407 | |
1408 | while (GetNextGroupEntry()) |
1409 | { |
1410 | |
1411 | sal_uInt32 nGroups = GetGroupsClosed(); |
1412 | for (sal_uInt32 i = 0; i < nGroups; i++) |
1413 | { |
1414 | SAL_INFO("sd.eppt", "leave group")do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "leave group") == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt") , ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1414" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "leave group"), 0); } else { ::std:: ostringstream sal_detail_stream; sal_detail_stream << "leave group" ; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt" ), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1414" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "leave group") == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1414" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "leave group"), 0); } else { ::std:: ostringstream sal_detail_stream; sal_detail_stream << "leave group" ; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt" ), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1414" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
1415 | } |
1416 | |
1417 | if (GetShapeByIndex(GetCurrentGroupIndex(), true)) |
1418 | { |
1419 | SAL_INFO("sd.eppt", "mType: " << mType)do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "mType: " << mType ) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt" ), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1419" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "mType: " << mType), 0); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << "mType: " << mType; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1419" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "mType: " << mType) == 1) { ::sal_detail_log ( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1419" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "mType: " << mType), 0); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << "mType: " << mType; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1419" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
1420 | if (DrawingML::IsDiagram(mXShape)) |
1421 | WriteDiagram(pFS, aDML, mXShape, mnDiagramId++); |
1422 | else |
1423 | aDML.WriteShape(mXShape); |
1424 | } |
1425 | } |
1426 | |
1427 | pFS->endElementNS(XML_p, XML_spTree); |
1428 | } |
1429 | |
1430 | ShapeExport& PowerPointShapeExport::WritePageShape(const Reference< XShape >& xShape, PageType ePageType, bool bPresObj) |
1431 | { |
1432 | if ((ePageType == NOTICE && bPresObj) || ePageType == LAYOUT || ePageType == MASTER) |
1433 | return WritePlaceholderShape(xShape, SlideImage); |
1434 | |
1435 | return WriteTextShape(xShape); |
1436 | } |
1437 | |
1438 | bool PowerPointShapeExport::WritePlaceholder(const Reference< XShape >& xShape, PlaceholderType ePlaceholder, bool bMaster) |
1439 | { |
1440 | SAL_INFO("sd.eppt", "WritePlaceholder " << bMaster << " " << ShapeExport::NonEmptyText(xShape))do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "WritePlaceholder " << bMaster << " " << ShapeExport::NonEmptyText(xShape )) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ( "sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1440" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "WritePlaceholder " << bMaster << " " << ShapeExport::NonEmptyText(xShape)), 0) ; } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << "WritePlaceholder " << bMaster << " " << ShapeExport::NonEmptyText(xShape); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1440" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "WritePlaceholder " << bMaster << " " << ShapeExport::NonEmptyText(xShape)) == 1) { ::sal_detail_log ( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1440" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "WritePlaceholder " << bMaster << " " << ShapeExport::NonEmptyText(xShape)), 0) ; } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << "WritePlaceholder " << bMaster << " " << ShapeExport::NonEmptyText(xShape); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1440" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
1441 | if (bMaster && ShapeExport::NonEmptyText(xShape)) |
1442 | { |
1443 | WritePlaceholderShape(xShape, ePlaceholder); |
1444 | |
1445 | return true; |
1446 | } |
1447 | |
1448 | return false; |
1449 | } |
1450 | |
1451 | ShapeExport& PowerPointShapeExport::WritePlaceholderShape(const Reference< XShape >& xShape, PlaceholderType ePlaceholder) |
1452 | { |
1453 | mpFS->startElementNS(XML_p, XML_sp); |
1454 | |
1455 | // non visual shape properties |
1456 | mpFS->startElementNS(XML_p, XML_nvSpPr); |
1457 | const OString aPlaceholderID("PlaceHolder " + OString::number(mnShapeIdMax++)); |
1458 | WriteNonVisualDrawingProperties(xShape, aPlaceholderID.getStr()); |
1459 | mpFS->startElementNS(XML_p, XML_cNvSpPr); |
1460 | mpFS->singleElementNS(XML_a, XML_spLocks, XML_noGrp, "1"); |
1461 | mpFS->endElementNS(XML_p, XML_cNvSpPr); |
1462 | mpFS->startElementNS(XML_p, XML_nvPr); |
1463 | |
1464 | const char* pType = nullptr; |
1465 | switch (ePlaceholder) |
1466 | { |
1467 | case SlideImage: |
1468 | pType = "sldImg"; |
1469 | break; |
1470 | case Notes: |
1471 | pType = "body"; |
1472 | break; |
1473 | case Header: |
1474 | pType = "hdr"; |
1475 | break; |
1476 | case Footer: |
1477 | pType = "ftr"; |
1478 | break; |
1479 | case SlideNumber: |
1480 | pType = "sldNum"; |
1481 | break; |
1482 | case DateAndTime: |
1483 | pType = "dt"; |
1484 | break; |
1485 | case Outliner: |
1486 | pType = "body"; |
1487 | break; |
1488 | case Title: |
1489 | pType = "title"; |
1490 | break; |
1491 | case Subtitle: |
1492 | pType = "subTitle"; |
1493 | break; |
1494 | default: |
1495 | SAL_INFO("sd.eppt", "warning: unhandled placeholder type: " << ePlaceholder)do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "warning: unhandled placeholder type: " << ePlaceholder) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1495" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "warning: unhandled placeholder type: " << ePlaceholder), 0); } else { ::std::ostringstream sal_detail_stream ; sal_detail_stream << "warning: unhandled placeholder type: " << ePlaceholder; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1495" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "warning: unhandled placeholder type: " << ePlaceholder ) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt" ), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1495" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "warning: unhandled placeholder type: " << ePlaceholder), 0); } else { ::std::ostringstream sal_detail_stream ; sal_detail_stream << "warning: unhandled placeholder type: " << ePlaceholder; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1495" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
1496 | } |
1497 | SAL_INFO("sd.eppt", "write placeholder " << pType)do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "write placeholder " << pType) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1497" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "write placeholder " << pType) , 0); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << "write placeholder " << pType; ::sal::detail:: log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1497" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "write placeholder " << pType) == 1) { ::sal_detail_log ( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1497" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "write placeholder " << pType) , 0); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << "write placeholder " << pType; ::sal::detail:: log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1497" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
1498 | mpFS->singleElementNS(XML_p, XML_ph, XML_type, pType); |
1499 | mpFS->endElementNS(XML_p, XML_nvPr); |
1500 | mpFS->endElementNS(XML_p, XML_nvSpPr); |
1501 | |
1502 | // visual shape properties |
1503 | mpFS->startElementNS(XML_p, XML_spPr); |
1504 | WriteShapeTransformation(xShape, XML_a); |
1505 | WritePresetShape("rect"); |
1506 | Reference< XPropertySet > xProps(xShape, UNO_QUERY); |
1507 | if (xProps.is()) |
1508 | WriteBlipFill(xProps, "Graphic"); |
1509 | mpFS->endElementNS(XML_p, XML_spPr); |
1510 | |
1511 | WriteTextBox(xShape, XML_p); |
1512 | |
1513 | mpFS->endElementNS(XML_p, XML_sp); |
1514 | |
1515 | return *this; |
1516 | } |
1517 | |
1518 | #define SYS_COLOR_SCHEMES" <a:dk1> <a:sysClr val=\"windowText\" lastClr=\"000000\"/> </a:dk1> <a:lt1> <a:sysClr val=\"window\" lastClr=\"FFFFFF\"/> </a:lt1>" " <a:dk1>\ |
1519 | <a:sysClr val=\"windowText\" lastClr=\"000000\"/>\ |
1520 | </a:dk1>\ |
1521 | <a:lt1>\ |
1522 | <a:sysClr val=\"window\" lastClr=\"FFFFFF\"/>\ |
1523 | </a:lt1>" |
1524 | |
1525 | #define MINIMAL_THEME" <a:fontScheme name=\"Office\"> <a:majorFont> <a:latin typeface=\"Arial\"/> <a:ea typeface=\"DejaVu Sans\"/> <a:cs typeface=\"DejaVu Sans\"/> </a:majorFont> <a:minorFont> <a:latin typeface=\"Arial\"/> <a:ea typeface=\"DejaVu Sans\"/> <a:cs typeface=\"DejaVu Sans\"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name=\"Office\"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val=\"phClr\"/> </a:solidFill> <a:gradFill rotWithShape=\"1\"> <a:gsLst> <a:gs pos=\"0\"> <a:schemeClr val=\"phClr\"> <a:tint val=\"50000\"/> <a:satMod val=\"300000\"/> </a:schemeClr> </a:gs> <a:gs pos=\"35000\"> <a:schemeClr val=\"phClr\"> <a:tint val=\"37000\"/> <a:satMod val=\"300000\"/> </a:schemeClr> </a:gs> <a:gs pos=\"100000\"> <a:schemeClr val=\"phClr\"> <a:tint val=\"15000\"/> <a:satMod val=\"350000\"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang=\"16200000\" scaled=\"1\"/> </a:gradFill> <a:gradFill rotWithShape=\"1\"> <a:gsLst> <a:gs pos=\"0\"> <a:schemeClr val=\"phClr\"> <a:shade val=\"51000\"/> <a:satMod val=\"130000\"/> </a:schemeClr> </a:gs> <a:gs pos=\"80000\"> <a:schemeClr val=\"phClr\"> <a:shade val=\"93000\"/> <a:satMod val=\"130000\"/> </a:schemeClr> </a:gs> <a:gs pos=\"100000\"> <a:schemeClr val=\"phClr\"> <a:shade val=\"94000\"/> <a:satMod val=\"135000\"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang=\"16200000\" scaled=\"0\"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"> <a:solidFill> <a:schemeClr val=\"phClr\"> <a:shade val=\"95000\"/> <a:satMod val=\"105000\"/> </a:schemeClr> </a:solidFill> <a:prstDash val=\"solid\"/> <a:miter/> </a:ln> <a:ln w=\"25400\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"> <a:solidFill> <a:schemeClr val=\"phClr\"/> </a:solidFill> <a:prstDash val=\"solid\"/> <a:miter/> </a:ln> <a:ln w=\"38100\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"> <a:solidFill> <a:schemeClr val=\"phClr\"/> </a:solidFill> <a:prstDash val=\"solid\"/> <a:miter/> </a:ln> </a:lnStyleLst> <a:effectStyleLst> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad=\"40000\" dist=\"20000\" dir=\"5400000\" rotWithShape=\"0\"> <a:srgbClr val=\"000000\"> <a:alpha val=\"38000\"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\"> <a:srgbClr val=\"000000\"> <a:alpha val=\"35000\"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\"> <a:srgbClr val=\"000000\"> <a:alpha val=\"35000\"/> </a:srgbClr> </a:outerShdw> </a:effectLst> <a:scene3d> <a:camera prst=\"orthographicFront\"> <a:rot lat=\"0\" lon=\"0\" rev=\"0\"/> </a:camera> <a:lightRig rig=\"threePt\" dir=\"t\"> <a:rot lat=\"0\" lon=\"0\" rev=\"1200000\"/> </a:lightRig> </a:scene3d> <a:sp3d> <a:bevelT w=\"63500\" h=\"25400\"/> </a:sp3d> </a:effectStyle> </a:effectStyleLst> <a:bgFillStyleLst> <a:solidFill> <a:schemeClr val=\"phClr\"/> </a:solidFill> <a:gradFill rotWithShape=\"1\"> <a:gsLst> <a:gs pos=\"0\"> <a:schemeClr val=\"phClr\"> <a:tint val=\"40000\"/> <a:satMod val=\"350000\"/> </a:schemeClr> </a:gs> <a:gs pos=\"40000\"> <a:schemeClr val=\"phClr\"> <a:tint val=\"45000\"/> <a:shade val=\"99000\"/> <a:satMod val=\"350000\"/> </a:schemeClr> </a:gs> <a:gs pos=\"100000\"> <a:schemeClr val=\"phClr\"> <a:shade val=\"20000\"/> <a:satMod val=\"255000\"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path=\"circle\"> <a:fillToRect l=\"50000\" t=\"-80000\" r=\"50000\" b=\"180000\"/> </a:path> </a:gradFill> <a:gradFill rotWithShape=\"1\"> <a:gsLst> <a:gs pos=\"0\"> <a:schemeClr val=\"phClr\"> <a:tint val=\"80000\"/> <a:satMod val=\"300000\"/> </a:schemeClr> </a:gs> <a:gs pos=\"100000\"> <a:schemeClr val=\"phClr\"> <a:shade val=\"30000\"/> <a:satMod val=\"200000\"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path=\"circle\"> <a:fillToRect l=\"50000\" t=\"50000\" r=\"50000\" b=\"50000\"/> </a:path> </a:gradFill> </a:bgFillStyleLst> </a:fmtScheme>" " <a:fontScheme name=\"Office\">\ |
1526 | <a:majorFont>\ |
1527 | <a:latin typeface=\"Arial\"/>\ |
1528 | <a:ea typeface=\"DejaVu Sans\"/>\ |
1529 | <a:cs typeface=\"DejaVu Sans\"/>\ |
1530 | </a:majorFont>\ |
1531 | <a:minorFont>\ |
1532 | <a:latin typeface=\"Arial\"/>\ |
1533 | <a:ea typeface=\"DejaVu Sans\"/>\ |
1534 | <a:cs typeface=\"DejaVu Sans\"/>\ |
1535 | </a:minorFont>\ |
1536 | </a:fontScheme>\ |
1537 | <a:fmtScheme name=\"Office\">\ |
1538 | <a:fillStyleLst>\ |
1539 | <a:solidFill>\ |
1540 | <a:schemeClr val=\"phClr\"/>\ |
1541 | </a:solidFill>\ |
1542 | <a:gradFill rotWithShape=\"1\">\ |
1543 | <a:gsLst>\ |
1544 | <a:gs pos=\"0\">\ |
1545 | <a:schemeClr val=\"phClr\">\ |
1546 | <a:tint val=\"50000\"/>\ |
1547 | <a:satMod val=\"300000\"/>\ |
1548 | </a:schemeClr>\ |
1549 | </a:gs>\ |
1550 | <a:gs pos=\"35000\">\ |
1551 | <a:schemeClr val=\"phClr\">\ |
1552 | <a:tint val=\"37000\"/>\ |
1553 | <a:satMod val=\"300000\"/>\ |
1554 | </a:schemeClr>\ |
1555 | </a:gs>\ |
1556 | <a:gs pos=\"100000\">\ |
1557 | <a:schemeClr val=\"phClr\">\ |
1558 | <a:tint val=\"15000\"/>\ |
1559 | <a:satMod val=\"350000\"/>\ |
1560 | </a:schemeClr>\ |
1561 | </a:gs>\ |
1562 | </a:gsLst>\ |
1563 | <a:lin ang=\"16200000\" scaled=\"1\"/>\ |
1564 | </a:gradFill>\ |
1565 | <a:gradFill rotWithShape=\"1\">\ |
1566 | <a:gsLst>\ |
1567 | <a:gs pos=\"0\">\ |
1568 | <a:schemeClr val=\"phClr\">\ |
1569 | <a:shade val=\"51000\"/>\ |
1570 | <a:satMod val=\"130000\"/>\ |
1571 | </a:schemeClr>\ |
1572 | </a:gs>\ |
1573 | <a:gs pos=\"80000\">\ |
1574 | <a:schemeClr val=\"phClr\">\ |
1575 | <a:shade val=\"93000\"/>\ |
1576 | <a:satMod val=\"130000\"/>\ |
1577 | </a:schemeClr>\ |
1578 | </a:gs>\ |
1579 | <a:gs pos=\"100000\">\ |
1580 | <a:schemeClr val=\"phClr\">\ |
1581 | <a:shade val=\"94000\"/>\ |
1582 | <a:satMod val=\"135000\"/>\ |
1583 | </a:schemeClr>\ |
1584 | </a:gs>\ |
1585 | </a:gsLst>\ |
1586 | <a:lin ang=\"16200000\" scaled=\"0\"/>\ |
1587 | </a:gradFill>\ |
1588 | </a:fillStyleLst>\ |
1589 | <a:lnStyleLst>\ |
1590 | <a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">\ |
1591 | <a:solidFill>\ |
1592 | <a:schemeClr val=\"phClr\">\ |
1593 | <a:shade val=\"95000\"/>\ |
1594 | <a:satMod val=\"105000\"/>\ |
1595 | </a:schemeClr>\ |
1596 | </a:solidFill>\ |
1597 | <a:prstDash val=\"solid\"/>\ |
1598 | <a:miter/>\ |
1599 | </a:ln>\ |
1600 | <a:ln w=\"25400\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">\ |
1601 | <a:solidFill>\ |
1602 | <a:schemeClr val=\"phClr\"/>\ |
1603 | </a:solidFill>\ |
1604 | <a:prstDash val=\"solid\"/>\ |
1605 | <a:miter/>\ |
1606 | </a:ln>\ |
1607 | <a:ln w=\"38100\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">\ |
1608 | <a:solidFill>\ |
1609 | <a:schemeClr val=\"phClr\"/>\ |
1610 | </a:solidFill>\ |
1611 | <a:prstDash val=\"solid\"/>\ |
1612 | <a:miter/>\ |
1613 | </a:ln>\ |
1614 | </a:lnStyleLst>\ |
1615 | <a:effectStyleLst>\ |
1616 | <a:effectStyle>\ |
1617 | <a:effectLst>\ |
1618 | <a:outerShdw blurRad=\"40000\" dist=\"20000\" dir=\"5400000\" rotWithShape=\"0\">\ |
1619 | <a:srgbClr val=\"000000\">\ |
1620 | <a:alpha val=\"38000\"/>\ |
1621 | </a:srgbClr>\ |
1622 | </a:outerShdw>\ |
1623 | </a:effectLst>\ |
1624 | </a:effectStyle>\ |
1625 | <a:effectStyle>\ |
1626 | <a:effectLst>\ |
1627 | <a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\">\ |
1628 | <a:srgbClr val=\"000000\">\ |
1629 | <a:alpha val=\"35000\"/>\ |
1630 | </a:srgbClr>\ |
1631 | </a:outerShdw>\ |
1632 | </a:effectLst>\ |
1633 | </a:effectStyle>\ |
1634 | <a:effectStyle>\ |
1635 | <a:effectLst>\ |
1636 | <a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\">\ |
1637 | <a:srgbClr val=\"000000\">\ |
1638 | <a:alpha val=\"35000\"/>\ |
1639 | </a:srgbClr>\ |
1640 | </a:outerShdw>\ |
1641 | </a:effectLst>\ |
1642 | <a:scene3d>\ |
1643 | <a:camera prst=\"orthographicFront\">\ |
1644 | <a:rot lat=\"0\" lon=\"0\" rev=\"0\"/>\ |
1645 | </a:camera>\ |
1646 | <a:lightRig rig=\"threePt\" dir=\"t\">\ |
1647 | <a:rot lat=\"0\" lon=\"0\" rev=\"1200000\"/>\ |
1648 | </a:lightRig>\ |
1649 | </a:scene3d>\ |
1650 | <a:sp3d>\ |
1651 | <a:bevelT w=\"63500\" h=\"25400\"/>\ |
1652 | </a:sp3d>\ |
1653 | </a:effectStyle>\ |
1654 | </a:effectStyleLst>\ |
1655 | <a:bgFillStyleLst>\ |
1656 | <a:solidFill>\ |
1657 | <a:schemeClr val=\"phClr\"/>\ |
1658 | </a:solidFill>\ |
1659 | <a:gradFill rotWithShape=\"1\">\ |
1660 | <a:gsLst>\ |
1661 | <a:gs pos=\"0\">\ |
1662 | <a:schemeClr val=\"phClr\">\ |
1663 | <a:tint val=\"40000\"/>\ |
1664 | <a:satMod val=\"350000\"/>\ |
1665 | </a:schemeClr>\ |
1666 | </a:gs>\ |
1667 | <a:gs pos=\"40000\">\ |
1668 | <a:schemeClr val=\"phClr\">\ |
1669 | <a:tint val=\"45000\"/>\ |
1670 | <a:shade val=\"99000\"/>\ |
1671 | <a:satMod val=\"350000\"/>\ |
1672 | </a:schemeClr>\ |
1673 | </a:gs>\ |
1674 | <a:gs pos=\"100000\">\ |
1675 | <a:schemeClr val=\"phClr\">\ |
1676 | <a:shade val=\"20000\"/>\ |
1677 | <a:satMod val=\"255000\"/>\ |
1678 | </a:schemeClr>\ |
1679 | </a:gs>\ |
1680 | </a:gsLst>\ |
1681 | <a:path path=\"circle\">\ |
1682 | <a:fillToRect l=\"50000\" t=\"-80000\" r=\"50000\" b=\"180000\"/>\ |
1683 | </a:path>\ |
1684 | </a:gradFill>\ |
1685 | <a:gradFill rotWithShape=\"1\">\ |
1686 | <a:gsLst>\ |
1687 | <a:gs pos=\"0\">\ |
1688 | <a:schemeClr val=\"phClr\">\ |
1689 | <a:tint val=\"80000\"/>\ |
1690 | <a:satMod val=\"300000\"/>\ |
1691 | </a:schemeClr>\ |
1692 | </a:gs>\ |
1693 | <a:gs pos=\"100000\">\ |
1694 | <a:schemeClr val=\"phClr\">\ |
1695 | <a:shade val=\"30000\"/>\ |
1696 | <a:satMod val=\"200000\"/>\ |
1697 | </a:schemeClr>\ |
1698 | </a:gs>\ |
1699 | </a:gsLst>\ |
1700 | <a:path path=\"circle\">\ |
1701 | <a:fillToRect l=\"50000\" t=\"50000\" r=\"50000\" b=\"50000\"/>\ |
1702 | </a:path>\ |
1703 | </a:gradFill>\ |
1704 | </a:bgFillStyleLst>\ |
1705 | </a:fmtScheme>" |
1706 | |
1707 | void PowerPointExport::WriteDefaultColorSchemes(const FSHelperPtr& pFS) |
1708 | { |
1709 | for (int nId = PredefinedClrSchemeId::dk2; nId != PredefinedClrSchemeId::Count; nId++) |
1710 | { |
1711 | OUString sName = PredefinedClrNames[static_cast<PredefinedClrSchemeId>(nId)]; |
1712 | sal_Int32 nColor = 0; |
1713 | |
1714 | switch (nId) |
1715 | { |
1716 | case PredefinedClrSchemeId::dk2: |
1717 | nColor = 0x1F497D; |
1718 | break; |
1719 | case PredefinedClrSchemeId::lt2: |
1720 | nColor = 0xEEECE1; |
1721 | break; |
1722 | case PredefinedClrSchemeId::accent1: |
1723 | nColor = 0x4F81BD; |
1724 | break; |
1725 | case PredefinedClrSchemeId::accent2: |
1726 | nColor = 0xC0504D; |
1727 | break; |
1728 | case PredefinedClrSchemeId::accent3: |
1729 | nColor = 0x9BBB59; |
1730 | break; |
1731 | case PredefinedClrSchemeId::accent4: |
1732 | nColor = 0x8064A2; |
1733 | break; |
1734 | case PredefinedClrSchemeId::accent5: |
1735 | nColor = 0x4BACC6; |
1736 | break; |
1737 | case PredefinedClrSchemeId::accent6: |
1738 | nColor = 0xF79646; |
1739 | break; |
1740 | case PredefinedClrSchemeId::hlink: |
1741 | nColor = 0x0000FF; |
1742 | break; |
1743 | case PredefinedClrSchemeId::folHlink: |
1744 | nColor = 0x800080; |
1745 | break; |
1746 | } |
1747 | |
1748 | OUString sOpenColorScheme = OUStringBuffer() |
1749 | .append("<a:") |
1750 | .append(sName) |
1751 | .append(">") |
1752 | .makeStringAndClear(); |
1753 | pFS->write(sOpenColorScheme); |
1754 | |
1755 | pFS->singleElementNS(XML_a, XML_srgbClr, XML_val, I32SHEX(nColor)); |
1756 | |
1757 | OUString sCloseColorScheme = OUStringBuffer() |
1758 | .append("</a:") |
1759 | .append(sName) |
1760 | .append(">") |
1761 | .makeStringAndClear(); |
1762 | pFS->write(sCloseColorScheme); |
1763 | } |
1764 | } |
1765 | |
1766 | bool PowerPointExport::WriteColorSchemes(const FSHelperPtr& pFS, const OUString& rThemePath) |
1767 | { |
1768 | try |
1769 | { |
1770 | uno::Reference<beans::XPropertySet> xDocProps(getModel(), uno::UNO_QUERY); |
1771 | if (xDocProps.is()) |
1772 | { |
1773 | uno::Reference<beans::XPropertySetInfo> xPropsInfo = xDocProps->getPropertySetInfo(); |
1774 | |
1775 | const OUString aGrabBagPropName = "InteropGrabBag"; |
1776 | if (xPropsInfo.is() && xPropsInfo->hasPropertyByName(aGrabBagPropName)) |
1777 | { |
1778 | comphelper::SequenceAsHashMap aGrabBag(xDocProps->getPropertyValue(aGrabBagPropName)); |
1779 | uno::Sequence<beans::PropertyValue> aCurrentTheme; |
1780 | |
1781 | aGrabBag.getValue(rThemePath) >>= aCurrentTheme; |
1782 | |
1783 | if (!aCurrentTheme.hasElements()) |
1784 | return false; |
1785 | |
1786 | // Order is important |
1787 | for (int nId = PredefinedClrSchemeId::dk2; nId != PredefinedClrSchemeId::Count; nId++) |
1788 | { |
1789 | OUString sName = PredefinedClrNames[static_cast<PredefinedClrSchemeId>(nId)]; |
1790 | sal_Int32 nColor = 0; |
1791 | |
1792 | for (auto aIt = aCurrentTheme.begin(); aIt != aCurrentTheme.end(); aIt++) |
1793 | { |
1794 | if (aIt->Name == sName) |
1795 | { |
1796 | aIt->Value >>= nColor; |
1797 | break; |
1798 | } |
1799 | } |
1800 | |
1801 | OUString sOpenColorScheme = OUStringBuffer() |
1802 | .append("<a:") |
1803 | .append(sName) |
1804 | .append(">") |
1805 | .makeStringAndClear(); |
1806 | pFS->write(sOpenColorScheme); |
1807 | |
1808 | pFS->singleElementNS(XML_a, XML_srgbClr, XML_val, I32SHEX(nColor)); |
1809 | |
1810 | OUString sCloseColorScheme = OUStringBuffer() |
1811 | .append("</a:") |
1812 | .append(sName) |
1813 | .append(">") |
1814 | .makeStringAndClear(); |
1815 | pFS->write(sCloseColorScheme); |
1816 | } |
1817 | |
1818 | // TODO: write complete color schemes & only if successful, protection against partial export |
1819 | return true; |
1820 | } |
1821 | } |
1822 | } |
1823 | catch (const uno::Exception&) |
1824 | { |
1825 | SAL_WARN("writerfilter", "Failed to save documents grab bag")do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_WARN , "writerfilter")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break ; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "Failed to save documents grab bag" ) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_WARN), ("writerfilter" ), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1825" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "Failed to save documents grab bag") , 0); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << "Failed to save documents grab bag"; ::sal::detail:: log( (::SAL_DETAIL_LOG_LEVEL_WARN), ("writerfilter"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1825" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "Failed to save documents grab bag") == 1) { ::sal_detail_log ( (::SAL_DETAIL_LOG_LEVEL_WARN), ("writerfilter"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1825" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "Failed to save documents grab bag") , 0); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << "Failed to save documents grab bag"; ::sal::detail:: log( (::SAL_DETAIL_LOG_LEVEL_WARN), ("writerfilter"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1825" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
1826 | } |
1827 | |
1828 | return false; |
1829 | } |
1830 | |
1831 | void PowerPointExport::WriteTheme(sal_Int32 nThemeNum) |
1832 | { |
1833 | OUString sThemePath = OUStringBuffer() |
1834 | .append("ppt/theme/theme") |
1835 | .append(nThemeNum + 1) |
1836 | .append(".xml") |
1837 | .makeStringAndClear(); |
1838 | |
1839 | FSHelperPtr pFS = openFragmentStreamWithSerializer(sThemePath, |
1840 | "application/vnd.openxmlformats-officedocument.theme+xml"); |
1841 | |
1842 | pFS->startElementNS(XML_a, XML_theme, |
1843 | FSNS(XML_xmlns, XML_a), this->getNamespaceURL(OOX_NS(dml)(::oox::NMSP_dml)), |
1844 | XML_name, "Office Theme"); |
1845 | |
1846 | pFS->startElementNS(XML_a, XML_themeElements); |
1847 | pFS->startElementNS(XML_a, XML_clrScheme, XML_name, "Office"); |
1848 | |
1849 | pFS->write(SYS_COLOR_SCHEMES" <a:dk1> <a:sysClr val=\"windowText\" lastClr=\"000000\"/> </a:dk1> <a:lt1> <a:sysClr val=\"window\" lastClr=\"FFFFFF\"/> </a:lt1>"); |
1850 | |
1851 | if (!WriteColorSchemes(pFS, sThemePath)) |
1852 | { |
1853 | // if style is not defined, try to use first one |
1854 | if (!WriteColorSchemes(pFS, "ppt/theme/theme1.xml")) |
1855 | { |
1856 | // color schemes are required - use default values |
1857 | WriteDefaultColorSchemes(pFS); |
1858 | } |
1859 | } |
1860 | |
1861 | pFS->endElementNS(XML_a, XML_clrScheme); |
1862 | |
1863 | // export remaining part |
1864 | pFS->write(MINIMAL_THEME" <a:fontScheme name=\"Office\"> <a:majorFont> <a:latin typeface=\"Arial\"/> <a:ea typeface=\"DejaVu Sans\"/> <a:cs typeface=\"DejaVu Sans\"/> </a:majorFont> <a:minorFont> <a:latin typeface=\"Arial\"/> <a:ea typeface=\"DejaVu Sans\"/> <a:cs typeface=\"DejaVu Sans\"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name=\"Office\"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val=\"phClr\"/> </a:solidFill> <a:gradFill rotWithShape=\"1\"> <a:gsLst> <a:gs pos=\"0\"> <a:schemeClr val=\"phClr\"> <a:tint val=\"50000\"/> <a:satMod val=\"300000\"/> </a:schemeClr> </a:gs> <a:gs pos=\"35000\"> <a:schemeClr val=\"phClr\"> <a:tint val=\"37000\"/> <a:satMod val=\"300000\"/> </a:schemeClr> </a:gs> <a:gs pos=\"100000\"> <a:schemeClr val=\"phClr\"> <a:tint val=\"15000\"/> <a:satMod val=\"350000\"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang=\"16200000\" scaled=\"1\"/> </a:gradFill> <a:gradFill rotWithShape=\"1\"> <a:gsLst> <a:gs pos=\"0\"> <a:schemeClr val=\"phClr\"> <a:shade val=\"51000\"/> <a:satMod val=\"130000\"/> </a:schemeClr> </a:gs> <a:gs pos=\"80000\"> <a:schemeClr val=\"phClr\"> <a:shade val=\"93000\"/> <a:satMod val=\"130000\"/> </a:schemeClr> </a:gs> <a:gs pos=\"100000\"> <a:schemeClr val=\"phClr\"> <a:shade val=\"94000\"/> <a:satMod val=\"135000\"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang=\"16200000\" scaled=\"0\"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"> <a:solidFill> <a:schemeClr val=\"phClr\"> <a:shade val=\"95000\"/> <a:satMod val=\"105000\"/> </a:schemeClr> </a:solidFill> <a:prstDash val=\"solid\"/> <a:miter/> </a:ln> <a:ln w=\"25400\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"> <a:solidFill> <a:schemeClr val=\"phClr\"/> </a:solidFill> <a:prstDash val=\"solid\"/> <a:miter/> </a:ln> <a:ln w=\"38100\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"> <a:solidFill> <a:schemeClr val=\"phClr\"/> </a:solidFill> <a:prstDash val=\"solid\"/> <a:miter/> </a:ln> </a:lnStyleLst> <a:effectStyleLst> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad=\"40000\" dist=\"20000\" dir=\"5400000\" rotWithShape=\"0\"> <a:srgbClr val=\"000000\"> <a:alpha val=\"38000\"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\"> <a:srgbClr val=\"000000\"> <a:alpha val=\"35000\"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\"> <a:srgbClr val=\"000000\"> <a:alpha val=\"35000\"/> </a:srgbClr> </a:outerShdw> </a:effectLst> <a:scene3d> <a:camera prst=\"orthographicFront\"> <a:rot lat=\"0\" lon=\"0\" rev=\"0\"/> </a:camera> <a:lightRig rig=\"threePt\" dir=\"t\"> <a:rot lat=\"0\" lon=\"0\" rev=\"1200000\"/> </a:lightRig> </a:scene3d> <a:sp3d> <a:bevelT w=\"63500\" h=\"25400\"/> </a:sp3d> </a:effectStyle> </a:effectStyleLst> <a:bgFillStyleLst> <a:solidFill> <a:schemeClr val=\"phClr\"/> </a:solidFill> <a:gradFill rotWithShape=\"1\"> <a:gsLst> <a:gs pos=\"0\"> <a:schemeClr val=\"phClr\"> <a:tint val=\"40000\"/> <a:satMod val=\"350000\"/> </a:schemeClr> </a:gs> <a:gs pos=\"40000\"> <a:schemeClr val=\"phClr\"> <a:tint val=\"45000\"/> <a:shade val=\"99000\"/> <a:satMod val=\"350000\"/> </a:schemeClr> </a:gs> <a:gs pos=\"100000\"> <a:schemeClr val=\"phClr\"> <a:shade val=\"20000\"/> <a:satMod val=\"255000\"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path=\"circle\"> <a:fillToRect l=\"50000\" t=\"-80000\" r=\"50000\" b=\"180000\"/> </a:path> </a:gradFill> <a:gradFill rotWithShape=\"1\"> <a:gsLst> <a:gs pos=\"0\"> <a:schemeClr val=\"phClr\"> <a:tint val=\"80000\"/> <a:satMod val=\"300000\"/> </a:schemeClr> </a:gs> <a:gs pos=\"100000\"> <a:schemeClr val=\"phClr\"> <a:shade val=\"30000\"/> <a:satMod val=\"200000\"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path=\"circle\"> <a:fillToRect l=\"50000\" t=\"50000\" r=\"50000\" b=\"50000\"/> </a:path> </a:gradFill> </a:bgFillStyleLst> </a:fmtScheme>"); |
1865 | |
1866 | pFS->endElementNS(XML_a, XML_themeElements); |
1867 | pFS->endElementNS(XML_a, XML_theme); |
1868 | } |
1869 | |
1870 | bool PowerPointExport::ImplCreateDocument() |
1871 | { |
1872 | mbCreateNotes = false; |
1873 | |
1874 | for (sal_uInt32 i = 0; i < mnPages; i++) |
1875 | { |
1876 | if (!GetPageByIndex(i, NOTICE)) |
1877 | return false; |
1878 | |
1879 | if (ContainsOtherShapeThanPlaceholders()) |
1880 | { |
1881 | mbCreateNotes = true; |
1882 | break; |
1883 | } |
1884 | } |
1885 | |
1886 | return true; |
1887 | } |
1888 | |
1889 | void PowerPointExport::WriteNotesMaster() |
1890 | { |
1891 | SAL_INFO("sd.eppt", "write Notes master\n---------------")do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "write Notes master\n---------------" ) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt" ), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1891" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "write Notes master\n---------------" ), 0); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << "write Notes master\n---------------"; ::sal::detail ::log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1891" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "write Notes master\n---------------") == 1) { :: sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ( "/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1891" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "write Notes master\n---------------" ), 0); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << "write Notes master\n---------------"; ::sal::detail ::log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1891" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
1892 | |
1893 | mPresentationFS->startElementNS(XML_p, XML_notesMasterIdLst); |
1894 | |
1895 | OUString sRelId = addRelation(mPresentationFS->getOutputStream(), |
1896 | oox::getRelationship(Relationship::NOTESMASTER), |
1897 | "notesMasters/notesMaster1.xml"); |
1898 | |
1899 | mPresentationFS->singleElementNS(XML_p, XML_notesMasterId, |
1900 | FSNS(XML_r, XML_id), sRelId); |
1901 | |
1902 | mPresentationFS->endElementNS(XML_p, XML_notesMasterIdLst); |
1903 | |
1904 | FSHelperPtr pFS = |
1905 | openFragmentStreamWithSerializer("ppt/notesMasters/notesMaster1.xml", |
1906 | "application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml"); |
1907 | // write theme per master |
1908 | WriteTheme(mnMasterPages); |
1909 | |
1910 | // add implicit relation to the presentation theme |
1911 | addRelation(pFS->getOutputStream(), |
1912 | oox::getRelationship(Relationship::THEME), |
1913 | OUStringBuffer() |
1914 | .append("../theme/theme") |
1915 | .append(static_cast<sal_Int32>(mnMasterPages) + 1) |
1916 | .append(".xml") |
1917 | .makeStringAndClear()); |
1918 | |
1919 | pFS->startElementNS(XML_p, XML_notesMaster, PNMSSFSNS(XML_xmlns, XML_a), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_dml)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_p), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_ppt)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_r), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_officeRel)), (((rtl_TextEncoding) 76))).getStr( ), FSNS(XML_xmlns, XML_p14), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_p14)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_p15), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_p15)), (((rtl_TextEncoding) 76))).getStr(), FSNS (XML_xmlns, XML_mc), OUStringToOString(this->getNamespaceURL ((::oox::NMSP_mce)), (((rtl_TextEncoding) 76))).getStr()); |
1920 | |
1921 | pFS->startElementNS(XML_p, XML_cSld); |
1922 | |
1923 | Reference< XPropertySet > aXBackgroundPropSet; |
1924 | if (ImplGetPropertyValue(mXPagePropSet, "Background") && |
1925 | (mAny >>= aXBackgroundPropSet)) |
1926 | ImplWriteBackground(pFS, aXBackgroundPropSet); |
1927 | |
1928 | WriteShapeTree(pFS, NOTICE, true); |
1929 | |
1930 | pFS->endElementNS(XML_p, XML_cSld); |
1931 | |
1932 | // color map - now it uses colors from hardcoded theme, once we eventually generate theme, this might need update |
1933 | pFS->singleElementNS(XML_p, XML_clrMap, |
1934 | XML_bg1, "lt1", |
1935 | XML_bg2, "lt2", |
1936 | XML_tx1, "dk1", |
1937 | XML_tx2, "dk2", |
1938 | XML_accent1, "accent1", |
1939 | XML_accent2, "accent2", |
1940 | XML_accent3, "accent3", |
1941 | XML_accent4, "accent4", |
1942 | XML_accent5, "accent5", |
1943 | XML_accent6, "accent6", |
1944 | XML_hlink, "hlink", |
1945 | XML_folHlink, "folHlink"); |
1946 | |
1947 | pFS->endElementNS(XML_p, XML_notesMaster); |
1948 | |
1949 | SAL_INFO("sd.eppt", "----------------")do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "----------------") == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt" ), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1949" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "----------------"), 0); } else { :: std::ostringstream sal_detail_stream; sal_detail_stream << "----------------"; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1949" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "----------------") == 1) { ::sal_detail_log( (:: SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1949" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "----------------"), 0); } else { :: std::ostringstream sal_detail_stream; sal_detail_stream << "----------------"; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "1949" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
1950 | } |
1951 | |
1952 | void PowerPointExport::embedEffectAudio(const FSHelperPtr& pFS, const OUString& sUrl, OUString& sRelId, OUString& sName) |
1953 | { |
1954 | comphelper::LifecycleProxy aProxy; |
1955 | |
1956 | if (!sUrl.endsWithIgnoreAsciiCase(".wav")) |
1957 | return; |
1958 | |
1959 | uno::Reference<io::XInputStream> xAudioStream; |
1960 | if (sUrl.startsWith("vnd.sun.star.Package:")) |
1961 | { |
1962 | uno::Reference<document::XStorageBasedDocument> xStorageBasedDocument(getModel(), uno::UNO_QUERY); |
1963 | if (!xStorageBasedDocument.is()) |
1964 | return; |
1965 | |
1966 | uno::Reference<embed::XStorage> xDocumentStorage = xStorageBasedDocument->getDocumentStorage(); |
1967 | if (!xDocumentStorage.is()) |
1968 | return; |
1969 | |
1970 | uno::Reference<io::XStream> xStream = comphelper::OStorageHelper::GetStreamAtPackageURL(xDocumentStorage, sUrl, |
1971 | css::embed::ElementModes::READ, aProxy); |
1972 | |
1973 | if (xStream.is()) |
1974 | xAudioStream = xStream->getInputStream(); |
1975 | } |
1976 | else |
1977 | xAudioStream = comphelper::OStorageHelper::GetInputStreamFromURL(sUrl, getComponentContext()); |
1978 | |
1979 | if (!xAudioStream.is()) |
1980 | return; |
1981 | |
1982 | int nLastSlash = sUrl.lastIndexOf('/'); |
1983 | sName = sUrl.copy(nLastSlash >= 0 ? nLastSlash + 1 : 0); |
1984 | |
1985 | OUString sPath = "../media/" + sName; |
1986 | sRelId = addRelation(pFS->getOutputStream(), |
1987 | oox::getRelationship(Relationship::AUDIO), sPath); |
1988 | |
1989 | uno::Reference<io::XOutputStream> xOutputStream = openFragmentStream(sPath.replaceAt(0, 2, "/ppt"), |
1990 | "audio/x-wav"); |
1991 | |
1992 | comphelper::OStorageHelper::CopyInputToOutput(xAudioStream, xOutputStream); |
1993 | } |
1994 | |
1995 | sal_Int32 PowerPointExport::GetShapeID(const Reference<XShape>& rXShape) |
1996 | { |
1997 | return ShapeExport::GetShapeID(rXShape, &maShapeMap); |
1998 | } |
1999 | |
2000 | sal_Int32 PowerPointExport::GetNextAnimationNodeID() |
2001 | { |
2002 | return mnAnimationNodeIdMax++; |
2003 | } |
2004 | |
2005 | bool PowerPointExport::ImplCreateMainNotes() |
2006 | { |
2007 | if (mbCreateNotes) |
2008 | WriteNotesMaster(); |
2009 | |
2010 | return true; |
2011 | } |
2012 | |
2013 | OUString PowerPointExport::getImplementationName() |
2014 | { |
2015 | return "com.sun.star.comp.Impress.oox.PowerPointExport"; |
2016 | } |
2017 | |
2018 | void PowerPointExport::WriteDiagram(const FSHelperPtr& pFS, PowerPointShapeExport& rDML, const css::uno::Reference<css::drawing::XShape>& rXShape, int nDiagramId) |
2019 | { |
2020 | SAL_INFO("sd.eppt", "writing Diagram " + OUString::number(nDiagramId))do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "writing Diagram " + OUString ::number(nDiagramId)) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2020" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "writing Diagram " + OUString::number (nDiagramId)), 0); } else { ::std::ostringstream sal_detail_stream ; sal_detail_stream << "writing Diagram " + OUString::number (nDiagramId); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2020" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "writing Diagram " + OUString::number(nDiagramId) ) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt" ), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2020" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "writing Diagram " + OUString::number (nDiagramId)), 0); } else { ::std::ostringstream sal_detail_stream ; sal_detail_stream << "writing Diagram " + OUString::number (nDiagramId); ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2020" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
2021 | pFS->startElementNS(XML_p, XML_graphicFrame); |
2022 | rDML.WriteDiagram(rXShape, nDiagramId); |
2023 | pFS->endElementNS(XML_p, XML_graphicFrame); |
2024 | } |
2025 | |
2026 | // UNO component |
2027 | extern "C" SAL_DLLPUBLIC_EXPORT__attribute__ ((visibility("default"))) uno::XInterface* |
2028 | css_comp_Impress_oox_PowerPointExport(uno::XComponentContext* rxCtxt, |
2029 | uno::Sequence<css::uno::Any> const& rArguments) |
2030 | { |
2031 | return cppu::acquire(new PowerPointExport(rxCtxt, rArguments)); |
2032 | } |
2033 | |
2034 | #if OSL_DEBUG_LEVEL1 > 1 |
2035 | void dump_pset(Reference< XPropertySet > const& rXPropSet) |
2036 | { |
2037 | Reference< XPropertySetInfo > info = rXPropSet->getPropertySetInfo(); |
2038 | Sequence< beans::Property > props = info->getProperties(); |
2039 | |
2040 | for (int i=0; i < props.getLength(); i++) |
2041 | { |
2042 | OString name = OUStringToOString(props [i].Name, RTL_TEXTENCODING_UTF8(((rtl_TextEncoding) 76))); |
2043 | |
2044 | Any value = rXPropSet->getPropertyValue(props [i].Name); |
2045 | |
2046 | OUString strValue; |
2047 | sal_Int32 intValue; |
2048 | bool boolValue; |
2049 | RectanglePoint pointValue; |
2050 | |
2051 | if (value >>= strValue) |
2052 | SAL_INFO("sd.eppt", name << " = \"" << strValue << "\"")do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << name << " = \"" << strValue << "\"") == 1) { ::sal_detail_log( ( ::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2052" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << name << " = \"" << strValue << "\""), 0); } else { ::std::ostringstream sal_detail_stream ; sal_detail_stream << name << " = \"" << strValue << "\""; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2052" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << name << " = \"" << strValue << "\"" ) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt" ), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2052" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << name << " = \"" << strValue << "\""), 0); } else { ::std::ostringstream sal_detail_stream ; sal_detail_stream << name << " = \"" << strValue << "\""; ::sal::detail::log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2052" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
2053 | else if (value >>= intValue) |
2054 | SAL_INFO("sd.eppt", name << " = " << intValue << "(hex : " << std::hex << intValue << ")")do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << name << " = " << intValue << "(hex : " << std::hex << intValue << ")") == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO ), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2054" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << name << " = " << intValue << "(hex : " << std::hex << intValue << ")"), 0); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << name << " = " << intValue << "(hex : " << std::hex << intValue << ")"; ::sal::detail ::log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2054" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << name << " = " << intValue << "(hex : " << std::hex << intValue << ")") == 1) { :: sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ( "/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2054" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << name << " = " << intValue << "(hex : " << std::hex << intValue << ")"), 0); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << name << " = " << intValue << "(hex : " << std::hex << intValue << ")"; ::sal::detail ::log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2054" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
2055 | else if (value >>= boolValue) |
2056 | SAL_INFO("sd.eppt", name << " = " << boolValue << " (bool)")do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << name << " = " << boolValue << " (bool)") == 1) { ::sal_detail_log ( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2056" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << name << " = " << boolValue << " (bool)"), 0); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << name << " = " << boolValue << " (bool)"; ::sal::detail ::log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2056" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << name << " = " << boolValue << " (bool)" ) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt" ), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2056" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << name << " = " << boolValue << " (bool)"), 0); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << name << " = " << boolValue << " (bool)"; ::sal::detail ::log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2056" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
2057 | else if (value >>= pointValue) |
2058 | SAL_INFO("sd.eppt", name << " = " << static_cast<int>(pointValue) << " (RectanglePoint)")do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << name << " = " << static_cast<int>(pointValue) << " (RectanglePoint)" ) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt" ), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2058" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << name << " = " << static_cast <int>(pointValue) << " (RectanglePoint)"), 0); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << name << " = " << static_cast<int> (pointValue) << " (RectanglePoint)"; ::sal::detail:: log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2058" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << name << " = " << static_cast<int> (pointValue) << " (RectanglePoint)") == 1) { ::sal_detail_log ( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2058" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << name << " = " << static_cast <int>(pointValue) << " (RectanglePoint)"), 0); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << name << " = " << static_cast<int> (pointValue) << " (RectanglePoint)"; ::sal::detail:: log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2058" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
2059 | else |
2060 | SAL_INFO("sd.eppt", "??? <unhandled type>")do { if (true) { switch (sal_detail_log_report(::SAL_DETAIL_LOG_LEVEL_INFO , "sd.eppt")) { case SAL_DETAIL_LOG_ACTION_IGNORE: break; case SAL_DETAIL_LOG_ACTION_LOG: if (sizeof ::sal::detail::getResult ( ::sal::detail::StreamStart() << "??? <unhandled type>" ) == 1) { ::sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt" ), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2060" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "??? <unhandled type>" ), 0); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << "??? <unhandled type>"; ::sal::detail ::log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2060" ": "), sal_detail_stream, 0); }; break; case SAL_DETAIL_LOG_ACTION_FATAL : if (sizeof ::sal::detail::getResult( ::sal::detail::StreamStart () << "??? <unhandled type>") == 1) { :: sal_detail_log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ( "/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2060" ": "), ::sal::detail::unwrapStream( ::sal::detail ::StreamStart() << "??? <unhandled type>" ), 0); } else { ::std::ostringstream sal_detail_stream; sal_detail_stream << "??? <unhandled type>"; ::sal::detail ::log( (::SAL_DETAIL_LOG_LEVEL_INFO), ("sd.eppt"), ("/home/maarten/src/libreoffice/core/sd/source/filter/eppt/pptx-epptooxml.cxx" ":" "2060" ": "), sal_detail_stream, 0); }; std::abort(); break ; } } } while (false); |
2061 | } |
2062 | } |
2063 | #endif |
2064 | |
2065 | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |