Line data Source code
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 :
21 : #include "eppt.hxx"
22 : #include "epptdef.hxx"
23 :
24 : #include <comphelper/extract.hxx>
25 : #include <tools/globname.hxx>
26 : #include <tools/datetime.hxx>
27 : #include <tools/poly.hxx>
28 : #include <tools/stream.hxx>
29 : #include <vcl/graph.hxx>
30 : #include <vcl/bmpacc.hxx>
31 : #include <vcl/gradient.hxx>
32 : #include <vcl/virdev.hxx>
33 : #include <rtl/ustring.hxx>
34 : #include <rtl/strbuf.hxx>
35 : #include <svtools/fltcall.hxx>
36 : #include <svtools/wmf.hxx>
37 : #include <sfx2/docfile.hxx>
38 : #include <sfx2/docinf.hxx>
39 : #include <svx/unoapi.hxx>
40 : #include <svx/svdobj.hxx>
41 : #include <svx/svdoole2.hxx>
42 : #include <svx/svdmodel.hxx>
43 : #include <svx/svdpage.hxx>
44 : #include <com/sun/star/view/PaperOrientation.hpp>
45 : #include <com/sun/star/view/PaperFormat.hpp>
46 : #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
47 : #include <com/sun/star/office/XAnnotation.hpp>
48 : #include <com/sun/star/office/XAnnotationAccess.hpp>
49 : #include <com/sun/star/office/XAnnotationEnumeration.hpp>
50 : #include <com/sun/star/geometry/RealPoint2D.hpp>
51 : #include <com/sun/star/util/DateTime.hpp>
52 : #include <com/sun/star/animations/TransitionType.hpp>
53 : #include <com/sun/star/animations/TransitionSubType.hpp>
54 : #include <com/sun/star/awt/FontDescriptor.hpp>
55 : #include <com/sun/star/awt/FontFamily.hpp>
56 : #include <com/sun/star/awt/FontPitch.hpp>
57 : #include <com/sun/star/container/XNamed.hpp>
58 : #include <com/sun/star/container/XNameAccess.hpp>
59 : #include <com/sun/star/presentation/XPresentationPage.hpp>
60 : #include <com/sun/star/text/XSimpleText.hpp>
61 : #include <com/sun/star/style/XStyle.hpp>
62 : #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
63 : #include <editeng/svxenum.hxx>
64 : #include <editeng/flditem.hxx>
65 : #include <sot/storinfo.hxx>
66 : #include <filter/msfilter/msoleexp.hxx>
67 : #include <filter/msfilter/msdffimp.hxx>
68 : #include <filter/msfilter/svxmsbas.hxx>
69 :
70 : #ifdef DEBUG
71 : #define DBG(x) x
72 : #include <stdio.h>
73 : #else
74 : #define DBG(x)
75 : #endif
76 :
77 : using namespace com::sun::star;
78 :
79 : using namespace ::com::sun::star::animations;
80 : using namespace ::com::sun::star::awt::FontFamily;
81 : using namespace ::com::sun::star::awt::FontPitch;
82 : using namespace ::com::sun::star::presentation;
83 :
84 : using ::com::sun::star::awt::FontDescriptor;
85 : using ::com::sun::star::beans::XPropertySet;
86 : using ::com::sun::star::container::XNameAccess;
87 : using ::com::sun::star::container::XNamed;
88 : using ::com::sun::star::drawing::XDrawPagesSupplier;
89 : using ::com::sun::star::drawing::XMasterPagesSupplier;
90 : using ::com::sun::star::drawing::XShapes;
91 : using ::com::sun::star::drawing::XMasterPageTarget;
92 : using ::com::sun::star::drawing::XDrawPage;
93 : using ::com::sun::star::frame::XModel;
94 : using ::com::sun::star::style::XStyleFamiliesSupplier;
95 : using ::com::sun::star::style::XStyle;
96 : using ::com::sun::star::task::XStatusIndicator;
97 : using ::com::sun::star::text::XSimpleText;
98 : using ::com::sun::star::uno::Any;
99 : using ::com::sun::star::uno::Exception;
100 : using ::com::sun::star::uno::Reference;
101 : using ::com::sun::star::uno::UNO_QUERY;
102 :
103 : static PHLayout pPHLayout[] =
104 : {
105 : { EPP_LAYOUT_TITLESLIDE, { 0x0d, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x10, sal_True, sal_True, sal_False },
106 : { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, sal_True, sal_True, sal_False },
107 : { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, sal_True, sal_True, sal_False },
108 : { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, sal_True, sal_True, sal_True },
109 : { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, sal_True, sal_True, sal_False },
110 : { EPP_LAYOUT_BLANCSLIDE, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, sal_False, sal_False, sal_False },
111 : { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x0e, sal_True, sal_True, sal_False },
112 : { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x14, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, sal_True, sal_True, sal_False },
113 : { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x15, 0x0d, 0x0e, sal_True, sal_False, sal_False },
114 : { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x16, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x0e, sal_True, sal_True, sal_False },
115 : { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_True, sal_False },
116 : { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_False, sal_False },
117 : { EPP_LAYOUT_RIGHTCOLUMN2ROWS, { 0x0d, 0x0e, 0x13, 0x13, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_True, sal_False },
118 : { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_True, sal_False },
119 : { EPP_LAYOUT_2ROWSANDTITLE, { 0x0d, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_True, sal_False },
120 : { EPP_LAYOUT_LEFTCOLUMN2ROWS, { 0x0d, 0x13, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_True, sal_False },
121 : { EPP_LAYOUT_TOPROW2COLUMN, { 0x0d, 0x13, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_True, sal_False },
122 : { EPP_LAYOUT_2ROWSANDTITLE, { 0x0d, 0x0e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_True, sal_False },
123 : { EPP_LAYOUT_4OBJECTS, { 0x0d, 0x13, 0x13, 0x13, 0x13, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_False, sal_False },
124 : { EPP_LAYOUT_ONLYTITLE, { 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, sal_True, sal_False, sal_False },
125 : { EPP_LAYOUT_BLANCSLIDE, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, sal_False, sal_False, sal_False },
126 : { EPP_LAYOUT_TITLERIGHT2BODIESLEFT, { 0x11, 0x12, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x11, 0x12, sal_True, sal_True, sal_False },
127 : { EPP_LAYOUT_TITLERIGHTBODYLEFT, { 0x11, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x11, 0x12, sal_True, sal_True, sal_False },
128 : { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x12, sal_True, sal_True, sal_False },
129 : { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x16, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x12, sal_True, sal_True, sal_False }
130 : };
131 :
132 : #define PPT_WRITER_BASE_INIT_VALUES \
133 : maFraction ( 1, 576 ), \
134 : maMapModeSrc ( MAP_100TH_MM ), \
135 : maMapModeDest ( MAP_INCH, Point(), maFraction, maFraction ), \
136 : meLatestPageType ( NORMAL )
137 :
138 0 : PPTWriterBase::PPTWriterBase() :
139 0 : PPT_WRITER_BASE_INIT_VALUES
140 : {
141 : DBG(printf ("PPTWriterBase::PPTWriterBase()\n"));
142 0 : }
143 :
144 0 : PPTWriterBase::PPTWriterBase( const Reference< XModel > & rXModel,
145 : const Reference< XStatusIndicator > & rXStatInd ) :
146 : mXModel ( rXModel ),
147 : mXStatusIndicator ( rXStatInd ),
148 : mbStatusIndicator ( false ),
149 0 : PPT_WRITER_BASE_INIT_VALUES
150 : {
151 0 : }
152 :
153 : // ---------------------------------------------------------------------------------------------
154 :
155 0 : PPTWriterBase::~PPTWriterBase()
156 : {
157 : // Possibly unnecessary sanity check for mXStatusIndicator.is().
158 : // In 3.3 we had a bug report of a crash where it was null,
159 : // https://bugzilla.novell.com/show_bug.cgi?id=694119 (non-public,
160 : // bug report, sorry).
161 0 : if ( mbStatusIndicator && mXStatusIndicator.is() )
162 0 : mXStatusIndicator->end();
163 0 : }
164 :
165 : // ---------------------------------------------------------------------------------------------
166 :
167 0 : void PPTWriterBase::exportPPT( const std::vector< com::sun::star::beans::PropertyValue >& rMediaData )
168 : {
169 0 : if ( !InitSOIface() )
170 : return;
171 :
172 : FontCollectionEntry aDefaultFontDesc( rtl::OUString( "Times New Roman" ),
173 : ROMAN,
174 : awt::FontPitch::VARIABLE,
175 0 : RTL_TEXTENCODING_MS_1252 );
176 0 : maFontCollection.GetId( aDefaultFontDesc ); // default is always times new roman
177 :
178 0 : if ( !GetPageByIndex( 0, NOTICE ) )
179 : return;
180 :
181 0 : sal_Int32 nWidth = 21000;
182 0 : if ( ImplGetPropertyValue( mXPagePropSet, rtl::OUString( "Width" ) ) )
183 0 : mAny >>= nWidth;
184 0 : sal_Int32 nHeight = 29700;
185 0 : if ( ImplGetPropertyValue( mXPagePropSet, rtl::OUString( "Height" ) ) )
186 0 : mAny >>= nHeight;
187 :
188 0 : maNotesPageSize = MapSize( awt::Size( nWidth, nHeight ) );
189 :
190 0 : if ( !GetPageByIndex( 0, MASTER ) )
191 : return;
192 :
193 0 : nWidth = 28000;
194 0 : if ( ImplGetPropertyValue( mXPagePropSet, rtl::OUString( "Width" ) ) )
195 0 : mAny >>= nWidth;
196 0 : nHeight = 21000;
197 0 : if ( ImplGetPropertyValue( mXPagePropSet, rtl::OUString( "Height" ) ) )
198 0 : mAny >>= nHeight;
199 0 : maDestPageSize = MapSize( awt::Size( nWidth, nHeight ) );
200 :
201 : DBG(printf( "call exportDocumentPre()\n"));
202 0 : exportPPTPre(rMediaData);
203 :
204 0 : if ( !GetStyleSheets() )
205 : return;
206 :
207 0 : if ( !ImplCreateDocument() )
208 : return;
209 :
210 : sal_uInt32 i;
211 :
212 0 : for ( i = 0; i < mnPages; i++ )
213 : {
214 0 : if ( GetPageByIndex( i, NORMAL ) ) {
215 0 : sal_uInt32 nMasterNum = GetMasterIndex( NORMAL );
216 0 : ImplWriteLayout( GetLayoutOffset( mXPagePropSet ), nMasterNum );
217 : }
218 : }
219 :
220 0 : for ( i = 0; i < mnMasterPages; i++ )
221 : {
222 0 : if ( !CreateSlideMaster( i ) )
223 : return;
224 : }
225 0 : if ( !CreateMainNotes() )
226 : return;
227 :
228 0 : for ( i = 0; i < mnPages; i++ )
229 : {
230 : DBG(printf( "call ImplCreateSlide( %" SAL_PRIuUINT32 " )\n", i));
231 0 : if ( !CreateSlide( i ) )
232 : return;
233 : }
234 :
235 0 : for ( i = 0; i < mnPages; i++ )
236 : {
237 0 : if ( !CreateNotes( i ) )
238 : return;
239 : }
240 :
241 : DBG(printf( "call exportDocumentPost()\n"));
242 0 : exportPPTPost();
243 : }
244 :
245 : // ---------------------------------------------------------------------------------------------
246 :
247 0 : sal_Bool PPTWriterBase::InitSOIface()
248 : {
249 : while( sal_True )
250 : {
251 0 : mXDrawPagesSupplier = Reference< XDrawPagesSupplier >( mXModel, UNO_QUERY );
252 0 : if ( !mXDrawPagesSupplier.is() )
253 0 : break;
254 :
255 0 : mXMasterPagesSupplier = Reference< XMasterPagesSupplier >( mXModel, UNO_QUERY );
256 0 : if ( !mXMasterPagesSupplier.is() )
257 0 : break;
258 0 : mXDrawPages = mXMasterPagesSupplier->getMasterPages();
259 0 : if ( !mXDrawPages.is() )
260 0 : break;
261 0 : mnMasterPages = mXDrawPages->getCount();
262 0 : mXDrawPages = mXDrawPagesSupplier->getDrawPages();
263 0 : if( !mXDrawPages.is() )
264 0 : break;
265 0 : mnPages = mXDrawPages->getCount();
266 0 : if ( !GetPageByIndex( 0, NORMAL ) )
267 0 : break;
268 :
269 0 : return sal_True;
270 : }
271 0 : return sal_False;
272 : }
273 :
274 : // ---------------------------------------------------------------------------------------------
275 :
276 0 : sal_Bool PPTWriterBase::GetPageByIndex( sal_uInt32 nIndex, PageType ePageType )
277 : {
278 : while( sal_True )
279 : {
280 0 : if ( ePageType != meLatestPageType )
281 : {
282 0 : switch( ePageType )
283 : {
284 : case NORMAL :
285 : case NOTICE :
286 : {
287 0 : mXDrawPages = mXDrawPagesSupplier->getDrawPages();
288 0 : if( !mXDrawPages.is() )
289 0 : return sal_False;
290 : }
291 0 : break;
292 :
293 : case MASTER :
294 : {
295 0 : mXDrawPages = mXMasterPagesSupplier->getMasterPages();
296 0 : if( !mXDrawPages.is() )
297 0 : return sal_False;
298 : }
299 0 : break;
300 : default:
301 0 : break;
302 : }
303 0 : meLatestPageType = ePageType;
304 : }
305 0 : Any aAny( mXDrawPages->getByIndex( nIndex ) );
306 0 : aAny >>= mXDrawPage;
307 0 : if ( !mXDrawPage.is() )
308 : break;
309 0 : if ( ePageType == NOTICE )
310 : {
311 0 : Reference< XPresentationPage > aXPresentationPage( mXDrawPage, UNO_QUERY );
312 0 : if ( !aXPresentationPage.is() )
313 : break;
314 0 : mXDrawPage = aXPresentationPage->getNotesPage();
315 0 : if ( !mXDrawPage.is() )
316 0 : break;
317 : }
318 0 : mXPagePropSet = Reference< XPropertySet >( mXDrawPage, UNO_QUERY );
319 0 : if ( !mXPagePropSet.is() )
320 : break;
321 :
322 0 : mXShapes = Reference< XShapes >( mXDrawPage, UNO_QUERY );
323 0 : if ( !mXShapes.is() )
324 : break;
325 :
326 : /* try to get the "real" background PropertySet. If the normal page is not supporting this property, it is
327 : taken the property from the master */
328 0 : sal_Bool bHasBackground = GetPropertyValue( aAny, mXPagePropSet, rtl::OUString( "Background" ), sal_True );
329 0 : if ( bHasBackground )
330 0 : bHasBackground = ( aAny >>= mXBackgroundPropSet );
331 0 : if ( !bHasBackground )
332 : {
333 0 : Reference< XMasterPageTarget > aXMasterPageTarget( mXDrawPage, UNO_QUERY );
334 0 : if ( aXMasterPageTarget.is() )
335 : {
336 0 : Reference< XDrawPage > aXMasterDrawPage;
337 0 : aXMasterDrawPage = aXMasterPageTarget->getMasterPage();
338 0 : if ( aXMasterDrawPage.is() )
339 : {
340 0 : Reference< XPropertySet > aXMasterPagePropSet;
341 : aXMasterPagePropSet = Reference< XPropertySet >
342 0 : ( aXMasterDrawPage, UNO_QUERY );
343 0 : if ( aXMasterPagePropSet.is() )
344 : {
345 0 : sal_Bool bBackground = GetPropertyValue( aAny, aXMasterPagePropSet, rtl::OUString( "Background" ) );
346 0 : if ( bBackground )
347 : {
348 0 : aAny >>= mXBackgroundPropSet;
349 : }
350 0 : }
351 0 : }
352 0 : }
353 : }
354 0 : return sal_True;
355 0 : }
356 0 : return sal_False;
357 : }
358 :
359 : // ---------------------------------------------------------------------------------------------
360 :
361 0 : sal_Bool PPTWriterBase::CreateSlide( sal_uInt32 nPageNum )
362 : {
363 0 : Any aAny;
364 :
365 0 : if ( !GetPageByIndex( nPageNum, NORMAL ) )
366 0 : return sal_False;
367 :
368 0 : sal_uInt32 nMasterNum = GetMasterIndex( NORMAL );
369 0 : SetCurrentStyleSheet( nMasterNum );
370 :
371 0 : Reference< XPropertySet > aXBackgroundPropSet;
372 0 : sal_Bool bHasBackground = GetPropertyValue( aAny, mXPagePropSet, rtl::OUString( "Background" ) );
373 0 : if ( bHasBackground )
374 0 : bHasBackground = ( aAny >>= aXBackgroundPropSet );
375 :
376 0 : sal_uInt16 nMode = 7; // Bit 1: Follow master objects, Bit 2: Follow master scheme, Bit 3: Follow master background
377 0 : if ( bHasBackground )
378 0 : nMode &=~4;
379 :
380 : /* sj: Don't know what's IsBackgroundVisible for, have to ask cl
381 : if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundVisible" ) ) ) )
382 : {
383 : sal_Bool bBackgroundVisible;
384 : if ( aAny >>= bBackgroundVisible )
385 : {
386 : if ( bBackgroundVisible )
387 : nMode &= ~4;
388 : }
389 : }
390 : */
391 0 : if ( GetPropertyValue( aAny, mXPagePropSet, rtl::OUString( "IsBackgroundObjectsVisible" ) ) )
392 : {
393 0 : sal_Bool bBackgroundObjectsVisible = sal_False;
394 0 : if ( aAny >>= bBackgroundObjectsVisible )
395 : {
396 0 : if ( !bBackgroundObjectsVisible )
397 0 : nMode &= ~1;
398 : }
399 : }
400 :
401 0 : ImplWriteSlide( nPageNum, nMasterNum, nMode, bHasBackground, aXBackgroundPropSet );
402 :
403 0 : return sal_True;
404 : };
405 :
406 : // ---------------------------------------------------------------------------------------------
407 :
408 0 : sal_Bool PPTWriterBase::CreateNotes( sal_uInt32 nPageNum )
409 : {
410 0 : if ( !GetPageByIndex( nPageNum, NOTICE ) )
411 0 : return sal_False;
412 0 : SetCurrentStyleSheet( GetMasterIndex( NORMAL ) );
413 :
414 0 : ImplWriteNotes( nPageNum );
415 :
416 0 : return sal_True;
417 : };
418 :
419 : // ---------------------------------------------------------------------------------------------
420 :
421 0 : sal_Bool PPTWriterBase::CreateSlideMaster( sal_uInt32 nPageNum )
422 : {
423 0 : if ( !GetPageByIndex( nPageNum, MASTER ) )
424 0 : return sal_False;
425 0 : SetCurrentStyleSheet( nPageNum );
426 :
427 0 : if ( !ImplGetPropertyValue( mXPagePropSet, rtl::OUString( "Background" ) ) ) // Backgroundshape laden
428 0 : return sal_False;
429 0 : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > aXBackgroundPropSet;
430 0 : if ( !( mAny >>= aXBackgroundPropSet ) )
431 0 : return sal_False;
432 :
433 0 : ImplWriteSlideMaster( nPageNum, aXBackgroundPropSet );
434 :
435 0 : return sal_True;
436 : };
437 :
438 : // ---------------------------------------------------------------------------------------------
439 :
440 0 : sal_Int32 PPTWriterBase::GetLayoutOffset( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rXPropSet ) const
441 : {
442 0 : ::com::sun::star::uno::Any aAny;
443 0 : sal_Int32 nLayout = 20;
444 0 : if ( GetPropertyValue( aAny, rXPropSet, rtl::OUString( "Layout" ) ), sal_True )
445 0 : aAny >>= nLayout;
446 :
447 : DBG(printf("GetLayoutOffset %" SAL_PRIdINT32 "\n", nLayout));
448 :
449 0 : return nLayout;
450 : }
451 :
452 0 : sal_Int32 PPTWriterBase::GetLayoutOffsetFixed( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rXPropSet ) const
453 : {
454 0 : sal_Int32 nLayout = GetLayoutOffset( rXPropSet );
455 :
456 0 : if ( ( nLayout >= 21 ) && ( nLayout <= 26 ) ) // NOTES _> HANDOUT6
457 0 : nLayout = 20;
458 0 : if ( ( nLayout >= 27 ) && ( nLayout <= 30 ) ) // VERTICAL LAYOUT
459 0 : nLayout -= 6;
460 0 : else if ( nLayout > 30 )
461 0 : nLayout = 20;
462 :
463 0 : return nLayout;
464 : }
465 :
466 0 : PHLayout& PPTWriterBase::GetLayout( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rXPropSet ) const
467 : {
468 0 : return pPHLayout[ GetLayoutOffsetFixed( rXPropSet ) ];
469 : }
470 :
471 : // ---------------------------------------------------------------------------------------------
472 :
473 0 : PHLayout& PPTWriterBase::GetLayout( sal_Int32 nOffset ) const
474 : {
475 0 : if( nOffset >= 0 && nOffset < EPP_LAYOUT_SIZE )
476 0 : return pPHLayout[ nOffset ];
477 :
478 : DBG(printf("asked %" SAL_PRIdINT32 " for layout outside of 0,%d array scope\n", nOffset, EPP_LAYOUT_SIZE ));
479 :
480 0 : return pPHLayout[ 0 ];
481 : }
482 :
483 : // ---------------------------------------------------------------------------------------------
484 :
485 0 : sal_uInt32 PPTWriterBase::GetMasterIndex( PageType ePageType )
486 : {
487 0 : sal_uInt32 nRetValue = 0;
488 : ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XMasterPageTarget >
489 0 : aXMasterPageTarget( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
490 :
491 0 : if ( aXMasterPageTarget.is() )
492 : {
493 : ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >
494 0 : aXDrawPage = aXMasterPageTarget->getMasterPage();
495 0 : if ( aXDrawPage.is() )
496 : {
497 : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
498 0 : aXPropertySet( aXDrawPage, ::com::sun::star::uno::UNO_QUERY );
499 :
500 0 : if ( aXPropertySet.is() )
501 : {
502 0 : if ( ImplGetPropertyValue( aXPropertySet, rtl::OUString( "Number" ) ) )
503 0 : nRetValue |= *(sal_Int16*)mAny.getValue();
504 0 : if ( nRetValue & 0xffff ) // ueberlauf vermeiden
505 0 : nRetValue--;
506 0 : }
507 0 : }
508 : }
509 0 : if ( ePageType == NOTICE )
510 0 : nRetValue += mnMasterPages;
511 0 : return nRetValue;
512 : }
513 :
514 : // -----------------------------------------------------------------------
515 :
516 0 : sal_Bool PPTWriterBase::SetCurrentStyleSheet( sal_uInt32 nPageNum )
517 : {
518 0 : sal_Bool bRet = sal_False;
519 0 : if ( nPageNum >= maStyleSheetList.size() )
520 0 : nPageNum = 0;
521 : else
522 0 : bRet = sal_True;
523 0 : mpStyleSheet = maStyleSheetList[ nPageNum ];
524 0 : return bRet;
525 : }
526 :
527 : // ---------------------------------------------------------------------------------------------
528 :
529 0 : sal_Bool PPTWriterBase::GetStyleSheets()
530 : {
531 : int nInstance, nLevel;
532 0 : sal_Bool bRetValue = sal_False;
533 : sal_uInt32 nPageNum;
534 :
535 0 : for ( nPageNum = 0; nPageNum < mnMasterPages; nPageNum++ )
536 : {
537 : Reference< XNamed >
538 0 : aXNamed;
539 :
540 : Reference< XNameAccess >
541 0 : aXNameAccess;
542 :
543 : Reference< XStyleFamiliesSupplier >
544 0 : aXStyleFamiliesSupplier( mXModel, UNO_QUERY );
545 :
546 : Reference< XPropertySet >
547 0 : aXPropSet( mXModel, UNO_QUERY );
548 :
549 0 : sal_uInt16 nDefaultTab = ( aXPropSet.is() && ImplGetPropertyValue( aXPropSet, rtl::OUString( "TabStop" ) ) )
550 0 : ? (sal_uInt16)( *(sal_Int32*)mAny.getValue() / 4.40972 )
551 0 : : 1250;
552 :
553 0 : maStyleSheetList.push_back( new PPTExStyleSheet( nDefaultTab, (PPTExBulletProvider&)*this ) );
554 0 : SetCurrentStyleSheet( nPageNum );
555 0 : if ( GetPageByIndex( nPageNum, MASTER ) )
556 : aXNamed = Reference< XNamed >
557 0 : ( mXDrawPage, UNO_QUERY );
558 :
559 0 : if ( aXStyleFamiliesSupplier.is() )
560 0 : aXNameAccess = aXStyleFamiliesSupplier->getStyleFamilies();
561 :
562 0 : bRetValue = aXNamed.is() && aXNameAccess.is() && aXStyleFamiliesSupplier.is();
563 0 : if ( bRetValue )
564 : {
565 0 : for ( nInstance = EPP_TEXTTYPE_Title; nInstance <= EPP_TEXTTYPE_CenterTitle; nInstance++ )
566 : {
567 0 : String aStyle;
568 0 : String aFamily;
569 0 : switch ( nInstance )
570 : {
571 : case EPP_TEXTTYPE_CenterTitle :
572 : case EPP_TEXTTYPE_Title :
573 : {
574 0 : aStyle = rtl::OUString( "title" );
575 0 : aFamily = aXNamed->getName();
576 : }
577 0 : break;
578 : case EPP_TEXTTYPE_Body :
579 : {
580 0 : aStyle = rtl::OUString( "outline1" ); // SD_LT_SEPARATOR
581 0 : aFamily = aXNamed->getName();
582 : }
583 0 : break;
584 : case EPP_TEXTTYPE_Other :
585 : {
586 0 : aStyle = rtl::OUString( "standard" );
587 0 : aFamily = rtl::OUString( "graphics" );
588 : }
589 0 : break;
590 : case EPP_TEXTTYPE_CenterBody :
591 : {
592 0 : aStyle = rtl::OUString( "subtitle" );
593 0 : aFamily = aXNamed->getName();
594 : }
595 0 : break;
596 : }
597 0 : if ( aStyle.Len() && aFamily.Len() )
598 : {
599 : try
600 : {
601 0 : Reference< XNameAccess >xNameAccess;
602 0 : if ( aXNameAccess->hasByName( aFamily ) )
603 : {
604 0 : Any aAny( aXNameAccess->getByName( aFamily ) );
605 0 : if( aAny.getValue() && ::cppu::extractInterface( xNameAccess, aAny ) )
606 : {
607 0 : Reference< XNameAccess > aXFamily;
608 0 : if ( aAny >>= aXFamily )
609 : {
610 0 : if ( aXFamily->hasByName( aStyle ) )
611 : {
612 0 : Reference< XStyle > xStyle;
613 0 : aAny = aXFamily->getByName( aStyle );
614 0 : if( aAny.getValue() && ::cppu::extractInterface( xStyle, aAny ) )
615 : {
616 0 : Reference< XStyle > aXStyle;
617 0 : aAny >>= aXStyle;
618 : Reference< XPropertySet >
619 0 : xPropSet( aXStyle, UNO_QUERY );
620 0 : if( xPropSet.is() )
621 0 : mpStyleSheet->SetStyleSheet( xPropSet, maFontCollection, nInstance, 0 );
622 0 : for ( nLevel = 1; nLevel < 5; nLevel++ )
623 : {
624 0 : if ( nInstance == EPP_TEXTTYPE_Body )
625 : {
626 0 : sal_Unicode cTemp = aStyle.GetChar( aStyle.Len() - 1 );
627 0 : aStyle.SetChar( aStyle.Len() - 1, ++cTemp );
628 0 : if ( aXFamily->hasByName( aStyle ) )
629 : {
630 0 : aXFamily->getByName( aStyle ) >>= xStyle;
631 0 : if( xStyle.is() )
632 : {
633 : Reference< XPropertySet >
634 0 : xPropertySet( xStyle, UNO_QUERY );
635 0 : if ( xPropertySet.is() )
636 0 : mpStyleSheet->SetStyleSheet( xPropertySet, maFontCollection, nInstance, nLevel );
637 : }
638 : }
639 : }
640 : else
641 0 : mpStyleSheet->SetStyleSheet( xPropSet, maFontCollection, nInstance, nLevel );
642 0 : }
643 0 : }
644 : }
645 0 : }
646 0 : }
647 0 : }
648 : }
649 0 : catch( Exception& )
650 : {
651 : //
652 : }
653 : }
654 0 : }
655 0 : for ( ; nInstance <= EPP_TEXTTYPE_QuarterBody; nInstance++ )
656 : {
657 :
658 : }
659 : }
660 0 : }
661 0 : return bRetValue;
662 : }
663 :
664 : // -----------------------------------------------------------------------
665 :
666 0 : sal_Bool PPTWriterBase::CreateMainNotes()
667 : {
668 0 : if ( !GetPageByIndex( 0, NOTICE ) )
669 0 : return sal_False;
670 0 : SetCurrentStyleSheet( 0 );
671 :
672 : ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XMasterPageTarget >
673 0 : aXMasterPageTarget( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
674 :
675 0 : if ( !aXMasterPageTarget.is() )
676 0 : return sal_False;
677 :
678 0 : mXDrawPage = aXMasterPageTarget->getMasterPage();
679 0 : if ( !mXDrawPage.is() )
680 0 : return sal_False;
681 :
682 : mXPropSet = ::com::sun::star::uno::Reference<
683 : ::com::sun::star::beans::XPropertySet >
684 0 : ( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
685 0 : if ( !mXPropSet.is() )
686 0 : return sal_False;
687 :
688 : mXShapes = ::com::sun::star::uno::Reference<
689 : ::com::sun::star::drawing::XShapes >
690 0 : ( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
691 0 : if ( !mXShapes.is() )
692 0 : return sal_False;
693 :
694 0 : return ImplCreateMainNotes();
695 : }
696 :
697 : // -----------------------------------------------------------------------
698 :
699 0 : awt::Size PPTWriterBase::MapSize( const awt::Size& rSize )
700 : {
701 0 : Size aRetSize( OutputDevice::LogicToLogic( Size( rSize.Width, rSize.Height ), maMapModeSrc, maMapModeDest ) );
702 :
703 0 : if ( !aRetSize.Width() )
704 0 : aRetSize.Width()++;
705 0 : if ( !aRetSize.Height() )
706 0 : aRetSize.Height()++;
707 0 : return awt::Size( aRetSize.Width(), aRetSize.Height() );
708 : }
709 :
710 : // -----------------------------------------------------------------------
711 :
712 0 : awt::Point PPTWriterBase::MapPoint( const awt::Point& rPoint )
713 : {
714 0 : Point aRet( OutputDevice::LogicToLogic( Point( rPoint.X, rPoint.Y ), maMapModeSrc, maMapModeDest ) );
715 0 : return awt::Point( aRet.X(), aRet.Y() );
716 : }
717 :
718 : // -----------------------------------------------------------------------
719 :
720 0 : Rectangle PPTWriterBase::MapRectangle( const awt::Rectangle& rRect )
721 : {
722 0 : ::com::sun::star::awt::Point aPoint( rRect.X, rRect.Y );
723 0 : ::com::sun::star::awt::Size aSize( rRect.Width, rRect.Height );
724 0 : ::com::sun::star::awt::Point aP( MapPoint( aPoint ) );
725 0 : ::com::sun::star::awt::Size aS( MapSize( aSize ) );
726 0 : return Rectangle( Point( aP.X, aP.Y ), Size( aS.Width, aS.Height ) );
727 : }
728 :
729 : // -----------------------------------------------------------------------
730 :
731 0 : sal_Bool PPTWriterBase::GetShapeByIndex( sal_uInt32 nIndex, sal_Bool bGroup )
732 : {
733 : while(sal_True)
734 : {
735 0 : if ( ( bGroup == sal_False ) || ( GetCurrentGroupLevel() == 0 ) )
736 : {
737 0 : Any aAny( mXShapes->getByIndex( nIndex ) );
738 0 : aAny >>= mXShape;
739 : }
740 : else
741 : {
742 0 : Any aAny( GetCurrentGroupAccess()->getByIndex( GetCurrentGroupIndex() ) );
743 0 : aAny >>= mXShape;
744 : }
745 0 : if ( !mXShape.is() )
746 : break;
747 :
748 0 : Any aAny( mXShape->queryInterface( ::getCppuType( (const Reference< XPropertySet >*) 0 ) ));
749 0 : aAny >>= mXPropSet;
750 :
751 0 : if ( !mXPropSet.is() )
752 : break;
753 0 : maPosition = MapPoint( mXShape->getPosition() );
754 0 : maSize = MapSize( mXShape->getSize() );
755 0 : maRect = Rectangle( Point( maPosition.X, maPosition.Y ), Size( maSize.Width, maSize.Height ) );
756 :
757 : rtl::OStringBuffer aTypeBuffer(rtl::OUStringToOString(
758 0 : mXShape->getShapeType(), RTL_TEXTENCODING_UTF8));
759 : // "com.sun.star." entfernen
760 0 : aTypeBuffer.remove(0, RTL_CONSTASCII_LENGTH("com.sun.star."));
761 :
762 0 : sal_Int32 nPos = aTypeBuffer.toString().indexOf("Shape");
763 0 : aTypeBuffer.remove(nPos, RTL_CONSTASCII_LENGTH("Shape"));
764 0 : mType = aTypeBuffer.makeStringAndClear();
765 :
766 0 : mbPresObj = mbEmptyPresObj = sal_False;
767 0 : if ( ImplGetPropertyValue( rtl::OUString( "IsPresentationObject" ) ) )
768 0 : mAny >>= mbPresObj;
769 :
770 0 : if ( mbPresObj && ImplGetPropertyValue( rtl::OUString( "IsEmptyPresentationObject" ) ) )
771 0 : mAny >>= mbEmptyPresObj;
772 :
773 : mnAngle = ( PropValue::GetPropertyValue( aAny,
774 0 : mXPropSet, rtl::OUString( "RotateAngle" ), sal_True ) )
775 0 : ? *((sal_Int32*)aAny.getValue() )
776 0 : : 0;
777 :
778 0 : return sal_True;
779 0 : }
780 0 : return sal_False;
781 : }
782 :
783 : // -----------------------------------------------------------------------
784 :
785 0 : sal_Int8 PPTWriterBase::GetTransition( sal_Int16 nTransitionType, sal_Int16 nTransitionSubtype, FadeEffect eEffect, sal_uInt8& nDirection )
786 : {
787 0 : sal_Int8 nPPTTransitionType = 0;
788 0 : nDirection = 0;
789 :
790 0 : switch( nTransitionType )
791 : {
792 : case TransitionType::FADE :
793 : {
794 0 : if ( nTransitionSubtype == TransitionSubType::CROSSFADE )
795 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_SMOOTHFADE;
796 0 : else if ( nTransitionSubtype == TransitionSubType::FADEOVERCOLOR )
797 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_FADE;
798 : }
799 0 : break;
800 : case PPT_TRANSITION_TYPE_COMB :
801 : {
802 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_COMB;
803 0 : if ( nTransitionSubtype == TransitionSubType::COMBVERTICAL )
804 0 : nDirection++;
805 : }
806 0 : break;
807 : case TransitionType::PUSHWIPE :
808 : {
809 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_PUSH;
810 0 : switch( nTransitionSubtype )
811 : {
812 0 : case TransitionSubType::FROMRIGHT: nDirection = 0; break;
813 0 : case TransitionSubType::FROMBOTTOM: nDirection = 1; break;
814 0 : case TransitionSubType::FROMLEFT: nDirection = 2; break;
815 0 : case TransitionSubType::FROMTOP: nDirection = 3; break;
816 : }
817 : }
818 0 : break;
819 : case TransitionType::PINWHEELWIPE :
820 : {
821 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_WHEEL;
822 0 : switch( nTransitionSubtype )
823 : {
824 0 : case TransitionSubType::ONEBLADE: nDirection = 1; break;
825 0 : case TransitionSubType::TWOBLADEVERTICAL : nDirection = 2; break;
826 0 : case TransitionSubType::THREEBLADE : nDirection = 3; break;
827 0 : case TransitionSubType::FOURBLADE: nDirection = 4; break;
828 0 : case TransitionSubType::EIGHTBLADE: nDirection = 8; break;
829 : }
830 : }
831 0 : break;
832 : case TransitionType::FANWIPE :
833 : {
834 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_WEDGE;
835 : }
836 0 : break;
837 : case TransitionType::ELLIPSEWIPE :
838 : {
839 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_CIRCLE;
840 : }
841 0 : break;
842 : case TransitionType::FOURBOXWIPE :
843 : {
844 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_PLUS;
845 : }
846 0 : break;
847 : case TransitionType::IRISWIPE :
848 : {
849 0 : switch( nTransitionSubtype ) {
850 : case TransitionSubType::RECTANGLE:
851 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_ZOOM;
852 0 : nDirection = (eEffect == FadeEffect_FADE_FROM_CENTER) ? 0 : 1;
853 0 : break;
854 : default:
855 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_DIAMOND;
856 0 : break;
857 : }
858 : }
859 0 : break;
860 : }
861 :
862 0 : return nPPTTransitionType;
863 : }
864 :
865 0 : sal_Int8 PPTWriterBase::GetTransition( FadeEffect eEffect, sal_uInt8& nDirection )
866 : {
867 0 : sal_Int8 nPPTTransitionType = 0;
868 :
869 0 : switch ( eEffect )
870 : {
871 : default :
872 : case FadeEffect_RANDOM :
873 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_RANDOM;
874 0 : break;
875 :
876 : case FadeEffect_HORIZONTAL_STRIPES :
877 0 : nDirection++;
878 : case FadeEffect_VERTICAL_STRIPES :
879 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_BLINDS;
880 0 : break;
881 :
882 : case FadeEffect_VERTICAL_CHECKERBOARD :
883 0 : nDirection++;
884 : case FadeEffect_HORIZONTAL_CHECKERBOARD :
885 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_CHECKER;
886 0 : break;
887 :
888 : case FadeEffect_MOVE_FROM_UPPERLEFT :
889 0 : nDirection++;
890 : case FadeEffect_MOVE_FROM_UPPERRIGHT :
891 0 : nDirection++;
892 : case FadeEffect_MOVE_FROM_LOWERLEFT :
893 0 : nDirection++;
894 : case FadeEffect_MOVE_FROM_LOWERRIGHT :
895 0 : nDirection++;
896 : case FadeEffect_MOVE_FROM_TOP :
897 0 : nDirection++;
898 : case FadeEffect_MOVE_FROM_LEFT :
899 0 : nDirection++;
900 : case FadeEffect_MOVE_FROM_BOTTOM :
901 0 : nDirection++;
902 : case FadeEffect_MOVE_FROM_RIGHT :
903 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_COVER;
904 0 : break;
905 :
906 : case FadeEffect_DISSOLVE :
907 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_DISSOLVE;
908 0 : break;
909 :
910 : case FadeEffect_VERTICAL_LINES :
911 0 : nDirection++;
912 : case FadeEffect_HORIZONTAL_LINES :
913 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_RANDOM_BARS;
914 0 : break;
915 :
916 : case FadeEffect_CLOSE_HORIZONTAL :
917 0 : nDirection++;
918 : case FadeEffect_OPEN_HORIZONTAL :
919 0 : nDirection++;
920 : case FadeEffect_CLOSE_VERTICAL :
921 0 : nDirection++;
922 : case FadeEffect_OPEN_VERTICAL :
923 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_SPLIT;
924 0 : break;
925 :
926 : case FadeEffect_FADE_FROM_UPPERLEFT :
927 0 : nDirection++;
928 : case FadeEffect_FADE_FROM_UPPERRIGHT :
929 0 : nDirection++;
930 : case FadeEffect_FADE_FROM_LOWERLEFT :
931 0 : nDirection++;
932 : case FadeEffect_FADE_FROM_LOWERRIGHT :
933 0 : nDirection += 4;
934 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_STRIPS;
935 0 : break;
936 :
937 : case FadeEffect_UNCOVER_TO_LOWERRIGHT :
938 0 : nDirection++;
939 : case FadeEffect_UNCOVER_TO_LOWERLEFT :
940 0 : nDirection++;
941 : case FadeEffect_UNCOVER_TO_UPPERRIGHT :
942 0 : nDirection++;
943 : case FadeEffect_UNCOVER_TO_UPPERLEFT :
944 0 : nDirection++;
945 : case FadeEffect_UNCOVER_TO_BOTTOM :
946 0 : nDirection++;
947 : case FadeEffect_UNCOVER_TO_RIGHT :
948 0 : nDirection++;
949 : case FadeEffect_UNCOVER_TO_TOP :
950 0 : nDirection++;
951 : case FadeEffect_UNCOVER_TO_LEFT :
952 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_PULL;
953 0 : break;
954 :
955 : case FadeEffect_FADE_FROM_TOP :
956 0 : nDirection++;
957 : case FadeEffect_FADE_FROM_LEFT :
958 0 : nDirection++;
959 : case FadeEffect_FADE_FROM_BOTTOM :
960 0 : nDirection++;
961 : case FadeEffect_FADE_FROM_RIGHT :
962 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_WIPE;
963 0 : break;
964 :
965 : case FadeEffect_ROLL_FROM_TOP :
966 0 : nDirection++;
967 : case FadeEffect_ROLL_FROM_LEFT :
968 0 : nDirection++;
969 : case FadeEffect_ROLL_FROM_BOTTOM :
970 0 : nDirection++;
971 : case FadeEffect_ROLL_FROM_RIGHT :
972 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_WIPE;
973 0 : break;
974 :
975 : case FadeEffect_FADE_TO_CENTER :
976 0 : nDirection++;
977 : case FadeEffect_FADE_FROM_CENTER :
978 0 : nPPTTransitionType = PPT_TRANSITION_TYPE_ZOOM;
979 0 : break;
980 :
981 : case FadeEffect_NONE :
982 0 : nDirection = 2;
983 0 : break;
984 : }
985 :
986 0 : return nPPTTransitionType;
987 : }
988 :
989 : // -----------------------------------------------------------------------
990 :
991 0 : sal_Bool PPTWriterBase::ContainsOtherShapeThanPlaceholders( sal_Bool bForOOMLX )
992 : {
993 0 : sal_uInt32 nShapes = mXShapes->getCount();
994 0 : sal_Bool bOtherThanPlaceHolders = sal_False;
995 :
996 0 : if ( nShapes )
997 0 : for ( sal_uInt32 nIndex = 0; ( nIndex < nShapes ) && ( bOtherThanPlaceHolders == sal_False ); nIndex++ ) {
998 0 : if ( GetShapeByIndex( nIndex ) && mType != "drawing.Page" ) {
999 0 : if( bForOOMLX &&
1000 0 : ( mType == "presentation.Page" ||
1001 0 : mType == "presentation.Notes" ) ) {
1002 0 : Reference< XSimpleText > rXText( mXShape, UNO_QUERY );
1003 :
1004 0 : if( rXText.is() && !rXText->getString().isEmpty() )
1005 0 : bOtherThanPlaceHolders = sal_True;
1006 : } else
1007 0 : bOtherThanPlaceHolders = sal_True;
1008 : }
1009 : DBG(printf("mType == %s\n", mType.getStr()));
1010 : }
1011 :
1012 0 : return bOtherThanPlaceHolders;
1013 : }
1014 :
1015 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|