LibreOffice Module sd (master) 1
pptin.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <osl/file.hxx>
21#include <sal/log.hxx>
24#include <svl/urihelper.hxx>
25#include <svx/svxids.hrc>
27#include <svx/svditer.hxx>
28#include <sfx2/docfile.hxx>
29#include <svx/svdograf.hxx>
30#include <svx/svdlayer.hxx>
31#include <svx/sdmetitm.hxx>
32#include <svx/sdtmfitm.hxx>
33#include <svx/sdtagitm.hxx>
34#include <svl/style.hxx>
35#include <svl/intitem.hxx>
36#include <editeng/eeitem.hxx>
37#include <editeng/editeng.hxx>
38#include <svx/svdoutl.hxx>
39#include <svx/xfillit0.hxx>
40#include <svx/xlineit0.hxx>
41
42#include <sfx2/docinf.hxx>
43#include <o3tl/string_view.hxx>
44
45#include <strings.hrc>
46#include <strings.hxx>
47#include "pptin.hxx"
48#include <drawdoc.hxx>
49#include <sdpage.hxx>
50#include <sdresid.hxx>
51#include <pres.hxx>
52#include <stlpool.hxx>
53#include <anminfo.hxx>
54#include <svx/gallery.hxx>
55#include <tools/debug.hxx>
56#include <tools/urlobj.hxx>
57#include <svx/svdopage.hxx>
58#include <svx/svdomedia.hxx>
59#include <svx/svdogrp.hxx>
60#include "propread.hxx"
61#include <cusshow.hxx>
62#include <xmloff/autolayout.hxx>
63
64#include <customshowlist.hxx>
65#include <sddll.hxx>
66
67#include <DrawDocShell.hxx>
68#include <FrameView.hxx>
69#include <unokywds.hxx>
70
71#include <unotools/fltrcfg.hxx>
72#include <sfx2/progress.hxx>
73#include <editeng/editstat.hxx>
75
76#define MAX_USER_MOVE 2
77
78#include "pptanimations.hxx"
79#include "pptinanimations.hxx"
80#include "ppt97animations.hxx"
81
82#include <com/sun/star/animations/TransitionSubType.hpp>
83#include <com/sun/star/animations/TransitionType.hpp>
84#include <com/sun/star/document/XDocumentProperties.hpp>
85#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
86#include <com/sun/star/drawing/LineStyle.hpp>
87#include <com/sun/star/frame/XModel.hpp>
88#include <comphelper/string.hxx>
89#include <oox/ole/olehelper.hxx>
90
91#include <optional>
92
93#include <cassert>
94#include <memory>
95#include <string_view>
96
97using namespace ::com::sun::star;
98
99SdPPTImport::SdPPTImport( SdDrawDocument* pDocument, SvStream& rDocStream, SotStorage& rStorage, SfxMedium& rMedium )
100 : maParam(rDocStream)
101{
102#ifdef DBG_UTIL
103 std::unique_ptr<PropRead> pSummaryInformation(new PropRead( rStorage, "\005SummaryInformation" ));
104 if ( pSummaryInformation->IsValid() )
105 {
106 pSummaryInformation->Read();
107 sal_uInt8 const aPropSetGUID[ 16 ]
108 {
109 0xe0, 0x85, 0x9f, 0xf2, 0xf9, 0x4f, 0x68, 0x10, 0xab, 0x91, 0x08, 0x00, 0x2b, 0x27, 0xb3, 0xd9
110 };
111 Section* pSection = const_cast<Section*>(pSummaryInformation->GetSection( aPropSetGUID ));
112 if ( pSection )
113 {
114 PropItem aPropItem;
115 if ( pSection->GetProperty( PID_COMMENTS, aPropItem ) )
116 {
117 OUString aComment;
118 aPropItem.Read( aComment );
119 if ( aComment.indexOf( "Applixware" ) >= 0 )
120 {
122 }
123 }
124 }
125 }
126 pSummaryInformation.reset();
127#endif
128
129 tools::SvRef<SotStorageStream> pCurrentUserStream(rStorage.OpenSotStream("Current User", StreamMode::STD_READ));
130 if (pCurrentUserStream)
131 {
132 ReadPptCurrentUserAtom(*pCurrentUserStream, maParam.aCurrentUserAtom);
133 }
134
135 if( pDocument )
136 {
137 // iterate over all styles
138 SdStyleSheetPool* pStyleSheetPool = pDocument->GetSdStyleSheetPool();
139 std::shared_ptr<SfxStyleSheetIterator> aIter =
140 std::make_shared<SfxStyleSheetIterator>(pStyleSheetPool, SfxStyleFamily::All);
141
142 for (SfxStyleSheetBase *pSheet = aIter->First(); pSheet; pSheet = aIter->Next())
143 {
144 SfxItemSet& rSet = pSheet->GetItemSet();
145 // if autokerning is set in style, override it, ppt has no autokerning
146 if( rSet.GetItemState( EE_CHAR_PAIRKERNING, false ) == SfxItemState::SET )
148 }
149 }
150
151 pFilter.reset(new ImplSdPPTImport(pDocument, rStorage, rMedium, maParam));
152}
153
155{
156 return pFilter->Import();
157}
158
160{
161}
162
164 : SdrPowerPointImport(rParam, rMedium.GetBaseURL())
165 , mrMed(rMedium)
166 , mrStorage(rStorage_)
167 , mbDocumentFound(false)
168 , mnFilterOptions(0)
169 , mpDoc(pDocument)
170 , mePresChange(PresChange::Manual)
171 , mnBackgroundObjectsLayerID(0)
172{
173 if ( !m_bOk )
174 return;
175
176 mbDocumentFound = SeekToDocument( &maDocHd ); // maDocHd = the latest DocumentHeader
178 mbDocumentFound = true;
179
180 sal_uInt32 nDggContainerOfs = 0;
181
182 if ( mbDocumentFound )
183 {
184 sal_uInt64 nOldPos = rStCtrl.Tell();
185
186 mxPicturesStream = rStorage_.OpenSotStream( "Pictures", StreamMode::STD_READ );
188
191 DffRecordHeader aPPDGHd;
192 if ( SeekToRec( rStCtrl, PPT_PST_PPDrawingGroup, nDocLen, &aPPDGHd ) )
193 {
194 sal_uLong nPPDGLen = aPPDGHd.GetRecEndFilePos();
195 if ( SeekToRec( rStCtrl, DFF_msofbtDggContainer, nPPDGLen ) )
196 nDggContainerOfs = rStCtrl.Tell();
197 }
198 rStCtrl.Seek( nOldPos );
199 }
200 sal_uInt32 nSvxMSDffOLEConvFlags2 = 0;
201
202 const SvtFilterOptions& rBasOpt = SvtFilterOptions::Get();
203 if ( rBasOpt.IsLoadPPointBasicCode() )
204 mnFilterOptions |= 1;
205 if ( rBasOpt.IsMathType2Math() )
206 nSvxMSDffOLEConvFlags2 |= OLE_MATHTYPE_2_STARMATH;
207 if ( rBasOpt.IsWinWord2Writer() )
208 nSvxMSDffOLEConvFlags2 |= OLE_WINWORD_2_STARWRITER;
209 if ( rBasOpt.IsExcel2Calc() )
210 nSvxMSDffOLEConvFlags2 |= OLE_EXCEL_2_STARCALC;
211 if ( rBasOpt.IsPowerPoint2Impress() )
212 nSvxMSDffOLEConvFlags2 |= OLE_POWERPOINT_2_STARIMPRESS;
213
214 InitSvxMSDffManager( nDggContainerOfs, pStData, nSvxMSDffOLEConvFlags2 );
217 SetModel( mpDoc, 576 );
218}
219
220// Dtor
222{
223 pStData = nullptr;
225}
226
227// Import
229{
230 if ( !m_bOk )
231 return false;
232
233 bool bWasLocked = pSdrModel->isLocked();
234 pSdrModel->setLock(true);
235 const bool bSavedUndoEnabled = pSdrModel->IsUndoEnabled();
236 pSdrModel->EnableUndo(false);
237
239 EEControlBits nControlWord = rOutl.GetEditEngine().GetControlWord();
240 nControlWord |= EEControlBits::ULSPACESUMMATION;
241 const_cast<EditEngine&>(rOutl.GetEditEngine()).SetControlWord( nControlWord );
242
243 SdrLayerAdmin& rAdmin = mpDoc->GetLayerAdmin();
245
246 ::sd::DrawDocShell* pDocShell = mpDoc->GetDocSh();
247 if ( pDocShell )
248 SeekOle( pDocShell, mnFilterOptions );
249
250 // hyperlinks
251 std::unique_ptr<PropRead> pDInfoSec2(new PropRead( mrStorage, "\005DocumentSummaryInformation" ));
252 if ( pDInfoSec2->IsValid() )
253 {
254 PropItem aPropItem;
255
256 sal_uInt32 nType(0), nPropCount(0);
257
258 pDInfoSec2->Read();
259
260 sal_uInt8 const aPropSetGUID[ 16 ]
261 {
262 0x02, 0xd5, 0xcd, 0xd5, 0x9c, 0x2e, 0x1b, 0x10, 0x93, 0x97, 0x08, 0x00, 0x2b, 0x2c, 0xf9, 0xae
263 };
264 Section* pSection = const_cast<Section*>(pDInfoSec2->GetSection( aPropSetGUID ));
265 if ( pSection )
266 {
267 if ( pSection->GetProperty( PID_SLIDECOUNT, aPropItem ) )
268 {
269 aPropItem.ReadUInt32( nType );
270 if ( ( nType == VT_I4 ) || ( nType == VT_UI4 ) )
271 {
272 // examine PID_HEADINGPAIR to get the correct entry for PID_DOCPARTS
273 sal_uInt32 nSlideCount(0), nVecCount(0);
274 aPropItem.ReadUInt32( nSlideCount );
275 if ( nSlideCount && pSection->GetProperty( PID_HEADINGPAIR, aPropItem ) )
276 {
277 sal_uInt32 nSlideTitleIndex = 0, nSlideTitleCount = 0;
278
279 OUString aUString;
280
281 aPropItem.ReadUInt32( nType )
282 .ReadUInt32( nVecCount );
283
284 if ( ( nType == ( VT_VARIANT | VT_VECTOR ) ) && ( nVecCount ^ 1 ) )
285 {
286 nVecCount >>= 1;
287 sal_uInt32 nEntryCount = 0;
288 for (sal_uInt32 i = 0; i < nVecCount; ++i)
289 {
290 if ( !aPropItem.Read( aUString, VT_EMPTY, false ) )
291 break;
292 aPropItem.ReadUInt32( nType );
293 if ( ( nType != VT_I4 ) && ( nType != VT_UI4 ) )
294 break;
295 sal_uInt32 nTemp(0);
296 aPropItem.ReadUInt32( nTemp );
297 if ( aUString == "Slide Titles" || aUString == "Folientitel" )
298 {
299 nSlideTitleCount = nTemp;
300 nSlideTitleIndex = nEntryCount;
301 }
302 nEntryCount += nTemp;
303 }
304 }
305 if ( ( nSlideCount == nSlideTitleCount ) && pSection->GetProperty( PID_DOCPARTS, aPropItem ) )
306 {
307 aPropItem.ReadUInt32( nType )
308 .ReadUInt32( nVecCount );
309
310 bool bVecOk = ( ( nVecCount >= (nSlideTitleIndex + nSlideTitleCount) )
311 && ( nType == ( VT_LPSTR | VT_VECTOR ) ) );
312
313 if (bVecOk)
314 {
315 for (sal_uInt32 i = 0; i != nSlideTitleIndex; ++i)
316 {
317 sal_uInt32 nTemp(0);
318 aPropItem.ReadUInt32(nTemp);
319 if (!aPropItem.good())
320 {
321 bVecOk = false;
322 break;
323 }
324 auto nPos = aPropItem.Tell() + nTemp;
325 if (!checkSeek(aPropItem, nPos))
326 {
327 bVecOk = false;
328 break;
329 }
330 }
331 }
332 if (bVecOk)
333 {
334 for (sal_uInt32 i = 0; i < nSlideTitleCount; ++i)
335 {
336 if (!aPropItem.Read(aUString, nType, false))
337 break;
338
339 OUString aString( aUString );
340 if ( aString == "No Slide Title" )
341 aString.clear();
342 else
343 {
344 std::vector<OUString>::const_iterator pIter =
345 std::find(maSlideNameList.begin(),maSlideNameList.end(),aString);
346
347 if (pIter != maSlideNameList.end())
348 aString.clear();
349 }
350 maSlideNameList.push_back( aString );
351 }
352 }
353 }
354 }
355 }
356 }
357
358 sal_uInt8 const aUserPropSetGUID[ 16 ]
359 {
360 0x05, 0xd5, 0xcd, 0xd5, 0x9c, 0x2e, 0x1b, 0x10, 0x93, 0x97, 0x08, 0x00, 0x2b, 0x2c, 0xf9, 0xae
361 };
362 pSection = const_cast<Section*>(pDInfoSec2->GetSection( aUserPropSetGUID ));
363 if ( pSection )
364 {
365 PropDictionary aDict;
366 pSection->GetDictionary(aDict);
367 if (!aDict.empty())
368 {
369 auto iter = aDict.find( OUString("_PID_HLINKS") );
370
371 if ( iter != aDict.end() )
372 {
373 if ( pSection->GetProperty( iter->second, aPropItem ) )
374 {
375 aPropItem.Seek( STREAM_SEEK_TO_BEGIN );
376 aPropItem.ReadUInt32( nType );
377 if ( nType == VT_BLOB )
378 {
379 sal_uInt32 nPropSize;
380 aPropItem.ReadUInt32( nPropSize )
381 .ReadUInt32( nPropCount );
382
383 if ( ! ( nPropCount % 6 ) )
384 {
385 sal_uInt32 i;
386
387 nPropCount /= 6; // 6 properties per hyperlink
388
389 for ( i = 0; i < nPropCount; i++ )
390 {
391 SdHyperlinkEntry aHyperlink;
392 aHyperlink.nIndex = 0;
393 aPropItem.ReadUInt32( nType );
394 if ( nType != VT_I4 )
395 break;
396 aPropItem.ReadInt32( aHyperlink.nPrivate1 )
397 .ReadUInt32( nType );
398 if ( nType != VT_I4 )
399 break;
400 aPropItem.ReadInt32( aHyperlink.nPrivate2 )
401 .ReadUInt32( nType );
402 if ( nType != VT_I4 )
403 break;
404 aPropItem.ReadInt32( aHyperlink.nPrivate3 )
405 .ReadUInt32( nType );
406 if ( nType != VT_I4 )
407 break;
408 aPropItem.ReadInt32( aHyperlink.nInfo );
409 if ( !aPropItem.Read( aHyperlink.aTarget ) )
410 break;
411
412 // Convert '\\' notation to 'smb://'
413 INetURLObject aUrl( aHyperlink.aTarget, INetProtocol::File );
415
416 if ( !aPropItem.Read( aHyperlink.aSubAddress ) )
417 break;
418
419 if ( !aHyperlink.aSubAddress.isEmpty() ) // get the converted subaddress
420 {
421 sal_uInt32 nPageNumber = 0;
422 OUString aString( aHyperlink.aSubAddress );
423 OString aStringAry[ 3 ];
424 size_t nTokenCount = 0;
425 sal_Int32 nPos = 0;
426 do
427 {
428 aStringAry[nTokenCount] =
429 OUStringToOString(o3tl::getToken(aString, 0, ',', nPos ), RTL_TEXTENCODING_UTF8);
430 }
431 while ( ++nTokenCount < SAL_N_ELEMENTS(aStringAry) && nPos >= 0 );
432
433 bool bDocInternalSubAddress = false;
434
435 // first pass, searching for a SlideId
436 for( size_t nToken = 0; nToken < nTokenCount; ++nToken )
437 {
439 {
440 sal_Int32 nNumber = aStringAry[ nToken ].toInt32();
441 if ( nNumber & ~0xff )
442 {
444 if ( pPageList )
445 {
446 sal_uInt16 nPage = pPageList->FindPage( nNumber );
447 if ( nPage != PPTSLIDEPERSIST_ENTRY_NOTFOUND )
448 {
449 nPageNumber = nPage;
450 bDocInternalSubAddress = true;
451 break;
452 }
453 }
454 }
455 }
456 }
457 if ( !bDocInternalSubAddress )
458 { // second pass, searching for a SlideName
459 for ( size_t nToken = 0; nToken < nTokenCount; ++nToken )
460 {
461 OUString aToken(OStringToOUString(aStringAry[nToken], RTL_TEXTENCODING_UTF8));
462 std::vector<OUString>::const_iterator pIter =
463 std::find(maSlideNameList.begin(),maSlideNameList.end(),aToken);
464
465 if (pIter != maSlideNameList.end())
466 {
467 nPageNumber = pIter - maSlideNameList.begin();
468 bDocInternalSubAddress = true;
469 }
470 }
471 }
472 if ( !bDocInternalSubAddress )
473 { // third pass, searching for a slide number
474 for ( size_t nToken = 0; nToken < nTokenCount; ++nToken )
475 {
477 {
478 sal_Int32 nNumber = aStringAry[ nToken ].toInt32();
479 if ( ( nNumber & ~0xff ) == 0 )
480 {
481 nPageNumber = static_cast<sal_uInt32>(nNumber) - 1;
482 bDocInternalSubAddress = true;
483 break;
484 }
485 }
486 }
487 }
488 // if a document internal sub address
489 if ( bDocInternalSubAddress )
490 {
491 if ( nPageNumber < maSlideNameList.size() )
492 aHyperlink.aConvSubString = maSlideNameList[ nPageNumber ];
493 if ( aHyperlink.aConvSubString.isEmpty() )
494 {
495 aHyperlink.aConvSubString = SdResId( STR_PAGE ) + " " + mpDoc->CreatePageNumValue( static_cast<sal_uInt16>(nPageNumber) + 1 );
496 }
497 } else {
498 // if sub address is given but not internal, use it as it is
499 if ( aHyperlink.aConvSubString.isEmpty() )
500 {
501 aHyperlink.aConvSubString = aString;
502 }
503 }
504 }
505 m_aHyperList.push_back( aHyperlink );
506 }
507 }
508 }
509 }
510 }
511 }
512 }
513 }
514 }
515 pDInfoSec2.reset();
516
517 if ( mbDocumentFound )
518 {
520 // read hyperlist / set indices of the entries
521 DffRecordHeader aHyperHd;
523 {
524 sal_uInt32 nExObjHyperListLen = aHyperHd.GetRecEndFilePos();
525 for (SdHyperlinkEntry & entry : m_aHyperList)
526 {
527 DffRecordHeader aHyperE;
528 if ( !SeekToRec( rStCtrl, PPT_PST_ExHyperlink, nExObjHyperListLen, &aHyperE ) )
529 break;
530 if ( !SeekToRec( rStCtrl, PPT_PST_ExHyperlinkAtom, nExObjHyperListLen ) )
531 break;
532 rStCtrl.SeekRel( 8 );
533 rStCtrl.ReadUInt32( entry.nIndex );
534 if (!aHyperE.SeekToEndOfRecord(rStCtrl))
535 break;
536 }
537
538 if (m_aHyperList.size() == 0)
539 {
540 while(true)
541 {
542
543 DffRecordHeader aHyperE;
544 if (!SeekToRec(rStCtrl, PPT_PST_ExHyperlink, nExObjHyperListLen, &aHyperE))
545 break;
546 if (!SeekToRec(rStCtrl, PPT_PST_ExHyperlinkAtom, nExObjHyperListLen))
547 continue;
548
549 SdHyperlinkEntry aHyperlink;
550
551 OUString aURLText;
552 OUString aURLLink;
553 rStCtrl.SeekRel(8);
554 rStCtrl.ReadUInt32(aHyperlink.nIndex);
555
556 ReadString(aURLText);
557 ReadString(aURLLink);
558 aHyperlink.aTarget = aURLLink;
559 m_aHyperList.push_back(aHyperlink);
560 }
561 }
562 }
563 }
564
565 if (pDocShell)
566 {
567 Size aVisAreaSize;
569 {
570 case PptViewTypeEnum::Notes:
571 case PptViewTypeEnum::NotesMaster:
572 aVisAreaSize = aDocAtom.GetNotesPageSize();
573 break;
574 default :
575 aVisAreaSize = aDocAtom.GetSlidesPageSize();
576 }
577 Scale( aVisAreaSize );
578 pDocShell->SetVisArea( ::tools::Rectangle( Point(), aVisAreaSize ) );
579 }
580
581 // create master pages:
582
583 std::unique_ptr<SfxProgress> xStbMgr;
585 {
586 xStbMgr.reset(new SfxProgress(pDocShell,
587 SdResId( STR_POWERPOINT_IMPORT),
588 m_pMasterPages->size() +
589 m_pSlidePages->size() + m_pNotePages->size()));
590 }
591
592 sal_uInt32 nImportedPages = 0;
593 {
594 sal_uInt16 nMasterCnt = GetPageCount( PPT_MASTERPAGE );
595
596 for ( sal_uInt16 nMasterNum = 0; nMasterNum < nMasterCnt; nMasterNum++ )
597 {
598 SetPageNum( nMasterNum, PPT_MASTERPAGE );
599 rtl::Reference<SdPage> pPage = static_cast<SdPage*>(MakeBlankPage( true ).get());
600 if ( pPage )
601 {
602 bool bNotesMaster = (*GetPageList( m_eCurrentPageKind ) )[ m_nCurrentPageNum ].bNotesMaster;
603 bool bStarDrawFiller = (*GetPageList( m_eCurrentPageKind ) )[ m_nCurrentPageNum ].bStarDrawFiller;
604
605 PageKind ePgKind = bNotesMaster ? PageKind::Notes : PageKind::Standard;
606 bool bHandout = (*GetPageList( m_eCurrentPageKind ) )[ m_nCurrentPageNum ].bHandoutMaster;
607 if ( bHandout )
608 ePgKind = PageKind::Handout;
609
610 pPage->SetPageKind( ePgKind );
611 pSdrModel->InsertMasterPage( pPage.get() );
612 if ( bNotesMaster && bStarDrawFiller )
613 pPage->SetAutoLayout( AUTOLAYOUT_NOTES, true );
614 if ( nMasterNum )
615 {
616 std::optional< sal_Int16 > oStartNumbering;
617 SfxStyleSheet* pSheet;
618 if ( nMasterNum == 1 )
619 {
620 // standardsheet
621 pSheet = static_cast<SfxStyleSheet*>(mpDoc->GetStyleSheetPool()->Find(SdResId(STR_STANDARD_STYLESHEET_NAME), SfxStyleFamily::Para ));
622 if ( pSheet )
623 {
624 SfxItemSet& rItemSet = pSheet->GetItemSet();
625 PPTParagraphObj aParagraph( *m_pPPTStyleSheet, TSS_Type::TextInShape, 0 );
626 PPTPortionObj aPortion( *m_pPPTStyleSheet, TSS_Type::TextInShape, 0 );
627 aParagraph.AppendPortion( aPortion );
628 aParagraph.ApplyTo( rItemSet, oStartNumbering, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
629 aPortion.ApplyTo( rItemSet, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
630 }
631 }
632
633 // PSEUDO
634 pSheet = static_cast<SfxStyleSheet*>(mpDoc->GetStyleSheetPool()->Find(SdResId(STR_PSEUDOSHEET_BACKGROUNDOBJECTS), SfxStyleFamily::Pseudo ));
635 if ( pSheet )
636 {
637 SfxItemSet& rItemSet = pSheet->GetItemSet();
638 PPTParagraphObj aParagraph( *m_pPPTStyleSheet, TSS_Type::TextInShape, 0 );
639 PPTPortionObj aPortion( *m_pPPTStyleSheet, TSS_Type::TextInShape, 0 );
640 aParagraph.AppendPortion( aPortion );
641 aParagraph.ApplyTo( rItemSet, oStartNumbering, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
642 aPortion.ApplyTo( rItemSet, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
643 }
644
645 // create layoutstylesheets, set layoutname and stylesheet
646 // (only on standard and not pages)
647
648 OUString aLayoutName( SdResId( STR_LAYOUT_DEFAULT_NAME ) );
649 if ( nMasterNum > 2 )
650 {
651 if ( ePgKind == PageKind::Standard )
652 { // standard page: create new presentation layout
653 aLayoutName = SdResId( STR_LAYOUT_DEFAULT_TITLE_NAME ) +
654 OUString::number( static_cast<sal_Int32>( ( nMasterNum + 1 ) / 2 - 1 ) );
655 static_cast<SdStyleSheetPool*>( mpDoc->GetStyleSheetPool() )->CreateLayoutStyleSheets( aLayoutName );
656 }
657 else // note page: use presentation layout of standard page
658 aLayoutName = static_cast<SdPage*>( mpDoc->GetMasterPage( nMasterNum - 1 ) )->GetName();
659 }
660 pPage->SetName( aLayoutName );
661 aLayoutName += SD_LT_SEPARATOR + STR_LAYOUT_OUTLINE;
662 pPage->SetLayoutName( aLayoutName );
663
664 // set stylesheets
665 if ( pPage->GetPageKind() == PageKind::Standard )
666 {
667 TSS_Type nTitleInstance = TSS_Type::PageTitle;
668 TSS_Type nOutlinerInstance = TSS_Type::Body;
669 const PptSlideLayoutAtom* pSlideLayout = GetSlideLayoutAtom();
670 bool bSwapStyleSheet = pSlideLayout->eLayout == PptSlideLayout::TITLEMASTERSLIDE;
671 if ( bSwapStyleSheet )
672 {
673 nTitleInstance = TSS_Type::Title;
674 nOutlinerInstance = TSS_Type::Subtitle;
675 }
676
677 // titlestylesheet
678 pSheet = pPage->GetStyleSheetForPresObj( PresObjKind::Title );
679 if ( pSheet )
680 {
681 SfxItemSet& rItemSet = pSheet->GetItemSet();
682 PPTParagraphObj aParagraph( *m_pPPTStyleSheet, nTitleInstance, 0 );
683 PPTPortionObj aPortion( *m_pPPTStyleSheet, nTitleInstance, 0 );
684 aParagraph.AppendPortion( aPortion );
685 aParagraph.ApplyTo( rItemSet, oStartNumbering, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
686 aPortion.ApplyTo( rItemSet, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
687 }
688
689 // outlinerstylesheet
690 sal_uInt16 nLevel;
691 PPTParagraphObj* pParagraphs[ 9 ];
692
693 for ( nLevel = 0; nLevel < 9; nLevel++ )
694 {
695 OUString aName = pPage->GetLayoutName() +
696 " " + OUString::number( nLevel + 1 );
697 SfxStyleSheet* pOutlineSheet = static_cast<SfxStyleSheet*>( mpDoc->GetStyleSheetPool()->Find( aName, SfxStyleFamily::Page ) );
698 DBG_ASSERT( pOutlineSheet, "Template for outline object not found" );
699 if ( pOutlineSheet )
700 {
701 pParagraphs[ nLevel ] = new PPTParagraphObj( *m_pPPTStyleSheet, nOutlinerInstance, nLevel );
702 SfxItemSet& rItemSet = pOutlineSheet->GetItemSet();
703 PPTPortionObj aPortion( *m_pPPTStyleSheet, nOutlinerInstance, nLevel );
704 pParagraphs[ nLevel ]->AppendPortion( aPortion );
705 pParagraphs[ nLevel ]->ApplyTo( rItemSet, oStartNumbering, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
706 aPortion.ApplyTo( rItemSet, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
707 }
708 else
709 pParagraphs[ nLevel ] = nullptr;
710 }
711 for ( nLevel = 0; nLevel < 9; delete pParagraphs[ nLevel++ ] ) ;
712
713 // subtitle stylesheet
714 pSheet = pPage->GetStyleSheetForPresObj( PresObjKind::Text );
715 if ( pSheet )
716 {
717 SfxItemSet& rItemSet = pSheet->GetItemSet();
718 PPTParagraphObj aParagraph( *m_pPPTStyleSheet, TSS_Type::Subtitle, 0 );
719 PPTPortionObj aPortion( *m_pPPTStyleSheet, TSS_Type::Subtitle, 0 );
720 aParagraph.AppendPortion( aPortion );
721 aParagraph.ApplyTo( rItemSet, oStartNumbering, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
722 aPortion.ApplyTo( rItemSet, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
723 }
724 }
725 else if ( ePgKind == PageKind::Notes )
726 {
727 pSheet = pPage->GetStyleSheetForPresObj( PresObjKind::Notes );
728 if ( pSheet )
729 {
730 SfxItemSet& rItemSet = pSheet->GetItemSet();
731 PPTParagraphObj aParagraph( *m_pPPTStyleSheet, TSS_Type::Notes, 0 );
732 PPTPortionObj aPortion( *m_pPPTStyleSheet, TSS_Type::Notes, 0 );
733 aParagraph.AppendPortion( aPortion );
734 aParagraph.ApplyTo( rItemSet, oStartNumbering, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
735 aPortion.ApplyTo( rItemSet, static_cast<SdrPowerPointImport&>(*this), TSS_Type::Unknown );
736 }
737 }
738 }
739 }
740 }
741 }
742 for (sal_uInt16 i = 0; i < mpDoc->GetMasterPageCount(); ++i)
743 {
744 SdPage *const pMPage(static_cast<SdPage*>(mpDoc->GetMasterPage(i)));
745 if (pMPage == nullptr)
746 break;
748
749 // importing master page objects
751 PptSlidePersistEntry* pPersist = ( pList && ( m_nCurrentPageNum < pList->size() ) )
752 ? &(*pList)[ m_nCurrentPageNum ] : nullptr;
753 if ( pPersist )
754 {
755 if ( pPersist->bStarDrawFiller && pPersist->bNotesMaster && ( m_nCurrentPageNum > 2 ) && ( ( m_nCurrentPageNum & 1 ) == 0 ) )
756 {
758 SdPage* pMasterPage2 = static_cast<SdPage*>(pSdrModel->GetMasterPage( 2 ));
759 rtl::Reference<SdPage> pNotesClone = static_cast<SdPage*>(pMasterPage2->CloneSdrPage(*pSdrModel).get());
760 pSdrModel->InsertMasterPage( pNotesClone.get(), m_nCurrentPageNum );
761 if ( pNotesClone )
762 {
763 OUString aLayoutName( static_cast<SdPage*>(pSdrModel->GetMasterPage( m_nCurrentPageNum - 1 ))->GetLayoutName() );
764 pNotesClone->SetPresentationLayout( aLayoutName, false, false );
765 pNotesClone->SetLayoutName( aLayoutName );
766 }
767 }
768 else if ( !pPersist->bStarDrawFiller )
769 {
770 PptSlidePersistEntry* pE = pPersist;
771 while( ( pE->aSlideAtom.nFlags & 4 ) && pE->aSlideAtom.nMasterId )
772 {
773 auto nOrigMasterId = pE->aSlideAtom.nMasterId;
774 sal_uInt16 nNextMaster = m_pMasterPages->FindPage(nOrigMasterId);
775 if ( nNextMaster == PPTSLIDEPERSIST_ENTRY_NOTFOUND )
776 break;
777 else
778 pE = &(*pList)[ nNextMaster ];
779 if (pE->aSlideAtom.nMasterId == nOrigMasterId)
780 {
781 SAL_WARN("filter.ms", "loop in atom chain");
782 break;
783 }
784 }
785 rtl::Reference<SdrObject> pObj = ImportPageBackgroundObject( *pMPage, pE->nBackgroundOffset ); // import background
786 if ( pObj )
787 pMPage->NbcInsertObject( pObj.get() );
788
789 bool bNewAnimationsUsed = false;
790 ProcessData aProcessData( (*pList)[ m_nCurrentPageNum ], SdPageCapsule(pMPage) );
791 sal_uInt32 nOldFPos = rStCtrl.Tell();
792 DffRecordHeader aPageHd;
793 if ( SeekToCurrentPage( &aPageHd ) )
794 {
795 auto nEndRecPos = SanitizeEndPos(rStCtrl, aPageHd.GetRecEndFilePos());
796 while( ( rStCtrl.GetError() == ERRCODE_NONE ) && ( rStCtrl.Tell() < nEndRecPos ) )
797 {
798 DffRecordHeader aHd;
799 if (!ReadDffRecordHeader( rStCtrl, aHd ))
800 break;
801 switch( aHd.nRecType )
802 {
803 case PPT_PST_PPDrawing :
804 {
806 DffRecordHeader aPPDrawHd;
807 if ( SeekToRec( rStCtrl, PPT_PST_PPDrawing, aHd.GetRecEndFilePos(), &aPPDrawHd ) )
808 {
809 sal_uInt32 nPPDrawEnd = aPPDrawHd.GetRecEndFilePos();
810 DffRecordHeader aEscherF002Hd;
811 if ( SeekToRec( rStCtrl, DFF_msofbtDgContainer, nPPDrawEnd, &aEscherF002Hd ) )
812 {
813 sal_uInt32 nEscherF002End = aEscherF002Hd.GetRecEndFilePos();
814 DffRecordHeader aEscherObjListHd;
815 if ( SeekToRec( rStCtrl, DFF_msofbtSpgrContainer, nEscherF002End, &aEscherObjListHd ) )
816 {
817 sal_uInt32 nObjCount = 0;
818 auto nListEndRecPos = SanitizeEndPos(rStCtrl, aEscherObjListHd.GetRecEndFilePos());
819 while( ( rStCtrl.GetError() == ERRCODE_NONE ) && ( rStCtrl.Tell() < nListEndRecPos ) )
820 {
821 DffRecordHeader aHd2;
823 if ( ( aHd2.nRecType == DFF_msofbtSpContainer ) || ( aHd2.nRecType == DFF_msofbtSpgrContainer ) )
824 {
825 if ( nObjCount++ ) // skipping the first object
826 {
827 ::tools::Rectangle aEmpty;
828 if (!aHd2.SeekToBegOfRecord(rStCtrl))
829 break;
830 rtl::Reference<SdrObject> pImpObj = ImportObj( rStCtrl, aProcessData, aEmpty, aEmpty, /*nCalledByGroup*/0, /*pShapeId*/ nullptr );
831 if ( pImpObj )
832 {
833 pImpObj->SetLayer( mnBackgroundObjectsLayerID );
834 pMPage->NbcInsertObject( pImpObj.get() );
835 }
836 }
837 }
838 if (!aHd2.SeekToEndOfRecord(rStCtrl))
839 break;
840 }
841 }
842 }
843 }
844 }
845 break;
846
847 case PPT_PST_ProgTags :
848 {
849 DffRecordHeader aProgTagHd;
850 if ( SeekToContentOfProgTag( 10, rStCtrl, aPageHd, aProgTagHd ) )
851 {
852 auto nTagEndRecPos = SanitizeEndPos(rStCtrl, aProgTagHd.GetRecEndFilePos());
853 while ( ( rStCtrl.GetError() == ERRCODE_NONE ) && ( rStCtrl.Tell() < nTagEndRecPos ) )
854 {
855 DffRecordHeader aProgTagContentHd;
856 ReadDffRecordHeader( rStCtrl, aProgTagContentHd );
857 switch( aProgTagContentHd.nRecType )
858 {
860 {
861 css::uno::Reference< css::drawing::XDrawPage > xPage( pMPage->getUnoPage(), css::uno::UNO_QUERY );
862 ppt::AnimationImporter aImporter( this, rStCtrl );
863 bNewAnimationsUsed = aImporter.import( xPage, aProgTagContentHd ) > 0;
864 }
865 break;
866 }
867 if (!aProgTagContentHd.SeekToEndOfRecord(rStCtrl))
868 break;
869 }
870 }
871 }
872 break;
873 }
874 bool bSuccess = aHd.SeekToEndOfRecord(rStCtrl);
875 if (!bSuccess)
876 {
877 SAL_WARN("filter.ms", "Could not seek to end of record");
878 break;
879 }
880 }
881 }
882 rStCtrl.Seek( nOldFPos );
883 ImportPageEffect( pMPage, bNewAnimationsUsed );
884
885 // background object
886 pObj = pMPage->GetObj( 0 );
887 if ( pObj && pObj->GetObjIdentifier() == SdrObjKind::Rectangle )
888 {
889 if ( pMPage->GetPageKind() == PageKind::Standard )
890 {
891 // transform data from imported background object to new form
892 // and delete the object. It was used as container to transport
893 // the attributes of the MasterPage background fill
895
896 if(pSheet)
897 {
898 // if we have a StyleSheet (for Masterpages), set attributes there and use it
899 pSheet->GetItemSet().ClearItem();
900 pSheet->GetItemSet().Put(pObj->GetMergedItemSet());
902 pMPage->getSdrPageProperties().SetStyleSheet(pSheet);
903 }
904 else
905 {
906 // without StyleSheet, set attributes directly. This
907 // should not be done at all and is an error (will be asserted by SdrPage)
909 pMPage->getSdrPageProperties().PutItemSet(pObj->GetMergedItemSet());
910 }
911
912 pMPage->RemoveObject(pObj->GetOrdNum());
913 pObj.clear();
914 }
915 }
916 }
917 }
918 if (xStbMgr)
919 xStbMgr->SetState( nImportedPages++ );
920 }
921
922 // importing slide pages
923 {
924 sal_uInt32 nOldFPos = rStCtrl.Tell();
926 sal_uInt16 nPageNum = m_nCurrentPageNum;
927
928 rtl::Reference<SdPage> pHandoutPage = static_cast<SdPage*>(MakeBlankPage( false ).get());
929 pHandoutPage->SetPageKind( PageKind::Handout );
930 pSdrModel->InsertPage( pHandoutPage.get() );
931
932 sal_uInt16 nPageCnt = GetPageCount();
933 if ( nPageCnt )
934 {
935 for ( sal_uInt16 nPage = 0; nPage < nPageCnt; nPage++ )
936 {
938 SetPageNum( nPage );
939 rtl::Reference<SdPage> pPage = static_cast<SdPage*>(MakeBlankPage( false ).get());
940 PptSlidePersistEntry* pMasterPersist = nullptr;
941 if ( HasMasterPage( nPage ) ) // try to get the LayoutName from the masterpage
942 {
943 sal_uInt16 nMasterNum = GetMasterPageIndex( m_nCurrentPageNum, m_eCurrentPageKind );
944 pPage->TRG_SetMasterPage(*pSdrModel->GetMasterPage(nMasterNum));
946 if ( pPageList && nMasterNum < pPageList->size() )
947 pMasterPersist = &(*pPageList)[ nMasterNum ];
948 pPage->SetLayoutName(static_cast<SdPage&>(pPage->TRG_GetMasterPage()).GetLayoutName());
949 }
950 pPage->SetPageKind( PageKind::Standard );
951 pSdrModel->InsertPage( pPage.get() ); // SJ: #i29625# because of form controls, the
952 ImportPage( pPage.get(), pMasterPersist ); // page must be inserted before importing
953 SetHeaderFooterPageSettings( pPage.get(), pMasterPersist );
954 // CWS preseng01: pPage->SetPageKind( PageKind::Standard );
955
956 DffRecordHeader aPageHd;
957 if ( SeekToCurrentPage( &aPageHd ) )
958 {
959 bool bNewAnimationsUsed = false;
960
961 aPageHd.SeekToContent( rStCtrl );
962 auto nEndRecPos = SanitizeEndPos(rStCtrl, aPageHd.GetRecEndFilePos());
963 while ( ( rStCtrl.GetError() == ERRCODE_NONE ) && ( rStCtrl.Tell() < nEndRecPos ) )
964 {
965 DffRecordHeader aHd;
967 switch ( aHd.nRecType )
968 {
969 case PPT_PST_ProgTags :
970 {
971 DffRecordHeader aProgTagHd;
972 if ( SeekToContentOfProgTag( 10, rStCtrl, aPageHd, aProgTagHd ) )
973 {
974 auto nHdEndRecPos = SanitizeEndPos(rStCtrl, aProgTagHd.GetRecEndFilePos());
975 while ( ( rStCtrl.GetError() == ERRCODE_NONE ) && ( rStCtrl.Tell() < nHdEndRecPos ) )
976 {
977 DffRecordHeader aProgTagContentHd;
978 ReadDffRecordHeader( rStCtrl, aProgTagContentHd );
979 switch( aProgTagContentHd.nRecType )
980 {
982 {
983 css::uno::Reference< css::drawing::XDrawPage > xPage( pPage->getUnoPage(), css::uno::UNO_QUERY );
984 ppt::AnimationImporter aImporter( this, rStCtrl );
985 bNewAnimationsUsed = aImporter.import( xPage, aProgTagContentHd ) > 0;
986 }
987 break;
988
989 case PPT_PST_HashCodeAtom : // ???
990 break;
991
992 case PPT_PST_SlideTime10Atom : // ??? don't know, this atom is always 8 bytes big
993 break; // and is appearing in nearly every l10 progtag
994 }
995 if (!aProgTagContentHd.SeekToEndOfRecord(rStCtrl))
996 break;
997 }
998 }
999 }
1000 break;
1001
1003 case PPT_PST_PPDrawing :
1004 default:
1005 break;
1006 }
1007
1008 if (!aHd.SeekToEndOfRecord(rStCtrl))
1009 break;
1010 }
1011 ImportPageEffect( pPage.get(), bNewAnimationsUsed );
1012 }
1013
1014 // creating the corresponding note page
1016 rtl::Reference<SdPage> pNotesPage = static_cast<SdPage*>(MakeBlankPage( false ).get());
1017 sal_uInt16 nNotesMasterNum = GetMasterPageIndex( nPage ) + 1;
1018 sal_uInt32 nNotesPageId = GetNotesPageId( nPage );
1019 if ( nNotesPageId )
1020 {
1021 nImportedPages++;
1022 sal_uInt16 nNotesPageIndex = m_pNotePages->FindPage( nNotesPageId );
1023 if ( nNotesPageIndex == PPTSLIDEPERSIST_ENTRY_NOTFOUND )
1024 nNotesPageIndex = 0;
1025 SetPageNum( nNotesPageIndex, PPT_NOTEPAGE );
1026 PptSlidePersistEntry* pMasterPersist2 = nullptr;
1027 if ( HasMasterPage( nNotesPageIndex, PPT_NOTEPAGE ) ) // try to get the LayoutName from the masterpage
1028 {
1029 pNotesPage->TRG_SetMasterPage(*pSdrModel->GetMasterPage(nNotesMasterNum));
1031 if ( pPageList && nNotesMasterNum < pPageList->size() )
1032 pMasterPersist2 = &(*pPageList)[ nNotesMasterNum ];
1033 pNotesPage->SetLayoutName( static_cast<SdPage&>(pNotesPage->TRG_GetMasterPage()).GetLayoutName() );
1034 }
1035 pNotesPage->SetPageKind( PageKind::Notes );
1036 pNotesPage->TRG_SetMasterPage(*pSdrModel->GetMasterPage(nNotesMasterNum));
1037 pSdrModel->InsertPage( pNotesPage.get() ); // SJ: #i29625# because of form controls, the
1038 ImportPage( pNotesPage.get(), pMasterPersist2 ); // page must be inserted before importing
1039 SetHeaderFooterPageSettings( pNotesPage.get(), pMasterPersist2 );
1040 pNotesPage->SetAutoLayout( AUTOLAYOUT_NOTES );
1041 }
1042 else
1043 {
1044 pNotesPage->SetPageKind( PageKind::Notes );
1045 pNotesPage->TRG_SetMasterPage(*pSdrModel->GetMasterPage(nNotesMasterNum));
1046 pNotesPage->SetAutoLayout( AUTOLAYOUT_NOTES, true );
1047 pSdrModel->InsertPage( pNotesPage.get() );
1048 SdrObject* pPageObj = pNotesPage->GetPresObj( PresObjKind::Page );
1049 if ( pPageObj )
1050 static_cast<SdrPageObj*>(pPageObj)->SetReferencedPage(pSdrModel->GetPage(( nPage << 1 ) + 1));
1051 }
1052
1053 if (xStbMgr)
1054 xStbMgr->SetState( nImportedPages++ );
1055 }
1056 }
1057 else
1058 {
1059 // that can happen by document templates
1061 rtl::Reference<SdPage> pPage = static_cast<SdPage*>(MakeBlankPage( false ).get());
1062 pSdrModel->InsertPage( pPage.get() );
1063
1064 // #i37397#, trying to set the title master for the first page
1065 sal_uInt16 nMaster, nMasterCount = pSdrModel->GetMasterPageCount();
1066 SdPage* pFoundMaster = nullptr;
1067 for ( nMaster = 1; nMaster < nMasterCount; nMaster++ )
1068 {
1069 SdPage* pMaster = static_cast<SdPage*>( pSdrModel->GetMasterPage( nMaster ) );
1070 if ( pMaster->GetPageKind() == PageKind::Standard )
1071 {
1072 SetPageNum( nMaster, PPT_MASTERPAGE );
1073 if ( !pFoundMaster )
1074 pFoundMaster = pMaster;
1075 else if ( GetSlideLayoutAtom()->eLayout == PptSlideLayout::TITLEMASTERSLIDE )
1076 pFoundMaster = pMaster;
1077 if ( GetSlideLayoutAtom()->eLayout == PptSlideLayout::TITLEMASTERSLIDE )
1078 break;
1079 }
1080 }
1081 if ( pFoundMaster )
1082 {
1083 pPage->TRG_SetMasterPage( *pFoundMaster );
1084 pPage->SetLayoutName( pFoundMaster->GetLayoutName() );
1085 }
1086 pPage->SetAutoLayout( AUTOLAYOUT_TITLE, true, true );
1087
1089 rtl::Reference<SdrPage> pNPage = MakeBlankPage( false );
1090 pSdrModel->InsertPage( pNPage.get() );
1091 }
1092 SetPageNum( nPageNum, ePageKind );
1093 rStCtrl.Seek( nOldFPos );
1094 }
1095
1096 // create handout and note pages
1098 if ( m_bOk )
1099 {
1100 for ( sal_uInt16 i = 0; i < mpDoc->GetSdPageCount( PageKind::Standard ); i++ )
1101 {
1102
1103 // set AutoLayout
1104 SetPageNum( i );
1106 AutoLayout eAutoLayout = AUTOLAYOUT_NONE;
1107 const PptSlideLayoutAtom* pSlideLayout = GetSlideLayoutAtom();
1108 if ( pSlideLayout )
1109 {
1110 switch ( pSlideLayout->eLayout ) // presentation layout for standard pages
1111 {
1112 case PptSlideLayout::TITLEANDBODYSLIDE :
1113 {
1114 eAutoLayout = AUTOLAYOUT_TITLE_CONTENT;
1115 PptPlaceholder nID1 = pSlideLayout->aPlaceholderId[ 1 ];
1116 switch ( nID1 )
1117 {
1118 case PptPlaceholder::BODY :
1119 eAutoLayout = AUTOLAYOUT_TITLE_CONTENT;
1120 break;
1121 case PptPlaceholder::TABLE :
1122 eAutoLayout = AUTOLAYOUT_TAB;
1123 break;
1124 case PptPlaceholder::ORGANISZATIONCHART :
1125 eAutoLayout = AUTOLAYOUT_ORG;
1126 break;
1127 case PptPlaceholder::GRAPH :
1128 eAutoLayout = AUTOLAYOUT_CHART;
1129 break;
1130 case PptPlaceholder::OBJECT :
1131 eAutoLayout = AUTOLAYOUT_OBJ;
1132 break;
1133 case PptPlaceholder::VERTICALTEXTBODY :
1134 eAutoLayout = AUTOLAYOUT_TITLE_VCONTENT;
1135 break;
1136 default: break;
1137 }
1138 }
1139 break;
1140
1141 case PptSlideLayout::TWOCOLUMNSANDTITLE :
1142 {
1143 eAutoLayout = AUTOLAYOUT_TITLE_2CONTENT;
1144 PptPlaceholder nID1 = pSlideLayout->aPlaceholderId[ 1 ];
1145 PptPlaceholder nID2 = pSlideLayout->aPlaceholderId[ 2 ];
1146 if ( nID1 == PptPlaceholder::BODY && nID2 == PptPlaceholder::GRAPH )
1147 eAutoLayout = AUTOLAYOUT_TEXTCHART;
1148 else if ( nID1 == PptPlaceholder::GRAPH && nID2 == PptPlaceholder::BODY )
1149 eAutoLayout = AUTOLAYOUT_CHARTTEXT;
1150 else if ( nID1 == PptPlaceholder::BODY && nID2 == PptPlaceholder::CLIPART )
1151 eAutoLayout = AUTOLAYOUT_TEXTCLIP;
1152 else if ( nID1 == PptPlaceholder::CLIPART && nID2 == PptPlaceholder::BODY )
1153 eAutoLayout = AUTOLAYOUT_CLIPTEXT;
1154 else if ( nID1 == PptPlaceholder::CLIPART && nID2 == PptPlaceholder::VERTICALTEXTBODY )
1155 eAutoLayout = AUTOLAYOUT_TITLE_2VTEXT;
1156 else if ( ( nID1 == PptPlaceholder::BODY )
1157 && ( ( nID2 == PptPlaceholder::OBJECT ) || ( nID2 == PptPlaceholder::MEDIACLIP ) ) )
1158 eAutoLayout = AUTOLAYOUT_TEXTOBJ;
1159 else if ( ( nID2 == PptPlaceholder::BODY )
1160 && ( ( nID1 == PptPlaceholder::OBJECT ) || ( nID1 == PptPlaceholder::MEDIACLIP ) ) )
1161 eAutoLayout = AUTOLAYOUT_OBJTEXT;
1162 else if ( ( nID1 == PptPlaceholder::OBJECT ) && ( nID2 == PptPlaceholder::OBJECT ) )
1163 eAutoLayout = AUTOLAYOUT_OBJ;
1164 }
1165 break;
1166
1167 case PptSlideLayout::TWOROWSANDTITLE :
1168 {
1169 eAutoLayout = AUTOLAYOUT_TITLE_2CONTENT;
1170 PptPlaceholder nID1 = pSlideLayout->aPlaceholderId[ 1 ];
1171 PptPlaceholder nID2 = pSlideLayout->aPlaceholderId[ 2 ];
1172 if ( nID1 == PptPlaceholder::BODY && nID2 == PptPlaceholder::OBJECT )
1173 eAutoLayout = AUTOLAYOUT_TEXTOVEROBJ;
1174 else if ( nID1 == PptPlaceholder::OBJECT && nID2 == PptPlaceholder::BODY )
1176 }
1177 break;
1178
1179 case PptSlideLayout::TITLESLIDE :
1180 eAutoLayout = AUTOLAYOUT_TITLE;
1181 break;
1182 case PptSlideLayout::ONLYTITLE :
1183 eAutoLayout = AUTOLAYOUT_TITLE_ONLY;
1184 break;
1185 case PptSlideLayout::RIGHTCOLUMN2ROWS :
1187 break;
1188 case PptSlideLayout::LEFTCOLUMN2ROWS :
1190 break;
1191 case PptSlideLayout::TOPROW2COLUMN :
1193 break;
1194 case PptSlideLayout::FOUROBJECTS :
1195 eAutoLayout = AUTOLAYOUT_TITLE_4CONTENT;
1196 break;
1197 case PptSlideLayout::BIGOBJECT :
1198 eAutoLayout = AUTOLAYOUT_OBJ;
1199 break;
1200 case PptSlideLayout::TITLERIGHTBODYLEFT :
1201 eAutoLayout = AUTOLAYOUT_VTITLE_VCONTENT;
1202 break;
1203 case PptSlideLayout::TITLERIGHT2BODIESLEFT :
1205 break;
1206
1207 case PptSlideLayout::BOTTOMROW2COLUMNS :
1208 case PptSlideLayout::BLANKSLIDE :
1209 case PptSlideLayout::MASTERSLIDE : // layout of the standard and title master page
1210 case PptSlideLayout::TITLEMASTERSLIDE :
1211 case PptSlideLayout::MASTERNOTES : // layout of the note master page
1212 case PptSlideLayout::NOTESTITLEBODY : // presentation layout for note pages
1213 case PptSlideLayout::HANDOUTLAYOUT : // presentation layout for handout
1214 eAutoLayout = AUTOLAYOUT_NONE;
1215 break;
1216 }
1217 if ( eAutoLayout != AUTOLAYOUT_NONE )
1218 pPage->SetAutoLayout( eAutoLayout );
1219 }
1220 }
1221
1222 // handout master page: auto layout
1223 SdPage* pHandoutMPage = mpDoc->GetMasterSdPage( 0, PageKind::Handout );
1224 pHandoutMPage->SetAutoLayout( AUTOLAYOUT_HANDOUT6, true, true );
1225 }
1226
1227 sal_uInt32 nSlideCount = GetPageCount();
1228 for ( sal_uInt32 i = 0; ( i < nSlideCount) && ( i < maSlideNameList.size() ); i++ )
1229 {
1231 OUString &aName = maSlideNameList[ i ];
1232 if ( pPage )
1233 {
1234 if ( !aName.isEmpty() )
1235 pPage->SetName( aName );
1236 else
1237 aName = pPage->GetName();
1238 }
1239 }
1240 if ( mbDocumentFound )
1241 {
1243 if ( pDocShell )
1244 {
1245 ::sd::FrameView* pFrameView = mpDoc->GetFrameView( 0 );
1246 if ( !pFrameView )
1247 {
1248 std::vector<std::unique_ptr<sd::FrameView>> &rViews = mpDoc->GetFrameViewList();
1249 pFrameView = new ::sd::FrameView( mpDoc );
1250 rViews.push_back( std::unique_ptr<sd::FrameView>(pFrameView) );
1251 }
1252 sal_uInt16 nSelectedPage = 0;
1253 PageKind ePageKind = PageKind::Standard;
1254 EditMode eEditMode = EditMode::Page;
1255
1257 {
1258 case PptViewTypeEnum::Outline:
1259 mrMed.GetItemSet().Put( SfxUInt16Item( SID_VIEW_ID, 3 ) );
1260 break;
1261 case PptViewTypeEnum::SlideSorter:
1262 mrMed.GetItemSet().Put( SfxUInt16Item( SID_VIEW_ID, 2 ) );
1263 break;
1264 case PptViewTypeEnum::TitleMaster:
1265 nSelectedPage = 1;
1266 [[fallthrough]];
1267 case PptViewTypeEnum::SlideMaster:
1268 {
1269 ePageKind = PageKind::Standard;
1270 eEditMode = EditMode::MasterPage;
1271 }
1272 break;
1273 case PptViewTypeEnum::NotesMaster:
1274 eEditMode = EditMode::MasterPage;
1275 [[fallthrough]];
1276 case PptViewTypeEnum::Notes:
1277 ePageKind = PageKind::Notes;
1278 break;
1279 case PptViewTypeEnum::Handout:
1280 ePageKind = PageKind::Handout;
1281 break;
1282 default :
1283 case PptViewTypeEnum::Slide:
1284 break;
1285 }
1286 pFrameView->SetPageKind( ePageKind );
1287 pFrameView->SetSelectedPage( nSelectedPage );
1288 pFrameView->SetViewShEditMode( eEditMode );
1289 }
1290 DffRecordHeader aCustomShowHeader;
1291 // read and set custom show
1293 if ( SeekToRec( rStCtrl, PPT_PST_NamedShows, maDocHd.GetRecEndFilePos(), &aCustomShowHeader ) )
1294 {
1295 DffRecordHeader aCuHeader;
1296 while( SeekToRec( rStCtrl, PPT_PST_NamedShow, aCustomShowHeader.GetRecEndFilePos(), &aCuHeader ) )
1297 {
1298 DffRecordHeader aContent;
1299 if ( SeekToRec( rStCtrl, PPT_PST_CString, aCuHeader.GetRecEndFilePos(), &aContent ) )
1300 {
1301 OUString aCuShow;
1302 aContent.SeekToBegOfRecord( rStCtrl );
1303 if ( ReadString( aCuShow ) )
1304 {
1305 if ( SeekToRec( rStCtrl, PPT_PST_NamedShowSlides, aCuHeader.GetRecEndFilePos(), &aContent ) )
1306 {
1308 const auto nRemainingSize = rStCtrl.remainingSize();
1309 sal_uInt32 nBCount = aContent.nRecLen;
1310 if (nBCount > nRemainingSize)
1311 {
1312 SAL_WARN("filter.ms", "page number data len longer than remaining stream size");
1313 nBCount = nRemainingSize;
1314 }
1315 sal_uInt32 nSCount = nBCount >> 2;
1316
1317 if ( pPageList && nSCount )
1318 {
1319 SdCustomShowList* pList = mpDoc->GetCustomShowList( true );
1320 if ( pList )
1321 {
1322 std::unique_ptr<SdCustomShow> pSdCustomShow(new SdCustomShow);
1323 pSdCustomShow->SetName( aCuShow );
1324 sal_uInt32 nFound = 0;
1325 for ( sal_uInt32 nS = 0; nS < nSCount; nS++ )
1326 {
1327 sal_uInt32 nPageNumber;
1328 rStCtrl.ReadUInt32( nPageNumber );
1329 sal_uInt16 nPage = pPageList->FindPage( nPageNumber );
1330 if ( nPage != PPTSLIDEPERSIST_ENTRY_NOTFOUND )
1331 {
1332 SdPage* pPage = mpDoc->GetSdPage( nPage, PageKind::Standard );
1333 if ( pPage )
1334 {
1335 pSdCustomShow->PagesVector().push_back( pPage );
1336 nFound++;
1337 }
1338 }
1339 }
1340 if ( nFound )
1341 pList->push_back( std::move(pSdCustomShow) );
1342 }
1343 }
1344 }
1345 }
1346 }
1347 }
1348 }
1349 // this is defaulted, maybe there is no SSDocInfoAtom
1350 OUStringBuffer aCustomShow;
1351 sal_uInt32 nFlags = 1; // Bit 0: Auto advance
1352 sal_uInt16 nStartSlide = 0;
1353
1354 // read the pres. configuration
1356 if ( SeekToRec( rStCtrl, PPT_PST_SSDocInfoAtom, maDocHd.GetRecEndFilePos(), &aCustomShowHeader ) )
1357 {
1358 sal_uInt32 nPenColor = 0x1000000;
1359 sal_Int32 nRestartTime = 0x7fffffff;
1360 sal_Int16 nEndSlide = 0;
1361 rStCtrl.ReadUInt32( nPenColor )
1362 .ReadInt32( nRestartTime )
1363 .ReadUInt16( nStartSlide )
1364 .ReadInt16( nEndSlide );
1365
1366 sal_Unicode nChar;
1367 for ( sal_uInt32 i2 = 0; i2 < 32; i2++ )
1368 {
1369 rStCtrl.ReadUtf16( nChar );
1370 if ( nChar )
1371 aCustomShow.append( nChar );
1372 else
1373 {
1374 rStCtrl.SeekRel( ( 31 - i2 ) << 1 );
1375 break;
1376 }
1377 }
1378 rStCtrl.ReadUInt32( nFlags );
1379 }
1380 // set the current custom show
1381 if ( !aCustomShow.isEmpty() )
1382 {
1384 if ( pList )
1385 {
1386 SdCustomShow* pPtr = nullptr;
1387 OUString aCustomShowStr = aCustomShow.makeStringAndClear();
1388 for( pPtr = pList->First(); pPtr; pPtr = pList->Next() )
1389 {
1390 if ( pPtr->GetName() == aCustomShowStr )
1391 break;
1392 }
1393 if ( !pPtr )
1394 pList->First();
1395 }
1396 }
1398
1399 rPresSettings.mbManual = ( nFlags & 1 ) == 0;
1400 rPresSettings.mbAnimationAllowed = ( nFlags & 2 ) == 0;
1401 rPresSettings.mbAll = ( nFlags & 4 ) == 0;
1402 rPresSettings.mbCustomShow = ( nFlags & 8 ) != 0;
1403 rPresSettings.mbEndless = ( nFlags & 0x80 ) != 0;
1404 rPresSettings.mbFullScreen = ( nFlags & 0x10 ) == 0;
1405
1406 if ( nStartSlide && ( nStartSlide <= GetPageCount() ) )
1407 {
1408 SdPage* pPage = mpDoc->GetSdPage( nStartSlide - 1, PageKind::Standard );
1409 if ( pPage )
1410 rPresSettings.maPresPage = pPage->GetName();
1411 }
1412 }
1413
1414 xStbMgr.reset();
1415
1416 // read DocumentProperties
1417 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
1418 mpDoc->GetObjectShell()->GetModel(), uno::UNO_QUERY_THROW);
1419 uno::Reference<document::XDocumentProperties> xDocProps
1420 = xDPS->getDocumentProperties();
1422 xDocProps->setTemplateName(OUString());
1423
1424 pSdrModel->setLock(bWasLocked);
1425 pSdrModel->EnableUndo(bSavedUndoEnabled);
1426 return m_bOk;
1427}
1428
1430{
1431 sal_uInt32 i;
1433 if ( ( !pList ) || ( pList->size() <= m_nCurrentPageNum ) )
1434 return;
1435 PptSlidePersistEntry& rSlidePersist = (*pList)[ m_nCurrentPageNum ];
1436 HeaderFooterEntry* pHFE = rSlidePersist.xHeaderFooterEntry.get();
1437 if (!pHFE)
1438 return;
1439
1440 for ( i = 0; i < 4; i++ )
1441 {
1442 bool bVisible = pHFE->IsToDisplay( i );
1444 && ( rSlidePersist.aSlideAtom.aLayout.eLayout == PptSlideLayout::TITLESLIDE )
1446 {
1447 bVisible = false;
1448 }
1449 if ( bVisible && pMasterPersist )
1450 {
1451 sal_uInt32 nPosition = pHFE->NeedToImportInstance( i, rSlidePersist );
1452 if ( nPosition )
1453 {
1454 ::tools::Rectangle aEmpty;
1455 bVisible = false;
1456 rStCtrl.Seek( nPosition );
1457 ProcessData aProcessData( rSlidePersist, SdPageCapsule(pPage) );
1458 rtl::Reference<SdrObject> pObj = ImportObj( rStCtrl, aProcessData, aEmpty, aEmpty, /*nCalledByGroup*/0, /*pShapeId*/nullptr );
1459 if ( pObj )
1460 pPage->NbcInsertObject( pObj.get(), 0 );
1461 }
1462 }
1463 OUString aPlaceHolderString = pHFE->pPlaceholder[ i ];
1464
1465 sd::HeaderFooterSettings rHeaderFooterSettings( pPage->getHeaderFooterSettings() );
1466 switch( i )
1467 {
1468 case 0 :
1469 {
1470 rHeaderFooterSettings.mbDateTimeVisible = bVisible;
1471 rHeaderFooterSettings.mbDateTimeIsFixed = ( pHFE->nAtom & 0x20000 ) == 0;
1472 rHeaderFooterSettings.maDateTimeText = aPlaceHolderString;
1473 SvxDateFormat eDateFormat;
1474 SvxTimeFormat eTimeFormat;
1475 PPTFieldEntry::GetDateTime( pHFE->nAtom & 0xff, eDateFormat, eTimeFormat );
1476 rHeaderFooterSettings.meDateFormat = eDateFormat;
1477 rHeaderFooterSettings.meTimeFormat = eTimeFormat;
1478 }
1479 break;
1480 case 1 :
1481 {
1482 rHeaderFooterSettings.mbHeaderVisible = bVisible;
1483 rHeaderFooterSettings.maHeaderText = aPlaceHolderString;
1484 }
1485 break;
1486 case 2 :
1487 {
1488 rHeaderFooterSettings.mbFooterVisible = bVisible;
1489 rHeaderFooterSettings.maFooterText = aPlaceHolderString;
1490 }
1491 break;
1492 case 3 :
1493 {
1494 rHeaderFooterSettings.mbSlideNumberVisible = bVisible;
1495 }
1496 break;
1497 }
1498 pPage->setHeaderFooterSettings( rHeaderFooterSettings );
1499 }
1500}
1501
1502namespace {
1503
1504// Import of pages
1505struct Ppt97AnimationStlSortHelper
1506{
1507 bool operator()( const std::pair< SdrObject*, Ppt97AnimationPtr >& p1, const std::pair< SdrObject*, Ppt97AnimationPtr >& p2 );
1508};
1509
1510}
1511
1512bool Ppt97AnimationStlSortHelper::operator()( const std::pair< SdrObject*, Ppt97AnimationPtr >& p1, const std::pair< SdrObject*, Ppt97AnimationPtr >& p2 )
1513{
1514 if( !p1.second || !p2.second )
1515 return p1.second.get() < p2.second.get();
1516 if( *p1.second < *p2.second )
1517 return true;
1518 if( *p1.second > *p2.second )
1519 return false;
1520 return p1.first->GetOrdNum() < p2.first->GetOrdNum();
1521}
1522
1523void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const bool bNewAnimationsUsed )
1524{
1525 sal_uInt64 nOldFilePos = rStCtrl.Tell();
1526
1527 // set PageKind at page (up to now only PageKind::Standard or PageKind::Notes)
1528 if ( pPage->GetPageKind() == PageKind::Standard )
1529 {
1531 PptSlidePersistEntry* pActualSlidePersist = ( pPersistList && ( m_nCurrentPageNum < pPersistList->size() ) )
1532 ? &(*pPersistList)[ m_nCurrentPageNum ] : nullptr;
1533
1534 if ( pActualSlidePersist && ( m_eCurrentPageKind == PPT_SLIDEPAGE ) )
1535 {
1536 if ( ! ( pActualSlidePersist->aSlideAtom.nFlags & 1 ) ) // do not follow master objects ?
1537 {
1538 if(pPage->TRG_HasMasterPage())
1539 {
1540 SdrLayerIDSet aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers();
1541 aVisibleLayers.Set(mnBackgroundObjectsLayerID, false);
1542 pPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers);
1543 }
1544 }
1545 }
1546 DffRecordHeader aPageRecHd;
1547 if ( SeekToCurrentPage( &aPageRecHd ) )
1548 {
1549 sal_uLong nPageRecEnd = SanitizeEndPos(rStCtrl, aPageRecHd.GetRecEndFilePos());
1550
1551 bool bTryTwice = ( m_eCurrentPageKind == PPT_SLIDEPAGE );
1552 bool bSSSlideInfoAtom = false;
1553 while ( true )
1554 {
1555 while ( ( rStCtrl.GetError() == ERRCODE_NONE ) && ( rStCtrl.Tell() < nPageRecEnd ) )
1556 {
1557 DffRecordHeader aHd;
1559 switch ( aHd.nRecType )
1560 {
1562 {
1563 bSSSlideInfoAtom = true;
1565 {
1566 if ( pActualSlidePersist )
1567 pActualSlidePersist->aPersistAtom.nReserved = aHd.GetRecBegFilePos();
1568 }
1569 else
1570 {
1571 sal_Int8 nDirection, nTransitionType, nByteDummy, nSpeed;
1572 sal_Int16 nBuildFlags;
1573 sal_Int32 nSlideTime, nSoundRef;
1574 rStCtrl.ReadInt32( nSlideTime ) // time to show (in Ticks)
1575 .ReadInt32( nSoundRef ) // Index of SoundCollection
1576 .ReadSChar( nDirection ) // direction of fade effect
1577 .ReadSChar( nTransitionType ) // fade effect
1578 .ReadInt16( nBuildFlags ) // Buildflags (s.u.)
1579 .ReadSChar( nSpeed ) // speed (slow, medium, fast)
1580 .ReadSChar( nByteDummy ).ReadSChar( nByteDummy ).ReadSChar( nByteDummy );
1581
1582 switch ( nTransitionType )
1583 {
1585 {
1586 if ( nDirection == 0 )
1587 pPage->SetFadeEffect( css::presentation::FadeEffect_VERTICAL_STRIPES ); // fade vertical
1588 else if ( nDirection == 1 )
1589 pPage->SetFadeEffect( css::presentation::FadeEffect_HORIZONTAL_STRIPES ); // fade horizontal
1590 }
1591 break;
1593 {
1594 if ( nDirection == 0 )
1595 pPage->SetFadeEffect( css::presentation::FadeEffect_HORIZONTAL_CHECKERBOARD ); // fade vertical with offset ??
1596 else if ( nDirection == 1 )
1597 pPage->SetFadeEffect( css::presentation::FadeEffect_VERTICAL_CHECKERBOARD ); // fade horizontal with offset ??
1598 }
1599 break;
1601 {
1602 if ( nDirection == 0 )
1603 pPage->SetFadeEffect( css::presentation::FadeEffect_MOVE_FROM_RIGHT ); // overlay from right
1604 else if ( nDirection == 1 )
1605 pPage->SetFadeEffect( css::presentation::FadeEffect_MOVE_FROM_BOTTOM ); // overlay from bottom
1606 else if ( nDirection == 2 )
1607 pPage->SetFadeEffect( css::presentation::FadeEffect_MOVE_FROM_LEFT ); // overlay from left
1608 else if ( nDirection == 3 )
1609 pPage->SetFadeEffect( css::presentation::FadeEffect_MOVE_FROM_TOP ); // overlay from top
1610 else if ( nDirection == 4 )
1611 pPage->SetFadeEffect( css::presentation::FadeEffect_MOVE_FROM_LOWERRIGHT ); // overlay from bottom right ??
1612 else if ( nDirection == 5 )
1613 pPage->SetFadeEffect( css::presentation::FadeEffect_MOVE_FROM_LOWERLEFT ); // overlay from bottom left ??
1614 else if ( nDirection == 6 )
1615 pPage->SetFadeEffect( css::presentation::FadeEffect_MOVE_FROM_UPPERRIGHT ); // overlay from top right
1616 else if ( nDirection == 7 )
1617 pPage->SetFadeEffect( css::presentation::FadeEffect_MOVE_FROM_UPPERLEFT ); // overlay from top left ??
1618 }
1619 break;
1621 {
1622 if ( nBuildFlags )
1623 {
1624 if ( nDirection == 0 )
1625 pPage->SetFadeEffect( css::presentation::FadeEffect_NONE ); // direct
1626 else if ( nDirection == 1 )
1627 {
1628 pPage->setTransitionType( animations::TransitionType::BARWIPE );
1629 pPage->setTransitionSubtype( animations::TransitionSubType::FADEOVERCOLOR );
1630 pPage->setTransitionFadeColor( 0 );
1631 }
1632 }
1633 else
1634 pPage->setTransitionType( 0 );
1635 }
1636 break;
1638 pPage->SetFadeEffect(css::presentation::FadeEffect_DISSOLVE); // dissolve
1639 break;
1641 {
1642 if ( nDirection == 0 )
1643 pPage->SetFadeEffect( css::presentation::FadeEffect_HORIZONTAL_LINES ); // horizontal lines
1644 else if ( nDirection == 1 )
1645 pPage->SetFadeEffect( css::presentation::FadeEffect_VERTICAL_LINES ); // vertical lines
1646 }
1647 break;
1649 {
1650 if ( nDirection == 0 )
1651 pPage->SetFadeEffect( css::presentation::FadeEffect_OPEN_VERTICAL ); // open horizontal ??
1652 else if ( nDirection == 1 )
1653 pPage->SetFadeEffect( css::presentation::FadeEffect_CLOSE_VERTICAL ); // close horizontal ??
1654 else if ( nDirection == 2 )
1655 pPage->SetFadeEffect( css::presentation::FadeEffect_OPEN_HORIZONTAL ); // open vertical ??
1656 else if ( nDirection == 3 )
1657 pPage->SetFadeEffect( css::presentation::FadeEffect_CLOSE_HORIZONTAL ); // close vertical ??
1658 }
1659 break;
1661 {
1662 if ( nDirection == 4 )
1663 pPage->SetFadeEffect( css::presentation::FadeEffect_FADE_FROM_LOWERRIGHT ); // diagonal to top left
1664 else if ( nDirection == 5 )
1665 pPage->SetFadeEffect( css::presentation::FadeEffect_FADE_FROM_LOWERLEFT ); // diagonal to top right
1666 else if ( nDirection == 6 )
1667 pPage->SetFadeEffect( css::presentation::FadeEffect_FADE_FROM_UPPERRIGHT ); // diagonal to bottom left
1668 else if ( nDirection == 7 )
1669 pPage->SetFadeEffect( css::presentation::FadeEffect_FADE_FROM_UPPERLEFT ); // diagonal to bottom right
1670 }
1671 break;
1673 {
1674 if ( nDirection == 0 )
1675 pPage->SetFadeEffect( css::presentation::FadeEffect_UNCOVER_TO_LEFT ); // uncover to left
1676 else if ( nDirection == 1 )
1677 pPage->SetFadeEffect( css::presentation::FadeEffect_UNCOVER_TO_TOP ); // uncover to top
1678 else if ( nDirection == 2 )
1679 pPage->SetFadeEffect( css::presentation::FadeEffect_UNCOVER_TO_RIGHT ); // uncover to right
1680 else if ( nDirection == 3 )
1681 pPage->SetFadeEffect( css::presentation::FadeEffect_UNCOVER_TO_BOTTOM ); // uncover to bottom
1682 else if ( nDirection == 4 )
1683 pPage->SetFadeEffect( css::presentation::FadeEffect_UNCOVER_TO_UPPERLEFT ); // uncover to top left
1684 else if ( nDirection == 5 )
1685 pPage->SetFadeEffect( css::presentation::FadeEffect_UNCOVER_TO_UPPERRIGHT ); // uncover to top right
1686 else if ( nDirection == 6 )
1687 pPage->SetFadeEffect( css::presentation::FadeEffect_UNCOVER_TO_LOWERLEFT ); // uncover to bottom left
1688 else if ( nDirection == 7 )
1689 pPage->SetFadeEffect( css::presentation::FadeEffect_UNCOVER_TO_LOWERRIGHT ); // uncover to bottom right
1690 }
1691 break;
1693 {
1694 if ( nDirection == 0 )
1695 pPage->SetFadeEffect( css::presentation::FadeEffect_FADE_FROM_RIGHT ); // roll from right
1696 else if ( nDirection == 1 )
1697 pPage->SetFadeEffect( css::presentation::FadeEffect_FADE_FROM_BOTTOM ); // roll from bottom
1698 else if ( nDirection == 2 )
1699 pPage->SetFadeEffect( css::presentation::FadeEffect_FADE_FROM_LEFT ); // roll from left
1700 else if ( nDirection == 3 )
1701 pPage->SetFadeEffect( css::presentation::FadeEffect_FADE_FROM_TOP ); // roll from top
1702 }
1703 break;
1705 pPage->SetFadeEffect( css::presentation::FadeEffect_RANDOM ); // automatic
1706 break;
1708 {
1709 pPage->setTransitionType( animations::TransitionType::FADE );
1710 pPage->setTransitionSubtype( animations::TransitionSubType::FADEOVERCOLOR );
1711 pPage->setTransitionFadeColor( 0 );
1712 }
1713 break;
1715 {
1716 if ( nDirection == 0 )
1717 pPage->SetFadeEffect( css::presentation::FadeEffect_FADE_FROM_CENTER ); // fade from center
1718 else if ( nDirection == 1 )
1719 pPage->SetFadeEffect( css::presentation::FadeEffect_FADE_TO_CENTER ); // fade from the outside
1720 }
1721 break;
1723 {
1724 pPage->setTransitionType( animations::TransitionType::IRISWIPE );
1725 pPage->setTransitionSubtype( animations::TransitionSubType::DIAMOND );
1726 }
1727 break;
1729 {
1730 pPage->setTransitionType( animations::TransitionType::FOURBOXWIPE );
1731 pPage->setTransitionSubtype( animations::TransitionSubType::CORNERSOUT );
1732 }
1733 break;
1735 {
1736 pPage->setTransitionType( animations::TransitionType::ELLIPSEWIPE );
1737 pPage->setTransitionSubtype( animations::TransitionSubType::CIRCLE );
1738 }
1739 break;
1741 {
1742 pPage->setTransitionType( animations::TransitionType::FANWIPE );
1743 pPage->setTransitionSubtype( animations::TransitionSubType::CENTERTOP );
1744 }
1745 break;
1747 {
1748 pPage->setTransitionType( animations::TransitionType::PINWHEELWIPE );
1749 sal_Int16 nSubType;
1750 switch( nDirection )
1751 {
1752 default:
1753 case 1 : nSubType = animations::TransitionSubType::ONEBLADE; break;
1754 case 2 : nSubType = animations::TransitionSubType::TWOBLADEVERTICAL; break;
1755 case 3 : nSubType = animations::TransitionSubType::THREEBLADE; break;
1756 case 4 : nSubType = animations::TransitionSubType::FOURBLADE; break;
1757 case 8 : nSubType = animations::TransitionSubType::EIGHTBLADE; break;
1758 }
1759 pPage->setTransitionSubtype( nSubType );
1760 }
1761 break;
1763 {
1764 pPage->setTransitionType( animations::TransitionType::PUSHWIPE );
1765 sal_Int16 nSubType;
1766 switch( nDirection )
1767 {
1768 default:
1769 case 0 : nSubType = animations::TransitionSubType::FROMRIGHT; break;
1770 case 1 : nSubType = animations::TransitionSubType::FROMBOTTOM; break;
1771 case 2 : nSubType = animations::TransitionSubType::FROMLEFT; break;
1772 case 3 : nSubType = animations::TransitionSubType::FROMTOP; break;
1773 }
1774 pPage->setTransitionSubtype( nSubType );
1775 }
1776 break;
1778 {
1779 pPage->setTransitionType( animations::TransitionType::PUSHWIPE );
1780 pPage->setTransitionSubtype( nDirection ? animations::TransitionSubType::COMBVERTICAL : animations::TransitionSubType::COMBHORIZONTAL );
1781 }
1782 break;
1784 {
1785 pPage->setTransitionType( animations::TransitionType::ZOOM );
1786 pPage->setTransitionSubtype( animations::TransitionSubType::ROTATEIN );
1787 }
1788 break;
1790 {
1791 pPage->setTransitionType( animations::TransitionType::FADE );
1792 pPage->setTransitionSubtype( animations::TransitionSubType::CROSSFADE );
1793 }
1794 break;
1795 }
1796
1797 if ( nSpeed == 0 )
1798 pPage->setTransitionDuration( 1.0 ); // slow
1799 else if ( nSpeed == 1 )
1800 pPage->setTransitionDuration( 0.75 ); // medium
1801 else if ( nSpeed == 2 )
1802 pPage->setTransitionDuration( 0.5 ); // fast
1803
1804 if ( nBuildFlags & 0x400 ) // slidechange by time
1805 { // time to show (in Ticks)
1807 pPage->SetTime( nSlideTime / 1000.0 );
1808 }
1809 else
1810 pPage->SetPresChange( mePresChange );
1811
1812 if ( nBuildFlags & 4 )
1813 pPage->SetExcluded( true ); // don't show slide
1814 if ( nBuildFlags & 16 )
1815 { // slide with sound effect
1816 pPage->SetSound( true );
1817 OUString aSoundFile( ReadSound( nSoundRef ) );
1818 pPage->SetSoundFile( aSoundFile );
1819 }
1820 if ( nBuildFlags & ( 1 << 6 ) ) // Loop until next sound
1821 pPage->SetLoopSound( true );
1822 if ( nBuildFlags & ( 1 << 8 ) ) // Stop the previous sound
1823 pPage->SetStopSound( true );
1824 break;
1825 }
1826 }
1827 }
1828 if (!aHd.SeekToEndOfRecord(rStCtrl))
1829 break;
1830 }
1831 if ( bTryTwice && !bSSSlideInfoAtom )
1832 {
1833 bTryTwice = false;
1835 {
1836 sal_uInt16 nMasterNum = GetMasterPageIndex( m_nCurrentPageNum, m_eCurrentPageKind );
1838 if ( pPageList && ( nMasterNum < pPageList->size() ) )
1839 {
1840 assert( !pPageList->is_null( nMasterNum ) );
1841 const PptSlidePersistEntry& rE = (*pPageList)[ nMasterNum ];
1842 sal_uInt32 nOfs = rE.aPersistAtom.nReserved;
1843 if ( nOfs )
1844 {
1845 rStCtrl.Seek( nOfs );
1846 nPageRecEnd = nOfs + 16;
1847 continue;
1848 }
1849 }
1850
1851 }
1852 }
1853 break;
1854 }
1855 }
1856 }
1857
1858 if ( !bNewAnimationsUsed )
1859 {
1860 std::vector< std::pair< SdrObject*, Ppt97AnimationPtr > > aAnimationsOnThisPage;
1861
1862 // add effects from page in correct order
1863 SdrObjListIter aSdrIter( pPage, SdrIterMode::Flat );
1864 while ( aSdrIter.IsMore() )
1865 {
1866 SdrObject* pObj = aSdrIter.Next();
1867 tAnimationMap::iterator aFound = maAnimations.find( pObj );
1868 if( aFound != maAnimations.end() )
1869 {
1870 std::pair< SdrObject*, Ppt97AnimationPtr > aPair( (*aFound).first, (*aFound).second );
1871 aAnimationsOnThisPage.push_back( aPair );
1872 }
1873 }
1874
1875 std::sort( aAnimationsOnThisPage.begin(), aAnimationsOnThisPage.end(), Ppt97AnimationStlSortHelper() );
1876
1877 for( auto& rEntry : aAnimationsOnThisPage )
1878 {
1879 Ppt97AnimationPtr pPpt97Animation = rEntry.second;
1880 if( pPpt97Animation )
1881 pPpt97Animation->createAndSetCustomAnimationEffect( rEntry.first );
1882 }
1883 }
1884 rStCtrl.Seek( nOldFilePos );
1885}
1886
1887// import of sounds
1888
1889// Not only the sounds are imported as string, they are also inserted to
1890// the gallery if they are not already there.
1891OUString ImplSdPPTImport::ReadSound(sal_uInt32 nSoundRef) const
1892{
1893 OUString aRetval;
1894 sal_uInt32 nOldPos = rStCtrl.Tell();
1895 DffRecordHeader aDocHd;
1896 if ( SeekToDocument( &aDocHd ) )
1897 {
1898 sal_uInt32 nSoundLen = aDocHd.GetRecEndFilePos();
1899 DffRecordHeader aSoundBlockRecHd;
1900 if( SeekToRec( rStCtrl, PPT_PST_SoundCollection, nSoundLen, &aSoundBlockRecHd ) )
1901 {
1902 sal_uInt32 nDataLen = aSoundBlockRecHd.GetRecEndFilePos();
1903 DffRecordHeader aSoundRecHd;
1904 bool bRefStrValid = false;
1905 bool bDone = false;
1906
1907 while( !bDone && SeekToRec( rStCtrl, PPT_PST_Sound, nDataLen, &aSoundRecHd ) )
1908 {
1909 sal_uInt32 nStrLen = aSoundRecHd.GetRecEndFilePos();
1910 OUString aRefStr;
1911 sal_uInt32 nOldPos2 = rStCtrl.Tell();
1912 if ( SeekToRec( rStCtrl, PPT_PST_CString, nStrLen, nullptr, 2 ) )
1913 {
1914 if ( ReadString( aRefStr ) )
1915 bRefStrValid = true;
1916 }
1917 if ( bRefStrValid )
1918 {
1919 if ( std::u16string_view(OUString::number(nSoundRef)) == aRefStr )
1920 {
1921 rStCtrl.Seek( nOldPos2 );
1922 if ( SeekToRec( rStCtrl, PPT_PST_CString, nStrLen ) )
1923 {
1924 ReadString( aRetval );
1925 bDone = true;
1926 }
1927 }
1928 }
1929 if ( bDone )
1930 {
1931 // Check if this sound file already exists.
1932 // If not, it is exported to our local sound directory.
1933 bool bSoundExists = false;
1934 ::std::vector< OUString > aSoundList;
1935
1938
1939 for( size_t n = 0; ( n < aSoundList.size() ) && !bSoundExists; ++n )
1940 {
1941 INetURLObject aURL( aSoundList[ n ] );
1942
1943 if (aURL.GetLastName() == aRetval)
1944 {
1945 aRetval = aSoundList[ n ];
1946 bSoundExists = true;
1947 }
1948 }
1949
1950 aSoundList.clear();
1951
1952 if ( !bSoundExists )
1953 {
1954 rStCtrl.Seek( nOldPos2 );
1955 DffRecordHeader aSoundDataRecHd;
1956 if ( SeekToRec( rStCtrl, PPT_PST_SoundData, nStrLen, &aSoundDataRecHd ) )
1957 {
1958 OUString aGalleryDir;
1960 osl_getTempDirURL(&aGalleryDir.pData);
1961 else
1962 aGalleryDir = SvtPathOptions().GetGalleryPath();
1963 // Use last token delimited by ';'. copy(lastIndexOf+1) works whether
1964 // string is empty or not and whether ';' is there or not.
1965 INetURLObject aGalleryUserSound( aGalleryDir.subView(aGalleryDir.lastIndexOf(';')+1) );
1966
1967 aGalleryUserSound.Append( aRetval );
1968 const auto nRemainingSize = rStCtrl.remainingSize();
1969 sal_uInt32 nSoundDataLen = aSoundDataRecHd.nRecLen;
1970 if (nSoundDataLen > nRemainingSize)
1971 {
1972 SAL_WARN("filter.ms", "sound data len longer than remaining stream size");
1973 nSoundDataLen = nRemainingSize;
1974 }
1975 std::vector<sal_uInt8> aBuf(nSoundDataLen);
1976
1977 rStCtrl.ReadBytes(aBuf.data(), nSoundDataLen);
1978 std::unique_ptr<SvStream> pOStm = ::utl::UcbStreamHelper::CreateStream( aGalleryUserSound.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::WRITE | StreamMode::TRUNC );
1979
1980 if( pOStm )
1981 {
1982 pOStm->WriteBytes(aBuf.data(), nSoundDataLen);
1983
1984 if( pOStm->GetError() == ERRCODE_NONE )
1985 {
1987 aRetval = aGalleryUserSound.GetMainURL( INetURLObject::DecodeMechanism::NONE );
1988 }
1989 }
1990 }
1991 }
1992 }
1993 if ( !bDone )
1994 {
1995 if (!aSoundRecHd.SeekToEndOfRecord(rStCtrl))
1996 break;
1997 }
1998 }
1999 }
2000 }
2001 rStCtrl.Seek( nOldPos );
2002 return aRetval;
2003}
2004
2005// media object import, the return value is the url to the media object
2006OUString ImplSdPPTImport::ReadMedia( sal_uInt32 nMediaRef ) const
2007{
2008 OUString aRetVal;
2010 if ( pHd )
2011 {
2012 pHd->SeekToContent( rStCtrl );
2013 auto nEndRecPos = SanitizeEndPos(rStCtrl, pHd->GetRecEndFilePos());
2014 while ( ( rStCtrl.Tell() < nEndRecPos ) && aRetVal.isEmpty() )
2015 {
2016 DffRecordHeader aHdMovie;
2017 ReadDffRecordHeader( rStCtrl, aHdMovie );
2018 switch( aHdMovie.nRecType )
2019 {
2020 case PPT_PST_ExAviMovie :
2021 case PPT_PST_ExMCIMovie :
2022 {
2023 DffRecordHeader aExVideoHd;
2024 if ( SeekToRec( rStCtrl, PPT_PST_ExVideo, aHdMovie.GetRecEndFilePos(), &aExVideoHd ) )
2025 {
2026 DffRecordHeader aExMediaAtomHd;
2027 if ( SeekToRec( rStCtrl, PPT_PST_ExMediaAtom, aExVideoHd.GetRecEndFilePos(), &aExMediaAtomHd ) )
2028 {
2029 sal_uInt32 nRef;
2031 if ( nRef == nMediaRef )
2032 {
2033 aExVideoHd.SeekToContent( rStCtrl );
2034 auto nHdEndRecPos = SanitizeEndPos(rStCtrl, aExVideoHd.GetRecEndFilePos());
2035 while (rStCtrl.Tell() < nHdEndRecPos)
2036 {
2037 DffRecordHeader aHd;
2039 switch( aHd.nRecType )
2040 {
2041 case PPT_PST_CString :
2042 {
2044 OUString aStr;
2045 if ( ReadString( aStr ) )
2046 {
2047 if( osl::FileBase::getFileURLFromSystemPath( aStr, aRetVal )
2048 == osl::FileBase::E_None )
2049 {
2051 }else{
2052 aRetVal = aStr;
2053 }
2054 }
2055 }
2056 break;
2057 }
2058 if (!aHd.SeekToEndOfRecord(rStCtrl))
2059 break;
2060 }
2061 break;
2062 }
2063 }
2064 }
2065 }
2066 break;
2067 }
2068 if (!aHdMovie.SeekToEndOfRecord(rStCtrl))
2069 break;
2070 }
2071 }
2072 return aRetVal;
2073}
2074
2075// import of objects
2076void ImplSdPPTImport::FillSdAnimationInfo(SdAnimationInfo* pInfo, const PptInteractiveInfoAtom& rIAtom, const OUString& rMacroName)
2077{
2078 // set local information into pInfo
2079 if( rIAtom.nSoundRef )
2080 {
2081 pInfo->SetBookmark( ReadSound( rIAtom.nSoundRef ) ); // path to sound file in MS DOS notation
2082 pInfo->meClickAction = css::presentation::ClickAction_SOUND; // RunProgramAction
2083 }
2084
2085 switch ( rIAtom.nAction )
2086 {
2087
2088 case 0x02 : // RunProgramAction
2089 {
2090 pInfo->meClickAction = css::presentation::ClickAction_PROGRAM;
2091 pInfo->SetBookmark(rMacroName); // program name in aBookmark
2092 }
2093 break;
2094 case 0x03 : // JumpAction
2095 {
2096 switch( rIAtom.nJump )
2097 {
2098 case 0x01 :
2099 pInfo->meClickAction = css::presentation::ClickAction_NEXTPAGE; // Next slide
2100 break;
2101 case 0x02 :
2102 pInfo->meClickAction = css::presentation::ClickAction_PREVPAGE; // Previous slide
2103 break;
2104 case 0x03 :
2105 pInfo->meClickAction = css::presentation::ClickAction_FIRSTPAGE; // First slide
2106 break;
2107 case 0x04 :
2108 pInfo->meClickAction = css::presentation::ClickAction_LASTPAGE; // last Slide
2109 break;
2110 case 0x05 :
2111 pInfo->meClickAction = css::presentation::ClickAction_PREVPAGE; // Last slide viewed
2112 break;
2113 case 0x06 :
2114 pInfo->meClickAction = css::presentation::ClickAction_STOPPRESENTATION; // End show
2115 break;
2116 default :
2117 pInfo->meClickAction = css::presentation::ClickAction_NONE; // 0x00: no action, else unknown
2118 break;
2119 }
2120 }
2121 break;
2122 case 0x04 :
2123 {
2124 SdHyperlinkEntry* pPtr = nullptr;
2125 for (SdHyperlinkEntry & entry : m_aHyperList) {
2126 if ( entry.nIndex == rIAtom.nExHyperlinkId ) {
2127 pPtr = &entry;
2128 break;
2129 }
2130 }
2131 if ( pPtr )
2132 {
2133 switch( rIAtom.nHyperlinkType )
2134 {
2135 case 9:
2136 case 8: // hyperlink : URL
2137 {
2138 if ( !pPtr->aTarget.isEmpty() )
2139 {
2140 ::sd::DrawDocShell* pDocShell = mpDoc->GetDocSh();
2141 SfxMedium* pMedium = pDocShell ? pDocShell->GetMedium() : nullptr;
2142 if (pMedium)
2143 {
2144 OUString aBaseURL = pMedium->GetBaseURL();
2145 OUString aBookmarkURL( pInfo->GetBookmark() );
2146 INetURLObject aURL( pPtr->aTarget );
2147 if( INetProtocol::NotValid == aURL.GetProtocol()
2148 && (osl::FileBase::getFileURLFromSystemPath(
2149 pPtr->aTarget, aBookmarkURL)
2150 != osl::FileBase::E_None) )
2151 aBookmarkURL.clear();
2152 if( aBookmarkURL.isEmpty() )
2153 aBookmarkURL = URIHelper::SmartRel2Abs( INetURLObject(aBaseURL), pPtr->aTarget, URIHelper::GetMaybeFileHdl() );
2154 pInfo->SetBookmark( aBookmarkURL );
2155 pInfo->meClickAction = css::presentation::ClickAction_PROGRAM;
2156 }
2157 }
2158 }
2159 break;
2160
2161 case 10:
2162 break;
2163
2164 case 7: // hyperlink to a page
2165 {
2166 if ( !pPtr->aConvSubString.isEmpty() )
2167 {
2168 pInfo->meClickAction = css::presentation::ClickAction_BOOKMARK;
2169 pInfo->SetBookmark( pPtr->aConvSubString );
2170 }
2171 }
2172 break;
2173 }
2174 }
2175 }
2176 break;
2177 case 0x05 : // OLEAction ( OLEVerb to use, 0==first, 1==second, .. )
2178 case 0x06 : // MediaAction
2179 case 0x07 : // CustomShowAction
2180 default : // 0x00: no action, else unknown action
2181 break;
2182 }
2183}
2184
2186 SfxStyleSheet* pSheet, SfxStyleSheet** ppStyleSheetAry ) const
2187{
2188 SdPage * pPage = static_cast<SdPage *>(pPageCapsule.page);
2189 SfxStyleSheet* pStyleSheetAry[ 9 ];
2190 SdrTextObj* pText = pObj;
2191 SdrObject* pRet = pText;
2192
2193 ppStyleSheetAry = nullptr;
2194
2195 PresObjKind ePresKind = PresObjKind::NONE;
2196 const std::optional<PptOEPlaceholderAtom>& pPlaceHolder = pTextObj->GetOEPlaceHolderAtom();
2197 OUString aPresentationText;
2198 if ( pPlaceHolder )
2199 {
2200 switch( pPlaceHolder->nPlaceholderId )
2201 {
2202 case PptPlaceholder::MASTERNOTESSLIDEIMAGE :
2203 case PptPlaceholder::MASTERCENTEREDTITLE :
2204 case PptPlaceholder::MASTERTITLE :
2205 {
2206 ePresKind = PresObjKind::Title;
2207 aPresentationText = pPage->GetPresObjText( ePresKind );
2208 }
2209 break;
2210 case PptPlaceholder::MASTERBODY :
2211 {
2212 ePresKind = PresObjKind::Outline;
2213 aPresentationText = pPage->GetPresObjText( ePresKind );
2214 }
2215 break;
2216 case PptPlaceholder::MASTERSUBTITLE :
2217 {
2218 ePresKind = PresObjKind::Text;
2219 aPresentationText = pPage->GetPresObjText( ePresKind );
2220 }
2221 break;
2222 case PptPlaceholder::MASTERNOTESBODYIMAGE :
2223 {
2224 ePresKind = PresObjKind::Notes;
2225 aPresentationText = pPage->GetPresObjText( ePresKind );
2226 }
2227 break;
2228 case PptPlaceholder::MASTERDATE : ePresKind = PresObjKind::DateTime; break;
2229 case PptPlaceholder::MASTERSLIDENUMBER : ePresKind = PresObjKind::SlideNumber;break;
2230 case PptPlaceholder::MASTERFOOTER : ePresKind = PresObjKind::Footer; break;
2231 case PptPlaceholder::MASTERHEADER : ePresKind = PresObjKind::Header; break;
2232 default: break;
2233 }
2234 }
2235 switch ( pTextObj->GetDestinationInstance() )
2236 {
2237 case TSS_Type::PageTitle :
2238 case TSS_Type::Title :
2239 {
2241 if ( pSheet )
2242 static_cast<SdrAttrObj*>(pText)->SdrAttrObj::NbcSetStyleSheet( pSheet, true );
2243 DBG_ASSERT( pSheet, "ImplSdPPTImport::ApplyTextObj -> could not get stylesheet for titleobject (SJ)" );
2244 }
2245 break;
2246 case TSS_Type::Subtitle :
2247 {
2248 pSheet = pPage->GetStyleSheetForPresObj( PresObjKind::Text );
2249 if ( pSheet )
2250 static_cast<SdrAttrObj*>(pText)->SdrAttrObj::NbcSetStyleSheet( pSheet, true );
2251 DBG_ASSERT( pSheet, "ImplSdPPTImport::ApplyTextObj -> could not get stylesheet for subtitleobject (SJ)" );
2252 }
2253 break;
2254 case TSS_Type::Body :
2255 case TSS_Type::HalfBody :
2256 case TSS_Type::QuarterBody :
2257 {
2258 for ( sal_uInt16 nLevel = 9; nLevel; nLevel-- )
2259 {
2260 OUString aName = pPage->GetLayoutName() + " " + OUString::number( nLevel );
2261 pSheet = static_cast<SfxStyleSheet*>(mpDoc->GetStyleSheetPool()->Find( aName, SfxStyleFamily::Page ));
2262 if ( pSheet )
2263 pText->StartListening( *pSheet );
2264 pStyleSheetAry[ nLevel - 1 ] = pSheet;
2265 }
2266 DBG_ASSERT( pSheet, "ImplSdPPTImport::ApplyTextObj -> could not get stylesheet for outlinerobject (SJ)" );
2267 if ( pSheet )
2268 static_cast<SdrAttrObj*>(pText)->SdrAttrObj::NbcSetStyleSheet( pSheet, true );
2269 ppStyleSheetAry = &pStyleSheetAry[ 0 ];
2270 }
2271 break;
2272 case TSS_Type::Notes :
2273 {
2274 if ( pPlaceHolder && ( ( pPlaceHolder->nPlaceholderId == PptPlaceholder::NOTESSLIDEIMAGE )
2275 || ( pPlaceHolder->nPlaceholderId == PptPlaceholder::MASTERNOTESSLIDEIMAGE ) ) )
2276 {
2278 if ( pSheet )
2279 static_cast<SdrAttrObj*>(pText)->SdrAttrObj::NbcSetStyleSheet( pSheet, true );
2280 DBG_ASSERT( pSheet, "ImplSdPPTImport::ApplyTextObj -> could not get stylesheet for titleobject (SJ)" );
2281 }
2282 else
2283 {
2285 DBG_ASSERT( pSheet, "ImplSdPPTImport::ApplyTextObj -> could not get stylesheet for notesobj (SJ)" );
2286 if ( pSheet )
2287 static_cast<SdrAttrObj*>(pText)->SdrAttrObj::NbcSetStyleSheet( pSheet, true );
2288 }
2289 }
2290 break;
2291 case TSS_Type::Unused :
2292 case TSS_Type::TextInShape :
2293 {
2294 switch( ePresKind )
2295 {
2298 case PresObjKind::Footer :
2299 case PresObjKind::Header :
2300 pSheet = static_cast<SfxStyleSheet*>(mpDoc->GetStyleSheetPool()->Find(SdResId(STR_PSEUDOSHEET_BACKGROUNDOBJECTS), SfxStyleFamily::Pseudo ));
2301 break;
2302 default :
2303 pSheet = static_cast<SfxStyleSheet*>(mpDoc->GetStyleSheetPool()->Find(SdResId(STR_STANDARD_STYLESHEET_NAME), SfxStyleFamily::Para ));
2304 }
2305 }
2306 break;
2307 default: break;
2308 }
2309
2310 pText = static_cast<SdrTextObj*>(SdrPowerPointImport::ApplyTextObj( pTextObj, pText, pPageCapsule, pSheet, ppStyleSheetAry ));
2311
2312 if ( pPlaceHolder && pPlaceHolder->nPlaceholderId != PptPlaceholder::NONE )
2313 {
2315 {
2316 bool bCreatePlaceHolder = ( pTextObj->GetInstance() != TSS_Type::Unused );
2317 bool bIsHeaderFooter = ( ePresKind == PresObjKind::Header) || (ePresKind == PresObjKind::Footer)
2318 || (ePresKind == PresObjKind::DateTime) || (ePresKind == PresObjKind::SlideNumber);
2319 if ( bCreatePlaceHolder && ( pTextObj->GetInstance() == TSS_Type::TextInShape ) )
2320 bCreatePlaceHolder = bIsHeaderFooter;
2321 if ( bCreatePlaceHolder )
2322 {
2323 if ( !bIsHeaderFooter )
2324 {
2325 pText->SetNotVisibleAsMaster( true );
2326 pText->SetEmptyPresObj( true );
2327 }
2328 pText->SetUserCall( pPage );
2329 pPage->InsertPresObj( pText, ePresKind );
2330 SdrOutliner* pOutl = nullptr;
2331 if ( pTextObj->GetInstance() == TSS_Type::Notes )
2332 pOutl = GetDrawOutliner( pText );
2333 if ( !aPresentationText.isEmpty() )
2334 pPage->SetObjText( pText, pOutl, ePresKind, aPresentationText );
2335
2336 if ( pPage->GetPageKind() != PageKind::Notes && pPage->GetPageKind() != PageKind::Handout)
2337 {
2338 SfxStyleSheet* pSheet2( pPage->GetStyleSheetForPresObj( ePresKind ) );
2339 if ( pSheet2 )
2340 {
2341 SfxItemSet& rItemSet = pSheet2->GetItemSet();
2342 rItemSet.Put( pText->GetMergedItem( SDRATTR_TEXT_LEFTDIST ) );
2343 rItemSet.Put( pText->GetMergedItem( SDRATTR_TEXT_RIGHTDIST ) );
2344 rItemSet.Put( pText->GetMergedItem( SDRATTR_TEXT_UPPERDIST ) );
2345 rItemSet.Put( pText->GetMergedItem( SDRATTR_TEXT_LOWERDIST ) );
2346 rItemSet.Put( pText->GetMergedItem( SDRATTR_TEXT_VERTADJUST ) );
2347 rItemSet.Put( pText->GetMergedItem( SDRATTR_TEXT_HORZADJUST ) );
2348 if ( pTextObj->GetInstance() == TSS_Type::Title
2349 || pTextObj->GetInstance() == TSS_Type::Subtitle)
2350 {
2351 rItemSet.Put( pText->GetMergedItemSet() );
2352 }
2353 }
2354 }
2355
2356 SfxItemSet aTempAttr( mpDoc->GetPool() );
2358 aTempAttr.Put( aMinHeight );
2359 SdrOnOffItem aAutoGrowHeight( makeSdrTextAutoGrowHeightItem(false) );
2360 aTempAttr.Put( aAutoGrowHeight );
2361 pText->SetMergedItemSet(aTempAttr);
2362 }
2363 else
2364 {
2365 pRet = nullptr;
2366 }
2367 }
2368 else
2369 {
2370 const PptSlideLayoutAtom* pSlideLayout = GetSlideLayoutAtom();
2371 if ( pSlideLayout || ( m_eCurrentPageKind == PPT_NOTEPAGE ) )
2372 {
2373 sal_uInt32 nPlacementId = pPlaceHolder->nPlacementId;
2374 PptPlaceholder nPlaceholderId = pPlaceHolder->nPlaceholderId;
2375 PresObjKind ePresObjKind = PresObjKind::NONE;
2376 bool bEmptyPresObj = true;
2377 bool bVertical = false;
2378 if ( ( pTextObj->GetShapeType() == mso_sptRectangle ) || ( pTextObj->GetShapeType() == mso_sptTextBox ) )
2379 {
2380 //if a placeholder with some custom attribute,the pTextObj will keep those attr,whose text size is zero,
2381 //so sdPage should renew a PresObj to process placeholder.
2382 bEmptyPresObj = ( pTextObj->Count() == 0 ) || ( pTextObj->Count() == 1 && pTextObj->First()->GetTextSize() == 0 );
2383 switch ( nPlaceholderId )
2384 {
2385 case PptPlaceholder::NOTESBODY : ePresObjKind = PresObjKind::Notes; break;
2386 case PptPlaceholder::VERTICALTEXTTITLE :
2387 bVertical = true;
2388 [[fallthrough]];
2389 case PptPlaceholder::TITLE : ePresObjKind = PresObjKind::Title; break;
2390 case PptPlaceholder::VERTICALTEXTBODY :
2391 bVertical = true;
2392 [[fallthrough]];
2393 case PptPlaceholder::BODY : ePresObjKind = PresObjKind::Outline; break;
2394 case PptPlaceholder::CENTEREDTITLE : ePresObjKind = PresObjKind::Title; break;
2395 case PptPlaceholder::SUBTITLE : ePresObjKind = PresObjKind::Text; break; // PresObjKind::Outline
2396
2397 default :
2398 {
2399 if ( pTextObj->Count() == 0 )
2400 {
2401 switch ( nPlaceholderId )
2402 {
2403 case PptPlaceholder::MEDIACLIP :
2404 case PptPlaceholder::OBJECT : ePresObjKind = PresObjKind::Object; break;
2405 case PptPlaceholder::GRAPH : ePresObjKind = PresObjKind::Chart; break;
2406 case PptPlaceholder::TABLE : ePresObjKind = PresObjKind::Table; break;
2407 case PptPlaceholder::CLIPART : ePresObjKind = PresObjKind::Graphic; break;
2408 case PptPlaceholder::ORGANISZATIONCHART : ePresObjKind = PresObjKind::OrgChart; break;
2409 default: break;
2410 }
2411 }
2412 };
2413 }
2414 }
2415 else if ( pTextObj->GetShapeType() == mso_sptPictureFrame )
2416 {
2417 if ( !pTextObj->Count() && dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr )
2418 {
2419 bEmptyPresObj = false;
2420 switch ( nPlaceholderId )
2421 {
2422 case PptPlaceholder::MEDIACLIP :
2423 case PptPlaceholder::OBJECT : ePresObjKind = PresObjKind::Object; break;
2424 case PptPlaceholder::GRAPH : ePresObjKind = PresObjKind::Chart; break;
2425 case PptPlaceholder::TABLE : ePresObjKind = PresObjKind::Calc; break;
2426 case PptPlaceholder::CLIPART : ePresObjKind = PresObjKind::Graphic; break;
2427 case PptPlaceholder::ORGANISZATIONCHART : ePresObjKind = PresObjKind::OrgChart; break;
2428 default: break;
2429 }
2430 }
2431 }
2432 if ( ePresObjKind != PresObjKind::NONE )
2433 {
2434 if ( !bEmptyPresObj )
2435 {
2436 pPage->InsertPresObj( pRet, ePresObjKind );
2437 }
2438 else
2439 {
2440 SdrObject* pPresObj = pPage->CreatePresObj( ePresObjKind, bVertical, pText->GetLogicRect() );
2441 pPresObj->SetUserCall( pPage );
2442
2443 SfxItemSet aSet( pSdrModel->GetItemPool() );
2444 ApplyAttributes( rStCtrl, aSet );
2445 pPresObj->SetLogicRect(pText->GetLogicRect());
2446 ApplyTextAnchorAttributes( *pTextObj, aSet );
2447 //set custom font attribute of the placeholder
2448 if ( pTextObj->Count() == 1 )
2449 {
2450 PPTParagraphObj* pPara = pTextObj->First();
2451 if ( pPara && pPara->GetTextSize() == 0 )
2452 {
2453 if ( PPTPortionObj * pPor = pPara->First() )
2454 {
2455 pPor->ApplyTo(aSet, const_cast<SdrPowerPointImport&>(static_cast<SdrPowerPointImport const &>(*this)), pTextObj->GetDestinationInstance());
2456 }
2457 }
2458 }
2459 pPresObj->SetMergedItemSet(aSet);
2460
2461 if ((m_eCurrentPageKind != PPT_NOTEPAGE) && (nPlacementId != 0xffffffff) && pPage->TRG_HasMasterPage())
2462 {
2463 SdrObject* pTitleObj = static_cast<SdPage&>(pPage->TRG_GetMasterPage()).GetPresObj( PresObjKind::Title );
2464 SdrObject* pOutlineObj = static_cast<SdPage&>(pPage->TRG_GetMasterPage()).GetPresObj( PresObjKind::Outline );
2465
2466 ::tools::Rectangle aTitleRect;
2467 ::tools::Rectangle aOutlineRect;
2468 Size aOutlineSize;
2469
2470 if ( pTitleObj )
2471 aTitleRect = pTitleObj->GetLogicRect();
2472 if ( pOutlineObj )
2473 {
2474 aOutlineRect = pOutlineObj->GetLogicRect();
2475 aOutlineSize = aOutlineRect.GetSize();
2476 }
2477 ::tools::Rectangle aLogicRect( pPresObj->GetLogicRect() );
2478 Size aLogicSize( aLogicRect.GetSize() );
2479
2480 switch ( nPlacementId )
2481 {
2482 case 0 : // position in title area
2483 {
2484 if ( aLogicRect != aTitleRect )
2485 pPresObj->SetUserCall( nullptr );
2486 }
2487 break;
2488
2489 case 1:
2490 {
2491 if ( pSlideLayout->eLayout == PptSlideLayout::TITLEANDBODYSLIDE )
2492 { // position in outline area
2493 if ( aLogicRect != aOutlineRect )
2494 pPresObj->SetUserCall( nullptr );
2495 }
2496 else if ( pSlideLayout->eLayout == PptSlideLayout::TWOCOLUMNSANDTITLE )
2497 { // position in outline area left
2498 if (std::abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE ||
2499 std::abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE ||
2500 std::abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE ||
2501 aOutlineSize.Width() == 0 ||
2502 static_cast<double>(aLogicSize.Width()) / aOutlineSize.Width() < 0.48 ||
2503 static_cast<double>(aLogicSize.Width()) / aOutlineSize.Width() > 0.5)
2504 {
2505 pPresObj->SetUserCall(nullptr);
2506 }
2507 }
2508 else if ( pSlideLayout->eLayout == PptSlideLayout::TWOROWSANDTITLE )
2509 { // position in outline area top
2510 if (std::abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE ||
2511 std::abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE ||
2512 std::abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE)
2513 {
2514 pPresObj->SetUserCall( nullptr );
2515 }
2516 }
2517 else if (std::abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE ||
2518 std::abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE)
2519 { // position in outline area top left
2520 pPresObj->SetUserCall( nullptr );
2521 }
2522 }
2523 break;
2524
2525 case 2:
2526 {
2527 if ( pSlideLayout->eLayout == PptSlideLayout::TWOCOLUMNSANDTITLE )
2528 { // position in outline area right
2529 if (std::abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE ||
2530 std::abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE ||
2531 std::abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE ||
2532 aOutlineSize.Width() == 0 ||
2533 static_cast<double>(aLogicSize.Width()) / aOutlineSize.Width() < 0.48 ||
2534 static_cast<double>(aLogicSize.Width()) / aOutlineSize.Width() > 0.5)
2535 {
2536 pPresObj->SetUserCall( nullptr );
2537 }
2538 }
2539 else if ( pSlideLayout->eLayout == PptSlideLayout::TWOROWSANDTITLE )
2540 { // position in outline area bottom
2541 if (std::abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE ||
2542 std::abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE ||
2543 std::abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE)
2544 {
2545 pPresObj->SetUserCall( nullptr );
2546 }
2547 }
2548 else if (std::abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE ||
2549 std::abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE)
2550 { // position in outline area top right
2551 pPresObj->SetUserCall(nullptr);
2552 }
2553 }
2554 break;
2555
2556 case 3:
2557 { // position in outline area bottom left
2558 if (std::abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE ||
2559 std::abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE)
2560 {
2561 pPresObj->SetUserCall( nullptr );
2562 }
2563 }
2564 break;
2565
2566 case 4:
2567 { // position in outline area bottom right
2568 if (std::abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE ||
2569 std::abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE)
2570 {
2571 pObj->SetUserCall( nullptr );
2572 }
2573 }
2574 break;
2575 }
2576 }
2577 pRet = nullptr; // return zero cause this obj was already inserted by CreatePresObj
2578 }
2579 }
2580 else if ( !pTextObj->Count() )
2581 pRet = nullptr;
2582 }
2583 }
2584 }
2585 return pRet;
2586}
2587
2589{
2590 rtl::Reference<SdrObject> pObj = SdrPowerPointImport::ProcessObj( rSt, rData, rClientData, rTextRect, pRet );
2591
2592 // read animation effect of object
2593 if ( pObj )
2594 {
2595 // further setup placeholder objects
2596 if (dynamic_cast<const SdrPageObj*>(pObj.get()))
2597 {
2598 const ProcessData& rProcessData=static_cast<const ProcessData&>(rClientData);
2599 if(rProcessData.pPage.page)
2600 static_cast<SdPage *>(rProcessData.pPage.page)->InsertPresObj(
2601 pObj.get(), PresObjKind::Page );
2602 }
2603
2604 DffRecordHeader aMasterShapeHd;
2605
2607 {
2608 bool bInhabitanceChecked = false;
2609 bool bAnimationInfoFound = false;
2610
2611 DffRecordHeader& rHdClientData = *maShapeRecords.Current();
2612 while( true )
2613 {
2614 sal_uInt32 nClientDataLen = SanitizeEndPos(rSt, rHdClientData.GetRecEndFilePos());
2615 DffRecordHeader aHd;
2616 do
2617 {
2618 ReadDffRecordHeader( rSt, aHd );
2619 sal_uInt32 nHdRecEnd = aHd.GetRecEndFilePos();
2620 switch ( aHd.nRecType )
2621 {
2623 {
2624 DffRecordHeader aHdAnimInfoAtom;
2625 if ( SeekToRec( rSt, PPT_PST_AnimationInfoAtom, nHdRecEnd, &aHdAnimInfoAtom ) )
2626 {
2627 // read data from stream
2628 Ppt97AnimationPtr pAnimation = std::make_shared<Ppt97Animation>( rSt );
2629 // store animation information
2630 if( pAnimation->HasEffect() )
2631 {
2632 // translate color to RGB
2633 pAnimation->SetDimColor( MSO_CLR_ToColor(pAnimation->GetDimColor()) );
2634 // translate sound bits to file url
2635 if( pAnimation->HasSoundEffect() )
2636 pAnimation->SetSoundFileUrl( ReadSound( pAnimation->GetSoundRef() ) );
2637
2638 bool bDontAnimateInvisibleShape = false;
2639 {
2640 SdrTextObj* pTextObj = DynCastSdrTextObj(pObj.get());
2641
2642 if( pTextObj && pTextObj->HasText() &&
2643 dynamic_cast< SdrObjGroup *>( pObj.get() ) == nullptr &&
2644 pAnimation->HasAnimateAssociatedShape() )
2645 {
2646 const SfxItemSet& rObjItemSet = pObj->GetMergedItemSet();
2647
2648 drawing::FillStyle eFillStyle = rObjItemSet.Get(XATTR_FILLSTYLE).GetValue();
2649 drawing::LineStyle eLineStyle = rObjItemSet.Get(XATTR_LINESTYLE).GetValue();
2650
2651 if ( ( eFillStyle == drawing::FillStyle_NONE ) && ( eLineStyle == drawing::LineStyle_NONE ) )
2652 bDontAnimateInvisibleShape = true;
2653 }
2654 }
2655 if( bDontAnimateInvisibleShape )
2656 pAnimation->SetAnimateAssociatedShape(false);
2657
2658 //maybe some actions necessary to ensure that animations on master pages are played before animations on normal pages
2659 //maybe todo in future: bool bIsEffectOnMasterPage = !bInhabitanceChecked;?
2660
2661 maAnimations[pObj.get()] = pAnimation;
2662
2663 bAnimationInfoFound = true;
2664 }
2665 }
2666 }
2667 break;
2669 {
2670 sal_uInt32 nOldFilePos2 = rSt.Tell();
2671 OUString aMacroName;
2672
2673 if(SeekToRec( rSt, PPT_PST_CString, nHdRecEnd ) )
2674 ReadString(aMacroName);
2675
2676 rSt.Seek( nOldFilePos2 );
2677 DffRecordHeader aHdInteractiveInfoAtom;
2678 if ( SeekToRec( rSt, PPT_PST_InteractiveInfoAtom, nHdRecEnd, &aHdInteractiveInfoAtom ) )
2679 {
2680 PptInteractiveInfoAtom aInteractiveInfoAtom;
2681 if (ReadPptInteractiveInfoAtom(rSt, aInteractiveInfoAtom))
2682 {
2683 // interactive object
2685
2686 FillSdAnimationInfo(pInfo, aInteractiveInfoAtom, aMacroName);
2687 if ( aInteractiveInfoAtom.nAction == 6 ) // Sj -> media action
2688 {
2689 rHdClientData.SeekToContent( rStCtrl );
2690 DffRecordHeader aObjRefAtomHd;
2691 if ( SeekToRec( rSt, PPT_PST_ExObjRefAtom, nHdRecEnd, &aObjRefAtomHd ) )
2692 {
2693 sal_uInt32 nRef;
2694 rSt.ReadUInt32( nRef );
2695 OUString aMediaURL( ReadMedia( nRef ) );
2696 if ( aMediaURL.isEmpty() )
2697 aMediaURL = ReadSound( nRef );
2698 if ( !aMediaURL.isEmpty() )
2699 {
2701 pObj->getSdrModelFromSdrObject(),
2702 pObj->GetSnapRect());
2703 pMediaObj->SetMergedItemSet( pObj->GetMergedItemSet() );
2704
2705 //--remove object from maAnimations list and add the new object instead
2706 Ppt97AnimationPtr pAnimation;
2707 {
2708 tAnimationMap::iterator aFound = maAnimations.find( pObj.get() );
2709 if( aFound != maAnimations.end() )
2710 {
2711 pAnimation = (*aFound).second;
2712 maAnimations.erase(aFound);
2713 }
2714 maAnimations[pMediaObj.get()] = pAnimation;
2715 }
2716
2717 pObj = pMediaObj; // SJ: hoping that pObj is not inserted in any list
2718 pMediaObj->setURL( aMediaURL, ""/*TODO?*/ );
2719 }
2720 }
2721 }
2722 }
2723 }
2724 }
2725 break;
2726 }
2727 if (!aHd.SeekToEndOfRecord(rSt))
2728 break;
2729 }
2730 while( ( rSt.GetError() == ERRCODE_NONE ) && ( rSt.Tell() < nClientDataLen ) );
2731
2732 if ( bInhabitanceChecked || bAnimationInfoFound )
2733 break;
2734 bInhabitanceChecked = true;
2735 if ( ! ( IsProperty( DFF_Prop_hspMaster ) && SeekToShape( rSt, &rClientData, GetPropertyValue( DFF_Prop_hspMaster, 0 ) ) ) )
2736 break;
2737 ReadDffRecordHeader( rSt, aMasterShapeHd );
2738 if ( !SeekToRec( rSt, DFF_msofbtClientData, aMasterShapeHd.GetRecEndFilePos(), &aMasterShapeHd ) )
2739 break;
2740 aMasterShapeHd.SeekToContent( rSt );
2741 rHdClientData = aMasterShapeHd;
2742 }
2743 }
2744 }
2745 return pObj;
2746}
2747
2748bool
2749ImplSdPPTImport::ReadFormControl( tools::SvRef<SotStorage>& rSrc1, css::uno::Reference< css::form::XFormComponent > & rFormComp ) const
2750{
2751 uno::Reference< frame::XModel > xModel;
2752 if ( mpDoc->GetDocSh() )
2753 {
2754 xModel = mpDoc->GetDocSh()->GetModel();
2755 oox::ole::MSConvertOCXControls aCtrlImporter( xModel );
2756 return aCtrlImporter.ReadOCXStorage( rSrc1, rFormComp );
2757 }
2758 return false;
2759}
2760
2761// exported function
2762SAL_DLLPUBLIC_EXPORT bool ImportPPT(
2763 SdDrawDocument* pDocument, SvStream& rDocStream, SotStorage& rStorage, SfxMedium& rMedium )
2764{
2765 std::unique_ptr<SdPPTImport> pImport( new SdPPTImport( pDocument, rDocStream, rStorage, rMedium ));
2766 return pImport->Import();
2767}
2768
2769extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportPPT(SvStream &rStream)
2770{
2771 bool bRet = false;
2772 try
2773 {
2774 tools::SvRef<SotStorage> xStorage(new SotStorage(rStream));
2775 if (xStorage->GetError())
2776 return false;
2777
2778 tools::SvRef<SotStorageStream> xDocStream(xStorage->OpenSotStream( "PowerPoint Document", StreamMode::STD_READ));
2779 if ( !xDocStream.is() )
2780 return false;
2781
2782 SdDLL::Init();
2783
2784 SfxMedium aSrcMed("", StreamMode::STD_READ);
2785
2786 xDocStream->SetVersion(xStorage->GetVersion());
2787 xDocStream->SetCryptMaskKey(xStorage->GetKey());
2788
2789 ::sd::DrawDocShellRef xDocShRef = new ::sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false, DocumentType::Impress);
2790 SdDrawDocument *pDoc = xDocShRef->GetDoc();
2791
2792 try
2793 {
2794 bRet = ImportPPT(pDoc, *xDocStream, *xStorage, aSrcMed);
2795 }
2796 catch (...)
2797 {
2798 }
2799
2800 xDocShRef->DoClose();
2801 }
2802 catch (...)
2803 {
2804 }
2805 return bRet;
2806}
2807
2808/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AutoLayout
AUTOLAYOUT_CLIPTEXT
AUTOLAYOUT_TITLE_2CONTENT_OVER_CONTENT
AUTOLAYOUT_TITLE
AUTOLAYOUT_TEXTOBJ
AUTOLAYOUT_TITLE_CONTENT_OVER_CONTENT
AUTOLAYOUT_TITLE_2VTEXT
AUTOLAYOUT_VTITLE_VCONTENT_OVER_VCONTENT
AUTOLAYOUT_VTITLE_VCONTENT
AUTOLAYOUT_TITLE_ONLY
AUTOLAYOUT_TITLE_2CONTENT
AUTOLAYOUT_TAB
AUTOLAYOUT_TITLE_2CONTENT_CONTENT
AUTOLAYOUT_TEXTCHART
AUTOLAYOUT_ORG
AUTOLAYOUT_TITLE_CONTENT_2CONTENT
AUTOLAYOUT_OBJ
AUTOLAYOUT_OBJTEXT
AUTOLAYOUT_NONE
AUTOLAYOUT_CHARTTEXT
AUTOLAYOUT_CHART
AUTOLAYOUT_HANDOUT6
AUTOLAYOUT_TEXTOVEROBJ
AUTOLAYOUT_NOTES
AUTOLAYOUT_TITLE_CONTENT
AUTOLAYOUT_TITLE_VCONTENT
AUTOLAYOUT_TEXTCLIP
AUTOLAYOUT_TITLE_4CONTENT
sal_uInt32 GetPropertyValue(sal_uInt32 nId, sal_uInt32 nDefault) const
bool IsProperty(sal_uInt32 nRecType) const
static sal_uLong SanitizeEndPos(SvStream &rIn, sal_uLong nEndRecPos)
void ApplyAttributes(SvStream &rIn, SfxItemSet &rSet) const
sal_uLong GetRecEndFilePos() const
bool SeekToEndOfRecord(SvStream &rIn) const
sal_uLong GetRecBegFilePos() const
bool SeekToBegOfRecord(SvStream &rIn) const
sal_uInt32 nRecLen
sal_uInt16 nRecType
bool SeekToContent(SvStream &rIn) const
DffRecordHeader * GetRecordHeader(sal_uInt16 nRecType, DffSeekToContentMode eMode=SEEK_FROM_BEGINNING)
DffRecordHeader * Current()
bool SeekToContent(SvStream &rIn, sal_uInt16 nRecType, DffSeekToContentMode eMode=SEEK_FROM_BEGINNING)
SfxObjectShell * GetObjectShell() const
static bool FillObjList(std::u16string_view rThemeName, std::vector< OUString > &rObjList)
static bool InsertURL(std::u16string_view rThemeName, std::u16string_view rURL)
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
bool Append(std::u16string_view rTheSegment, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
PresChange mePresChange
Definition: pptin.hxx:54
SdDrawDocument * mpDoc
Definition: pptin.hxx:53
virtual rtl::Reference< SdrObject > ProcessObj(SvStream &rSt, DffObjData &rData, SvxMSDffClientData &rClientData, ::tools::Rectangle &rTextRect, SdrObject *pObj) override
Definition: pptin.cxx:2588
OUString ReadSound(sal_uInt32 nSoundRef) const
Definition: pptin.cxx:1891
OUString ReadMedia(sal_uInt32 nMediaRef) const
Definition: pptin.cxx:2006
virtual ~ImplSdPPTImport() override
Definition: pptin.cxx:221
virtual bool ReadFormControl(tools::SvRef< SotStorage > &rSrc1, css::uno::Reference< css::form::XFormComponent > &rFormComp) const override
Definition: pptin.cxx:2749
bool Import()
Definition: pptin.cxx:228
tools::SvRef< SotStorageStream > mxPicturesStream
Definition: pptin.hxx:46
tAnimationMap maAnimations
Definition: pptin.hxx:57
virtual SdrObject * ApplyTextObj(PPTTextObj *pTextObj, SdrTextObj *pText, SdPageCapsule pPage, SfxStyleSheet *, SfxStyleSheet **) const override
Definition: pptin.cxx:2185
void ImportPageEffect(SdPage *pPage, const bool bNewAnimationsUsed)
Definition: pptin.cxx:1523
SdrLayerID mnBackgroundObjectsLayerID
Definition: pptin.hxx:55
void SetHeaderFooterPageSettings(SdPage *pPage, const PptSlidePersistEntry *pMasterPersist)
Definition: pptin.cxx:1429
std::vector< OUString > maSlideNameList
Definition: pptin.hxx:50
SotStorage & mrStorage
Definition: pptin.hxx:48
DffRecordHeader maDocHd
Definition: pptin.hxx:49
SfxMedium & mrMed
Definition: pptin.hxx:47
void FillSdAnimationInfo(SdAnimationInfo *pInfo, const PptInteractiveInfoAtom &rIAtom, const OUString &rMacroName)
Definition: pptin.cxx:2076
bool mbDocumentFound
Definition: pptin.hxx:51
sal_uInt32 mnFilterOptions
Definition: pptin.hxx:52
void AppendPortion(PPTPortionObj &rPortion)
PPTPortionObj * First()
void ApplyTo(SfxItemSet &rSet, std::optional< sal_Int16 > &rStartNumbering, SdrPowerPointImport const &rManager, TSS_Type nInstanceInSheet)
sal_uInt32 GetTextSize()
void ApplyTo(SfxItemSet &rSet, SdrPowerPointImport &rManager, TSS_Type nInstanceInSheet)
PPTParagraphObj * First()
MSO_SPT GetShapeType() const
const std::optional< PptOEPlaceholderAtom > & GetOEPlaceHolderAtom() const
sal_uInt32 Count() const
TSS_Type GetInstance() const
TSS_Type GetDestinationInstance() const
bool is_null(size_t nIdx) const
sal_uInt16 FindPage(sal_uInt32 nId) const
size_t size() const
bool Read(OUString &rString, sal_uInt32 nType=VT_EMPTY, bool bDwordAlign=true)
Definition: propread.cxx:73
void SetBookmark(const OUString &rBookmark)
Definition: anminfo.cxx:95
css::presentation::ClickAction meClickAction
Action at mouse click.
Definition: anminfo.hxx:48
OUString GetBookmark() const
Definition: anminfo.cxx:110
void push_back(std::unique_ptr< SdCustomShow > p)
SdCustomShow * Next()
SdCustomShow * First()
const OUString & GetName() const
Definition: cusshow.hxx:60
static void Init()
Definition: sddll.cxx:218
SAL_DLLPRIVATE std::vector< std::unique_ptr< sd::FrameView > > & GetFrameViewList()
Definition: drawdoc.hxx:442
static SdAnimationInfo * GetShapeUserData(SdrObject &rObject, bool bCreate=false)
Definition: drawdoc2.cxx:959
SAL_DLLPRIVATE const sd::PresentationSettings & getPresentationSettings() const
Definition: drawdoc.hxx:400
SAL_DLLPRIVATE SfxItemPool & GetPool()
Definition: drawdoc.hxx:237
SAL_DLLPRIVATE void SetSummationOfParagraphs(bool bOn=true)
Definition: drawdoc.hxx:405
bool CreateMissingNotesAndHandoutPages()
Definition: drawdoc2.cxx:671
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
Definition: drawdoc2.cxx:207
OUString CreatePageNumValue(sal_uInt16 nNum) const
Definition: drawdoc4.cxx:986
SdCustomShowList * GetCustomShowList(bool bCreate=false)
Definition: drawdoc3.cxx:1161
SdStyleSheetPool * GetSdStyleSheetPool() const
Get the style sheet pool if it was a SdStyleSheetPool.
Definition: drawdoc4.cxx:1264
SdPage * GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind)
Definition: drawdoc2.cxx:217
SAL_DLLPRIVATE::sd::FrameView * GetFrameView(sal_uLong nPos)
Definition: drawdoc.hxx:460
SAL_DLLPRIVATE::sd::DrawDocShell * GetDocSh() const
Definition: drawdoc.hxx:242
sal_uInt16 GetSdPageCount(PageKind ePgKind) const
Definition: drawdoc2.cxx:212
SdPPTImport(SdDrawDocument *pDoc, SvStream &rDocStream, SotStorage &rStorage, SfxMedium &rMed)
Definition: pptin.cxx:99
bool Import()
Definition: pptin.cxx:154
PowerPointImportParam maParam
Definition: pptin.hxx:81
std::unique_ptr< ImplSdPPTImport > pFilter
Definition: pptin.hxx:82
~SdPPTImport()
Definition: pptin.cxx:159
void setTransitionFadeColor(sal_Int32 nTransitionFadeColor)
Definition: sdpage2.cxx:516
SdrObject * CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::tools::Rectangle &rRect)
creates a presentation object with the given PresObjKind on this page.
Definition: sdpage.cxx:284
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum) override
Definition: sdpage.cxx:1706
PageKind GetPageKind() const
Definition: sdpage.hxx:205
SfxStyleSheet * GetStyleSheetForMasterPageBackground() const
Definition: sdpage.cxx:606
void SetObjText(SdrTextObj *pObj, SdrOutliner *pOutliner, PresObjKind eObjKind, std::u16string_view rStr)
Definition: sdpage.cxx:2357
void SetTime(double fNewTime)
Definition: sdpage.hxx:216
void SetExcluded(bool bNewExcluded)
Definition: sdpage.hxx:222
OUString GetPresObjText(PresObjKind eObjKind) const
Definition: sdpage.cxx:2581
const sd::HeaderFooterSettings & getHeaderFooterSettings() const
Definition: sdpage.cxx:2711
SfxStyleSheet * GetStyleSheetForPresObj(PresObjKind eObjKind) const
Definition: sdpage.cxx:625
void SetFadeEffect(css::presentation::FadeEffect eNewEffect)
void SetLoopSound(bool bLoopSound)
Definition: sdpage.hxx:230
void setTransitionSubtype(sal_Int16 nTransitionSubtype)
Definition: sdpage2.cxx:504
void SetAutoLayout(AutoLayout eLayout, bool bInit=false, bool bCreate=false)
Definition: sdpage.cxx:1610
void SetPresChange(PresChange eChange)
Definition: sdpage.hxx:213
void InsertPresObj(SdrObject *pObj, PresObjKind eKind)
inserts the given SdrObject into the presentation object list
Definition: sdpage.cxx:2338
virtual OUString GetLayoutName() const override
Definition: sdpage.hxx:255
const OUString & GetName() const
Definition: sdpage.cxx:2505
void SetSoundFile(const OUString &rStr)
Definition: sdpage.hxx:227
void SetStopSound(bool bStopSound)
Definition: sdpage.hxx:233
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE) override
Definition: sdpage.cxx:1681
void setHeaderFooterSettings(const sd::HeaderFooterSettings &rNewSettings)
Definition: sdpage.cxx:2723
void setTransitionType(sal_Int16 nTransitionType)
Definition: sdpage2.cxx:498
void SetName(const OUString &rName)
Set the name of the page and broadcast a model change.
Definition: sdpage.cxx:2703
void SetSound(bool bNewSoundOn)
Definition: sdpage.hxx:219
void setTransitionDuration(double fTransitionDuration)
Definition: sdpage2.cxx:522
virtual rtl::Reference< SdrPage > CloneSdrPage(SdrModel &rTargetModel) const override
Definition: sdpage2.cxx:420
virtual rtl::Reference< SdrObject > ProcessObj(SvStream &rSt, DffObjData &rData, SvxMSDffClientData &rClientData, tools::Rectangle &rTextRect, SdrObject *pObj) override
friend friend class ImplSdPPTImport
bool ReadString(OUString &rStr) const
PptDocumentAtom aDocAtom
DffRecordManager aDocRecManager
sal_uInt32 nStreamLen
SdrLayerID GetLayerID(const OUString &rName) const
void Set(SdrLayerID a)
virtual void InsertPage(SdrPage *pPage, sal_uInt16 nPos=0xFFFF)
bool isLocked() const
const SdrPage * GetMasterPage(sal_uInt16 nPgNum) const
void DeleteMasterPage(sal_uInt16 nPgNum)
SdrOutliner & GetDrawOutliner(const SdrTextObj *pObj=nullptr) const
void setLock(bool bLock)
sal_uInt16 GetMasterPageCount() const
const SfxItemPool & GetItemPool() const
void EnableUndo(bool bEnable)
SfxStyleSheetBasePool * GetStyleSheetPool() const
virtual void InsertMasterPage(SdrPage *pPage, sal_uInt16 nPos=0xFFFF)
bool IsUndoEnabled() const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
const SdrLayerAdmin & GetLayerAdmin() const
SdrObject * Next()
bool IsMore() const
SdrObject * GetObj(size_t nNum) const
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
void SetUserCall(SdrObjUserCall *pUser)
void SetEmptyPresObj(bool bEpt)
void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
void NbcSetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr)
virtual void SetLogicRect(const tools::Rectangle &rRect)
void SetNotVisibleAsMaster(bool bFlg)
const SfxItemSet & GetMergedItemSet() const
virtual const tools::Rectangle & GetLogicRect() const
void SetStyleSheet(SfxStyleSheet *pStyleSheet)
void PutItemSet(const SfxItemSet &rSet)
void ClearItem(const sal_uInt16 nWhich=0)
css::uno::Reference< css::uno::XInterface > const & getUnoPage()
SdrPage & TRG_GetMasterPage() const
void TRG_SetMasterPageVisibleLayers(const SdrLayerIDSet &rNew)
bool TRG_HasMasterPage() const
SdrPageProperties & getSdrPageProperties()
const SdrLayerIDSet & TRG_GetMasterPageVisibleLayers() const
std::unique_ptr< PptSlidePersistList > m_pSlidePages
sal_uInt16 GetMasterPageIndex(sal_uInt16 nPageNum, PptPageKind ePageKind=PPT_SLIDEPAGE) const
virtual SdrObject * ApplyTextObj(PPTTextObj *pTextObj, SdrTextObj *pText, SdPageCapsule pPage, SfxStyleSheet *, SfxStyleSheet **) const
void ApplyTextAnchorAttributes(PPTTextObj const &rTextObj, SfxItemSet &rSet) const
sal_uInt16 GetPageCount(PptPageKind eKind=PPT_SLIDEPAGE) const
sal_uInt16 m_nCurrentPageNum
::std::vector< SdHyperlinkEntry > m_aHyperList
rtl::Reference< SdrPage > MakeBlankPage(bool bMaster) const
const PPTStyleSheet * m_pPPTStyleSheet
bool SeekToCurrentPage(DffRecordHeader *pRecHd) const
void ImportPage(SdrPage *pPage, const PptSlidePersistEntry *pMasterPersist)
PptSlidePersistList * GetPageList(PptPageKind ePageKind) const
void SeekOle(SfxObjectShell *pShell, sal_uInt32 nFilterOptions)
virtual bool SeekToShape(SvStream &rSt, SvxMSDffClientData *pClientData, sal_uInt32 nId) const override
PptUserEditAtom m_aUserEditAtom
static bool SeekToContentOfProgTag(sal_Int32 nVersion, SvStream &rSt, const DffRecordHeader &rProgTagBinaryDataHd, DffRecordHeader &rContentHd)
virtual const PptSlideLayoutAtom * GetSlideLayoutAtom() const override
rtl::Reference< SdrObject > ImportPageBackgroundObject(const SdrPage &rPage, sal_uInt32 &nBgFileOffset)
static SdrOutliner * GetDrawOutliner(SdrTextObj const *pSdrText)
PptPageKind m_eCurrentPageKind
std::unique_ptr< PptSlidePersistList > m_pNotePages
void SetPageNum(sal_uInt16 nPageNum, PptPageKind=PPT_SLIDEPAGE)
bool SeekToDocument(DffRecordHeader *pRecHd) const
sal_uInt32 GetNotesPageId(sal_uInt16 nPageNum) const
std::unique_ptr< PptSlidePersistList > m_pMasterPages
bool HasMasterPage(sal_uInt16 nPageNum, PptPageKind ePageKind=PPT_SLIDEPAGE) const
virtual const tools::Rectangle & GetLogicRect() const override
virtual bool HasText() const override
void GetDictionary(PropDictionary &rDict)
Definition: propread.cxx:262
bool GetProperty(sal_uInt32 nId, PropItem &rPropItem)
Definition: propread.cxx:218
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
OUString GetBaseURL(bool bForSaving=false)
SfxItemSet & GetItemSet() const
virtual void SetVisArea(const tools::Rectangle &rVisArea)
SfxMedium * GetMedium() const
css::uno::Reference< css::frame::XModel3 > GetModel() const
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
virtual SfxItemSet & GetItemSet()
constexpr tools::Long Height() const
constexpr tools::Long Width() const
tools::SvRef< SotStorageStream > OpenSotStream(const OUString &rEleName, StreamMode=StreamMode::STD_READWRITE)
sal_uInt64 Tell() const
bool good() const
SvStream & ReadInt16(sal_Int16 &rInt16)
SvStream & ReadUInt32(sal_uInt32 &rUInt32)
SvStream & ReadUtf16(sal_Unicode &rUtf16)
sal_uInt64 Seek(sal_uInt64 nPos)
SvStream & ReadInt32(sal_Int32 &rInt32)
std::size_t ReadBytes(void *pData, std::size_t nSize)
sal_uInt64 SeekRel(sal_Int64 nPos)
ErrCode GetError() const
SvStream & ReadSChar(signed char &rChar)
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
sal_uInt64 remainingSize()
bool IsMathType2Math() const
bool IsWinWord2Writer() const
static SvtFilterOptions & Get()
bool IsExcel2Calc() const
bool IsPowerPoint2Impress() const
bool IsLoadPPointBasicCode() const
const OUString & GetGalleryPath() const
DffRecordManager maShapeRecords
SvStream & rStCtrl
void InitSvxMSDffManager(sal_uInt32 nOffsDgg_, SvStream *pStData_, sal_uInt32 nSvxMSDffOLEConvFlags)
void Scale(sal_Int32 &rVal) const
SdrModel * pSdrModel
void SetSvxMSDffSettings(sal_uInt32 nSettings)
Color MSO_CLR_ToColor(sal_uInt32 nColorCode, sal_uInt16 nContextProperty=DFF_Prop_lineColor) const
SvStream * pStData
rtl::Reference< SdrObject > ImportObj(SvStream &rSt, SvxMSDffClientData &rData, tools::Rectangle &rClientRect, const tools::Rectangle &rGlobalChildRect, int nCalledByGroup, sal_Int32 *pShapeId)
static bool SeekToRec(SvStream &rSt, sal_uInt16 nRecId, sal_uLong nMaxFilePos, DffRecordHeader *pRecHd=nullptr, sal_uLong nSkipCount=0)
void SetModel(SdrModel *pModel, tools::Long nApplicationScale)
bool ReadOCXStorage(tools::SvRef< SotStorage > const &rSrc1, css::uno::Reference< css::form::XFormComponent > &rxFormComp)
int import(const css::uno::Reference< css::drawing::XDrawPage > &xPage, const DffRecordHeader &rProgTagContentHd)
View for MDIFrame.
Definition: FrameView.hxx:36
void SetSelectedPage(sal_uInt16 nPage)
Definition: frmview.cxx:907
void SetPageKind(PageKind eKind)
Definition: FrameView.hxx:85
void SetViewShEditMode(EditMode eMode)
Set EditMode (Page or MasterPage) of working mode.
Definition: frmview.cxx:326
constexpr tools::Long Top() const
constexpr Size GetSize() const
constexpr tools::Long Right() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
T * get() const
bool is() const
static bool IsFuzzing()
static std::unique_ptr< SvStream > CreateStream(const OUString &rFileName, StreamMode eOpenMode, css::uno::Reference< css::awt::XWindow > xParentWin=nullptr)
FormulaCommand pE
#define DBG_ASSERT(sCon, aError)
bool ReadDffRecordHeader(SvStream &rIn, DffRecordHeader &rRec)
PresChange
Definition: diadef.h:23
URL aURL
virtual OUString GetName() const override
EEControlBits
constexpr TypedWhichId< SvxAutoKernItem > EE_CHAR_PAIRKERNING(EE_CHAR_START+11)
#define ERRCODE_NONE
SvxTimeFormat
SvxDateFormat
#define GALLERY_THEME_USERSOUNDS
#define GALLERY_THEME_SOUNDS
constexpr OUStringLiteral SD_LT_SEPARATOR
Definition: glob.hxx:49
OUString aName
sal_Int64 n
sal_Int32 nRef
sal_uInt16 nPos
#define SAL_WARN(area, stream)
#define SAL_N_ELEMENTS(arr)
if(aStr !=aBuf) UpdateName_Impl(m_xFollowLb.get()
aStr
aBuf
#define DFF_msofbtClientData
#define DFF_msofbtDgContainer
#define DFF_msofbtDggContainer
mso_sptPictureFrame
mso_sptTextBox
mso_sptRectangle
#define DFF_msofbtSpContainer
#define DFF_Prop_hspMaster
#define DFF_msofbtSpgrContainer
#define SVXMSDFF_SETTINGS_IMPORT_PPT
SEEK_FROM_CURRENT_AND_RESTART
#define OLE_EXCEL_2_STARCALC
#define SVXMSDFF_SETTINGS_CROP_BITMAPS
#define OLE_MATHTYPE_2_STARMATH
#define OLE_WINWORD_2_STARWRITER
#define OLE_POWERPOINT_2_STARIMPRESS
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
size
bool isdigitAsciiString(std::string_view rString)
int i
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
ErrCode LoadOlePropertySet(const uno::Reference< document::XDocumentProperties > &i_xDocProps, SotStorage *i_pStorage)
#define PPT_TRANSITION_TYPE_PLUS
#define PPT_TRANSITION_TYPE_CIRCLE
#define PPT_TRANSITION_TYPE_RANDOM
#define PPT_TRANSITION_TYPE_PULL
#define PPT_TRANSITION_TYPE_WIPE
#define PPT_TRANSITION_TYPE_PUSH
#define PPT_TRANSITION_TYPE_ZOOM
#define PPT_TRANSITION_TYPE_SPLIT
#define PPT_TRANSITION_TYPE_DIAMOND
#define PPT_TRANSITION_TYPE_COVER
#define DFF_msofbtAnimGroup
#define PPT_TRANSITION_TYPE_BLINDS
#define PPT_TRANSITION_TYPE_NEWSFLASH
#define PPT_TRANSITION_TYPE_SMOOTHFADE
#define PPT_TRANSITION_TYPE_DISSOLVE
#define PPT_TRANSITION_TYPE_WHEEL
#define PPT_TRANSITION_TYPE_WEDGE
#define PPT_TRANSITION_TYPE_COMB
#define PPT_TRANSITION_TYPE_RANDOM_BARS
#define PPT_TRANSITION_TYPE_STRIPS
#define PPT_TRANSITION_TYPE_FADE
#define PPT_TRANSITION_TYPE_NONE
#define PPT_TRANSITION_TYPE_CHECKER
SAL_DLLPUBLIC_EXPORT bool TestImportPPT(SvStream &rStream)
Definition: pptin.cxx:2769
#define MAX_USER_MOVE
Definition: pptin.cxx:76
SAL_DLLPUBLIC_EXPORT bool ImportPPT(SdDrawDocument *pDocument, SvStream &rDocStream, SotStorage &rStorage, SfxMedium &rMedium)
Definition: pptin.cxx:2762
std::shared_ptr< Ppt97Animation > Ppt97AnimationPtr
Definition: pptin.hxx:39
PresObjKind
Definition: pres.hxx:22
EditMode
Definition: pres.hxx:53
PageKind
Definition: pres.hxx:45
#define PID_DOCPARTS
Definition: propread.hxx:44
#define VT_LPSTR
Definition: propread.hxx:67
#define VT_EMPTY
Definition: propread.hxx:46
#define VT_UI4
Definition: propread.hxx:62
#define PID_HEADINGPAIR
Definition: propread.hxx:43
#define VT_BLOB
Definition: propread.hxx:70
#define VT_VARIANT
Definition: propread.hxx:57
#define PID_COMMENTS
Definition: propread.hxx:35
#define VT_VECTOR
Definition: propread.hxx:78
std::map< OUString, sal_uInt32 > PropDictionary
Definition: propread.hxx:83
#define VT_I4
Definition: propread.hxx:49
#define PID_SLIDECOUNT
Definition: propread.hxx:42
DefTokenId nToken
QPRO_FUNC_TYPE nType
OUString SdResId(TranslateId aId)
Definition: sdmod.cxx:83
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
SdrMetricItem makeSdrTextMinFrameHeightItem(tools::Long mnHeight)
static SfxItemSet & rSet
sal_uIntPtr sal_uLong
#define STREAM_SEEK_TO_BEGIN
TOOLS_DLLPUBLIC bool checkSeek(SvStream &rSt, sal_uInt64 nOffset)
constexpr OUStringLiteral STR_LAYOUT_OUTLINE
Definition: strings.hxx:16
sal_uInt32 IsToDisplay(sal_uInt32 nInstance)
sal_uInt32 nAtom
OUString pPlaceholder[4]
sal_uInt32 NeedToImportInstance(const sal_uInt32 nInstance, const PptSlidePersistEntry &rSlidePersist)
static void GetDateTime(const sal_uInt32 nVal, SvxDateFormat &eDateFormat, SvxTimeFormat &eTimeFormat)
PptCurrentUserAtom aCurrentUserAtom
Size const & GetSlidesPageSize() const
Size const & GetNotesPageSize() const
bool bTitlePlaceholdersOmitted
sal_uInt16 nFlags
PptSlideLayoutAtom aLayout
PptSlideLayout eLayout
PptPlaceholder aPlaceholderId[8]
sal_uInt32 nReserved
PptSlidePersistAtom aPersistAtom
PptSlideAtom aSlideAtom
std::unique_ptr< HeaderFooterEntry > xHeaderFooterEntry
PptViewTypeEnum eLastViewType
SdPageCapsule pPage
sal_Int32 nPrivate2
sal_Int32 nPrivate3
OUString aConvSubString
sal_uInt32 nIndex
OUString aSubAddress
sal_Int32 nPrivate1
SdrPage * page
SvxTimeFormat meTimeFormat
Definition: sdpage.hxx:75
SvxDateFormat meDateFormat
Definition: sdpage.hxx:74
Reference< XModel > xModel
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_LEFTDIST(SDRATTR_MISC_FIRST+4)
constexpr TypedWhichId< SdrTextHorzAdjustItem > SDRATTR_TEXT_HORZADJUST(SDRATTR_MISC_FIRST+13)
constexpr TypedWhichId< SdrTextVertAdjustItem > SDRATTR_TEXT_VERTADJUST(SDRATTR_MISC_FIRST+8)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_RIGHTDIST(SDRATTR_MISC_FIRST+5)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_LOWERDIST(SDRATTR_MISC_FIRST+7)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_UPPERDIST(SDRATTR_MISC_FIRST+6)
SvStream & ReadPptCurrentUserAtom(SvStream &rIn, PptCurrentUserAtom &rAtom)
bool ReadPptInteractiveInfoAtom(SvStream &rIn, PptInteractiveInfoAtom &rAtom)
#define PPT_PST_Document
#define PPT_PST_ExAviMovie
PptPageKind
PPT_MASTERPAGE
PPT_NOTEPAGE
PPT_SLIDEPAGE
#define PPT_PST_PPDrawingGroup
#define PPT_PST_ExMCIMovie
#define PPT_PST_NamedShows
#define PPT_PST_ExHyperlinkAtom
#define PPT_PST_InteractiveInfo
TSS_Type
#define PPT_PST_InteractiveInfoAtom
#define PPT_PST_CString
#define PPT_PST_ExObjList
#define PPT_PST_SlideTime10Atom
#define PPT_PST_SSDocInfoAtom
#define PPT_PST_PPDrawing
#define PPT_PST_SoundCollection
#define PPT_PST_HashCodeAtom
#define PPT_PST_ExObjRefAtom
#define PPT_PST_HeadersFooters
#define PPT_PST_SSSlideInfoAtom
PptPlaceholder
#define PPT_PST_SoundData
#define PPT_PST_NamedShow
#define PPT_PST_AnimationInfo
#define PPT_PST_NamedShowSlides
#define PPT_PST_Sound
#define PPT_PST_ExVideo
#define PPT_PST_ExHyperlink
#define PPTSLIDEPERSIST_ENTRY_NOTFOUND
#define PPT_IMPORTFLAGS_NO_TEXT_ASSERT
#define PPT_PST_ProgTags
#define PPT_PST_AnimationInfoAtom
#define PPT_PST_ExMediaAtom
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)
bool bVisible
unsigned char sal_uInt8
sal_uInt16 sal_Unicode
signed char sal_Int8
constexpr OUStringLiteral sUNO_LayerName_background_objects
Definition: unokywds.hxx:30
constexpr TypedWhichId< XLineStyleItem > XATTR_LINESTYLE(XATTR_LINE_FIRST)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)