1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: eppt.cxx,v $
10 * $Revision: 1.64.78.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sd.hxx"
34 #include "epptdef.hxx"
35 #include <tools/globname.hxx>
36 #include <tools/datetime.hxx>
37 #include <tools/poly.hxx>
38 #include <vcl/graph.hxx>
39 #include <vcl/bmpacc.hxx>
40 #include <vcl/gradient.hxx>
41 #include <rtl/ustring.hxx>
42 #include <tools/stream.hxx>
43 #include <svtools/fltcall.hxx>
44 #include <sfx2/docfile.hxx>
45 #include <svx/unoapi.hxx>
46 #include <svx/svdobj.hxx>
47 #include <svx/svdoole2.hxx>
48 #include <svx/svdmodel.hxx>
49 #include <svx/svdpage.hxx>
50 #include <com/sun/star/view/PaperOrientation.hpp>
51 #include <com/sun/star/view/PaperFormat.hpp>
52 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
53 #include <com/sun/star/office/XAnnotation.hpp>
54 #include <com/sun/star/office/XAnnotationAccess.hpp>
55 #include <com/sun/star/office/XAnnotationEnumeration.hpp>
56 #include <com/sun/star/geometry/RealPoint2D.hpp>
57 #include <com/sun/star/util/DateTime.hpp>
58 #include <tools/zcodec.hxx>
59 #include <svx/svxenum.hxx>
60 #include <sot/storinfo.hxx>
61 #include <svx/msoleexp.hxx>
62 #include <vcl/virdev.hxx>
63 #include <svtools/wmf.hxx>
64 #include <svx/msdffimp.hxx>
65 #include <svx/flditem.hxx>
66 #include <sfx2/docinf.hxx>
68 #define PPT_TRANSITION_TYPE_NONE 0
69 #define PPT_TRANSITION_TYPE_RANDOM 1
70 #define PPT_TRANSITION_TYPE_BLINDS 2
71 #define PPT_TRANSITION_TYPE_CHECKER 3
72 #define PPT_TRANSITION_TYPE_COVER 4
73 #define PPT_TRANSITION_TYPE_DISSOLVE 5
74 #define PPT_TRANSITION_TYPE_FADE 6
75 #define PPT_TRANSITION_TYPE_PULL 7
76 #define PPT_TRANSITION_TYPE_RANDOM_BARS 8
77 #define PPT_TRANSITION_TYPE_STRIPS 9
78 #define PPT_TRANSITION_TYPE_WIPE 10
79 #define PPT_TRANSITION_TYPE_ZOOM 11
80 #define PPT_TRANSITION_TYPE_SPLIT 13
83 #define PPT_TRANSITION_TYPE_DIAMOND 17
84 #define PPT_TRANSITION_TYPE_PLUS 18
85 #define PPT_TRANSITION_TYPE_WEDGE 19
86 #define PPT_TRANSITION_TYPE_PUSH 20
87 #define PPT_TRANSITION_TYPE_COMB 21
88 #define PPT_TRANSITION_TYPE_NEWSFLASH 22
89 #define PPT_TRANSITION_TYPE_SMOOTHFADE 23
90 #define PPT_TRANSITION_TYPE_WHEEL 26
91 #define PPT_TRANSITION_TYPE_CIRCLE 27
93 using namespace com::sun::star
;
95 static PHLayout pPHLayout
[] =
97 { EPP_LAYOUT_TITLESLIDE
, { 0x0d, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x10, TRUE
, TRUE
, FALSE
},
98 { EPP_LAYOUT_TITLEANDBODYSLIDE
, { 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, TRUE
, TRUE
, FALSE
},
99 { EPP_LAYOUT_TITLEANDBODYSLIDE
, { 0x0d, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, TRUE
, TRUE
, FALSE
},
100 { EPP_LAYOUT_2COLUMNSANDTITLE
, { 0x0d, 0x0e, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, TRUE
, TRUE
, TRUE
},
101 { EPP_LAYOUT_2COLUMNSANDTITLE
, { 0x0d, 0x0e, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, TRUE
, TRUE
, FALSE
},
102 { EPP_LAYOUT_BLANCSLIDE
, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, FALSE
, FALSE
, FALSE
},
103 { EPP_LAYOUT_2COLUMNSANDTITLE
, { 0x0d, 0x0e, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x0e, TRUE
, TRUE
, FALSE
},
104 { EPP_LAYOUT_2COLUMNSANDTITLE
, { 0x0d, 0x14, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, TRUE
, TRUE
, FALSE
},
105 { EPP_LAYOUT_TITLEANDBODYSLIDE
, { 0x0d, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x15, 0x0d, 0x0e, TRUE
, FALSE
, FALSE
},
106 { EPP_LAYOUT_2COLUMNSANDTITLE
, { 0x0d, 0x16, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x0e, TRUE
, TRUE
, FALSE
},
107 { EPP_LAYOUT_2COLUMNSANDTITLE
, { 0x0d, 0x0e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE
, TRUE
, FALSE
},
108 { EPP_LAYOUT_TITLEANDBODYSLIDE
, { 0x0d, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE
, FALSE
, FALSE
},
109 { EPP_LAYOUT_RIGHTCOLUMN2ROWS
, { 0x0d, 0x0e, 0x13, 0x13, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE
, TRUE
, FALSE
},
110 { EPP_LAYOUT_2COLUMNSANDTITLE
, { 0x0d, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE
, TRUE
, FALSE
},
111 { EPP_LAYOUT_2ROWSANDTITLE
, { 0x0d, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE
, TRUE
, FALSE
},
112 { EPP_LAYOUT_LEFTCOLUMN2ROWS
, { 0x0d, 0x13, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE
, TRUE
, FALSE
},
113 { EPP_LAYOUT_TOPROW2COLUMN
, { 0x0d, 0x13, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE
, TRUE
, FALSE
},
114 { EPP_LAYOUT_2ROWSANDTITLE
, { 0x0d, 0x0e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE
, TRUE
, FALSE
},
115 { EPP_LAYOUT_4OBJECTS
, { 0x0d, 0x13, 0x13, 0x13, 0x13, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE
, FALSE
, FALSE
},
116 { EPP_LAYOUT_ONLYTITLE
, { 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, TRUE
, FALSE
, FALSE
},
117 { EPP_LAYOUT_BLANCSLIDE
, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, FALSE
, FALSE
, FALSE
},
118 { EPP_LAYOUT_TITLERIGHT2BODIESLEFT
, { 0x11, 0x12, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x11, 0x12, TRUE
, TRUE
, FALSE
},
119 { EPP_LAYOUT_TITLERIGHTBODYLEFT
, { 0x11, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x11, 0x12, TRUE
, TRUE
, FALSE
},
120 { EPP_LAYOUT_TITLEANDBODYSLIDE
, { 0x0d, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x12, TRUE
, TRUE
, FALSE
},
121 { EPP_LAYOUT_2COLUMNSANDTITLE
, { 0x0d, 0x16, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x12, TRUE
, TRUE
, FALSE
}
124 //============================ PPTWriter ==================================
126 PPTWriter::PPTWriter( SvStorageRef
& rSvStorage
,
127 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> & rXModel
,
128 ::com::sun::star::uno::Reference
< ::com::sun::star::task::XStatusIndicator
> & rXStatInd
,
129 SvMemoryStream
* pVBA
, sal_uInt32 nCnvrtFlags
) :
130 mbStatus ( sal_False
),
131 mbUseNewAnimations ( sal_True
),
132 mnLatestStatValue ( 0 ),
133 maFraction ( 1, 576 ),
134 maMapModeSrc ( MAP_100TH_MM
),
135 maMapModeDest ( MAP_INCH
, Point(), maFraction
, maFraction
),
136 meLatestPageType ( NORMAL
),
138 mXStatusIndicator ( rXStatInd
),
139 mbStatusIndicator ( FALSE
),
140 mpCurUserStrm ( NULL
),
143 mpPptEscherEx ( NULL
),
147 mpExEmbed ( new SvMemoryStream
),
148 mnPagesWritten ( 0 ),
152 if ( !ImplInitSOIface() )
155 FontCollectionEntry
aDefaultFontDesc( String( RTL_CONSTASCII_USTRINGPARAM( "Times New Roman" ) ),
156 ::com::sun::star::awt::FontFamily::ROMAN
,
157 ::com::sun::star::awt::FontPitch::VARIABLE
,
158 RTL_TEXTENCODING_MS_1252
);
159 maFontCollection
.GetId( aDefaultFontDesc
); // default is always times new roman
161 if ( !ImplGetPageByIndex( 0, NOTICE
) )
163 INT32 nWidth
= 21000;
164 if ( ImplGetPropertyValue( mXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ) ) )
166 INT32 nHeight
= 29700;
167 if ( ImplGetPropertyValue( mXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ) )
170 maNotesPageSize
= ImplMapSize( ::com::sun::star::awt::Size( nWidth
, nHeight
) );
172 if ( !ImplGetPageByIndex( 0, MASTER
) )
175 if ( ImplGetPropertyValue( mXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ) ) )
178 if ( ImplGetPropertyValue( mXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ) )
180 maDestPageSize
= ImplMapSize( ::com::sun::star::awt::Size( nWidth
, nHeight
) );
186 // MasterPages + Slides und Notizen + NotesMasterPage
187 mnDrawings
= mnMasterPages
+ ( mnPages
<< 1 ) + 1;
189 if ( mXStatusIndicator
.is() )
191 mbStatusIndicator
= TRUE
;
192 mnStatMaxValue
= ( mnPages
+ mnMasterPages
) * 5;
193 mXStatusIndicator
->start( String( RTL_CONSTASCII_USTRINGPARAM( "PowerPoint Export" ) ),
194 mnStatMaxValue
+ ( mnStatMaxValue
>> 3 ) );
197 SvGlobalName
aGName( 0x64818d10L
, 0x4f9b, 0x11cf, 0x86, 0xea, 0x00, 0xaa, 0x00, 0xb9, 0x29, 0xe8 );
198 mrStg
->SetClass( aGName
, 0, String( RTL_CONSTASCII_USTRINGPARAM( "MS PowerPoint 97" ) ) );
200 if ( !ImplCreateCurrentUserStream() )
203 mpStrm
= mrStg
->OpenSotStream( String( RTL_CONSTASCII_USTRINGPARAM( "PowerPoint Document" ) ) );
208 mpPicStrm
= mrStg
->OpenSotStream( String( RTL_CONSTASCII_USTRINGPARAM( "Pictures" ) ) );
210 mpPptEscherEx
= new PptEscherEx( *mpStrm
, mnDrawings
);
212 if ( !ImplGetStyleSheets() )
215 if ( !ImplCreateDocument() )
218 for ( i
= 0; i
< mnMasterPages
; i
++ )
220 if ( !ImplCreateMaster( i
) )
223 if ( !ImplCreateMainNotes() )
225 maTextRuleList
.First(); // rewind list, so we can get the current or next entry without
226 // searching, all entrys are sorted#
227 for ( i
= 0; i
< mnPages
; i
++ )
229 if ( !ImplCreateSlide( i
) )
232 for ( i
= 0; i
< mnPages
; i
++ )
234 if ( !ImplCreateNotes( i
) )
237 if ( !ImplCloseDocument() )
240 if ( mbStatusIndicator
)
242 mXStatusIndicator
->setText( String( RTL_CONSTASCII_USTRINGPARAM( "PowerPoint Export" ) ) );
243 sal_uInt32 nValue
= mnStatMaxValue
+ ( mnStatMaxValue
>> 3 );
244 if ( nValue
> mnLatestStatValue
)
246 mXStatusIndicator
->setValue( nValue
);
247 mnLatestStatValue
= nValue
;
251 ImplWriteOLE( nCnvrtFlags
);
253 ImplWriteVBA( pVBA
);
255 if ( !ImplWriteAtomEnding() )
258 if ( !ImplCreateDocumentSummaryInformation( nCnvrtFlags
) )
265 // ---------------------------------------------------------------------------------------------
267 PPTWriter::~PPTWriter()
271 delete mpPptEscherEx
;
273 std::vector
< PPTExStyleSheet
* >::iterator
aStyleSheetIter( maStyleSheetList
.begin() );
274 while( aStyleSheetIter
< maStyleSheetList
.end() )
275 delete *aStyleSheetIter
++;
277 for ( pPtr
= maTextRuleList
.First(); pPtr
; pPtr
= maTextRuleList
.Next() )
278 delete (TextRuleEntry
*)pPtr
;
279 for ( pPtr
= maSlideNameList
.First(); pPtr
; pPtr
= maSlideNameList
.Next() )
280 delete (::rtl::OUString
*)pPtr
;
281 for ( pPtr
= maHyperlink
.First(); pPtr
; pPtr
= maHyperlink
.Next() )
282 delete (EPPTHyperlink
*)pPtr
;
283 for ( pPtr
= maExOleObj
.First(); pPtr
; pPtr
= maExOleObj
.Next() )
284 delete (PPTExOleObjEntry
*)pPtr
;
286 if ( mbStatusIndicator
)
287 mXStatusIndicator
->end();
290 // ---------------------------------------------------------------------------------------------
292 static inline sal_uInt32
PPTtoEMU( INT32 nPPT
)
294 return (sal_uInt32
)( (double)nPPT
* 1587.5 );
297 // ---------------------------------------------------------------------------------------------
299 sal_Bool
PPTWriter::ImplCreateCurrentUserStream()
301 mpCurUserStrm
= mrStg
->OpenSotStream( String( RTL_CONSTASCII_USTRINGPARAM( "Current User" ) ) );
302 if ( !mpCurUserStrm
)
304 char pUserName
[] = "Current User";
305 sal_uInt32 nLenOfUserName
= strlen( pUserName
);
306 sal_uInt32 nSizeOfRecord
= 0x14 + ( ( nLenOfUserName
+ 4 ) & ~ 3 );
308 *mpCurUserStrm
<< (sal_uInt16
)0 << (sal_uInt16
)EPP_CurrentUserAtom
<< nSizeOfRecord
;
309 *mpCurUserStrm
<< (sal_uInt32
)0x14 // Len
310 << (sal_uInt32
)0xe391c05f; // Magic
312 sal_uInt32 nEditPos
= mpCurUserStrm
->Tell();
313 *mpCurUserStrm
<< (sal_uInt32
)0x0 // OffsetToCurrentEdit;
314 << (sal_uInt16
)nLenOfUserName
//
315 << (sal_uInt16
)0x3f4 // DocFileVersion
316 << (sal_uInt8
)3 // MajorVersion
317 << (sal_uInt8
)0 // MinorVersion
318 << (sal_uInt16
)0; // Pad Word
319 pUserName
[ nLenOfUserName
] = 8;
320 mpCurUserStrm
->Write( pUserName
, nLenOfUserName
+ 1 );
321 for ( sal_uInt32 i
= 0x15 + nLenOfUserName
; i
< nSizeOfRecord
; i
++ )
323 *mpCurUserStrm
<< (sal_uInt8
)0; // pad bytes
325 mpCurUserStrm
->Seek( nEditPos
);
329 // ---------------------------------------------------------------------------------------------
331 sal_Bool
PPTWriter::ImplCreateDocumentSummaryInformation( sal_uInt32 nCnvrtFlags
)
333 uno::Reference
<document::XDocumentPropertiesSupplier
> xDPS(
334 mXModel
, uno::UNO_QUERY_THROW
);
335 uno::Reference
<document::XDocumentProperties
> xDocProps(
336 xDPS
->getDocumentProperties());
338 if (xDocProps
.is()) {
340 // no idea what this is...
341 static sal_uInt8 aGuid
[ 0x52 ] =
343 0x4e, 0x00, 0x00, 0x00,
344 '{',0,'D',0,'B',0,'1',0,'A',0,'C',0,'9',0,'6',0,'4',0,'-',0,
345 'E',0,'3',0,'9',0,'C',0,'-',0,'1',0,'1',0,'D',0,'2',0,'-',0,
346 'A',0,'1',0,'E',0,'F',0,'-',0,'0',0,'0',0,'6',0,'0',0,'9',0,
347 '7',0,'D',0,'A',0,'5',0,'6',0,'8',0,'9',0,'}',0
349 uno::Sequence
<sal_uInt8
> aGuidSeq(aGuid
, 0x52);
351 SvMemoryStream aHyperBlob
;
352 ImplCreateHyperBlob( aHyperBlob
);
354 uno::Sequence
<sal_uInt8
> aHyperSeq(aHyperBlob
.Tell());
355 const sal_uInt8
* pBlob(
356 static_cast<const sal_uInt8
*>(aHyperBlob
.GetData()));
357 for (sal_Int32 j
= 0; j
< aHyperSeq
.getLength(); ++j
) {
358 aHyperSeq
[j
] = pBlob
[j
];
361 if ( nCnvrtFlags
& 0x8000 )
363 uno::Sequence
<sal_uInt8
> aThumbSeq
;
364 if ( ImplGetPageByIndex( 0, NORMAL
) &&
365 ImplGetPropertyValue( mXPagePropSet
,
366 String( RTL_CONSTASCII_USTRINGPARAM( "PreviewBitmap" ) ) ) )
369 *static_cast<const uno::Sequence
<sal_uInt8
>*>(mAny
.getValue());
371 sfx2::SaveOlePropertySet( xDocProps
, mrStg
,
372 &aThumbSeq
, &aGuidSeq
, &aHyperSeq
);
376 sfx2::SaveOlePropertySet( xDocProps
, mrStg
,
377 NULL
, &aGuidSeq
, &aHyperSeq
);
384 // ---------------------------------------------------------------------------------------------
386 void PPTWriter::ImplWriteExtParaHeader( SvMemoryStream
& rSt
, sal_uInt32 nRef
, sal_uInt32 nInstance
, sal_uInt32 nSlideId
)
390 aBuExOutlineStream
<< (sal_uInt32
)( ( EPP_PST_ExtendedParagraphHeaderAtom
<< 16 )
393 << (sal_uInt32
)nSlideId
394 << (sal_uInt32
)nInstance
;
395 aBuExOutlineStream
.Write( rSt
.GetData(), rSt
.Tell() );
399 // ---------------------------------------------------------------------------------------------
401 void PPTWriter::ImplCreateHeaderFooterStrings( SvStream
& rStrm
, ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& rXPagePropSet
)
403 if ( rXPagePropSet
.is() )
405 rtl::OUString aString
;
406 ::com::sun::star::uno::Any aAny
;
407 if ( PropValue::GetPropertyValue( aAny
, rXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "HeaderText" ) ), sal_True
) )
409 if ( aAny
>>= aString
)
410 PPTWriter::WriteCString( rStrm
, aString
, 1 );
412 if ( PropValue::GetPropertyValue( aAny
, rXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "FooterText" ) ), sal_True
) )
414 if ( aAny
>>= aString
)
415 PPTWriter::WriteCString( rStrm
, aString
, 2 );
417 if ( PropValue::GetPropertyValue( aAny
, rXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "DateTimeText" ) ), sal_True
) )
419 if ( aAny
>>= aString
)
420 PPTWriter::WriteCString( rStrm
, aString
, 0 );
425 // ---------------------------------------------------------------------------------------------
427 void PPTWriter::ImplCreateHeaderFooters( ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& rXPagePropSet
)
429 if ( rXPagePropSet
.is() )
431 sal_Bool bVal
= sal_False
;
433 ::com::sun::star::uno::Any aAny
;
434 if ( PropValue::GetPropertyValue( aAny
, rXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "IsHeaderVisible" ) ), sal_True
) )
436 if ( ( aAny
>>= bVal
) && bVal
)
439 if ( PropValue::GetPropertyValue( aAny
, rXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "IsFooterVisible" ) ), sal_True
) )
441 if ( ( aAny
>>= bVal
) && bVal
)
444 if ( PropValue::GetPropertyValue( aAny
, rXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "IsDateTimeVisible" ) ), sal_True
) )
446 if ( ( aAny
>>= bVal
) && bVal
)
449 if ( PropValue::GetPropertyValue( aAny
, rXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "IsPageNumberVisible" ) ), sal_True
) )
451 if ( ( aAny
>>= bVal
) && bVal
)
454 if ( PropValue::GetPropertyValue( aAny
, rXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "IsDateTimeFixed" ) ), sal_True
) )
456 if ( ( aAny
>>= bVal
) && !bVal
)
461 if ( PropValue::GetPropertyValue( aAny
, rXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "DateTimeFormat" ) ), sal_True
) )
463 sal_Int32 nFormat
= *(sal_Int32
*)aAny
.getValue();
464 SvxDateFormat eDateFormat
= (SvxDateFormat
)( nFormat
& 0xf );
465 SvxTimeFormat eTimeFormat
= (SvxTimeFormat
)( ( nFormat
>> 4 ) & 0xf );
466 switch( eDateFormat
)
468 case SVXDATEFORMAT_F
:
471 case SVXDATEFORMAT_D
:
474 case SVXDATEFORMAT_C
:
478 case SVXDATEFORMAT_A
:
481 switch( eTimeFormat
)
483 case SVXTIMEFORMAT_24_HM
:
486 case SVXTIMEFORMAT_12_HM
:
489 case SVXTIMEFORMAT_24_HMS
:
492 case SVXTIMEFORMAT_12_HMS
:
501 mpPptEscherEx
->OpenContainer( EPP_HeadersFooters
, 0 );
502 mpPptEscherEx
->AddAtom( 4, EPP_HeadersFootersAtom
);
504 ImplCreateHeaderFooterStrings( *mpStrm
, rXPagePropSet
);
505 mpPptEscherEx
->CloseContainer();
509 // ---------------------------------------------------------------------------------------------
511 sal_Bool
PPTWriter::ImplCreateDocument()
514 sal_uInt16 nSlideType
= EPP_SLIDESIZE_TYPECUSTOM
;
516 sal_uInt32 nWidth
= maDestPageSize
.Width
;
517 sal_uInt32 nHeight
= maDestPageSize
.Height
;
519 if ( ( nWidth
== 0x1680 ) && ( nHeight
== 0x10e0 ) )
520 nSlideType
= EPP_SLIDESIZE_TYPEONSCREEN
;
521 else if ( ( nWidth
== 0x1200 ) && ( nHeight
== 0x240 ) )
522 nSlideType
= EPP_SLIDESIZE_TYPEBANNER
;
523 else if ( ( nWidth
== 0x1950 ) && ( nHeight
== 0x10e0 ) )
524 nSlideType
= EPP_SLIDESIZE_TYPE35MM
;
525 else if ( ( nWidth
== 0x1860 ) && ( nHeight
== 0x10e0 ) )
526 nSlideType
= EPP_SLIDESIZE_TYPEA4PAPER
;
528 mpPptEscherEx
->OpenContainer( EPP_Document
);
529 // CREATE DOCUMENT ATOM
530 mpPptEscherEx
->AddAtom( 40, EPP_DocumentAtom
, 1 );
531 *mpStrm
<< nWidth
// Slide Size in Master coordinates X
532 << nHeight
// " " " " " Y
533 << (INT32
)maNotesPageSize
.Width
// Notes Page Size X
534 << (INT32
)maNotesPageSize
.Height
// " " " Y
535 << (INT32
)1 << (INT32
)2; // the scale used when the Powerpoint document is embedded. the default is 1:2
536 mpPptEscherEx
->InsertPersistOffset( EPP_MAINNOTESMASTER_PERSIST_KEY
, mpStrm
->Tell() );
537 *mpStrm
<< (sal_uInt32
)0 // Reference to NotesMaster ( 0 if none );
538 << (sal_uInt32
)0 // Reference to HandoutMaster ( 0 if none );
539 << (sal_Int16
)1 // Number of the first slide;
540 << nSlideType
// Size of the document slides ( default: EPP_SLIDESIZETYPEONSCREEN )
541 << (sal_uInt8
)0 // bool1 indicates if document was saved with embedded true type fonts
542 << (sal_uInt8
)0 // bool1 indicates if the placeholders on the title slide are omitted
543 << (sal_uInt8
)0 // bool1 right to left ( flag for Bidi version )
544 << (sal_uInt8
)1; // bool1 visibility of comments shapes
546 mpPptEscherEx
->PtInsert( EPP_Persist_Document
, mpStrm
->Tell() );
548 mpPptEscherEx
->OpenContainer( EPP_HeadersFooters
, 3 ); //Master footer (default)
549 mpPptEscherEx
->AddAtom( 4, EPP_HeadersFootersAtom
);
550 *mpStrm
<< (sal_uInt32
)0x25000d;
551 if ( ImplGetPageByIndex( 0, MASTER
) )
552 ImplCreateHeaderFooterStrings( *mpStrm
, mXPagePropSet
);
553 mpPptEscherEx
->CloseContainer();
554 mpPptEscherEx
->OpenContainer( EPP_HeadersFooters
, 4 ); //NotesMaster footer (default)
555 mpPptEscherEx
->AddAtom( 4, EPP_HeadersFootersAtom
);
556 *mpStrm
<< (sal_uInt32
)0x3d000d;
557 if ( ImplGetPageByIndex( 0, NOTICE
) )
558 ImplCreateHeaderFooterStrings( *mpStrm
, mXPagePropSet
);
559 mpPptEscherEx
->CloseContainer();
561 mpPptEscherEx
->OpenContainer( EPP_SlideListWithText
); // Animation info fuer die Slides
564 sal_Bool bOtherThanPlaceHolders
;
566 for ( i
= 0; i
< mnPages
; i
++ )
568 sal_uInt32 nPOffset
, nPObjects
;
569 sal_Bool bOutliner
, bTitle
;
571 bOtherThanPlaceHolders
= bOutliner
= bTitle
= FALSE
;
574 mpPptEscherEx
->AddAtom( 20, EPP_SlidePersistAtom
);
575 mpPptEscherEx
->InsertPersistOffset( EPP_MAINSLIDE_PERSIST_KEY
| i
, mpStrm
->Tell() );
576 *mpStrm
<< (sal_uInt32
)0; // psrReference - logical reference to the slide persist object ( EPP_MAINSLIDE_PERSIST_KEY )
577 nPOffset
= mpStrm
->Tell();
578 *mpStrm
<< (sal_uInt32
)0 // flags - only bit 3 used, if set then slide contains shapes other than placeholders
579 << (INT32
)0 // numberTexts - number of placeholder texts stored with the persist object. Allows to display outline view without loading the slide persist objects
580 << (INT32
)i
+ 0x100 // slideId - Unique slide identifier, used for OLE link monikers for example
581 << (sal_uInt32
)0; // reserved, usualy 0
583 if ( !ImplGetPageByIndex( i
, NORMAL
) ) // sehr aufregend: noch einmal ueber alle seiten
585 ImplSetCurrentStyleSheet( ImplGetMasterIndex( NORMAL
) );
587 const PHLayout
& rLayout
= ImplGetLayout( mXPagePropSet
);
589 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNamed
>
590 aXName( mXDrawPage
, ::com::sun::star::uno::UNO_QUERY
);
594 ::rtl::OUString aStr
= aXName
->getName();
595 ::rtl::OUString
*pUStr
= new ::rtl::OUString( aStr
);
596 maSlideNameList
.Insert( pUStr
, LIST_APPEND
);
599 maSlideNameList
.Insert( new ::rtl::OUString(), LIST_APPEND
);
601 nShapes
= mXShapes
->getCount();
603 sal_Bool bSecOutl
= FALSE
;
604 if ( nShapes
&& ( rLayout
.bTitlePossible
|| rLayout
.bOutlinerPossible
) )
606 for ( sal_uInt32 nIndex
= 0; nIndex
< nShapes
; nIndex
++ )
608 if ( !ImplGetShapeByIndex( nIndex
) )
611 if ( mbPresObj
&& ( ( mType
== "presentation.Outliner" ) || ( mType
== "presentation.Subtitle" ) ) )
613 if ( bOutliner
== FALSE
)
616 mnTextStyle
= EPP_TEXTSTYLE_BODY
;
617 sal_uInt32 nTextType
= EPP_TEXTTYPE_Body
;
619 nTextType
= EPP_TEXTTYPE_HalfBody
;
620 else if ( mType
== "presentation.Subtitle" )
621 nTextType
= EPP_TEXTTYPE_CenterBody
;
623 TextRuleEntry
* pRule
= new TextRuleEntry( i
);
624 SvMemoryStream
aExtBu( 0x200, 0x200 );
625 if ( !mbEmptyPresObj
)
627 ImplWriteTextStyleAtom( *mpStrm
, nTextType
, nPObjects
, pRule
, aExtBu
, NULL
);
628 ImplWriteExtParaHeader( aExtBu
, nPObjects
++, nTextType
, i
+ 0x100 );
629 maTextRuleList
.Insert( (void*)pRule
, LIST_APPEND
);
630 if ( rLayout
.bSecOutlinerPossible
)
632 if ( ( nIndex
+ 1 ) < nShapes
)
634 if ( ImplGetShapeByIndex( nIndex
+ 1 ) && mType
== "presentation.Outliner" )
637 TextRuleEntry
* pTempRule
= new TextRuleEntry( i
);
638 SvMemoryStream
aTmpStrm( 0x200, 0x200 );
639 if ( !mbEmptyPresObj
)
641 ImplWriteTextStyleAtom( *mpStrm
, nTextType
, nPObjects
, pTempRule
, aTmpStrm
, NULL
);
642 ImplWriteExtParaHeader( aTmpStrm
, nPObjects
++, nTextType
, i
+ 0x100 );
643 maTextRuleList
.Insert( (void*)pTempRule
, LIST_APPEND
);
649 else if ( rLayout
.bTitlePossible
&& ( mType
== "presentation.TitleText" ) )
651 if ( bTitle
== FALSE
)
654 mnTextStyle
= EPP_TEXTSTYLE_TITLE
;
655 TextRuleEntry
* pRule
= new TextRuleEntry( i
);
656 SvMemoryStream
aExtBu( 0x200, 0x200 );
657 if ( !mbEmptyPresObj
)
659 ImplWriteTextStyleAtom( *mpStrm
, EPP_TEXTTYPE_Title
, nPObjects
, pRule
, aExtBu
, NULL
);
660 ImplWriteExtParaHeader( aExtBu
, nPObjects
++, EPP_TEXTTYPE_Title
, i
+ 0x100 );
661 maTextRuleList
.Insert( (void*)pRule
, LIST_APPEND
);
666 if ( mbEmptyPresObj
)
669 bOtherThanPlaceHolders
= TRUE
; // muss noch auf background und leeren Title/outliner geprueft werden !!!
671 if ( bOutliner
&& bTitle
&& bOtherThanPlaceHolders
)
677 sal_uInt32 nOldPos
= mpStrm
->Tell();
678 mpStrm
->Seek( nPOffset
);
679 *mpStrm
<< (sal_uInt32
)( ( bOtherThanPlaceHolders
) ? 4 : 0 );
680 *mpStrm
<< nPObjects
;
681 mpStrm
->Seek( nOldPos
);
684 mpPptEscherEx
->CloseContainer(); // EPP_SlideListWithText
686 mpPptEscherEx
->OpenContainer( EPP_SlideListWithText
, 2 ); // Animation info fuer die notes
687 for( i
= 0; i
< mnPages
; i
++ )
689 if ( !ImplGetPageByIndex( i
, NOTICE
) )
692 nShapes
= mXShapes
->getCount();
694 bOtherThanPlaceHolders
= FALSE
;
697 for ( sal_uInt32 nIndex
= 0; ( nIndex
< nShapes
) && ( bOtherThanPlaceHolders
== FALSE
); nIndex
++ )
699 if ( ImplGetShapeByIndex( nIndex
) && ( mType
!= "drawing.Page" ) )
700 bOtherThanPlaceHolders
= TRUE
;
703 mpPptEscherEx
->AddAtom( 20, EPP_SlidePersistAtom
);
704 mpPptEscherEx
->InsertPersistOffset( EPP_MAINNOTES_PERSIST_KEY
| i
, mpStrm
->Tell() );
705 *mpStrm
<< (sal_uInt32
)0
706 << (sal_uInt32
)( ( bOtherThanPlaceHolders
) ? 4 : 0 )
711 mpPptEscherEx
->CloseContainer(); // EPP_SlideListWithText
713 ::com::sun::star::uno::Reference
< ::com::sun::star::presentation::XPresentationSupplier
>
714 aXPresSupplier( mXModel
, ::com::sun::star::uno::UNO_QUERY
); ;
715 if ( aXPresSupplier
.is() )
717 ::com::sun::star::uno::Reference
< ::com::sun::star::presentation::XPresentation
>
718 aXPresentation( aXPresSupplier
->getPresentation() );
719 if ( aXPresentation
.is() )
721 mXPropSet
= ::com::sun::star::uno::Reference
<
722 ::com::sun::star::beans::XPropertySet
>
723 ( aXPresentation
, ::com::sun::star::uno::UNO_QUERY
);
724 if ( mXPropSet
.is() )
726 ::rtl::OUString aCustomShow
;
727 sal_uInt32 nPenColor
= 0x1000000;
728 INT32 nRestartTime
= 0x7fffffff;
729 sal_Int16 nStartSlide
= 0;
730 sal_Int16 nEndSlide
= 0;
731 sal_uInt32 nFlags
= 0; // Bit 0: Auto advance
732 // Bit 1 Skip builds ( do not allow slide effects )
733 // Bit 2 Use slide range
734 // Bit 3 Use named show
735 // Bit 4 Browse mode on
736 // Bit 5 Kiosk mode on
737 // Bit 7 loop continously
738 // Bit ? show scrollbar
740 if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CustomShow" ) ) ) )
742 aCustomShow
= ( *(::rtl::OUString
*)mAny
.getValue() );
743 if ( aCustomShow
.getLength() )
748 if ( ( nFlags
& 8 ) == 0 )
750 if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "FirstPage" ) ) ) )
752 ::rtl::OUString
aSlideName( *(::rtl::OUString
*)mAny
.getValue() );
753 ::rtl::OUString
* pStr
;
754 for ( pStr
= (::rtl::OUString
*)maSlideNameList
.First(); pStr
;
755 pStr
= (::rtl::OUString
*)maSlideNameList
.Next(), nStartSlide
++ )
757 if ( *pStr
== aSlideName
)
761 nEndSlide
= (sal_uInt16
)mnPages
;
770 // if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "DiaName" ) ) ) )
773 // if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsAlwaysOnTop" ) ) ) )
776 if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsAutomatic" ) ) ) )
778 sal_Bool bBool
= sal_False
;
784 if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsEndless" ) ) ) ) // muesste eigendlich heissen IsNotEndless !=)"§()&
786 sal_Bool bBool
= sal_False
;
791 if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsFullScreen" ) ) ) )
793 sal_Bool bBool
= sal_False
;
798 // if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsMouseVisible" ) ) ) )
801 // if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ) ) )
804 // if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "StartWithNavigator" ) ) ) )
807 // if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "UsePen" ) ) ) )
810 mpPptEscherEx
->AddAtom( 80, EPP_SSDocInfoAtom
, 1 );
811 *mpStrm
<< nPenColor
<< nRestartTime
<< nStartSlide
<< nEndSlide
;
813 sal_uInt32 nCustomShowNameLen
= aCustomShow
.getLength();
814 if ( nCustomShowNameLen
> 31 )
815 nCustomShowNameLen
= 31;
816 if ( nCustomShowNameLen
) // named show identifier
818 const sal_Unicode
* pCustomShow
= aCustomShow
.getStr();
819 for ( i
= 0; i
< nCustomShowNameLen
; i
++ )
821 *mpStrm
<< (sal_uInt16
)( pCustomShow
[ i
] );
824 for ( i
= nCustomShowNameLen
; i
< 32; i
++, *mpStrm
<< (sal_uInt16
)0 ) ;
827 ::com::sun::star::uno::Reference
< ::com::sun::star::presentation::XCustomPresentationSupplier
>
828 aXCPSup( mXModel
, ::com::sun::star::uno::UNO_QUERY
);
831 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
>
832 aXCont( aXCPSup
->getCustomPresentations() );
835 ::com::sun::star::uno::Sequence
< ::rtl::OUString
> aNameSeq( aXCont
->getElementNames() );
836 const ::rtl::OUString
* pUString
= aNameSeq
.getArray();
837 sal_uInt32 nCount
= aNameSeq
.getLength();
840 mpPptEscherEx
->OpenContainer( EPP_NamedShows
);
841 sal_uInt32 nCustomShowIndex
= 0;
842 for( i
= 0; i
< nCount
; i
++ ) // Anzahl der Custom Shows
844 if ( pUString
[ i
].getLength() )
846 mpPptEscherEx
->OpenContainer( EPP_NamedShow
, nCustomShowIndex
++ );
848 sal_uInt32 nNamedShowLen
= pUString
[ i
].getLength();
849 if ( nNamedShowLen
> 31 )
851 mpPptEscherEx
->AddAtom( nNamedShowLen
<< 1, EPP_CString
);
852 const sal_Unicode
* pCustomShowName
= pUString
[ i
].getStr();
853 for ( sal_uInt32 k
= 0; k
< nNamedShowLen
; *mpStrm
<< (sal_uInt16
)( pCustomShowName
[ k
++ ] ) ) ;
854 mAny
= aXCont
->getByName( pUString
[ i
] );
855 if ( mAny
.getValue() )
858 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexContainer
> aXIC
;
861 mpPptEscherEx
->BeginAtom();
863 INT32 nSlideCount
= aXIC
->getCount();
864 for ( INT32 j
= 0; j
< nSlideCount
; j
++ ) // Anzahl der Slides
866 mAny
= aXIC
->getByIndex( j
);
867 if ( mAny
.getValue() )
869 ::com::sun::star::uno::Reference
<
870 ::com::sun::star::drawing::XDrawPage
> aXDrawPage
;
871 if ( mAny
>>= aXDrawPage
)
873 ::com::sun::star::uno::Reference
<
874 ::com::sun::star::container::XNamed
>
875 aXName( aXDrawPage
, ::com::sun::star::uno::UNO_QUERY
);
878 ::rtl::OUString
aSlideName( aXName
->getName() );
879 sal_uInt32 nPageNumber
= 0;
880 for ( ::rtl::OUString
* pSlideName
= (::rtl::OUString
*)maSlideNameList
.First();
882 pSlideName
= (::rtl::OUString
*)maSlideNameList
.Next(), nPageNumber
++ )
884 if ( *pSlideName
== aSlideName
)
886 *mpStrm
<< (sal_uInt32
)( nPageNumber
+ 0x100 ); // unique slide id
894 mpPptEscherEx
->EndAtom( EPP_NamedShowSlides
);
897 mpPptEscherEx
->CloseContainer(); // EPP_NamedShow
900 mpPptEscherEx
->CloseContainer(); // EPP_NamedShows
907 mpPptEscherEx
->AddAtom( 0, EPP_EndDocument
);
908 mpPptEscherEx
->CloseContainer(); // EPP_Document
912 // ---------------------------------------------------------------------------------------------
914 sal_Bool
PPTWriter::ImplCreateHyperBlob( SvMemoryStream
& rStrm
)
916 sal_uInt32 nCurrentOfs
, nParaOfs
, nParaCount
= 0;
917 // SfxOlePropertySection does this...
918 // rStrm << (sal_uInt32)0x41; // property type VT_BLOB
919 nParaOfs
= rStrm
.Tell();
920 rStrm
<< (sal_uInt32
)0; // property size
921 rStrm
<< (sal_uInt32
)0; // property count
923 for ( EPPTHyperlink
* pLink
= (EPPTHyperlink
*)maHyperlink
.First(); pLink
; pLink
= (EPPTHyperlink
*)maHyperlink
.Next() )
926 rStrm
<< (sal_uInt32
)3 // Type VT_I4
927 << (sal_uInt32
)7 // (VTI4 - Private1)
928 << (sal_uInt32
)3 // Type VT_I4
929 << (sal_uInt32
)6 // (VTI4 - Private2)
930 << (sal_uInt32
)3 // Type VT_I4
931 << (sal_uInt32
)0; // (VTI4 - Private3)
934 // HIWORD: = 0 : do not change anything
935 // = 1 : replace the hyperlink with the target and subadress in the following two VTLPWSTR
936 // = 2 : delete the hyperlink
937 // LOWORD: = 0 : graphic shown as background (link)
938 // = 1 : graphic shown as shape (link)
939 // = 2 : graphic is used to fill a shape
940 // = 3 : graphic used to fill a shape outline (future use)
941 // = 4 : hyperlink attached to a shape
942 // = 5 : " " " " (Word) field
943 // = 6 : " " " " (Excel) range
944 // = 7 : " " " " (PPT) text range
945 // = 8 : " " " " (Project) task
947 sal_uInt32 nUrlLen
= pLink
->aURL
.Len();
948 const sal_Unicode
* pUrl
= pLink
->aURL
.GetBuffer();
950 sal_uInt32 nInfo
= 7;
952 rStrm
<< (sal_uInt32
)3 // Type VT_I4
955 switch( pLink
->nType
& 0xff )
957 case 1 : // click action to slidenumber
959 rStrm
<< (sal_uInt32
)0x1f << (sal_uInt32
)1 << (sal_uInt32
)0; // path
960 rStrm
<< (sal_uInt32
)0x1f << (sal_uInt32
)( nUrlLen
+ 1 );
961 for ( sal_uInt32 i
= 0; i
< nUrlLen
; i
++ )
965 rStrm
<< (sal_uInt16
)0;
972 rStrm
<< (sal_uInt32
)0x1f
973 << (sal_uInt32
)( nUrlLen
+ 1 );
974 for ( i
= 0; i
< nUrlLen
; i
++ )
979 rStrm
<< (sal_uInt16
)0;
980 rStrm
<< (sal_uInt16
)0
988 nCurrentOfs
= rStrm
.Tell();
989 rStrm
.Seek( nParaOfs
);
990 rStrm
<< (sal_uInt32
)( nCurrentOfs
- ( nParaOfs
+ 4 ) );
992 rStrm
.Seek( nCurrentOfs
);
996 PHLayout
& PPTWriter::ImplGetLayout( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& rXPropSet
) const
998 ::com::sun::star::uno::Any aAny
;
999 sal_Int16 nLayout
= 20;
1000 if ( GetPropertyValue( aAny
, rXPropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "Layout" ) ) ), sal_True
)
1003 if ( ( nLayout
>= 21 ) && ( nLayout
<= 26 ) ) // NOTES _> HANDOUT6
1005 if ( ( nLayout
>= 27 ) && ( nLayout
<= 30 ) ) // VERTICAL LAYOUT
1007 else if ( nLayout
> 30 )
1009 return pPHLayout
[ nLayout
];
1013 // ---------------------------------------------------------------------------------------------
1015 sal_Bool
PPTWriter::ImplCreateMaster( sal_uInt32 nPageNum
)
1017 if ( !ImplGetPageByIndex( nPageNum
, MASTER
) )
1019 ImplSetCurrentStyleSheet( nPageNum
);
1021 if ( !ImplGetPropertyValue( mXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "Background" ) ) ) ) // Backgroundshape laden
1023 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> aXBackgroundPropSet
;
1024 if ( !( mAny
>>= aXBackgroundPropSet
) )
1027 sal_uInt32 nFillColor
= 0xffffff;
1028 sal_uInt32 nFillBackColor
= 0x000000;
1030 ::com::sun::star::drawing::FillStyle aFS
= ::com::sun::star::drawing::FillStyle_NONE
;
1031 if ( ImplGetPropertyValue( aXBackgroundPropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "FillStyle" ) ) ) )
1035 case ::com::sun::star::drawing::FillStyle_GRADIENT
:
1037 if ( ImplGetPropertyValue( aXBackgroundPropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "FillGradient" ) ) ) )
1039 nFillColor
= EscherPropertyContainer::GetGradientColor( (::com::sun::star::awt::Gradient
*)mAny
.getValue(), 0 );
1040 nFillBackColor
= EscherPropertyContainer::GetGradientColor( (::com::sun::star::awt::Gradient
*)mAny
.getValue(), 1 );
1045 case ::com::sun::star::drawing::FillStyle_SOLID
:
1047 if ( ImplGetPropertyValue( aXBackgroundPropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "FillColor" ) ) ) )
1049 nFillColor
= mpPptEscherEx
->GetColor( *((sal_uInt32
*)mAny
.getValue()) );
1050 nFillBackColor
= nFillColor
^ 0xffffff;
1059 mpPptEscherEx
->PtReplaceOrInsert( EPP_Persist_MainMaster
| nPageNum
, mpStrm
->Tell() );
1060 mpPptEscherEx
->OpenContainer( EPP_MainMaster
);
1061 mpPptEscherEx
->AddAtom( 24, EPP_SlideAtom
, 2 );
1062 *mpStrm
<< (INT32
)EPP_LAYOUT_TITLEANDBODYSLIDE
// slide layout -> title and body slide
1063 << (sal_uInt8
)1 << (sal_uInt8
)2 << (sal_uInt8
)0 << (sal_uInt8
)0 << (sal_uInt8
)0 << (sal_uInt8
)0 << (sal_uInt8
)0 << (sal_uInt8
)0 // placeholderID
1064 << (sal_uInt32
)0 // master ID ( ist gleich null bei einer masterpage )
1065 << (sal_uInt32
)0 // notes ID ( ist gleich null wenn keine notizen vorhanden )
1066 << (sal_uInt16
)0 // Bit 1: Follow master objects, Bit 2: Follow master scheme, Bit 3: Follow master background
1067 << (sal_uInt16
)0; // padword
1069 mpPptEscherEx
->AddAtom( 32, EPP_ColorSchemeAtom
, 0, 6 );
1070 *mpStrm
<< (sal_uInt32
)0xffffff << (sal_uInt32
)0x000000 << (sal_uInt32
)0x808080 << (sal_uInt32
)0x000000 << (sal_uInt32
)0x99cc00 << (sal_uInt32
)0xcc3333 << (sal_uInt32
)0xffcccc << (sal_uInt32
)0xb2b2b2;
1071 mpPptEscherEx
->AddAtom( 32, EPP_ColorSchemeAtom
, 0, 6 );
1072 *mpStrm
<< (sal_uInt32
)0xff0000 << (sal_uInt32
)0xffffff << (sal_uInt32
)0x000000 << (sal_uInt32
)0x00ffff << (sal_uInt32
)0x0099ff << (sal_uInt32
)0xffff00 << (sal_uInt32
)0x0000ff << (sal_uInt32
)0x969696;
1073 mpPptEscherEx
->AddAtom( 32, EPP_ColorSchemeAtom
, 0, 6 );
1074 *mpStrm
<< (sal_uInt32
)0xccffff << (sal_uInt32
)0x000000 << (sal_uInt32
)0x336666 << (sal_uInt32
)0x008080 << (sal_uInt32
)0x339933 << (sal_uInt32
)0x000080 << (sal_uInt32
)0xcc3300 << (sal_uInt32
)0x66ccff;
1075 mpPptEscherEx
->AddAtom( 32, EPP_ColorSchemeAtom
, 0, 6 );
1076 *mpStrm
<< (sal_uInt32
)0xffffff << (sal_uInt32
)0x000000 << (sal_uInt32
)0x333333 << (sal_uInt32
)0x000000 << (sal_uInt32
)0xdddddd << (sal_uInt32
)0x808080 << (sal_uInt32
)0x4d4d4d << (sal_uInt32
)0xeaeaea;
1077 mpPptEscherEx
->AddAtom( 32, EPP_ColorSchemeAtom
, 0, 6 );
1078 *mpStrm
<< (sal_uInt32
)0xffffff << (sal_uInt32
)0x000000 << (sal_uInt32
)0x808080 << (sal_uInt32
)0x000000 << (sal_uInt32
)0x66ccff << (sal_uInt32
)0xff0000 << (sal_uInt32
)0xcc00cc << (sal_uInt32
)0xc0c0c0;
1079 mpPptEscherEx
->AddAtom( 32, EPP_ColorSchemeAtom
, 0, 6 );
1080 *mpStrm
<< (sal_uInt32
)0xffffff << (sal_uInt32
)0x000000 << (sal_uInt32
)0x808080 << (sal_uInt32
)0x000000 << (sal_uInt32
)0xc0c0c0 << (sal_uInt32
)0xff6600 << (sal_uInt32
)0x0000ff << (sal_uInt32
)0x009900;
1081 mpPptEscherEx
->AddAtom( 32, EPP_ColorSchemeAtom
, 0, 6 );
1082 *mpStrm
<< (sal_uInt32
)0xffffff << (sal_uInt32
)0x000000 << (sal_uInt32
)0x808080 << (sal_uInt32
)0x000000 << (sal_uInt32
)0xff9933 << (sal_uInt32
)0xccff99 << (sal_uInt32
)0xcc00cc << (sal_uInt32
)0xb2b2b2;
1084 for ( int nInstance
= EPP_TEXTTYPE_Title
; nInstance
<= EPP_TEXTTYPE_QuarterBody
; nInstance
++ )
1086 if ( nInstance
== EPP_TEXTTYPE_notUsed
)
1089 // the auto color is dependent to the page background,so we have to set a page that is in the right context
1090 if ( nInstance
== EPP_TEXTTYPE_Notes
)
1091 ImplGetPageByIndex( 0, NOTICE
);
1093 ImplGetPageByIndex( 0, MASTER
);
1095 mpPptEscherEx
->BeginAtom();
1097 sal_Bool bFirst
= TRUE
;
1098 sal_Bool bSimpleText
= FALSE
;
1100 *mpStrm
<< (sal_uInt16
)5; // paragraph count
1102 for ( sal_uInt16 nLev
= 0; nLev
< 5; nLev
++ )
1104 if ( nInstance
>= EPP_TEXTTYPE_CenterBody
)
1110 mpStyleSheet
->mpParaSheet
[ nInstance
]->Write( *mpStrm
, mpPptEscherEx
, nLev
, bFirst
, bSimpleText
, mXPagePropSet
);
1111 mpStyleSheet
->mpCharSheet
[ nInstance
]->Write( *mpStrm
, mpPptEscherEx
, nLev
, bFirst
, bSimpleText
, mXPagePropSet
);
1114 mpPptEscherEx
->EndAtom( EPP_TxMasterStyleAtom
, 0, nInstance
);
1116 ImplGetPageByIndex( nPageNum
, MASTER
);
1118 EscherSolverContainer aSolverContainer
;
1120 mpPptEscherEx
->OpenContainer( EPP_PPDrawing
);
1121 mpPptEscherEx
->OpenContainer( ESCHER_DgContainer
);
1123 mpPptEscherEx
->EnterGroup(0,0);
1124 ImplWritePage( pPHLayout
[ 0 ], aSolverContainer
, MASTER
, TRUE
); // Die Shapes der Seite werden im PPT Dok. erzeugt
1125 mpPptEscherEx
->LeaveGroup();
1127 ImplWriteBackground( aXBackgroundPropSet
);
1129 aSolverContainer
.WriteSolver( *mpStrm
);
1131 mpPptEscherEx
->CloseContainer(); // ESCHER_DgContainer
1132 mpPptEscherEx
->CloseContainer(); // EPP_Drawing
1133 mpPptEscherEx
->AddAtom( 32, EPP_ColorSchemeAtom
, 0, 1 );
1134 *mpStrm
<< (sal_uInt32
)0xffffff << (sal_uInt32
)0x000000 << (sal_uInt32
)0x808080 << (sal_uInt32
)0x000000 << (sal_uInt32
)0x99cc00 << (sal_uInt32
)0xcc3333 << (sal_uInt32
)0xffcccc << (sal_uInt32
)0xb2b2b2;
1136 if ( aBuExMasterStream
.Tell() )
1138 ImplProgTagContainer( mpStrm
, &aBuExMasterStream
);
1140 mpPptEscherEx
->CloseContainer(); // EPP_MainMaster
1144 // ---------------------------------------------------------------------------------------------
1146 sal_Bool
PPTWriter::ImplCreateMainNotes()
1148 if ( !ImplGetPageByIndex( 0, NOTICE
) )
1150 ImplSetCurrentStyleSheet( 0 );
1152 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XMasterPageTarget
>
1153 aXMasterPageTarget( mXDrawPage
, ::com::sun::star::uno::UNO_QUERY
);
1155 if ( !aXMasterPageTarget
.is() )
1158 mXDrawPage
= aXMasterPageTarget
->getMasterPage();
1159 if ( !mXDrawPage
.is() )
1162 mXPropSet
= ::com::sun::star::uno::Reference
<
1163 ::com::sun::star::beans::XPropertySet
>
1164 ( mXDrawPage
, ::com::sun::star::uno::UNO_QUERY
);
1165 if ( !mXPropSet
.is() )
1168 mXShapes
= ::com::sun::star::uno::Reference
<
1169 ::com::sun::star::drawing::XShapes
>
1170 ( mXDrawPage
, ::com::sun::star::uno::UNO_QUERY
);
1171 if ( !mXShapes
.is() )
1174 EscherSolverContainer aSolverContainer
;
1176 mpPptEscherEx
->PtReplaceOrInsert( EPP_Persist_MainNotes
, mpStrm
->Tell() );
1177 mpPptEscherEx
->OpenContainer( EPP_Notes
);
1178 mpPptEscherEx
->AddAtom( 8, EPP_NotesAtom
, 1 );
1179 *mpStrm
<< (sal_uInt32
)0x80000001 // Number that identifies this slide
1180 << (sal_uInt32
)0; // follow nothing
1181 mpPptEscherEx
->OpenContainer( EPP_PPDrawing
);
1182 mpPptEscherEx
->OpenContainer( ESCHER_DgContainer
);
1183 mpPptEscherEx
->EnterGroup(0,0);
1185 ImplWritePage( pPHLayout
[ 20 ], aSolverContainer
, NOTICE
, TRUE
);
1187 mpPptEscherEx
->LeaveGroup();
1188 mpPptEscherEx
->OpenContainer( ESCHER_SpContainer
);
1189 mpPptEscherEx
->AddShape( ESCHER_ShpInst_Rectangle
, 0xc00 );
1190 EscherPropertyContainer aPropOpt
;
1191 aPropOpt
.AddOpt( ESCHER_Prop_fillColor
, 0xffffff ); // stock valued fill color
1192 aPropOpt
.AddOpt( ESCHER_Prop_fillBackColor
, 0 );
1193 aPropOpt
.AddOpt( ESCHER_Prop_fillRectRight
, 0x68bdde );
1194 aPropOpt
.AddOpt( ESCHER_Prop_fillRectBottom
, 0x8b9f8e );
1195 aPropOpt
.AddOpt( ESCHER_Prop_fNoFillHitTest
, 0x120012 );
1196 aPropOpt
.AddOpt( ESCHER_Prop_fNoLineDrawDash
, 0 );
1197 aPropOpt
.AddOpt( ESCHER_Prop_bWMode
, ESCHER_wDontShow
);
1198 aPropOpt
.AddOpt( ESCHER_Prop_fBackground
, 0x10001 ); // if true, this is the background shape
1199 aPropOpt
.Commit( *mpStrm
);
1200 mpPptEscherEx
->CloseContainer(); // ESCHER_SpContainer
1202 aSolverContainer
.WriteSolver( *mpStrm
);
1204 mpPptEscherEx
->CloseContainer(); // ESCHER_DgContainer
1205 mpPptEscherEx
->CloseContainer(); // EPP_Drawing
1206 mpPptEscherEx
->AddAtom( 32, EPP_ColorSchemeAtom
, 0, 1 );
1207 *mpStrm
<< (sal_uInt32
)0xffffff << (sal_uInt32
)0x000000 << (sal_uInt32
)0x808080 << (sal_uInt32
)0x000000 << (sal_uInt32
)0x99cc00 << (sal_uInt32
)0xcc3333 << (sal_uInt32
)0xffcccc << (sal_uInt32
)0xb2b2b2;
1208 mpPptEscherEx
->CloseContainer(); // EPP_Notes
1212 // ---------------------------------------------------------------------------------------------
1214 static rtl::OUString
getInitials( const rtl::OUString
& rName
)
1216 rtl::OUString sInitials
;
1218 const sal_Unicode
* pStr
= rName
.getStr();
1219 sal_Int32 nLength
= rName
.getLength();
1224 while( nLength
&& (*pStr
<= ' ') )
1232 sInitials
+= rtl::OUString( *pStr
);
1236 // skip letters until whitespace
1237 while( nLength
&& (*pStr
> ' ') )
1246 void ImplExportComments( uno::Reference
< drawing::XDrawPage
> xPage
, SvMemoryStream
& rBinaryTagData10Atom
)
1250 uno::Reference
< office::XAnnotationAccess
> xAnnotationAccess( xPage
, uno::UNO_QUERY_THROW
);
1251 uno::Reference
< office::XAnnotationEnumeration
> xAnnotationEnumeration( xAnnotationAccess
->createAnnotationEnumeration() );
1253 sal_Int32 nIndex
= 1;
1255 while( xAnnotationEnumeration
->hasMoreElements() )
1257 EscherExContainer
aComment10( rBinaryTagData10Atom
, EPP_Comment10
);
1259 uno::Reference
< office::XAnnotation
> xAnnotation( xAnnotationEnumeration
->nextElement() );
1261 geometry::RealPoint2D
aRealPoint2D( xAnnotation
->getPosition() );
1262 MapMode
aMapDest( MAP_INCH
, Point(), Fraction( 1, 576 ), Fraction( 1, 576 ) );
1263 Point
aPoint( OutputDevice::LogicToLogic( Point( static_cast< sal_Int32
>( aRealPoint2D
.X
* 100.0 ),
1264 static_cast< sal_Int32
>( aRealPoint2D
.Y
* 100.0 ) ), MAP_100TH_MM
, aMapDest
) );
1266 rtl::OUString
sAuthor( xAnnotation
->getAuthor() );
1267 uno::Reference
< text::XText
> xText( xAnnotation
->getTextRange() );
1268 rtl::OUString
sText( xText
->getString() );
1269 rtl::OUString
sInitials( getInitials( sAuthor
) );
1270 util::DateTime
aDateTime( xAnnotation
->getDateTime() );
1271 if ( sAuthor
.getLength() )
1272 PPTWriter::WriteCString( rBinaryTagData10Atom
, sAuthor
, 0 );
1273 if ( sText
.getLength() )
1274 PPTWriter::WriteCString( rBinaryTagData10Atom
, sText
, 1 );
1275 if ( sInitials
.getLength() )
1276 PPTWriter::WriteCString( rBinaryTagData10Atom
, sInitials
, 2 );
1278 sal_Int16 nMilliSeconds
= aDateTime
.HundredthSeconds
* 10;
1279 EscherExAtom
aCommentAtom10( rBinaryTagData10Atom
, EPP_CommentAtom10
);
1280 rBinaryTagData10Atom
<< nIndex
++
1283 << aDateTime
.Day
// todo: day of week
1286 << aDateTime
.Minutes
1287 << aDateTime
.Seconds
1289 << static_cast< sal_Int32
>( aPoint
.X() )
1290 << static_cast< sal_Int32
>( aPoint
.Y() );
1294 catch ( uno::Exception
& )
1299 // ---------------------------------------------------------------------------------------------
1301 sal_Bool
PPTWriter::ImplCreateSlide( sal_uInt32 nPageNum
)
1303 ::com::sun::star::uno::Any aAny
;
1305 if ( !ImplGetPageByIndex( nPageNum
, NORMAL
) )
1307 sal_uInt32 nMasterID
= ImplGetMasterIndex( NORMAL
);
1308 ImplSetCurrentStyleSheet( nMasterID
);
1309 nMasterID
|= 0x80000000;
1311 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> aXBackgroundPropSet
;
1312 sal_Bool bHasBackground
= GetPropertyValue( aAny
, mXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "Background" ) ) );
1313 if ( bHasBackground
)
1314 bHasBackground
= ( aAny
>>= aXBackgroundPropSet
);
1316 sal_uInt16 nMode
= 7; // Bit 1: Follow master objects, Bit 2: Follow master scheme, Bit 3: Follow master background
1317 if ( bHasBackground
)
1320 /* sj: Don't know what's IsBackgroundVisible for, have to ask cl
1321 if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundVisible" ) ) ) )
1323 sal_Bool bBackgroundVisible;
1324 if ( aAny >>= bBackgroundVisible )
1326 if ( bBackgroundVisible )
1331 if ( GetPropertyValue( aAny
, mXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundObjectsVisible" ) ) ) )
1333 sal_Bool bBackgroundObjectsVisible
= sal_False
;
1334 if ( aAny
>>= bBackgroundObjectsVisible
)
1336 if ( !bBackgroundObjectsVisible
)
1341 const PHLayout
& rLayout
= ImplGetLayout( mXPagePropSet
);
1342 mpPptEscherEx
->PtReplaceOrInsert( EPP_Persist_Slide
| nPageNum
, mpStrm
->Tell() );
1343 mpPptEscherEx
->OpenContainer( EPP_Slide
);
1344 mpPptEscherEx
->AddAtom( 24, EPP_SlideAtom
, 2 );
1345 *mpStrm
<< rLayout
.nLayout
;
1346 mpStrm
->Write( rLayout
.nPlaceHolder
, 8 ); // placeholderIDs ( 8Stueck )
1347 *mpStrm
<< (sal_uInt32
)nMasterID
// master ID ( ist gleich 0x80000000 bei einer masterpage )
1348 << (sal_uInt32
)nPageNum
+ 0x100 // notes ID ( ist gleich null wenn keine notizen vorhanden )
1350 << (sal_uInt16
)0; // padword
1353 sal_Bool bVisible
= sal_True
;
1354 ::com::sun::star::presentation::FadeEffect eFe
= ::com::sun::star::presentation::FadeEffect_NONE
;
1356 if ( GetPropertyValue( aAny
, mXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) ) ) )
1358 if ( GetPropertyValue( aAny
, mXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "Change" ) ) ) )
1360 switch ( *(INT32
*)aAny
.getValue() )
1362 case 1 : // automatisch
1364 case 2 : // halbautomatisch
1371 if ( GetPropertyValue( aAny
, mXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "Effect" ) ) ) )
1374 sal_uInt32 nSoundRef
= 0;
1375 sal_Bool bIsSound
= sal_False
;
1376 sal_Bool bStopSound
= sal_False
;
1377 sal_Bool bLoopSound
= sal_False
;
1379 if ( GetPropertyValue( aAny
, mXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "Sound" ) ) ) )
1381 rtl::OUString aSoundURL
;
1382 if ( aAny
>>= aSoundURL
)
1384 nSoundRef
= maSoundCollection
.GetId( aSoundURL
);
1385 bIsSound
= sal_True
;
1388 aAny
>>= bStopSound
;
1390 if ( GetPropertyValue( aAny
, mXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "LoopSound" ) ) ) )
1391 aAny
>>= bLoopSound
;
1394 sal_Bool bNeedsSSSlideInfoAtom
= ( bVisible
== FALSE
)
1395 || ( mnDiaMode
== 2 )
1398 || ( eFe
!= ::com::sun::star::presentation::FadeEffect_NONE
);
1399 if ( bNeedsSSSlideInfoAtom
)
1401 sal_uInt8 nDirection
= 0;
1402 sal_uInt8 nTransitionType
= 0;
1403 sal_uInt16 nBuildFlags
= 1; // advange by mouseclick
1404 INT32 nSlideTime
= 0; // muss noch !!!
1405 sal_uInt8 nSpeed
= 1;
1407 if ( GetPropertyValue( aAny
, mXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "Speed" ) ) ) )
1409 ::com::sun::star::presentation::AnimationSpeed aAs
;
1411 nSpeed
= (sal_uInt8
)aAs
;
1413 sal_Int16 nTT
= 0, nTST
= 0;
1414 if ( GetPropertyValue( aAny
, mXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "TransitionType" ) ) )
1415 && ( aAny
>>= nTT
) )
1417 if ( GetPropertyValue( aAny
, mXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "TransitionSubtype" ) ) )
1418 && ( aAny
>>= nTST
) )
1422 case animations::TransitionType::FADE
:
1424 if ( nTST
== animations::TransitionSubType::CROSSFADE
)
1425 nTransitionType
= PPT_TRANSITION_TYPE_SMOOTHFADE
;
1426 else if ( nTST
== animations::TransitionSubType::FADEOVERCOLOR
)
1427 nTransitionType
= PPT_TRANSITION_TYPE_FADE
;
1430 case PPT_TRANSITION_TYPE_COMB
:
1432 nTransitionType
= PPT_TRANSITION_TYPE_COMB
;
1433 if ( nTST
== animations::TransitionSubType::COMBVERTICAL
)
1437 case animations::TransitionType::PUSHWIPE
:
1439 nTransitionType
= PPT_TRANSITION_TYPE_PUSH
;
1442 case animations::TransitionSubType::FROMRIGHT
: nDirection
= 0; break;
1443 case animations::TransitionSubType::FROMBOTTOM
: nDirection
= 1; break;
1444 case animations::TransitionSubType::FROMLEFT
: nDirection
= 2; break;
1445 case animations::TransitionSubType::FROMTOP
: nDirection
= 3; break;
1449 case animations::TransitionType::PINWHEELWIPE
:
1451 nTransitionType
= PPT_TRANSITION_TYPE_WHEEL
;
1454 case animations::TransitionSubType::ONEBLADE
: nDirection
= 1; break;
1455 case animations::TransitionSubType::TWOBLADEVERTICAL
: nDirection
= 2; break;
1456 case animations::TransitionSubType::THREEBLADE
: nDirection
= 3; break;
1457 case animations::TransitionSubType::FOURBLADE
: nDirection
= 4; break;
1458 case animations::TransitionSubType::EIGHTBLADE
: nDirection
= 8; break;
1462 case animations::TransitionType::FANWIPE
:
1464 nTransitionType
= PPT_TRANSITION_TYPE_WEDGE
;
1467 case animations::TransitionType::ELLIPSEWIPE
:
1469 nTransitionType
= PPT_TRANSITION_TYPE_CIRCLE
;
1472 case animations::TransitionType::FOURBOXWIPE
:
1474 nTransitionType
= PPT_TRANSITION_TYPE_PLUS
;
1477 case animations::TransitionType::IRISWIPE
:
1479 nTransitionType
= PPT_TRANSITION_TYPE_DIAMOND
;
1485 if ( !nTransitionType
)
1490 case ::com::sun::star::presentation::FadeEffect_RANDOM
:
1491 nTransitionType
= PPT_TRANSITION_TYPE_RANDOM
;
1494 case ::com::sun::star::presentation::FadeEffect_HORIZONTAL_STRIPES
:
1496 case ::com::sun::star::presentation::FadeEffect_VERTICAL_STRIPES
:
1497 nTransitionType
= PPT_TRANSITION_TYPE_BLINDS
;
1500 case ::com::sun::star::presentation::FadeEffect_VERTICAL_CHECKERBOARD
:
1502 case ::com::sun::star::presentation::FadeEffect_HORIZONTAL_CHECKERBOARD
:
1503 nTransitionType
= PPT_TRANSITION_TYPE_CHECKER
;
1506 case ::com::sun::star::presentation::FadeEffect_MOVE_FROM_UPPERLEFT
:
1508 case ::com::sun::star::presentation::FadeEffect_MOVE_FROM_UPPERRIGHT
:
1510 case ::com::sun::star::presentation::FadeEffect_MOVE_FROM_LOWERLEFT
:
1512 case ::com::sun::star::presentation::FadeEffect_MOVE_FROM_LOWERRIGHT
:
1514 case ::com::sun::star::presentation::FadeEffect_MOVE_FROM_TOP
:
1516 case ::com::sun::star::presentation::FadeEffect_MOVE_FROM_LEFT
:
1518 case ::com::sun::star::presentation::FadeEffect_MOVE_FROM_BOTTOM
:
1520 case ::com::sun::star::presentation::FadeEffect_MOVE_FROM_RIGHT
:
1521 nTransitionType
= PPT_TRANSITION_TYPE_COVER
;
1524 case ::com::sun::star::presentation::FadeEffect_DISSOLVE
:
1525 nTransitionType
= PPT_TRANSITION_TYPE_DISSOLVE
;
1528 case ::com::sun::star::presentation::FadeEffect_VERTICAL_LINES
:
1530 case ::com::sun::star::presentation::FadeEffect_HORIZONTAL_LINES
:
1531 nTransitionType
= PPT_TRANSITION_TYPE_RANDOM_BARS
;
1534 case ::com::sun::star::presentation::FadeEffect_CLOSE_HORIZONTAL
:
1536 case ::com::sun::star::presentation::FadeEffect_OPEN_HORIZONTAL
:
1538 case ::com::sun::star::presentation::FadeEffect_CLOSE_VERTICAL
:
1540 case ::com::sun::star::presentation::FadeEffect_OPEN_VERTICAL
:
1541 nTransitionType
= PPT_TRANSITION_TYPE_SPLIT
;
1544 case ::com::sun::star::presentation::FadeEffect_FADE_FROM_UPPERLEFT
:
1546 case ::com::sun::star::presentation::FadeEffect_FADE_FROM_UPPERRIGHT
:
1548 case ::com::sun::star::presentation::FadeEffect_FADE_FROM_LOWERLEFT
:
1550 case ::com::sun::star::presentation::FadeEffect_FADE_FROM_LOWERRIGHT
:
1552 nTransitionType
= PPT_TRANSITION_TYPE_STRIPS
;
1555 case ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_LOWERRIGHT
:
1557 case ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_LOWERLEFT
:
1559 case ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_UPPERRIGHT
:
1561 case ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_UPPERLEFT
:
1563 case ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_BOTTOM
:
1565 case ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_RIGHT
:
1567 case ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_TOP
:
1569 case ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_LEFT
:
1570 nTransitionType
= PPT_TRANSITION_TYPE_PULL
;
1573 case ::com::sun::star::presentation::FadeEffect_FADE_FROM_TOP
:
1575 case ::com::sun::star::presentation::FadeEffect_FADE_FROM_LEFT
:
1577 case ::com::sun::star::presentation::FadeEffect_FADE_FROM_BOTTOM
:
1579 case ::com::sun::star::presentation::FadeEffect_FADE_FROM_RIGHT
:
1580 nTransitionType
= PPT_TRANSITION_TYPE_WIPE
;
1583 case ::com::sun::star::presentation::FadeEffect_ROLL_FROM_TOP
:
1585 case ::com::sun::star::presentation::FadeEffect_ROLL_FROM_LEFT
:
1587 case ::com::sun::star::presentation::FadeEffect_ROLL_FROM_BOTTOM
:
1589 case ::com::sun::star::presentation::FadeEffect_ROLL_FROM_RIGHT
:
1590 nTransitionType
= PPT_TRANSITION_TYPE_WIPE
;
1593 case ::com::sun::star::presentation::FadeEffect_FADE_TO_CENTER
:
1595 case ::com::sun::star::presentation::FadeEffect_FADE_FROM_CENTER
:
1596 nTransitionType
= PPT_TRANSITION_TYPE_ZOOM
;
1599 case ::com::sun::star::presentation::FadeEffect_NONE
:
1604 if ( mnDiaMode
== 2 ) // automatic ?
1605 nBuildFlags
|= 0x400;
1606 if ( bVisible
== FALSE
)
1615 if ( GetPropertyValue( aAny
, mXPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "Duration" ) ) ) )// duration of this slide
1616 nSlideTime
= *(INT32
*)aAny
.getValue() << 10; // in ticks
1619 mpPptEscherEx
->AddAtom( 16, EPP_SSSlideInfoAtom
);
1620 *mpStrm
<< nSlideTime
// standtime in ticks
1626 << (sal_uInt8
)0 << (sal_uInt8
)0 << (sal_uInt8
)0;
1629 ImplCreateHeaderFooters( mXPagePropSet
);
1631 EscherSolverContainer aSolverContainer
;
1632 mpPptEscherEx
->OpenContainer( EPP_PPDrawing
);
1633 mpPptEscherEx
->OpenContainer( ESCHER_DgContainer
);
1634 mpPptEscherEx
->EnterGroup(0,0);
1635 ImplWritePage( rLayout
, aSolverContainer
, NORMAL
, FALSE
, nPageNum
); // Die Shapes der Seite werden im PPT Dok. erzeugt
1636 mpPptEscherEx
->LeaveGroup();
1638 if ( bHasBackground
)
1639 ImplWriteBackground( aXBackgroundPropSet
);
1642 mpPptEscherEx
->OpenContainer( ESCHER_SpContainer
);
1643 mpPptEscherEx
->AddShape( ESCHER_ShpInst_Rectangle
, 0xc00 ); // Flags: Connector | Background | HasSpt
1644 EscherPropertyContainer aPropOpt
;
1645 aPropOpt
.AddOpt( ESCHER_Prop_fillRectRight
, PPTtoEMU( maDestPageSize
.Width
) );
1646 aPropOpt
.AddOpt( ESCHER_Prop_fillRectBottom
, PPTtoEMU( maDestPageSize
.Width
) );
1647 aPropOpt
.AddOpt( ESCHER_Prop_fNoFillHitTest
, 0x120012 );
1648 aPropOpt
.AddOpt( ESCHER_Prop_fNoLineDrawDash
, 0x80000 );
1649 aPropOpt
.AddOpt( ESCHER_Prop_bWMode
, ESCHER_wDontShow
);
1650 aPropOpt
.AddOpt( ESCHER_Prop_fBackground
, 0x10001 ); // if true, this is the background shape
1651 aPropOpt
.Commit( *mpStrm
);
1652 mpPptEscherEx
->CloseContainer(); // ESCHER_SpContainer
1655 aSolverContainer
.WriteSolver( *mpStrm
);
1657 mpPptEscherEx
->CloseContainer(); // ESCHER_DgContainer
1658 mpPptEscherEx
->CloseContainer(); // EPP_Drawing
1659 mpPptEscherEx
->AddAtom( 32, EPP_ColorSchemeAtom
, 0, 1 );
1660 *mpStrm
<< (sal_uInt32
)0xffffff << (sal_uInt32
)0x000000 << (sal_uInt32
)0x808080 << (sal_uInt32
)0x000000 << (sal_uInt32
)0x99cc00 << (sal_uInt32
)0xcc3333 << (sal_uInt32
)0xffcccc << (sal_uInt32
)0xb2b2b2;
1662 SvMemoryStream aBinaryTagData10Atom
;
1663 ImplExportComments( mXDrawPage
, aBinaryTagData10Atom
);
1664 if ( mbUseNewAnimations
)
1666 SvMemoryStream amsofbtAnimGroup
;
1667 ppt::AnimationExporter
aExporter( aSolverContainer
, maSoundCollection
);
1668 aExporter
.doexport( mXDrawPage
, amsofbtAnimGroup
);
1669 sal_uInt32 nmsofbtAnimGroupSize
= amsofbtAnimGroup
.Tell();
1670 if ( nmsofbtAnimGroupSize
)
1673 EscherExAtom
aMagic2( aBinaryTagData10Atom
, 0x2eeb );
1674 aBinaryTagData10Atom
<< (sal_uInt32
)0x01c45df9
1675 << (sal_uInt32
)0xe1471b30;
1678 EscherExAtom
aMagic( aBinaryTagData10Atom
, 0x2b00 );
1679 aBinaryTagData10Atom
<< (sal_uInt32
)0;
1681 aBinaryTagData10Atom
.Write( amsofbtAnimGroup
.GetData(), amsofbtAnimGroup
.Tell() );
1683 EscherExContainer
aMagic2( aBinaryTagData10Atom
, 0x2b02 );
1687 if ( aBinaryTagData10Atom
.Tell() )
1689 EscherExContainer
aProgTags ( *mpStrm
, EPP_ProgTags
);
1690 EscherExContainer
aProgBinaryTag( *mpStrm
, EPP_ProgBinaryTag
);
1692 EscherExAtom
aCString( *mpStrm
, EPP_CString
);
1693 *mpStrm
<< (sal_uInt32
)0x5f005f
1694 << (sal_uInt32
)0x50005f
1695 << (sal_uInt32
)0x540050
1697 << (sal_uInt16
)0x30;
1700 EscherExAtom
aBinaryTagData( *mpStrm
, EPP_BinaryTagData
);
1701 mpStrm
->Write( aBinaryTagData10Atom
.GetData(), aBinaryTagData10Atom
.Tell() );
1705 if ( mbUseNewAnimations )
1707 SvMemoryStream amsofbtAnimGroup;
1708 ppt::AnimationExporter aExporter( aSolverContainer, maSoundCollection );
1709 aExporter.doexport( mXDrawPage, amsofbtAnimGroup );
1710 sal_uInt32 nmsofbtAnimGroupSize = amsofbtAnimGroup.Tell();
1711 if ( nmsofbtAnimGroupSize )
1713 EscherExContainer aProgTags ( *mpStrm, EPP_ProgTags );
1714 EscherExContainer aProgBinaryTag( *mpStrm, EPP_ProgBinaryTag );
1716 EscherExAtom aCString( *mpStrm, EPP_CString );
1717 *mpStrm << (sal_uInt32)0x5f005f
1718 << (sal_uInt32)0x50005f
1719 << (sal_uInt32)0x540050
1721 << (sal_uInt16)0x30;
1724 EscherExAtom aBinaryTagData( *mpStrm, EPP_BinaryTagData );
1727 EscherExAtom aMagic2( *mpStrm, 0x2eeb );
1728 *mpStrm << (sal_uInt32)0x01c45df9
1729 << (sal_uInt32)0xe1471b30;
1732 EscherExAtom aMagic( *mpStrm, 0x2b00 );
1733 *mpStrm << (sal_uInt32)0;
1736 mpStrm->Write( amsofbtAnimGroup.GetData(), amsofbtAnimGroup.Tell() );
1738 EscherExContainer aMagic2( *mpStrm, 0x2b02 );
1744 mpPptEscherEx
->CloseContainer(); // EPP_Slide
1748 // ---------------------------------------------------------------------------------------------
1750 sal_Bool
PPTWriter::ImplCreateNotes( sal_uInt32 nPageNum
)
1752 if ( !ImplGetPageByIndex( nPageNum
, NOTICE
) )
1754 ImplSetCurrentStyleSheet( ImplGetMasterIndex( NORMAL
) );
1757 mpPptEscherEx
->PtReplaceOrInsert( EPP_Persist_Notes
| nPageNum
, mpStrm
->Tell() );
1758 mpPptEscherEx
->OpenContainer( EPP_Notes
);
1759 mpPptEscherEx
->AddAtom( 8, EPP_NotesAtom
, 1 );
1760 *mpStrm
<< (sal_uInt32
)nPageNum
+ 0x100
1761 << (sal_uInt16
)3 // follow master ....
1764 ImplCreateHeaderFooters( mXPagePropSet
);
1766 EscherSolverContainer aSolverContainer
;
1768 mpPptEscherEx
->OpenContainer( EPP_PPDrawing
);
1769 mpPptEscherEx
->OpenContainer( ESCHER_DgContainer
);
1770 mpPptEscherEx
->EnterGroup(0,0);
1772 ImplWritePage( pPHLayout
[ 20 ], aSolverContainer
, NOTICE
, FALSE
); // Die Shapes der Seite werden im PPT Dok. erzeugt
1774 mpPptEscherEx
->LeaveGroup();
1775 mpPptEscherEx
->OpenContainer( ESCHER_SpContainer
);
1776 mpPptEscherEx
->AddShape( ESCHER_ShpInst_Rectangle
, 0xc00 ); // Flags: Connector | Background | HasSpt
1777 EscherPropertyContainer aPropOpt
;
1778 aPropOpt
.AddOpt( ESCHER_Prop_fillColor
, 0xffffff ); // stock valued fill color
1779 aPropOpt
.AddOpt( ESCHER_Prop_fillBackColor
, 0 );
1780 aPropOpt
.AddOpt( ESCHER_Prop_fillRectRight
, 0x8b9f8e );
1781 aPropOpt
.AddOpt( ESCHER_Prop_fillRectBottom
, 0x68bdde );
1782 aPropOpt
.AddOpt( ESCHER_Prop_fNoFillHitTest
, 0x120012 );
1783 aPropOpt
.AddOpt( ESCHER_Prop_fNoLineDrawDash
, 0x80000 );
1784 aPropOpt
.AddOpt( ESCHER_Prop_bWMode
, ESCHER_wDontShow
);
1785 aPropOpt
.AddOpt( ESCHER_Prop_fBackground
, 0x10001 );
1786 aPropOpt
.Commit( *mpStrm
);
1787 mpPptEscherEx
->CloseContainer(); // ESCHER_SpContainer
1789 aSolverContainer
.WriteSolver( *mpStrm
);
1791 mpPptEscherEx
->CloseContainer(); // ESCHER_DgContainer
1792 mpPptEscherEx
->CloseContainer(); // EPP_Drawing
1793 mpPptEscherEx
->AddAtom( 32, EPP_ColorSchemeAtom
, 0, 1 );
1794 *mpStrm
<< (sal_uInt32
)0xffffff << (sal_uInt32
)0x000000 << (sal_uInt32
)0x808080 << (sal_uInt32
)0x000000 << (sal_uInt32
)0x99cc00 << (sal_uInt32
)0xcc3333 << (sal_uInt32
)0xffcccc << (sal_uInt32
)0xb2b2b2;
1795 mpPptEscherEx
->CloseContainer(); // EPP_Notes
1799 void PPTWriter::ImplWriteBackground( ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> & rXPropSet
)
1801 //************************ ******
1802 //** DEFAULT BACKGROUND SHAPE **
1803 //******************************
1805 sal_uInt32 nFillColor
= 0xffffff;
1806 sal_uInt32 nFillBackColor
= 0;
1808 mpPptEscherEx
->OpenContainer( ESCHER_SpContainer
);
1809 mpPptEscherEx
->AddShape( ESCHER_ShpInst_Rectangle
, 0xc00 ); // Flags: Connector | Background | HasSpt
1810 Point aEmptyPoint
= Point();
1811 Rectangle
aRect( aEmptyPoint
, Size( 28000, 21000 ) );
1812 EscherPropertyContainer
aPropOpt( (EscherGraphicProvider
&)*mpPptEscherEx
, mpPicStrm
, aRect
);
1813 aPropOpt
.AddOpt( ESCHER_Prop_fillType
, ESCHER_FillSolid
);
1814 ::com::sun::star::drawing::FillStyle
aFS( ::com::sun::star::drawing::FillStyle_NONE
);
1815 if ( ImplGetPropertyValue( rXPropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "FillStyle" ) ) ) )
1820 case ::com::sun::star::drawing::FillStyle_GRADIENT
:
1822 aPropOpt
.CreateGradientProperties( rXPropSet
);
1823 aPropOpt
.AddOpt( ESCHER_Prop_fNoFillHitTest
, 0x1f001e );
1824 aPropOpt
.GetOpt( ESCHER_Prop_fillColor
, nFillColor
);
1825 aPropOpt
.GetOpt( ESCHER_Prop_fillBackColor
, nFillBackColor
);
1829 case ::com::sun::star::drawing::FillStyle_BITMAP
:
1830 aPropOpt
.CreateGraphicProperties( rXPropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapURL" ) ), sal_True
);
1833 case ::com::sun::star::drawing::FillStyle_HATCH
:
1834 aPropOpt
.CreateGraphicProperties( rXPropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "FillHatch" ) ), sal_True
);
1837 case ::com::sun::star::drawing::FillStyle_SOLID
:
1839 if ( ImplGetPropertyValue( rXPropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "FillColor" ) ) ) )
1841 nFillColor
= mpPptEscherEx
->GetColor( *((sal_uInt32
*)mAny
.getValue()) );
1842 nFillBackColor
= nFillColor
^ 0xffffff;
1844 } // PASSTHROUGH INTENDED
1845 case ::com::sun::star::drawing::FillStyle_NONE
:
1847 aPropOpt
.AddOpt( ESCHER_Prop_fNoFillHitTest
, 0x120012 );
1850 aPropOpt
.AddOpt( ESCHER_Prop_fillColor
, nFillColor
);
1851 aPropOpt
.AddOpt( ESCHER_Prop_fillBackColor
, nFillBackColor
);
1852 aPropOpt
.AddOpt( ESCHER_Prop_fillRectRight
, PPTtoEMU( maDestPageSize
.Width
) );
1853 aPropOpt
.AddOpt( ESCHER_Prop_fillRectBottom
, PPTtoEMU( maDestPageSize
.Height
) );
1854 aPropOpt
.AddOpt( ESCHER_Prop_fNoLineDrawDash
, 0x80000 );
1855 aPropOpt
.AddOpt( ESCHER_Prop_bWMode
, ESCHER_bwWhite
);
1856 aPropOpt
.AddOpt( ESCHER_Prop_fBackground
, 0x10001 );
1857 aPropOpt
.Commit( *mpStrm
);
1858 mpPptEscherEx
->CloseContainer(); // ESCHER_SpContainer
1861 void PPTWriter::ImplWriteVBA( SvMemoryStream
* pVBA
)
1865 pVBA
->Seek( STREAM_SEEK_TO_END
);
1866 sal_uInt32 nLen
= pVBA
->Tell();
1870 mnVBAOleOfs
= mpStrm
->Tell();
1871 mpPptEscherEx
->BeginAtom();
1872 mpStrm
->Write( (sal_Int8
*)pVBA
->GetData() + 8, nLen
);
1873 mpPptEscherEx
->EndAtom( EPP_ExOleObjStg
, 0, 1 );
1878 // ---------------------------------------------------------------------------------------------
1880 void PPTWriter::ImplWriteOLE( sal_uInt32 nCnvrtFlags
)
1882 PPTExOleObjEntry
* pPtr
;
1884 SvxMSExportOLEObjects
aOleExport( nCnvrtFlags
);
1886 for ( pPtr
= (PPTExOleObjEntry
*)maExOleObj
.First(); pPtr
;
1887 pPtr
= (PPTExOleObjEntry
*)maExOleObj
.Next() )
1889 SvMemoryStream
* pStrm
= NULL
;
1890 pPtr
->nOfsB
= mpStrm
->Tell();
1891 switch ( pPtr
->eType
)
1893 case NORMAL_OLE_OBJECT
:
1895 SdrObject
* pSdrObj
= GetSdrObjectFromXShape( pPtr
->xShape
);
1896 if ( pSdrObj
&& pSdrObj
->ISA( SdrOle2Obj
) )
1898 ::uno::Reference
< embed::XEmbeddedObject
> xObj( ( (SdrOle2Obj
*) pSdrObj
)->GetObjRef() );
1901 SvStorageRef
xTempStorage( new SvStorage( new SvMemoryStream(), TRUE
) );
1902 aOleExport
.ExportOLEObject( xObj
, *xTempStorage
);
1905 String
aPersistStream( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( SVEXT_PERSIST_STREAM
) ) );
1906 SvMemoryStream aStream
;
1907 SvStorageRef
xCleanStorage( new SvStorage( FALSE
, aStream
) );
1908 xTempStorage
->CopyTo( xCleanStorage
);
1909 // SJ: #99809# create a dummy content stream, the dummy content is necessary for ppt, but not for
1910 // doc files, so we can't share code.
1911 SotStorageStreamRef xStm
= xCleanStorage
->OpenSotStream( aPersistStream
, STREAM_STD_READWRITE
);
1912 *xStm
<< (sal_uInt32
)0 // no ClipboardId
1913 << (sal_uInt32
)4 // no target device
1914 << (sal_uInt32
)1 // aspect ratio
1915 << (sal_Int32
)-1 // L-Index
1916 << (sal_uInt32
)0 // Advanced Flags
1917 << (sal_uInt32
)0 // compression
1918 << (sal_uInt32
)0 // Size
1919 << (sal_uInt32
)0 // "
1921 pStrm
= xCleanStorage
->CreateMemoryStream();
1929 if ( pPtr
->xControlModel
.is() )
1932 ::com::sun::star::awt::Size aSize
;
1933 SvStorageRef
xDest( new SvStorage( new SvMemoryStream(), TRUE
) );
1934 sal_Bool bOk
= SvxMSConvertOCXControls::WriteOCXStream( xDest
, pPtr
->xControlModel
, aSize
, aName
);
1936 pStrm
= xDest
->CreateMemoryStream();
1942 mpPptEscherEx
->BeginAtom();
1943 pStrm
->Seek( STREAM_SEEK_TO_END
);
1944 sal_uInt32 npStrmSize
= pStrm
->Tell();
1945 *mpStrm
<< npStrmSize
; // uncompressed size
1947 #ifdef DBG_EXTRACTOLEOBJECTS
1948 SvFileStream
aOut( String::CreateFromAscii( "D:\\OUT.OLE" ), STREAM_TRUNC
| STREAM_WRITE
);
1950 aOut
.Write( pStrm
->GetData(), npStrmSize
);
1954 ZCodec
aZCodec( 0x8000, 0x8000 );
1955 aZCodec
.BeginCompression();
1956 aZCodec
.Compress( *pStrm
, *mpStrm
);
1957 aZCodec
.EndCompression();
1959 mpPptEscherEx
->EndAtom( EPP_ExOleObjStg
, 0, 1 );
1964 // ---------------------------------------------------------------------------------------------
1965 // PersistantTable und UserEditAtom schreiben
1967 sal_Bool
PPTWriter::ImplWriteAtomEnding()
1970 #define EPP_LastViewTypeNone 0
1971 #define EPP_LastViewTypeSlideView 1
1972 #define EPP_LastViewTypeOutlineView 2
1973 #define EPP_LastViewTypeNotes 3
1976 sal_uInt32 i
, nPos
, nOfs
, nPersistOfs
= mpStrm
->Tell();
1977 sal_uInt32 nPersistEntrys
= 0;
1978 *mpStrm
<< (sal_uInt32
)0 << (sal_uInt32
)0 << (sal_uInt32
)0; // Record Header und ersten Eintrag ueberspringen
1980 // Document pesist schreiben
1982 *mpStrm
<< (sal_uInt32
)0;
1983 // MasterPages persists schreiben
1984 for ( i
= 0; i
< mnMasterPages
; i
++ )
1986 nOfs
= mpPptEscherEx
->PtGetOffsetByID( EPP_Persist_MainMaster
| i
);
1990 mpPptEscherEx
->InsertAtPersistOffset( EPP_MAINMASTER_PERSIST_KEY
| i
, ++nPersistEntrys
);
1993 // MainNotesMaster persist schreiben
1994 nOfs
= mpPptEscherEx
->PtGetOffsetByID( EPP_Persist_MainNotes
);
1998 mpPptEscherEx
->InsertAtPersistOffset( EPP_MAINNOTESMASTER_PERSIST_KEY
, ++nPersistEntrys
);
2000 // Slide persists schreiben -> es gilt hier auch den EPP_SlidePersistAtome mit einem gueltigen wert zu beschreiben
2001 for ( i
= 0; i
< mnPages
; i
++ )
2003 nOfs
= mpPptEscherEx
->PtGetOffsetByID( EPP_Persist_Slide
| i
);
2007 mpPptEscherEx
->InsertAtPersistOffset( EPP_MAINSLIDE_PERSIST_KEY
| i
, ++nPersistEntrys
);
2010 // Notes persists schreiben
2011 for ( i
= 0; i
< mnPages
; i
++ )
2013 nOfs
= mpPptEscherEx
->PtGetOffsetByID( EPP_Persist_Notes
| i
);
2017 mpPptEscherEx
->InsertAtPersistOffset( EPP_MAINNOTES_PERSIST_KEY
| i
, ++nPersistEntrys
);
2021 PPTExOleObjEntry
* pPtr
;
2022 for ( pPtr
= (PPTExOleObjEntry
*)maExOleObj
.First(); pPtr
; pPtr
= (PPTExOleObjEntry
*)maExOleObj
.Next() )
2024 nOfs
= mpPptEscherEx
->PtGetOffsetByID( EPP_Persist_ExObj
);
2028 *mpStrm
<< pPtr
->nOfsB
;
2029 sal_uInt32 nOldPos
, nPersOfs
= nOfs
+ pPtr
->nOfsA
+ 16 + 8; // 8 bytes atom header, +16 to the persist entry
2030 nOldPos
= mpStrm
->Tell();
2031 mpStrm
->Seek( nPersOfs
);
2032 *mpStrm
<< nPersistEntrys
;
2033 mpStrm
->Seek( nOldPos
);
2037 if ( mnVBAOleOfs
&& mpVBA
)
2039 nOfs
= mpPptEscherEx
->PtGetOffsetByID( EPP_Persist_VBAInfoAtom
);
2049 *mpStrm
<< mnVBAOleOfs
;
2050 sal_uInt32 nOldPos
= mpStrm
->Tell();
2051 mpStrm
->Seek( nOfs
); // Fill the VBAInfoAtom with the correct index to the persisttable
2052 *mpStrm
<< nPersistEntrys
2055 mpStrm
->Seek( nOldPos
);
2059 nPos
= mpStrm
->Tell();
2060 mpStrm
->Seek( nPersistOfs
);
2061 mpPptEscherEx
->AddAtom( ( nPersistEntrys
+ 1 ) << 2, EPP_PersistPtrIncrementalBlock
); // Record Header eintragen
2062 *mpStrm
<< (sal_uInt32
)( ( nPersistEntrys
<< 20 ) | 1 );
2063 mpStrm
->Seek( nPos
);
2065 *mpCurUserStrm
<< (sal_uInt32
)nPos
; // offset to current edit setzen
2066 mpPptEscherEx
->AddAtom( 28, EPP_UserEditAtom
);
2067 *mpStrm
<< (INT32
)0x100 // last slide ID
2068 << (sal_uInt32
)0x03000dbc // minor and major app version that did the save
2069 << (sal_uInt32
)0 // offset last save, 0 after a full save
2070 << nPersistOfs
// File offset to persist pointers for this save operation
2071 << (sal_uInt32
)1 // Persist reference to the document persist object
2072 << (sal_uInt32
)nPersistEntrys
// max persists written, Seed value for persist object id management
2073 << (sal_Int16
)EPP_LastViewTypeSlideView
// last view type
2074 << (sal_Int16
)0x12; // padword
2079 // ---------------------------------------------------------------------------------------------
2081 PPTExCharSheet::PPTExCharSheet( int nInstance
)
2083 sal_uInt16 nFontHeight
= 24;
2085 for ( int nDepth
= 0; nDepth
< 5; nDepth
++ )
2087 PPTExCharLevel
& rLev
= maCharLevel
[ nDepth
];
2088 switch ( nInstance
)
2090 case EPP_TEXTTYPE_Title
:
2091 case EPP_TEXTTYPE_CenterTitle
:
2094 case EPP_TEXTTYPE_Body
:
2095 case EPP_TEXTTYPE_CenterBody
:
2096 case EPP_TEXTTYPE_HalfBody
:
2097 case EPP_TEXTTYPE_QuarterBody
:
2101 case 0 : nFontHeight
= 32; break;
2102 case 1 : nFontHeight
= 28; break;
2103 case 2 : nFontHeight
= 24; break;
2104 default :nFontHeight
= 20; break;
2108 case EPP_TEXTTYPE_Notes
:
2111 case EPP_TEXTTYPE_notUsed
:
2112 case EPP_TEXTTYPE_Other
:
2118 rLev
.mnAsianOrComplexFont
= 0xffff;
2119 rLev
.mnFontHeight
= nFontHeight
;
2120 rLev
.mnFontColor
= 0;
2121 rLev
.mnEscapement
= 0;
2126 void PPTExCharSheet::SetStyleSheet( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> & rXPropSet
,
2127 FontCollection
& rFontCollection
, int nLevel
)
2129 PortionObj
aPortionObj( rXPropSet
, rFontCollection
);
2131 PPTExCharLevel
& rLev
= maCharLevel
[ nLevel
];
2133 if ( aPortionObj
.meCharColor
== ::com::sun::star::beans::PropertyState_DIRECT_VALUE
)
2134 rLev
.mnFontColor
= aPortionObj
.mnCharColor
;
2135 if ( aPortionObj
.meCharEscapement
== ::com::sun::star::beans::PropertyState_DIRECT_VALUE
)
2136 rLev
.mnEscapement
= aPortionObj
.mnCharEscapement
;
2137 if ( aPortionObj
.meCharHeight
== ::com::sun::star::beans::PropertyState_DIRECT_VALUE
)
2138 rLev
.mnFontHeight
= aPortionObj
.mnCharHeight
;
2139 if ( aPortionObj
.meFontName
== ::com::sun::star::beans::PropertyState_DIRECT_VALUE
)
2140 rLev
.mnFont
= aPortionObj
.mnFont
;
2141 if ( aPortionObj
.meAsianOrComplexFont
== ::com::sun::star::beans::PropertyState_DIRECT_VALUE
)
2142 rLev
.mnAsianOrComplexFont
= aPortionObj
.mnAsianOrComplexFont
;
2143 rLev
.mnFlags
= aPortionObj
.mnCharAttr
;
2146 void PPTExCharSheet::Write( SvStream
& rSt
, PptEscherEx
*, sal_uInt16 nLev
, sal_Bool
, sal_Bool bSimpleText
,
2147 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> & rPagePropSet
)
2149 const PPTExCharLevel
& rLev
= maCharLevel
[ nLev
];
2151 sal_uInt32 nCharFlags
= 0xefffff;
2153 nCharFlags
= 0x7ffff;
2159 sal_uInt32 nFontColor
= rLev
.mnFontColor
;
2160 if ( nFontColor
== COL_AUTO
)
2162 sal_Bool bIsDark
= sal_False
;
2163 ::com::sun::star::uno::Any aAny
;
2164 if ( PropValue::GetPropertyValue( aAny
, rPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundDark" ) ), sal_True
) )
2166 nFontColor
= bIsDark
? 0xffffff : 0x000000;
2168 nFontColor
&= 0xffffff;
2169 nFontColor
|= 0xfe000000;
2172 rSt
<< rLev
.mnFontHeight
2177 rSt
<< rLev
.mnAsianOrComplexFont
2178 << (sal_uInt16
)0xffff // unbekannt
2179 << (sal_uInt16
)0xffff // unbekannt
2180 << rLev
.mnFontHeight
2182 << rLev
.mnEscapement
;
2186 PPTExParaSheet::PPTExParaSheet( int nInstance
, sal_uInt16 nDefaultTab
, PPTExBulletProvider
& rProv
) :
2188 mnInstance ( nInstance
)
2190 sal_Bool bHasBullet
= FALSE
;
2192 sal_uInt16 nUpperDist
= 0;
2193 sal_uInt16 nBulletChar
= 0x2022;
2194 sal_uInt16 nBulletOfs
= 0;
2195 sal_uInt16 nTextOfs
= 0;
2197 for ( int nDepth
= 0; nDepth
< 5; nDepth
++ )
2199 PPTExParaLevel
& rLev
= maParaLevel
[ nDepth
];
2200 switch ( nInstance
)
2202 case EPP_TEXTTYPE_Title
:
2203 case EPP_TEXTTYPE_CenterTitle
:
2205 case EPP_TEXTTYPE_Body
:
2206 case EPP_TEXTTYPE_CenterBody
:
2207 case EPP_TEXTTYPE_HalfBody
:
2208 case EPP_TEXTTYPE_QuarterBody
:
2214 case EPP_TEXTTYPE_Notes
:
2219 // case EPP_TEXTTYPE_notUsed :
2220 // case EPP_TEXTTYPE_Other :
2227 nBulletChar
= 0x2022;
2229 nTextOfs
= ( bHasBullet
) ? 0xd8 : 0;
2234 nBulletChar
= 0x2013;
2241 nBulletChar
= 0x2022;
2248 nBulletChar
= 0x2013;
2261 rLev
.mbIsBullet
= bHasBullet
;
2262 rLev
.mnBulletChar
= nBulletChar
;
2263 rLev
.mnBulletFont
= 0;
2264 rLev
.mnBulletHeight
= 100;
2265 rLev
.mnBulletColor
= 0;
2267 rLev
.mnLineFeed
= 100;
2268 rLev
.mnLowerDist
= 0;
2269 rLev
.mnUpperDist
= nUpperDist
;
2270 rLev
.mnTextOfs
= nTextOfs
;
2271 rLev
.mnBulletOfs
= nBulletOfs
;
2272 rLev
.mnDefaultTab
= nDefaultTab
;
2273 rLev
.mnAsianSettings
= 2;
2276 rLev
.mbExtendedBulletsUsed
= FALSE
;
2277 rLev
.mnBulletId
= 0xffff;
2278 rLev
.mnBulletStart
= 0;
2279 rLev
.mnMappedNumType
= 0;
2280 rLev
.mnNumberingType
= 0;
2284 void PPTExParaSheet::SetStyleSheet( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> & rXPropSet
,
2285 FontCollection
& rFontCollection
, int nLevel
, const PPTExCharLevel
& rCharLevel
)
2287 ParagraphObj
aParagraphObj( rXPropSet
, rBuProv
);
2288 aParagraphObj
.CalculateGraphicBulletSize( rCharLevel
.mnFontHeight
);
2289 PPTExParaLevel
& rLev
= maParaLevel
[ nLevel
];
2291 if ( aParagraphObj
.meTextAdjust
== ::com::sun::star::beans::PropertyState_DIRECT_VALUE
)
2292 rLev
.mnAdjust
= aParagraphObj
.mnTextAdjust
;
2293 if ( aParagraphObj
.meLineSpacing
== ::com::sun::star::beans::PropertyState_DIRECT_VALUE
)
2295 sal_Int16 nLineSpacing
= aParagraphObj
.mnLineSpacing
;
2296 if ( nLineSpacing
> 0 ) // if nLinespacing is < 0 the linespacing is an absolute spacing
2298 sal_Bool bFixedLineSpacing
= sal_False
;
2299 uno::Any aAny
= rXPropSet
->getPropertyValue( ::rtl::OUString(
2300 RTL_CONSTASCII_USTRINGPARAM(
2301 "FontIndependentLineSpacing" ) ) );
2302 if( !(aAny
>>= bFixedLineSpacing
) || !bFixedLineSpacing
)
2304 const FontCollectionEntry
* pDesc
= rFontCollection
.GetById( rCharLevel
.mnFont
);
2306 nLineSpacing
= (sal_Int16
)( (double)nLineSpacing
* pDesc
->Scaling
+ 0.5 );
2311 if ( rCharLevel
.mnFontHeight
> (sal_uInt16
)( ((double)-nLineSpacing
) * 0.001 * 72.0 / 2.54 ) ) // 1/100mm to point
2313 const FontCollectionEntry
* pDesc
= rFontCollection
.GetById( rCharLevel
.mnFont
);
2315 nLineSpacing
= (sal_Int16
)( (double)100.0 * pDesc
->Scaling
+ 0.5 );
2320 nLineSpacing
= (sal_Int16
)( (double)nLineSpacing
/ 4.40972 );
2322 rLev
.mnLineFeed
= nLineSpacing
;
2324 if ( aParagraphObj
.meLineSpacingBottom
== ::com::sun::star::beans::PropertyState_DIRECT_VALUE
)
2325 rLev
.mnLowerDist
= aParagraphObj
.mnLineSpacingBottom
;
2326 if ( aParagraphObj
.meLineSpacingTop
== ::com::sun::star::beans::PropertyState_DIRECT_VALUE
)
2327 rLev
.mnUpperDist
= aParagraphObj
.mnLineSpacingTop
;
2328 if ( aParagraphObj
.meForbiddenRules
== ::com::sun::star::beans::PropertyState_DIRECT_VALUE
)
2330 rLev
.mnAsianSettings
&=~1;
2331 if ( aParagraphObj
.mbForbiddenRules
)
2332 rLev
.mnAsianSettings
|= 1;
2334 if ( aParagraphObj
.meParagraphPunctation
== ::com::sun::star::beans::PropertyState_DIRECT_VALUE
)
2336 rLev
.mnAsianSettings
&=~4;
2337 if ( aParagraphObj
.mbParagraphPunctation
)
2338 rLev
.mnAsianSettings
|= 4;
2341 if ( aParagraphObj
.meBiDi
== ::com::sun::star::beans::PropertyState_DIRECT_VALUE
)
2342 rLev
.mnBiDi
= aParagraphObj
.mnBiDi
;
2344 rLev
.mbIsBullet
= aParagraphObj
.mbIsBullet
; //( ( aParagraphObj.nBulletFlags & 1 ) != 0 );
2348 if ( ( aParagraphObj
.meBullet
== ::com::sun::star::beans::PropertyState_DIRECT_VALUE
)
2349 && aParagraphObj
.bExtendedParameters
)
2351 for ( sal_Int16 i
= 0; i
< 5; i
++ )
2353 PPTExParaLevel
& rLevel
= maParaLevel
[ i
];
2355 aParagraphObj
.ImplGetNumberingLevel( rBuProv
, i
, FALSE
);
2356 // rLevel.mbIsBullet = ( ( aParagraphObj.nBulletFlags & 1 ) != 0 );
2357 rLevel
.mnTextOfs
= aParagraphObj
.nTextOfs
;
2358 rLevel
.mnBulletOfs
= (sal_uInt16
)aParagraphObj
.nBulletOfs
;
2359 rLevel
.mnBulletChar
= aParagraphObj
.cBulletId
;
2360 FontCollectionEntry
aFontDescEntry( aParagraphObj
.aFontDesc
.Name
, aParagraphObj
.aFontDesc
.Family
,
2361 aParagraphObj
.aFontDesc
.Pitch
, aParagraphObj
.aFontDesc
.CharSet
);
2362 rLevel
.mnBulletFont
= (sal_uInt16
)rFontCollection
.GetId( aFontDescEntry
);
2363 rLevel
.mnBulletHeight
= aParagraphObj
.nBulletRealSize
;
2364 rLevel
.mnBulletColor
= aParagraphObj
.nBulletColor
;
2366 rLevel
.mbExtendedBulletsUsed
= aParagraphObj
.bExtendedBulletsUsed
;
2367 rLevel
.mnBulletId
= aParagraphObj
.nBulletId
;
2368 rLevel
.mnNumberingType
= aParagraphObj
.nNumberingType
;
2369 rLevel
.mnBulletStart
= aParagraphObj
.nStartWith
;
2370 rLevel
.mnMappedNumType
= aParagraphObj
.nMappedNumType
;
2376 void PPTExParaSheet::Write( SvStream
& rSt
, PptEscherEx
*, sal_uInt16 nLev
, sal_Bool
, sal_Bool bSimpleText
,
2377 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> & rPagePropSet
)
2379 const PPTExParaLevel
& rLev
= maParaLevel
[ nLev
];
2381 if ( maParaLevel
[ 0 ].mbExtendedBulletsUsed
|| maParaLevel
[ 1 ].mbExtendedBulletsUsed
||
2382 maParaLevel
[ 2 ].mbExtendedBulletsUsed
|| maParaLevel
[ 3 ].mbExtendedBulletsUsed
||
2383 maParaLevel
[ 4 ].mbExtendedBulletsUsed
)
2385 SvStream
& rOut
= rBuProv
.aBuExMasterStream
;
2388 rOut
<< (sal_uInt32
)( ( EPP_PST_ExtendedParagraphMasterAtom
<< 16 ) | ( mnInstance
<< 4 ) )
2389 << (sal_uInt32
)( 5 * 16 + 2 )
2390 << (sal_uInt16
)5; // depth
2392 sal_uInt16 nBulletId
= rLev
.mnBulletId
;
2393 if ( rLev
.mnNumberingType
!= SVX_NUM_BITMAP
)
2395 rOut
<< (sal_uInt32
)0x03800000
2396 << (sal_uInt16
)nBulletId
2397 << (sal_uInt32
)rLev
.mnMappedNumType
2398 << (sal_uInt16
)rLev
.mnBulletStart
2402 sal_uInt32 nParaFlags
= 0x3ffdff;
2403 sal_uInt16 nBulletFlags
= ( rLev
.mbIsBullet
) ? 0xf : 0xe;
2406 nParaFlags
&= 0x207fff;
2408 nParaFlags
&= 0x7fff;
2409 sal_uInt32 nBulletColor
= rLev
.mnBulletColor
;
2410 if ( nBulletColor
== COL_AUTO
)
2412 sal_Bool bIsDark
= sal_False
;
2413 ::com::sun::star::uno::Any aAny
;
2414 if ( PropValue::GetPropertyValue( aAny
, rPagePropSet
, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundDark" ) ), sal_True
) )
2416 nBulletColor
= bIsDark
? 0xffffff : 0x000000;
2418 nBulletColor
&= 0xffffff;
2419 nBulletColor
|= 0xfe000000;
2422 << rLev
.mnBulletChar
2423 << rLev
.mnBulletFont
2424 << rLev
.mnBulletHeight
2431 << rLev
.mnBulletOfs
;
2433 if ( bSimpleText
|| nLev
)
2435 if ( nParaFlags
& 0x200000 )
2440 rSt
<< rLev
.mnDefaultTab
2443 << rLev
.mnAsianSettings
2449 PPTExStyleSheet::PPTExStyleSheet( sal_uInt16 nDefaultTab
, PPTExBulletProvider
& rBuProv
)
2451 for ( int nInstance
= EPP_TEXTTYPE_Title
; nInstance
<= EPP_TEXTTYPE_QuarterBody
; nInstance
++ )
2453 mpParaSheet
[ nInstance
] = ( nInstance
== EPP_TEXTTYPE_notUsed
) ? NULL
: new PPTExParaSheet( nInstance
, nDefaultTab
, rBuProv
);
2454 mpCharSheet
[ nInstance
] = ( nInstance
== EPP_TEXTTYPE_notUsed
) ? NULL
: new PPTExCharSheet( nInstance
);
2458 PPTExStyleSheet::~PPTExStyleSheet()
2460 for ( int nInstance
= EPP_TEXTTYPE_Title
; nInstance
<= EPP_TEXTTYPE_QuarterBody
; nInstance
++ )
2462 if ( nInstance
== EPP_TEXTTYPE_notUsed
)
2465 delete mpParaSheet
[ nInstance
];
2466 delete mpCharSheet
[ nInstance
];
2470 void PPTExStyleSheet::SetStyleSheet( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> & rXPropSet
,
2471 FontCollection
& rFontCollection
, int nInstance
, int nLevel
)
2473 if ( nInstance
== EPP_TEXTTYPE_notUsed
)
2475 mpCharSheet
[ nInstance
]->SetStyleSheet( rXPropSet
, rFontCollection
, nLevel
);
2476 mpParaSheet
[ nInstance
]->SetStyleSheet( rXPropSet
, rFontCollection
, nLevel
, mpCharSheet
[ nInstance
]->maCharLevel
[ nLevel
] );
2479 sal_Bool
PPTExStyleSheet::IsHardAttribute( sal_uInt32 nInstance
, sal_uInt32 nLevel
, PPTExTextAttr eAttr
, sal_uInt32 nValue
)
2481 const PPTExParaLevel
& rPara
= mpParaSheet
[ nInstance
]->maParaLevel
[ nLevel
];
2482 const PPTExCharLevel
& rChar
= mpCharSheet
[ nInstance
]->maCharLevel
[ nLevel
];
2484 sal_uInt32 nFlag
= 0;
2488 case ParaAttr_BulletOn
: return ( rPara
.mbIsBullet
) ? ( nValue
) ? FALSE
: TRUE
: ( nValue
) ? TRUE
: FALSE
;
2489 case ParaAttr_BuHardFont
:
2490 case ParaAttr_BulletFont
: return ( rPara
.mnBulletFont
!= nValue
);
2491 case ParaAttr_BuHardColor
:
2492 case ParaAttr_BulletColor
: return ( rPara
.mnBulletColor
!= nValue
);
2493 case ParaAttr_BuHardHeight
:
2494 case ParaAttr_BulletHeight
: return ( rPara
.mnBulletHeight
!= nValue
);
2495 case ParaAttr_BulletChar
: return ( rPara
.mnBulletChar
!= nValue
);
2496 case ParaAttr_Adjust
: return ( rPara
.mnAdjust
!= nValue
);
2497 case ParaAttr_LineFeed
: return ( rPara
.mnLineFeed
!= nValue
);
2498 case ParaAttr_UpperDist
: return ( rPara
.mnUpperDist
!= nValue
);
2499 case ParaAttr_LowerDist
: return ( rPara
.mnLowerDist
!= nValue
);
2500 case ParaAttr_TextOfs
: return ( rPara
.mnTextOfs
!= nValue
);
2501 case ParaAttr_BulletOfs
: return ( rPara
.mnBulletOfs
!= nValue
);
2502 case ParaAttr_DefaultTab
: return ( rPara
.mnDefaultTab
!= nValue
);
2503 case ParaAttr_BiDi
: return ( rPara
.mnBiDi
!= nValue
);
2504 case CharAttr_Bold
: nFlag
= 1; break;
2505 case CharAttr_Italic
: nFlag
= 2; break;
2506 case CharAttr_Underline
: nFlag
= 4; break;
2507 case CharAttr_Shadow
: nFlag
= 16; break;
2508 case CharAttr_Strikeout
: nFlag
= 256; break;
2509 case CharAttr_Embossed
: nFlag
= 512; break;
2510 case CharAttr_Font
: return ( rChar
.mnFont
!= nValue
);
2511 case CharAttr_AsianOrComplexFont
: return ( rChar
.mnAsianOrComplexFont
!= nValue
);
2512 case CharAttr_Symbol
: return TRUE
;
2513 case CharAttr_FontHeight
: return ( rChar
.mnFontHeight
!= nValue
);
2514 case CharAttr_FontColor
: return ( rChar
.mnFontColor
!= nValue
);
2515 case CharAttr_Escapement
: return ( rChar
.mnEscapement
!= nValue
);
2521 if ( rChar
.mnFlags
& nFlag
)
2522 return ( ( nValue
& nFlag
) == 0 );
2524 return ( ( nValue
& nFlag
) != 0 );
2529 sal_uInt32
PPTExStyleSheet::SizeOfTxCFStyleAtom() const
2534 // the TxCFStyleAtom stores the text properties that are used
2535 // when creating new objects in PowerPoint.
2537 void PPTExStyleSheet::WriteTxCFStyleAtom( SvStream
& rSt
)
2539 const PPTExCharLevel
& rCharStyle
= mpCharSheet
[ EPP_TEXTTYPE_Other
]->maCharLevel
[ 0 ];
2541 sal_uInt16 nFlags
= 0x60 // ??
2543 | 0x04; // fontcolor
2545 sal_uInt32 nCharFlags
= rCharStyle
.mnFlags
;
2546 nCharFlags
&= CharAttr_Italic
| CharAttr_Bold
| CharAttr_Underline
| CharAttr_Shadow
;
2548 rSt
<< (sal_uInt32
)( EPP_TxCFStyleAtom
<< 16 ) // recordheader
2549 << SizeOfTxCFStyleAtom() - 8
2550 << (sal_uInt16
)( 0x80 | nCharFlags
)
2551 << (sal_uInt16
)nFlags
2552 << (sal_uInt16
)nCharFlags
2553 << (sal_Int32
)-1 // ?
2554 << rCharStyle
.mnFontHeight
2555 << rCharStyle
.mnFontColor
;
2559 // ---------------------------------------------------------------------------------------------
2561 // ---------------------
2562 // - exported function -
2563 // ---------------------
2565 extern "C" SAL_DLLPUBLIC_EXPORT BOOL __LOADONCALLAPI
ExportPPT( SvStorageRef
& rSvStorage
,
2566 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> & rXModel
,
2567 ::com::sun::star::uno::Reference
< ::com::sun::star::task::XStatusIndicator
> & rXStatInd
,
2568 SvMemoryStream
* pVBA
, sal_uInt32 nCnvrtFlags
)
2570 PPTWriter
* pPPTWriter
;
2571 BOOL bStatus
= FALSE
;
2573 pPPTWriter
= new PPTWriter( rSvStorage
, rXModel
, rXStatInd
, pVBA
, nCnvrtFlags
);
2576 bStatus
= ( pPPTWriter
->IsValid() == TRUE
);