fix crash on re-export of fdo50057-2.odt to odt
[LibreOffice.git] / include / filter / msfilter / svdfppt.hxx
bloba9bb62335b8b46b9ed83e19abd28f3acc675488e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_FILTER_MSFILTER_SVDFPPT_HXX
21 #define INCLUDED_FILTER_MSFILTER_SVDFPPT_HXX
23 #include <rtl/ustring.hxx>
24 #include <tools/solar.h>
25 #include <tools/gen.hxx>
26 #include <tools/color.hxx>
27 #include <svx/svdobj.hxx>
28 #include <editeng/numitem.hxx>
29 #include <editeng/editdata.hxx>
30 #include <filter/msfilter/msdffimp.hxx>
31 #include <filter/msfilter/msocximex.hxx>
32 #include <editeng/eeitem.hxx>
33 #define ITEMID_FIELD EE_FEATURE_FIELD
34 #include <editeng/flditem.hxx>
35 #undef ITEMID_FIELD
36 #include <filter/msfilter/msfilterdllapi.h>
37 #include <vcl/font.hxx>
38 #include <vector>
39 #include <boost/optional.hpp>
40 #include <boost/ptr_container/ptr_vector.hpp>
42 class SdrModel;
43 class SdPage;
44 class SdrPage;
45 class SdrObject;
46 class SvStream;
47 class Polygon;
48 class PolyPolygon;
49 class SfxItemSet;
50 class Outliner;
51 class Graphic;
52 class SvxMSDffManager;
53 class PPTTextObj;
54 class DffRecordHeader;
55 class SvxBulletItem;
57 #define PPT_IMPORTFLAGS_NO_TEXT_ASSERT 1
59 struct MSFILTER_DLLPUBLIC PptCurrentUserAtom
61 sal_uInt32 nMagic;
62 sal_uInt32 nCurrentUserEdit;
63 sal_uInt16 nDocFileVersion;
64 sal_uInt8 nMajorVersion;
65 sal_uInt8 nMinorVersion;
66 OUString aCurrentUser;
68 public:
70 PptCurrentUserAtom() : nMagic ( 0 ),
71 nCurrentUserEdit ( 0 ),
72 nDocFileVersion ( 0 ),
73 nMajorVersion ( 0 ),
74 nMinorVersion ( 0 ) {}
76 MSFILTER_DLLPUBLIC friend SvStream& ReadPptCurrentUserAtom( SvStream& rIn, PptCurrentUserAtom& rAtom );
79 struct MSFILTER_DLLPUBLIC PowerPointImportParam
81 SvStream& rDocStream;
82 sal_uInt32 nImportFlags;
83 PptCurrentUserAtom aCurrentUserAtom;
85 PowerPointImportParam( SvStream& rDocStream, sal_uInt32 nImportFlags );
88 struct SdHyperlinkEntry
90 sal_uInt32 nIndex;
91 sal_Int32 nPrivate1;
92 sal_Int32 nPrivate2;
93 sal_Int32 nPrivate3;
94 sal_Int32 nInfo;
95 OUString aTarget;
96 OUString aSubAdress;
98 sal_Int32 nStartPos;
99 sal_Int32 nEndPos;
101 OUString aConvSubString;
102 ESelection aESelection;
103 bool bSelection;
106 // Helper class for reading the PPT InteractiveInfoAtom
107 struct MSFILTER_DLLPUBLIC PptInteractiveInfoAtom
109 sal_uInt32 nSoundRef;
110 sal_uInt32 nExHyperlinkId;
111 sal_uInt8 nAction;
112 sal_uInt8 nOleVerb;
113 sal_uInt8 nJump;
114 sal_uInt8 nFlags;
115 sal_uInt8 nHyperlinkType;
117 // unknown, because total size is 16
118 sal_uInt8 nUnknown1;
119 sal_uInt8 nUnknown2;
120 sal_uInt8 nUnknown3;
122 public:
124 MSFILTER_DLLPUBLIC friend SvStream& ReadPptInteractiveInfoAtom( SvStream& rIn, PptInteractiveInfoAtom& rAtom );
127 enum PptPageKind { PPT_MASTERPAGE, PPT_SLIDEPAGE, PPT_NOTEPAGE };
129 enum PptPageFormat
130 { PPTPF_SCREEN,
131 PPTPF_USLETTER, // 8.5x11"
132 PPTPF_A4, // 210x297mm
133 PPTPF_35MMDIA, // DIA
134 PPTPF_OVERHEAD,
135 PPTPF_CUSTOM
138 // values for PPT_PST_TextHeaderAtom's sal_uLong
139 enum PPT_TextHeader
141 PPTTH_TITLE,
142 PPTTH_BODY,
143 PPTTH_NOTES,
144 PPTTH_NOTUSED,
145 PPTTH_OTHER, // Text in a Shape
146 PPTTH_CENTERBODY, // Subtitle in Title-Slide
147 PPTTH_CENTERTITLE, // Title in Title-Slide
148 PPTTH_HALFBODY, // Body in two-column slide
149 PPTTH_QUARTERBODY // Body in four-body slide
152 #define TSS_TYPE_PAGETITLE (0)
153 #define TSS_TYPE_BODY (1)
154 #define TSS_TYPE_NOTES (2)
155 #define TSS_TYPE_UNUSED (3)
156 #define TSS_TYPE_TEXT_IN_SHAPE (4)
157 #define TSS_TYPE_SUBTITLE (5)
158 #define TSS_TYPE_TITLE (6)
159 #define TSS_TYPE_HALFBODY (7)
160 #define TSS_TYPE_QUARTERBODY (8)
162 // Inventor-Id for PPT UserData
163 const sal_uInt32 PPTInventor = sal_uInt32('P') * 0x00000001
164 + sal_uInt32('P') * 0x00000100
165 + sal_uInt32('T') * 0x00010000
166 + sal_uInt32('0') * 0x01000000;
168 // Object IDs for StarDraw UserData
169 #define PPT_OBJECTINFO_ID (1)
171 struct MSFILTER_DLLPUBLIC PptDocumentAtom
173 Size aSlidesPageSize; // page size of the slides in 576DPI
174 Size aNotesPageSize; // page size of the notes in 576DPI
175 // avoid RatioAtom for the time being
176 sal_uInt32 nNotesMasterPersist; // 0=non-existent
177 sal_uInt32 nHandoutMasterPersist; // 0=non-existent
178 sal_uInt16 n1stPageNumber; // page number of the first slide
179 PptPageFormat eSlidesPageFormat; // page format of the slides
180 bool bEmbeddedTrueType : 1; // TrueType direcly within the File?
181 bool bTitlePlaceholdersOmitted : 1;
182 bool bRightToLeft : 1;
183 bool bShowComments : 1;
185 public:
187 Size GetPageSize( const Size& rSiz ) const;
188 Size GetSlidesPageSize() const { return GetPageSize( aSlidesPageSize ); }
189 Size GetNotesPageSize() const { return GetPageSize( aNotesPageSize ); }
191 friend SvStream& ReadPptDocumentAtom( SvStream& rIn, PptDocumentAtom& rAtom );
194 struct PptSlideLayoutAtom
196 sal_Int32 eLayout; // 0..18
197 sal_uInt8 aPlaceholderId[ 8 ];
199 public:
200 PptSlideLayoutAtom() { Clear(); }
201 void Clear();
203 // SlideLayoutAtom is read without header!
204 friend SvStream& ReadPptSlideLayoutAtom( SvStream& rIn, PptSlideLayoutAtom& rAtom );
207 struct PptSlideAtom
209 PptSlideLayoutAtom aLayout;
210 sal_uInt32 nMasterId;
211 sal_uInt32 nNotesId;
212 sal_uInt16 nFlags;
214 public:
215 PptSlideAtom() { Clear(); }
216 void Clear();
218 friend SvStream& ReadPptSlideAtom(SvStream& rIn, PptSlideAtom& rAtom);
221 struct PptSlidePersistAtom
223 sal_uInt32 nPsrReference;
224 sal_uInt32 nFlags;
225 sal_uInt32 nNumberTexts;
226 sal_uInt32 nSlideId;
227 sal_uInt32 nReserved; // we will use nReserved temporarly to set the offset to SSSlideInfoAtom ( if possible )
229 public:
230 PptSlidePersistAtom() { Clear(); }
231 void Clear();
233 friend SvStream& ReadPptSlidePersistAtom(SvStream& rIn, PptSlidePersistAtom& rAtom);
236 struct PptNotesAtom
238 sal_uInt32 nSlideId;
239 sal_uInt16 nFlags;
241 public:
242 PptNotesAtom() { Clear(); }
243 void Clear();
245 friend SvStream& ReadPptNotesAtom(SvStream& rIn, PptNotesAtom& rAtom);
248 struct PptColorSchemeAtom
250 sal_uInt8 aData[32];
252 public:
253 PptColorSchemeAtom () { Clear(); }
254 void Clear();
255 Color GetColor( sal_uInt16 nNum ) const;
257 friend SvStream& ReadPptColorSchemeAtom(SvStream& rIn, PptColorSchemeAtom& rAtom);
260 struct PptFontEntityAtom
262 OUString aName;
263 double fScaling;
264 sal_uInt8 lfClipPrecision;
265 sal_uInt8 lfQuality;
267 sal_uInt32 nUniqueFontId; // not used anymore
268 rtl_TextEncoding eCharSet;
269 FontFamily eFamily;
270 FontPitch ePitch;
271 bool bAvailable;
273 friend SvStream& ReadPptFontEntityAtom(SvStream& rIn, PptFontEntityAtom& rAtom);
276 class PptFontCollection;
277 struct PptUserEditAtom
279 DffRecordHeader aHd;
280 sal_Int32 nLastSlideID; // ID of last visible slide
281 sal_uInt32 nVersion; // This is major/minor/build which did the edit
282 sal_uInt32 nOffsetLastEdit; // File offset of prev PptUserEditAtom
283 sal_uInt32 nOffsetPersistDirectory; // Offset to PersistPtrs for this file version.
284 sal_uInt32 nDocumentRef;
285 sal_uInt32 nMaxPersistWritten; // total number of Persist entries up to this point
286 sal_Int16 eLastViewType; // enum view type
288 public:
289 PptUserEditAtom()
290 : nLastSlideID( 0 )
291 , nVersion( 0 )
292 , nOffsetLastEdit( 0 )
293 , nOffsetPersistDirectory( 0 )
294 , nDocumentRef( 0 )
295 , nMaxPersistWritten( 0 )
296 , eLastViewType( 0 )
299 friend SvStream& ReadPptUserEditAtom( SvStream& rIn, PptUserEditAtom& rAtom );
302 struct PptOEPlaceholderAtom
304 sal_uInt32 nPlacementId;
305 sal_uInt8 nPlaceholderId;
306 sal_uInt8 nPlaceholderSize; // 0=Full size, 1=Half size, 2=Quarter of Slide
308 public:
309 PptOEPlaceholderAtom() { Clear(); }
310 void Clear();
312 friend SvStream& ReadPptOEPlaceholderAtom( SvStream& rIn, PptOEPlaceholderAtom& rAtom );
315 struct ProcessData;
316 struct PPTStyleSheet;
317 struct HeaderFooterEntry;
318 struct PptSlidePersistEntry
320 PptSlidePersistAtom aPersistAtom;
321 PptSlideAtom aSlideAtom;
322 PptNotesAtom aNotesAtom;
323 PptColorSchemeAtom aColorScheme; // each slide includes this colorscheme atom
324 PPTStyleSheet* pStyleSheet; // stylesheet of this page (only in masterpages), since XP supports more than one masterpage
326 sal_uInt32 HeaderFooterOfs[ 4 ]; // containing the ofs to the placeholder (only masterpage)
327 HeaderFooterEntry* pHeaderFooterEntry;
328 SvxMSDffSolverContainer* pSolverContainer;
329 sal_uInt32 nSlidePersistStartOffset;// is an array to the end of the SlidePersistAtom of this page, TextHeaderAtom is following
330 sal_uInt32 nSlidePersistEndOffset;
331 sal_uInt32 nBackgroundOffset; // fileoffset
332 sal_uInt32 nDrawingDgId; // valid, if not -1
333 sal_uInt32* pPresentationObjects; // if valid, this is a pointer to an array that includes the offsets to the presentation objects
334 // on this masterpage for each instance (0 - 8);
335 SdrObject* pBObj;
336 bool bBObjIsTemporary;
338 PptPageKind ePageKind;
340 bool bNotesMaster : 1; // for NotesMaster
341 bool bHandoutMaster : 1; // for HandoutMaster
342 bool bStarDrawFiller : 1; // special for StarDraw
343 public:
344 PptSlidePersistEntry();
345 ~PptSlidePersistEntry();
346 sal_uInt32 GetSlideId() const { return aPersistAtom.nSlideId; }
349 class _PptSlidePersistList : public std::vector<PptSlidePersistEntry*>
351 public:
352 ~_PptSlidePersistList()
354 for( const_iterator it = begin(); it != end(); ++it )
355 delete *it;
359 #define PPTSLIDEPERSIST_ENTRY_NOTFOUND 0xFFFF
361 class MSFILTER_DLLPUBLIC PptSlidePersistList: public _PptSlidePersistList
363 public:
364 sal_uInt16 FindPage( sal_uInt32 nId ) const;
367 class SfxObjectShell;
368 struct PPTOleEntry
370 sal_uInt32 nId; // OleId
371 sal_uInt32 nPersistPtr; // PersistPtr
372 sal_uInt32 nRecHdOfs; // points to the record header: ExObjListHd
373 SfxObjectShell* pShell;
374 sal_uInt16 nType; // maybe PPT_PST_ExEmbed or PPT_PST_ExControl
375 sal_uInt32 nAspect; // the aspect of the OLE object
377 PPTOleEntry( sal_uInt32 nid, sal_uInt32 nOfs, SfxObjectShell* pSh, sal_uInt16 nT, sal_uInt32 nAsp )
378 : nId(nid)
379 , nPersistPtr(0)
380 , nRecHdOfs(nOfs)
381 , pShell(pSh)
382 , nType(nT)
383 , nAspect(nAsp)
387 struct PptExOleObjAtom
389 sal_uInt32 nAspect;
390 sal_uInt32 nId;
391 sal_uInt32 nPersistPtr;
393 public:
395 friend SvStream& ReadPptExOleObjAtom( SvStream& rIn, PptExOleObjAtom& rAtom );
398 typedef ::std::vector< PPTOleEntry* > PPTOleEntryList;
399 class PPTExtParaProv;
400 class MSFILTER_DLLPUBLIC SdrEscherImport : public SvxMSDffManager
402 protected:
404 friend class PPTTextObj;
405 friend class PPTPortionObj;
406 friend struct PPTStyleTextPropReader;
407 friend class ImplSdPPTImport;
409 PptDocumentAtom aDocAtom;
410 DffRecordManager aDocRecManager; // contains all first level container and atoms of the document container
412 PPTOleEntryList aOleObjectList; // contains PPTOleEntrys
414 PptFontCollection* pFonts;
416 sal_uInt32 nStreamLen;
417 sal_uInt16 nTextStylesIndex;
419 rtl_TextEncoding eCharSetSystem;
421 bool bWingdingsChecked : 1;
422 bool bWingdingsAvailable : 1;
423 bool bMonotypeSortsChecked : 1;
424 bool bMonotypeSortsAvailable : 1;
425 bool bTimesNewRomanChecked : 1;
426 bool bTimesNewRomanAvailable : 1;
428 bool ReadString( OUString& rStr ) const;
429 // only for PowerPoint filter:
430 virtual const PptSlideLayoutAtom* GetSlideLayoutAtom() const;
432 public:
433 using SvxMSDffManager::ReadObjText;
435 PowerPointImportParam& rImportParam;
437 SdrEscherImport( PowerPointImportParam&, const OUString& rBaseURL );
438 virtual ~SdrEscherImport();
439 virtual bool GetColorFromPalette( sal_uInt16 nNum, Color& rColor ) const SAL_OVERRIDE;
440 virtual bool SeekToShape( SvStream& rSt, void* pClientData, sal_uInt32 nId ) const SAL_OVERRIDE;
441 PptFontEntityAtom* GetFontEnityAtom( sal_uInt32 nNum ) const;
442 void RecolorGraphic( SvStream& rSt, sal_uInt32 nRecLen, Graphic& rGraph );
443 virtual SdrObject* ReadObjText( PPTTextObj* pTextObj, SdrObject* pObj, SdPage* pPage ) const;
444 virtual SdrObject* ProcessObj( SvStream& rSt, DffObjData& rData, void* pData, Rectangle& rTextRect, SdrObject* pObj ) SAL_OVERRIDE;
445 virtual void ProcessClientAnchor2( SvStream& rSt, DffRecordHeader& rHd, void* pData, DffObjData& rObj ) SAL_OVERRIDE;
446 void ImportHeaderFooterContainer( DffRecordHeader& rHeader, HeaderFooterEntry& rEntry );
451 #define SD_HEADERFOOTER_DATE 1
452 #define SD_HEADERFOOTER_TODAYDATE 2
453 #define SD_HEADERFOOTER_USERDATE 4
454 #define SD_HEADERFOOTER_SLIDENUMBER 8
455 #define SD_HEADERFOOTER_HEADER 16
456 #define SD_HEADERFOOTER_FOOTER 32
458 class SvxFieldItem;
459 struct MSFILTER_DLLPUBLIC PPTFieldEntry
461 sal_uInt16 nPos;
462 sal_uInt16 nTextRangeEnd;
463 SvxFieldItem* pField1;
464 SvxFieldItem* pField2;
465 OUString* pString;
467 PPTFieldEntry() : nPos( 0 ), nTextRangeEnd( 0 ), pField1( NULL ), pField2( NULL ), pString( NULL ) {};
468 ~PPTFieldEntry();
470 void SetDateTime( sal_uInt32 nType );
472 // converting PPT date time format:
473 static void GetDateTime(
474 const sal_uInt32 nVal,
475 SvxDateFormat& eDateFormat,
476 SvxTimeFormat& eTimeFormat
480 struct MSFILTER_DLLPUBLIC HeaderFooterEntry
482 const PptSlidePersistEntry* pMasterPersist;
483 OUString pPlaceholder[ 4 ];
484 sal_uInt32 nAtom;
486 sal_uInt32 GetMaskForInstance( sal_uInt32 nInstance );
487 sal_uInt32 IsToDisplay( sal_uInt32 nInstance );
488 sal_uInt32 NeedToImportInstance(
489 const sal_uInt32 nInstance,
490 const PptSlidePersistEntry& rSlidePersist
493 explicit HeaderFooterEntry( const PptSlidePersistEntry* pMaster = NULL );
494 ~HeaderFooterEntry();
497 struct ProcessData
499 PptSlidePersistEntry& rPersistEntry;
500 SdPage* pPage;
501 ::std::vector< SdrObject* > aBackgroundColoredObjects;
502 sal_uInt32* pTableRowProperties;
504 ProcessData( PptSlidePersistEntry& rP, SdPage* pP ) :
505 rPersistEntry ( rP ),
506 pPage ( pP ),
507 pTableRowProperties ( NULL ) {};
508 ~ProcessData() { delete[] pTableRowProperties; };
513 typedef ::std::vector< SdHyperlinkEntry* > SdHyperlinkEntryList;
514 class SdrTextObj;
515 class SfxObjectShell;
517 class MSFILTER_DLLPUBLIC SdrPowerPointImport : public SdrEscherImport
519 protected:
521 friend class PPTTextObj;
522 friend class PPTExtParaProv;
523 friend struct PPTStyleSheet;
524 friend class PPTNumberFormatCreator;
526 bool bOk;
527 PptUserEditAtom aUserEditAtom;
528 PptColorSchemeAtom aPageColors;
529 SdHyperlinkEntryList aHyperList;
530 sal_uInt32* pPersistPtr;
531 sal_uLong nPersistPtrAnz;
533 const PPTStyleSheet* pPPTStyleSheet; // this is the current stylesheet;
534 const PPTStyleSheet* pDefaultSheet; // this is a sheet we are using if no masterpage can be found, but that should
535 // never happen just preventing a crash
536 PptSlidePersistList* pMasterPages;
537 PptSlidePersistList* pSlidePages;
538 PptSlidePersistList* pNotePages;
539 sal_uInt16 nAktPageNum;
540 sal_uLong nDocStreamPos;
541 sal_uInt16 nPageColorsNum;
542 PptPageKind ePageColorsKind;
543 PptPageKind eAktPageKind;
545 protected:
546 using SdrEscherImport::ReadObjText;
548 bool SeekToAktPage(DffRecordHeader* pRecHd=NULL) const;
549 bool SeekToDocument(DffRecordHeader* pRecHd=NULL) const;
550 bool SeekToContentOfProgTag(
551 sal_Int32 nVersion,
552 SvStream& rSt,
553 const DffRecordHeader& rProgTagBinaryDataHd,
554 DffRecordHeader& rContentHd
556 virtual SdrObject* ApplyTextObj(
557 PPTTextObj* pTextObj,
558 SdrTextObj* pText,
559 SdPage* pPage,
560 SfxStyleSheet*,
561 SfxStyleSheet** )
562 const;
563 virtual SdrObject* ReadObjText( PPTTextObj* pTextObj, SdrObject* pObj, SdPage* pPage ) const SAL_OVERRIDE;
564 // #i32596# - new parameter <_nCalledByGroup>, which
565 // indicates, if the OLE object is imported inside a group object.
566 virtual SdrObject* ImportOLE(
567 long nOLEId,
568 const Graphic& rGraf,
569 const Rectangle& rBoundRect,
570 const Rectangle& rVisArea,
571 const int _nCalledByGroup,
572 sal_Int64 nAspect
573 ) const SAL_OVERRIDE;
574 SvMemoryStream* ImportExOleObjStg( sal_uInt32 nPersistPtr, sal_uInt32& nOleId ) const;
575 SdrPage* MakeBlancPage(bool bMaster) const;
576 bool ReadFontCollection();
577 bool ForceFontCollection() const
578 { return pFonts!=NULL?sal_True:((SdrPowerPointImport*)this)->ReadFontCollection(); }
579 PptSlidePersistList* GetPageList(PptPageKind ePageKind) const;
580 sal_uInt32 GetAktPageId();
581 sal_uInt32 GetMasterPageId(sal_uInt16 nPageNum, PptPageKind ePageKind) const;
582 sal_uInt32 GetNotesPageId(sal_uInt16 nPageNum ) const;
583 SdrOutliner* GetDrawOutliner( SdrTextObj* pSdrText ) const;
584 void SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOptions );
586 void ApplyTextAnchorAttributes( PPTTextObj& rTextObj, SfxItemSet& rSet ) const;
587 bool IsVerticalText() const;
589 public:
590 SdrPowerPointImport( PowerPointImportParam&, const OUString& rBaseURL );
591 virtual ~SdrPowerPointImport();
592 sal_uInt16 GetPageCount( PptPageKind eKind = PPT_SLIDEPAGE ) const;
593 void SetPageNum( sal_uInt16 nPageNum, PptPageKind = PPT_SLIDEPAGE );
594 sal_uInt16 GetPageNum() const { return nAktPageNum; }
595 PptPageKind GetPageKind() const { return eAktPageKind; }
596 Size GetPageSize() const;
597 SdrObject* ImportPageBackgroundObject(
598 const SdrPage& rPage,
599 sal_uInt32& nBgFileOffset,
600 bool bForce
602 bool IsNoteOrHandout( sal_uInt16 nPageNum, PptPageKind ePageKind ) const;
603 bool HasMasterPage(
604 sal_uInt16 nPageNum,
605 PptPageKind ePageKind = PPT_SLIDEPAGE
606 ) const;
607 sal_uInt16 GetMasterPageIndex(
608 sal_uInt16 nPageNum,
609 PptPageKind ePageKind = PPT_SLIDEPAGE
610 ) const;
612 void ImportPage( SdrPage* pPage, const PptSlidePersistEntry* pMasterPersist = NULL );
613 virtual bool GetColorFromPalette(sal_uInt16 nNum, Color& rColor) const SAL_OVERRIDE;
614 virtual bool SeekToShape( SvStream& rSt, void* pClientData, sal_uInt32 nId ) const SAL_OVERRIDE;
615 sal_Unicode PPTSubstitute(
616 sal_uInt16 nFont,
617 sal_Unicode nChar,
618 sal_uInt32& nMappedFontId,
619 Font& rFont,
620 char nDefault
621 ) const;
622 const PptDocumentAtom& GetDocumentAtom() const { return aDocAtom; }
623 virtual const PptSlideLayoutAtom* GetSlideLayoutAtom() const SAL_OVERRIDE;
624 SdrObject* CreateTable(
625 SdrObject* pGroupObject,
626 sal_uInt32* pTableArry,
627 SvxMSDffSolverContainer*
629 virtual bool ReadFormControl( SotStorageRef& rSrc1, com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > & rFormComp ) const = 0;
632 struct PPTTextCharacterStyleAtomInterpreter
634 sal_uInt16 nFlags1;
635 sal_uInt16 nFlags2;
636 sal_uInt16 nFlags3;
637 sal_Int32 n1;
638 sal_uInt16 nFontHeight;
639 sal_Int32 nFontColor;
641 PPTTextCharacterStyleAtomInterpreter();
642 ~PPTTextCharacterStyleAtomInterpreter();
644 bool Read( SvStream& rIn, const DffRecordHeader& rRecHd );
646 sal_uInt32 GetColor( sal_uInt32 nDefault );
649 struct PPTTextParagraphStyleAtomInterpreter
651 bool bValid;
652 bool bForbiddenRules;
653 bool bHangingPunctuation;
654 bool bLatinTextWrap;
656 PPTTextParagraphStyleAtomInterpreter();
657 ~PPTTextParagraphStyleAtomInterpreter();
659 bool Read( SvStream& rIn, const DffRecordHeader& rRecHd );
662 struct PPTTextSpecInfo
664 sal_uInt32 nCharIdx;
665 sal_uInt16 nLanguage[ 3 ];
666 sal_uInt16 nDontKnow;
668 explicit PPTTextSpecInfo( sal_uInt32 nCharIdx );
669 ~PPTTextSpecInfo();
672 typedef ::std::vector< PPTTextSpecInfo* > PPTTextSpecInfoList;
673 struct PPTTextSpecInfoAtomInterpreter
675 bool bValid;
676 PPTTextSpecInfoList aList;
678 PPTTextSpecInfoAtomInterpreter();
679 ~PPTTextSpecInfoAtomInterpreter();
681 bool Read(
682 SvStream& rIn,
683 const DffRecordHeader& rRecHd,
684 sal_uInt16 nRecordType,
685 const PPTTextSpecInfo* pTextSpecDefault = NULL
690 #define PPT_STYLESHEETENTRYS 9
692 struct PPTExtParaLevel
694 sal_uInt32 mnExtParagraphMask;
695 sal_uInt16 mnBuBlip;
696 sal_uInt16 mnHasAnm;
697 sal_uInt32 mnAnmScheme;
698 sal_uInt32 mpfPP10Ext;
699 sal_uInt32 mnExtCharacterMask;
700 sal_uInt32 mcfPP10Ext;
701 bool mbSet;
703 PPTExtParaLevel();
704 friend SvStream& ReadPPTExtParaLevel( SvStream& rIn, PPTExtParaLevel& rL );
707 struct PPTExtParaSheet
709 PPTExtParaLevel aExtParaLevel[ 5 ];
712 struct PPTBuGraEntry
714 sal_uInt32 nInstance;
715 Graphic aBuGra;
717 PPTBuGraEntry( Graphic& rGraphic, sal_uInt32 nInstance );
720 typedef ::std::vector< PPTBuGraEntry* > PPTBuGraEntryList;
722 class PPTExtParaProv
724 PPTBuGraEntryList aBuGraList;
726 public :
727 bool bStyles;
728 bool bGraphics;
729 DffRecordManager aExtendedPresRules;
731 PPTExtParaSheet aExtParaSheet[ PPT_STYLESHEETENTRYS ];
733 bool GetGraphic( sal_uInt32 nInstance, Graphic& rGraphic ) const;
735 PPTExtParaProv(
736 SdrPowerPointImport& rManager,
737 SvStream& rSt,
738 const DffRecordHeader* pMainMasterHd
740 ~PPTExtParaProv();
743 struct PPTCharLevel
745 Color mnFontColorInStyleSheet;
746 sal_uInt32 mnFontColor;
747 sal_uInt16 mnFlags;
748 sal_uInt16 mnFont;
749 sal_uInt16 mnAsianOrComplexFont;
750 sal_uInt16 mnFontHeight;
751 sal_uInt16 mnEscapement;
754 struct PPTCharSheet
756 PPTCharLevel maCharLevel[ 5 ];
758 explicit PPTCharSheet( sal_uInt32 nInstance );
759 PPTCharSheet( const PPTCharSheet& rCharSheet );
761 void Read( SvStream& rIn, bool bMasterStyle, sal_uInt32 nLevel, bool bFirst );
764 struct PPTParaLevel
766 sal_uInt16 mnBuFlags;
767 sal_uInt16 mnBulletChar;
768 sal_uInt16 mnBulletFont;
769 sal_uInt16 mnBulletHeight;
770 sal_uInt32 mnBulletColor;
772 sal_uInt16 mnAdjust;
773 sal_uInt16 mnLineFeed;
774 sal_uInt16 mnUpperDist;
775 sal_uInt16 mnLowerDist;
776 sal_uInt16 mnTextOfs;
777 sal_uInt16 mnBulletOfs;
778 sal_uInt16 mnDefaultTab;
779 sal_uInt16 mnAsianLineBreak; // bit0: use asian rules for first and last character
780 // 1: do not wrap latin text in the middle of the word
781 // 2: allow hanging punctuation
782 sal_uInt16 mnBiDi;
785 struct PPTParaSheet
787 public:
789 PPTParaLevel maParaLevel[ 5 ];
791 explicit PPTParaSheet( sal_uInt32 nInstance );
792 PPTParaSheet( const PPTParaSheet& rParaSheet );
794 bool Read(
795 SdrPowerPointImport& rMan,
796 SvStream& rIn,
797 bool bMasterStyle,
798 sal_uInt32 nLevel,
799 bool bFirst
801 void UpdateBulletRelSize( sal_uInt32 nLevel, sal_uInt16 nFontHeight );
804 class PPTParagraphObj;
805 class PPTNumberFormatCreator
807 sal_uInt32 nIsBullet;
808 sal_uInt32 nBulletChar;
809 sal_uInt32 nBulletFont;
810 sal_uInt32 nBulletHeight;
811 sal_uInt32 nBulletColor;
812 sal_uInt32 nTextOfs;
813 sal_uInt32 nBulletOfs;
815 void ImplGetNumberFormat(
816 SdrPowerPointImport& rMan,
817 SvxNumberFormat& rNumberFormat,
818 sal_uInt32 nLevel
820 bool ImplGetExtNumberFormat(
821 SdrPowerPointImport& rMan,
822 SvxNumberFormat& rNumberFormat,
823 sal_uInt32 nLevel,
824 sal_uInt32 nInstance,
825 sal_uInt32 nInstanceInSheet,
826 boost::optional< sal_Int16 >& rStartNumbering,
827 sal_uInt32 nFontHeight,
828 PPTParagraphObj* pPara
831 protected:
833 PPTNumberFormatCreator( PPTExtParaProv* );
834 ~PPTNumberFormatCreator();
836 public:
838 PPTExtParaProv* pExtParaProv;
840 void GetNumberFormat(
841 SdrPowerPointImport& rMan,
842 SvxNumberFormat& rNumberFormat,
843 sal_uInt32 nLevel,
844 const PPTParaLevel& rParaLevel,
845 const PPTCharLevel& rCharLevel,
846 sal_uInt32 nInstance
849 bool GetNumberFormat(
850 SdrPowerPointImport& rMan,
851 SvxNumberFormat& rNumberFormat,
852 PPTParagraphObj* pPara,
853 sal_uInt32 nInstanceInSheet,
854 boost::optional< sal_Int16 >& rStartNumbering
858 class SvxNumBulletItem;
859 struct PPTStyleSheet : public PPTNumberFormatCreator
861 PPTTextSpecInfo maTxSI;
862 PPTCharSheet* mpCharSheet[ PPT_STYLESHEETENTRYS ];
863 PPTParaSheet* mpParaSheet[ PPT_STYLESHEETENTRYS ];
864 SvxNumBulletItem* mpNumBulletItem[ PPT_STYLESHEETENTRYS ];
866 PPTStyleSheet(
867 const DffRecordHeader& rSlideHd,
868 SvStream& rSt, SdrPowerPointImport&,
869 const PPTTextCharacterStyleAtomInterpreter&,
870 const PPTTextParagraphStyleAtomInterpreter&,
871 const PPTTextSpecInfo&
873 ~PPTStyleSheet();
876 struct ImplPPTParaPropSet
878 sal_uInt32 mnRefCount;
880 sal_uInt16 mnDepth;
881 sal_uInt32 mnAttrSet;
882 sal_uInt32 mnBulletColor;
883 sal_uInt16 mpArry[ 22 ];
885 sal_uInt32 mnExtParagraphMask;
886 sal_uInt32 mnAnmScheme;
887 sal_uInt16 mnHasAnm;
888 sal_uInt16 mnBuBlip;
890 sal_uInt32 nDontKnow1;
891 sal_uInt32 nDontKnow2;
892 sal_uInt16 nDontKnow2bit06;
894 ImplPPTParaPropSet()
895 : mnRefCount( 1 )
896 , mnDepth( 0 )
897 , mnAttrSet( 0 )
898 , mnBulletColor( 0 )
899 , mnExtParagraphMask( 0 )
900 , mnAnmScheme( 0 )
901 , mnHasAnm( 0 )
902 , mnBuBlip( 0 )
903 , nDontKnow1( 0 )
904 , nDontKnow2( 0 )
905 , nDontKnow2bit06( 0 )
909 struct PPTParaPropSet
911 sal_uInt32 mnOriginalTextPos;
912 ImplPPTParaPropSet* pParaSet;
914 PPTParaPropSet();
915 PPTParaPropSet( PPTParaPropSet& rParaPropSet );
916 ~PPTParaPropSet();
918 PPTParaPropSet& operator=( PPTParaPropSet& rParaPropSet );
921 struct ImplPPTCharPropSet
923 sal_uInt32 mnRefCount;
925 sal_uInt32 mnAttrSet;
926 sal_uInt16 mnFlags;
927 sal_uInt32 mnColor;
928 sal_uInt16 mnFont;
929 sal_uInt16 mnAsianOrComplexFont;
930 sal_uInt16 mnANSITypeface;
931 sal_uInt16 mnFontHeight;
932 sal_uInt16 mnEscapement;
933 sal_uInt16 mnSymbolFont;
935 ImplPPTCharPropSet()
936 : mnRefCount ( 1 )
937 , mnAttrSet( 0 )
938 , mnFlags( 0 )
939 , mnColor( 0 )
940 , mnFont( 0 )
941 , mnAsianOrComplexFont( 0 )
942 , mnANSITypeface( 0 )
943 , mnFontHeight( 0 )
944 , mnEscapement( 0 )
945 , mnSymbolFont( 0)
949 struct PPTCharPropSet
951 //when the bullet text has more than two color,next the text following with bullet has been set hyperlink.
952 //now,the bullet color should be set original hyperlink text's color
953 //so "mbHardHylinkOrigColor" hold the original hyperlink text's color.
954 sal_uInt32 mnHylinkOrigColor;
955 //the bullet text weather has a hyperlink.
956 bool mbIsHyperlink;
957 //the hyperlink text weather has a custom color.
958 bool mbHardHylinkOrigColor;
960 sal_uInt32 mnOriginalTextPos;
961 sal_uInt32 mnParagraph;
962 OUString maString;
963 SvxFieldItem* mpFieldItem;
964 sal_uInt16 mnLanguage[ 3 ];
966 ImplPPTCharPropSet* pCharSet;
968 void SetFont( sal_uInt16 nFont );
969 void SetColor( sal_uInt32 nColor );
971 explicit PPTCharPropSet( sal_uInt32 nParagraph );
972 PPTCharPropSet( const PPTCharPropSet& rCharPropSet );
973 PPTCharPropSet( const PPTCharPropSet& rCharPropSet, sal_uInt32 nParagraph );
974 ~PPTCharPropSet();
976 PPTCharPropSet& operator=( const PPTCharPropSet& rCharPropSet );
978 private:
979 void ImplMakeUnique();
982 struct PPTTabEntry
984 sal_uInt16 nOffset;
985 sal_uInt16 nStyle;
988 struct PPTRuler
990 sal_uInt32 nRefCount;
992 sal_Int32 nFlags;
993 sal_uInt16 nDefaultTab;
994 sal_uInt16 nTextOfs[ 5 ];
995 sal_uInt16 nBulletOfs[ 5 ];
996 PPTTabEntry* pTab;
997 sal_uInt16 nTabCount;
999 PPTRuler();
1000 ~PPTRuler();
1003 struct PPTTextRulerInterpreter
1005 PPTRuler *mpImplRuler;
1007 PPTTextRulerInterpreter();
1008 PPTTextRulerInterpreter( PPTTextRulerInterpreter& rRuler );
1009 PPTTextRulerInterpreter(
1010 sal_uInt32 nFileOfs,
1011 SdrPowerPointImport&,
1012 DffRecordHeader& rHd,
1013 SvStream& rIn
1015 ~PPTTextRulerInterpreter();
1017 sal_uInt16 GetTabOffsetByIndex( sal_uInt16 nIndex ) const
1018 { return mpImplRuler->pTab[ nIndex ].nOffset; };
1020 sal_uInt16 GetTabStyleByIndex( sal_uInt16 nIndex ) const
1021 { return mpImplRuler->pTab[ nIndex ].nStyle; };
1023 sal_uInt16 GetTabCount() const { return mpImplRuler->nTabCount; };
1024 bool GetDefaultTab( sal_uInt32 nLevel, sal_uInt16& nValue ) const;
1025 bool GetTextOfs( sal_uInt32 nLevel, sal_uInt16& nValue ) const;
1026 bool GetBulletOfs( sal_uInt32 nLevel, sal_uInt16& nValue ) const;
1028 PPTTextRulerInterpreter& operator=( PPTTextRulerInterpreter& rRuler );
1031 #define PPT_SPEC_NEWLINE 0x10000
1032 #define PPT_SPEC_SYMBOL 0x20000
1033 #define PPT_SPEC_USE_STARBATS 0x40000
1035 struct StyleTextProp9
1037 sal_uInt32 mnExtParagraphMask;
1038 sal_uInt16 mnBuBlip;
1039 sal_uInt16 mnHasAnm;
1040 sal_uInt32 mnAnmScheme;
1041 sal_uInt32 mpfPP10Ext;
1042 sal_uInt32 mnExtCharacterMask;
1043 sal_uInt32 mncfPP10Ext;
1044 sal_uInt32 mnSpecialInfoMask;
1045 sal_uInt32 mnPP10Ext;
1046 sal_uInt16 mfBidi;
1048 StyleTextProp9()
1049 : mnExtParagraphMask( 0 )
1050 , mnBuBlip( 0 )
1051 , mnHasAnm( 0 )
1052 , mnAnmScheme( 0 )
1053 , mpfPP10Ext( 0 )
1054 , mnExtCharacterMask( 0 )
1055 , mncfPP10Ext( 0 )
1056 , mnSpecialInfoMask( 0 )
1057 , mnPP10Ext( 0 )
1058 , mfBidi( 0 )
1061 void Read( SvStream& rSt );
1064 typedef std::vector<PPTParaPropSet*> PPTParaPropSetList;
1065 typedef std::vector<PPTCharPropSet*> PPTCharPropSetList;
1067 struct PPTStyleTextPropReader
1069 std::vector< sal_uInt32 > aSpecMarkerList; // hiword -> Flags, loword -> Position
1070 PPTParaPropSetList aParaPropList;
1071 PPTCharPropSetList aCharPropList;
1073 PPTStyleTextPropReader(
1074 SvStream& rIn,
1075 SdrPowerPointImport&,
1076 const DffRecordHeader& rClientTextBoxHd,
1077 PPTTextRulerInterpreter& rInterpreter,
1078 const DffRecordHeader& rExtParaHd,
1079 sal_uInt32 nTextInstance
1081 ~PPTStyleTextPropReader();
1083 void Init(
1084 SvStream& rIn,
1085 SdrPowerPointImport&,
1086 const DffRecordHeader& rClientTextBoxHd,
1087 PPTTextRulerInterpreter& rInterpreter,
1088 const DffRecordHeader& rExtParaHd,
1089 sal_uInt32 nTextInstance
1091 void ReadParaProps(
1092 SvStream& rIn,
1093 SdrPowerPointImport& rMan,
1094 const DffRecordHeader& rTextHeader,
1095 const OUString& aString,
1096 PPTTextRulerInterpreter& rRuler,
1097 sal_uInt32& nCharCount,
1098 bool& bTextPropAtom
1100 void ReadCharProps(
1101 SvStream& rIn,
1102 PPTCharPropSet& aCharPropSet,
1103 const OUString& aString,
1104 sal_uInt32& nCharCount,
1105 sal_uInt32 nCharAnzRead,
1106 bool& bTextPropAtom,
1107 sal_uInt32 nExtParaPos,
1108 const std::vector< StyleTextProp9 >& aStyleTextProp9,
1109 sal_uInt32& nExtParaFlags,
1110 sal_uInt16& nBuBlip,
1111 sal_uInt16& nHasAnm,
1112 sal_uInt32& nAnmScheme
1116 class SvxFieldItem;
1117 class MSFILTER_DLLPUBLIC PPTPortionObj : public PPTCharPropSet
1120 friend class PPTParagraphObj;
1122 const PPTStyleSheet& mrStyleSheet;
1123 sal_uInt32 mnInstance;
1124 sal_uInt32 mnDepth;
1126 public:
1128 bool GetAttrib( sal_uInt32 nAttr, sal_uInt32& nVal, sal_uInt32 nInstanceInSheet ) const;
1129 SvxFieldItem* GetTextField();
1131 PPTPortionObj( const PPTStyleSheet&, sal_uInt32 nInstance, sal_uInt32 nDepth );
1132 PPTPortionObj(
1133 const PPTCharPropSet&,
1134 const PPTStyleSheet&,
1135 sal_uInt32 nInstance,
1136 sal_uInt32 nDepth
1138 PPTPortionObj( const PPTPortionObj& );
1139 ~PPTPortionObj();
1141 // the following function should be removed during next full update
1142 void ApplyTo(
1143 SfxItemSet& rSet,
1144 SdrPowerPointImport& rManager,
1145 sal_uInt32 nInstanceInSheet
1147 void ApplyTo(
1148 SfxItemSet& rSet,
1149 SdrPowerPointImport& rManager,
1150 sal_uInt32 nInstanceInSheet,
1151 const PPTTextObj* pTextObj
1153 sal_uInt32 Count() const { return ( mpFieldItem ) ? 1 : maString.getLength(); };
1154 bool HasTabulator();
1157 class MSFILTER_DLLPUBLIC PPTParagraphObj
1158 : public PPTParaPropSet,
1159 public PPTNumberFormatCreator,
1160 public PPTTextRulerInterpreter
1162 friend class PPTTextObj;
1163 friend class PPTNumberFormatCreator;
1165 const PPTStyleSheet& mrStyleSheet;
1166 sal_uInt32 mnInstance;
1168 protected:
1170 void ImplClear();
1172 public:
1174 bool mbTab; // if true, this paragraph has tabulators in text
1176 sal_uInt32 mnCurrentObject;
1177 ::boost::ptr_vector<PPTPortionObj> m_PortionList;
1179 void UpdateBulletRelSize( sal_uInt32& nBulletRelSize ) const;
1180 bool GetAttrib( sal_uInt32 nAttr, sal_uInt32& nVal, sal_uInt32 nInstanceInSheet );
1182 PPTParagraphObj(
1183 const PPTStyleSheet&,
1184 sal_uInt32 nInstance,
1185 sal_uInt16 nDepth
1187 PPTParagraphObj(
1188 PPTStyleTextPropReader&,
1189 size_t nCurParaPos,
1190 size_t& rnCurCharPos,
1191 const PPTStyleSheet&,
1192 sal_uInt32 nInstance,
1193 PPTTextRulerInterpreter& rRuler
1195 ~PPTParagraphObj();
1197 sal_uInt32 GetTextSize();
1198 PPTPortionObj* First();
1199 PPTPortionObj* Next();
1201 void AppendPortion( PPTPortionObj& rPortion );
1202 void ApplyTo(
1203 SfxItemSet& rSet,
1204 boost::optional< sal_Int16 >& rStartNumbering,
1205 SdrPowerPointImport& rManager,
1206 sal_uInt32 nInstanceInSheet,
1207 const PPTParagraphObj* pPrev
1211 #define PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT 1
1212 #define PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_CENTER 2
1213 #define PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT 4
1214 #define PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_BLOCK 8
1215 #define PPT_TEXTOBJ_FLAGS_VERTICAL 16
1217 struct ImplPPTTextObj
1219 sal_uInt32 mnRefCount;
1220 sal_uInt32 mnShapeId;
1221 sal_uInt32 mnShapeMaster;
1222 PptOEPlaceholderAtom* mpPlaceHolderAtom;
1223 sal_uInt16 mnInstance;
1224 sal_uInt16 mnDestinationInstance;
1225 MSO_SPT meShapeType;
1227 sal_uInt32 mnCurrentObject;
1228 sal_uInt32 mnParagraphCount;
1229 PPTParagraphObj** mpParagraphList;
1230 PptSlidePersistEntry& mrPersistEntry;
1232 sal_uInt32 mnTextFlags;
1234 explicit ImplPPTTextObj( PptSlidePersistEntry& rPersistEntry )
1235 : mnRefCount(0)
1236 , mnShapeId(0)
1237 , mnShapeMaster(0)
1238 , mpPlaceHolderAtom(NULL)
1239 , mnInstance(0)
1240 , mnDestinationInstance(0)
1241 , meShapeType(mso_sptMin)
1242 , mnCurrentObject(0)
1243 , mnParagraphCount(0)
1244 , mpParagraphList(NULL)
1245 , mrPersistEntry ( rPersistEntry )
1246 , mnTextFlags(0) {};
1249 class MSFILTER_DLLPUBLIC PPTTextObj
1251 ImplPPTTextObj* mpImplTextObj;
1252 void ImplClear();
1254 PPTTextObj(){};
1255 public:
1256 PPTTextObj(
1257 SvStream& rSt,
1258 SdrPowerPointImport&,
1259 PptSlidePersistEntry&,
1260 DffObjData*
1262 PPTTextObj( PPTTextObj& rTextObj );
1263 ~PPTTextObj();
1265 sal_uInt32 GetCurrentIndex() const { return mpImplTextObj->mnCurrentObject; };
1266 sal_uInt32 Count() const { return mpImplTextObj->mnParagraphCount; };
1267 PPTParagraphObj* First();
1268 PPTParagraphObj* Next();
1269 MSO_SPT GetShapeType() const { return mpImplTextObj->meShapeType; };
1270 sal_uInt32 GetInstance() const { return mpImplTextObj->mnInstance; };
1271 void SetInstance( sal_uInt16 nInstance )
1272 { mpImplTextObj->mnInstance = nInstance; }
1274 sal_uInt32 GetDestinationInstance() const
1275 { return mpImplTextObj->mnDestinationInstance; }
1277 void SetDestinationInstance( sal_uInt16 nInstance )
1278 { mpImplTextObj->mnDestinationInstance = nInstance; }
1280 PptOEPlaceholderAtom* GetOEPlaceHolderAtom() const { return mpImplTextObj->mpPlaceHolderAtom; }
1281 sal_uInt32 GetTextFlags() const { return mpImplTextObj->mnTextFlags; }
1282 void SetVertical( bool bVertical )
1284 if ( bVertical )
1285 mpImplTextObj->mnTextFlags |= PPT_TEXTOBJ_FLAGS_VERTICAL;
1286 else
1287 mpImplTextObj->mnTextFlags &= ~PPT_TEXTOBJ_FLAGS_VERTICAL;
1289 bool GetVertical() const
1290 { return ( mpImplTextObj->mnTextFlags & PPT_TEXTOBJ_FLAGS_VERTICAL ) != 0; }
1292 const SfxItemSet* GetBackground() const;
1294 PPTTextObj& operator=( PPTTextObj& rTextObj );
1297 class PPTConvertOCXControls : public SvxMSConvertOCXControls
1299 virtual const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > & GetDrawPage() SAL_OVERRIDE;
1300 PptPageKind ePageKind;
1301 const SdrPowerPointImport* mpPPTImporter;
1302 com::sun::star::uno::Reference< com::sun::star::io::XInputStream > mxInStrm;
1303 public :
1305 PPTConvertOCXControls( const SdrPowerPointImport* pPPTImporter, com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& rxInStrm, const com::sun::star::uno::Reference< com::sun::star::frame::XModel >& rxModel, PptPageKind ePKind ) :
1306 SvxMSConvertOCXControls ( rxModel ),
1307 ePageKind ( ePKind ),
1308 mpPPTImporter ( pPPTImporter ),
1309 mxInStrm ( rxInStrm )
1311 virtual bool ReadOCXStream( SotStorageRef& rSrc1,
1312 com::sun::star::uno::Reference<
1313 com::sun::star::drawing::XShape > *pShapeRef=0,
1314 bool bFloatingCtrl=false );
1315 virtual bool InsertControl(
1316 const com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > &rFComp,
1317 const com::sun::star::awt::Size& rSize,
1318 com::sun::star::uno::Reference< com::sun::star::drawing::XShape > *pShape,
1319 bool bFloatingCtrl
1320 ) SAL_OVERRIDE;
1323 // PowerPoint record types
1324 #define PPT_PST_Unknown 0
1325 #define PPT_PST_SubContainerCompleted 1
1326 #define PPT_PST_IRRAtom 2
1327 #define PPT_PST_PSS 3
1328 #define PPT_PST_SubContainerException 4
1329 #define PPT_PST_ClientSignal1 6
1330 #define PPT_PST_ClientSignal2 7
1331 #define PPT_PST_PowerPointStateInfoAtom 10
1332 #define PPT_PST_Document 1000
1333 #define PPT_PST_DocumentAtom 1001
1334 #define PPT_PST_EndDocument 1002
1335 #define PPT_PST_SlidePersist 1003
1336 #define PPT_PST_SlideBase 1004
1337 #define PPT_PST_SlideBaseAtom 1005
1338 #define PPT_PST_Slide 1006
1339 #define PPT_PST_SlideAtom 1007
1340 #define PPT_PST_Notes 1008
1341 #define PPT_PST_NotesAtom 1009
1342 #define PPT_PST_Environment 1010
1343 #define PPT_PST_SlidePersistAtom 1011
1344 #define PPT_PST_Scheme 1012
1345 #define PPT_PST_SchemeAtom 1013
1346 #define PPT_PST_DocViewInfo 1014
1347 #define PPT_PST_SslideLayoutAtom 1015
1348 #define PPT_PST_MainMaster 1016
1349 #define PPT_PST_SSSlideInfoAtom 1017
1350 #define PPT_PST_SlideViewInfo 1018
1351 #define PPT_PST_GuideAtom 1019
1352 #define PPT_PST_ViewInfo 1020
1353 #define PPT_PST_ViewInfoAtom 1021
1354 #define PPT_PST_SlideViewInfoAtom 1022
1355 #define PPT_PST_VBAInfo 1023
1356 #define PPT_PST_VBAInfoAtom 1024
1357 #define PPT_PST_SSDocInfoAtom 1025
1358 #define PPT_PST_Summary 1026
1359 #define PPT_PST_Texture 1027
1360 #define PPT_PST_VBASlideInfo 1028
1361 #define PPT_PST_VBASlideInfoAtom 1029
1362 #define PPT_PST_DocRoutingSlip 1030
1363 #define PPT_PST_OutlineViewInfo 1031
1364 #define PPT_PST_SorterViewInfo 1032
1365 #define PPT_PST_ExObjList 1033
1366 #define PPT_PST_ExObjListAtom 1034
1367 #define PPT_PST_PPDrawingGroup 1035
1368 #define PPT_PST_PPDrawing 1036
1369 #define PPT_PST_NewlyAddedAtomByXP1037 1037
1370 #define PPT_PST_NamedShows 1040
1371 #define PPT_PST_NamedShow 1041
1372 #define PPT_PST_NamedShowSlides 1042
1373 #define PPT_PST_List 2000
1374 #define PPT_PST_FontCollection 2005
1375 #define PPT_PST_ListPlaceholder 2017
1376 #define PPT_PST_BookmarkCollection 2019
1377 #define PPT_PST_SoundCollection 2020
1378 #define PPT_PST_SoundCollAtom 2021
1379 #define PPT_PST_Sound 2022
1380 #define PPT_PST_SoundData 2023
1381 #define PPT_PST_BookmarkSeedAtom 2025
1382 #define PPT_PST_GuideList 2026
1383 #define PPT_PST_RunArray 2028
1384 #define PPT_PST_RunArrayAtom 2029
1385 #define PPT_PST_ArrayElementAtom 2030
1386 #define PPT_PST_Int4ArrayAtom 2031
1387 #define PPT_PST_ColorSchemeAtom 2032
1389 // these atoms first was seen in ppt2000 in a private Tag atom
1390 #define PPT_PST_ExtendedBuGraContainer 2040 // consist of 4041
1391 #define PPT_PST_ExtendedBuGraAtom 2041 // the instance of this atom indices the current graphic
1393 #define PPT_PST_OEShape 3008
1394 #define PPT_PST_ExObjRefAtom 3009
1395 #define PPT_PST_OEPlaceholderAtom 3011
1396 #define PPT_PST_GrColor 3020
1397 #define PPT_PST_GrectAtom 3025
1398 #define PPT_PST_GratioAtom 3031
1399 #define PPT_PST_Gscaling 3032
1400 #define PPT_PST_GpointAtom 3034
1401 #define PPT_PST_OEShapeAtom 3035
1402 #define PPT_PST_OutlineTextRefAtom 3998
1403 #define PPT_PST_TextHeaderAtom 3999
1404 #define PPT_PST_TextCharsAtom 4000
1405 #define PPT_PST_StyleTextPropAtom 4001
1406 #define PPT_PST_BaseTextPropAtom 4002
1407 #define PPT_PST_TxMasterStyleAtom 4003
1408 #define PPT_PST_TxCFStyleAtom 4004
1409 #define PPT_PST_TxPFStyleAtom 4005
1410 #define PPT_PST_TextRulerAtom 4006
1411 #define PPT_PST_TextBookmarkAtom 4007
1412 #define PPT_PST_TextBytesAtom 4008
1413 #define PPT_PST_TxSIStyleAtom 4009
1414 #define PPT_PST_TextSpecInfoAtom 4010
1415 #define PPT_PST_DefaultRulerAtom 4011
1417 // these atoms first was seen in ppt2000 in a private Tag atom
1418 #define PPT_PST_ExtendedParagraphAtom 4012
1419 #define PPT_PST_ExtendedParagraphMasterAtom 4013
1420 #define PPT_PST_ExtendedPresRuleContainer 4014 // consist of 4012, 4015,
1421 #define PPT_PST_ExtendedParagraphHeaderAtom 4015 // the instance of this atom indices the current presobj
1422 // the first sal_uInt32 in this atom indices the current slideId
1423 #define PPT_PST_NewlyAddedAtom4016 4016
1425 #define PPT_PST_FontEntityAtom 4023
1426 #define PPT_PST_FontEmbedData 4024
1427 #define PPT_PST_TypeFace 4025
1428 #define PPT_PST_CString 4026
1429 #define PPT_PST_ExternalObject 4027
1430 #define PPT_PST_MetaFile 4033
1431 #define PPT_PST_ExOleObj 4034
1432 #define PPT_PST_ExOleObjAtom 4035
1433 #define PPT_PST_ExPlainLinkAtom 4036
1434 #define PPT_PST_CorePict 4037
1435 #define PPT_PST_CorePictAtom 4038
1436 #define PPT_PST_ExPlainAtom 4039
1437 #define PPT_PST_SrKinsoku 4040
1438 #define PPT_PST_Handout 4041
1439 #define PPT_PST_ExEmbed 4044
1440 #define PPT_PST_ExEmbedAtom 4045
1441 #define PPT_PST_ExLink 4046
1442 #define PPT_PST_ExLinkAtom_old 4047
1443 #define PPT_PST_BookmarkEntityAtom 4048
1444 #define PPT_PST_ExLinkAtom 4049
1445 #define PPT_PST_SrKinsokuAtom 4050
1446 #define PPT_PST_ExHyperlinkAtom 4051
1447 #define PPT_PST_ExPlain 4053
1448 #define PPT_PST_ExPlainLink 4054
1449 #define PPT_PST_ExHyperlink 4055
1450 #define PPT_PST_SlideNumberMCAtom 4056
1451 #define PPT_PST_HeadersFooters 4057
1452 #define PPT_PST_HeadersFootersAtom 4058
1453 #define PPT_PST_RecolorEntryAtom 4062
1454 #define PPT_PST_TxInteractiveInfoAtom 4063
1455 #define PPT_PST_EmFormatAtom 4065
1456 #define PPT_PST_CharFormatAtom 4066
1457 #define PPT_PST_ParaFormatAtom 4067
1458 #define PPT_PST_MasterText 4068
1459 #define PPT_PST_RecolorInfoAtom 4071
1460 #define PPT_PST_ExQuickTime 4073
1461 #define PPT_PST_ExQuickTimeMovie 4074
1462 #define PPT_PST_ExQuickTimeMovieData 4075
1463 #define PPT_PST_ExSubscription 4076
1464 #define PPT_PST_ExSubscriptionSection 4077
1465 #define PPT_PST_ExControl 4078
1466 #define PPT_PST_ExControlAtom 4091
1467 #define PPT_PST_SlideListWithText 4080
1468 #define PPT_PST_AnimationInfoAtom 4081
1469 #define PPT_PST_InteractiveInfo 4082
1470 #define PPT_PST_InteractiveInfoAtom 4083
1471 #define PPT_PST_SlideList 4084
1472 #define PPT_PST_UserEditAtom 4085
1473 #define PPT_PST_CurrentUserAtom 4086
1474 #define PPT_PST_DateTimeMCAtom 4087
1475 #define PPT_PST_GenericDateMCAtom 4088
1476 #define PPT_PST_HeaderMCAtom 4089
1477 #define PPT_PST_FooterMCAtom 4090
1478 #define PPT_PST_ExMediaAtom 4100
1479 #define PPT_PST_ExVideo 4101
1480 #define PPT_PST_ExAviMovie 4102
1481 #define PPT_PST_ExMCIMovie 4103
1482 #define PPT_PST_ExMIDIAudio 4109
1483 #define PPT_PST_ExCDAudio 4110
1484 #define PPT_PST_ExWAVAudioEmbedded 4111
1485 #define PPT_PST_ExWAVAudioLink 4112
1486 #define PPT_PST_ExOleObjStg 4113
1487 #define PPT_PST_ExCDAudioAtom 4114
1488 #define PPT_PST_ExWAVAudioEmbeddedAtom 4115
1489 #define PPT_PST_AnimationInfo 4116
1490 #define PPT_PST_RTFDateTimeMCAtom 4117
1491 #define PPT_PST_ProgTags 5000
1492 #define PPT_PST_ProgStringTag 5001
1493 #define PPT_PST_ProgBinaryTag 5002
1494 #define PPT_PST_BinaryTagData 5003
1495 #define PPT_PST_PrintOptions 6000
1496 #define PPT_PST_PersistPtrFullBlock 6001
1497 #define PPT_PST_PersistPtrIncrementalBlock 6002
1499 // these atoms first was seen in ppt2000 in a private Tag atom
1500 #define PPT_PST_NewlyAddedAtomByPPT2000_6010 6010
1501 #define PPT_PST_NewlyAddedAtomByPPT2000_6011 6011
1503 #define PPT_PST_RulerIndentAtom 10000
1504 #define PPT_PST_GscalingAtom 10001
1505 #define PPT_PST_GrColorAtom 10002
1506 #define PPT_PST_GLPointAtom 10003
1507 #define PPT_PST_GlineAtom 10004
1509 #define PPT_PST_NewlyAddedAtomByXP11008 11008
1510 #define PPT_PST_NewlyAddedAtomByXP11010 11010
1511 #define PPT_PST_Comment10 12000
1512 #define PPT_PST_CommentAtom10 12001
1513 #define PPT_PST_NewlyAddedAtomByXP12004 12004
1514 #define PPT_PST_NewlyAddedAtomByXP12010 12010
1515 #define PPT_PST_NewlyAddedAtomByXP12011 12011
1516 #define PPT_PST_NewlyAddedAtomByXP14001 14001
1518 // attributes for PptTextStyleSheet
1519 #define PPT_ParaAttr_BulletOn 0 //00000001
1520 #define PPT_ParaAttr_BuHardFont 1 //00000002
1521 #define PPT_ParaAttr_BuHardColor 2 //00000004
1522 #define PPT_ParaAttr_BuHardHeight 3 //00000008
1523 #define PPT_ParaAttr_BulletFont 4 //00000010
1524 #define PPT_ParaAttr_BulletColor 5 //00000020
1525 #define PPT_ParaAttr_BulletHeight 6 //00000040
1526 #define PPT_ParaAttr_BulletChar 7 //00000080
1527 #define PPT_ParaAttr_DontKnow1 8 //00000100
1528 #define PPT_ParaAttr_DontKnow2 9 //00000200
1529 #define PPT_ParaAttr_DontKnow3 10 //00000400
1530 #define PPT_ParaAttr_Adjust 11 //00000800 0000=Left, 0001=Center, 0002=Right, 0003=Block
1531 #define PPT_ParaAttr_LineFeed 12 //00001000
1532 #define PPT_ParaAttr_UpperDist 13 //00002000 is set to 0032 for TextFrames by default
1533 #define PPT_ParaAttr_LowerDist 14 //00004000
1534 #define PPT_ParaAttr_TextOfs 15 //00008000
1535 #define PPT_ParaAttr_BulletOfs 16 //00010000
1536 #define PPT_ParaAttr_DefaultTab 17 //00020000
1537 #define PPT_ParaAttr_AsianLB_1 18
1538 #define PPT_ParaAttr_AsianLB_2 19
1539 #define PPT_ParaAttr_AsianLB_3 20
1540 #define PPT_ParaAttr_BiDi 21 //00200000
1542 #define PPT_CharAttr_Bold 0 //00000001
1543 #define PPT_CharAttr_Italic 1 //00000002
1544 #define PPT_CharAttr_Underline 2 //00000004
1545 #define PPT_CharAttr_Shadow 4 //00000010
1546 #define PPT_CharAttr_Strikeout 8 //00000100
1547 #define PPT_CharAttr_Embossed 9 //00000200
1548 #define PPT_CharAttr_ResetNumbering 10 //00000400
1549 #define PPT_CharAttr_EnableNumbering1 11 //00000800
1550 #define PPT_CharAttr_EnableNumbering2 12 //00001000
1551 #define PPT_CharAttr_Font 16 //00010000
1552 #define PPT_CharAttr_AsianOrComplexFont 21 //00200000
1553 #define PPT_CharAttr_ANSITypeface 22 //00400000
1554 #define PPT_CharAttr_Symbol 23 //00800000
1555 #define PPT_CharAttr_FontHeight 17 //00020000
1556 #define PPT_CharAttr_FontColor 18 //00040000
1557 #define PPT_CharAttr_Escapement 19 //00080000
1559 // values for PptSlideLayoutAtom.eLayout
1560 #define PPT_LAYOUT_TITLESLIDE 0 // The slide is a title slide
1561 #define PPT_LAYOUT_TITLEANDBODYSLIDE 1 // Title and body slide
1562 #define PPT_LAYOUT_TITLEMASTERSLIDE 2 // Title master slide
1563 #define PPT_LAYOUT_MASTERSLIDE 3 // Master slide layout
1564 #define PPT_LAYOUT_MASTERNOTES 4 // Master notes layout
1565 #define PPT_LAYOUT_NOTESTITLEBODY 5 // Notes title/body layout
1566 #define PPT_LAYOUT_HANDOUTLAYOUT 6 // Handout layout, therefore it doesn't have placeholders except header, footer, and date
1567 #define PPT_LAYOUT_ONLYTITLE 7 // Only title placeholder
1568 #define PPT_LAYOUT_2COLUMNSANDTITLE 8 // Body of the slide has 2 columns and a title
1569 #define PPT_LAYOUT_2ROWSANDTITLE 9 // Slide's body has 2 rows and a title
1570 #define PPT_LAYOUT_RIGHTCOLUMN2ROWS 10 // Body contains 2 columns, right column has 2 rows
1571 #define PPT_LAYOUT_LEFTCOLUMN2ROWS 11 // Body contains 2 columns, left column has 2 rows
1572 #define PPT_LAYOUT_BOTTOMROW2COLUMNS 12 // Body contains 2 rows, bottom row has 2 columns
1573 #define PPT_LAYOUT_TOPROW2COLUMN 13 // Body contains 2 rows, top row has 2 columns
1574 #define PPT_LAYOUT_4OBJECTS 14 // 4 objects
1575 #define PPT_LAYOUT_BIGOBJECT 15 // Big object
1576 #define PPT_LAYOUT_BLANCSLIDE 16 // Blank slide
1577 #define PPT_LAYOUT_TITLERIGHTBODYLEFT 17 // Vertical title on the right, body on the left
1578 #define PPT_LAYOUT_TITLERIGHT2BODIESLEFT 18 // Vertical title on the right, body on the left split into 2 rows
1580 // the following table describes the placeholder id's (values from reality followed by values taken from the documentation)
1581 #define PPT_PLACEHOLDER_NONE 0 // 0 None
1582 #define PPT_PLACEHOLDER_MASTERTITLE 1 // 1 Master title
1583 #define PPT_PLACEHOLDER_MASTERBODY 2 // 2 Master body
1584 #define PPT_PLACEHOLDER_MASTERCENTEREDTITLE 3 // 3 Master centered title
1585 #define PPT_PLACEHOLDER_MASTERSUBTITLE 4 // 10 Master subtitle
1586 #define PPT_PLACEHOLDER_MASTERNOTESSLIDEIMAGE 5 // 4 Master notes slide image
1587 #define PPT_PLACEHOLDER_MASTERNOTESBODYIMAGE 6 // 5 Master notes body image
1588 #define PPT_PLACEHOLDER_MASTERDATE 7 // 6 Master date
1589 #define PPT_PLACEHOLDER_MASTERSLIDENUMBER 8 // 7 Master slide number
1590 #define PPT_PLACEHOLDER_MASTERFOOTER 9 // 8 Master footer
1591 #define PPT_PLACEHOLDER_MASTERHEADER 10 // 9 Master header
1592 #define PPT_PLACEHOLDER_GENERICTEXTOBJECT // 11 Generic text object
1593 #define PPT_PLACEHOLDER_TITLE 13 // 12 Title
1594 #define PPT_PLACEHOLDER_BODY 14 // 13 Body
1595 #define PPT_PLACEHOLDER_NOTESBODY 12 // 14 Notes body
1596 #define PPT_PLACEHOLDER_CENTEREDTITLE 15 // 15 Centered title
1597 #define PPT_PLACEHOLDER_SUBTITLE 16 // 16 Subtitle
1598 #define PPT_PLACEHOLDER_VERTICALTEXTTITLE 17 // 17 Vertical text title
1599 #define PPT_PLACEHOLDER_VERTICALTEXTBODY 18 // 18 Vertical text body
1600 #define PPT_PLACEHOLDER_NOTESSLIDEIMAGE 11 // 19 Notes slide image
1601 #define PPT_PLACEHOLDER_OBJECT 19 // 20 Object (no matter the size)
1602 #define PPT_PLACEHOLDER_GRAPH 20 // 21 Graph
1603 #define PPT_PLACEHOLDER_TABLE 21 // 22 Table
1604 #define PPT_PLACEHOLDER_CLIPART 22 // 23 Clip Art
1605 #define PPT_PLACEHOLDER_ORGANISZATIONCHART 23 // 24 Organization Chart
1606 #define PPT_PLACEHOLDER_MEDIACLIP 24 // 25 Media Clip
1608 #endif // INCLUDED_FILTER_MSFILTER_SVDFPPT_HXX
1610 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */