Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #include <editeng/numitem.hxx>
31 : :
32 : : #include <unotools/ucbstreamhelper.hxx>
33 : : #include <vcl/wrkwin.hxx>
34 : : #include <svl/urihelper.hxx>
35 : : #include <svx/svxids.hrc>
36 : : #include <filter/msfilter/svdfppt.hxx>
37 : : #include <svx/svditer.hxx>
38 : : #include <sfx2/docfile.hxx>
39 : : #include <sfx2/app.hxx>
40 : : #include <svx/svdograf.hxx>
41 : : #include <svx/svdlayer.hxx>
42 : : #include <vcl/msgbox.hxx>
43 : : #include <svl/style.hxx>
44 : : #include <svx/xflclit.hxx>
45 : : #include <editeng/eeitem.hxx>
46 : : #include <editeng/colritem.hxx>
47 : : #include <svl/whiter.hxx>
48 : : #include <svx/xgrad.hxx>
49 : : #include <svx/xflgrit.hxx>
50 : : #include <svx/xbtmpit.hxx>
51 : : #include <svx/xlnclit.hxx>
52 : : #include <editeng/adjitem.hxx>
53 : : #include <editeng/editeng.hxx>
54 : : #include <editeng/bulitem.hxx>
55 : : #include <editeng/lrspitem.hxx>
56 : : #include <editeng/lspcitem.hxx>
57 : : #include <editeng/tstpitem.hxx>
58 : :
59 : : #include <sfx2/docinf.hxx>
60 : :
61 : : #include "glob.hrc"
62 : : #include "pptin.hxx"
63 : : #include "Outliner.hxx"
64 : : #include "drawdoc.hxx"
65 : : #include "sdpage.hxx"
66 : : #include "sdresid.hxx"
67 : : #include "pres.hxx"
68 : : #include "stlpool.hxx"
69 : : #include "anminfo.hxx"
70 : : #include <svx/gallery.hxx>
71 : : #include <tools/urlobj.hxx>
72 : : #include <svl/itempool.hxx>
73 : : #include <editeng/fhgtitem.hxx>
74 : : #include <svx/svdopage.hxx>
75 : : #include <svx/svdomedia.hxx>
76 : : #include <svx/svdogrp.hxx>
77 : : #include "propread.hxx"
78 : : #include <cusshow.hxx>
79 : : #include <vcl/bmpacc.hxx>
80 : : #include "customshowlist.hxx"
81 : :
82 : : #include "../../ui/inc/DrawDocShell.hxx"
83 : : #include "../../ui/inc/FrameView.hxx"
84 : : #include "../../ui/inc/optsitem.hxx"
85 : :
86 : : #include <unotools/fltrcfg.hxx>
87 : : #include <sfx2/progress.hxx>
88 : : #include <unotools/localfilehelper.hxx>
89 : : #include <editeng/editstat.hxx>
90 : : #include <unotools/pathoptions.hxx>
91 : : #include <sfx2/docfac.hxx>
92 : : #define MAX_USER_MOVE 2
93 : :
94 : : #include "pptinanimations.hxx"
95 : : #include "ppt97animations.hxx"
96 : :
97 : : #include <com/sun/star/document/XDocumentProperties.hpp>
98 : : #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
99 : :
100 : : #include <comphelper/processfactory.hxx>
101 : : #include <comphelper/componentcontext.hxx>
102 : : #include <comphelper/string.hxx>
103 : : #include <oox/ole/olehelper.hxx>
104 : :
105 : : using namespace ::com::sun::star;
106 : :
107 : : uno::Reference< uno::XComponentContext >
108 : 0 : lcl_getUnoCtx()
109 : : {
110 [ # # ][ # # ]: 0 : comphelper::ComponentContext aCtx( ::comphelper::getProcessServiceFactory() );
111 [ # # ][ # # ]: 0 : return aCtx.getUNOContext();
112 : : }
113 : :
114 : 15 : SdPPTImport::SdPPTImport( SdDrawDocument* pDocument, SvStream& rDocStream, SvStorage& rStorage, SfxMedium& rMedium )
115 : : {
116 : :
117 : 15 : sal_uInt32 nImportFlags = 0;
118 : :
119 : : #ifdef DBG_UTIL
120 : : PropRead* pSummaryInformation = new PropRead( rStorage, String( "\005SummaryInformation" ) );
121 : : if ( pSummaryInformation->IsValid() )
122 : : {
123 : : pSummaryInformation->Read();
124 : : sal_uInt8 aPropSetGUID[ 16 ] =
125 : : {
126 : : 0xe0, 0x85, 0x9f, 0xf2, 0xf9, 0x4f, 0x68, 0x10, 0xab, 0x91, 0x08, 0x00, 0x2b, 0x27, 0xb3, 0xd9
127 : : };
128 : : Section* pSection = (Section*)pSummaryInformation->GetSection( aPropSetGUID );
129 : : if ( pSection )
130 : : {
131 : : PropItem aPropItem;
132 : : if ( pSection->GetProperty( PID_COMMENTS, aPropItem ) )
133 : : {
134 : : String aComment;
135 : : aPropItem.Read( aComment );
136 : : if ( aComment.Search( String( "Applixware" ), 0 ) != STRING_NOTFOUND )
137 : : {
138 : : nImportFlags |= PPT_IMPORTFLAGS_NO_TEXT_ASSERT;
139 : : }
140 : : }
141 : : }
142 : : }
143 : : delete pSummaryInformation;
144 : : #endif
145 : :
146 [ + - ]: 15 : PowerPointImportParam aParam( rDocStream, nImportFlags );
147 [ + - ][ + - ]: 15 : SvStream* pCurrentUserStream = rStorage.OpenSotStream( rtl::OUString( "Current User" ), STREAM_STD_READ );
[ + - ]
148 [ + - ]: 15 : if( pCurrentUserStream )
149 : : {
150 [ + - ]: 15 : *pCurrentUserStream >> aParam.aCurrentUserAtom;
151 [ + - ][ + - ]: 15 : delete pCurrentUserStream;
152 : : }
153 : :
154 [ + - ]: 15 : if( pDocument )
155 : : {
156 : : // iterate over all styles
157 [ + - ]: 15 : SdStyleSheetPool* pStyleSheetPool = pDocument->GetSdStyleSheetPool();
158 : :
159 [ + - ][ + - ]: 15 : sal_uInt32 nStyles = pStyleSheetPool ? pStyleSheetPool->GetStyles().size() : 0;
160 [ + + ]: 1170 : for (sal_uInt32 nStyle = 0; nStyle < nStyles; nStyle++)
161 : : {
162 [ + - ]: 1155 : SfxStyleSheet* pSheet = static_cast<SfxStyleSheet*>( pStyleSheetPool->GetStyles()[nStyle].get() );
163 [ + - ]: 1155 : SfxItemSet& rSet = pSheet->GetItemSet();
164 : :
165 : : // if autokerning is set in style, override it, ppt has no autokerning
166 [ + - ][ + + ]: 1155 : if( rSet.GetItemState( EE_CHAR_PAIRKERNING, sal_False ) == SFX_ITEM_SET )
167 [ + - ]: 120 : rSet.ClearItem( EE_CHAR_PAIRKERNING );
168 : : }
169 : : }
170 : :
171 [ + - ][ + - ]: 15 : pFilter = new ImplSdPPTImport( pDocument, rStorage, rMedium, aParam );
[ + - ]
172 : 15 : }
173 : :
174 : 15 : sal_Bool SdPPTImport::Import()
175 : : {
176 : 15 : return pFilter->Import();
177 : : }
178 : :
179 : 15 : SdPPTImport::~SdPPTImport()
180 : : {
181 [ + - ]: 15 : delete pFilter;
182 : 15 : }
183 : :
184 : 15 : ImplSdPPTImport::ImplSdPPTImport( SdDrawDocument* pDocument, SvStorage& rStorage_, SfxMedium& rMedium, PowerPointImportParam& rParam )
185 : : : SdrPowerPointImport ( rParam, rMedium.GetBaseURL() )
186 : : , mrMed ( rMedium )
187 : : , mrStorage ( rStorage_ )
188 : : , mbDocumentFound ( sal_False )
189 [ + - ][ + - ]: 15 : , mnFilterOptions ( 0 )
[ + - ][ + - ]
[ + - ]
190 : : {
191 : 15 : mpDoc = pDocument;
192 [ + + ]: 15 : if ( bOk )
193 : : {
194 [ + - ]: 12 : mbDocumentFound = SeekToDocument( &maDocHd ); // maDocHd = the latest DocumentHeader
195 [ + - ][ - + ]: 12 : while ( SeekToRec( rStCtrl, PPT_PST_Document, nStreamLen, &maDocHd ) )
196 : 0 : mbDocumentFound = sal_True;
197 : :
198 : 12 : sal_uInt32 nDggContainerOfs = 0;
199 : :
200 [ + - ]: 12 : if ( mbDocumentFound )
201 : : {
202 : 12 : sal_uLong nPosMerk = rStCtrl.Tell();
203 : :
204 [ + - ][ + - ]: 12 : pStData = rStorage_.OpenSotStream( rtl::OUString( "Pictures" ), STREAM_STD_READ );
[ + - ]
205 : :
206 [ + - ]: 12 : rStCtrl.Seek( maDocHd.GetRecBegFilePos() + 8 );
207 : 12 : sal_uLong nDocLen = maDocHd.GetRecEndFilePos();
208 : 12 : DffRecordHeader aPPDGHd;
209 [ + - ][ + - ]: 12 : if ( SeekToRec( rStCtrl, PPT_PST_PPDrawingGroup, nDocLen, &aPPDGHd ) )
210 : : {
211 : 12 : sal_uLong nPPDGLen = aPPDGHd.GetRecEndFilePos();
212 [ + - ][ + - ]: 12 : if ( SeekToRec( rStCtrl, DFF_msofbtDggContainer, nPPDGLen, NULL ) )
213 : 12 : nDggContainerOfs = rStCtrl.Tell();
214 : : }
215 [ + - ]: 12 : rStCtrl.Seek( nPosMerk );
216 : : }
217 : 12 : sal_uInt32 nSvxMSDffOLEConvFlags2 = 0;
218 : :
219 [ + - ]: 12 : const SvtFilterOptions& rBasOpt = SvtFilterOptions::Get();
220 [ + - ][ + - ]: 12 : if ( rBasOpt.IsLoadPPointBasicCode() )
221 : 12 : mnFilterOptions |= 1;
222 [ + - ][ + - ]: 12 : if ( rBasOpt.IsMathType2Math() )
223 : 12 : nSvxMSDffOLEConvFlags2 |= OLE_MATHTYPE_2_STARMATH;
224 [ + - ][ + - ]: 12 : if ( rBasOpt.IsWinWord2Writer() )
225 : 12 : nSvxMSDffOLEConvFlags2 |= OLE_WINWORD_2_STARWRITER;
226 [ + - ][ + - ]: 12 : if ( rBasOpt.IsExcel2Calc() )
227 : 12 : nSvxMSDffOLEConvFlags2 |= OLE_EXCEL_2_STARCALC;
228 [ + - ][ + - ]: 12 : if ( rBasOpt.IsPowerPoint2Impress() )
229 : 12 : nSvxMSDffOLEConvFlags2 |= OLE_POWERPOINT_2_STARIMPRESS;
230 : :
231 [ + - ]: 12 : InitSvxMSDffManager( nDggContainerOfs, pStData, nSvxMSDffOLEConvFlags2 );
232 : : SetSvxMSDffSettings( SVXMSDFF_SETTINGS_CROP_BITMAPS
233 : 12 : | SVXMSDFF_SETTINGS_IMPORT_PPT );
234 [ + - ]: 12 : SetModel( mpDoc, 576 );
235 : : }
236 : 15 : }
237 : :
238 : : //////////////////////////////////////////////////////////////////////////
239 : : //
240 : : // Dtor
241 : : //
242 : : //////////////////////////////////////////////////////////////////////////
243 : :
244 : 15 : ImplSdPPTImport::~ImplSdPPTImport()
245 : : {
246 [ + + ][ + - ]: 15 : delete pStData;
247 [ - + ]: 30 : }
248 : :
249 : : //////////////////////////////////////////////////////////////////////////
250 : : //
251 : : // Import
252 : : //
253 : : //////////////////////////////////////////////////////////////////////////
254 : :
255 : 15 : sal_Bool ImplSdPPTImport::Import()
256 : : {
257 [ + + ]: 15 : if ( !bOk )
258 : 3 : return sal_False;
259 : :
260 [ + - ]: 12 : pSdrModel->setLock(true);
261 [ + - ]: 12 : pSdrModel->EnableUndo(false);
262 : :
263 [ + - ]: 12 : SdrOutliner& rOutl = mpDoc->GetDrawOutliner();
264 [ + - ]: 12 : sal_uInt32 nControlWord = rOutl.GetEditEngine().GetControlWord();
265 : 12 : nControlWord |= EE_CNTRL_ULSPACESUMMATION;
266 : 12 : nControlWord &=~ EE_CNTRL_ULSPACEFIRSTPARA;
267 [ + - ]: 12 : ((EditEngine&)rOutl.GetEditEngine()).SetControlWord( nControlWord );
268 : :
269 : 12 : SdrLayerAdmin& rAdmin = mpDoc->GetLayerAdmin();
270 [ + - ][ + - ]: 12 : mnBackgroundLayerID = rAdmin.GetLayerID( String( SdResId( STR_LAYER_BCKGRND )), sal_False );
[ + - ][ + - ]
271 [ + - ][ + - ]: 12 : mnBackgroundObjectsLayerID = rAdmin.GetLayerID( String( SdResId( STR_LAYER_BCKGRNDOBJ )), sal_False );
[ + - ][ + - ]
272 : :
273 : 12 : ::sd::DrawDocShell* pDocShell = mpDoc->GetDocSh();
274 [ + - ]: 12 : if ( pDocShell )
275 [ + - ]: 12 : SeekOle( pDocShell, mnFilterOptions );
276 : :
277 : : // hyperlinks
278 [ + - ][ + - ]: 12 : PropRead* pDInfoSec2 = new PropRead( mrStorage, rtl::OUString( "\005DocumentSummaryInformation" ) );
[ + - ][ + - ]
279 [ + - ]: 12 : if ( pDInfoSec2->IsValid() )
280 : : {
281 [ + - ]: 12 : PropItem aPropItem;
282 : :
283 : : sal_uInt32 nType, nPropSize, nPropCount;
284 : :
285 [ + - ]: 12 : pDInfoSec2->Read();
286 : :
287 : : sal_uInt8 aPropSetGUID[ 16 ] =
288 : : {
289 : : 0x02, 0xd5, 0xcd, 0xd5, 0x9c, 0x2e, 0x1b, 0x10, 0x93, 0x97, 0x08, 0x00, 0x2b, 0x2c, 0xf9, 0xae
290 : 12 : };
291 [ + - ]: 12 : Section* pSection = (Section*)pDInfoSec2->GetSection( aPropSetGUID );
292 [ + - ]: 12 : if ( pSection )
293 : : {
294 [ + - ][ + + ]: 12 : if ( pSection->GetProperty( PID_SLIDECOUNT, aPropItem ) )
295 : : {
296 [ + - ]: 3 : aPropItem >> nType;
297 [ - + ][ # # ]: 3 : if ( ( nType == VT_I4 ) || ( nType == VT_UI4 ) )
298 : : {
299 : : // examine PID_HEADINGPAIR to get the correct entry for PID_DOCPARTS
300 : : sal_uInt32 nSlideCount, nVecCount;
301 [ + - ]: 3 : aPropItem >> nSlideCount;
302 [ + - ][ + - ]: 3 : if ( nSlideCount && pSection->GetProperty( PID_HEADINGPAIR, aPropItem ) )
[ + - ][ + - ]
303 : : {
304 : 3 : sal_uInt32 nSlideTitleIndex = 0, nSlideTitleCount = 0;
305 : : sal_uInt32 i, nTemp;
306 : :
307 [ + - ]: 3 : String aUString;
308 : :
309 [ + - ]: 3 : aPropItem >> nType
310 [ + - ]: 3 : >> nVecCount;
311 : :
312 [ + - ][ + - ]: 3 : if ( ( nType == ( VT_VARIANT | VT_VECTOR ) ) && ( nVecCount ^ 1 ) )
313 : : {
314 : 3 : nVecCount >>= 1;
315 : 3 : sal_uInt32 nEntryCount = 0;
316 [ + + ]: 12 : for ( i = 0; i < nVecCount; i++ )
317 : : {
318 [ + - ][ - + ]: 9 : if ( !aPropItem.Read( aUString, VT_EMPTY, sal_False ) )
319 : 0 : break;
320 [ + - ]: 9 : aPropItem >> nType;
321 [ - + ][ # # ]: 9 : if ( ( nType != VT_I4 ) && ( nType != VT_UI4 ) )
322 : 0 : break;
323 [ + - ]: 9 : aPropItem >> nTemp;
324 [ + - ][ + - ]: 9 : if ( aUString.EqualsAscii("Slide Titles") || aUString.EqualsAscii("Folientitel") )
[ + - ][ - + ]
[ - + ]
325 : : {
326 : 0 : nSlideTitleCount = nTemp;
327 : 0 : nSlideTitleIndex = nEntryCount;
328 : : }
329 : 9 : nEntryCount += nTemp;
330 : : }
331 : : }
332 [ - + ][ # # ]: 3 : if ( ( nSlideCount == nSlideTitleCount ) && pSection->GetProperty( PID_DOCPARTS, aPropItem ) )
[ # # ][ - + ]
333 : : {
334 [ # # ]: 0 : aPropItem >> nType
335 [ # # ]: 0 : >> nVecCount;
336 : :
337 [ # # ][ # # ]: 0 : if ( ( nVecCount >= ( nSlideTitleIndex + nSlideTitleCount ) )
338 : : && ( nType == ( VT_LPSTR | VT_VECTOR ) ) )
339 : : {
340 [ # # ]: 0 : for ( i = 0; i != nSlideTitleIndex; i++ )
341 : : {
342 [ # # ]: 0 : aPropItem >> nTemp;
343 [ # # ]: 0 : aPropItem.SeekRel( nTemp );
344 : : }
345 [ # # ]: 0 : for ( i = 0; i < nSlideTitleCount; i++ )
346 : : {
347 [ # # ][ # # ]: 0 : if ( !aPropItem.Read( aUString, nType, sal_False ) )
348 : : break;
349 : :
350 [ # # ]: 0 : String aString( aUString );
351 [ # # ][ # # ]: 0 : if ( aString.EqualsAscii( "No Slide Title" ))
352 [ # # ][ # # ]: 0 : aString = String();
[ # # ]
353 : : else
354 : : {
355 : : std::vector<String>::const_iterator pIter =
356 [ # # ][ # # ]: 0 : std::find(maSlideNameList.begin(),maSlideNameList.end(),aString);
357 : :
358 [ # # ][ # # ]: 0 : if (pIter != maSlideNameList.end())
359 [ # # ][ # # ]: 0 : aString = String();
[ # # ]
360 : : }
361 [ # # ]: 0 : maSlideNameList.push_back( aString );
362 [ # # ]: 0 : }
363 : : }
364 [ + - ]: 3 : }
365 : : }
366 : : }
367 : : }
368 : :
369 : : sal_uInt8 aUserPropSetGUID[ 16 ] =
370 : : {
371 : : 0x05, 0xd5, 0xcd, 0xd5, 0x9c, 0x2e, 0x1b, 0x10, 0x93, 0x97, 0x08, 0x00, 0x2b, 0x2c, 0xf9, 0xae
372 : 12 : };
373 [ + - ]: 12 : pSection = (Section*)pDInfoSec2->GetSection( aUserPropSetGUID );
374 [ + + ]: 12 : if ( pSection )
375 : : {
376 [ + - ]: 9 : Dictionary aDict;
377 [ + - ][ + - ]: 9 : if ( pSection->GetDictionary( aDict ) )
378 : : {
379 [ + - ][ + - ]: 9 : Dictionary::const_iterator iter = aDict.find( rtl::OUString("_PID_HLINKS") );
[ + - ][ + - ]
380 : :
381 [ + - ][ - + ]: 9 : if ( iter != aDict.end() )
[ + - ]
382 : : {
383 [ # # ][ # # ]: 0 : if ( pSection->GetProperty( iter->second, aPropItem ) )
[ # # ]
384 : : {
385 [ # # ]: 0 : aPropItem.Seek( STREAM_SEEK_TO_BEGIN );
386 [ # # ]: 0 : aPropItem >> nType;
387 [ # # ]: 0 : if ( nType == VT_BLOB )
388 : : {
389 [ # # ]: 0 : aPropItem >> nPropSize
390 [ # # ]: 0 : >> nPropCount;
391 : :
392 [ # # ]: 0 : if ( ! ( nPropCount % 6 ) )
393 : : {
394 : : sal_uInt32 i;
395 : :
396 : 0 : nPropCount /= 6; // 6 propertys a hyperlink
397 : :
398 : 0 : SdHyperlinkEntry* pHyperlink = 0;
399 [ # # ]: 0 : for ( i = 0; i < nPropCount; i++ )
400 : : {
401 [ # # ][ # # ]: 0 : pHyperlink = new SdHyperlinkEntry;
402 : 0 : pHyperlink->nIndex = 0;
403 [ # # ]: 0 : aPropItem >> nType;
404 [ # # ]: 0 : if ( nType != VT_I4 )
405 : : break;
406 [ # # ]: 0 : aPropItem >> pHyperlink->nPrivate1
407 [ # # ]: 0 : >> nType;
408 [ # # ]: 0 : if ( nType != VT_I4 )
409 : : break;
410 [ # # ]: 0 : aPropItem >> pHyperlink->nPrivate2
411 [ # # ]: 0 : >> nType;
412 [ # # ]: 0 : if ( nType != VT_I4 )
413 : : break;
414 [ # # ]: 0 : aPropItem >> pHyperlink->nPrivate3
415 [ # # ]: 0 : >> nType;
416 [ # # ]: 0 : if ( nType != VT_I4 )
417 : : break;
418 [ # # ]: 0 : aPropItem >> pHyperlink->nInfo;
419 [ # # ][ # # ]: 0 : if ( !aPropItem.Read( pHyperlink->aTarget, VT_EMPTY ) )
420 : : break;
421 : :
422 : : // Convert '\\' notation to 'smb://'
423 [ # # ][ # # ]: 0 : INetURLObject aUrl( pHyperlink->aTarget, INET_PROT_FILE );
424 [ # # ][ # # ]: 0 : pHyperlink->aTarget = aUrl.GetMainURL( INetURLObject::NO_DECODE );
425 : :
426 [ # # ][ # # ]: 0 : if ( !aPropItem.Read( pHyperlink->aSubAdress, VT_EMPTY ) )
427 : : break;
428 : 0 : pHyperlink->nStartPos = pHyperlink->nEndPos = -1;
429 : :
430 [ # # ]: 0 : if ( pHyperlink->aSubAdress.Len() ) // get the converted subadress
431 : : {
432 : 0 : sal_uInt32 nPageNumber = 0;
433 [ # # ]: 0 : String aString( pHyperlink->aSubAdress );
434 [ # # ]: 0 : rtl::OString aStringAry[ 3 ];
435 [ # # ][ # # ]: 0 : sal_uInt16 nTokenCount = comphelper::string::getTokenCount(aString, ',');
436 [ # # ]: 0 : if ( nTokenCount > 3 )
437 : 0 : nTokenCount = 3;
438 : : sal_uInt16 nToken;
439 [ # # ]: 0 : for( nToken = 0; nToken < nTokenCount; nToken++ )
440 [ # # ][ # # ]: 0 : aStringAry[nToken] = rtl::OUStringToOString(aString.GetToken( nToken, (sal_Unicode)',' ), RTL_TEXTENCODING_UTF8);
[ # # ][ # # ]
441 : :
442 : 0 : sal_Bool bSucceeded = sal_False;
443 : :
444 : : // first pass, searching for a SlideId
445 [ # # ]: 0 : for( nToken = 0; nToken < nTokenCount; nToken++ )
446 : : {
447 [ # # ][ # # ]: 0 : if (comphelper::string::isdigitAsciiString(aStringAry[nToken]))
448 : : {
449 : 0 : sal_Int32 nNumber = aStringAry[ nToken ].toInt32();
450 [ # # ]: 0 : if ( nNumber & ~0xff )
451 : : {
452 [ # # ]: 0 : PptSlidePersistList* pPageList = GetPageList( PPT_SLIDEPAGE );
453 [ # # ]: 0 : if ( pPageList )
454 : : {
455 [ # # ]: 0 : sal_uInt16 nPage = pPageList->FindPage( nNumber );
456 [ # # ]: 0 : if ( nPage != PPTSLIDEPERSIST_ENTRY_NOTFOUND )
457 : : {
458 : 0 : nPageNumber = nPage;
459 : 0 : bSucceeded = sal_True;
460 : 0 : break;
461 : : }
462 : : }
463 : : }
464 : : }
465 : : }
466 [ # # ]: 0 : if ( !bSucceeded )
467 : : { // second pass, searching for a SlideName
468 [ # # ]: 0 : for ( nToken = 0; nToken < nTokenCount; nToken++ )
469 : : {
470 [ # # ]: 0 : String aToken( aString.GetToken( nToken, (sal_Unicode)',' ) );
471 : : std::vector<String>::const_iterator pIter =
472 [ # # ][ # # ]: 0 : std::find(maSlideNameList.begin(),maSlideNameList.end(),aToken);
473 : :
474 [ # # ][ # # ]: 0 : if (pIter != maSlideNameList.end())
475 : : {
476 [ # # ]: 0 : nPageNumber = pIter - maSlideNameList.begin();
477 : 0 : bSucceeded = sal_True;
478 : : }
479 [ # # ]: 0 : }
480 : : }
481 [ # # ]: 0 : if ( !bSucceeded )
482 : : { // third pass, searching for a slide number
483 [ # # ]: 0 : for ( nToken = 0; nToken < nTokenCount; nToken++ )
484 : : {
485 [ # # ][ # # ]: 0 : if (comphelper::string::isdigitAsciiString(aStringAry[nToken]))
486 : : {
487 : 0 : sal_Int32 nNumber = aStringAry[ nToken ].toInt32();
488 [ # # ]: 0 : if ( ( nNumber & ~0xff ) == 0 )
489 : : {
490 : 0 : nPageNumber = (sal_uInt32)nNumber - 1;
491 : 0 : bSucceeded = sal_True;
492 : 0 : break;
493 : : }
494 : : }
495 : : }
496 : : }
497 [ # # ]: 0 : if ( bSucceeded )
498 : : {
499 [ # # ]: 0 : if ( nPageNumber < maSlideNameList.size() )
500 [ # # ][ # # ]: 0 : pHyperlink->aConvSubString = maSlideNameList[ nPageNumber ];
501 [ # # ]: 0 : if ( !pHyperlink->aConvSubString.Len() )
502 : : {
503 [ # # ][ # # ]: 0 : pHyperlink->aConvSubString = String( SdResId( STR_PAGE ) );
[ # # ][ # # ]
504 [ # # ]: 0 : pHyperlink->aConvSubString.Append( sal_Unicode( ' ' ) );
505 [ # # ][ # # ]: 0 : pHyperlink->aConvSubString.Append( mpDoc->CreatePageNumValue( (sal_uInt16)nPageNumber + 1 ) );
[ # # ]
506 : : }
507 [ # # ][ # # ]: 0 : }
[ # # ]
508 : : }
509 [ # # ][ # # ]: 0 : aHyperList.push_back( pHyperlink );
510 [ # # ]: 0 : }
511 [ # # ]: 0 : if ( i != nPropCount )
512 [ # # ][ # # ]: 9 : delete pHyperlink;
513 : : }
514 : : }
515 : : }
516 : : }
517 : 12 : }
518 : : }
519 [ + - ]: 12 : }
520 : : }
521 [ + - ][ + - ]: 12 : delete pDInfoSec2;
522 : :
523 [ + - ]: 12 : if ( mbDocumentFound )
524 : : {
525 [ + - ]: 12 : rStCtrl.Seek( maDocHd.GetRecBegFilePos() + 8 );
526 : : // HyperList lesen / Indexe der einzelnen Eintraege setzen
527 : 12 : DffRecordHeader aHyperHd;
528 [ + + ][ + - ]: 12 : if ( SeekToRec( rStCtrl, PPT_PST_ExObjList, maDocHd.GetRecEndFilePos(), &aHyperHd ) )
529 : : {
530 : 9 : sal_uInt32 nExObjHyperListLen = aHyperHd.GetRecEndFilePos();
531 [ - + ]: 12 : for ( size_t i = 0, n = aHyperList.size(); i < n; ++i )
532 : : {
533 : 0 : SdHyperlinkEntry* pPtr = aHyperList[ i ];
534 : 0 : DffRecordHeader aHyperE;
535 [ # # ][ # # ]: 0 : if ( !SeekToRec( rStCtrl, PPT_PST_ExHyperlink, nExObjHyperListLen, &aHyperE ) )
536 : : break;
537 [ # # ][ # # ]: 0 : if ( !SeekToRec( rStCtrl, PPT_PST_ExHyperlinkAtom, nExObjHyperListLen, NULL, 0 ) )
538 : : break;
539 [ # # ]: 0 : rStCtrl.SeekRel( 8 );
540 [ # # ]: 0 : rStCtrl >> pPtr->nIndex;
541 [ # # ]: 0 : aHyperE.SeekToEndOfRecord( rStCtrl );
542 : : }
543 : : }
544 : : }
545 : :
546 : 12 : Size aVisAreaSize;
547 [ - + ]: 12 : switch ( aUserEditAtom.eLastViewType )
548 : : {
549 : : case 5 : // notes master
550 : : case 3 : // notes
551 [ # # ]: 0 : aVisAreaSize = aDocAtom.GetNotesPageSize();
552 : 0 : break;
553 : : default :
554 [ + - ]: 12 : aVisAreaSize = aDocAtom.GetSlidesPageSize();
555 : : }
556 [ + - ]: 12 : Scale( aVisAreaSize );
557 [ + - ][ + - ]: 12 : pDocShell->SetVisArea( Rectangle( Point(), aVisAreaSize ) );
558 : :
559 : : ///////////////////////////////////////////////////////////
560 : : // create master pages:
561 : : ///////////////////////////////////////////////////////////
562 : : SfxProgress* pStbMgr = new SfxProgress( pDocShell, String( SdResId( STR_POWERPOINT_IMPORT ) ),
563 [ + - ][ + - ]: 12 : pMasterPages->size() + pSlidePages->size() + pNotePages->size() );
[ + - ][ + - ]
[ + - ]
564 : :
565 : 12 : sal_uInt32 nImportedPages = 0;
566 : : {
567 [ + - ]: 12 : sal_uInt16 nMasterAnz = GetPageCount( PPT_MASTERPAGE );
568 : :
569 [ + + ]: 48 : for ( sal_uInt16 nMasterNum = 0; nMasterNum < nMasterAnz; nMasterNum++ )
570 : : {
571 [ + - ]: 36 : SetPageNum( nMasterNum, PPT_MASTERPAGE );
572 [ + - ]: 36 : SdPage* pPage = (SdPage*)MakeBlancPage( sal_True );
573 [ + - ]: 36 : if ( pPage )
574 : : {
575 [ + - ]: 36 : sal_Bool bNotesMaster = (*GetPageList( eAktPageKind ) )[ nAktPageNum ]->bNotesMaster;
576 [ + - ]: 36 : sal_Bool bStarDrawFiller = (*GetPageList( eAktPageKind ) )[ nAktPageNum ]->bStarDrawFiller;
577 : :
578 [ + + ]: 36 : PageKind ePgKind = ( bNotesMaster ) ? PK_NOTES : PK_STANDARD;
579 : 36 : pPage->SetPageKind( ePgKind );
580 [ + - ]: 36 : pSdrModel->InsertMasterPage( (SdrPage*)pPage );
581 [ + + ][ + + ]: 36 : if ( bNotesMaster && bStarDrawFiller )
582 [ + - ]: 3 : ((SdPage*)pPage)->SetAutoLayout( AUTOLAYOUT_NOTES, sal_True );
583 [ + + ]: 36 : if ( nMasterNum )
584 : : {
585 [ + - ]: 24 : boost::optional< sal_Int16 > oStartNumbering;
586 : : SfxStyleSheet* pSheet;
587 [ + + ]: 24 : if ( nMasterNum == 1 )
588 : : {
589 : : ///////////////////
590 : : // standardsheet //
591 : : ///////////////////
592 [ + - ][ + - ]: 12 : pSheet = (SfxStyleSheet*)mpDoc->GetStyleSheetPool()->Find( String(SdResId( STR_STANDARD_STYLESHEET_NAME )), SD_STYLE_FAMILY_GRAPHICS );
[ + - ][ + - ]
[ + - ]
593 [ + - ]: 12 : if ( pSheet )
594 : : {
595 [ + - ]: 12 : SfxItemSet& rItemSet = pSheet->GetItemSet();
596 [ + - ]: 12 : PPTParagraphObj aParagraph( *pPPTStyleSheet, TSS_TYPE_TEXT_IN_SHAPE, 0 );
597 [ + - ]: 12 : PPTPortionObj aPortion( *pPPTStyleSheet, TSS_TYPE_TEXT_IN_SHAPE, 0 );
598 [ + - ]: 12 : aParagraph.AppendPortion( aPortion );
599 [ + - ]: 12 : aParagraph.ApplyTo( rItemSet, oStartNumbering, (SdrPowerPointImport&)*this, 0xffffffff, NULL );
600 [ + - ][ + - ]: 12 : aPortion.ApplyTo( rItemSet, (SdrPowerPointImport&)*this, 0xffffffff );
[ + - ]
601 : : }
602 : : }
603 : :
604 : : // PSEUDO
605 [ + - ][ + - ]: 24 : pSheet = (SfxStyleSheet*)mpDoc->GetStyleSheetPool()->Find( String(SdResId( STR_PSEUDOSHEET_BACKGROUNDOBJECTS )), SD_STYLE_FAMILY_PSEUDO );
[ + - ][ + - ]
[ + - ]
606 [ + - ]: 24 : if ( pSheet )
607 : : {
608 [ + - ]: 24 : SfxItemSet& rItemSet = pSheet->GetItemSet();
609 [ + - ]: 24 : PPTParagraphObj aParagraph( *pPPTStyleSheet, TSS_TYPE_TEXT_IN_SHAPE, 0 );
610 [ + - ]: 24 : PPTPortionObj aPortion( *pPPTStyleSheet, TSS_TYPE_TEXT_IN_SHAPE, 0 );
611 [ + - ]: 24 : aParagraph.AppendPortion( aPortion );
612 [ + - ]: 24 : aParagraph.ApplyTo( rItemSet, oStartNumbering, (SdrPowerPointImport&)*this, 0xffffffff, NULL );
613 [ + - ][ + - ]: 24 : aPortion.ApplyTo( rItemSet, (SdrPowerPointImport&)*this, 0xffffffff );
[ + - ]
614 : : }
615 : :
616 : : ///////////////////////////////////////////////////////////
617 : : // create layoutstylesheets, set layoutname and stylesheet
618 : : // (nur auf Standard- und Notizseiten)
619 : : ///////////////////////////////////////////////////////////
620 [ + - ][ + - ]: 24 : String aLayoutName( SdResId( STR_LAYOUT_DEFAULT_NAME ) );
621 [ - + ]: 24 : if ( nMasterNum > 2 )
622 : : {
623 [ # # ]: 0 : if ( ePgKind == PK_STANDARD )
624 : : { // Standardseite: Neues Praesentationslayout erzeugen
625 [ # # ][ # # ]: 0 : aLayoutName = String( SdResId( STR_LAYOUT_DEFAULT_TITLE_NAME ) );
[ # # ][ # # ]
626 [ # # ][ # # ]: 0 : aLayoutName += String::CreateFromInt32( (sal_Int32)( ( nMasterNum + 1 ) / 2 - 1 ) );
[ # # ]
627 [ # # ][ # # ]: 0 : ( (SdStyleSheetPool*)mpDoc->GetStyleSheetPool() )->CreateLayoutStyleSheets( aLayoutName );
628 : : }
629 : : else // Notizseite: Praesentationslayout von der Standardseite verwenden
630 [ # # ][ # # ]: 0 : aLayoutName = ( (SdPage*)mpDoc->GetMasterPage( nMasterNum - 1 ) )->GetName();
[ # # ]
631 : : }
632 [ + - ]: 24 : pPage->SetName( aLayoutName );
633 [ + - ]: 24 : aLayoutName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR ));
634 [ + - ][ + - ]: 24 : aLayoutName += String( SdResId( STR_LAYOUT_OUTLINE ) );
[ + - ][ + - ]
635 [ + - ][ + - ]: 24 : pPage->SetLayoutName( aLayoutName );
[ + - ]
636 : :
637 : : /////////////////////
638 : : // set stylesheets //
639 : : /////////////////////
640 [ + + ]: 24 : if ( pPage->GetPageKind() == PK_STANDARD )
641 : : {
642 : 12 : sal_uInt32 nTitleInstance = TSS_TYPE_PAGETITLE;
643 : 12 : sal_uInt32 nOutlinerInstance = TSS_TYPE_BODY;
644 : :
645 : : /////////////////////
646 : : // titelstylesheet //
647 : : /////////////////////
648 [ + - ]: 12 : pSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_TITLE );
649 [ + - ]: 12 : if ( pSheet )
650 : : {
651 [ + - ]: 12 : SfxItemSet& rItemSet = pSheet->GetItemSet();
652 [ + - ]: 12 : PPTParagraphObj aParagraph( *pPPTStyleSheet, nTitleInstance, 0 );
653 [ + - ]: 12 : PPTPortionObj aPortion( *pPPTStyleSheet, nTitleInstance, 0 );
654 [ + - ]: 12 : aParagraph.AppendPortion( aPortion );
655 [ + - ]: 12 : aParagraph.ApplyTo( rItemSet, oStartNumbering, (SdrPowerPointImport&)*this, 0xffffffff, NULL );
656 [ + - ][ + - ]: 12 : aPortion.ApplyTo( rItemSet, (SdrPowerPointImport&)*this, 0xffffffff );
[ + - ]
657 : : }
658 : : ////////////////////////
659 : : // outlinerstylesheet //
660 : : ////////////////////////
661 : : sal_uInt16 nLevel;
662 : : PPTParagraphObj* pParagraphs[ 9 ];
663 : 12 : PPTParagraphObj* pPreviousPara = NULL;
664 : :
665 [ + + ]: 120 : for ( nLevel = 0; nLevel < 9; nLevel++ )
666 : : {
667 [ + - ]: 108 : String aName( pPage->GetLayoutName() );
668 [ + - ]: 108 : aName.Append( (sal_Unicode)( ' ' ) );
669 [ + - ][ + - ]: 108 : aName.Append( String::CreateFromInt32( nLevel + 1 ) );
[ + - ]
670 [ + - ][ + - ]: 108 : SfxStyleSheet* pOutlineSheet = (SfxStyleSheet*)mpDoc->GetStyleSheetPool()->Find( aName, SD_STYLE_FAMILY_MASTERPAGE );
671 : : DBG_ASSERT( pOutlineSheet, "Vorlage fuer Gliederungsobjekt nicht gefunden" );
672 [ + - ]: 108 : if ( pOutlineSheet )
673 : : {
674 [ + - ][ + - ]: 108 : pParagraphs[ nLevel ] = new PPTParagraphObj( *pPPTStyleSheet, nOutlinerInstance, nLevel );
675 [ + - ]: 108 : SfxItemSet& rItemSet = pOutlineSheet->GetItemSet();
676 [ + - ]: 108 : PPTPortionObj aPortion( *pPPTStyleSheet, nOutlinerInstance, nLevel );
677 [ + - ]: 108 : pParagraphs[ nLevel ]->AppendPortion( aPortion );
678 [ + - ]: 108 : pParagraphs[ nLevel ]->ApplyTo( rItemSet, oStartNumbering, (SdrPowerPointImport&)*this, 0xffffffff, pPreviousPara );
679 [ + - ]: 108 : aPortion.ApplyTo( rItemSet, (SdrPowerPointImport&)*this, 0xffffffff );
680 [ + - ]: 108 : pPreviousPara = pParagraphs[ nLevel ];
681 : : }
682 : : else
683 : 0 : pParagraphs[ nLevel ] = NULL;
684 [ + - ]: 108 : }
685 [ + - ][ + - ]: 120 : for ( nLevel = 0; nLevel < 9; delete pParagraphs[ nLevel++ ] ) ;
[ + + ]
686 : : /////////////////////////
687 : : // subtitle stylesheet //
688 : : /////////////////////////
689 [ + - ]: 12 : pSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_TEXT );
690 [ + - ]: 12 : if ( pSheet )
691 : : {
692 [ + - ]: 12 : SfxItemSet& rItemSet = pSheet->GetItemSet();
693 [ + - ]: 12 : PPTParagraphObj aParagraph( *pPPTStyleSheet, TSS_TYPE_SUBTITLE, 0 );
694 [ + - ]: 12 : PPTPortionObj aPortion( *pPPTStyleSheet, TSS_TYPE_SUBTITLE, 0 );
695 [ + - ]: 12 : aParagraph.AppendPortion( aPortion );
696 [ + - ]: 12 : aParagraph.ApplyTo( rItemSet, oStartNumbering, (SdrPowerPointImport&)*this, 0xffffffff, NULL );
697 [ + - ][ + - ]: 12 : aPortion.ApplyTo( rItemSet, (SdrPowerPointImport&)*this, 0xffffffff );
[ + - ]
698 : : }
699 : : }
700 [ + - ]: 12 : else if ( ePgKind == PK_NOTES )
701 : : {
702 [ + - ]: 12 : pSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_NOTES );
703 [ + - ]: 12 : if ( pSheet )
704 : : {
705 [ + - ]: 12 : SfxItemSet& rItemSet = pSheet->GetItemSet();
706 [ + - ]: 12 : PPTParagraphObj aParagraph( *pPPTStyleSheet, TSS_TYPE_NOTES, 0 );
707 [ + - ]: 12 : PPTPortionObj aPortion( *pPPTStyleSheet, TSS_TYPE_NOTES, 0 );
708 [ + - ]: 12 : aParagraph.AppendPortion( aPortion );
709 [ + - ]: 12 : aParagraph.ApplyTo( rItemSet, oStartNumbering, (SdrPowerPointImport&)*this, 0xffffffff, NULL );
710 [ + - ][ + - ]: 12 : aPortion.ApplyTo( rItemSet, (SdrPowerPointImport&)*this, 0xffffffff );
[ + - ]
711 : : }
712 [ + - ][ + - ]: 24 : }
713 : : }
714 : : }
715 : : }
716 : : }
717 : : SdPage* pMPage;
718 : : sal_uInt16 i;
719 [ + - ][ + + ]: 36 : for ( i = 1; i < mpDoc->GetMasterPageCount() && ( (pMPage = (SdPage*)mpDoc->GetMasterPage( i )) != 0 ); i++ )
[ + - ][ + - ]
[ + + ]
720 : : {
721 [ + - ]: 24 : SetPageNum( i, PPT_MASTERPAGE );
722 : : /////////////////////////////////////////////
723 : : // importing master page objects //
724 : : /////////////////////////////////////////////
725 [ + - ]: 24 : PptSlidePersistList* pList = GetPageList( eAktPageKind );
726 : 24 : PptSlidePersistEntry* pPersist = ( pList && ( nAktPageNum < pList->size() ) )
727 [ + - + - ]: 48 : ? (*pList)[ nAktPageNum ] : NULL;
728 [ + - ]: 24 : if ( pPersist )
729 : : {
730 [ + + ][ + - ]: 24 : if ( pPersist->bStarDrawFiller && pPersist->bNotesMaster && ( nAktPageNum > 2 ) && ( ( nAktPageNum & 1 ) == 0 ) )
[ - + ][ # # ]
731 : : {
732 [ # # ]: 0 : pSdrModel->DeleteMasterPage( nAktPageNum );
733 [ # # ][ # # ]: 0 : SdrPage* pNotesClone = ((SdPage*)pSdrModel->GetMasterPage( 2 ))->Clone();
734 [ # # ]: 0 : pSdrModel->InsertMasterPage( pNotesClone, nAktPageNum );
735 [ # # ]: 0 : if ( pNotesClone )
736 : : {
737 [ # # ][ # # ]: 0 : String aLayoutName( ((SdPage*)pSdrModel->GetMasterPage( nAktPageNum - 1 ))->GetLayoutName() );
738 [ # # ]: 0 : ((SdPage*)pNotesClone)->SetPresentationLayout( aLayoutName, sal_False, sal_False, sal_False );
739 [ # # ][ # # ]: 0 : ((SdPage*)pNotesClone)->SetLayoutName( aLayoutName );
[ # # ][ # # ]
740 : 0 : }
741 : : }
742 [ + + ]: 24 : else if ( pPersist->bStarDrawFiller == sal_False )
743 : : {
744 : 21 : PptSlidePersistEntry* pE = pPersist;
745 [ - + ][ # # ]: 21 : while( ( pE->aSlideAtom.nFlags & 4 ) && pE->aSlideAtom.nMasterId )
[ - + ]
746 : : {
747 [ # # ]: 0 : sal_uInt16 nNextMaster = pMasterPages->FindPage( pE->aSlideAtom.nMasterId );
748 [ # # ]: 0 : if ( nNextMaster == PPTSLIDEPERSIST_ENTRY_NOTFOUND )
749 : 0 : break;
750 : : else
751 : 0 : pE = (*pList)[ nNextMaster ];
752 : : }
753 [ + - ]: 21 : SdrObject* pObj = ImportPageBackgroundObject( *pMPage, pE->nBackgroundOffset, sal_True ); // import background
754 [ + - ]: 21 : if ( pObj )
755 [ + - ]: 21 : pMPage->NbcInsertObject( pObj );
756 : :
757 : 21 : sal_Bool bNewAnimationsUsed = sal_False;
758 [ + - ]: 21 : ProcessData aProcessData( *(*pList)[ nAktPageNum ], (SdPage*)pMPage );
759 : 21 : sal_uInt32 nFPosMerk = rStCtrl.Tell();
760 : 21 : DffRecordHeader aPageHd;
761 [ + - ][ + - ]: 21 : if ( SeekToAktPage( &aPageHd ) )
762 : : {
763 [ + - ][ + + ]: 282 : while( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < aPageHd.GetRecEndFilePos() ) )
[ + + ]
764 : : {
765 : 261 : DffRecordHeader aHd;
766 [ + - ]: 261 : rStCtrl >> aHd;
767 [ + + + ]: 261 : switch( aHd.nRecType )
768 : : {
769 : : case PPT_PST_PPDrawing :
770 : : {
771 [ + - ]: 21 : aHd.SeekToBegOfRecord( rStCtrl );
772 : 21 : DffRecordHeader aPPDrawHd;
773 [ + - ][ + - ]: 21 : if ( SeekToRec( rStCtrl, PPT_PST_PPDrawing, aHd.GetRecEndFilePos(), &aPPDrawHd ) )
774 : : {
775 : 21 : sal_uInt32 nPPDrawEnd = aPPDrawHd.GetRecEndFilePos();
776 : 21 : DffRecordHeader aEscherF002Hd;
777 [ + - ][ + - ]: 21 : if ( SeekToRec( rStCtrl, DFF_msofbtDgContainer, nPPDrawEnd, &aEscherF002Hd ) )
778 : : {
779 : 21 : sal_uInt32 nEscherF002End = aEscherF002Hd.GetRecEndFilePos();
780 : 21 : DffRecordHeader aEscherObjListHd;
781 [ + - ][ + - ]: 21 : if ( SeekToRec( rStCtrl, DFF_msofbtSpgrContainer, nEscherF002End, &aEscherObjListHd ) )
782 : : {
783 : 21 : sal_uInt32 nObjCount = 0;
784 [ + - ][ + + ]: 156 : while( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < aEscherObjListHd.GetRecEndFilePos() ) )
[ + + ]
785 : : {
786 : 135 : DffRecordHeader aHd2;
787 [ + - ]: 135 : rStCtrl >> aHd2;
788 [ - + ][ # # ]: 135 : if ( ( aHd2.nRecType == DFF_msofbtSpContainer ) || ( aHd2.nRecType == DFF_msofbtSpgrContainer ) )
789 : : {
790 [ + + ]: 135 : if ( nObjCount++ ) // skipping the first object
791 : : {
792 [ + - ]: 114 : Rectangle aEmpty;
793 [ + - ]: 114 : aHd2.SeekToBegOfRecord( rStCtrl );
794 [ + - ]: 114 : SdrObject* pImpObj = ImportObj( rStCtrl, (void*)&aProcessData, aEmpty, aEmpty );
795 [ + - ]: 114 : if ( pImpObj )
796 : : {
797 [ + - ]: 114 : pImpObj->SetLayer( mnBackgroundObjectsLayerID );
798 [ + - ]: 114 : pMPage->NbcInsertObject( pImpObj );
799 : : }
800 : : }
801 : : }
802 [ + - ]: 135 : aHd2.SeekToEndOfRecord( rStCtrl );
803 : : }
804 : : }
805 : : }
806 : : }
807 : : }
808 : 21 : break;
809 : :
810 : : case PPT_PST_ProgTags :
811 : : {
812 : 3 : DffRecordHeader aProgTagHd;
813 [ + - ][ + - ]: 3 : if ( SeekToContentOfProgTag( 10, rStCtrl, aPageHd, aProgTagHd ) )
814 : : {
815 [ + - ][ + + ]: 6 : while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < aProgTagHd.GetRecEndFilePos() ) )
[ + + ]
816 : : {
817 : 3 : DffRecordHeader aProgTagContentHd;
818 [ + - ]: 3 : rStCtrl >> aProgTagContentHd;
819 [ - + ]: 3 : switch( aProgTagContentHd.nRecType )
820 : : {
821 : : case DFF_msofbtAnimGroup :
822 : : {
823 [ # # ][ # # ]: 0 : ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > xPage( pMPage->getUnoPage(), ::com::sun::star::uno::UNO_QUERY );
824 [ # # ]: 0 : ppt::AnimationImporter aImporter( this, rStCtrl );
825 [ # # ]: 0 : aImporter.import( xPage, aProgTagContentHd );
826 [ # # ]: 0 : bNewAnimationsUsed = sal_True;
827 : : }
828 : 0 : break;
829 : : }
830 [ + - ]: 3 : aProgTagContentHd.SeekToEndOfRecord( rStCtrl );
831 : : }
832 : : }
833 : : }
834 : 3 : break;
835 : : }
836 [ + - ]: 261 : aHd.SeekToEndOfRecord( rStCtrl );
837 : : }
838 : : }
839 [ + - ]: 21 : rStCtrl.Seek( nFPosMerk );
840 [ + - ]: 21 : ImportPageEffect( (SdPage*)pMPage, bNewAnimationsUsed );
841 : :
842 : : ///////////////////////
843 : : // background object //
844 : : ///////////////////////
845 [ + - ]: 21 : pObj = pMPage->GetObj( 0 );
846 [ + - ][ + - ]: 21 : if ( pObj && pObj->GetObjIdentifier() == OBJ_RECT )
[ + - ][ + - ]
847 : : {
848 [ + + ]: 21 : if ( pMPage->GetPageKind() == PK_STANDARD )
849 : : {
850 : : // transform data from imported background object to new form
851 : : // and delete the object. It was used as container to transport
852 : : // the attributes of the MasterPage background fill
853 [ + - ]: 12 : SfxStyleSheet* pSheet = pMPage->GetStyleSheetForMasterPageBackground();
854 : :
855 [ + - ]: 12 : if(pSheet)
856 : : {
857 : : // if we have a StyleSheet (for Masterpages), set attributes there and use it
858 [ + - ][ + - ]: 12 : pSheet->GetItemSet().ClearItem();
859 [ + - ][ + - ]: 12 : pSheet->GetItemSet().Put(pObj->GetMergedItemSet());
[ + - ]
860 [ + - ]: 12 : pMPage->getSdrPageProperties().ClearItem();
861 [ + - ]: 12 : pMPage->getSdrPageProperties().SetStyleSheet(pSheet);
862 : : }
863 : : else
864 : : {
865 : : // without StyleSheet, set attributes directly. This
866 : : // should not be done at all and is an error (will be asserted by SdrPage)
867 [ # # ]: 0 : pMPage->getSdrPageProperties().ClearItem();
868 [ # # ][ # # ]: 0 : pMPage->getSdrPageProperties().PutItemSet(pObj->GetMergedItemSet());
869 : : }
870 : :
871 [ + - ][ + - ]: 12 : pMPage->RemoveObject(pObj->GetOrdNum());
872 [ + - ]: 12 : SdrObject::Free(pObj);
873 : : }
874 : 24 : }
875 : : }
876 : : }
877 [ + - ]: 24 : if( pStbMgr )
878 [ + - ]: 24 : pStbMgr->SetState( nImportedPages++ );
879 : : }
880 : : ////////////////////////////////////
881 : : // importing slide pages //
882 : : ////////////////////////////////////
883 : : {
884 : 12 : sal_uInt32 nFPosMerk = rStCtrl.Tell();
885 : 12 : PptPageKind ePageKind = eAktPageKind;
886 : 12 : sal_uInt16 nPageNum = nAktPageNum;
887 : :
888 [ + - ]: 12 : SdPage* pHandoutPage = (SdPage*)MakeBlancPage( sal_False );
889 : 12 : pHandoutPage->SetPageKind( PK_HANDOUT );
890 [ + - ]: 12 : pSdrModel->InsertPage( pHandoutPage );
891 : :
892 [ + - ]: 12 : sal_uInt16 nPageAnz = GetPageCount( PPT_SLIDEPAGE );
893 [ + - ]: 12 : if ( nPageAnz )
894 : : {
895 [ + + ]: 24 : for ( sal_uInt16 nPage = 0; nPage < nPageAnz; nPage++ )
896 : : {
897 : 12 : sal_Bool bNewAnimationsUsed = sal_False;
898 : :
899 : 12 : mePresChange = PRESCHANGE_SEMIAUTO;
900 [ + - ]: 12 : SetPageNum( nPage, PPT_SLIDEPAGE );
901 [ + - ]: 12 : SdPage* pPage = (SdPage*)MakeBlancPage( sal_False );
902 : 12 : PptSlidePersistEntry* pMasterPersist = NULL;
903 [ + - ][ + - ]: 12 : if ( HasMasterPage( nPage, PPT_SLIDEPAGE ) ) // try to get the LayoutName from the masterpage
904 : : {
905 [ + - ]: 12 : sal_uInt16 nMasterNum = GetMasterPageIndex( nAktPageNum, eAktPageKind );
906 [ + - ][ + - ]: 12 : pPage->TRG_SetMasterPage(*pSdrModel->GetMasterPage(nMasterNum));
907 [ + - ]: 12 : PptSlidePersistList* pPageList = GetPageList( PPT_MASTERPAGE );
908 [ + - ][ + - ]: 12 : if ( pPageList && nMasterNum < pPageList->size() )
[ + - ]
909 : 12 : pMasterPersist = (*pPageList)[ nMasterNum ];
910 [ + - ][ + - ]: 12 : pPage->SetLayoutName(((SdPage&)pPage->TRG_GetMasterPage()).GetLayoutName());
[ + - ][ + - ]
911 : : }
912 : 12 : pPage->SetPageKind( PK_STANDARD );
913 [ + - ]: 12 : pSdrModel->InsertPage( pPage ); // SJ: #i29625# because of form controls, the
914 [ + - ]: 12 : ImportPage( pPage, pMasterPersist ); // page must be inserted before importing
915 [ + - ]: 12 : SetHeaderFooterPageSettings( pPage, pMasterPersist );
916 : : // CWS preseng01: pPage->SetPageKind( PK_STANDARD );
917 : :
918 : 12 : DffRecordHeader aPageHd;
919 [ + - ][ + - ]: 12 : if ( SeekToAktPage( &aPageHd ) )
920 : : {
921 [ + - ]: 12 : aPageHd.SeekToContent( rStCtrl );
922 [ + - ][ + + ]: 78 : while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < aPageHd.GetRecEndFilePos() ) )
[ + + ]
923 : : {
924 : 66 : DffRecordHeader aHd;
925 [ + - ]: 66 : rStCtrl >> aHd;
926 [ + + ]: 66 : switch ( aHd.nRecType )
927 : : {
928 : : case PPT_PST_ProgTags :
929 : : {
930 : 12 : DffRecordHeader aProgTagHd;
931 [ + - ][ + - ]: 12 : if ( SeekToContentOfProgTag( 10, rStCtrl, aPageHd, aProgTagHd ) )
932 : : {
933 [ + - ][ + + ]: 60 : while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < aProgTagHd.GetRecEndFilePos() ) )
[ + + ]
934 : : {
935 : 48 : DffRecordHeader aProgTagContentHd;
936 [ + - ]: 48 : rStCtrl >> aProgTagContentHd;
937 [ + + + + ]: 48 : switch( aProgTagContentHd.nRecType )
938 : : {
939 : : case DFF_msofbtAnimGroup :
940 : : {
941 [ + - ][ + - ]: 12 : ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > xPage( pPage->getUnoPage(), ::com::sun::star::uno::UNO_QUERY );
942 [ + - ]: 12 : ppt::AnimationImporter aImporter( this, rStCtrl );
943 [ + - ]: 12 : aImporter.import( xPage, aProgTagContentHd );
944 [ + - ]: 12 : bNewAnimationsUsed = sal_True;
945 : : }
946 : 12 : break;
947 : :
948 : : case PPT_PST_NewlyAddedAtomByXP11008 : // ???
949 : 12 : break;
950 : :
951 : : case PPT_PST_NewlyAddedAtomByXP12011 : // ??? don't know, this atom is always 8 bytes big
952 : 12 : break; // and is appearing in nearly every l10 progtag
953 : : }
954 [ + - ]: 48 : aProgTagContentHd.SeekToEndOfRecord( rStCtrl );
955 : : }
956 : : }
957 : : }
958 : 12 : break;
959 : :
960 : : case PPT_PST_HeadersFooters :
961 : : case PPT_PST_PPDrawing :
962 : : default:
963 : 54 : break;
964 : : }
965 : :
966 [ + - ]: 66 : aHd.SeekToEndOfRecord( rStCtrl );
967 : : }
968 [ + - ]: 12 : ImportPageEffect( (SdPage*)pPage, bNewAnimationsUsed );
969 : : }
970 : :
971 : : // creating the corresponding note page
972 : 12 : eAktPageKind = PPT_NOTEPAGE;
973 [ + - ]: 12 : SdPage* pNotesPage = (SdPage*)MakeBlancPage( sal_False );
974 [ + - ]: 12 : sal_uInt16 nNotesMasterNum = GetMasterPageIndex( nPage, PPT_SLIDEPAGE ) + 1;
975 [ + - ]: 12 : sal_uInt32 nNotesPageId = GetNotesPageId( nPage );
976 [ + + ]: 12 : if ( nNotesPageId )
977 : : {
978 : 9 : nImportedPages++;
979 [ + - ]: 9 : sal_uInt16 nNotesPageIndex = pNotePages->FindPage( nNotesPageId );
980 [ - + ]: 9 : if ( nNotesPageIndex == PPTSLIDEPERSIST_ENTRY_NOTFOUND )
981 : 0 : nNotesPageIndex = 0;
982 [ + - ]: 9 : SetPageNum( nNotesPageIndex, PPT_NOTEPAGE );
983 : 9 : PptSlidePersistEntry* pMasterPersist2 = NULL;
984 [ + - ][ + - ]: 9 : if ( HasMasterPage( nNotesPageIndex, PPT_NOTEPAGE ) ) // try to get the LayoutName from the masterpage
985 : : {
986 [ + - ][ + - ]: 9 : pNotesPage->TRG_SetMasterPage(*pSdrModel->GetMasterPage(nNotesMasterNum));
987 [ + - ]: 9 : PptSlidePersistList* pPageList = GetPageList( PPT_MASTERPAGE );
988 [ + - ][ + - ]: 9 : if ( pPageList && nNotesMasterNum < pPageList->size() )
[ + - ]
989 : 9 : pMasterPersist2 = (*pPageList)[ nNotesMasterNum ];
990 [ + - ][ + - ]: 9 : pNotesPage->SetLayoutName( ((SdPage&)pNotesPage->TRG_GetMasterPage()).GetLayoutName() );
[ + - ][ + - ]
991 : : }
992 : 9 : pNotesPage->SetPageKind( PK_NOTES );
993 [ + - ][ + - ]: 9 : pNotesPage->TRG_SetMasterPage(*pSdrModel->GetMasterPage(nNotesMasterNum));
994 [ + - ]: 9 : pSdrModel->InsertPage( pNotesPage ); // SJ: #i29625# because of form controls, the
995 [ + - ]: 9 : ImportPage( pNotesPage, pMasterPersist2 ); // page must be inserted before importing
996 [ + - ]: 9 : SetHeaderFooterPageSettings( pNotesPage, pMasterPersist2 );
997 [ + - ]: 9 : pNotesPage->SetAutoLayout( AUTOLAYOUT_NOTES, sal_False );
998 : : }
999 : : else
1000 : : {
1001 : 3 : pNotesPage->SetPageKind( PK_NOTES );
1002 [ + - ][ + - ]: 3 : pNotesPage->TRG_SetMasterPage(*pSdrModel->GetMasterPage(nNotesMasterNum));
1003 [ + - ]: 3 : pNotesPage->SetAutoLayout( AUTOLAYOUT_NOTES, sal_True );
1004 [ + - ]: 3 : pSdrModel->InsertPage( pNotesPage );
1005 [ + - ]: 3 : SdrObject* pPageObj = pNotesPage->GetPresObj( PRESOBJ_PAGE, 1 );
1006 [ + - ]: 3 : if ( pPageObj )
1007 [ + - ][ + - ]: 3 : ((SdrPageObj*)pPageObj)->SetReferencedPage(pSdrModel->GetPage(( nPage << 1 ) + 1));
1008 : : }
1009 : :
1010 [ + - ]: 12 : if( pStbMgr )
1011 [ + - ]: 12 : pStbMgr->SetState( nImportedPages++ );
1012 : : }
1013 : : //////////////
1014 : : }
1015 : : else
1016 : : {
1017 : : // Das kann bei Dokumentvorlagen vorkommen
1018 : 0 : eAktPageKind = PPT_SLIDEPAGE;
1019 [ # # ]: 0 : SdrPage* pPage = MakeBlancPage( sal_False );
1020 [ # # ]: 0 : pSdrModel->InsertPage( pPage );
1021 : :
1022 : : // #i37397#, trying to set the title master for the first page
1023 [ # # ]: 0 : sal_uInt16 nMaster, nMasterCount = pSdrModel->GetMasterPageCount();
1024 : 0 : SdPage* pFoundMaster = NULL;
1025 [ # # ]: 0 : for ( nMaster = 1; nMaster < nMasterCount; nMaster++ )
1026 : : {
1027 [ # # ]: 0 : SdPage* pMaster = static_cast<SdPage*>( pSdrModel->GetMasterPage( nMaster ) );
1028 [ # # ]: 0 : if ( pMaster->GetPageKind() == PK_STANDARD )
1029 : : {
1030 [ # # ]: 0 : SetPageNum( nMaster, PPT_MASTERPAGE );
1031 [ # # ]: 0 : if ( !pFoundMaster )
1032 : 0 : pFoundMaster = pMaster;
1033 [ # # ][ # # ]: 0 : else if ( GetSlideLayoutAtom()->eLayout == PPT_LAYOUT_TITLEMASTERSLIDE )
1034 : 0 : pFoundMaster = pMaster;
1035 [ # # ][ # # ]: 0 : if ( GetSlideLayoutAtom()->eLayout == PPT_LAYOUT_TITLEMASTERSLIDE )
1036 : 0 : break;
1037 : : }
1038 : : }
1039 [ # # ]: 0 : if ( pFoundMaster )
1040 : : {
1041 [ # # ]: 0 : ((SdPage*)pPage)->TRG_SetMasterPage( *((SdPage*)pFoundMaster) );
1042 [ # # ][ # # ]: 0 : ((SdPage*)pPage)->SetLayoutName( ((SdPage*)pFoundMaster)->GetLayoutName() );
[ # # ]
1043 : : }
1044 [ # # ]: 0 : ((SdPage*)pPage)->SetAutoLayout( AUTOLAYOUT_TITLE, sal_True, sal_True );
1045 : :
1046 : 0 : eAktPageKind = PPT_NOTEPAGE;
1047 [ # # ]: 0 : SdrPage* pNPage = MakeBlancPage( sal_False );
1048 [ # # ]: 0 : pSdrModel->InsertPage( pNPage );
1049 : : }
1050 [ + - ]: 12 : SetPageNum( nPageNum, ePageKind );
1051 [ + - ]: 12 : rStCtrl.Seek( nFPosMerk );
1052 : : }
1053 : : ///////////////////////////////////////////////////////////////////
1054 : : // Handzettel und Notiz-Seiten erzeugen //
1055 : : ///////////////////////////////////////////////////////////////////
1056 [ + - ]: 12 : bOk = mpDoc->CreateMissingNotesAndHandoutPages();
1057 [ + - ]: 12 : if ( bOk )
1058 : : {
1059 [ + - ][ + + ]: 24 : for ( i = 0; i < mpDoc->GetSdPageCount( PK_STANDARD ); i++ )
1060 : : {
1061 : : ////////////////////
1062 : : // set AutoLayout //
1063 : : ////////////////////
1064 [ + - ]: 12 : SetPageNum( i, PPT_SLIDEPAGE );
1065 [ + - ]: 12 : SdPage* pPage = mpDoc->GetSdPage( i, PK_STANDARD );
1066 : 12 : AutoLayout eAutoLayout = AUTOLAYOUT_NONE;
1067 [ + - ]: 12 : const PptSlideLayoutAtom* pSlideLayout = GetSlideLayoutAtom();
1068 [ + - ]: 12 : if ( pSlideLayout )
1069 : : {
1070 [ + - - + : 12 : switch ( pSlideLayout->eLayout ) // Praesentationslayouts fuer Standard-Seiten
- - - - -
- - - -
- ]
1071 : : {
1072 : : case PPT_LAYOUT_TITLEANDBODYSLIDE :
1073 : : {
1074 : 9 : eAutoLayout = AUTOLAYOUT_ENUM;
1075 : 9 : sal_uInt16 nID1 = pSlideLayout->aPlaceholderId[ 1 ];
1076 [ - - - + : 9 : switch ( nID1 )
- - - ]
1077 : : {
1078 : : case PPT_PLACEHOLDER_BODY :
1079 : 0 : eAutoLayout = AUTOLAYOUT_ENUM;
1080 : 0 : break;
1081 : : case PPT_PLACEHOLDER_TABLE :
1082 : 0 : eAutoLayout = AUTOLAYOUT_TAB;
1083 : 0 : break;
1084 : : case PPT_PLACEHOLDER_ORGANISZATIONCHART :
1085 : 0 : eAutoLayout = AUTOLAYOUT_ORG;
1086 : 0 : break;
1087 : : case PPT_PLACEHOLDER_GRAPH :
1088 : 9 : eAutoLayout = AUTOLAYOUT_CHART;
1089 : 9 : break;
1090 : : case PPT_PLACEHOLDER_OBJECT :
1091 : 0 : eAutoLayout = AUTOLAYOUT_OBJ;
1092 : 0 : break;
1093 : : case PPT_PLACEHOLDER_VERTICALTEXTBODY :
1094 : 0 : eAutoLayout = AUTOLAYOUT_TITLE_VERTICAL_OUTLINE;
1095 : 0 : break;
1096 : : }
1097 : : }
1098 : 9 : break;
1099 : :
1100 : : case PPT_LAYOUT_2COLUMNSANDTITLE :
1101 : : {
1102 : 0 : eAutoLayout = AUTOLAYOUT_2TEXT;
1103 : 0 : sal_uInt16 nID1 = pSlideLayout->aPlaceholderId[ 1 ];
1104 : 0 : sal_uInt16 nID2 = pSlideLayout->aPlaceholderId[ 2 ];
1105 [ # # ][ # # ]: 0 : if ( nID1 == PPT_PLACEHOLDER_BODY && nID2 == PPT_PLACEHOLDER_GRAPH )
1106 : 0 : eAutoLayout = AUTOLAYOUT_TEXTCHART;
1107 [ # # ][ # # ]: 0 : else if ( nID1 == PPT_PLACEHOLDER_GRAPH && nID2 == PPT_PLACEHOLDER_BODY )
1108 : 0 : eAutoLayout = AUTOLAYOUT_CHARTTEXT;
1109 [ # # ][ # # ]: 0 : else if ( nID1 == PPT_PLACEHOLDER_BODY && nID2 == PPT_PLACEHOLDER_CLIPART )
1110 : 0 : eAutoLayout = AUTOLAYOUT_TEXTCLIP;
1111 [ # # ][ # # ]: 0 : else if ( nID1 == PPT_PLACEHOLDER_CLIPART && nID2 == PPT_PLACEHOLDER_BODY )
1112 : 0 : eAutoLayout = AUTOLAYOUT_CLIPTEXT;
1113 [ # # ][ # # ]: 0 : else if ( nID1 == PPT_PLACEHOLDER_CLIPART && nID2 == PPT_PLACEHOLDER_VERTICALTEXTBODY )
1114 : 0 : eAutoLayout = AUTOLAYOUT_TITLE_VERTICAL_OUTLINE_CLIPART;
1115 [ # # ][ # # ]: 0 : else if ( ( nID1 == PPT_PLACEHOLDER_BODY )
[ # # ]
1116 : : && ( ( nID2 == PPT_PLACEHOLDER_OBJECT ) || ( nID2 == PPT_PLACEHOLDER_MEDIACLIP ) ) )
1117 : 0 : eAutoLayout = AUTOLAYOUT_TEXTOBJ;
1118 [ # # ][ # # ]: 0 : else if ( ( nID2 == PPT_PLACEHOLDER_BODY )
[ # # ]
1119 : : && ( ( nID1 == PPT_PLACEHOLDER_OBJECT ) || ( nID1 == PPT_PLACEHOLDER_MEDIACLIP ) ) )
1120 : 0 : eAutoLayout = AUTOLAYOUT_OBJTEXT;
1121 [ # # ][ # # ]: 0 : else if ( ( nID1 == PPT_PLACEHOLDER_OBJECT ) && ( nID2 == PPT_PLACEHOLDER_OBJECT ) )
1122 : 0 : eAutoLayout = AUTOLAYOUT_OBJ;
1123 : : }
1124 : 0 : break;
1125 : :
1126 : : case PPT_LAYOUT_2ROWSANDTITLE :
1127 : : {
1128 : 0 : eAutoLayout = AUTOLAYOUT_2TEXT;
1129 : 0 : sal_uInt16 nID1 = pSlideLayout->aPlaceholderId[ 1 ];
1130 : 0 : sal_uInt16 nID2 = pSlideLayout->aPlaceholderId[ 2 ];
1131 [ # # ][ # # ]: 0 : if ( nID1 == PPT_PLACEHOLDER_BODY && nID2 == PPT_PLACEHOLDER_OBJECT )
1132 : 0 : eAutoLayout = AUTOLAYOUT_TEXTOVEROBJ;
1133 [ # # ][ # # ]: 0 : else if ( nID1 == PPT_PLACEHOLDER_OBJECT && nID2 == PPT_PLACEHOLDER_BODY )
1134 : 0 : eAutoLayout = AUTOLAYOUT_OBJOVERTEXT;
1135 : : }
1136 : 0 : break;
1137 : :
1138 : : case PPT_LAYOUT_TITLESLIDE :
1139 : 3 : eAutoLayout = AUTOLAYOUT_TITLE;
1140 : 3 : break;
1141 : : case PPT_LAYOUT_ONLYTITLE :
1142 : 0 : eAutoLayout = AUTOLAYOUT_ONLY_TITLE;
1143 : 0 : break;
1144 : : case PPT_LAYOUT_RIGHTCOLUMN2ROWS :
1145 : 0 : eAutoLayout = AUTOLAYOUT_TEXT2OBJ;
1146 : 0 : break;
1147 : : case PPT_LAYOUT_LEFTCOLUMN2ROWS :
1148 : 0 : eAutoLayout = AUTOLAYOUT_2OBJTEXT;
1149 : 0 : break;
1150 : : case PPT_LAYOUT_TOPROW2COLUMN :
1151 : 0 : eAutoLayout = AUTOLAYOUT_2OBJOVERTEXT;
1152 : 0 : break;
1153 : : case PPT_LAYOUT_4OBJECTS :
1154 : 0 : eAutoLayout = AUTOLAYOUT_4OBJ;
1155 : 0 : break;
1156 : : case PPT_LAYOUT_BIGOBJECT :
1157 : 0 : eAutoLayout = AUTOLAYOUT_OBJ;
1158 : 0 : break;
1159 : : case PPT_LAYOUT_TITLERIGHTBODYLEFT :
1160 : 0 : eAutoLayout = AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE; // AUTOLAYOUT_ENUM;
1161 : 0 : break;
1162 : : case PPT_LAYOUT_TITLERIGHT2BODIESLEFT :
1163 : 0 : eAutoLayout = AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART; // AUTOLAYOUT_TEXT2OBJ;
1164 : 0 : break;
1165 : :
1166 : : case PPT_LAYOUT_BOTTOMROW2COLUMNS :
1167 : : case PPT_LAYOUT_BLANCSLIDE :
1168 : : case PPT_LAYOUT_MASTERSLIDE : // Layout der Standard- und Titel-MasterPage
1169 : : case PPT_LAYOUT_TITLEMASTERSLIDE :
1170 : : case PPT_LAYOUT_MASTERNOTES : // Layout der Notizen-MasterPage
1171 : : case PPT_LAYOUT_NOTESTITLEBODY : // Praesentationslayout fuer Notiz-Seiten
1172 : : case PPT_LAYOUT_HANDOUTLAYOUT : // Praesentationslayout fuer Handzettelseiten
1173 : 0 : eAutoLayout = AUTOLAYOUT_NONE;
1174 : 0 : break;
1175 : : }
1176 [ + - ]: 12 : if ( eAutoLayout != AUTOLAYOUT_NONE )
1177 [ + - ]: 12 : pPage->SetAutoLayout( eAutoLayout, sal_False );
1178 : : }
1179 : : }
1180 : : //////////////////////////////////////////////////////////////
1181 : : // Handzettel-MasterPage: Autolayout setzen //
1182 : : //////////////////////////////////////////////////////////////
1183 [ + - ]: 12 : SdPage* pHandoutMPage = mpDoc->GetMasterSdPage( 0, PK_HANDOUT );
1184 [ + - ]: 12 : pHandoutMPage->SetAutoLayout( AUTOLAYOUT_HANDOUT6, sal_True, sal_True );
1185 : : }
1186 : :
1187 [ + - ]: 12 : sal_uInt32 nSlideCount = GetPageCount();
1188 [ + - ][ - + ]: 12 : for ( i = 0; ( i < nSlideCount) && ( i < maSlideNameList.size() ); i++ )
[ - + ]
1189 : : {
1190 [ # # ]: 0 : SdPage* pPage = mpDoc->GetSdPage( i, PK_STANDARD );
1191 [ # # ]: 0 : String &aName = maSlideNameList[ i ];
1192 [ # # ]: 0 : if ( pPage )
1193 : : {
1194 [ # # ]: 0 : if ( aName.Len() )
1195 [ # # ]: 0 : pPage->SetName( aName );
1196 : : else
1197 [ # # ][ # # ]: 0 : aName = pPage->GetName();
1198 : : }
1199 : : }
1200 [ + - ]: 12 : if ( mbDocumentFound )
1201 : : {
1202 : 12 : mpDoc->SetSummationOfParagraphs( sal_True );
1203 [ + - ]: 12 : if ( pDocShell )
1204 : : {
1205 [ + - ]: 12 : ::sd::FrameView* pFrameView = mpDoc->GetFrameView( 0 );
1206 [ + - ]: 12 : if ( !pFrameView )
1207 : : {
1208 : 12 : std::vector<sd::FrameView*> &rViews = mpDoc->GetFrameViewList();
1209 [ + - ][ + - ]: 12 : pFrameView = new ::sd::FrameView( mpDoc );
1210 [ + - ]: 12 : rViews.push_back( pFrameView );
1211 : : }
1212 [ + - ]: 12 : if ( pFrameView )
1213 : : {
1214 : 12 : sal_uInt16 nSelectedPage = 0;
1215 : 12 : PageKind ePageKind = PK_STANDARD;
1216 : 12 : EditMode eEditMode = EM_PAGE;
1217 : :
1218 [ - - - - : 12 : switch ( aUserEditAtom.eLastViewType )
- - - + ]
1219 : : {
1220 : : case 7 : // outliner view
1221 : : {
1222 [ # # ]: 0 : SfxItemSet* pSet = mrMed.GetItemSet();
1223 [ # # ]: 0 : if ( pSet )
1224 [ # # ][ # # ]: 0 : pSet->Put( SfxUInt16Item( SID_VIEW_ID, 3 ) );
[ # # ]
1225 : : }
1226 : 0 : break;
1227 : : case 8 : // slide sorter
1228 : : {
1229 [ # # ]: 0 : SfxItemSet* pSet = mrMed.GetItemSet();
1230 [ # # ]: 0 : if ( pSet )
1231 [ # # ][ # # ]: 0 : pSet->Put( SfxUInt16Item( SID_VIEW_ID, 2 ) );
[ # # ]
1232 : : }
1233 : 0 : break;
1234 : : case 10 : // titlemaster
1235 : 0 : nSelectedPage = 1;
1236 : : case 2 : // master
1237 : : {
1238 : 0 : ePageKind = PK_STANDARD;
1239 : 0 : eEditMode = EM_MASTERPAGE;
1240 : : }
1241 : 0 : break;
1242 : : case 5 : // notes master
1243 : 0 : eEditMode = EM_MASTERPAGE;
1244 : : case 3 : // notes
1245 : 0 : ePageKind = PK_NOTES;
1246 : 0 : break;
1247 : : case 4 : // handout
1248 : 0 : ePageKind = PK_HANDOUT;
1249 : 0 : break;
1250 : : default :
1251 : : case 1 : // normal
1252 : 12 : break;
1253 : : }
1254 : 12 : pFrameView->SetPageKind( ePageKind );
1255 [ + - ]: 12 : pFrameView->SetSelectedPage( nSelectedPage );
1256 [ + - ]: 12 : pFrameView->SetViewShEditMode( eEditMode, ePageKind );
1257 : : }
1258 : : }
1259 : 12 : DffRecordHeader aCustomShowHeader;
1260 : : // custom show einlesen und setzen
1261 [ + - ]: 12 : rStCtrl.Seek( maDocHd.GetRecBegFilePos() + 8 );
1262 [ + - ][ - + ]: 12 : if ( SeekToRec( rStCtrl, PPT_PST_NamedShows, maDocHd.GetRecEndFilePos(), &aCustomShowHeader ) )
1263 : : {
1264 : 0 : DffRecordHeader aCuHeader;
1265 [ # # ][ # # ]: 0 : while( SeekToRec( rStCtrl, PPT_PST_NamedShow, aCustomShowHeader.GetRecEndFilePos(), &aCuHeader ) )
1266 : : {
1267 : 0 : DffRecordHeader aContent;
1268 [ # # ][ # # ]: 0 : if ( SeekToRec( rStCtrl, PPT_PST_CString, aCuHeader.GetRecEndFilePos(), &aContent ) )
1269 : : {
1270 : 0 : rtl::OUString aCuShow;
1271 [ # # ]: 0 : aContent.SeekToBegOfRecord( rStCtrl );
1272 [ # # ][ # # ]: 0 : if ( ReadString( aCuShow ) )
1273 : : {
1274 [ # # ][ # # ]: 0 : if ( SeekToRec( rStCtrl, PPT_PST_NamedShowSlides, aCuHeader.GetRecEndFilePos(), &aContent ) )
1275 : : {
1276 [ # # ]: 0 : PptSlidePersistList* pPageList = GetPageList( PPT_SLIDEPAGE );
1277 : 0 : sal_uInt32 nSCount = aContent.nRecLen >> 2;
1278 [ # # ][ # # ]: 0 : if ( pPageList && nSCount )
1279 : : {
1280 [ # # ]: 0 : SdCustomShowList* pList = mpDoc->GetCustomShowList( sal_True );
1281 [ # # ]: 0 : if ( pList )
1282 : : {
1283 [ # # ][ # # ]: 0 : SdCustomShow* pSdCustomShow = new SdCustomShow( mpDoc );
1284 [ # # ]: 0 : if ( pSdCustomShow )
1285 : : {
1286 [ # # ][ # # ]: 0 : pSdCustomShow->SetName( aCuShow );
[ # # ]
1287 : 0 : sal_uInt32 nFound = 0;
1288 [ # # ]: 0 : for ( sal_uInt32 nS = 0; nS < nSCount; nS++ )
1289 : : {
1290 : : sal_uInt32 nPageNumber;
1291 [ # # ]: 0 : rStCtrl >> nPageNumber;
1292 [ # # ]: 0 : sal_uInt16 nPage = pPageList->FindPage( nPageNumber );
1293 [ # # ]: 0 : if ( nPage != PPTSLIDEPERSIST_ENTRY_NOTFOUND )
1294 : : {
1295 [ # # ]: 0 : SdPage* pPage = mpDoc->GetSdPage( nPage, PK_STANDARD );
1296 [ # # ]: 0 : if ( pPage )
1297 : : {
1298 [ # # ][ # # ]: 0 : pSdCustomShow->PagesVector().push_back( pPage );
1299 : 0 : nFound++;
1300 : : }
1301 : : }
1302 : : }
1303 [ # # ]: 0 : if ( nFound )
1304 [ # # ]: 0 : pList->push_back( pSdCustomShow );
1305 : : else
1306 [ # # ][ # # ]: 0 : delete pSdCustomShow;
1307 : : }
1308 : : }
1309 : : }
1310 : : }
1311 : 0 : }
1312 : : }
1313 : : }
1314 : : }
1315 : : // this is defaulted, maybe there is no SSDocInfoAtom
1316 [ + - ]: 12 : String aCustomShow;
1317 : 12 : sal_uInt32 nFlags = 1; // Bit 0: Auto advance
1318 : 12 : sal_uInt16 nStartSlide = 0;
1319 : :
1320 : : // read the pres. configuration
1321 [ + - ]: 12 : rStCtrl.Seek( maDocHd.GetRecBegFilePos() + 8 );
1322 [ + - ][ + + ]: 12 : if ( SeekToRec( rStCtrl, PPT_PST_SSDocInfoAtom, maDocHd.GetRecEndFilePos(), &aCustomShowHeader ) )
1323 : : {
1324 : 9 : sal_uInt32 nPenColor = 0x1000000;
1325 : 9 : sal_Int32 nRestartTime = 0x7fffffff;
1326 : 9 : sal_Int16 nEndSlide = 0;
1327 [ + - ]: 9 : rStCtrl >> nPenColor
1328 [ + - ]: 9 : >> nRestartTime
1329 [ + - ]: 9 : >> nStartSlide
1330 [ + - ]: 9 : >> nEndSlide;
1331 : :
1332 : : sal_Unicode nChar;
1333 [ + - ]: 9 : for ( sal_uInt32 i2 = 0; i2 < 32; i2++ )
1334 : : {
1335 [ + - ]: 9 : rStCtrl >> nChar;
1336 [ - + ]: 9 : if ( nChar )
1337 [ # # ]: 0 : aCustomShow.Append( nChar );
1338 : : else
1339 : : {
1340 [ + - ]: 9 : rStCtrl.SeekRel( ( 31 - i2 ) << 1 );
1341 : 9 : break;
1342 : : }
1343 : : }
1344 [ + - ]: 9 : rStCtrl >> nFlags;
1345 : : }
1346 : : // set the current custom show
1347 [ - + ]: 12 : if ( aCustomShow.Len() )
1348 : : {
1349 [ # # ]: 0 : SdCustomShowList* pList = mpDoc->GetCustomShowList( sal_False );
1350 [ # # ]: 0 : if ( pList )
1351 : : {
1352 : 0 : SdCustomShow* pPtr = NULL;
1353 [ # # ][ # # ]: 0 : for( pPtr = pList->First(); pPtr; pPtr = pList->Next() )
[ # # ]
1354 : : {
1355 [ # # ][ # # ]: 0 : if ( pPtr->GetName() == aCustomShow )
[ # # ][ # # ]
1356 : 0 : break;
1357 : : }
1358 [ # # ]: 0 : if ( !pPtr )
1359 [ # # ]: 0 : pList->First();
1360 : : }
1361 : : }
1362 : 12 : sd::PresentationSettings& rPresSettings = mpDoc->getPresentationSettings();
1363 : :
1364 : 12 : rPresSettings.mbManual = ( nFlags & 1 ) == 0;
1365 : 12 : rPresSettings.mbAnimationAllowed = ( nFlags & 2 ) == 0;
1366 : 12 : rPresSettings.mbAll = ( nFlags & 4 ) == 0;
1367 : 12 : rPresSettings.mbCustomShow = ( nFlags & 8 ) != 0;
1368 : 12 : rPresSettings.mbEndless = ( nFlags & 0x80 ) != 0;
1369 : 12 : rPresSettings.mbFullScreen = ( nFlags & 0x10 ) == 0;
1370 : :
1371 [ # # ][ # # ]: 12 : if ( nStartSlide && ( nStartSlide <= GetPageCount() ) )
[ - + ][ - + ]
1372 : : {
1373 [ # # ]: 0 : SdPage* pPage = mpDoc->GetSdPage( nStartSlide - 1, PK_STANDARD );
1374 [ # # ]: 0 : if ( pPage )
1375 [ # # ][ # # ]: 0 : rPresSettings.maPresPage = pPage->GetName();
1376 [ + - ]: 12 : }
1377 : : }
1378 : :
1379 [ + - ][ + - ]: 12 : delete pStbMgr;
1380 : :
1381 : : // read DocumentInfo
1382 : : uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
1383 [ + - ][ + - ]: 12 : mpDoc->GetObjectShell()->GetModel(), uno::UNO_QUERY_THROW);
1384 : : uno::Reference<document::XDocumentProperties> xDocProps
1385 [ + - ][ + - ]: 12 : = xDPS->getDocumentProperties();
1386 [ + - ]: 12 : sfx2::LoadOlePropertySet(xDocProps, &mrStorage);
1387 [ + - ][ + - ]: 12 : xDocProps->setTemplateName(::rtl::OUString());
1388 : :
1389 [ + - ]: 12 : pSdrModel->setLock(false);
1390 [ + - ]: 12 : pSdrModel->EnableUndo(true);
1391 : 15 : return bOk;
1392 : : }
1393 : :
1394 : 21 : void ImplSdPPTImport::SetHeaderFooterPageSettings( SdPage* pPage, const PptSlidePersistEntry* pMasterPersist )
1395 : : {
1396 : : sal_uInt32 i;
1397 : 21 : PptSlidePersistList* pList = GetPageList( eAktPageKind );
1398 [ - + ][ - + ]: 21 : if ( ( !pList ) || ( pList->size() <= nAktPageNum ) )
[ + - ]
1399 : 21 : return;
1400 : 21 : PptSlidePersistEntry& rSlidePersist = *(*pList)[ nAktPageNum ];
1401 : 21 : HeaderFooterEntry* pHFE = rSlidePersist.pHeaderFooterEntry;
1402 [ + - ]: 21 : if ( pHFE )
1403 : : {
1404 [ + + ]: 105 : for ( i = 0; i < 4; i++ )
1405 : : {
1406 [ + - ]: 84 : bool bVisible = pHFE->IsToDisplay( i );
1407 [ + + ][ + + ]: 84 : if ( ( eAktPageKind == PPT_SLIDEPAGE )
[ - + ]
1408 : : && ( rSlidePersist.aSlideAtom.aLayout.eLayout == PPT_LAYOUT_TITLESLIDE )
1409 : : && ( aDocAtom.bTitlePlaceholdersOmitted == sal_True ) )
1410 : : {
1411 : 0 : bVisible = sal_False;
1412 : : }
1413 [ + + ][ + - ]: 84 : if ( bVisible && pMasterPersist )
1414 : : {
1415 [ + - ]: 54 : sal_uInt32 nPosition = pHFE->NeedToImportInstance( i, rSlidePersist );
1416 [ + + ]: 54 : if ( nPosition )
1417 : : {
1418 [ + - ]: 12 : Rectangle aEmpty;
1419 : 12 : bVisible = sal_False;
1420 [ + - ]: 12 : rStCtrl.Seek( nPosition );
1421 [ + - ]: 12 : ProcessData aProcessData( rSlidePersist, (SdPage*)pPage );
1422 [ + - ]: 12 : SdrObject* pObj = ImportObj( rStCtrl, (void*)&aProcessData, aEmpty, aEmpty );
1423 [ + - ]: 12 : if ( pObj )
1424 [ + - ]: 12 : pPage->NbcInsertObject( pObj, 0 );
1425 : : }
1426 : : }
1427 [ + - ]: 84 : String aPlaceHolderString;
1428 [ + - ]: 84 : if ( pHFE->pPlaceholder )
1429 [ + - ]: 84 : aPlaceHolderString = pHFE->pPlaceholder[ i ];
1430 : :
1431 [ + - ][ + - ]: 84 : sd::HeaderFooterSettings rHeaderFooterSettings( pPage->getHeaderFooterSettings() );
1432 [ + + + + : 84 : switch( i )
- ]
1433 : : {
1434 : : case 0 :
1435 : : {
1436 : 21 : rHeaderFooterSettings.mbDateTimeVisible = bVisible;
1437 : 21 : rHeaderFooterSettings.mbDateTimeIsFixed = ( pHFE->nAtom & 0x20000 ) == 0;
1438 [ + - ]: 21 : rHeaderFooterSettings.maDateTimeText = aPlaceHolderString;
1439 : : SvxDateFormat eDateFormat;
1440 : : SvxTimeFormat eTimeFormat;
1441 [ + - ]: 21 : PPTFieldEntry::GetDateTime( pHFE->nAtom & 0xff, eDateFormat, eTimeFormat );
1442 : 21 : rHeaderFooterSettings.meDateTimeFormat = eDateFormat | ( eTimeFormat << 4 );
1443 : : }
1444 : 21 : break;
1445 : : case 1 :
1446 : : {
1447 : 21 : rHeaderFooterSettings.mbHeaderVisible = bVisible;
1448 [ + - ]: 21 : rHeaderFooterSettings.maHeaderText = aPlaceHolderString;
1449 : : }
1450 : 21 : break;
1451 : : case 2 :
1452 : : {
1453 : 21 : rHeaderFooterSettings.mbFooterVisible = bVisible;
1454 [ + - ]: 21 : rHeaderFooterSettings.maFooterText = aPlaceHolderString;
1455 : : }
1456 : 21 : break;
1457 : : case 3 :
1458 : : {
1459 : 21 : rHeaderFooterSettings.mbSlideNumberVisible = bVisible;
1460 : : }
1461 : 21 : break;
1462 : : }
1463 [ + - ]: 84 : pPage->setHeaderFooterSettings( rHeaderFooterSettings );
1464 [ + - ][ + - ]: 84 : }
1465 : : }
1466 : : }
1467 : :
1468 : : //////////////////////////////////////////////////////////////////////////
1469 : : //
1470 : : // Import von Seiten
1471 : : //
1472 : : //////////////////////////////////////////////////////////////////////////
1473 : :
1474 : : struct Ppt97AnimationStlSortHelper
1475 : : {
1476 : : bool operator()( const std::pair< SdrObject*, Ppt97AnimationPtr >& p1, const std::pair< SdrObject*, Ppt97AnimationPtr >& p2 );
1477 : : };
1478 : :
1479 : 0 : bool Ppt97AnimationStlSortHelper::operator()( const std::pair< SdrObject*, Ppt97AnimationPtr >& p1, const std::pair< SdrObject*, Ppt97AnimationPtr >& p2 )
1480 : : {
1481 [ # # ][ # # ]: 0 : if( !p1.second.get() || !p2.second.get() )
[ # # ]
1482 : 0 : return true;
1483 [ # # ]: 0 : if( *p1.second < *p2.second )
1484 : 0 : return true;
1485 [ # # ]: 0 : if( *p1.second > *p2.second )
1486 : 0 : return false;
1487 [ # # ]: 0 : if( p1.first->GetOrdNum() < p2.first->GetOrdNum() )
1488 : 0 : return true;
1489 : 0 : return false;
1490 : : }
1491 : :
1492 : 33 : void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const sal_Bool bNewAnimationsUsed )
1493 : : {
1494 : 33 : sal_uLong nFilePosMerk = rStCtrl.Tell();
1495 : :
1496 : : // PageKind an der Seite setzen (bisher nur PK_STANDARD oder PK_NOTES)
1497 [ + + ]: 33 : if ( pPage->GetPageKind() == PK_STANDARD )
1498 : : {
1499 [ + - ]: 24 : PptSlidePersistList* pPersistList = GetPageList( eAktPageKind );
1500 : 24 : PptSlidePersistEntry* pActualSlidePersist = ( pPersistList && ( nAktPageNum < pPersistList->size() ) )
1501 [ + - + - ]: 48 : ? (*pPersistList)[ nAktPageNum ] : NULL;
1502 : :
1503 [ + - ][ + + ]: 24 : if ( pActualSlidePersist && ( eAktPageKind == PPT_SLIDEPAGE ) )
1504 : : {
1505 [ - + ]: 12 : if ( ! ( pActualSlidePersist->aSlideAtom.nFlags & 1 ) ) // do not follow master objects ?
1506 : : {
1507 [ # # ]: 0 : if(pPage->TRG_HasMasterPage())
1508 : : {
1509 [ # # ]: 0 : SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers();
1510 : 0 : aVisibleLayers.Set(mnBackgroundObjectsLayerID, sal_False);
1511 [ # # ]: 0 : pPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers);
1512 : : }
1513 : : }
1514 : : }
1515 : 24 : DffRecordHeader aPageRecHd;
1516 [ + - ][ + - ]: 24 : if ( pPage && SeekToAktPage( &aPageRecHd ) )
[ + - ][ + - ]
1517 : : {
1518 : 24 : sal_uLong nPageRecEnd = aPageRecHd.GetRecEndFilePos();
1519 : :
1520 : 24 : sal_Bool bTryTwice = ( eAktPageKind == PPT_SLIDEPAGE );
1521 : 24 : sal_Bool bSSSlideInfoAtom = sal_False;
1522 : 0 : while ( sal_True )
1523 : : {
1524 [ + - ][ + + ]: 324 : while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < nPageRecEnd ) )
[ + + ]
1525 : : {
1526 : 300 : DffRecordHeader aHd;
1527 [ + - ]: 300 : rStCtrl >> aHd;
1528 [ + + ]: 300 : switch ( aHd.nRecType )
1529 : : {
1530 : : case PPT_PST_SSSlideInfoAtom:
1531 : : {
1532 : 9 : bSSSlideInfoAtom = sal_True;
1533 [ - + ]: 9 : if ( eAktPageKind == PPT_MASTERPAGE )
1534 : : {
1535 [ # # ]: 0 : if ( pActualSlidePersist )
1536 : 0 : pActualSlidePersist->aPersistAtom.nReserved = aHd.GetRecBegFilePos();
1537 : : }
1538 : : else
1539 : : {
1540 : : sal_Int8 nDirection, nTransitionType, nByteDummy, nSpeed;
1541 : : sal_Int16 nBuildFlags;
1542 : : sal_Int32 nSlideTime, nSoundRef;
1543 [ + - ]: 9 : rStCtrl >> nSlideTime // Standzeit (in Ticks)
1544 [ + - ]: 9 : >> nSoundRef // Index in SoundCollection
1545 [ + - ]: 9 : >> nDirection // Richtung des Ueberblendeffekts
1546 [ + - ]: 9 : >> nTransitionType // Ueberblendeffekt
1547 [ + - ]: 9 : >> nBuildFlags // Buildflags (s.u.)
1548 [ + - ]: 9 : >> nSpeed // Geschwindigkeit (langsam, mittel, schnell)
1549 [ + - ][ + - ]: 9 : >> nByteDummy >> nByteDummy >> nByteDummy;
[ + - ]
1550 : :
1551 [ - - - + : 9 : switch ( nTransitionType )
- - - - -
- - - - -
- - - - -
- - - - ]
1552 : : {
1553 : : case PPT_TRANSITION_TYPE_BLINDS :
1554 : : {
1555 [ # # ]: 0 : if ( nDirection == 0 )
1556 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_VERTICAL_STRIPES );// Vertikal blenden
1557 [ # # ]: 0 : else if ( nDirection == 1 )
1558 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_HORIZONTAL_STRIPES );// Horizontal blenden
1559 : : }
1560 : 0 : break;
1561 : : case PPT_TRANSITION_TYPE_CHECKER :
1562 : : {
1563 [ # # ]: 0 : if ( nDirection == 0 )
1564 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_HORIZONTAL_CHECKERBOARD );// Vertikal versetzt einblenden ??
1565 [ # # ]: 0 : else if ( nDirection == 1 )
1566 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_VERTICAL_CHECKERBOARD );// Horizontal versetzt einblenden ??
1567 : : }
1568 : 0 : break;
1569 : : case PPT_TRANSITION_TYPE_COVER :
1570 : : {
1571 [ # # ]: 0 : if ( nDirection == 0 )
1572 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_MOVE_FROM_RIGHT ); // Von rechts ueberdecken
1573 [ # # ]: 0 : else if ( nDirection == 1 )
1574 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_MOVE_FROM_BOTTOM ); // Von unten ueberdecken
1575 [ # # ]: 0 : else if ( nDirection == 2 )
1576 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_MOVE_FROM_LEFT ); // Von links ueberdecken
1577 [ # # ]: 0 : else if ( nDirection == 3 )
1578 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_MOVE_FROM_TOP ); // Von oben ueberdecken
1579 [ # # ]: 0 : else if ( nDirection == 4 )
1580 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_MOVE_FROM_LOWERRIGHT );// Von rechts unten ueberdecken ??
1581 [ # # ]: 0 : else if ( nDirection == 5 )
1582 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_MOVE_FROM_LOWERLEFT ); // Von links unten ueberdecken ??
1583 [ # # ]: 0 : else if ( nDirection == 6 )
1584 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_MOVE_FROM_UPPERRIGHT );// Von rechts oben ueberdecken
1585 [ # # ]: 0 : else if ( nDirection == 7 )
1586 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_MOVE_FROM_UPPERLEFT ); // Von links oben ueberdecken ??
1587 : : }
1588 : 0 : break;
1589 : : case PPT_TRANSITION_TYPE_NONE :
1590 : : {
1591 [ + - ]: 9 : if ( nBuildFlags )
1592 : : {
1593 [ - + ]: 9 : if ( nDirection == 0 )
1594 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_NONE ); // Direkt
1595 [ - + ]: 9 : else if ( nDirection == 1 )
1596 : : {
1597 [ # # ]: 0 : pPage->setTransitionType( animations::TransitionType::BARWIPE );
1598 [ # # ]: 0 : pPage->setTransitionSubtype( animations::TransitionSubType::FADEOVERCOLOR );
1599 [ # # ]: 0 : pPage->setTransitionFadeColor( 0 );
1600 : : }
1601 : : }
1602 : : else
1603 [ # # ]: 0 : pPage->setTransitionType( 0 );
1604 : : }
1605 : 9 : break;
1606 : : case PPT_TRANSITION_TYPE_DISSOLVE :
1607 [ # # ]: 0 : pPage->SetFadeEffect(::com::sun::star::presentation::FadeEffect_DISSOLVE); // Aufloesen
1608 : 0 : break;
1609 : : case PPT_TRANSITION_TYPE_RANDOM_BARS :
1610 : : {
1611 [ # # ]: 0 : if ( nDirection == 0 )
1612 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_HORIZONTAL_LINES ); // Horizontale Linien
1613 [ # # ]: 0 : else if ( nDirection == 1 )
1614 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_VERTICAL_LINES ); // Vertikale Linien
1615 : : }
1616 : 0 : break;
1617 : : case PPT_TRANSITION_TYPE_SPLIT :
1618 : : {
1619 [ # # ]: 0 : if ( nDirection == 0 )
1620 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_OPEN_VERTICAL ); // Horizontal oeffnen
1621 [ # # ]: 0 : else if ( nDirection == 1 )
1622 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_CLOSE_VERTICAL ); // Horizontal schliessen
1623 [ # # ]: 0 : else if ( nDirection == 2 )
1624 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_OPEN_HORIZONTAL ); // Vertikal oeffnen
1625 [ # # ]: 0 : else if ( nDirection == 3 )
1626 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_CLOSE_HORIZONTAL );// Vertikal schliessen
1627 : : }
1628 : 0 : break;
1629 : : case PPT_TRANSITION_TYPE_STRIPS :
1630 : : {
1631 [ # # ]: 0 : if ( nDirection == 4 )
1632 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_FADE_FROM_LOWERRIGHT );// Diagonal nach links oben
1633 [ # # ]: 0 : else if ( nDirection == 5 )
1634 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_FADE_FROM_LOWERLEFT ); // Diagonal nach rechts oben
1635 [ # # ]: 0 : else if ( nDirection == 6 )
1636 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_FADE_FROM_UPPERRIGHT );// Diagonal nach links unten
1637 [ # # ]: 0 : else if ( nDirection == 7 )
1638 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_FADE_FROM_UPPERLEFT ); // Diagonal nach rechts unten
1639 : : }
1640 : 0 : break;
1641 : : case PPT_TRANSITION_TYPE_PULL :
1642 : : {
1643 [ # # ]: 0 : if ( nDirection == 0 )
1644 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_LEFT ); // Nach links aufdecken
1645 [ # # ]: 0 : else if ( nDirection == 1 )
1646 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_TOP ); // Nach oben aufdecken
1647 [ # # ]: 0 : else if ( nDirection == 2 )
1648 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_RIGHT ); // Nach rechts aufdecken
1649 [ # # ]: 0 : else if ( nDirection == 3 )
1650 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_BOTTOM ); // Nach unten aufdecken
1651 [ # # ]: 0 : else if ( nDirection == 4 )
1652 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_UPPERLEFT );// Nach links oben aufdecken
1653 [ # # ]: 0 : else if ( nDirection == 5 )
1654 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_UPPERRIGHT );// Nach rechts oben aufdecken
1655 [ # # ]: 0 : else if ( nDirection == 6 )
1656 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_LOWERLEFT );// Nach links unten aufdecken
1657 [ # # ]: 0 : else if ( nDirection == 7 )
1658 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_LOWERRIGHT );// Nach rechts unten aufdecken
1659 : : }
1660 : 0 : break;
1661 : : case PPT_TRANSITION_TYPE_WIPE :
1662 : : {
1663 [ # # ]: 0 : if ( nDirection == 0 )
1664 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_FADE_FROM_RIGHT ); // Von rechts rollen
1665 [ # # ]: 0 : else if ( nDirection == 1 )
1666 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_FADE_FROM_BOTTOM );// Von unten rollen
1667 [ # # ]: 0 : else if ( nDirection == 2 )
1668 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_FADE_FROM_LEFT ); // Von links rollen
1669 [ # # ]: 0 : else if ( nDirection == 3 )
1670 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_FADE_FROM_TOP ); // Von oben rollen
1671 : : }
1672 : 0 : break;
1673 : : case PPT_TRANSITION_TYPE_RANDOM :
1674 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_RANDOM ); // Automatisch
1675 : 0 : break;
1676 : : case PPT_TRANSITION_TYPE_FADE :
1677 : : {
1678 [ # # ]: 0 : pPage->setTransitionType( animations::TransitionType::FADE );
1679 [ # # ]: 0 : pPage->setTransitionSubtype( animations::TransitionSubType::FADEOVERCOLOR );
1680 [ # # ]: 0 : pPage->setTransitionFadeColor( 0 );
1681 : : }
1682 : 0 : break;
1683 : : case PPT_TRANSITION_TYPE_ZOOM :
1684 : : {
1685 [ # # ]: 0 : if ( nDirection == 0 )
1686 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_FADE_FROM_CENTER );// Von innen einblenden
1687 [ # # ]: 0 : else if ( nDirection == 1 )
1688 [ # # ]: 0 : pPage->SetFadeEffect( ::com::sun::star::presentation::FadeEffect_FADE_TO_CENTER ); // Von aussen einblenden
1689 : : }
1690 : 0 : break;
1691 : : case PPT_TRANSITION_TYPE_DIAMOND :
1692 : : {
1693 [ # # ]: 0 : pPage->setTransitionType( animations::TransitionType::IRISWIPE );
1694 [ # # ]: 0 : pPage->setTransitionSubtype( animations::TransitionSubType::DIAMOND );
1695 : : }
1696 : 0 : break;
1697 : : case PPT_TRANSITION_TYPE_PLUS :
1698 : : {
1699 [ # # ]: 0 : pPage->setTransitionType( animations::TransitionType::FOURBOXWIPE );
1700 [ # # ]: 0 : pPage->setTransitionSubtype( animations::TransitionSubType::CORNERSOUT );
1701 : : }
1702 : 0 : break;
1703 : : case PPT_TRANSITION_TYPE_CIRCLE :
1704 : : {
1705 [ # # ]: 0 : pPage->setTransitionType( animations::TransitionType::ELLIPSEWIPE );
1706 [ # # ]: 0 : pPage->setTransitionSubtype( animations::TransitionSubType::CIRCLE );
1707 : : }
1708 : 0 : break;
1709 : : case PPT_TRANSITION_TYPE_WEDGE :
1710 : : {
1711 [ # # ]: 0 : pPage->setTransitionType( animations::TransitionType::FANWIPE );
1712 [ # # ]: 0 : pPage->setTransitionSubtype( animations::TransitionSubType::CENTERTOP );
1713 : : }
1714 : 0 : break;
1715 : : case PPT_TRANSITION_TYPE_WHEEL :
1716 : : {
1717 [ # # ]: 0 : pPage->setTransitionType( animations::TransitionType::PINWHEELWIPE );
1718 : : sal_Int16 nSubType;
1719 [ # # # # : 0 : switch( nDirection )
# ]
1720 : : {
1721 : : default:
1722 : 0 : case 1 : nSubType = animations::TransitionSubType::ONEBLADE; break;
1723 : 0 : case 2 : nSubType = animations::TransitionSubType::TWOBLADEVERTICAL; break;
1724 : 0 : case 3 : nSubType = animations::TransitionSubType::THREEBLADE; break;
1725 : 0 : case 4 : nSubType = animations::TransitionSubType::FOURBLADE; break;
1726 : 0 : case 8 : nSubType = animations::TransitionSubType::EIGHTBLADE; break;
1727 : : }
1728 [ # # ]: 0 : pPage->setTransitionSubtype( nSubType );
1729 : : }
1730 : 0 : break;
1731 : : case PPT_TRANSITION_TYPE_PUSH :
1732 : : {
1733 [ # # ]: 0 : pPage->setTransitionType( animations::TransitionType::PUSHWIPE );
1734 : : sal_Int16 nSubType;
1735 [ # # # # ]: 0 : switch( nDirection )
1736 : : {
1737 : : default:
1738 : 0 : case 0 : nSubType = animations::TransitionSubType::FROMRIGHT; break;
1739 : 0 : case 1 : nSubType = animations::TransitionSubType::FROMBOTTOM; break;
1740 : 0 : case 2 : nSubType = animations::TransitionSubType::FROMLEFT; break;
1741 : 0 : case 3 : nSubType = animations::TransitionSubType::FROMTOP; break;
1742 : : }
1743 [ # # ]: 0 : pPage->setTransitionSubtype( nSubType );
1744 : : }
1745 : 0 : break;
1746 : : case PPT_TRANSITION_TYPE_COMB :
1747 : : {
1748 [ # # ]: 0 : pPage->setTransitionType( animations::TransitionType::PUSHWIPE );
1749 [ # # ][ # # ]: 0 : pPage->setTransitionSubtype( nDirection ? animations::TransitionSubType::COMBVERTICAL : animations::TransitionSubType::COMBHORIZONTAL );
1750 : : }
1751 : 0 : break;
1752 : : case PPT_TRANSITION_TYPE_NEWSFLASH :
1753 : : {
1754 [ # # ]: 0 : pPage->setTransitionType( animations::TransitionType::ZOOM );
1755 [ # # ]: 0 : pPage->setTransitionSubtype( animations::TransitionSubType::ROTATEIN );
1756 : : }
1757 : 0 : break;
1758 : : case PPT_TRANSITION_TYPE_SMOOTHFADE :
1759 : : {
1760 [ # # ]: 0 : pPage->setTransitionType( animations::TransitionType::FADE );
1761 [ # # ]: 0 : pPage->setTransitionSubtype( animations::TransitionSubType::CROSSFADE );
1762 : : }
1763 : 0 : break;
1764 : : }
1765 : :
1766 [ - + ]: 9 : if ( nSpeed == 0 )
1767 [ # # ]: 0 : pPage->setTransitionDuration( 3.0 ); // langsam
1768 [ + - ]: 9 : else if ( nSpeed == 1 )
1769 [ + - ]: 9 : pPage->setTransitionDuration( 2.0 ); // mittel
1770 [ # # ]: 0 : else if ( nSpeed == 2 )
1771 [ # # ]: 0 : pPage->setTransitionDuration( 1.0 ); // schnell
1772 : :
1773 [ - + ]: 9 : if ( nBuildFlags & 0x400 ) // slidechange by time
1774 : : { // Standzeit (in Ticks)
1775 : 0 : pPage->SetPresChange( PRESCHANGE_AUTO );
1776 : 0 : pPage->SetTime( nSlideTime / 1000 );
1777 : : }
1778 : : else
1779 : 9 : pPage->SetPresChange( mePresChange );
1780 : :
1781 [ - + ]: 9 : if ( nBuildFlags & 4 )
1782 : 0 : pPage->SetExcluded( sal_True ); // Dia nicht anzeigen
1783 [ + - ]: 9 : if ( nBuildFlags & 16 )
1784 : : { // Dia mit Soundeffekt
1785 : 9 : pPage->SetSound( sal_True );
1786 [ + - ]: 9 : String aSoundFile( ReadSound( nSoundRef ) );
1787 [ + - ][ + - ]: 9 : pPage->SetSoundFile( aSoundFile );
1788 : : }
1789 [ - + ]: 9 : if ( nBuildFlags & ( 1 << 6 ) ) // Loop until next sound
1790 : 0 : pPage->SetLoopSound( sal_True );
1791 [ - + ]: 9 : if ( nBuildFlags & ( 1 << 8 ) ) // Stop the previous sound
1792 : 9 : pPage->SetStopSound( sal_True );
1793 : : break;
1794 : : }
1795 : : }
1796 : : }
1797 [ + - ]: 300 : aHd.SeekToEndOfRecord( rStCtrl );
1798 : : }
1799 [ + + ][ + + ]: 24 : if ( bTryTwice && ( bSSSlideInfoAtom == sal_False ) )
1800 : : {
1801 : 3 : bTryTwice = sal_False;
1802 [ + - ][ + - ]: 3 : if ( HasMasterPage( nAktPageNum, eAktPageKind ) )
1803 : : {
1804 [ + - ]: 3 : sal_uInt16 nMasterNum = GetMasterPageIndex( nAktPageNum, eAktPageKind );
1805 [ + - ]: 3 : PptSlidePersistList* pPageList = GetPageList( PPT_MASTERPAGE );
1806 [ + - ][ + - ]: 3 : if ( pPageList && ( nMasterNum < pPageList->size() ) )
[ + - ]
1807 : : {
1808 : 3 : PptSlidePersistEntry* pE = (*pPageList)[ nMasterNum ];
1809 [ + - ]: 3 : if ( pE )
1810 : : {
1811 : 3 : sal_uInt32 nOfs = pE->aPersistAtom.nReserved;
1812 [ - + ]: 3 : if ( nOfs )
1813 : : {
1814 [ # # ]: 0 : rStCtrl.Seek( nOfs );
1815 : 0 : nPageRecEnd = nOfs + 16;
1816 : 0 : continue;
1817 : : }
1818 : : }
1819 : : }
1820 : :
1821 : : }
1822 : : }
1823 : 24 : break;
1824 : : }
1825 : : }
1826 : : }
1827 : :
1828 [ + + ]: 33 : if ( !bNewAnimationsUsed )
1829 : : {
1830 [ + - ]: 21 : tAnimationVector aAnimationsOnThisPage;
1831 : :
1832 : : // add effects from page in correct order
1833 [ + - ]: 21 : SdrObjListIter aSdrIter( *pPage, IM_FLAT );
1834 [ + + ]: 156 : while ( aSdrIter.IsMore() )
1835 : : {
1836 [ + - ]: 135 : SdrObject* pObj = aSdrIter.Next();
1837 [ + - ]: 135 : tAnimationMap::iterator aFound = maAnimations.find( pObj );
1838 [ - + ]: 135 : if( aFound != maAnimations.end() )
1839 : : {
1840 [ # # ]: 0 : std::pair< SdrObject*, Ppt97AnimationPtr > aPair( (*aFound).first, (*aFound).second );
1841 [ # # ][ # # ]: 135 : aAnimationsOnThisPage.push_back( aPair );
1842 : : }
1843 : : }
1844 : :
1845 : : Ppt97AnimationStlSortHelper aSortHelper;
1846 [ + - ]: 21 : std::sort( aAnimationsOnThisPage.begin(), aAnimationsOnThisPage.end(), aSortHelper );
1847 : :
1848 : 21 : tAnimationVector::iterator aIter( aAnimationsOnThisPage.begin() );
1849 : 21 : const tAnimationVector::iterator aEnd( aAnimationsOnThisPage.end() );
1850 : :
1851 [ + - ][ - + ]: 21 : for( ;aIter != aEnd; ++aIter )
1852 : : {
1853 [ # # ]: 0 : Ppt97AnimationPtr pPpt97Animation = (*aIter).second;;
1854 [ # # ]: 0 : if( pPpt97Animation.get() )
1855 [ # # ]: 0 : pPpt97Animation->createAndSetCustomAnimationEffect( (*aIter).first );
1856 [ # # ]: 21 : }
1857 : : }
1858 : 33 : rStCtrl.Seek( nFilePosMerk );
1859 : 33 : }
1860 : :
1861 : : //////////////////////////////////////////////////////////////////////////
1862 : : //
1863 : : // Import von Sounds
1864 : : //
1865 : : // Die Sounds werden nicht nur als String importiert sondern auch
1866 : : // in die Gallery einefuegt, falls dort noch nicht vorhanden.
1867 : : //
1868 : : ///////////////////////////////////////////////////////////////////////////
1869 : :
1870 : 9 : String ImplSdPPTImport::ReadSound(sal_uInt32 nSoundRef) const
1871 : : {
1872 : 9 : rtl::OUString aRetval;
1873 : 9 : sal_uInt32 nPosMerk = rStCtrl.Tell();
1874 : 9 : DffRecordHeader aDocHd;
1875 [ + - ][ + - ]: 9 : if ( SeekToDocument( &aDocHd ) )
1876 : : {
1877 : 9 : sal_uInt32 nSoundLen = aDocHd.GetRecEndFilePos();
1878 : 9 : DffRecordHeader aSoundBlockRecHd;
1879 [ - + ][ + - ]: 9 : if( SeekToRec( rStCtrl, PPT_PST_SoundCollection, nSoundLen, &aSoundBlockRecHd ) )
1880 : : {
1881 : 0 : sal_uInt32 nDataLen = aSoundBlockRecHd.GetRecEndFilePos();
1882 : 0 : DffRecordHeader aSoundRecHd;
1883 : 0 : sal_Bool bRefStrValid = sal_False;
1884 : 0 : sal_Bool bDone = sal_False;
1885 : :
1886 [ # # ][ # # ]: 9 : while( !bDone && SeekToRec( rStCtrl, PPT_PST_Sound, nDataLen, &aSoundRecHd ) )
[ # # ][ # # ]
1887 : : {
1888 : 0 : sal_uInt32 nStrLen = aSoundRecHd.GetRecEndFilePos();
1889 : 0 : rtl::OUString aRefStr;
1890 : 0 : sal_uInt32 nPosMerk2 = rStCtrl.Tell();
1891 [ # # ][ # # ]: 0 : if ( SeekToRec( rStCtrl, PPT_PST_CString, nStrLen, NULL, 2 ) )
1892 : : {
1893 [ # # ][ # # ]: 0 : if ( ReadString( aRefStr ) )
1894 : 0 : bRefStrValid = sal_True;
1895 : : }
1896 [ # # ]: 0 : if ( bRefStrValid )
1897 : : {
1898 [ # # ]: 0 : if ( rtl::OUString::valueOf(static_cast<sal_Int32>(nSoundRef)) == aRefStr )
1899 : : {
1900 [ # # ]: 0 : rStCtrl.Seek( nPosMerk2 );
1901 [ # # ][ # # ]: 0 : if ( SeekToRec( rStCtrl, PPT_PST_CString, nStrLen, NULL, 0 ) )
1902 : : {
1903 [ # # ]: 0 : ReadString( aRetval );
1904 : 0 : bDone = sal_True;
1905 : : }
1906 : : }
1907 : : }
1908 [ # # ]: 0 : if ( bDone )
1909 : : {
1910 : : // ueberpruefen, ob diese Sound-Datei schon
1911 : : // existiert. Wenn nicht, exportiere diese
1912 : : // in unser lokales Sound-Verzeichnis.
1913 : 0 : sal_Bool bSoundExists = sal_False;
1914 [ # # ]: 0 : ::std::vector< String > aSoundList;
1915 : :
1916 [ # # ]: 0 : GalleryExplorer::FillObjList( GALLERY_THEME_SOUNDS, aSoundList );
1917 [ # # ]: 0 : GalleryExplorer::FillObjList( GALLERY_THEME_USERSOUNDS, aSoundList );
1918 : :
1919 [ # # ][ # # ]: 0 : for( size_t n = 0; ( n < aSoundList.size() ) && !bSoundExists; ++n )
[ # # ]
1920 : : {
1921 [ # # ][ # # ]: 0 : INetURLObject aURL( aSoundList[ n ] );
[ # # ]
1922 : :
1923 [ # # ][ # # ]: 0 : if( aURL.GetName() == aRetval )
1924 : : {
1925 [ # # ][ # # ]: 0 : aRetval = aSoundList[ n ];
1926 : 0 : bSoundExists = sal_True;
1927 : : }
1928 [ # # ]: 0 : }
1929 : :
1930 : 0 : aSoundList.clear();
1931 : :
1932 [ # # ]: 0 : if ( !bSoundExists )
1933 : : {
1934 [ # # ]: 0 : rStCtrl.Seek( nPosMerk2 );
1935 : 0 : DffRecordHeader aSoundDataRecHd;
1936 [ # # ][ # # ]: 0 : if ( SeekToRec( rStCtrl, PPT_PST_SoundData, nStrLen, &aSoundDataRecHd, 0 ) )
1937 : : {
1938 [ # # ][ # # ]: 0 : String aGalleryDir( SvtPathOptions().GetGalleryPath() );
[ # # ][ # # ]
1939 [ # # ][ # # ]: 0 : INetURLObject aGalleryUserSound( aGalleryDir.GetToken( comphelper::string::getTokenCount(aGalleryDir, ';') - 1 ) );
[ # # ][ # # ]
[ # # ][ # # ]
1940 : :
1941 [ # # ]: 0 : aGalleryUserSound.Append( aRetval );
1942 : 0 : sal_uInt32 nSoundDataLen = aSoundDataRecHd.nRecLen;
1943 [ # # ]: 0 : sal_uInt8* pBuf = new sal_uInt8[ nSoundDataLen ];
1944 : :
1945 [ # # ]: 0 : rStCtrl.Read( pBuf, nSoundDataLen );
1946 [ # # ][ # # ]: 0 : SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( aGalleryUserSound.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_TRUNC );
[ # # ][ # # ]
1947 : :
1948 [ # # ]: 0 : if( pOStm )
1949 : : {
1950 [ # # ]: 0 : pOStm->Write( pBuf, nSoundDataLen );
1951 : :
1952 [ # # ]: 0 : if( pOStm->GetError() == ERRCODE_NONE )
1953 : : {
1954 [ # # ][ # # ]: 0 : GalleryExplorer::InsertURL( GALLERY_THEME_USERSOUNDS, aGalleryUserSound.GetMainURL( INetURLObject::NO_DECODE ) );
[ # # ][ # # ]
1955 [ # # ]: 0 : aRetval = aGalleryUserSound.GetMainURL( INetURLObject::NO_DECODE );
1956 : : }
1957 : :
1958 [ # # ][ # # ]: 0 : delete pOStm;
1959 : : }
1960 : :
1961 [ # # ][ # # ]: 0 : delete[] pBuf;
[ # # ]
1962 : : }
1963 : 0 : }
1964 : : }
1965 [ # # ]: 0 : if ( !bDone )
1966 [ # # ]: 0 : aSoundRecHd.SeekToEndOfRecord( rStCtrl );
1967 : 0 : }
1968 : : }
1969 : : }
1970 [ + - ]: 9 : rStCtrl.Seek( nPosMerk );
1971 [ + - ]: 9 : return aRetval;
1972 : : }
1973 : :
1974 : : //////////////////////////////////////////////////////////////////////////
1975 : : //
1976 : : // media object import, the return value is the url to the media object
1977 : : //
1978 : : //////////////////////////////////////////////////////////////////////////
1979 : :
1980 : 0 : String ImplSdPPTImport::ReadMedia( sal_uInt32 nMediaRef ) const
1981 : : {
1982 : 0 : rtl::OUString aRetVal;
1983 [ # # ]: 0 : DffRecordHeader* pHd( const_cast<ImplSdPPTImport*>(this)->aDocRecManager.GetRecordHeader( PPT_PST_ExObjList, SEEK_FROM_BEGINNING ) );
1984 [ # # ]: 0 : if ( pHd )
1985 : : {
1986 [ # # ]: 0 : pHd->SeekToContent( rStCtrl );
1987 [ # # ][ # # ]: 0 : while ( ( rStCtrl.Tell() < pHd->GetRecEndFilePos() ) && aRetVal.isEmpty() )
[ # # ]
1988 : : {
1989 : 0 : DffRecordHeader aHdMovie;
1990 [ # # ]: 0 : rStCtrl >> aHdMovie;
1991 [ # # ]: 0 : switch( aHdMovie.nRecType )
1992 : : {
1993 : : case PPT_PST_ExAviMovie :
1994 : : case PPT_PST_ExMCIMovie :
1995 : : {
1996 : 0 : DffRecordHeader aExVideoHd;
1997 [ # # ][ # # ]: 0 : if ( SeekToRec( rStCtrl, PPT_PST_ExVideo, aHdMovie.GetRecEndFilePos(), &aExVideoHd ) )
1998 : : {
1999 : 0 : DffRecordHeader aExMediaAtomHd;
2000 [ # # ][ # # ]: 0 : if ( SeekToRec( rStCtrl, PPT_PST_ExMediaAtom, aExVideoHd.GetRecEndFilePos(), &aExMediaAtomHd ) )
2001 : : {
2002 : : sal_uInt32 nRef;
2003 [ # # ]: 0 : rStCtrl >> nRef;
2004 [ # # ]: 0 : if ( nRef == nMediaRef )
2005 : : {
2006 [ # # ]: 0 : aExVideoHd.SeekToContent( rStCtrl );
2007 [ # # ]: 0 : while( rStCtrl.Tell() < aExVideoHd.GetRecEndFilePos() )
2008 : : {
2009 : 0 : DffRecordHeader aHd;
2010 [ # # ]: 0 : rStCtrl >> aHd;
2011 [ # # ]: 0 : switch( aHd.nRecType )
2012 : : {
2013 : : case PPT_PST_CString :
2014 : : {
2015 [ # # ]: 0 : aHd.SeekToBegOfRecord( rStCtrl );
2016 : 0 : rtl::OUString aStr;
2017 [ # # ][ # # ]: 0 : if ( ReadString( aStr ) )
2018 : : {
2019 [ # # ][ # # ]: 0 : if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aStr, aRetVal ) )
2020 : : {
2021 [ # # ][ # # ]: 0 : aRetVal = INetURLObject( aRetVal ).GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS );
[ # # ]
2022 : : }
2023 : 0 : }
2024 : : }
2025 : 0 : break;
2026 : : }
2027 [ # # ]: 0 : aHd.SeekToEndOfRecord( rStCtrl );
2028 : : }
2029 : : break;
2030 : : }
2031 : : }
2032 : : }
2033 : : }
2034 : 0 : break;
2035 : : }
2036 [ # # ]: 0 : aHdMovie.SeekToEndOfRecord( rStCtrl );
2037 : : }
2038 : : }
2039 [ # # ]: 0 : return aRetVal;
2040 : : }
2041 : :
2042 : : //////////////////////////////////////////////////////////////////////////
2043 : : //
2044 : : // Import von Objekten
2045 : : //
2046 : : //////////////////////////////////////////////////////////////////////////
2047 : :
2048 : 0 : void ImplSdPPTImport::FillSdAnimationInfo( SdAnimationInfo* pInfo, PptInteractiveInfoAtom* pIAtom, String aMacroName )
2049 : : {
2050 : : // Lokale Informationen in pInfo eintragen
2051 [ # # ]: 0 : if( pIAtom->nSoundRef )
2052 : : {
2053 [ # # ]: 0 : pInfo->SetBookmark( ReadSound( pIAtom->nSoundRef ) ); // Pfad zum Soundfile in MSDOS-Notation
2054 : 0 : pInfo->meClickAction = ::com::sun::star::presentation::ClickAction_SOUND; // RunProgramAction
2055 : : }
2056 : :
2057 [ # # # # ]: 0 : switch ( pIAtom->nAction )
2058 : : {
2059 : :
2060 : : case 0x02 : // RunProgramAction
2061 : : {
2062 : 0 : pInfo->meClickAction = ::com::sun::star::presentation::ClickAction_PROGRAM;
2063 : 0 : pInfo->SetBookmark( aMacroName ); // Programmname in aBookmark
2064 : : }
2065 : 0 : break;
2066 : : case 0x03 : // JumpAction
2067 : : {
2068 [ # # # # : 0 : switch( pIAtom->nJump )
# # # ]
2069 : : {
2070 : : case 0x01 :
2071 : 0 : pInfo->meClickAction = ::com::sun::star::presentation::ClickAction_NEXTPAGE; // Next slide
2072 : 0 : break;
2073 : : case 0x02 :
2074 : 0 : pInfo->meClickAction = ::com::sun::star::presentation::ClickAction_PREVPAGE; // Previous slide
2075 : 0 : break;
2076 : : case 0x03 :
2077 : 0 : pInfo->meClickAction = ::com::sun::star::presentation::ClickAction_FIRSTPAGE; // First slide
2078 : 0 : break;
2079 : : case 0x04 :
2080 : 0 : pInfo->meClickAction = ::com::sun::star::presentation::ClickAction_LASTPAGE; // last Slide
2081 : 0 : break;
2082 : : case 0x05 :
2083 : 0 : pInfo->meClickAction = ::com::sun::star::presentation::ClickAction_PREVPAGE; // Last slide viewed
2084 : 0 : break;
2085 : : case 0x06 :
2086 : 0 : pInfo->meClickAction = ::com::sun::star::presentation::ClickAction_STOPPRESENTATION; // End show
2087 : 0 : break;
2088 : : default :
2089 : 0 : pInfo->meClickAction = ::com::sun::star::presentation::ClickAction_NONE; // 0x00: no action, else unknown
2090 : 0 : break;
2091 : : }
2092 : : }
2093 : 0 : break;
2094 : : case 0x04 :
2095 : : {
2096 : 0 : SdHyperlinkEntry* pPtr = NULL;
2097 [ # # ]: 0 : for ( size_t i = 0, n = aHyperList.size(); i < n; ++i ) {
2098 [ # # ]: 0 : if ( aHyperList[ i ]->nIndex == pIAtom->nExHyperlinkId ) {
2099 : 0 : pPtr = aHyperList[ i ];
2100 : 0 : break;
2101 : : }
2102 : : }
2103 [ # # ]: 0 : if ( pPtr )
2104 : : {
2105 [ # # # # ]: 0 : switch( pIAtom->nHyperlinkType )
2106 : : {
2107 : : case 9:
2108 : : case 8: // hyperlink : URL
2109 : : {
2110 [ # # ]: 0 : if ( pPtr->aTarget.Len() )
2111 : : {
2112 : 0 : ::sd::DrawDocShell* pDocShell = mpDoc->GetDocSh();
2113 [ # # ]: 0 : if ( pDocShell )
2114 : : {
2115 [ # # ][ # # ]: 0 : String aBaseURL = pDocShell->GetMedium()->GetBaseURL();
2116 [ # # ]: 0 : String aBookmarkURL( pInfo->GetBookmark() );
2117 [ # # ][ # # ]: 0 : INetURLObject aURL( pPtr->aTarget );
2118 [ # # ]: 0 : if( INET_PROT_NOT_VALID == aURL.GetProtocol() )
2119 [ # # ]: 0 : utl::LocalFileHelper::ConvertSystemPathToURL( pPtr->aTarget, aBaseURL, aBookmarkURL );
2120 [ # # ]: 0 : if( !aBookmarkURL.Len() )
2121 [ # # ][ # # ]: 0 : aBookmarkURL = URIHelper::SmartRel2Abs( INetURLObject(aBaseURL), pPtr->aTarget, URIHelper::GetMaybeFileHdl(), true );
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
2122 [ # # ]: 0 : pInfo->SetBookmark( aBookmarkURL );
2123 [ # # ][ # # ]: 0 : pInfo->meClickAction = ::com::sun::star::presentation::ClickAction_PROGRAM;
[ # # ]
2124 : : }
2125 : : }
2126 : : }
2127 : 0 : break;
2128 : :
2129 : : case 10:
2130 : 0 : break;
2131 : :
2132 : : case 7: // hyperlink auf eine Seite
2133 : : {
2134 [ # # ]: 0 : if ( pPtr->aConvSubString.Len() )
2135 : : {
2136 : 0 : pInfo->meClickAction = ::com::sun::star::presentation::ClickAction_BOOKMARK;
2137 : 0 : pInfo->SetBookmark( pPtr->aConvSubString );
2138 : : }
2139 : : }
2140 : 0 : break;
2141 : : }
2142 : : }
2143 : : }
2144 : 0 : break;
2145 : : case 0x05 : // OLEAction ( OLEVerb to use, 0==first, 1==secnd, .. )
2146 : : case 0x06 : // MediaAction
2147 : : case 0x07 : // CustomShowAction
2148 : : default : // 0x00: no action, else unknown action
2149 : 0 : break;
2150 : : }
2151 : 0 : }
2152 : :
2153 : 144 : SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj, SdPage* pPage,
2154 : : SfxStyleSheet* pSheet, SfxStyleSheet** ppStyleSheetAry ) const
2155 : : {
2156 : : SfxStyleSheet* pStyleSheetAry[ 9 ];
2157 : 144 : SdrTextObj* pText = pObj;
2158 : 144 : SdrObject* pRet = pText;
2159 : :
2160 : 144 : ppStyleSheetAry = NULL;
2161 : :
2162 : 144 : PresObjKind ePresKind = PRESOBJ_NONE;
2163 : 144 : PptOEPlaceholderAtom* pPlaceHolder = pTextObj->GetOEPlaceHolderAtom();
2164 [ + - ]: 144 : String aPresentationText;
2165 [ + - ]: 144 : if ( pPlaceHolder )
2166 : : {
2167 [ + + - + : 144 : switch( pPlaceHolder->nPlaceholderId )
+ + + +
+ ]
2168 : : {
2169 : : case PPT_PLACEHOLDER_MASTERNOTESSLIDEIMAGE :
2170 : : case PPT_PLACEHOLDER_MASTERCENTEREDTITLE :
2171 : : case PPT_PLACEHOLDER_MASTERTITLE :
2172 : : {
2173 : 21 : ePresKind = PRESOBJ_TITLE;
2174 [ + - ][ + - ]: 21 : aPresentationText = pPage->GetPresObjText( ePresKind );
[ + - ]
2175 : : }
2176 : 21 : break;
2177 : : case PPT_PLACEHOLDER_MASTERBODY :
2178 : : {
2179 : 12 : ePresKind = PRESOBJ_OUTLINE;
2180 [ + - ][ + - ]: 12 : aPresentationText = pPage->GetPresObjText( ePresKind );
[ + - ]
2181 : : }
2182 : 12 : break;
2183 : : case PPT_PLACEHOLDER_MASTERSUBTITLE :
2184 : : {
2185 : 0 : ePresKind = PRESOBJ_TEXT;
2186 [ # # ][ # # ]: 0 : aPresentationText = pPage->GetPresObjText( ePresKind );
[ # # ]
2187 : : }
2188 : 0 : break;
2189 : : case PPT_PLACEHOLDER_MASTERNOTESBODYIMAGE :
2190 : : {
2191 : 9 : ePresKind = PRESOBJ_NOTES;
2192 [ + - ][ + - ]: 9 : aPresentationText = pPage->GetPresObjText( ePresKind );
[ + - ]
2193 : : }
2194 : 9 : break;
2195 : 24 : case PPT_PLACEHOLDER_MASTERDATE : ePresKind = PRESOBJ_DATETIME; break;
2196 : 21 : case PPT_PLACEHOLDER_MASTERSLIDENUMBER : ePresKind = PRESOBJ_SLIDENUMBER;break;
2197 : 24 : case PPT_PLACEHOLDER_MASTERFOOTER : ePresKind = PRESOBJ_FOOTER; break;
2198 : 144 : case PPT_PLACEHOLDER_MASTERHEADER : ePresKind = PRESOBJ_HEADER; break;
2199 : : }
2200 : : }
2201 [ + + + + : 144 : switch ( pTextObj->GetDestinationInstance() )
+ - ]
2202 : : {
2203 : : case TSS_TYPE_PAGETITLE :
2204 : : case TSS_TYPE_TITLE :
2205 : : {
2206 [ + - ]: 24 : pSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_TITLE );
2207 [ + - ]: 24 : if ( pSheet )
2208 [ + - ]: 24 : ((SdrAttrObj*)pText)->SdrAttrObj::NbcSetStyleSheet( pSheet, sal_True );
2209 : : DBG_ASSERT( pSheet, "ImplSdPPTImport::ApplyTextObj -> could not get stylesheet for titleobject (SJ)" );
2210 : : }
2211 : 24 : break;
2212 : : case TSS_TYPE_SUBTITLE :
2213 : : {
2214 [ + - ]: 3 : pSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_TEXT );
2215 [ + - ]: 3 : if ( pSheet )
2216 [ + - ]: 3 : ((SdrAttrObj*)pText)->SdrAttrObj::NbcSetStyleSheet( pSheet, sal_True );
2217 : : DBG_ASSERT( pSheet, "ImplSdPPTImport::ApplyTextObj -> could not get stylesheet for subtitleobject (SJ)" );
2218 : : }
2219 : 3 : break;
2220 : : case TSS_TYPE_BODY :
2221 : : case TSS_TYPE_HALFBODY :
2222 : : case TSS_TYPE_QUARTERBODY :
2223 : : {
2224 [ + + ]: 120 : for ( sal_uInt16 nLevel = 9; nLevel; nLevel-- )
2225 : : {
2226 [ + - ]: 108 : String aName( pPage->GetLayoutName() );
2227 [ + - ]: 108 : aName.Append( (sal_Unicode)( ' ' ) );
2228 [ + - ][ + - ]: 108 : aName.Append( String::CreateFromInt32( nLevel ) );
[ + - ]
2229 [ + - ][ + - ]: 108 : pSheet = (SfxStyleSheet*)mpDoc->GetStyleSheetPool()->Find( aName, SD_STYLE_FAMILY_MASTERPAGE );
2230 [ + - ]: 108 : if ( pSheet )
2231 [ + - ]: 108 : pText->StartListening( *pSheet );
2232 : 108 : pStyleSheetAry[ nLevel - 1 ] = pSheet;
2233 [ + - ]: 108 : }
2234 : : DBG_ASSERT( pSheet, "ImplSdPPTImport::ApplyTextObj -> could not get stylesheet for outlinerobject (SJ)" );
2235 [ + - ]: 12 : if ( pSheet )
2236 [ + - ]: 12 : ((SdrAttrObj*)pText)->SdrAttrObj::NbcSetStyleSheet( pSheet, sal_True );
2237 : 12 : ppStyleSheetAry = &pStyleSheetAry[ 0 ];
2238 : : }
2239 : 12 : break;
2240 : : case TSS_TYPE_NOTES :
2241 : : {
2242 [ + - ][ + - ]: 24 : if ( pPlaceHolder && ( ( pPlaceHolder->nPlaceholderId == PPT_PLACEHOLDER_NOTESSLIDEIMAGE )
[ + + ]
2243 : : || ( pPlaceHolder->nPlaceholderId == PPT_PLACEHOLDER_MASTERNOTESSLIDEIMAGE ) ) )
2244 : : {
2245 [ + - ]: 9 : pSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_TITLE );
2246 [ + - ]: 9 : if ( pSheet )
2247 [ + - ]: 9 : ((SdrAttrObj*)pText)->SdrAttrObj::NbcSetStyleSheet( pSheet, sal_True );
2248 : 9 : DBG_ASSERT( pSheet, "ImplSdPPTImport::ApplyTextObj -> could not get stylesheet for titleobject (SJ)" );
2249 : : }
2250 : : else
2251 : : {
2252 [ + - ]: 15 : pSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_NOTES );
2253 : : DBG_ASSERT( pSheet, "ImplSdPPTImport::ApplyTextObj -> could not get stylesheet for notesobj (SJ)" );
2254 [ + - ]: 15 : if ( pSheet )
2255 [ + - ]: 15 : ((SdrAttrObj*)pText)->SdrAttrObj::NbcSetStyleSheet( pSheet, sal_True );
2256 : : }
2257 : : }
2258 : 24 : break;
2259 : : case TSS_TYPE_UNUSED :
2260 : : case TSS_TYPE_TEXT_IN_SHAPE :
2261 : : {
2262 [ + - ]: 81 : switch( ePresKind )
2263 : : {
2264 : : case PRESOBJ_DATETIME :
2265 : : case PRESOBJ_SLIDENUMBER :
2266 : : case PRESOBJ_FOOTER :
2267 : : case PRESOBJ_HEADER :
2268 [ + - ][ + - ]: 81 : pSheet = (SfxStyleSheet*)mpDoc->GetStyleSheetPool()->Find( String(SdResId( STR_PSEUDOSHEET_BACKGROUNDOBJECTS )), SD_STYLE_FAMILY_PSEUDO );
[ + - ][ + - ]
[ + - ]
2269 : 81 : break;
2270 : : default :
2271 [ # # ][ # # ]: 0 : pSheet = (SfxStyleSheet*)mpDoc->GetStyleSheetPool()->Find( String(SdResId( STR_STANDARD_STYLESHEET_NAME )), SD_STYLE_FAMILY_GRAPHICS );
[ # # ][ # # ]
[ # # ]
2272 : : }
2273 : : }
2274 : 81 : break;
2275 : : }
2276 [ + - ]: 144 : pText = (SdrTextObj*)SdrPowerPointImport::ApplyTextObj( pTextObj, pText, pPage, pSheet, ppStyleSheetAry );
2277 [ + - ][ + - ]: 144 : if ( pPlaceHolder && pPlaceHolder->nPlaceholderId )
2278 : : {
2279 [ + + ]: 144 : if ( eAktPageKind == PPT_MASTERPAGE )
2280 : : {
2281 [ + - ][ + - ]: 111 : sal_Bool bCreatePlaceHolder = ( pTextObj->GetInstance() != TSS_TYPE_SUBTITLE ) && ( pTextObj->GetInstance() != TSS_TYPE_UNUSED );
2282 : : sal_Bool bIsHeaderFooter = ( ePresKind == PRESOBJ_HEADER) || (ePresKind == PRESOBJ_FOOTER)
2283 [ + + ][ + + ]: 111 : || (ePresKind == PRESOBJ_DATETIME) || (ePresKind == PRESOBJ_SLIDENUMBER);
[ + + ][ + + ]
2284 [ + - ][ + + ]: 111 : if ( bCreatePlaceHolder && ( pTextObj->GetInstance() == TSS_TYPE_TEXT_IN_SHAPE ) )
[ + + ]
2285 : 69 : bCreatePlaceHolder = bIsHeaderFooter;
2286 [ + - ]: 111 : if ( bCreatePlaceHolder )
2287 : : {
2288 [ + + ]: 111 : if ( !bIsHeaderFooter )
2289 : : {
2290 [ + - ]: 42 : pText->SetNotVisibleAsMaster( sal_True );
2291 [ + - ]: 42 : pText->SetEmptyPresObj( sal_True );
2292 : : }
2293 [ + - ][ + - ]: 111 : pText->SetUserCall( pPage );
2294 [ + - ]: 111 : pPage->InsertPresObj( pText, ePresKind );
2295 : 111 : SdrOutliner* pOutl = NULL;
2296 [ + + ]: 111 : if ( pTextObj->GetInstance() == TSS_TYPE_NOTES )
2297 [ + - ]: 18 : pOutl = GetDrawOutliner( pText );
2298 [ + + ]: 111 : if ( aPresentationText.Len() )
2299 [ + - ]: 42 : pPage->SetObjText( (SdrTextObj*)pText, pOutl, ePresKind, aPresentationText );
2300 : :
2301 [ + + ]: 111 : if ( pPage->GetPageKind() != PK_NOTES )
2302 : : {
2303 [ + - ]: 60 : SfxStyleSheet* pSheet2( pPage->GetStyleSheetForPresObj( ePresKind ) );
2304 [ + - ]: 60 : if ( pSheet2 )
2305 : : {
2306 [ + - ]: 60 : SfxItemSet& rItemSet = pSheet2->GetItemSet();
2307 [ + - ][ + - ]: 60 : rItemSet.Put( (SdrTextLeftDistItem&)pText->GetMergedItem( SDRATTR_TEXT_LEFTDIST ) );
2308 [ + - ][ + - ]: 60 : rItemSet.Put( (SdrTextRightDistItem&)pText->GetMergedItem( SDRATTR_TEXT_RIGHTDIST ) );
2309 [ + - ][ + - ]: 60 : rItemSet.Put( (SdrTextUpperDistItem&)pText->GetMergedItem( SDRATTR_TEXT_UPPERDIST ) );
2310 [ + - ][ + - ]: 60 : rItemSet.Put( (SdrTextLowerDistItem&)pText->GetMergedItem( SDRATTR_TEXT_LOWERDIST ) );
2311 [ + - ][ + - ]: 60 : rItemSet.Put( (SdrTextVertAdjustItem&)pText->GetMergedItem( SDRATTR_TEXT_VERTADJUST ) );
2312 [ + - ][ + - ]: 60 : rItemSet.Put( (SdrTextHorzAdjustItem&)pText->GetMergedItem( SDRATTR_TEXT_HORZADJUST ) );
2313 : : }
2314 [ + - ]: 60 : pText->NbcSetStyleSheet( pSheet2, sal_False );
2315 : : }
2316 : :
2317 [ + - ]: 111 : SfxItemSet aTempAttr( mpDoc->GetPool() );
2318 [ + - ][ + - ]: 111 : SdrTextMinFrameHeightItem aMinHeight( pText->GetLogicRect().GetSize().Height() );
[ + - ]
2319 [ + - ]: 111 : aTempAttr.Put( aMinHeight );
2320 [ + - ]: 111 : SdrTextAutoGrowHeightItem aAutoGrowHeight( sal_False );
2321 [ + - ]: 111 : aTempAttr.Put( aAutoGrowHeight );
2322 [ + - ][ + - ]: 111 : pText->SetMergedItemSet(aTempAttr);
[ + - ][ + - ]
2323 : : }
2324 : : else
2325 : : {
2326 : 0 : pRet = NULL;
2327 : : }
2328 : : }
2329 : : else
2330 : : {
2331 [ + - ]: 33 : const PptSlideLayoutAtom* pSlideLayout = GetSlideLayoutAtom();
2332 [ - + ][ # # ]: 33 : if ( pSlideLayout || ( eAktPageKind == PPT_NOTEPAGE ) )
2333 : : {
2334 : 33 : sal_Int16 nPlaceholderId = pPlaceHolder->nPlaceholderId;
2335 : 33 : sal_uInt16 i = 0;
2336 [ + + ]: 33 : if ( eAktPageKind == PPT_SLIDEPAGE )
2337 : : {
2338 [ + - ]: 33 : for ( ; i < 8; i++ )
2339 : : {
2340 [ + + ]: 18 : if ( pSlideLayout->aPlaceholderId[ i ] == nPlaceholderId )
2341 : 15 : break;
2342 : : }
2343 : : }
2344 [ + - ]: 33 : if ( i < 8 )
2345 : : {
2346 : 33 : PresObjKind ePresObjKind = PRESOBJ_NONE;
2347 : 33 : sal_Bool bEmptyPresObj = sal_True;
2348 : 33 : sal_Bool bVertical = sal_False;
2349 [ + + ][ + - ]: 33 : if ( ( pTextObj->GetShapeType() == mso_sptRectangle ) || ( pTextObj->GetShapeType() == mso_sptTextBox ) )
[ + - ]
2350 : : {
2351 [ + + ]: 33 : if ( pTextObj->Count() )
2352 : 12 : bEmptyPresObj = sal_False;
2353 [ + - + - : 33 : switch ( nPlaceholderId )
- + + + ]
2354 : : {
2355 : 6 : case PPT_PLACEHOLDER_NOTESBODY : ePresObjKind = PRESOBJ_NOTES; break;
2356 : : case PPT_PLACEHOLDER_VERTICALTEXTTITLE :
2357 : 0 : bVertical = sal_True; // PASSTHROUGH !!!
2358 : 9 : case PPT_PLACEHOLDER_TITLE : ePresObjKind = PRESOBJ_TITLE; break;
2359 : : case PPT_PLACEHOLDER_VERTICALTEXTBODY :
2360 : 0 : bVertical = sal_True; // PASSTHROUGH !!!
2361 : 0 : case PPT_PLACEHOLDER_BODY : ePresObjKind = PRESOBJ_OUTLINE; break;
2362 : 3 : case PPT_PLACEHOLDER_CENTEREDTITLE : ePresObjKind = PRESOBJ_TITLE; break;
2363 : 3 : case PPT_PLACEHOLDER_SUBTITLE : ePresObjKind = PRESOBJ_TEXT; break; // PRESOBJ_OUTLINE
2364 : :
2365 : : default :
2366 : : {
2367 [ - + ]: 12 : if ( !pTextObj->Count() )
2368 : : {
2369 [ # # # # : 0 : switch ( nPlaceholderId )
# # ]
2370 : : {
2371 : : case PPT_PLACEHOLDER_MEDIACLIP :
2372 : 0 : case PPT_PLACEHOLDER_OBJECT : ePresObjKind = PRESOBJ_OBJECT; break;
2373 : 0 : case PPT_PLACEHOLDER_GRAPH : ePresObjKind = PRESOBJ_CHART; break;
2374 : 0 : case PPT_PLACEHOLDER_TABLE : ePresObjKind = PRESOBJ_TABLE; break;
2375 : 0 : case PPT_PLACEHOLDER_CLIPART : ePresObjKind = PRESOBJ_GRAPHIC; break;
2376 : 33 : case PPT_PLACEHOLDER_ORGANISZATIONCHART : ePresObjKind = PRESOBJ_ORGCHART; break;
2377 : : }
2378 : : }
2379 : : };
2380 : : }
2381 : : }
2382 [ # # ]: 0 : else if ( pTextObj->GetShapeType() == mso_sptPictureFrame )
2383 : : {
2384 [ # # ][ # # ]: 0 : if ( !pTextObj->Count() && pObj->ISA( SdrGrafObj ) )
[ # # ][ # # ]
[ # # ]
2385 : : {
2386 : 0 : bEmptyPresObj = sal_False;
2387 [ # # # # : 0 : switch ( nPlaceholderId )
# # ]
2388 : : {
2389 : : case PPT_PLACEHOLDER_MEDIACLIP :
2390 : 0 : case PPT_PLACEHOLDER_OBJECT : ePresObjKind = PRESOBJ_OBJECT; break;
2391 : 0 : case PPT_PLACEHOLDER_GRAPH : ePresObjKind = PRESOBJ_CHART; break;
2392 : 0 : case PPT_PLACEHOLDER_TABLE : ePresObjKind = PRESOBJ_CALC; break;
2393 : 0 : case PPT_PLACEHOLDER_CLIPART : ePresObjKind = PRESOBJ_GRAPHIC; break;
2394 : 0 : case PPT_PLACEHOLDER_ORGANISZATIONCHART : ePresObjKind = PRESOBJ_ORGCHART; break;
2395 : : }
2396 : : }
2397 : : }
2398 [ + + ]: 33 : if ( ePresObjKind != PRESOBJ_NONE )
2399 : : {
2400 [ - + ]: 21 : if ( !bEmptyPresObj )
2401 : : {
2402 [ # # ]: 0 : pPage->InsertPresObj( pRet, ePresObjKind );
2403 : : }
2404 : : else
2405 : : {
2406 [ + - ][ + - ]: 21 : SdrObject* pPresObj = pPage->CreatePresObj( ePresObjKind, bVertical, pText->GetLogicRect(), sal_True );
2407 [ + - ][ + - ]: 21 : pPresObj->SetUserCall( pPage );
2408 : :
2409 [ + - ]: 21 : SfxItemSet aSet( pSdrModel->GetItemPool() );
2410 [ + - ]: 21 : ApplyAttributes( rStCtrl, aSet );
2411 [ + - ]: 21 : pPresObj->SetMergedItemSet(aSet);
2412 : :
2413 [ + + ][ + - ]: 21 : if ( ( eAktPageKind != PPT_NOTEPAGE ) && ( pSlideLayout->aPlacementId[ i ] != (sal_uLong)-1 ) )
2414 : : {
2415 [ + - ][ + - ]: 15 : SdrObject* pTitleObj = ((SdPage&)pPage->TRG_GetMasterPage()).GetPresObj( PRESOBJ_TITLE );
2416 [ + - ][ + - ]: 15 : SdrObject* pOutlineObj = ((SdPage&)pPage->TRG_GetMasterPage()).GetPresObj( PRESOBJ_OUTLINE );
2417 : :
2418 [ + - ]: 15 : Rectangle aTitleRect;
2419 [ + - ]: 15 : Rectangle aOutlineRect;
2420 : 15 : Size aOutlineSize;
2421 : :
2422 [ + - ]: 15 : if ( pTitleObj )
2423 [ + - ]: 15 : aTitleRect = pTitleObj->GetLogicRect();
2424 [ + - ]: 15 : if ( pOutlineObj )
2425 : : {
2426 [ + - ]: 15 : aOutlineRect = pOutlineObj->GetLogicRect();
2427 [ + - ]: 15 : aOutlineSize = aOutlineRect.GetSize();
2428 : : }
2429 [ + - ]: 15 : Rectangle aLogicRect( pPresObj->GetLogicRect() );
2430 [ + - ]: 15 : Size aLogicSize( aLogicRect.GetSize() );
2431 : :
2432 [ + - - - : 15 : switch ( pSlideLayout->aPlacementId[ i ] )
- - ]
2433 : : {
2434 : : case 0 : // Lage im Titelbereich
2435 : : {
2436 [ + - ][ + - ]: 15 : if ( aLogicRect != aTitleRect )
2437 [ + - ]: 15 : pPresObj->SetUserCall( NULL );
2438 : : }
2439 : 15 : break;
2440 : :
2441 : : case 1:
2442 : : {
2443 [ # # ]: 0 : if ( pSlideLayout->eLayout == PPT_LAYOUT_TITLEANDBODYSLIDE )
2444 : : { // Lage im Outlinebereich
2445 [ # # ][ # # ]: 0 : if ( aLogicRect != aOutlineRect )
2446 [ # # ]: 0 : pPresObj->SetUserCall( NULL );
2447 : : }
2448 [ # # ]: 0 : else if ( pSlideLayout->eLayout == PPT_LAYOUT_2COLUMNSANDTITLE )
2449 : : { // Lage im Outlinebereich links
2450 [ # # # # : 0 : if (Abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE ||
# # # # #
# ][ # # ]
2451 : 0 : Abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE ||
2452 : 0 : Abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE ||
2453 : 0 : aLogicSize.Width() / aOutlineSize.Width() < 0.48 ||
2454 : 0 : aLogicSize.Width() / aOutlineSize.Width() > 0.5)
2455 : : {
2456 [ # # ]: 0 : pPresObj->SetUserCall(NULL);
2457 : : }
2458 : : }
2459 [ # # ]: 0 : else if ( pSlideLayout->eLayout == PPT_LAYOUT_2ROWSANDTITLE )
2460 : : { // Lage im Outlinebereich oben
2461 [ # # # # : 0 : if (Abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE ||
# # ][ # # ]
2462 : 0 : Abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE ||
2463 : 0 : Abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE)
2464 : : {
2465 [ # # ]: 0 : pPresObj->SetUserCall( NULL );
2466 : : }
2467 : : }
2468 [ # # # # ]: 0 : else if (Abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE ||
[ # # ]
2469 : 0 : Abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE)
2470 : : { // Lage im Outlinebereich links oben
2471 [ # # ]: 0 : pPresObj->SetUserCall( NULL );
2472 : : }
2473 : : }
2474 : 0 : break;
2475 : :
2476 : : case 2:
2477 : : {
2478 [ # # ]: 0 : if ( pSlideLayout->eLayout == PPT_LAYOUT_2COLUMNSANDTITLE )
2479 : : { // Lage im Outlinebereich rechts
2480 [ # # # # : 0 : if (Abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE ||
# # # # #
# ][ # # ]
2481 : 0 : Abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE ||
2482 : 0 : Abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE ||
2483 : 0 : aLogicSize.Width() / aOutlineSize.Width() < 0.48 ||
2484 : 0 : aLogicSize.Width() / aOutlineSize.Width() > 0.5)
2485 : : {
2486 [ # # ]: 0 : pPresObj->SetUserCall( NULL );
2487 : : }
2488 : : }
2489 [ # # ]: 0 : else if ( pSlideLayout->eLayout == PPT_LAYOUT_2ROWSANDTITLE )
2490 : : { // Lage im Outlinebereich unten
2491 [ # # # # : 0 : if (Abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE ||
# # ][ # # ]
2492 : 0 : Abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE ||
2493 : 0 : Abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE)
2494 : : {
2495 [ # # ]: 0 : pPresObj->SetUserCall( NULL );
2496 : : }
2497 : : }
2498 [ # # # # ]: 0 : else if (Abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE ||
[ # # ]
2499 : 0 : Abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE)
2500 : : { // Lage im Outlinebereich rechts oben
2501 [ # # ]: 0 : pPresObj->SetUserCall(NULL);
2502 : : }
2503 : : }
2504 : 0 : break;
2505 : :
2506 : : case 3:
2507 : : { // Lage im Outlinebereich links unten
2508 [ # # # # ]: 0 : if (Abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE ||
[ # # ]
2509 : 0 : Abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE)
2510 : : {
2511 [ # # ]: 0 : pPresObj->SetUserCall( NULL );
2512 : : }
2513 : : }
2514 : 0 : break;
2515 : :
2516 : : case 4:
2517 : : { // Lage im Outlinebereich rechts unten
2518 [ # # # # ]: 0 : if (Abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE ||
[ # # ]
2519 : 0 : Abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE)
2520 : : {
2521 [ # # ]: 0 : pObj->SetUserCall( NULL );
2522 : : }
2523 : : }
2524 : 15 : break;
2525 : : }
2526 : : }
2527 [ + - ]: 21 : pRet = NULL; // return zero cause this obj was already inserted by CreatePresObj
2528 : : }
2529 : : }
2530 [ - + ]: 12 : else if ( !pTextObj->Count() )
2531 : 0 : pRet = NULL;
2532 : : }
2533 : : }
2534 : : }
2535 : : }
2536 [ + + ]: 144 : if ( pRet != pText )
2537 : : {
2538 : 21 : SdrObject* pFree( pText );
2539 [ + - ]: 21 : SdrObject::Free( pFree );
2540 : : }
2541 [ + - ]: 144 : return pRet;
2542 : : }
2543 : :
2544 : 180 : SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, void* pData, Rectangle& rTextRect, SdrObject* pRet )
2545 : : {
2546 [ + - ]: 180 : SdrObject* pObj = SdrPowerPointImport::ProcessObj( rSt, rObjData, pData, rTextRect, pRet );
2547 : :
2548 : : // Animationseffekte des Objektes lesen
2549 [ + + ]: 180 : if ( pObj )
2550 : : {
2551 : : // further setup placeholder objects
2552 [ + - ][ + - ]: 159 : if( pObj->ISA(SdrPageObj) && pData )
[ + + ][ + - ]
[ + + ]
2553 : : {
2554 : 3 : const ProcessData* pProcessData=(const ProcessData*)pData;
2555 [ + - ]: 3 : if( pProcessData->pPage )
2556 [ + - ]: 3 : pProcessData->pPage->InsertPresObj( pObj, PRESOBJ_PAGE );
2557 : : }
2558 : :
2559 : 159 : sal_Bool bInhabitanceChecked = sal_False;
2560 : 159 : sal_Bool bAnimationInfoFound = sal_False;
2561 : 159 : DffRecordHeader aMasterShapeHd;
2562 : :
2563 [ + + ][ + - ]: 159 : if ( maShapeRecords.SeekToContent( rSt, DFF_msofbtClientData, SEEK_FROM_CURRENT_AND_RESTART ) )
2564 : : {
2565 [ + - ]: 135 : DffRecordHeader& rHdClientData = *maShapeRecords.Current();
2566 : 159 : while( sal_True )
2567 : : {
2568 : 135 : sal_uInt32 nClientDataLen = rHdClientData.GetRecEndFilePos();
2569 : 135 : DffRecordHeader aHd;
2570 [ - + ]: 270 : do
[ + - - + ]
2571 : : {
2572 [ + - ]: 135 : rSt >> aHd;
2573 : 135 : sal_uInt32 nHdRecEnd = aHd.GetRecEndFilePos();
2574 [ - - + ]: 135 : switch ( aHd.nRecType )
2575 : : {
2576 : : case PPT_PST_AnimationInfo :
2577 : : {
2578 : 0 : DffRecordHeader aHdAnimInfoAtom;
2579 [ # # ][ # # ]: 0 : if ( SeekToRec( rSt, PPT_PST_AnimationInfoAtom, nHdRecEnd, &aHdAnimInfoAtom ) )
2580 : : {
2581 : : // read data from stream
2582 [ # # ][ # # ]: 0 : Ppt97AnimationPtr pAnimation( new Ppt97Animation( rSt ) );
[ # # ]
2583 : : // store animation informations
2584 [ # # ][ # # ]: 0 : if( pAnimation->HasEffect() )
2585 : : {
2586 : : // translate color to RGB
2587 [ # # ][ # # ]: 0 : pAnimation->SetDimColor( MSO_CLR_ToColor(pAnimation->GetDimColor()).GetColor() );
[ # # ]
2588 : : // translate sound bits to file url
2589 [ # # ][ # # ]: 0 : if( pAnimation->HasSoundEffect() )
2590 [ # # ][ # # ]: 0 : pAnimation->SetSoundFileUrl( ReadSound( pAnimation->GetSoundRef() ) );
[ # # ][ # # ]
[ # # ]
2591 : :
2592 : 0 : bool bDontAnimateInvisibleShape = false;
2593 : : {
2594 [ # # ]: 0 : SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>(pObj);
2595 : :
2596 [ # # ][ # # ]: 0 : if( pTextObj && pTextObj->HasText() &&
[ # # ][ # # ]
[ # # ][ # # ]
2597 [ # # ][ # # ]: 0 : !pObj->ISA( SdrObjGroup ) &&
2598 [ # # ]: 0 : pAnimation->HasAnimateAssociatedShape() )
2599 : : {
2600 [ # # ]: 0 : const SfxItemSet& rObjItemSet = pObj->GetMergedItemSet();
2601 : :
2602 [ # # ]: 0 : XFillStyle eFillStyle = ((XFillStyleItem&)(rObjItemSet.Get(XATTR_FILLSTYLE))).GetValue();
2603 [ # # ]: 0 : XLineStyle eLineStyle = ((XLineStyleItem&)(rObjItemSet.Get(XATTR_LINESTYLE))).GetValue();
2604 : :
2605 [ # # ][ # # ]: 0 : if ( ( eFillStyle == XFILL_NONE ) && ( eLineStyle == XLINE_NONE ) )
2606 : 0 : bDontAnimateInvisibleShape = true;
2607 : : }
2608 : : }
2609 [ # # ]: 0 : if( bDontAnimateInvisibleShape )
2610 [ # # ]: 0 : pAnimation->SetAnimateAssociatedShape(false);
2611 : :
2612 : : //maybe some actions necessary to ensure that animations on master pages are played before animations on normal pages
2613 : : ///mabe todo in future: bool bIsEffectOnMasterPage = !bInhabitanceChecked;?
2614 : :
2615 [ # # ][ # # ]: 0 : maAnimations[pObj] = pAnimation;
2616 : :
2617 : 0 : bAnimationInfoFound = sal_True;
2618 [ # # ]: 0 : }
2619 : : }
2620 : : }
2621 : 0 : break;
2622 : : case PPT_PST_InteractiveInfo:
2623 : : {
2624 : 0 : sal_uInt32 nFilePosMerk2 = rSt.Tell();
2625 : 0 : rtl::OUString aMacroName;
2626 : :
2627 [ # # ][ # # ]: 0 : if(SeekToRec( rSt, PPT_PST_CString, nHdRecEnd, NULL, 0 ) )
2628 [ # # ]: 0 : ReadString(aMacroName);
2629 : :
2630 [ # # ]: 0 : rSt.Seek( nFilePosMerk2 );
2631 : 0 : DffRecordHeader aHdInteractiveInfoAtom;
2632 [ # # ][ # # ]: 0 : if ( SeekToRec( rSt, PPT_PST_InteractiveInfoAtom, nHdRecEnd, &aHdInteractiveInfoAtom ) )
2633 : : {
2634 : : PptInteractiveInfoAtom aInteractiveInfoAtom;
2635 [ # # ]: 0 : rSt >> aInteractiveInfoAtom;
2636 : :
2637 : : // interactive object
2638 [ # # ]: 0 : SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pObj, true);
2639 : :
2640 [ # # ][ # # ]: 0 : ( (ImplSdPPTImport*) this )->FillSdAnimationInfo( pInfo, &aInteractiveInfoAtom, aMacroName );
[ # # ]
2641 [ # # ]: 0 : if ( aInteractiveInfoAtom.nAction == 6 ) // Sj -> media action
2642 : : {
2643 [ # # ]: 0 : rHdClientData.SeekToContent( rStCtrl );
2644 : 0 : DffRecordHeader aObjRefAtomHd;
2645 [ # # ][ # # ]: 0 : if ( SeekToRec( rSt, PPT_PST_ExObjRefAtom, nHdRecEnd, &aObjRefAtomHd ) )
2646 : : {
2647 : : sal_uInt32 nRef;
2648 [ # # ]: 0 : rSt >> nRef;
2649 [ # # ]: 0 : String aMediaURL( ReadMedia( nRef ) );
2650 [ # # ]: 0 : if ( !aMediaURL.Len() )
2651 [ # # ][ # # ]: 0 : aMediaURL = ReadSound( nRef );
[ # # ]
2652 [ # # ]: 0 : if ( aMediaURL.Len() )
2653 : : {
2654 [ # # ][ # # ]: 0 : SdrMediaObj* pMediaObj = new SdrMediaObj( pObj->GetSnapRect() );
[ # # ]
2655 [ # # ][ # # ]: 0 : pMediaObj->SetModel( pObj->GetModel() );
2656 [ # # ][ # # ]: 0 : pMediaObj->SetMergedItemSet( pObj->GetMergedItemSet() );
2657 : :
2658 : : //--remove object from maAnimations list and add the new object instead
2659 [ # # ]: 0 : Ppt97AnimationPtr pAnimation;
2660 : : {
2661 [ # # ]: 0 : tAnimationMap::iterator aFound = maAnimations.find( pObj );
2662 [ # # ]: 0 : if( aFound != maAnimations.end() )
2663 : : {
2664 [ # # ]: 0 : pAnimation = (*aFound).second;
2665 [ # # ]: 0 : maAnimations.erase(aFound);
2666 : : }
2667 [ # # ][ # # ]: 0 : maAnimations[pMediaObj] = pAnimation;
2668 : : }
2669 : : //--
2670 : :
2671 [ # # ]: 0 : SdrObject::Free( pObj ), pObj = pMediaObj; // SJ: hoping that pObj is not inserted in any list
2672 [ # # ][ # # ]: 0 : pMediaObj->setURL( aMediaURL );
[ # # ]
2673 [ # # ]: 0 : }
2674 : : }
2675 : : }
2676 : 0 : }
2677 : : }
2678 : 0 : break;
2679 : : }
2680 [ + - ]: 135 : aHd.SeekToEndOfRecord( rSt );
2681 : : }
2682 : 270 : while( ( rSt.GetError() == 0 ) && ( rSt.Tell() < nClientDataLen ) );
2683 : :
2684 [ + - ][ + - ]: 135 : if ( bInhabitanceChecked || bAnimationInfoFound )
2685 : : break;
2686 : 135 : bInhabitanceChecked = sal_True;
2687 [ - + ][ # # ]: 135 : if ( ! ( IsProperty( DFF_Prop_hspMaster ) && SeekToShape( rSt, pData, GetPropertyValue( DFF_Prop_hspMaster ) ) ) )
[ # # ][ # # ]
[ - + ]
2688 : : break;
2689 [ # # ]: 0 : rSt >> aMasterShapeHd;
2690 [ # # ][ # # ]: 0 : if ( !SeekToRec( rSt, DFF_msofbtClientData, aMasterShapeHd.GetRecEndFilePos(), &aMasterShapeHd ) )
2691 : : break;
2692 [ # # ]: 0 : aMasterShapeHd.SeekToContent( rSt );
2693 : 0 : rHdClientData = aMasterShapeHd;
2694 : : }
2695 : : }
2696 : : }
2697 : 180 : return pObj;
2698 : : }
2699 : :
2700 : :
2701 : : bool
2702 : 0 : ImplSdPPTImport::ReadFormControl( SotStorageRef& rSrc1, com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > & rFormComp ) const
2703 : : {
2704 : 0 : uno::Reference< frame::XModel > xModel;
2705 [ # # ]: 0 : if ( mpDoc->GetDocSh() )
2706 : : {
2707 [ # # ][ # # ]: 0 : xModel = mpDoc->GetDocSh()->GetModel();
2708 [ # # ]: 0 : oox::ole::MSConvertOCXControls mCtrlImporter( xModel );
2709 [ # # ][ # # ]: 0 : return mCtrlImporter.ReadOCXStorage( rSrc1, rFormComp );
2710 : : }
2711 : 0 : return false;
2712 : : }
2713 : :
2714 : : // ---------------------
2715 : : // - exported function -
2716 : : // ---------------------
2717 : :
2718 : 15 : extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL ImportPPT(
2719 : : SdDrawDocument* pDocument, SvStream& rDocStream, SvStorage& rStorage, SfxMedium& rMedium )
2720 : : {
2721 : 15 : sal_Bool bRet = sal_False;
2722 : :
2723 [ + - ]: 15 : SdPPTImport* pImport = new SdPPTImport( pDocument, rDocStream, rStorage, rMedium );
2724 : 15 : bRet = pImport->Import();
2725 : :
2726 [ + - ]: 15 : delete pImport;
2727 : :
2728 : 15 : return bRet;
2729 [ + - ][ + - ]: 9 : }
2730 : :
2731 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|