Update to m13
[ooovba.git] / applied_patches / 0833-pptx-snapshot-at-ooxml03-creation.diff
blob64ea660a49959a232dbdb7b44192bb68f321c9d5
1 # For the purpose of the 3.1 release, instead of sharing the binary and ooxml
2 # export, we introduce a separate sd/source/filter/pptx that creates libxlsx -
3 # a filter for the PPTX files. After the release, the changes will be
4 # reverted so that the binary and ooxml are shared again.
5 # The changes include:
6 # sd/source/filter/eppt/* -> sd/source/filter/pptx/pptx-*
7 # scp2 bits were commented out
8 # sd/util/makefile.mk commented out
9 # sd/source/filter/pptx/makefile.mk commented out
10 diff --git filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu
11 index 0fcdc21..3f125ec 100644
12 --- filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu
13 +++ filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML.xcu
14 @@ -1,5 +1,5 @@
15 <node oor:name="Impress MS PowerPoint 2007 XML" oor:op="replace">
16 - <prop oor:name="Flags"><value>IMPORT ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
17 + <prop oor:name="Flags"><value>IMPORT EXPORT ALIEN 3RDPARTYFILTER PREFERRED</value></prop>
18 <prop oor:name="UIComponent"/>
19 <prop oor:name="FilterService"><value>com.sun.star.comp.Impress.oox.PowerPointImport</value></prop>
20 <prop oor:name="UserData"/>
21 diff --git filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu
22 index f080848..d74fd60 100644
23 --- filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu
24 +++ filter/source/config/fragments/filters/impress_MS_PowerPoint_2007_XML_Template.xcu
25 @@ -1,5 +1,5 @@
26 <node oor:name="Impress MS PowerPoint 2007 XML Template" oor:op="replace">
27 - <prop oor:name="Flags"><value>IMPORT ALIEN 3RDPARTYFILTER TEMPLATE TEMPLATEPATH PREFERRED</value></prop>
28 + <prop oor:name="Flags"><value>IMPORT EXPORT ALIEN 3RDPARTYFILTER TEMPLATE TEMPLATEPATH PREFERRED</value></prop>
29 <prop oor:name="UIComponent"/>
30 <prop oor:name="FilterService"><value>com.sun.star.comp.Impress.oox.PowerPointImport</value></prop>
31 <prop oor:name="UserData"/>
32 --- filter/source/config/fragments/types/MS_PowerPoint_2007_XML.xcu
33 +++ filter/source/config/fragments/types/MS_PowerPoint_2007_XML.xcu
34 @@ -1,7 +1,7 @@
35 <node oor:name="MS PowerPoint 2007 XML" oor:op="replace" >
36 <prop oor:name="DetectService"><value>com.sun.star.comp.oox.FormatDetector</value></prop>
37 <prop oor:name="URLPattern"/>
38 - <prop oor:name="Extensions"><value>pptm pptx</value></prop>
39 + <prop oor:name="Extensions"><value>pptx pptm</value></prop>
40 <prop oor:name="MediaType"/>
41 <prop oor:name="Preferred"><value>true</value></prop>
42 <prop oor:name="PreferredFilter"><value>Impress MS PowerPoint 2007 XML</value></prop>
43 diff --git oox/inc/oox/ppt/pptimport.hxx oox/inc/oox/ppt/pptimport.hxx
44 index 6d4fd19..4fe5c43 100644
45 --- oox/inc/oox/ppt/pptimport.hxx
46 +++ oox/inc/oox/ppt/pptimport.hxx
47 @@ -70,6 +70,9 @@ public:
48 std::vector< SlidePersistPtr >& getMasterPages(){ return maMasterPages; };
49 std::vector< SlidePersistPtr >& getNotesPages(){ return maNotesPages; };
51 + virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rDescriptor )
52 + throw( ::com::sun::star::uno::RuntimeException );
54 private:
55 virtual ::rtl::OUString implGetImplementationName() const;
57 diff --git oox/source/ppt/pptimport.cxx oox/source/ppt/pptimport.cxx
58 index 421987d..d360d8b 100644
59 --- oox/source/ppt/pptimport.cxx
60 +++ oox/source/ppt/pptimport.cxx
61 @@ -39,6 +39,9 @@ using namespace ::com::sun::star::uno;
62 using namespace ::com::sun::star::xml::sax;
63 using namespace oox::core;
65 +using ::com::sun::star::beans::PropertyValue;
66 +using ::com::sun::star::lang::XComponent;
68 namespace oox { namespace ppt {
70 OUString SAL_CALL PowerPointImport_getImplementationName() throw()
71 @@ -93,6 +96,29 @@ const ::oox::drawingml::Theme* PowerPointImport::getCurrentTheme() const
72 return mpActualSlidePersist ? mpActualSlidePersist->getTheme().get() : 0;
75 +sal_Bool SAL_CALL PowerPointImport::filter( const Sequence< PropertyValue >& rDescriptor ) throw( RuntimeException )
77 + if( XmlFilterBase::filter( rDescriptor ) )
78 + return true;
80 + if( isExportFilter() ) {
81 + Reference< XExporter > xExporter( getGlobalFactory()->createInstance( CREATE_OUSTRING( "com.sun.star.comp.Impress.oox.PowerPointExport" ) ), UNO_QUERY );
83 + if( xExporter.is() ) {
84 + Reference< XComponent > xDocument( getModel(), UNO_QUERY );
85 + Reference< XFilter > xFilter( xExporter, UNO_QUERY );
87 + if( xFilter.is() ) {
88 + xExporter->setSourceDocument( xDocument );
89 + if( xFilter->filter( rDescriptor ) )
90 + return true;
91 + }
92 + }
93 + }
95 + return false;
98 sal_Int32 PowerPointImport::getSchemeClr( sal_Int32 nColorSchemeToken ) const
100 sal_Int32 nColor = 0;
101 # commented out for the libpptx --- scp2/source/ooo/file_ooo.scp
102 # commented out for the libpptx +++ scp2/source/ooo/file_ooo.scp
103 # commented out for the libpptx @@ -359,7 +359,7 @@ End
104 # commented out for the libpptx
105 # commented out for the libpptx STD_FILTER_FILE( gid_File_Filter_Eme, eme)
106 # commented out for the libpptx
107 # commented out for the libpptx -STD_FILTER_FILE_PATCH( gid_File_Filter_Sdfilt, sdfilt)
108 # commented out for the libpptx +STD_UNO_LIB_FILE_PATCH( gid_File_Filter_Sdfilt, sdfilt)
109 # commented out for the libpptx
110 # commented out for the libpptx STD_FILTER_FILE( gid_File_Filter_Icg, icg)
111 # commented out for the libpptx
112 # commented out for the libpptx diff --git sd/prj/build.lst sd/prj/build.lst
113 index c5ed381..d43ce1a 100644
114 --- sd/prj/build.lst
115 +++ sd/prj/build.lst
116 @@ -1,4 +1,4 @@
117 -sd sd : animations svx stoc uui canvas NULL
118 +sd sd : animations svx stoc uui canvas slideshow oox NULL
119 sd sd usr1 - all sd_mkout NULL
120 sd sd\inc nmake - all sd_inc NULL
121 sd sd\prj get - all sd_prj NULL
122 diff --git sd/source/filter/eppt/NOTES sd/source/filter/eppt/NOTES
123 new file mode 100644
124 index 0000000..1e2f168
125 --- /dev/null
126 +++ sd/source/filter/pptx/pptx-NOTES
127 @@ -0,0 +1,2 @@
128 +* ParaAdjust of empty text paragraph in shapes is by default set to left, but
129 +should be set to center. Same problem exist for ppt as well as pptx export
130 diff --git sd/source/filter/eppt/eppt.cxx sd/source/filter/eppt/eppt.cxx
131 index 29f6829..9a6c761 100644
132 --- sd/source/filter/pptx/pptx-eppt.cxx
133 +++ sd/source/filter/pptx/pptx-eppt.cxx
134 @@ -59,62 +59,13 @@
135 #include <svx/msdffimp.hxx>
136 #include <svx/flditem.hxx>
137 #include <sfx2/docinf.hxx>
138 +#include <oox/export/utils.hxx>
140 -#define PPT_TRANSITION_TYPE_NONE 0
141 -#define PPT_TRANSITION_TYPE_RANDOM 1
142 -#define PPT_TRANSITION_TYPE_BLINDS 2
143 -#define PPT_TRANSITION_TYPE_CHECKER 3
144 -#define PPT_TRANSITION_TYPE_COVER 4
145 -#define PPT_TRANSITION_TYPE_DISSOLVE 5
146 -#define PPT_TRANSITION_TYPE_FADE 6
147 -#define PPT_TRANSITION_TYPE_PULL 7
148 -#define PPT_TRANSITION_TYPE_RANDOM_BARS 8
149 -#define PPT_TRANSITION_TYPE_STRIPS 9
150 -#define PPT_TRANSITION_TYPE_WIPE 10
151 -#define PPT_TRANSITION_TYPE_ZOOM 11
152 -#define PPT_TRANSITION_TYPE_SPLIT 13
154 -// effects, new in xp
155 -#define PPT_TRANSITION_TYPE_DIAMOND 17
156 -#define PPT_TRANSITION_TYPE_PLUS 18
157 -#define PPT_TRANSITION_TYPE_WEDGE 19
158 -#define PPT_TRANSITION_TYPE_PUSH 20
159 -#define PPT_TRANSITION_TYPE_COMB 21
160 -#define PPT_TRANSITION_TYPE_NEWSFLASH 22
161 -#define PPT_TRANSITION_TYPE_SMOOTHFADE 23
162 -#define PPT_TRANSITION_TYPE_WHEEL 26
163 -#define PPT_TRANSITION_TYPE_CIRCLE 27
165 -using namespace com::sun::star;
167 -static PHLayout pPHLayout[] =
169 - { EPP_LAYOUT_TITLESLIDE, { 0x0d, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x10, TRUE, TRUE, FALSE },
170 - { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, TRUE, TRUE, FALSE },
171 - { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, TRUE, TRUE, FALSE },
172 - { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, TRUE, TRUE, TRUE },
173 - { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, TRUE, TRUE, FALSE },
174 - { EPP_LAYOUT_BLANCSLIDE, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, FALSE, FALSE, FALSE },
175 - { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x0e, TRUE, TRUE, FALSE },
176 - { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x14, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, TRUE, TRUE, FALSE },
177 - { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x15, 0x0d, 0x0e, TRUE, FALSE, FALSE },
178 - { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x16, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x0e, TRUE, TRUE, FALSE },
179 - { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE, TRUE, FALSE },
180 - { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE, FALSE, FALSE },
181 - { EPP_LAYOUT_RIGHTCOLUMN2ROWS, { 0x0d, 0x0e, 0x13, 0x13, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE, TRUE, FALSE },
182 - { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE, TRUE, FALSE },
183 - { EPP_LAYOUT_2ROWSANDTITLE, { 0x0d, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE, TRUE, FALSE },
184 - { EPP_LAYOUT_LEFTCOLUMN2ROWS, { 0x0d, 0x13, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE, TRUE, FALSE },
185 - { EPP_LAYOUT_TOPROW2COLUMN, { 0x0d, 0x13, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE, TRUE, FALSE },
186 - { EPP_LAYOUT_2ROWSANDTITLE, { 0x0d, 0x0e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE, TRUE, FALSE },
187 - { EPP_LAYOUT_4OBJECTS, { 0x0d, 0x13, 0x13, 0x13, 0x13, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE, FALSE, FALSE },
188 - { EPP_LAYOUT_ONLYTITLE, { 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, TRUE, FALSE, FALSE },
189 - { EPP_LAYOUT_BLANCSLIDE, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, FALSE, FALSE, FALSE },
190 - { EPP_LAYOUT_TITLERIGHT2BODIESLEFT, { 0x11, 0x12, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x11, 0x12, TRUE, TRUE, FALSE },
191 - { EPP_LAYOUT_TITLERIGHTBODYLEFT, { 0x11, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x11, 0x12, TRUE, TRUE, FALSE },
192 - { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x12, TRUE, TRUE, FALSE },
193 - { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x16, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x12, TRUE, TRUE, FALSE }
195 +using namespace ::com::sun::star;
196 +using namespace ::com::sun::star::uno;
197 +using namespace ::com::sun::star::presentation;
199 +using ::com::sun::star::beans::XPropertySet;
201 //============================ PPTWriter ==================================
203 @@ -122,16 +73,12 @@ PPTWriter::PPTWriter( SvStorageRef& rSvStorage,
204 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & rXModel,
205 ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > & rXStatInd,
206 SvMemoryStream* pVBA, sal_uInt32 nCnvrtFlags ) :
207 + PPTWriterBase ( rXModel, rXStatInd ),
208 + mnCnvrtFlags ( nCnvrtFlags ),
209 mbStatus ( sal_False ),
210 mbUseNewAnimations ( sal_True ),
211 mnLatestStatValue ( 0 ),
212 - maFraction ( 1, 576 ),
213 - maMapModeSrc ( MAP_100TH_MM ),
214 - maMapModeDest ( MAP_INCH, Point(), maFraction, maFraction ),
215 - meLatestPageType ( NORMAL ),
216 - mXModel ( rXModel ),
217 - mXStatusIndicator ( rXStatInd ),
218 - mbStatusIndicator ( FALSE ),
219 + mrStg ( rSvStorage ),
220 mpCurUserStrm ( NULL ),
221 mpStrm ( NULL ),
222 mpPicStrm ( NULL ),
223 @@ -143,38 +90,10 @@ PPTWriter::PPTWriter( SvStorageRef& rSvStorage,
224 mnPagesWritten ( 0 ),
225 mnTxId ( 0x7a2f64 )
227 - sal_uInt32 i;
228 - if ( !ImplInitSOIface() )
229 - return;
231 - FontCollectionEntry aDefaultFontDesc( String( RTL_CONSTASCII_USTRINGPARAM( "Times New Roman" ) ),
232 - ::com::sun::star::awt::FontFamily::ROMAN,
233 - ::com::sun::star::awt::FontPitch::VARIABLE,
234 - RTL_TEXTENCODING_MS_1252 );
235 - maFontCollection.GetId( aDefaultFontDesc ); // default is always times new roman
237 - if ( !ImplGetPageByIndex( 0, NOTICE ) )
238 - return;
239 - INT32 nWidth = 21000;
240 - if ( ImplGetPropertyValue( mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ) ) )
241 - mAny >>= nWidth;
242 - INT32 nHeight = 29700;
243 - if ( ImplGetPropertyValue( mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ) )
244 - mAny >>= nHeight;
246 - maNotesPageSize = ImplMapSize( ::com::sun::star::awt::Size( nWidth, nHeight ) );
249 - if ( !ImplGetPageByIndex( 0, MASTER ) )
250 - return;
251 - nWidth = 28000;
252 - if ( ImplGetPropertyValue( mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ) ) )
253 - mAny >>= nWidth;
254 - nHeight = 21000;
255 - if ( ImplGetPropertyValue( mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ) )
256 - mAny >>= nHeight;
257 - maDestPageSize = ImplMapSize( ::com::sun::star::awt::Size( nWidth, nHeight ) );
259 - mrStg = rSvStorage;
260 +void PPTWriter::exportPPTPre()
262 if ( !mrStg.Is() )
263 return;
265 @@ -203,32 +122,10 @@ PPTWriter::PPTWriter( SvStorageRef& rSvStorage,
266 mpPicStrm = mrStg->OpenSotStream( String( RTL_CONSTASCII_USTRINGPARAM( "Pictures" ) ) );
268 mpPptEscherEx = new PptEscherEx( *mpStrm, mnDrawings );
271 - if ( !ImplGetStyleSheets() )
272 - return;
274 - if ( !ImplCreateDocument() )
275 - return;
277 - for ( i = 0; i < mnMasterPages; i++ )
279 - if ( !ImplCreateMaster( i ) )
280 - return;
282 - if ( !ImplCreateMainNotes() )
283 - return;
284 - maTextRuleList.First(); // rewind list, so we can get the current or next entry without
285 - // searching, all entrys are sorted#
286 - for ( i = 0; i < mnPages; i++ )
288 - if ( !ImplCreateSlide( i ) )
289 - return;
291 - for ( i = 0; i < mnPages; i++ )
293 - if ( !ImplCreateNotes( i ) )
294 - return;
296 +void PPTWriter::exportPPTPost()
298 if ( !ImplCloseDocument() )
299 return;
301 @@ -243,19 +140,328 @@ PPTWriter::PPTWriter( SvStorageRef& rSvStorage,
305 - ImplWriteOLE( nCnvrtFlags );
306 + ImplWriteOLE();
308 - ImplWriteVBA( pVBA );
309 + ImplWriteVBA();
311 if ( !ImplWriteAtomEnding() )
312 return;
314 - if ( !ImplCreateDocumentSummaryInformation( nCnvrtFlags ) )
315 + if ( !ImplCreateDocumentSummaryInformation() )
316 return;
318 mbStatus = TRUE;
322 +// ---------------------------------------------------------------------------------------------
324 +void PPTWriter::ImplWriteSlide( sal_uInt32 nPageNum, sal_uInt32 nMasterNum, sal_uInt16 nMode,
325 + sal_Bool bHasBackground, Reference< XPropertySet > aXBackgroundPropSet )
327 + Any aAny;
329 + const PHLayout& rLayout = GetLayout( mXPagePropSet );
330 + mpPptEscherEx->PtReplaceOrInsert( EPP_Persist_Slide | nPageNum, mpStrm->Tell() );
331 + mpPptEscherEx->OpenContainer( EPP_Slide );
332 + mpPptEscherEx->AddAtom( 24, EPP_SlideAtom, 2 );
333 + *mpStrm << rLayout.nLayout;
334 + mpStrm->Write( rLayout.nPlaceHolder, 8 ); // placeholderIDs ( 8Stueck )
335 + *mpStrm << (sal_uInt32)(nMasterNum | 0x80000000) // master ID ( ist gleich 0x80000000 bei einer masterpage )
336 + << (sal_uInt32)nPageNum + 0x100 // notes ID ( ist gleich null wenn keine notizen vorhanden )
337 + << nMode
338 + << (sal_uInt16)0; // padword
340 + mnDiaMode = 0;
341 + sal_Bool bVisible = sal_True;
342 + FadeEffect eFe = FadeEffect_NONE;
344 + if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) ) ) )
345 + aAny >>= bVisible;
346 + if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Change" ) ) ) )
348 + switch ( *(INT32*)aAny.getValue() )
350 + case 1 : // automatisch
351 + mnDiaMode++;
352 + case 2 : // halbautomatisch
353 + mnDiaMode++;
354 + default :
355 + case 0 : // manuell
356 + break;
359 + if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Effect" ) ) ) )
360 + aAny >>= eFe;
362 + sal_uInt32 nSoundRef = 0;
363 + sal_Bool bIsSound = sal_False;
364 + sal_Bool bStopSound = sal_False;
365 + sal_Bool bLoopSound = sal_False;
367 + if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Sound" ) ) ) )
369 + rtl::OUString aSoundURL;
370 + if ( aAny >>= aSoundURL )
372 + nSoundRef = maSoundCollection.GetId( aSoundURL );
373 + bIsSound = sal_True;
375 + else
376 + aAny >>= bStopSound;
378 + if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "LoopSound" ) ) ) )
379 + aAny >>= bLoopSound;
382 + sal_Bool bNeedsSSSlideInfoAtom = ( bVisible == FALSE )
383 + || ( mnDiaMode == 2 )
384 + || ( bIsSound )
385 + || ( bStopSound )
386 + || ( eFe != FadeEffect_NONE );
388 + if ( bNeedsSSSlideInfoAtom )
390 + sal_uInt8 nDirection = 0;
391 + sal_uInt8 nTransitionType = 0;
392 + sal_uInt16 nBuildFlags = 1; // advange by mouseclick
393 + INT32 nSlideTime = 0; // muss noch !!!
394 + sal_uInt8 nSpeed = 1;
396 + if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Speed" ) ) ) )
398 + AnimationSpeed aAs;
399 + aAny >>= aAs;
400 + nSpeed = (sal_uInt8)aAs;
403 + sal_Int16 nTT = 0, nTST = 0;
404 + if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TransitionType" ) ) )
405 + && ( aAny >>= nTT ) )
406 + if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TransitionSubtype" ) ) )
407 + && ( aAny >>= nTST ) )
408 + nTransitionType = GetTransition( nTT, nTST, eFe, nDirection );
410 + if( !nTransitionType )
411 + nTransitionType = GetTransition( eFe, nDirection );
413 + if ( mnDiaMode == 2 ) // automatic ?
414 + nBuildFlags |= 0x400;
415 + if ( bVisible == FALSE )
416 + nBuildFlags |= 4;
417 + if ( bIsSound )
418 + nBuildFlags |= 16;
419 + if ( bLoopSound )
420 + nBuildFlags |= 64;
421 + if ( bStopSound )
422 + nBuildFlags |= 256;
424 + if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Duration" ) ) ) )// duration of this slide
425 + nSlideTime = *(INT32*)aAny.getValue() << 10; // in ticks
428 + mpPptEscherEx->AddAtom( 16, EPP_SSSlideInfoAtom );
429 + *mpStrm << nSlideTime // standtime in ticks
430 + << nSoundRef
431 + << nDirection
432 + << nTransitionType
433 + << nBuildFlags
434 + << nSpeed
435 + << (sal_uInt8)0 << (sal_uInt8)0 << (sal_uInt8)0;
438 + ImplCreateHeaderFooters( mXPagePropSet );
440 + EscherSolverContainer aSolverContainer;
441 + mpPptEscherEx->OpenContainer( EPP_PPDrawing );
442 + mpPptEscherEx->OpenContainer( ESCHER_DgContainer );
443 + mpPptEscherEx->EnterGroup(0,0);
444 + ImplWritePage( rLayout, aSolverContainer, NORMAL, FALSE, nPageNum ); // Die Shapes der Seite werden im PPT Dok. erzeugt
445 + mpPptEscherEx->LeaveGroup();
447 + if ( bHasBackground )
448 + ImplWriteBackground( aXBackgroundPropSet );
449 + else
451 + mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
452 + mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xc00 ); // Flags: Connector | Background | HasSpt
453 + EscherPropertyContainer aPropOpt;
454 + aPropOpt.AddOpt( ESCHER_Prop_fillRectRight, PPTtoEMU( maDestPageSize.Width ) );
455 + aPropOpt.AddOpt( ESCHER_Prop_fillRectBottom, PPTtoEMU( maDestPageSize.Width ) );
456 + aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x120012 );
457 + aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x80000 );
458 + aPropOpt.AddOpt( ESCHER_Prop_bWMode, ESCHER_wDontShow );
459 + aPropOpt.AddOpt( ESCHER_Prop_fBackground, 0x10001 ); // if true, this is the background shape
460 + aPropOpt.Commit( *mpStrm );
461 + mpPptEscherEx->CloseContainer(); // ESCHER_SpContainer
464 + aSolverContainer.WriteSolver( *mpStrm );
466 + mpPptEscherEx->CloseContainer(); // ESCHER_DgContainer
467 + mpPptEscherEx->CloseContainer(); // EPP_Drawing
468 + mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 1 );
469 + *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;
471 + if ( mbUseNewAnimations )
473 + SvMemoryStream amsofbtAnimGroup;
474 + ppt::AnimationExporter aExporter( aSolverContainer, maSoundCollection );
475 + aExporter.doexport( mXDrawPage, amsofbtAnimGroup );
476 + sal_uInt32 nmsofbtAnimGroupSize = amsofbtAnimGroup.Tell();
477 + if ( nmsofbtAnimGroupSize )
479 + EscherExContainer aProgTags ( *mpStrm, EPP_ProgTags );
480 + EscherExContainer aProgBinaryTag( *mpStrm, EPP_ProgBinaryTag );
482 + EscherExAtom aCString( *mpStrm, EPP_CString );
483 + *mpStrm << (sal_uInt32)0x5f005f
484 + << (sal_uInt32)0x50005f
485 + << (sal_uInt32)0x540050
486 + << (sal_uInt16)0x31
487 + << (sal_uInt16)0x30;
490 + EscherExAtom aBinaryTagData( *mpStrm, EPP_BinaryTagData );
493 + EscherExAtom aMagic2( *mpStrm, 0x2eeb );
494 + *mpStrm << (sal_uInt32)0x01c45df9
495 + << (sal_uInt32)0xe1471b30;
498 + EscherExAtom aMagic( *mpStrm, 0x2b00 );
499 + *mpStrm << (sal_uInt32)0;
502 + mpStrm->Write( amsofbtAnimGroup.GetData(), amsofbtAnimGroup.Tell() );
504 + EscherExContainer aMagic2( *mpStrm, 0x2b02 );
509 + mpPptEscherEx->CloseContainer(); // EPP_Slide
512 +// ---------------------------------------------------------------------------------------------
514 +void PPTWriter::ImplWriteSlideMaster( sal_uInt32 nPageNum, Reference< XPropertySet > aXBackgroundPropSet )
516 + sal_uInt32 nFillColor = 0xffffff;
517 + sal_uInt32 nFillBackColor = 0x000000;
519 + ::com::sun::star::drawing::FillStyle aFS = ::com::sun::star::drawing::FillStyle_NONE;
520 + if ( ImplGetPropertyValue( aXBackgroundPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillStyle" ) ) ) )
521 + mAny >>= aFS;
522 + switch ( aFS )
524 + case ::com::sun::star::drawing::FillStyle_GRADIENT :
526 + if ( ImplGetPropertyValue( aXBackgroundPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillGradient" ) ) ) )
528 + nFillColor = EscherPropertyContainer::GetGradientColor( (::com::sun::star::awt::Gradient*)mAny.getValue(), 0 );
529 + nFillBackColor = EscherPropertyContainer::GetGradientColor( (::com::sun::star::awt::Gradient*)mAny.getValue(), 1 );
532 + break;
534 + case ::com::sun::star::drawing::FillStyle_SOLID :
536 + if ( ImplGetPropertyValue( aXBackgroundPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillColor" ) ) ) )
538 + nFillColor = mpPptEscherEx->GetColor( *((sal_uInt32*)mAny.getValue()) );
539 + nFillBackColor = nFillColor ^ 0xffffff;
542 + break;
544 + default:
545 + break;
548 + mpPptEscherEx->PtReplaceOrInsert( EPP_Persist_MainMaster | nPageNum, mpStrm->Tell() );
549 + mpPptEscherEx->OpenContainer( EPP_MainMaster );
550 + mpPptEscherEx->AddAtom( 24, EPP_SlideAtom, 2 );
551 + *mpStrm << (INT32)EPP_LAYOUT_TITLEANDBODYSLIDE // slide layout -> title and body slide
552 + << (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
553 + << (sal_uInt32)0 // master ID ( ist gleich null bei einer masterpage )
554 + << (sal_uInt32)0 // notes ID ( ist gleich null wenn keine notizen vorhanden )
555 + << (sal_uInt16)0 // Bit 1: Follow master objects, Bit 2: Follow master scheme, Bit 3: Follow master background
556 + << (sal_uInt16)0; // padword
558 + mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 6 );
559 + *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;
560 + mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 6 );
561 + *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;
562 + mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 6 );
563 + *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;
564 + mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 6 );
565 + *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;
566 + mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 6 );
567 + *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;
568 + mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 6 );
569 + *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;
570 + mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 6 );
571 + *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;
573 + for ( int nInstance = EPP_TEXTTYPE_Title; nInstance <= EPP_TEXTTYPE_QuarterBody; nInstance++ )
575 + if ( nInstance == EPP_TEXTTYPE_notUsed )
576 + continue;
578 + // the auto color is dependent to the page background,so we have to set a page that is in the right context
579 + if ( nInstance == EPP_TEXTTYPE_Notes )
580 + GetPageByIndex( 0, NOTICE );
581 + else
582 + GetPageByIndex( 0, MASTER );
584 + mpPptEscherEx->BeginAtom();
586 + sal_Bool bFirst = TRUE;
587 + sal_Bool bSimpleText = FALSE;
589 + *mpStrm << (sal_uInt16)5; // paragraph count
591 + for ( sal_uInt16 nLev = 0; nLev < 5; nLev++ )
593 + if ( nInstance >= EPP_TEXTTYPE_CenterBody )
595 + bFirst = FALSE;
596 + bSimpleText = TRUE;
597 + *mpStrm << nLev;
599 + mpStyleSheet->mpParaSheet[ nInstance ]->Write( *mpStrm, mpPptEscherEx, nLev, bFirst, bSimpleText, mXPagePropSet );
600 + mpStyleSheet->mpCharSheet[ nInstance ]->Write( *mpStrm, mpPptEscherEx, nLev, bFirst, bSimpleText, mXPagePropSet );
601 + bFirst = FALSE;
603 + mpPptEscherEx->EndAtom( EPP_TxMasterStyleAtom, 0, nInstance );
605 + GetPageByIndex( nPageNum, MASTER );
607 + EscherSolverContainer aSolverContainer;
609 + mpPptEscherEx->OpenContainer( EPP_PPDrawing );
610 + mpPptEscherEx->OpenContainer( ESCHER_DgContainer );
612 + mpPptEscherEx->EnterGroup(0,0);
613 + ImplWritePage( GetLayout(0), aSolverContainer, MASTER, TRUE ); // Die Shapes der Seite werden im PPT Dok. erzeugt
614 + mpPptEscherEx->LeaveGroup();
616 + ImplWriteBackground( aXBackgroundPropSet );
618 + aSolverContainer.WriteSolver( *mpStrm );
620 + mpPptEscherEx->CloseContainer(); // ESCHER_DgContainer
621 + mpPptEscherEx->CloseContainer(); // EPP_Drawing
622 + mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 1 );
623 + *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;
625 + if ( aBuExMasterStream.Tell() )
627 + ImplProgTagContainer( mpStrm, &aBuExMasterStream );
629 + mpPptEscherEx->CloseContainer(); // EPP_MainMaster
632 // ---------------------------------------------------------------------------------------------
634 @@ -277,16 +483,6 @@ PPTWriter::~PPTWriter()
635 delete (EPPTHyperlink*)pPtr;
636 for ( pPtr = maExOleObj.First(); pPtr; pPtr = maExOleObj.Next() )
637 delete (PPTExOleObjEntry*)pPtr;
639 - if ( mbStatusIndicator )
640 - mXStatusIndicator->end();
643 -// ---------------------------------------------------------------------------------------------
645 -static inline sal_uInt32 PPTtoEMU( INT32 nPPT )
647 - return (sal_uInt32)( (double)nPPT * 1587.5 );
650 // ---------------------------------------------------------------------------------------------
651 @@ -323,7 +519,7 @@ sal_Bool PPTWriter::ImplCreateCurrentUserStream()
653 // ---------------------------------------------------------------------------------------------
655 -sal_Bool PPTWriter::ImplCreateDocumentSummaryInformation( sal_uInt32 nCnvrtFlags )
656 +sal_Bool PPTWriter::ImplCreateDocumentSummaryInformation()
658 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
659 mXModel, uno::UNO_QUERY_THROW);
660 @@ -353,10 +549,10 @@ sal_Bool PPTWriter::ImplCreateDocumentSummaryInformation( sal_uInt32 nCnvrtFlags
661 aHyperSeq[j] = pBlob[j];
664 - if ( nCnvrtFlags & 0x8000 )
665 + if ( mnCnvrtFlags & 0x8000 )
667 uno::Sequence<sal_uInt8> aThumbSeq;
668 - if ( ImplGetPageByIndex( 0, NORMAL ) &&
669 + if ( GetPageByIndex( 0, NORMAL ) &&
670 ImplGetPropertyValue( mXPagePropSet,
671 String( RTL_CONSTASCII_USTRINGPARAM( "PreviewBitmap" ) ) ) )
673 @@ -543,13 +739,13 @@ sal_Bool PPTWriter::ImplCreateDocument()
674 mpPptEscherEx->OpenContainer( EPP_HeadersFooters, 3 ); //Master footer (default)
675 mpPptEscherEx->AddAtom( 4, EPP_HeadersFootersAtom );
676 *mpStrm << (sal_uInt32)0x25000d;
677 - if ( ImplGetPageByIndex( 0, MASTER ) )
678 + if ( GetPageByIndex( 0, MASTER ) )
679 ImplCreateHeaderFooterStrings( *mpStrm, mXPagePropSet );
680 mpPptEscherEx->CloseContainer();
681 mpPptEscherEx->OpenContainer( EPP_HeadersFooters, 4 ); //NotesMaster footer (default)
682 mpPptEscherEx->AddAtom( 4, EPP_HeadersFootersAtom );
683 *mpStrm << (sal_uInt32)0x3d000d;
684 - if ( ImplGetPageByIndex( 0, NOTICE ) )
685 + if ( GetPageByIndex( 0, NOTICE ) )
686 ImplCreateHeaderFooterStrings( *mpStrm, mXPagePropSet );
687 mpPptEscherEx->CloseContainer();
689 @@ -575,11 +771,11 @@ sal_Bool PPTWriter::ImplCreateDocument()
690 << (INT32)i + 0x100 // slideId - Unique slide identifier, used for OLE link monikers for example
691 << (sal_uInt32)0; // reserved, usualy 0
693 - if ( !ImplGetPageByIndex( i, NORMAL ) ) // sehr aufregend: noch einmal ueber alle seiten
694 + if ( !GetPageByIndex( i, NORMAL ) ) // sehr aufregend: noch einmal ueber alle seiten
695 return FALSE;
696 - ImplSetCurrentStyleSheet( ImplGetMasterIndex( NORMAL ) );
697 + SetCurrentStyleSheet( GetMasterIndex( NORMAL ) );
699 - const PHLayout& rLayout = ImplGetLayout( mXPagePropSet );
700 + const PHLayout& rLayout = GetLayout( mXPagePropSet );
702 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed >
703 aXName( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
704 @@ -600,7 +796,7 @@ sal_Bool PPTWriter::ImplCreateDocument()
706 for ( sal_uInt32 nIndex = 0; nIndex < nShapes; nIndex++ )
708 - if ( !ImplGetShapeByIndex( nIndex ) )
709 + if ( !GetShapeByIndex( nIndex ) )
710 continue;
712 if ( mbPresObj && ( ( mType == "presentation.Outliner" ) || ( mType == "presentation.Subtitle" ) ) )
713 @@ -626,7 +822,7 @@ sal_Bool PPTWriter::ImplCreateDocument()
715 if ( ( nIndex + 1 ) < nShapes )
717 - if ( ImplGetShapeByIndex( nIndex + 1 ) && mType == "presentation.Outliner" )
718 + if ( GetShapeByIndex( nIndex + 1 ) && mType == "presentation.Outliner" )
720 bSecOutl = TRUE;
721 TextRuleEntry* pTempRule = new TextRuleEntry( i );
722 @@ -681,24 +877,13 @@ sal_Bool PPTWriter::ImplCreateDocument()
723 mpPptEscherEx->OpenContainer( EPP_SlideListWithText, 2 ); // Animation info fuer die notes
724 for( i = 0; i < mnPages; i++ )
726 - if ( !ImplGetPageByIndex( i, NOTICE ) )
727 + if ( !GetPageByIndex( i, NOTICE ) )
728 return FALSE;
730 - nShapes = mXShapes->getCount();
732 - bOtherThanPlaceHolders = FALSE;
733 - if ( nShapes )
735 - for ( sal_uInt32 nIndex = 0; ( nIndex < nShapes ) && ( bOtherThanPlaceHolders == FALSE ); nIndex++ )
737 - if ( ImplGetShapeByIndex( nIndex ) && ( mType != "drawing.Page" ) )
738 - bOtherThanPlaceHolders = TRUE;
741 mpPptEscherEx->AddAtom( 20, EPP_SlidePersistAtom );
742 mpPptEscherEx->InsertPersistOffset( EPP_MAINNOTES_PERSIST_KEY | i, mpStrm->Tell() );
743 *mpStrm << (sal_uInt32)0
744 - << (sal_uInt32)( ( bOtherThanPlaceHolders ) ? 4 : 0 )
745 + << (sal_uInt32)( ( ContainsOtherShapeThanPlaceholders( FALSE ) ) ? 4 : 0 )
746 << (INT32)0
747 << (INT32)i + 0x100
748 << (sal_uInt32)0;
749 @@ -816,7 +1001,7 @@ sal_Bool PPTWriter::ImplCreateDocument()
750 *mpStrm << (sal_uInt16)( pCustomShow[ i ] );
753 - for ( i = nCustomShowNameLen; i < 32; i++, *mpStrm << (sal_uInt16)0 ) ;
754 + for ( i = nCustomShowNameLen; i < 32; i++, *mpStrm << (sal_uInt16)0 ) {}
756 *mpStrm << nFlags;
757 ::com::sun::star::uno::Reference< ::com::sun::star::presentation::XCustomPresentationSupplier >
758 @@ -845,7 +1030,7 @@ sal_Bool PPTWriter::ImplCreateDocument()
759 nNamedShowLen = 31;
760 mpPptEscherEx->AddAtom( nNamedShowLen << 1, EPP_CString );
761 const sal_Unicode* pCustomShowName = pUString[ i ].getStr();
762 - for ( sal_uInt32 k = 0; k < nNamedShowLen; *mpStrm << (sal_uInt16)( pCustomShowName[ k++ ] ) ) ;
763 + for ( sal_uInt32 k = 0; k < nNamedShowLen; *mpStrm << (sal_uInt16)( pCustomShowName[ k++ ] ) ) {}
764 mAny = aXCont->getByName( pUString[ i ] );
765 if ( mAny.getValue() )
767 @@ -988,184 +1173,10 @@ sal_Bool PPTWriter::ImplCreateHyperBlob( SvMemoryStream& rStrm )
768 return TRUE;
771 -PHLayout& PPTWriter::ImplGetLayout( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rXPropSet ) const
773 - ::com::sun::star::uno::Any aAny;
774 - sal_Int16 nLayout = 20;
775 - if ( GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Layout" ) ) ), sal_True )
776 - aAny >>= nLayout;
778 - if ( ( nLayout >= 21 ) && ( nLayout <= 26 ) ) // NOTES _> HANDOUT6
779 - nLayout = 20;
780 - if ( ( nLayout >= 27 ) && ( nLayout <= 30 ) ) // VERTICAL LAYOUT
781 - nLayout -= 6;
782 - else if ( nLayout > 30 )
783 - nLayout = 20;
784 - return pPHLayout[ nLayout ];
788 -// ---------------------------------------------------------------------------------------------
790 -sal_Bool PPTWriter::ImplCreateMaster( sal_uInt32 nPageNum )
792 - if ( !ImplGetPageByIndex( nPageNum, MASTER ) )
793 - return FALSE;
794 - ImplSetCurrentStyleSheet( nPageNum );
796 - if ( !ImplGetPropertyValue( mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Background" ) ) ) ) // Backgroundshape laden
797 - return FALSE;
798 - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > aXBackgroundPropSet;
799 - if ( !( mAny >>= aXBackgroundPropSet ) )
800 - return FALSE;
802 - sal_uInt32 nFillColor = 0xffffff;
803 - sal_uInt32 nFillBackColor = 0x000000;
805 - ::com::sun::star::drawing::FillStyle aFS = ::com::sun::star::drawing::FillStyle_NONE;
806 - if ( ImplGetPropertyValue( aXBackgroundPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillStyle" ) ) ) )
807 - mAny >>= aFS;
808 - switch ( aFS )
810 - case ::com::sun::star::drawing::FillStyle_GRADIENT :
812 - if ( ImplGetPropertyValue( aXBackgroundPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillGradient" ) ) ) )
814 - nFillColor = EscherPropertyContainer::GetGradientColor( (::com::sun::star::awt::Gradient*)mAny.getValue(), 0 );
815 - nFillBackColor = EscherPropertyContainer::GetGradientColor( (::com::sun::star::awt::Gradient*)mAny.getValue(), 1 );
818 - break;
820 - case ::com::sun::star::drawing::FillStyle_SOLID :
822 - if ( ImplGetPropertyValue( aXBackgroundPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillColor" ) ) ) )
824 - nFillColor = mpPptEscherEx->GetColor( *((sal_uInt32*)mAny.getValue()) );
825 - nFillBackColor = nFillColor ^ 0xffffff;
828 - break;
830 - default:
831 - break;
834 - mpPptEscherEx->PtReplaceOrInsert( EPP_Persist_MainMaster | nPageNum, mpStrm->Tell() );
835 - mpPptEscherEx->OpenContainer( EPP_MainMaster );
836 - mpPptEscherEx->AddAtom( 24, EPP_SlideAtom, 2 );
837 - *mpStrm << (INT32)EPP_LAYOUT_TITLEANDBODYSLIDE // slide layout -> title and body slide
838 - << (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
839 - << (sal_uInt32)0 // master ID ( ist gleich null bei einer masterpage )
840 - << (sal_uInt32)0 // notes ID ( ist gleich null wenn keine notizen vorhanden )
841 - << (sal_uInt16)0 // Bit 1: Follow master objects, Bit 2: Follow master scheme, Bit 3: Follow master background
842 - << (sal_uInt16)0; // padword
844 - mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 6 );
845 - *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;
846 - mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 6 );
847 - *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;
848 - mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 6 );
849 - *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;
850 - mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 6 );
851 - *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;
852 - mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 6 );
853 - *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;
854 - mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 6 );
855 - *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;
856 - mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 6 );
857 - *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;
859 - for ( int nInstance = EPP_TEXTTYPE_Title; nInstance <= EPP_TEXTTYPE_QuarterBody; nInstance++ )
861 - if ( nInstance == EPP_TEXTTYPE_notUsed )
862 - continue;
864 - // the auto color is dependent to the page background,so we have to set a page that is in the right context
865 - if ( nInstance == EPP_TEXTTYPE_Notes )
866 - ImplGetPageByIndex( 0, NOTICE );
867 - else
868 - ImplGetPageByIndex( 0, MASTER );
870 - mpPptEscherEx->BeginAtom();
872 - sal_Bool bFirst = TRUE;
873 - sal_Bool bSimpleText = FALSE;
875 - *mpStrm << (sal_uInt16)5; // paragraph count
877 - for ( sal_uInt16 nLev = 0; nLev < 5; nLev++ )
879 - if ( nInstance >= EPP_TEXTTYPE_CenterBody )
881 - bFirst = FALSE;
882 - bSimpleText = TRUE;
883 - *mpStrm << nLev;
885 - mpStyleSheet->mpParaSheet[ nInstance ]->Write( *mpStrm, mpPptEscherEx, nLev, bFirst, bSimpleText, mXPagePropSet );
886 - mpStyleSheet->mpCharSheet[ nInstance ]->Write( *mpStrm, mpPptEscherEx, nLev, bFirst, bSimpleText, mXPagePropSet );
887 - bFirst = FALSE;
889 - mpPptEscherEx->EndAtom( EPP_TxMasterStyleAtom, 0, nInstance );
891 - ImplGetPageByIndex( nPageNum, MASTER );
893 - EscherSolverContainer aSolverContainer;
895 - mpPptEscherEx->OpenContainer( EPP_PPDrawing );
896 - mpPptEscherEx->OpenContainer( ESCHER_DgContainer );
898 - mpPptEscherEx->EnterGroup(0,0);
899 - ImplWritePage( pPHLayout[ 0 ], aSolverContainer, MASTER, TRUE ); // Die Shapes der Seite werden im PPT Dok. erzeugt
900 - mpPptEscherEx->LeaveGroup();
902 - ImplWriteBackground( aXBackgroundPropSet );
904 - aSolverContainer.WriteSolver( *mpStrm );
906 - mpPptEscherEx->CloseContainer(); // ESCHER_DgContainer
907 - mpPptEscherEx->CloseContainer(); // EPP_Drawing
908 - mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 1 );
909 - *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;
911 - if ( aBuExMasterStream.Tell() )
913 - ImplProgTagContainer( mpStrm, &aBuExMasterStream );
915 - mpPptEscherEx->CloseContainer(); // EPP_MainMaster
916 - return TRUE;
919 // ---------------------------------------------------------------------------------------------
921 sal_Bool PPTWriter::ImplCreateMainNotes()
923 - if ( !ImplGetPageByIndex( 0, NOTICE ) )
924 - return FALSE;
925 - ImplSetCurrentStyleSheet( 0 );
927 - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XMasterPageTarget >
928 - aXMasterPageTarget( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
930 - if ( !aXMasterPageTarget.is() )
931 - return FALSE;
933 - mXDrawPage = aXMasterPageTarget->getMasterPage();
934 - if ( !mXDrawPage.is() )
935 - return FALSE;
937 - mXPropSet = ::com::sun::star::uno::Reference<
938 - ::com::sun::star::beans::XPropertySet >
939 - ( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
940 - if ( !mXPropSet.is() )
941 - return FALSE;
943 - mXShapes = ::com::sun::star::uno::Reference<
944 - ::com::sun::star::drawing::XShapes >
945 - ( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
946 - if ( !mXShapes.is() )
947 - return FALSE;
949 EscherSolverContainer aSolverContainer;
951 mpPptEscherEx->PtReplaceOrInsert( EPP_Persist_MainNotes, mpStrm->Tell() );
952 @@ -1177,7 +1188,7 @@ sal_Bool PPTWriter::ImplCreateMainNotes()
953 mpPptEscherEx->OpenContainer( ESCHER_DgContainer );
954 mpPptEscherEx->EnterGroup(0,0);
956 - ImplWritePage( pPHLayout[ 20 ], aSolverContainer, NOTICE, TRUE );
957 + ImplWritePage( GetLayout( 20 ), aSolverContainer, NOTICE, TRUE );
959 mpPptEscherEx->LeaveGroup();
960 mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
961 @@ -1204,420 +1215,8 @@ sal_Bool PPTWriter::ImplCreateMainNotes()
962 return TRUE;
965 -// ---------------------------------------------------------------------------------------------
967 -sal_Bool PPTWriter::ImplCreateSlide( sal_uInt32 nPageNum )
969 - ::com::sun::star::uno::Any aAny;
971 - if ( !ImplGetPageByIndex( nPageNum, NORMAL ) )
972 - return FALSE;
973 - sal_uInt32 nMasterID = ImplGetMasterIndex( NORMAL );
974 - ImplSetCurrentStyleSheet( nMasterID );
975 - nMasterID |= 0x80000000;
977 - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > aXBackgroundPropSet;
978 - sal_Bool bHasBackground = GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Background" ) ) );
979 - if ( bHasBackground )
980 - bHasBackground = ( aAny >>= aXBackgroundPropSet );
982 - sal_uInt16 nMode = 7; // Bit 1: Follow master objects, Bit 2: Follow master scheme, Bit 3: Follow master background
983 - if ( bHasBackground )
984 - nMode &=~4;
986 -/* sj: Don't know what's IsBackgroundVisible for, have to ask cl
987 - if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundVisible" ) ) ) )
989 - sal_Bool bBackgroundVisible;
990 - if ( aAny >>= bBackgroundVisible )
992 - if ( bBackgroundVisible )
993 - nMode &= ~4;
997 - if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundObjectsVisible" ) ) ) )
999 - sal_Bool bBackgroundObjectsVisible = sal_False;
1000 - if ( aAny >>= bBackgroundObjectsVisible )
1002 - if ( !bBackgroundObjectsVisible )
1003 - nMode &= ~1;
1007 - const PHLayout& rLayout = ImplGetLayout( mXPagePropSet );
1008 - mpPptEscherEx->PtReplaceOrInsert( EPP_Persist_Slide | nPageNum, mpStrm->Tell() );
1009 - mpPptEscherEx->OpenContainer( EPP_Slide );
1010 - mpPptEscherEx->AddAtom( 24, EPP_SlideAtom, 2 );
1011 - *mpStrm << rLayout.nLayout;
1012 - mpStrm->Write( rLayout.nPlaceHolder, 8 ); // placeholderIDs ( 8Stueck )
1013 - *mpStrm << (sal_uInt32)nMasterID // master ID ( ist gleich 0x80000000 bei einer masterpage )
1014 - << (sal_uInt32)nPageNum + 0x100 // notes ID ( ist gleich null wenn keine notizen vorhanden )
1015 - << nMode
1016 - << (sal_uInt16)0; // padword
1018 - mnDiaMode = 0;
1019 - sal_Bool bVisible = sal_True;
1020 - ::com::sun::star::presentation::FadeEffect eFe = ::com::sun::star::presentation::FadeEffect_NONE;
1022 - if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) ) ) )
1023 - aAny >>= bVisible;
1024 - if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Change" ) ) ) )
1026 - switch ( *(INT32*)aAny.getValue() )
1028 - case 1 : // automatisch
1029 - mnDiaMode++;
1030 - case 2 : // halbautomatisch
1031 - mnDiaMode++;
1032 - default :
1033 - case 0 : // manuell
1034 - break;
1037 - if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Effect" ) ) ) )
1038 - aAny >>= eFe;
1040 - sal_uInt32 nSoundRef = 0;
1041 - sal_Bool bIsSound = sal_False;
1042 - sal_Bool bStopSound = sal_False;
1043 - sal_Bool bLoopSound = sal_False;
1045 - if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Sound" ) ) ) )
1047 - rtl::OUString aSoundURL;
1048 - if ( aAny >>= aSoundURL )
1050 - nSoundRef = maSoundCollection.GetId( aSoundURL );
1051 - bIsSound = sal_True;
1053 - else
1054 - aAny >>= bStopSound;
1056 - if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "LoopSound" ) ) ) )
1057 - aAny >>= bLoopSound;
1060 - sal_Bool bNeedsSSSlideInfoAtom = ( bVisible == FALSE )
1061 - || ( mnDiaMode == 2 )
1062 - || ( bIsSound )
1063 - || ( bStopSound )
1064 - || ( eFe != ::com::sun::star::presentation::FadeEffect_NONE );
1065 - if ( bNeedsSSSlideInfoAtom )
1067 - sal_uInt8 nDirection = 0;
1068 - sal_uInt8 nTransitionType = 0;
1069 - sal_uInt16 nBuildFlags = 1; // advange by mouseclick
1070 - INT32 nSlideTime = 0; // muss noch !!!
1071 - sal_uInt8 nSpeed = 1;
1073 - if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Speed" ) ) ) )
1075 - ::com::sun::star::presentation::AnimationSpeed aAs;
1076 - aAny >>= aAs;
1077 - nSpeed = (sal_uInt8)aAs;
1079 - sal_Int16 nTT = 0, nTST = 0;
1080 - if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TransitionType" ) ) )
1081 - && ( aAny >>= nTT ) )
1083 - if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TransitionSubtype" ) ) )
1084 - && ( aAny >>= nTST ) )
1086 - switch( nTT )
1088 - case animations::TransitionType::FADE :
1090 - if ( nTST == animations::TransitionSubType::CROSSFADE )
1091 - nTransitionType = PPT_TRANSITION_TYPE_SMOOTHFADE;
1092 - else if ( nTST == animations::TransitionSubType::FADEOVERCOLOR )
1093 - nTransitionType = PPT_TRANSITION_TYPE_FADE;
1095 - break;
1096 - case PPT_TRANSITION_TYPE_COMB :
1098 - nTransitionType = PPT_TRANSITION_TYPE_COMB;
1099 - if ( nTST == animations::TransitionSubType::COMBVERTICAL )
1100 - nDirection++;
1102 - break;
1103 - case animations::TransitionType::PUSHWIPE :
1105 - nTransitionType = PPT_TRANSITION_TYPE_PUSH;
1106 - switch( nTST )
1108 - case animations::TransitionSubType::FROMRIGHT: nDirection = 0; break;
1109 - case animations::TransitionSubType::FROMBOTTOM: nDirection = 1; break;
1110 - case animations::TransitionSubType::FROMLEFT: nDirection = 2; break;
1111 - case animations::TransitionSubType::FROMTOP: nDirection = 3; break;
1114 - break;
1115 - case animations::TransitionType::PINWHEELWIPE :
1117 - nTransitionType = PPT_TRANSITION_TYPE_WHEEL;
1118 - switch( nTST )
1120 - case animations::TransitionSubType::ONEBLADE: nDirection = 1; break;
1121 - case animations::TransitionSubType::TWOBLADEVERTICAL : nDirection = 2; break;
1122 - case animations::TransitionSubType::THREEBLADE : nDirection = 3; break;
1123 - case animations::TransitionSubType::FOURBLADE: nDirection = 4; break;
1124 - case animations::TransitionSubType::EIGHTBLADE: nDirection = 8; break;
1127 - break;
1128 - case animations::TransitionType::FANWIPE :
1130 - nTransitionType = PPT_TRANSITION_TYPE_WEDGE;
1132 - break;
1133 - case animations::TransitionType::ELLIPSEWIPE :
1135 - nTransitionType = PPT_TRANSITION_TYPE_CIRCLE;
1137 - break;
1138 - case animations::TransitionType::FOURBOXWIPE :
1140 - nTransitionType = PPT_TRANSITION_TYPE_PLUS;
1142 - break;
1143 - case animations::TransitionType::IRISWIPE :
1145 - nTransitionType = PPT_TRANSITION_TYPE_DIAMOND;
1147 - break;
1151 - if ( !nTransitionType )
1153 - switch ( eFe )
1155 - default :
1156 - case ::com::sun::star::presentation::FadeEffect_RANDOM :
1157 - nTransitionType = PPT_TRANSITION_TYPE_RANDOM;
1158 - break;
1160 - case ::com::sun::star::presentation::FadeEffect_HORIZONTAL_STRIPES :
1161 - nDirection++;
1162 - case ::com::sun::star::presentation::FadeEffect_VERTICAL_STRIPES :
1163 - nTransitionType = PPT_TRANSITION_TYPE_BLINDS;
1164 - break;
1166 - case ::com::sun::star::presentation::FadeEffect_VERTICAL_CHECKERBOARD :
1167 - nDirection++;
1168 - case ::com::sun::star::presentation::FadeEffect_HORIZONTAL_CHECKERBOARD :
1169 - nTransitionType = PPT_TRANSITION_TYPE_CHECKER;
1170 - break;
1172 - case ::com::sun::star::presentation::FadeEffect_MOVE_FROM_UPPERLEFT :
1173 - nDirection++;
1174 - case ::com::sun::star::presentation::FadeEffect_MOVE_FROM_UPPERRIGHT :
1175 - nDirection++;
1176 - case ::com::sun::star::presentation::FadeEffect_MOVE_FROM_LOWERLEFT :
1177 - nDirection++;
1178 - case ::com::sun::star::presentation::FadeEffect_MOVE_FROM_LOWERRIGHT :
1179 - nDirection++;
1180 - case ::com::sun::star::presentation::FadeEffect_MOVE_FROM_TOP :
1181 - nDirection++;
1182 - case ::com::sun::star::presentation::FadeEffect_MOVE_FROM_LEFT :
1183 - nDirection++;
1184 - case ::com::sun::star::presentation::FadeEffect_MOVE_FROM_BOTTOM :
1185 - nDirection++;
1186 - case ::com::sun::star::presentation::FadeEffect_MOVE_FROM_RIGHT :
1187 - nTransitionType = PPT_TRANSITION_TYPE_COVER;
1188 - break;
1190 - case ::com::sun::star::presentation::FadeEffect_DISSOLVE :
1191 - nTransitionType = PPT_TRANSITION_TYPE_DISSOLVE;
1192 - break;
1194 - case ::com::sun::star::presentation::FadeEffect_VERTICAL_LINES :
1195 - nDirection++;
1196 - case ::com::sun::star::presentation::FadeEffect_HORIZONTAL_LINES :
1197 - nTransitionType = PPT_TRANSITION_TYPE_RANDOM_BARS;
1198 - break;
1200 - case ::com::sun::star::presentation::FadeEffect_CLOSE_HORIZONTAL :
1201 - nDirection++;
1202 - case ::com::sun::star::presentation::FadeEffect_OPEN_HORIZONTAL :
1203 - nDirection++;
1204 - case ::com::sun::star::presentation::FadeEffect_CLOSE_VERTICAL :
1205 - nDirection++;
1206 - case ::com::sun::star::presentation::FadeEffect_OPEN_VERTICAL :
1207 - nTransitionType = PPT_TRANSITION_TYPE_SPLIT;
1208 - break;
1210 - case ::com::sun::star::presentation::FadeEffect_FADE_FROM_UPPERLEFT :
1211 - nDirection++;
1212 - case ::com::sun::star::presentation::FadeEffect_FADE_FROM_UPPERRIGHT :
1213 - nDirection++;
1214 - case ::com::sun::star::presentation::FadeEffect_FADE_FROM_LOWERLEFT :
1215 - nDirection++;
1216 - case ::com::sun::star::presentation::FadeEffect_FADE_FROM_LOWERRIGHT :
1217 - nDirection += 4;
1218 - nTransitionType = PPT_TRANSITION_TYPE_STRIPS;
1219 - break;
1221 - case ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_LOWERRIGHT :
1222 - nDirection++;
1223 - case ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_LOWERLEFT :
1224 - nDirection++;
1225 - case ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_UPPERRIGHT :
1226 - nDirection++;
1227 - case ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_UPPERLEFT :
1228 - nDirection++;
1229 - case ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_BOTTOM :
1230 - nDirection++;
1231 - case ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_RIGHT :
1232 - nDirection++;
1233 - case ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_TOP :
1234 - nDirection++;
1235 - case ::com::sun::star::presentation::FadeEffect_UNCOVER_TO_LEFT :
1236 - nTransitionType = PPT_TRANSITION_TYPE_PULL;
1237 - break;
1239 - case ::com::sun::star::presentation::FadeEffect_FADE_FROM_TOP :
1240 - nDirection++;
1241 - case ::com::sun::star::presentation::FadeEffect_FADE_FROM_LEFT :
1242 - nDirection++;
1243 - case ::com::sun::star::presentation::FadeEffect_FADE_FROM_BOTTOM :
1244 - nDirection++;
1245 - case ::com::sun::star::presentation::FadeEffect_FADE_FROM_RIGHT :
1246 - nTransitionType = PPT_TRANSITION_TYPE_WIPE;
1247 - break;
1249 - case ::com::sun::star::presentation::FadeEffect_ROLL_FROM_TOP :
1250 - nDirection++;
1251 - case ::com::sun::star::presentation::FadeEffect_ROLL_FROM_LEFT :
1252 - nDirection++;
1253 - case ::com::sun::star::presentation::FadeEffect_ROLL_FROM_BOTTOM :
1254 - nDirection++;
1255 - case ::com::sun::star::presentation::FadeEffect_ROLL_FROM_RIGHT :
1256 - nTransitionType = PPT_TRANSITION_TYPE_WIPE;
1257 - break;
1259 - case ::com::sun::star::presentation::FadeEffect_FADE_TO_CENTER :
1260 - nDirection++;
1261 - case ::com::sun::star::presentation::FadeEffect_FADE_FROM_CENTER :
1262 - nTransitionType = PPT_TRANSITION_TYPE_ZOOM;
1263 - break;
1265 - case ::com::sun::star::presentation::FadeEffect_NONE :
1266 - nDirection = 2;
1267 - break;
1270 - if ( mnDiaMode == 2 ) // automatic ?
1271 - nBuildFlags |= 0x400;
1272 - if ( bVisible == FALSE )
1273 - nBuildFlags |= 4;
1274 - if ( bIsSound )
1275 - nBuildFlags |= 16;
1276 - if ( bLoopSound )
1277 - nBuildFlags |= 64;
1278 - if ( bStopSound )
1279 - nBuildFlags |= 256;
1281 - if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Duration" ) ) ) )// duration of this slide
1282 - nSlideTime = *(INT32*)aAny.getValue() << 10; // in ticks
1285 - mpPptEscherEx->AddAtom( 16, EPP_SSSlideInfoAtom );
1286 - *mpStrm << nSlideTime // standtime in ticks
1287 - << nSoundRef
1288 - << nDirection
1289 - << nTransitionType
1290 - << nBuildFlags
1291 - << nSpeed
1292 - << (sal_uInt8)0 << (sal_uInt8)0 << (sal_uInt8)0;
1295 - ImplCreateHeaderFooters( mXPagePropSet );
1297 - EscherSolverContainer aSolverContainer;
1298 - mpPptEscherEx->OpenContainer( EPP_PPDrawing );
1299 - mpPptEscherEx->OpenContainer( ESCHER_DgContainer );
1300 - mpPptEscherEx->EnterGroup(0,0);
1301 - ImplWritePage( rLayout, aSolverContainer, NORMAL, FALSE, nPageNum ); // Die Shapes der Seite werden im PPT Dok. erzeugt
1302 - mpPptEscherEx->LeaveGroup();
1304 - if ( bHasBackground )
1305 - ImplWriteBackground( aXBackgroundPropSet );
1306 - else
1308 - mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
1309 - mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xc00 ); // Flags: Connector | Background | HasSpt
1310 - EscherPropertyContainer aPropOpt;
1311 - aPropOpt.AddOpt( ESCHER_Prop_fillRectRight, PPTtoEMU( maDestPageSize.Width ) );
1312 - aPropOpt.AddOpt( ESCHER_Prop_fillRectBottom, PPTtoEMU( maDestPageSize.Width ) );
1313 - aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x120012 );
1314 - aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x80000 );
1315 - aPropOpt.AddOpt( ESCHER_Prop_bWMode, ESCHER_wDontShow );
1316 - aPropOpt.AddOpt( ESCHER_Prop_fBackground, 0x10001 ); // if true, this is the background shape
1317 - aPropOpt.Commit( *mpStrm );
1318 - mpPptEscherEx->CloseContainer(); // ESCHER_SpContainer
1321 - aSolverContainer.WriteSolver( *mpStrm );
1323 - mpPptEscherEx->CloseContainer(); // ESCHER_DgContainer
1324 - mpPptEscherEx->CloseContainer(); // EPP_Drawing
1325 - mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 1 );
1326 - *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;
1328 - if ( mbUseNewAnimations )
1330 - SvMemoryStream amsofbtAnimGroup;
1331 - ppt::AnimationExporter aExporter( aSolverContainer, maSoundCollection );
1332 - aExporter.doexport( mXDrawPage, amsofbtAnimGroup );
1333 - sal_uInt32 nmsofbtAnimGroupSize = amsofbtAnimGroup.Tell();
1334 - if ( nmsofbtAnimGroupSize )
1336 - EscherExContainer aProgTags ( *mpStrm, EPP_ProgTags );
1337 - EscherExContainer aProgBinaryTag( *mpStrm, EPP_ProgBinaryTag );
1339 - EscherExAtom aCString( *mpStrm, EPP_CString );
1340 - *mpStrm << (sal_uInt32)0x5f005f
1341 - << (sal_uInt32)0x50005f
1342 - << (sal_uInt32)0x540050
1343 - << (sal_uInt16)0x31
1344 - << (sal_uInt16)0x30;
1347 - EscherExAtom aBinaryTagData( *mpStrm, EPP_BinaryTagData );
1350 - EscherExAtom aMagic2( *mpStrm, 0x2eeb );
1351 - *mpStrm << (sal_uInt32)0x01c45df9
1352 - << (sal_uInt32)0xe1471b30;
1355 - EscherExAtom aMagic( *mpStrm, 0x2b00 );
1356 - *mpStrm << (sal_uInt32)0;
1359 - mpStrm->Write( amsofbtAnimGroup.GetData(), amsofbtAnimGroup.Tell() );
1361 - EscherExContainer aMagic2( *mpStrm, 0x2b02 );
1366 - mpPptEscherEx->CloseContainer(); // EPP_Slide
1367 - return TRUE;
1370 -// ---------------------------------------------------------------------------------------------
1372 -sal_Bool PPTWriter::ImplCreateNotes( sal_uInt32 nPageNum )
1373 +void PPTWriter::ImplWriteNotes( sal_uInt32 nPageNum )
1375 - if ( !ImplGetPageByIndex( nPageNum, NOTICE ) )
1376 - return FALSE;
1377 - ImplSetCurrentStyleSheet( ImplGetMasterIndex( NORMAL ) );
1380 mpPptEscherEx->PtReplaceOrInsert( EPP_Persist_Notes | nPageNum, mpStrm->Tell() );
1381 mpPptEscherEx->OpenContainer( EPP_Notes );
1382 mpPptEscherEx->AddAtom( 8, EPP_NotesAtom, 1 );
1383 @@ -1633,7 +1232,7 @@ sal_Bool PPTWriter::ImplCreateNotes( sal_uInt32 nPageNum )
1384 mpPptEscherEx->OpenContainer( ESCHER_DgContainer );
1385 mpPptEscherEx->EnterGroup(0,0);
1387 - ImplWritePage( pPHLayout[ 20 ], aSolverContainer, NOTICE, FALSE ); // Die Shapes der Seite werden im PPT Dok. erzeugt
1388 + ImplWritePage( GetLayout( 20 ), aSolverContainer, NOTICE, FALSE ); // Die Shapes der Seite werden im PPT Dok. erzeugt
1390 mpPptEscherEx->LeaveGroup();
1391 mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
1392 @@ -1657,8 +1256,7 @@ sal_Bool PPTWriter::ImplCreateNotes( sal_uInt32 nPageNum )
1393 mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 1 );
1394 *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;
1395 mpPptEscherEx->CloseContainer(); // EPP_Notes
1396 - return TRUE;
1400 void PPTWriter::ImplWriteBackground( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet )
1402 @@ -1734,18 +1332,18 @@ void PPTWriter::ImplWriteCString( SvStream& rSt, const String& rString, sal_uInt
1406 -void PPTWriter::ImplWriteVBA( SvMemoryStream* pVBA )
1407 +void PPTWriter::ImplWriteVBA()
1409 - if ( pVBA )
1410 + if ( mpVBA )
1412 - pVBA->Seek( STREAM_SEEK_TO_END );
1413 - sal_uInt32 nLen = pVBA->Tell();
1414 + mpVBA->Seek( STREAM_SEEK_TO_END );
1415 + sal_uInt32 nLen = mpVBA->Tell();
1416 if ( nLen > 8 )
1418 nLen -= 8;
1419 mnVBAOleOfs = mpStrm->Tell();
1420 mpPptEscherEx->BeginAtom();
1421 - mpStrm->Write( (sal_Int8*)pVBA->GetData() + 8, nLen );
1422 + mpStrm->Write( (sal_Int8*)mpVBA->GetData() + 8, nLen );
1423 mpPptEscherEx->EndAtom( EPP_ExOleObjStg, 0, 1 );
1426 @@ -1753,11 +1351,11 @@ void PPTWriter::ImplWriteVBA( SvMemoryStream* pVBA )
1428 // ---------------------------------------------------------------------------------------------
1430 -void PPTWriter::ImplWriteOLE( sal_uInt32 nCnvrtFlags )
1431 +void PPTWriter::ImplWriteOLE()
1433 PPTExOleObjEntry* pPtr;
1435 - SvxMSExportOLEObjects aOleExport( nCnvrtFlags );
1436 + SvxMSExportOLEObjects aOleExport( mnCnvrtFlags );
1438 for ( pPtr = (PPTExOleObjEntry*)maExOleObj.First(); pPtr;
1439 pPtr = (PPTExOleObjEntry*)maExOleObj.Next() )
1440 @@ -1954,482 +1552,6 @@ sal_Bool PPTWriter::ImplWriteAtomEnding()
1442 // ---------------------------------------------------------------------------------------------
1444 -PPTExCharSheet::PPTExCharSheet( int nInstance )
1446 - sal_uInt16 nFontHeight = 24;
1448 - for ( int nDepth = 0; nDepth < 5; nDepth++ )
1450 - PPTExCharLevel& rLev = maCharLevel[ nDepth ];
1451 - switch ( nInstance )
1453 - case EPP_TEXTTYPE_Title :
1454 - case EPP_TEXTTYPE_CenterTitle :
1455 - nFontHeight = 44;
1456 - break;
1457 - case EPP_TEXTTYPE_Body :
1458 - case EPP_TEXTTYPE_CenterBody :
1459 - case EPP_TEXTTYPE_HalfBody :
1460 - case EPP_TEXTTYPE_QuarterBody :
1462 - switch ( nDepth )
1464 - case 0 : nFontHeight = 32; break;
1465 - case 1 : nFontHeight = 28; break;
1466 - case 2 : nFontHeight = 24; break;
1467 - default :nFontHeight = 20; break;
1470 - break;
1471 - case EPP_TEXTTYPE_Notes :
1472 - nFontHeight = 12;
1473 - break;
1474 - case EPP_TEXTTYPE_notUsed :
1475 - case EPP_TEXTTYPE_Other :
1476 - nFontHeight = 24;
1477 - break;
1479 - rLev.mnFlags = 0;
1480 - rLev.mnFont = 0;
1481 - rLev.mnAsianOrComplexFont = 0xffff;
1482 - rLev.mnFontHeight = nFontHeight;
1483 - rLev.mnFontColor = 0;
1484 - rLev.mnEscapement = 0;
1489 -void PPTExCharSheet::SetStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
1490 - FontCollection& rFontCollection, int nLevel )
1492 - PortionObj aPortionObj( rXPropSet, rFontCollection );
1494 - PPTExCharLevel& rLev = maCharLevel[ nLevel ];
1496 - if ( aPortionObj.meCharColor == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
1497 - rLev.mnFontColor = aPortionObj.mnCharColor;
1498 - if ( aPortionObj.meCharEscapement == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
1499 - rLev.mnEscapement = aPortionObj.mnCharEscapement;
1500 - if ( aPortionObj.meCharHeight == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
1501 - rLev.mnFontHeight = aPortionObj.mnCharHeight;
1502 - if ( aPortionObj.meFontName == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
1503 - rLev.mnFont = aPortionObj.mnFont;
1504 - if ( aPortionObj.meAsianOrComplexFont == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
1505 - rLev.mnAsianOrComplexFont = aPortionObj.mnAsianOrComplexFont;
1506 - rLev.mnFlags = aPortionObj.mnCharAttr;
1509 -void PPTExCharSheet::Write( SvStream& rSt, PptEscherEx*, sal_uInt16 nLev, sal_Bool, sal_Bool bSimpleText,
1510 - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPagePropSet )
1512 - const PPTExCharLevel& rLev = maCharLevel[ nLev ];
1514 - sal_uInt32 nCharFlags = 0xefffff;
1515 - if ( bSimpleText )
1516 - nCharFlags = 0x7ffff;
1518 - rSt << nCharFlags
1519 - << rLev.mnFlags
1520 - << rLev.mnFont;
1522 - sal_uInt32 nFontColor = rLev.mnFontColor;
1523 - if ( nFontColor == COL_AUTO )
1525 - sal_Bool bIsDark = sal_False;
1526 - ::com::sun::star::uno::Any aAny;
1527 - if ( PropValue::GetPropertyValue( aAny, rPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundDark" ) ), sal_True ) )
1528 - aAny >>= bIsDark;
1529 - nFontColor = bIsDark ? 0xffffff : 0x000000;
1531 - nFontColor &= 0xffffff;
1532 - nFontColor |= 0xfe000000;
1533 - if ( bSimpleText )
1535 - rSt << rLev.mnFontHeight
1536 - << nFontColor;
1538 - else
1540 - rSt << rLev.mnAsianOrComplexFont
1541 - << (sal_uInt16)0xffff // unbekannt
1542 - << (sal_uInt16)0xffff // unbekannt
1543 - << rLev.mnFontHeight
1544 - << nFontColor
1545 - << rLev.mnEscapement;
1549 -PPTExParaSheet::PPTExParaSheet( int nInstance, sal_uInt16 nDefaultTab, PPTExBulletProvider& rProv ) :
1550 - rBuProv ( rProv ),
1551 - mnInstance ( nInstance )
1553 - sal_Bool bHasBullet = FALSE;
1555 - sal_uInt16 nUpperDist = 0;
1556 - sal_uInt16 nBulletChar = 0x2022;
1557 - sal_uInt16 nBulletOfs = 0;
1558 - sal_uInt16 nTextOfs = 0;
1560 - for ( int nDepth = 0; nDepth < 5; nDepth++ )
1562 - PPTExParaLevel& rLev = maParaLevel[ nDepth ];
1563 - switch ( nInstance )
1565 - case EPP_TEXTTYPE_Title :
1566 - case EPP_TEXTTYPE_CenterTitle :
1567 - break;
1568 - case EPP_TEXTTYPE_Body :
1569 - case EPP_TEXTTYPE_CenterBody :
1570 - case EPP_TEXTTYPE_HalfBody :
1571 - case EPP_TEXTTYPE_QuarterBody :
1573 - bHasBullet = TRUE;
1574 - nUpperDist = 0x14;
1576 - break;
1577 - case EPP_TEXTTYPE_Notes :
1578 - nUpperDist = 0x1e;
1579 - break;
1581 -// default :
1582 -// case EPP_TEXTTYPE_notUsed :
1583 -// case EPP_TEXTTYPE_Other :
1584 -// break;
1586 - switch ( nDepth )
1588 - case 0 :
1590 - nBulletChar = 0x2022;
1591 - nBulletOfs = 0;
1592 - nTextOfs = ( bHasBullet ) ? 0xd8 : 0;
1594 - break;
1595 - case 1 :
1597 - nBulletChar = 0x2013;
1598 - nBulletOfs = 0x120;
1599 - nTextOfs = 0x1d4;
1601 - break;
1602 - case 2 :
1604 - nBulletChar = 0x2022;
1605 - nBulletOfs = 0x240;
1606 - nTextOfs = 0x2d0;
1608 - break;
1609 - case 3 :
1611 - nBulletChar = 0x2013;
1612 - nBulletOfs = 0x360;
1613 - nTextOfs = 0x3f0;
1615 - break;
1616 - case 4 :
1618 - nBulletChar = 0xbb;
1619 - nBulletOfs = 0x480;
1620 - nTextOfs = 0x510;
1622 - break;
1624 - rLev.mbIsBullet = bHasBullet;
1625 - rLev.mnBulletChar = nBulletChar;
1626 - rLev.mnBulletFont = 0;
1627 - rLev.mnBulletHeight = 100;
1628 - rLev.mnBulletColor = 0;
1629 - rLev.mnAdjust = 0;
1630 - rLev.mnLineFeed = 100;
1631 - rLev.mnLowerDist = 0;
1632 - rLev.mnUpperDist = nUpperDist;
1633 - rLev.mnTextOfs = nTextOfs;
1634 - rLev.mnBulletOfs = nBulletOfs;
1635 - rLev.mnDefaultTab = nDefaultTab;
1636 - rLev.mnAsianSettings = 2;
1637 - rLev.mnBiDi = 0;
1639 - rLev.mbExtendedBulletsUsed = FALSE;
1640 - rLev.mnBulletId = 0xffff;
1641 - rLev.mnBulletStart = 0;
1642 - rLev.mnMappedNumType = 0;
1643 - rLev.mnNumberingType = 0;
1647 -void PPTExParaSheet::SetStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
1648 - FontCollection& rFontCollection, int nLevel, const PPTExCharLevel& rCharLevel )
1650 - ParagraphObj aParagraphObj( rXPropSet, rBuProv );
1651 - aParagraphObj.CalculateGraphicBulletSize( rCharLevel.mnFontHeight );
1652 - PPTExParaLevel& rLev = maParaLevel[ nLevel ];
1654 - if ( aParagraphObj.meTextAdjust == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
1655 - rLev.mnAdjust = aParagraphObj.mnTextAdjust;
1656 - if ( aParagraphObj.meLineSpacing == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
1658 - sal_Int16 nLineSpacing = aParagraphObj.mnLineSpacing;
1659 - if ( nLineSpacing > 0 ) // if nLinespacing is < 0 the linespacing is an absolute spacing
1661 - sal_Bool bFixedLineSpacing = sal_False;
1662 - uno::Any aAny = rXPropSet->getPropertyValue( ::rtl::OUString(
1663 - RTL_CONSTASCII_USTRINGPARAM(
1664 - "FontIndependentLineSpacing" ) ) );
1665 - if( !(aAny >>= bFixedLineSpacing) || !bFixedLineSpacing )
1667 - const FontCollectionEntry* pDesc = rFontCollection.GetById( rCharLevel.mnFont );
1668 - if ( pDesc )
1669 - nLineSpacing = (sal_Int16)( (double)nLineSpacing * pDesc->Scaling + 0.5 );
1672 - else
1674 - if ( rCharLevel.mnFontHeight > (sal_uInt16)( ((double)-nLineSpacing) * 0.001 * 72.0 / 2.54 ) ) // 1/100mm to point
1676 - const FontCollectionEntry* pDesc = rFontCollection.GetById( rCharLevel.mnFont );
1677 - if ( pDesc )
1678 - nLineSpacing = (sal_Int16)( (double)100.0 * pDesc->Scaling + 0.5 );
1679 - else
1680 - nLineSpacing = 100;
1682 - else
1683 - nLineSpacing = (sal_Int16)( (double)nLineSpacing / 4.40972 );
1685 - rLev.mnLineFeed = nLineSpacing;
1687 - if ( aParagraphObj.meLineSpacingBottom == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
1688 - rLev.mnLowerDist = aParagraphObj.mnLineSpacingBottom;
1689 - if ( aParagraphObj.meLineSpacingTop == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
1690 - rLev.mnUpperDist = aParagraphObj.mnLineSpacingTop;
1691 - if ( aParagraphObj.meForbiddenRules == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
1693 - rLev.mnAsianSettings &=~1;
1694 - if ( aParagraphObj.mbForbiddenRules )
1695 - rLev.mnAsianSettings |= 1;
1697 - if ( aParagraphObj.meParagraphPunctation == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
1699 - rLev.mnAsianSettings &=~4;
1700 - if ( aParagraphObj.mbParagraphPunctation )
1701 - rLev.mnAsianSettings |= 4;
1704 - if ( aParagraphObj.meBiDi == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
1705 - rLev.mnBiDi = aParagraphObj.mnBiDi;
1707 - rLev.mbIsBullet = aParagraphObj.mbIsBullet; //( ( aParagraphObj.nBulletFlags & 1 ) != 0 );
1709 - if ( !nLevel )
1711 - if ( ( aParagraphObj.meBullet == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
1712 - && aParagraphObj.bExtendedParameters )
1714 - for ( sal_Int16 i = 0; i < 5; i++ )
1716 - PPTExParaLevel& rLevel = maParaLevel[ i ];
1717 - if ( i )
1718 - aParagraphObj.ImplGetNumberingLevel( rBuProv, i, FALSE );
1719 -// rLevel.mbIsBullet = ( ( aParagraphObj.nBulletFlags & 1 ) != 0 );
1720 - rLevel.mnTextOfs = aParagraphObj.nTextOfs;
1721 - rLevel.mnBulletOfs = (sal_uInt16)aParagraphObj.nBulletOfs;
1722 - rLevel.mnBulletChar = aParagraphObj.cBulletId;
1723 - FontCollectionEntry aFontDescEntry( aParagraphObj.aFontDesc.Name, aParagraphObj.aFontDesc.Family,
1724 - aParagraphObj.aFontDesc.Pitch, aParagraphObj.aFontDesc.CharSet );
1725 - rLevel.mnBulletFont = (sal_uInt16)rFontCollection.GetId( aFontDescEntry );
1726 - rLevel.mnBulletHeight = aParagraphObj.nBulletRealSize;
1727 - rLevel.mnBulletColor = aParagraphObj.nBulletColor;
1729 - rLevel.mbExtendedBulletsUsed = aParagraphObj.bExtendedBulletsUsed;
1730 - rLevel.mnBulletId = aParagraphObj.nBulletId;
1731 - rLevel.mnNumberingType = aParagraphObj.nNumberingType;
1732 - rLevel.mnBulletStart = aParagraphObj.nStartWith;
1733 - rLevel.mnMappedNumType = aParagraphObj.nMappedNumType;
1739 -void PPTExParaSheet::Write( SvStream& rSt, PptEscherEx*, sal_uInt16 nLev, sal_Bool, sal_Bool bSimpleText,
1740 - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPagePropSet )
1742 - const PPTExParaLevel& rLev = maParaLevel[ nLev ];
1744 - if ( maParaLevel[ 0 ].mbExtendedBulletsUsed || maParaLevel[ 1 ].mbExtendedBulletsUsed ||
1745 - maParaLevel[ 2 ].mbExtendedBulletsUsed || maParaLevel[ 3 ].mbExtendedBulletsUsed ||
1746 - maParaLevel[ 4 ].mbExtendedBulletsUsed )
1748 - SvStream& rOut = rBuProv.aBuExMasterStream;
1749 - if ( !nLev )
1751 - rOut << (sal_uInt32)( ( EPP_PST_ExtendedParagraphMasterAtom << 16 ) | ( mnInstance << 4 ) )
1752 - << (sal_uInt32)( 5 * 16 + 2 )
1753 - << (sal_uInt16)5; // depth
1755 - sal_uInt16 nBulletId = rLev.mnBulletId;
1756 - if ( rLev.mnNumberingType != SVX_NUM_BITMAP )
1757 - nBulletId = 0xffff;
1758 - rOut << (sal_uInt32)0x03800000
1759 - << (sal_uInt16)nBulletId
1760 - << (sal_uInt32)rLev.mnMappedNumType
1761 - << (sal_uInt16)rLev.mnBulletStart
1762 - << (sal_uInt32)0;
1765 - sal_uInt32 nParaFlags = 0x3ffdff;
1766 - sal_uInt16 nBulletFlags = ( rLev.mbIsBullet ) ? 0xf : 0xe;
1768 - if ( nLev )
1769 - nParaFlags &= 0x207fff;
1770 - if ( bSimpleText )
1771 - nParaFlags &= 0x7fff;
1772 - sal_uInt32 nBulletColor = rLev.mnBulletColor;
1773 - if ( nBulletColor == COL_AUTO )
1775 - sal_Bool bIsDark = sal_False;
1776 - ::com::sun::star::uno::Any aAny;
1777 - if ( PropValue::GetPropertyValue( aAny, rPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundDark" ) ), sal_True ) )
1778 - aAny >>= bIsDark;
1779 - nBulletColor = bIsDark ? 0xffffff : 0x000000;
1781 - nBulletColor &= 0xffffff;
1782 - nBulletColor |= 0xfe000000;
1783 - rSt << nParaFlags
1784 - << nBulletFlags
1785 - << rLev.mnBulletChar
1786 - << rLev.mnBulletFont
1787 - << rLev.mnBulletHeight
1788 - << nBulletColor
1789 - << rLev.mnAdjust
1790 - << rLev.mnLineFeed
1791 - << rLev.mnUpperDist
1792 - << rLev.mnLowerDist
1793 - << rLev.mnTextOfs
1794 - << rLev.mnBulletOfs;
1796 - if ( bSimpleText || nLev )
1798 - if ( nParaFlags & 0x200000 )
1799 - rSt << rLev.mnBiDi;
1801 - else
1803 - rSt << rLev.mnDefaultTab
1804 - << (sal_uInt16)0
1805 - << (sal_uInt16)0
1806 - << rLev.mnAsianSettings
1807 - << rLev.mnBiDi;
1812 -PPTExStyleSheet::PPTExStyleSheet( sal_uInt16 nDefaultTab, PPTExBulletProvider& rBuProv )
1814 - for ( int nInstance = EPP_TEXTTYPE_Title; nInstance <= EPP_TEXTTYPE_QuarterBody; nInstance++ )
1816 - mpParaSheet[ nInstance ] = ( nInstance == EPP_TEXTTYPE_notUsed ) ? NULL : new PPTExParaSheet( nInstance, nDefaultTab, rBuProv );
1817 - mpCharSheet[ nInstance ] = ( nInstance == EPP_TEXTTYPE_notUsed ) ? NULL : new PPTExCharSheet( nInstance );
1821 -PPTExStyleSheet::~PPTExStyleSheet()
1823 - for ( int nInstance = EPP_TEXTTYPE_Title; nInstance <= EPP_TEXTTYPE_QuarterBody; nInstance++ )
1825 - if ( nInstance == EPP_TEXTTYPE_notUsed )
1826 - continue;
1828 - delete mpParaSheet[ nInstance ];
1829 - delete mpCharSheet[ nInstance ];
1833 -void PPTExStyleSheet::SetStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
1834 - FontCollection& rFontCollection, int nInstance, int nLevel )
1836 - if ( nInstance == EPP_TEXTTYPE_notUsed )
1837 - return;
1838 - mpCharSheet[ nInstance ]->SetStyleSheet( rXPropSet, rFontCollection, nLevel );
1839 - mpParaSheet[ nInstance ]->SetStyleSheet( rXPropSet, rFontCollection, nLevel, mpCharSheet[ nInstance ]->maCharLevel[ nLevel ] );
1842 -sal_Bool PPTExStyleSheet::IsHardAttribute( sal_uInt32 nInstance, sal_uInt32 nLevel, PPTExTextAttr eAttr, sal_uInt32 nValue )
1844 - const PPTExParaLevel& rPara = mpParaSheet[ nInstance ]->maParaLevel[ nLevel ];
1845 - const PPTExCharLevel& rChar = mpCharSheet[ nInstance ]->maCharLevel[ nLevel ];
1847 - sal_uInt32 nFlag = 0;
1849 - switch ( eAttr )
1851 - case ParaAttr_BulletOn : return ( rPara.mbIsBullet ) ? ( nValue ) ? FALSE : TRUE : ( nValue ) ? TRUE : FALSE;
1852 - case ParaAttr_BuHardFont :
1853 - case ParaAttr_BulletFont : return ( rPara.mnBulletFont != nValue );
1854 - case ParaAttr_BuHardColor :
1855 - case ParaAttr_BulletColor : return ( rPara.mnBulletColor != nValue );
1856 - case ParaAttr_BuHardHeight :
1857 - case ParaAttr_BulletHeight : return ( rPara.mnBulletHeight != nValue );
1858 - case ParaAttr_BulletChar : return ( rPara.mnBulletChar != nValue );
1859 - case ParaAttr_Adjust : return ( rPara.mnAdjust != nValue );
1860 - case ParaAttr_LineFeed : return ( rPara.mnLineFeed != nValue );
1861 - case ParaAttr_UpperDist : return ( rPara.mnUpperDist != nValue );
1862 - case ParaAttr_LowerDist : return ( rPara.mnLowerDist != nValue );
1863 - case ParaAttr_TextOfs : return ( rPara.mnTextOfs != nValue );
1864 - case ParaAttr_BulletOfs : return ( rPara.mnBulletOfs != nValue );
1865 - case ParaAttr_DefaultTab : return ( rPara.mnDefaultTab != nValue );
1866 - case ParaAttr_BiDi : return ( rPara.mnBiDi != nValue );
1867 - case CharAttr_Bold : nFlag = 1; break;
1868 - case CharAttr_Italic : nFlag = 2; break;
1869 - case CharAttr_Underline : nFlag = 4; break;
1870 - case CharAttr_Shadow : nFlag = 16; break;
1871 - case CharAttr_Strikeout : nFlag = 256; break;
1872 - case CharAttr_Embossed : nFlag = 512; break;
1873 - case CharAttr_Font : return ( rChar.mnFont != nValue );
1874 - case CharAttr_AsianOrComplexFont : return ( rChar.mnAsianOrComplexFont != nValue );
1875 - case CharAttr_Symbol : return TRUE;
1876 - case CharAttr_FontHeight : return ( rChar.mnFontHeight != nValue );
1877 - case CharAttr_FontColor : return ( rChar.mnFontColor != nValue );
1878 - case CharAttr_Escapement : return ( rChar.mnEscapement != nValue );
1879 - default:
1880 - break;
1881 - };
1882 - if ( nFlag )
1884 - if ( rChar.mnFlags & nFlag )
1885 - return ( ( nValue & nFlag ) == 0 );
1886 - else
1887 - return ( ( nValue & nFlag ) != 0 );
1889 - return TRUE;
1892 -sal_uInt32 PPTExStyleSheet::SizeOfTxCFStyleAtom() const
1894 - return 24;
1897 -// the TxCFStyleAtom stores the text properties that are used
1898 -// when creating new objects in PowerPoint.
1900 -void PPTExStyleSheet::WriteTxCFStyleAtom( SvStream& rSt )
1902 - const PPTExCharLevel& rCharStyle = mpCharSheet[ EPP_TEXTTYPE_Other ]->maCharLevel[ 0 ];
1904 - sal_uInt16 nFlags = 0x60 // ??
1905 - | 0x02 // fontsize;
1906 - | 0x04; // fontcolor
1908 - sal_uInt32 nCharFlags = rCharStyle.mnFlags;
1909 - nCharFlags &= CharAttr_Italic | CharAttr_Bold | CharAttr_Underline | CharAttr_Shadow;
1911 - rSt << (sal_uInt32)( EPP_TxCFStyleAtom << 16 ) // recordheader
1912 - << SizeOfTxCFStyleAtom() - 8
1913 - << (sal_uInt16)( 0x80 | nCharFlags )
1914 - << (sal_uInt16)nFlags
1915 - << (sal_uInt16)nCharFlags
1916 - << (sal_Int32)-1 // ?
1917 - << rCharStyle.mnFontHeight
1918 - << rCharStyle.mnFontColor;
1922 // ---------------------------------------------------------------------------------------------
1923 @@ -2449,6 +1571,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT BOOL __LOADONCALLAPI ExportPPT( SvStorageRef& rS
1924 pPPTWriter = new PPTWriter( rSvStorage, rXModel, rXStatInd, pVBA, nCnvrtFlags );
1925 if ( pPPTWriter )
1927 + pPPTWriter->exportPPT();
1928 bStatus = ( pPPTWriter->IsValid() == TRUE );
1929 delete pPPTWriter;
1931 diff --git sd/source/filter/eppt/eppt.hxx sd/source/filter/eppt/eppt.hxx
1932 index 9d0ab80..70ce541 100644
1933 --- sd/source/filter/pptx/eppt.hxx
1934 +++ sd/source/filter/pptx/eppt.hxx
1935 @@ -36,13 +36,11 @@
1936 #endif
1937 #include <tools/solar.h>
1938 #include <sot/storage.hxx>
1939 -#include <tools/gen.hxx>
1940 #include <vcl/graph.hxx>
1941 #include <vcl/fontcvt.hxx>
1942 -#include <tools/string.hxx>
1943 #include "pptexanimations.hxx"
1944 #include <pptexsoundcollection.hxx>
1946 +#include "text.hxx"
1947 // ------------------------------------------------------------------------
1949 #include <vcl/mapmod.hxx>
1950 @@ -66,11 +64,7 @@
1951 #include <com/sun/star/drawing/Hatch.hpp>
1952 #include <com/sun/star/drawing/LineDash.hpp>
1953 #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
1954 -#include <com/sun/star/presentation/XPresentationSupplier.hpp>
1955 #include <com/sun/star/presentation/XCustomPresentationSupplier.hpp>
1956 -#include <com/sun/star/drawing/XMasterPageTarget.hpp>
1957 -#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
1958 -#include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
1959 #include <com/sun/star/awt/XGraphics.hpp>
1960 #include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
1961 #include <com/sun/star/presentation/AnimationEffect.hpp>
1962 @@ -81,12 +75,10 @@
1963 #include <com/sun/star/text/XTextFieldsSupplier.hpp>
1964 #include <com/sun/star/text/XTextField.hpp>
1965 #include <com/sun/star/container/XNamed.hpp>
1966 -#include <com/sun/star/awt/FontDescriptor.hpp>
1967 #include <com/sun/star/container/XIndexContainer.hpp>
1968 #include <com/sun/star/awt/XControlModel.hpp>
1969 #include <com/sun/star/style/TabStop.hpp>
1970 #include <svx/msocximex.hxx>
1971 -#include <com/sun/star/beans/XPropertySet.hpp>
1972 #include <com/sun/star/beans/XPropertyState.hpp>
1973 #include <com/sun/star/beans/XPropertySetInfo.hpp>
1974 #include <com/sun/star/awt/FontFamily.hpp>
1975 @@ -95,7 +87,7 @@
1976 #include <com/sun/star/text/WritingMode.hpp>
1977 #include <com/sun/star/lang/Locale.hpp>
1979 -enum PageType { NORMAL = 0, MASTER = 1, NOTICE = 2, UNDEFINED = 3 };
1980 +#include <epptbase.hxx>
1982 #define EPP_MAINMASTER_PERSIST_KEY 0x80010000
1983 #define EPP_MAINNOTESMASTER_PERSIST_KEY 0x80020000
1984 @@ -116,283 +108,11 @@ enum PageType { NORMAL = 0, MASTER = 1, NOTICE = 2, UNDEFINED = 3 };
1985 #define EPP_TEXTSTYLE_BODY 0x00000100
1986 #define EPP_TEXTSTYLE_TEXT 0x00001000
1988 -// PLACEMENT_ID
1989 -#define EPP_LAYOUT_TITLESLIDE 0 /* The slide is a title slide */
1990 -#define EPP_LAYOUT_TITLEANDBODYSLIDE 1 /* Title and body slide */
1991 -#define EPP_LAYOUT_TITLEMASTERSLIDE 2 /* Title master slide */
1992 -#define EPP_LAYOUT_MASTERSLIDE 3 /* Master slide layout */
1993 -#define EPP_LAYOUT_MASTERNOTES 4 /* Master notes layout */
1994 -#define EPP_LAYOUT_NOTESTITLEBODY 5 /* Notes title/body layout */
1995 -#define EPP_LAYOUT_HANDOUTLAYOUT 6 /* Handout layout, therefore it doesn't have placeholders except header, footer, and date */
1996 -#define EPP_LAYOUT_ONLYTITLE 7 /* Only title placeholder */
1997 -#define EPP_LAYOUT_2COLUMNSANDTITLE 8 /* Body of the slide has 2 columns and a title */
1998 -#define EPP_LAYOUT_2ROWSANDTITLE 9 /* Slide's body has 2 rows and a title */
1999 -#define EPP_LAYOUT_RIGHTCOLUMN2ROWS 10 /* Body contains 2 columns, right column has 2 rows */
2000 -#define EPP_LAYOUT_LEFTCOLUMN2ROWS 11 /* Body contains 2 columns, left column has 2 rows */
2001 -#define EPP_LAYOUT_BOTTOMROW2COLUMNS 12 /* Body contains 2 rows, bottom row has 2 columns */
2002 -#define EPP_LAYOUT_TOPROW2COLUMN 13 /* Body contains 2 rows, top row has 2 columns */
2003 -#define EPP_LAYOUT_4OBJECTS 14 /* 4 objects */
2004 -#define EPP_LAYOUT_BIGOBJECT 15 /* Big object */
2005 -#define EPP_LAYOUT_BLANCSLIDE 16 /* Blank slide */
2006 -#define EPP_LAYOUT_TITLERIGHTBODYLEFT 17 /* Vertical title on the right, body on the left */
2007 -#define EPP_LAYOUT_TITLERIGHT2BODIESLEFT 18 /* Vertical title on the right, body on the left split into 2 rows */
2009 class Polygon;
2010 -class PptEscherEx;
2011 class XStatusIndicatorRef;
2013 -struct PHLayout
2015 - sal_Int32 nLayout;
2016 - sal_uInt8 nPlaceHolder[ 8 ];
2018 - sal_uInt8 nUsedObjectPlaceHolder;
2019 - sal_uInt8 nTypeOfTitle;
2020 - sal_uInt8 nTypeOfOutliner;
2022 - BOOL bTitlePossible;
2023 - BOOL bOutlinerPossible;
2024 - BOOL bSecOutlinerPossible;
2027 -struct SOParagraph
2029 - sal_Bool bExtendedParameters;
2030 - sal_uInt32 nParaFlags;
2031 - sal_Int16 nBulletFlags;
2032 - String sPrefix;
2033 - String sSuffix;
2034 - String sGraphicUrl; // String auf eine Graphic
2035 - Size aBuGraSize;
2036 - sal_uInt32 nNumberingType; // in wirlichkeit ist dies ein SvxEnum
2037 - sal_uInt32 nHorzAdjust;
2038 - sal_uInt32 nBulletColor;
2039 - sal_Int32 nBulletOfs;
2040 - sal_Int16 nStartWith; // Start der nummerierung
2041 - sal_Int16 nTextOfs;
2042 - sal_Int16 nBulletRealSize; // GroessenVerhaeltnis in Proz
2043 - sal_Int16 nDepth; // aktuelle tiefe
2044 - sal_Unicode cBulletId; // wenn Numbering Type == CharSpecial
2045 - ::com::sun::star::awt::FontDescriptor aFontDesc;
2047 - sal_Bool bExtendedBulletsUsed;
2048 - sal_uInt16 nBulletId;
2049 - sal_uInt32 nMappedNumType;
2050 - sal_Bool bNumberingIsNumber;
2052 - SOParagraph()
2054 - nDepth = 0;
2055 - bExtendedParameters = FALSE;
2056 - nParaFlags = 0;
2057 - nBulletFlags = 0;
2058 - nBulletOfs = 0;
2059 - nTextOfs = 0;
2060 - bExtendedBulletsUsed = FALSE;
2061 - nBulletId = 0xffff;
2062 - bNumberingIsNumber = sal_True;
2063 - };
2066 // ------------------------------------------------------------------------
2068 -class EscherGraphicProvider;
2069 -class PPTExBulletProvider
2071 - friend struct PPTExParaSheet;
2073 - protected :
2075 - SvMemoryStream aBuExPictureStream;
2076 - SvMemoryStream aBuExOutlineStream;
2077 - SvMemoryStream aBuExMasterStream;
2079 - EscherGraphicProvider* pGraphicProv;
2081 - public :
2083 - sal_uInt16 GetId( const ByteString& rUniqueId, Size& rGraphicSize );
2085 - PPTExBulletProvider();
2086 - ~PPTExBulletProvider();
2089 -struct FontCollectionEntry
2091 - String Name;
2092 - double Scaling;
2093 - sal_Int16 Family;
2094 - sal_Int16 Pitch;
2095 - sal_Int16 CharSet;
2097 - String Original;
2098 - sal_Bool bIsConverted;
2100 - FontCollectionEntry( const String& rName, sal_Int16 nFamily, sal_Int16 nPitch, sal_Int16 nCharSet ) :
2101 - Scaling ( 1.0 ),
2102 - Family ( nFamily ),
2103 - Pitch ( nPitch ),
2104 - CharSet ( nCharSet ),
2105 - Original( rName )
2107 - ImplInit( rName );
2108 - };
2110 - FontCollectionEntry( const String& rName ) :
2111 - Scaling ( 1.0 ),
2112 - Original( rName )
2114 - ImplInit( rName );
2115 - };
2116 - ~FontCollectionEntry();
2118 - private :
2120 - FontCollectionEntry() {};
2122 - void ImplInit( const String& rName );
2125 -class VirtualDevice;
2126 -class FontCollection : private List
2128 - VirtualDevice* pVDev;
2129 - public :
2130 - FontCollection();
2131 - ~FontCollection();
2133 - short GetScriptDirection( const String& rText ) const;
2134 - sal_uInt32 GetId( FontCollectionEntry& rFontDescriptor );
2135 - sal_uInt32 GetCount() const { return List::Count(); };
2136 - const FontCollectionEntry* GetById( sal_uInt32 nId );
2137 - FontCollectionEntry& GetLast() { return *(FontCollectionEntry*)List::Last(); };
2140 -// ------------------------------------------------------------------------
2142 -#define PPTEX_STYLESHEETENTRYS 9
2144 -enum PPTExTextAttr
2146 - ParaAttr_BulletOn,
2147 - ParaAttr_BuHardFont,
2148 - ParaAttr_BuHardColor,
2149 - ParaAttr_BuHardHeight,
2150 - ParaAttr_BulletChar,
2151 - ParaAttr_BulletFont,
2152 - ParaAttr_BulletHeight,
2153 - ParaAttr_BulletColor,
2154 - ParaAttr_Adjust,
2155 - ParaAttr_LineFeed,
2156 - ParaAttr_UpperDist,
2157 - ParaAttr_LowerDist,
2158 - ParaAttr_TextOfs,
2159 - ParaAttr_BulletOfs,
2160 - ParaAttr_DefaultTab,
2161 - ParaAttr_AsianLB_1,
2162 - ParaAttr_AsianLB_2,
2163 - ParaAttr_AsianLB_3,
2164 - ParaAttr_BiDi,
2165 - CharAttr_Bold,
2166 - CharAttr_Italic,
2167 - CharAttr_Underline,
2168 - CharAttr_Shadow,
2169 - CharAttr_Strikeout,
2170 - CharAttr_Embossed,
2171 - CharAttr_Font,
2172 - CharAttr_AsianOrComplexFont,
2173 - CharAttr_Symbol,
2174 - CharAttr_FontHeight,
2175 - CharAttr_FontColor,
2176 - CharAttr_Escapement
2179 -struct PPTExCharLevel
2181 - sal_uInt16 mnFlags;
2182 - sal_uInt16 mnFont;
2183 - sal_uInt16 mnAsianOrComplexFont;
2184 - sal_uInt16 mnFontHeight;
2185 - sal_uInt16 mnEscapement;
2186 - sal_uInt32 mnFontColor;
2189 -struct PPTExCharSheet
2191 - PPTExCharLevel maCharLevel[ 5 ];
2193 - PPTExCharSheet( int nInstance );
2195 - void SetStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
2196 - FontCollection& rFontCollection, int nLevel );
2197 - void Write( SvStream& rSt, PptEscherEx* pEx, sal_uInt16 nLev, sal_Bool bFirst, sal_Bool bSimpleText,
2198 - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPagePropSet );
2202 -struct PPTExParaLevel
2204 - sal_Bool mbIsBullet;
2205 - sal_uInt16 mnBulletChar;
2206 - sal_uInt16 mnBulletFont;
2207 - sal_uInt16 mnBulletHeight;
2208 - sal_uInt32 mnBulletColor;
2210 - sal_uInt16 mnAdjust;
2211 - sal_uInt16 mnLineFeed;
2212 - sal_uInt16 mnUpperDist;
2213 - sal_uInt16 mnLowerDist;
2214 - sal_uInt16 mnTextOfs;
2215 - sal_uInt16 mnBulletOfs;
2216 - sal_uInt16 mnDefaultTab;
2218 - sal_Bool mbExtendedBulletsUsed;
2219 - sal_uInt16 mnBulletId;
2220 - sal_uInt16 mnBulletStart;
2221 - sal_uInt32 mnMappedNumType;
2222 - sal_uInt32 mnNumberingType;
2223 - sal_uInt16 mnAsianSettings;
2224 - sal_uInt16 mnBiDi;
2227 -struct PPTExParaSheet
2229 - PPTExBulletProvider& rBuProv;
2231 - sal_uInt32 mnInstance;
2233 - PPTExParaLevel maParaLevel[ 5 ];
2234 - PPTExParaSheet( int nInstance, sal_uInt16 nDefaultTab, PPTExBulletProvider& rProv );
2236 - void SetStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
2237 - FontCollection& rFontCollection, int nLevel, const PPTExCharLevel& rCharLevel );
2238 - void Write( SvStream& rSt, PptEscherEx* pEx, sal_uInt16 nLev, sal_Bool bFirst, sal_Bool bSimpleText,
2239 - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPagePropSet );
2242 -class PPTExStyleSheet
2245 - public :
2247 - PPTExCharSheet* mpCharSheet[ PPTEX_STYLESHEETENTRYS ];
2248 - PPTExParaSheet* mpParaSheet[ PPTEX_STYLESHEETENTRYS ];
2250 - PPTExStyleSheet( sal_uInt16 nDefaultTab, PPTExBulletProvider& rBuProv );
2251 - ~PPTExStyleSheet();
2253 - PPTExParaSheet& GetParaSheet( int nInstance ) { return *mpParaSheet[ nInstance ]; };
2254 - PPTExCharSheet& GetCharSheet( int nInstance ) { return *mpCharSheet[ nInstance ]; };
2256 - void SetStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
2257 - FontCollection& rFontCollection, int nInstance, int nLevel );
2258 - sal_Bool IsHardAttribute( sal_uInt32 nInstance, sal_uInt32 nLevel, PPTExTextAttr eAttr, sal_uInt32 nValue );
2260 - sal_uInt32 SizeOfTxCFStyleAtom() const;
2261 - void WriteTxCFStyleAtom( SvStream& rSt );
2265 struct EPPTHyperlink
2267 String aURL;
2268 @@ -437,296 +157,34 @@ struct TextRuleEntry
2269 ~TextRuleEntry() { delete pOut; };
2272 -// ------------------------------------------------------------------------
2274 -struct GroupEntry
2275 +class TextObjBinary : public TextObj
2277 - sal_uInt32 mnCurrentPos;
2278 - sal_uInt32 mnCount;
2279 - ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > mXIndexAccess;
2280 - GroupEntry( ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > & rIndex )
2282 - mXIndexAccess = rIndex;
2283 - mnCount =mXIndexAccess->getCount();
2284 - mnCurrentPos = 0;
2285 - };
2286 - GroupEntry( sal_uInt32 nCount )
2288 - mnCount = nCount;
2289 - mnCurrentPos = 0;
2290 - };
2291 - ~GroupEntry(){};
2294 -// ------------------------------------------------------------------------
2295 +public:
2296 + TextObjBinary( ::com::sun::star::uno::Reference< ::com::sun::star::text::XSimpleText > &
2297 + rXText, int nInstance, FontCollection& rFontCollection, PPTExBulletProvider& rBuProv ) : TextObj( rXText, nInstance, rFontCollection, rBuProv ) {}
2299 -class GroupTable
2301 - protected:
2303 - sal_uInt32 mnIndex;
2304 - sal_uInt32 mnCurrentGroupEntry;
2305 - sal_uInt32 mnMaxGroupEntry;
2306 - sal_uInt32 mnGroupsClosed;
2307 - GroupEntry** mpGroupEntry;
2309 - void ImplResizeGroupTable( sal_uInt32 nEntrys );
2311 - public:
2313 - sal_uInt32 GetCurrentGroupIndex() const { return mnIndex; };
2314 - sal_Int32 GetCurrentGroupLevel() const { return mnCurrentGroupEntry - 1; };
2315 - ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > &
2316 - GetCurrentGroupAccess() const { return mpGroupEntry[ mnCurrentGroupEntry - 1 ]->mXIndexAccess; };
2317 - sal_uInt32 GetGroupsClosed();
2318 - void SkipCurrentGroup();
2319 - void ResetGroupTable( sal_uInt32 nCount );
2320 - void ClearGroupTable();
2321 - sal_Bool EnterGroup( ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > & rIndex );
2322 - sal_Bool GetNextGroupEntry();
2323 - GroupTable();
2324 - ~GroupTable();
2327 -class PropValue
2329 - protected :
2331 - ::com::sun::star::uno::Any mAny;
2333 - ::com::sun::star::uno::Reference
2334 - < ::com::sun::star::beans::XPropertySet > mXPropSet;
2336 - sal_Bool ImplGetPropertyValue( const String& rString );
2337 - sal_Bool ImplGetPropertyValue( const ::com::sun::star::uno::Reference
2338 - < ::com::sun::star::beans::XPropertySet > &, const String& );
2340 - public :
2342 - static sal_Bool GetPropertyValue(
2343 - ::com::sun::star::uno::Any& rAny,
2344 - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
2345 - const String& rPropertyName,
2346 - sal_Bool bTestPropertyAvailability = sal_False );
2348 - static ::com::sun::star::beans::PropertyState GetPropertyState(
2349 - const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > &,
2350 - const String& rPropertyName );
2353 -class PropStateValue : public PropValue
2355 - protected :
2357 - ::com::sun::star::beans::PropertyState ePropState;
2358 - ::com::sun::star::uno::Reference
2359 - < ::com::sun::star::beans::XPropertyState > mXPropState;
2361 - sal_Bool ImplGetPropertyValue( const String& rString, sal_Bool bGetPropertyState = TRUE );
2365 -// ------------------------------------------------------------------------
2367 -struct FieldEntry;
2368 -class PortionObj : public PropStateValue
2371 - friend class ParagraphObj;
2373 - protected :
2375 - void ImplClear();
2376 - void ImplConstruct( PortionObj& rPortionObj );
2377 - sal_uInt32 ImplGetTextField( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & rXTextRangeRef,
2378 - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSetRef, String& rURL );
2379 - sal_uInt32 ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition );
2380 - void ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool bGetPropStateValue = FALSE );
2382 - public :
2384 - ::com::sun::star::beans::PropertyState meCharColor;
2385 - ::com::sun::star::beans::PropertyState meCharHeight;
2386 - ::com::sun::star::beans::PropertyState meFontName;
2387 - ::com::sun::star::beans::PropertyState meAsianOrComplexFont;
2388 - ::com::sun::star::beans::PropertyState meCharEscapement;
2389 - ::com::sun::star::lang::Locale meCharLocale;
2390 - sal_uInt16 mnCharAttrHard;
2392 - sal_uInt32 mnCharColor;
2393 - sal_uInt16 mnCharAttr;
2394 - sal_uInt16 mnCharHeight;
2395 - sal_uInt16 mnFont;
2396 - sal_uInt16 mnAsianOrComplexFont;
2397 - sal_Int16 mnCharEscapement;
2399 - sal_uInt32 mnTextSize;
2400 - sal_Bool mbLastPortion;
2402 - sal_uInt16* mpText;
2403 - FieldEntry* mpFieldEntry;
2405 - PortionObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & rXTextRangeRef,
2406 - sal_Bool bLast, FontCollection& rFontCollection );
2407 - PortionObj( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSetRef,
2408 - FontCollection& rFontCollection );
2409 - PortionObj( PortionObj& rPortionObj );
2410 - ~PortionObj();
2412 - void Write( SvStream* pStrm, sal_Bool bLast );
2413 - sal_uInt32 Count() const { return mnTextSize; };
2415 - PortionObj& operator=( PortionObj& rPortionObj );
2418 -struct ParaFlags
2420 - sal_Bool bFirstParagraph : 1;
2421 - sal_Bool bLastParagraph : 1;
2423 - ParaFlags() { bFirstParagraph = TRUE; bLastParagraph = FALSE; };
2426 -class ParagraphObj : public List, public PropStateValue, public SOParagraph
2428 - friend class TextObj;
2429 - friend struct PPTExParaSheet;
2431 - MapMode maMapModeSrc;
2432 - MapMode maMapModeDest;
2434 - protected :
2436 - void ImplConstruct( ParagraphObj& rParagraphObj );
2437 - void ImplClear();
2438 - sal_uInt32 ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition );
2439 - ::com::sun::star::awt::Size ImplMapSize( const ::com::sun::star::awt::Size& rSize );
2440 - void ImplGetParagraphValues( PPTExBulletProvider& rBuProv, sal_Bool bGetPropStateValue = FALSE );
2441 - void ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int16 nDepth, sal_Bool bIsBullet, sal_Bool bGetPropStateValue = FALSE );
2443 - public :
2445 - ::com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop > maTabStop;
2447 - sal_uInt32 mnTextSize;
2449 - sal_Bool mbIsBullet;
2450 - sal_Bool mbFirstParagraph;
2451 - sal_Bool mbLastParagraph;
2453 - ::com::sun::star::beans::PropertyState meBullet;
2454 - ::com::sun::star::beans::PropertyState meTextAdjust;
2455 - ::com::sun::star::beans::PropertyState meLineSpacing;
2456 - ::com::sun::star::beans::PropertyState meLineSpacingTop;
2457 - ::com::sun::star::beans::PropertyState meLineSpacingBottom;
2458 - ::com::sun::star::beans::PropertyState meForbiddenRules;
2459 - ::com::sun::star::beans::PropertyState meParagraphPunctation;
2460 - ::com::sun::star::beans::PropertyState meBiDi;
2462 - sal_uInt16 mnTextAdjust;
2463 - sal_Int16 mnLineSpacing;
2464 - sal_Bool mbFixedLineSpacing;
2465 - sal_Int16 mnLineSpacingTop;
2466 - sal_Int16 mnLineSpacingBottom;
2467 - sal_Bool mbForbiddenRules;
2468 - sal_Bool mbParagraphPunctation;
2469 - sal_uInt16 mnBiDi;
2471 - ParagraphObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > & rXTextContentRef,
2472 - ParaFlags, FontCollection& rFontCollection,
2473 - PPTExBulletProvider& rBuProv );
2474 - ParagraphObj( ParagraphObj& rParargraphObj );
2475 - ParagraphObj( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSetRef,
2476 - PPTExBulletProvider& rBuProv );
2478 - void CalculateGraphicBulletSize( sal_uInt16 nFontHeight );
2479 - ~ParagraphObj();
2481 - void Write( SvStream* pStrm );
2482 - sal_uInt32 Count() const { return mnTextSize; };
2484 - ParagraphObj& operator=( ParagraphObj& rParagraphObj );
2487 -struct ImplTextObj
2489 - sal_uInt32 mnRefCount;
2490 - sal_uInt32 mnTextSize;
2491 - int mnInstance;
2492 - List* mpList;
2493 - sal_Bool mbHasExtendedBullets;
2494 - sal_Bool mbFixedCellHeightUsed;
2496 - ImplTextObj( int nInstance );
2497 - ~ImplTextObj();
2500 -class TextObj
2502 - ImplTextObj* mpImplTextObj;
2503 - void ImplCalculateTextPositions();
2505 - public :
2506 - TextObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XSimpleText > &
2507 - rXText, int nInstance, FontCollection& rFontCollection, PPTExBulletProvider& rBuProv );
2508 - TextObj( TextObj& rTextObj );
2509 - ~TextObj();
2511 - void Write( SvStream* pStrm );
2513 - ParagraphObj* First(){ return (ParagraphObj*)mpImplTextObj->mpList->First(); };
2514 - ParagraphObj* Next(){ return(ParagraphObj*)mpImplTextObj->mpList->Next(); };
2515 - sal_uInt32 Count() const { return mpImplTextObj->mnTextSize; };
2516 - int GetInstance() const { return mpImplTextObj->mnInstance; };
2517 - sal_Bool HasExtendedBullets(){ return mpImplTextObj->mbHasExtendedBullets; };
2518 - void WriteTextSpecInfo( SvStream* pStrm );
2520 - TextObj& operator=( TextObj& rTextObj );
2521 + void Write( SvStream* pStrm );
2522 + void WriteTextSpecInfo( SvStream* pStrm );
2525 // ------------------------------------------------------------------------
2526 struct CellBorder;
2527 -class PPTWriter : public GroupTable, public PropValue, public PPTExBulletProvider
2528 +class PPTWriter : public PPTWriterBase, public PPTExBulletProvider
2530 + sal_uInt32 mnCnvrtFlags;
2531 sal_Bool mbStatus;
2532 sal_Bool mbUseNewAnimations;
2533 sal_uInt32 mnStatMaxValue;
2534 sal_uInt32 mnLatestStatValue;
2535 - std::vector< PPTExStyleSheet* > maStyleSheetList;
2536 - PPTExStyleSheet* mpStyleSheet;
2538 EscherGraphicProvider* mpGraphicProvider;
2539 - Fraction maFraction;
2540 - MapMode maMapModeSrc;
2541 - MapMode maMapModeDest;
2542 - ::com::sun::star::awt::Size maDestPageSize;
2543 - ::com::sun::star::awt::Size maNotesPageSize;
2544 - PageType meLatestPageType;
2545 List maSlideNameList;
2547 - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mXModel;
2548 - ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > mXStatusIndicator;
2549 - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPagesSupplier > mXDrawPagesSupplier;
2550 - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XMasterPagesSupplier > mXMasterPagesSupplier;
2551 - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPages > mXDrawPages;
2552 - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > mXDrawPage;
2553 - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mXPagePropSet;
2554 - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mXBackgroundPropSet;
2555 - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mXShapes;
2556 - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXShape;
2557 ::com::sun::star::uno::Reference< ::com::sun::star::text::XSimpleText > mXText; // TextRef des globalen Text
2558 ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > mXCursor;
2559 ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > mXCursorText; // TextRef des Teilstuecks des Cursors
2560 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mXCursorPropSet; // die Properties des Teilstueckes
2561 ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextField > mXTextField;
2562 - ::com::sun::star::awt::Size maSize;
2563 - ::com::sun::star::awt::Point maPosition;
2564 - Rectangle maRect;
2565 - ByteString mType;
2566 - sal_Bool mbPresObj;
2567 - sal_Bool mbEmptyPresObj;
2568 - sal_Bool mbStatusIndicator;
2569 - sal_Int32 mnAngle;
2570 sal_uInt32 mnTextStyle;
2572 sal_Bool mbFontIndependentLineSpacing;
2573 @@ -744,8 +202,6 @@ class PPTWriter : public GroupTable, public PropValue, public PPTExBulletProvide
2574 sal_uInt32 mnExEmbed;
2575 SvMemoryStream* mpExEmbed;
2577 - sal_uInt32 mnPages; // anzahl einzelner Slides ( ohne masterpages & notes & handout )
2578 - sal_uInt32 mnMasterPages; //
2579 sal_uInt32 mnDrawings; // anzahl Slides + masterpages + notes + handout
2580 sal_uInt32 mnPagesWritten;
2581 sal_uInt32 mnUniqueSlideIdentifier;
2582 @@ -757,13 +213,10 @@ class PPTWriter : public GroupTable, public PropValue, public PPTExBulletProvide
2583 sal_uInt32 mnShapeMasterTitle;
2584 sal_uInt32 mnShapeMasterBody;
2586 - List maTextRuleList; // TextRuleEntry's
2587 List maHyperlink;
2589 - FontCollection maFontCollection;
2590 ppt::ExSoundCollection maSoundCollection;
2592 - PHLayout& ImplGetLayout( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rXPropSet ) const;
2593 void ImplWriteExtParaHeader( SvMemoryStream& rSt, sal_uInt32 nRef, sal_uInt32 nInstance, sal_uInt32 nSlideId );
2596 @@ -778,29 +231,22 @@ class PPTWriter : public GroupTable, public PropValue, public PPTExBulletProvide
2598 protected:
2600 - sal_Bool ImplCreateDocumentSummaryInformation( sal_uInt32 nCnvrtFlags );
2601 + sal_Bool ImplCreateDocumentSummaryInformation();
2602 sal_Bool ImplCreateCurrentUserStream();
2603 void ImplCreateHeaderFooterStrings( SvStream& rOut,
2604 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rXPagePropSet );
2605 void ImplCreateHeaderFooters( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rXPagePropSet );
2606 - sal_Bool ImplCreateDocument();
2607 + virtual sal_Bool ImplCreateDocument();
2608 sal_Bool ImplCreateHyperBlob( SvMemoryStream& rStream );
2609 sal_uInt32 ImplInsertBookmarkURL( const String& rBookmark, const sal_uInt32 nType,
2610 const String& rStringVer0, const String& rStringVer1, const String& rStringVer2, const String& rStringVer3 );
2611 - sal_Bool ImplCreateMaster( sal_uInt32 nPageNum );
2612 - sal_Bool ImplCreateMainNotes();
2613 - sal_Bool ImplCreateSlide( sal_uInt32 nPageNum );
2614 + virtual sal_Bool ImplCreateMainNotes();
2615 sal_Bool ImplCreateNotes( sal_uInt32 nPageNum );
2616 void ImplWriteBackground( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXBackgroundPropSet );
2617 - void ImplWriteVBA( SvMemoryStream* pVBA );
2618 - void ImplWriteOLE( sal_uInt32 nCnvrtFlags );
2619 + void ImplWriteVBA();
2620 + void ImplWriteOLE();
2621 sal_Bool ImplWriteAtomEnding();
2623 - sal_Bool ImplInitSOIface();
2624 - sal_Bool ImplSetCurrentStyleSheet( sal_uInt32 nPageNum );
2625 - sal_Bool ImplGetPageByIndex( sal_uInt32 nIndex, PageType );
2626 - sal_Bool ImplGetShapeByIndex( sal_uInt32 nIndex, sal_Bool bGroup = FALSE );
2627 - sal_uInt32 ImplGetMasterIndex( PageType ePageType );
2628 void ImplFlipBoundingBox( EscherPropertyContainer& rPropOpt );
2629 sal_Bool ImplGetText();
2630 sal_Bool ImplCreatePresentationPlaceholder( const sal_Bool bMaster, const PageType PageType,
2631 @@ -814,7 +260,6 @@ class PPTWriter : public GroupTable, public PropValue, public PPTExBulletProvide
2632 ::com::sun::star::presentation::AnimationEffect eTextEffect,
2633 sal_uInt16 nOrder );
2634 void ImplWriteClickAction( SvStream& rSt, ::com::sun::star::presentation::ClickAction eAction, sal_Bool bMediaClickAction );
2635 - sal_Bool ImplGetStyleSheets();
2636 void ImplWriteParagraphs( SvStream& rOutStrm, TextObj& rTextObj );
2637 void ImplWritePortions( SvStream& rOutStrm, TextObj& rTextObj );
2638 void ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_uInt32 nAtomInstance,
2639 @@ -831,13 +276,15 @@ class PPTWriter : public GroupTable, public PropValue, public PPTExBulletProvide
2640 void ImplCreateCellBorder( const CellBorder* pCellBorder, sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int32 nY2 );
2641 void ImplCreateTable( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rXShape, EscherSolverContainer& aSolverContainer,
2642 EscherPropertyContainer& aPropOpt );
2643 - ::com::sun::star::awt::Point ImplMapPoint( const ::com::sun::star::awt::Point& );
2644 - ::com::sun::star::awt::Size ImplMapSize( const ::com::sun::star::awt::Size& );
2645 - Rectangle ImplMapRectangle( const ::com::sun::star::awt::Rectangle& );
2647 sal_Bool ImplCloseDocument(); // die font-, hyper-, Soundliste wird geschrieben ..
2648 void ImplWriteCString( SvStream&, const String&, sal_uInt32 nInstance = 0 );
2650 + virtual void ImplWriteSlide( sal_uInt32 nPageNum, sal_uInt32 nMasterID, sal_uInt16 nMode,
2651 + sal_Bool bHasBackground, ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > aXBackgroundPropSet );
2652 + virtual void ImplWriteNotes( sal_uInt32 nPageNum );
2653 + virtual void ImplWriteSlideMaster( sal_uInt32 nPageNum, ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > aXBackgroundPropSet );
2655 public:
2656 PPTWriter( SvStorageRef& rSvStorage,
2657 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & rModel,
2658 @@ -847,6 +294,9 @@ class PPTWriter : public GroupTable, public PropValue, public PPTExBulletProvide
2659 ~PPTWriter();
2661 sal_Bool IsValid() const { return mbStatus; };
2663 + virtual void exportPPTPre();
2664 + virtual void exportPPTPost();
2668 diff --git sd/source/filter/eppt/epptbase.cxx sd/source/filter/eppt/epptbase.cxx
2669 new file mode 100644
2670 index 0000000..43ec8c0
2671 --- /dev/null
2672 +++ sd/source/filter/pptx/pptx-epptbase.cxx
2673 @@ -0,0 +1,947 @@
2674 +#include <com/sun/star/animations/TransitionType.hpp>
2675 +#include <com/sun/star/animations/TransitionSubType.hpp>
2676 +#include <com/sun/star/awt/FontDescriptor.hpp>
2677 +#include <com/sun/star/awt/FontFamily.hpp>
2678 +#include <com/sun/star/awt/FontPitch.hpp>
2679 +#include <com/sun/star/container/XNamed.hpp>
2680 +#include <com/sun/star/container/XNameAccess.hpp>
2681 +#include <com/sun/star/presentation/XPresentationPage.hpp>
2682 +#include <com/sun/star/text/XSimpleText.hpp>
2683 +#include <com/sun/star/style/XStyle.hpp>
2684 +#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
2686 +#include <cppuhelper/extract.hxx>
2687 +#include <vcl/outdev.hxx>
2689 +#include "epptbase.hxx"
2690 +#include "epptdef.hxx"
2692 +#ifdef DEBUG
2693 +#define DBG(x) x
2694 +#include <stdio.h>
2695 +#else
2696 +#define DBG(x)
2697 +#endif
2699 +using namespace ::com::sun::star;
2700 +using namespace ::com::sun::star::animations;
2701 +using namespace ::com::sun::star::awt::FontFamily;
2702 +using namespace ::com::sun::star::awt::FontPitch;
2703 +using namespace ::com::sun::star::presentation;
2705 +using ::com::sun::star::awt::FontDescriptor;
2706 +using ::com::sun::star::beans::XPropertySet;
2707 +using ::com::sun::star::container::XNameAccess;
2708 +using ::com::sun::star::container::XNamed;
2709 +using ::com::sun::star::drawing::XDrawPagesSupplier;
2710 +using ::com::sun::star::drawing::XMasterPagesSupplier;
2711 +using ::com::sun::star::drawing::XShapes;
2712 +using ::com::sun::star::drawing::XMasterPageTarget;
2713 +using ::com::sun::star::drawing::XDrawPage;
2714 +using ::com::sun::star::frame::XModel;
2715 +using ::com::sun::star::style::XStyleFamiliesSupplier;
2716 +using ::com::sun::star::style::XStyle;
2717 +using ::com::sun::star::task::XStatusIndicator;
2718 +using ::com::sun::star::text::XSimpleText;
2719 +using ::com::sun::star::uno::Any;
2720 +using ::com::sun::star::uno::Exception;
2721 +using ::com::sun::star::uno::Reference;
2722 +using ::com::sun::star::uno::UNO_QUERY;
2724 +static PHLayout pPHLayout[EPP_LAYOUT_SIZE] =
2726 + { EPP_LAYOUT_TITLESLIDE, { 0x0d, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x10, TRUE, TRUE, FALSE },
2727 + { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, TRUE, TRUE, FALSE },
2728 + { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, TRUE, TRUE, FALSE },
2729 + { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, TRUE, TRUE, TRUE },
2730 + { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, TRUE, TRUE, FALSE },
2731 + { EPP_LAYOUT_BLANCSLIDE, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, FALSE, FALSE, FALSE },
2732 + { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x0e, TRUE, TRUE, FALSE },
2733 + { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x14, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, TRUE, TRUE, FALSE },
2734 + { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x15, 0x0d, 0x0e, TRUE, FALSE, FALSE },
2735 + { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x16, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x0e, TRUE, TRUE, FALSE },
2736 + { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x0e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE, TRUE, FALSE },
2737 + { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE, FALSE, FALSE },
2738 + { EPP_LAYOUT_RIGHTCOLUMN2ROWS, { 0x0d, 0x0e, 0x13, 0x13, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE, TRUE, FALSE },
2739 + { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE, TRUE, FALSE },
2740 + { EPP_LAYOUT_2ROWSANDTITLE, { 0x0d, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE, TRUE, FALSE },
2741 + { EPP_LAYOUT_LEFTCOLUMN2ROWS, { 0x0d, 0x13, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE, TRUE, FALSE },
2742 + { EPP_LAYOUT_TOPROW2COLUMN, { 0x0d, 0x13, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE, TRUE, FALSE },
2743 + { EPP_LAYOUT_2ROWSANDTITLE, { 0x0d, 0x0e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE, TRUE, FALSE },
2744 + { EPP_LAYOUT_4OBJECTS, { 0x0d, 0x13, 0x13, 0x13, 0x13, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, TRUE, FALSE, FALSE },
2745 + { EPP_LAYOUT_ONLYTITLE, { 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, TRUE, FALSE, FALSE },
2746 + { EPP_LAYOUT_BLANCSLIDE, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, FALSE, FALSE, FALSE },
2747 + { EPP_LAYOUT_TITLERIGHT2BODIESLEFT, { 0x11, 0x12, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x11, 0x12, TRUE, TRUE, FALSE },
2748 + { EPP_LAYOUT_TITLERIGHTBODYLEFT, { 0x11, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x11, 0x12, TRUE, TRUE, FALSE },
2749 + { EPP_LAYOUT_TITLEANDBODYSLIDE, { 0x0d, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x12, TRUE, TRUE, FALSE },
2750 + { EPP_LAYOUT_2COLUMNSANDTITLE, { 0x0d, 0x16, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x12, TRUE, TRUE, FALSE }
2753 +#define PPT_WRITER_BASE_INIT_VALUES \
2754 + maFraction ( 1, 576 ), \
2755 + maMapModeSrc ( MAP_100TH_MM ), \
2756 + maMapModeDest ( MAP_INCH, Point(), maFraction, maFraction ), \
2757 + meLatestPageType ( NORMAL )
2760 +PPTWriterBase::PPTWriterBase() :
2761 + PPT_WRITER_BASE_INIT_VALUES
2763 + DBG(printf ("PPTWriterBase::PPTWriterBase()\n"));
2766 +PPTWriterBase::PPTWriterBase( const Reference< XModel > & rXModel,
2767 + const Reference< XStatusIndicator > & rXStatInd ) :
2768 + mXModel ( rXModel ),
2769 + mXStatusIndicator ( rXStatInd ),
2770 + mbStatusIndicator ( false ),
2771 + PPT_WRITER_BASE_INIT_VALUES
2775 +// ---------------------------------------------------------------------------------------------
2777 +PPTWriterBase::~PPTWriterBase()
2779 + if ( mbStatusIndicator )
2780 + mXStatusIndicator->end();
2783 +// ---------------------------------------------------------------------------------------------
2785 +void PPTWriterBase::exportPPT()
2787 + if ( !InitSOIface() )
2788 + return;
2790 + FontCollectionEntry aDefaultFontDesc( String( RTL_CONSTASCII_USTRINGPARAM( "Times New Roman" ) ),
2791 + ROMAN,
2792 + awt::FontPitch::VARIABLE,
2793 + RTL_TEXTENCODING_MS_1252 );
2794 + maFontCollection.GetId( aDefaultFontDesc ); // default is always times new roman
2796 + if ( !GetPageByIndex( 0, NOTICE ) )
2797 + return;
2799 + INT32 nWidth = 21000;
2800 + if ( ImplGetPropertyValue( mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ) ) )
2801 + mAny >>= nWidth;
2802 + INT32 nHeight = 29700;
2803 + if ( ImplGetPropertyValue( mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ) )
2804 + mAny >>= nHeight;
2806 + maNotesPageSize = MapSize( awt::Size( nWidth, nHeight ) );
2808 + if ( !GetPageByIndex( 0, MASTER ) )
2809 + return;
2811 + nWidth = 28000;
2812 + if ( ImplGetPropertyValue( mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ) ) )
2813 + mAny >>= nWidth;
2814 + nHeight = 21000;
2815 + if ( ImplGetPropertyValue( mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ) )
2816 + mAny >>= nHeight;
2817 + maDestPageSize = MapSize( awt::Size( nWidth, nHeight ) );
2819 + DBG(printf( "call exportDocumentPre()\n"));
2820 + exportPPTPre();
2822 + if ( !GetStyleSheets() )
2823 + return;
2825 + if ( !ImplCreateDocument() )
2826 + return;
2828 + sal_uInt32 i;
2830 + for ( i = 0; i < mnPages; i++ )
2832 + if ( GetPageByIndex( i, NORMAL ) ) {
2833 + sal_uInt32 nMasterNum = GetMasterIndex( NORMAL );
2834 + ImplWriteLayout( GetLayoutOffset( mXPagePropSet ), nMasterNum );
2838 + for ( i = 0; i < mnMasterPages; i++ )
2840 + if ( !CreateSlideMaster( i ) )
2841 + return;
2843 + if ( !CreateMainNotes() )
2844 + return;
2845 + maTextRuleList.First(); // rewind list, so we can get the current or next entry without
2846 + // searching, all entrys are sorted#
2847 + for ( i = 0; i < mnPages; i++ )
2849 + DBG(printf( "call ImplCreateSlide( %d )\n", i));
2850 + if ( !CreateSlide( i ) )
2851 + return;
2854 + for ( i = 0; i < mnPages; i++ )
2856 + if ( !CreateNotes( i ) )
2857 + return;
2860 + DBG(printf( "call exportDocumentPost()\n"));
2861 + exportPPTPost();
2864 +// ---------------------------------------------------------------------------------------------
2866 +sal_Bool PPTWriterBase::InitSOIface()
2868 + while( TRUE )
2870 + mXDrawPagesSupplier = Reference< XDrawPagesSupplier >( mXModel, UNO_QUERY );
2871 + if ( !mXDrawPagesSupplier.is() )
2872 + break;
2874 + mXMasterPagesSupplier = Reference< XMasterPagesSupplier >( mXModel, UNO_QUERY );
2875 + if ( !mXMasterPagesSupplier.is() )
2876 + break;
2877 + mXDrawPages = mXMasterPagesSupplier->getMasterPages();
2878 + if ( !mXDrawPages.is() )
2879 + break;
2880 + mnMasterPages = mXDrawPages->getCount();
2881 + mXDrawPages = mXDrawPagesSupplier->getDrawPages();
2882 + if( !mXDrawPages.is() )
2883 + break;
2884 + mnPages = mXDrawPages->getCount();
2885 + if ( !GetPageByIndex( 0, NORMAL ) )
2886 + break;
2888 + return TRUE;
2890 + return FALSE;
2893 +// ---------------------------------------------------------------------------------------------
2895 +sal_Bool PPTWriterBase::GetPageByIndex( sal_uInt32 nIndex, PageType ePageType )
2897 + while( TRUE )
2899 + if ( ePageType != meLatestPageType )
2901 + switch( ePageType )
2903 + case NORMAL :
2904 + case NOTICE :
2906 + mXDrawPages = mXDrawPagesSupplier->getDrawPages();
2907 + if( !mXDrawPages.is() )
2908 + return FALSE;
2910 + break;
2912 + case MASTER :
2914 + mXDrawPages = mXMasterPagesSupplier->getMasterPages();
2915 + if( !mXDrawPages.is() )
2916 + return FALSE;
2918 + break;
2919 + default:
2920 + break;
2922 + meLatestPageType = ePageType;
2924 + Any aAny( mXDrawPages->getByIndex( nIndex ) );
2925 + aAny >>= mXDrawPage;
2926 + if ( !mXDrawPage.is() )
2927 + break;
2928 + if ( ePageType == NOTICE )
2930 + Reference< XPresentationPage > aXPresentationPage( mXDrawPage, UNO_QUERY );
2931 + if ( !aXPresentationPage.is() )
2932 + break;
2933 + mXDrawPage = aXPresentationPage->getNotesPage();
2934 + if ( !mXDrawPage.is() )
2935 + break;
2937 + mXPagePropSet = Reference< XPropertySet >( mXDrawPage, UNO_QUERY );
2938 + if ( !mXPagePropSet.is() )
2939 + break;
2941 + mXShapes = Reference< XShapes >( mXDrawPage, UNO_QUERY );
2942 + if ( !mXShapes.is() )
2943 + break;
2945 + /* try to get the "real" background PropertySet. If the normal page is not supporting this property, it is
2946 + taken the property from the master */
2947 + sal_Bool bHasBackground = GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Background" ) ), sal_True );
2948 + if ( bHasBackground )
2949 + bHasBackground = ( aAny >>= mXBackgroundPropSet );
2950 + if ( !bHasBackground )
2952 + Reference< XMasterPageTarget > aXMasterPageTarget( mXDrawPage, UNO_QUERY );
2953 + if ( aXMasterPageTarget.is() )
2955 + Reference< XDrawPage > aXMasterDrawPage;
2956 + aXMasterDrawPage = aXMasterPageTarget->getMasterPage();
2957 + if ( aXMasterDrawPage.is() )
2959 + Reference< XPropertySet > aXMasterPagePropSet;
2960 + aXMasterPagePropSet = Reference< XPropertySet >
2961 + ( aXMasterDrawPage, UNO_QUERY );
2962 + if ( aXMasterPagePropSet.is() )
2964 + sal_Bool bBackground = GetPropertyValue( aAny, aXMasterPagePropSet,
2965 + String( RTL_CONSTASCII_USTRINGPARAM( "Background" ) ) );
2966 + if ( bBackground )
2968 + aAny >>= mXBackgroundPropSet;
2974 + return TRUE;
2976 + return FALSE;
2979 +// ---------------------------------------------------------------------------------------------
2981 +sal_Bool PPTWriterBase::CreateSlide( sal_uInt32 nPageNum )
2983 + Any aAny;
2985 + if ( !GetPageByIndex( nPageNum, NORMAL ) )
2986 + return FALSE;
2988 + sal_uInt32 nMasterNum = GetMasterIndex( NORMAL );
2989 + SetCurrentStyleSheet( nMasterNum );
2991 + Reference< XPropertySet > aXBackgroundPropSet;
2992 + sal_Bool bHasBackground = GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Background" ) ) );
2993 + if ( bHasBackground )
2994 + bHasBackground = ( aAny >>= aXBackgroundPropSet );
2996 + sal_uInt16 nMode = 7; // Bit 1: Follow master objects, Bit 2: Follow master scheme, Bit 3: Follow master background
2997 + if ( bHasBackground )
2998 + nMode &=~4;
3000 +/* sj: Don't know what's IsBackgroundVisible for, have to ask cl
3001 + if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundVisible" ) ) ) )
3003 + sal_Bool bBackgroundVisible;
3004 + if ( aAny >>= bBackgroundVisible )
3006 + if ( bBackgroundVisible )
3007 + nMode &= ~4;
3011 + if ( GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundObjectsVisible" ) ) ) )
3013 + sal_Bool bBackgroundObjectsVisible = sal_False;
3014 + if ( aAny >>= bBackgroundObjectsVisible )
3016 + if ( !bBackgroundObjectsVisible )
3017 + nMode &= ~1;
3021 + ImplWriteSlide( nPageNum, nMasterNum, nMode, bHasBackground, aXBackgroundPropSet );
3023 + return TRUE;
3026 +// ---------------------------------------------------------------------------------------------
3028 +sal_Bool PPTWriterBase::CreateNotes( sal_uInt32 nPageNum )
3030 + if ( !GetPageByIndex( nPageNum, NOTICE ) )
3031 + return FALSE;
3032 + SetCurrentStyleSheet( GetMasterIndex( NORMAL ) );
3034 + ImplWriteNotes( nPageNum );
3036 + return TRUE;
3039 +// ---------------------------------------------------------------------------------------------
3041 +sal_Bool PPTWriterBase::CreateSlideMaster( sal_uInt32 nPageNum )
3043 + if ( !GetPageByIndex( nPageNum, MASTER ) )
3044 + return FALSE;
3045 + SetCurrentStyleSheet( nPageNum );
3047 + if ( !ImplGetPropertyValue( mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Background" ) ) ) ) // Backgroundshape laden
3048 + return FALSE;
3049 + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > aXBackgroundPropSet;
3050 + if ( !( mAny >>= aXBackgroundPropSet ) )
3051 + return FALSE;
3053 + ImplWriteSlideMaster( nPageNum, aXBackgroundPropSet );
3055 + return TRUE;
3058 +// ---------------------------------------------------------------------------------------------
3060 +sal_Int32 PPTWriterBase::GetLayoutOffset( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rXPropSet ) const
3062 + ::com::sun::star::uno::Any aAny;
3063 + sal_Int32 nLayout = 20;
3064 + if ( GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Layout" ) ) ), sal_True )
3065 + aAny >>= nLayout;
3067 + if ( ( nLayout >= 21 ) && ( nLayout <= 26 ) ) // NOTES _> HANDOUT6
3068 + nLayout = 20;
3069 + if ( ( nLayout >= 27 ) && ( nLayout <= 30 ) ) // VERTICAL LAYOUT
3070 + nLayout -= 6;
3071 + else if ( nLayout > 30 )
3072 + nLayout = 20;
3074 + return nLayout;
3077 +PHLayout& PPTWriterBase::GetLayout( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rXPropSet ) const
3079 + return pPHLayout[ GetLayoutOffset( rXPropSet ) ];
3082 +// ---------------------------------------------------------------------------------------------
3084 +PHLayout& PPTWriterBase::GetLayout( sal_Int32 nOffset ) const
3086 + if( nOffset >= 0 && nOffset < EPP_LAYOUT_SIZE )
3087 + return pPHLayout[ nOffset ];
3089 + DBG(printf("asked %d for layout outside of 0,%d array scope\n", nOffset, EPP_LAYOUT_SIZE ));
3091 + return pPHLayout[ 0 ];
3094 +// ---------------------------------------------------------------------------------------------
3096 +sal_uInt32 PPTWriterBase::GetMasterIndex( PageType ePageType )
3098 + sal_uInt32 nRetValue = 0;
3099 + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XMasterPageTarget >
3100 + aXMasterPageTarget( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
3102 + if ( aXMasterPageTarget.is() )
3104 + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >
3105 + aXDrawPage = aXMasterPageTarget->getMasterPage();
3106 + if ( aXDrawPage.is() )
3108 + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
3109 + aXPropertySet( aXDrawPage, ::com::sun::star::uno::UNO_QUERY );
3111 + if ( aXPropertySet.is() )
3113 + if ( ImplGetPropertyValue( aXPropertySet, String( RTL_CONSTASCII_USTRINGPARAM( "Number" ) ) ) )
3114 + nRetValue |= *(sal_Int16*)mAny.getValue();
3115 + if ( nRetValue & 0xffff ) // ueberlauf vermeiden
3116 + nRetValue--;
3120 + if ( ePageType == NOTICE )
3121 + nRetValue += mnMasterPages;
3122 + return nRetValue;
3125 +// -----------------------------------------------------------------------
3127 +sal_Bool PPTWriterBase::SetCurrentStyleSheet( sal_uInt32 nPageNum )
3129 + sal_Bool bRet = sal_False;
3130 + if ( nPageNum >= maStyleSheetList.size() )
3131 + nPageNum = 0;
3132 + else
3133 + bRet = sal_True;
3134 + mpStyleSheet = maStyleSheetList[ nPageNum ];
3135 + return bRet;
3138 +// ---------------------------------------------------------------------------------------------
3140 +sal_Bool PPTWriterBase::GetStyleSheets()
3142 + int nInstance, nLevel;
3143 + sal_Bool bRetValue = sal_False;
3144 + sal_uInt32 nPageNum;
3146 + for ( nPageNum = 0; nPageNum < mnMasterPages; nPageNum++ )
3148 + Reference< XNamed >
3149 + aXNamed;
3151 + Reference< XNameAccess >
3152 + aXNameAccess;
3154 + Reference< XStyleFamiliesSupplier >
3155 + aXStyleFamiliesSupplier( mXModel, UNO_QUERY );
3157 + Reference< XPropertySet >
3158 + aXPropSet( mXModel, UNO_QUERY );
3160 + sal_uInt16 nDefaultTab = ( aXPropSet.is() && ImplGetPropertyValue( aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TabStop" ) ) ) )
3161 + ? (sal_uInt16)( *(sal_Int32*)mAny.getValue() / 4.40972 )
3162 + : 1250;
3164 + maStyleSheetList.push_back( new PPTExStyleSheet( nDefaultTab, (PPTExBulletProvider&)*this ) );
3165 + SetCurrentStyleSheet( nPageNum );
3166 + if ( GetPageByIndex( nPageNum, MASTER ) )
3167 + aXNamed = Reference< XNamed >
3168 + ( mXDrawPage, UNO_QUERY );
3170 + if ( aXStyleFamiliesSupplier.is() )
3171 + aXNameAccess = aXStyleFamiliesSupplier->getStyleFamilies();
3173 + bRetValue = aXNamed.is() && aXNameAccess.is() && aXStyleFamiliesSupplier.is();
3174 + if ( bRetValue )
3176 + for ( nInstance = EPP_TEXTTYPE_Title; nInstance <= EPP_TEXTTYPE_CenterTitle; nInstance++ )
3178 + String aStyle;
3179 + String aFamily;
3180 + switch ( nInstance )
3182 + case EPP_TEXTTYPE_CenterTitle :
3183 + case EPP_TEXTTYPE_Title :
3185 + aStyle = String( RTL_CONSTASCII_USTRINGPARAM( "title" ) );
3186 + aFamily = aXNamed->getName();
3188 + break;
3189 + case EPP_TEXTTYPE_Body :
3191 + aStyle = String( RTL_CONSTASCII_USTRINGPARAM( "outline1" ) ); // SD_LT_SEPARATOR
3192 + aFamily = aXNamed->getName();
3194 + break;
3195 + case EPP_TEXTTYPE_Other :
3197 + aStyle = String( RTL_CONSTASCII_USTRINGPARAM( "standard" ) );
3198 + aFamily = String( RTL_CONSTASCII_USTRINGPARAM( "graphics" ) );
3200 + break;
3201 + case EPP_TEXTTYPE_CenterBody :
3203 + aStyle = String( RTL_CONSTASCII_USTRINGPARAM( "subtitle" ) );
3204 + aFamily = aXNamed->getName();
3206 + break;
3208 + if ( aStyle.Len() && aFamily.Len() )
3210 + try
3212 + Reference< XNameAccess >xNameAccess;
3213 + if ( aXNameAccess->hasByName( aFamily ) )
3215 + Any aAny( aXNameAccess->getByName( aFamily ) );
3216 + if( aAny.getValue() && ::cppu::extractInterface( xNameAccess, aAny ) )
3218 + Reference< XNameAccess > aXFamily;
3219 + if ( aAny >>= aXFamily )
3221 + if ( aXFamily->hasByName( aStyle ) )
3223 + Reference< XStyle > xStyle;
3224 + aAny = aXFamily->getByName( aStyle );
3225 + if( aAny.getValue() && ::cppu::extractInterface( xStyle, aAny ) )
3227 + Reference< XStyle > aXStyle;
3228 + aAny >>= aXStyle;
3229 + Reference< XPropertySet >
3230 + xPropSet( aXStyle, UNO_QUERY );
3231 + if( xPropSet.is() )
3232 + mpStyleSheet->SetStyleSheet( xPropSet, maFontCollection, nInstance, 0 );
3233 + for ( nLevel = 1; nLevel < 5; nLevel++ )
3235 + if ( nInstance == EPP_TEXTTYPE_Body )
3237 + sal_Unicode cTemp = aStyle.GetChar( aStyle.Len() - 1 );
3238 + aStyle.SetChar( aStyle.Len() - 1, ++cTemp );
3239 + if ( aXFamily->hasByName( aStyle ) )
3241 + aXFamily->getByName( aStyle ) >>= xStyle;
3242 + if( xStyle.is() )
3244 + Reference< XPropertySet >
3245 + xPropertySet( xStyle, UNO_QUERY );
3246 + if ( xPropertySet.is() )
3247 + mpStyleSheet->SetStyleSheet( xPropertySet, maFontCollection, nInstance, nLevel );
3251 + else
3252 + mpStyleSheet->SetStyleSheet( xPropSet, maFontCollection, nInstance, nLevel );
3260 + catch( Exception& )
3262 + //
3266 + for ( ; nInstance <= EPP_TEXTTYPE_QuarterBody; nInstance++ )
3272 + return bRetValue;
3275 +// -----------------------------------------------------------------------
3277 +sal_Bool PPTWriterBase::CreateMainNotes()
3279 + if ( !GetPageByIndex( 0, NOTICE ) )
3280 + return FALSE;
3281 + SetCurrentStyleSheet( 0 );
3283 + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XMasterPageTarget >
3284 + aXMasterPageTarget( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
3286 + if ( !aXMasterPageTarget.is() )
3287 + return FALSE;
3289 + mXDrawPage = aXMasterPageTarget->getMasterPage();
3290 + if ( !mXDrawPage.is() )
3291 + return FALSE;
3293 + mXPropSet = ::com::sun::star::uno::Reference<
3294 + ::com::sun::star::beans::XPropertySet >
3295 + ( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
3296 + if ( !mXPropSet.is() )
3297 + return FALSE;
3299 + mXShapes = ::com::sun::star::uno::Reference<
3300 + ::com::sun::star::drawing::XShapes >
3301 + ( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
3302 + if ( !mXShapes.is() )
3303 + return FALSE;
3305 + return ImplCreateMainNotes();
3308 +// -----------------------------------------------------------------------
3310 +awt::Size PPTWriterBase::MapSize( const awt::Size& rSize )
3312 + Size aRetSize( OutputDevice::LogicToLogic( Size( rSize.Width, rSize.Height ), maMapModeSrc, maMapModeDest ) );
3314 + if ( !aRetSize.Width() )
3315 + aRetSize.Width()++;
3316 + if ( !aRetSize.Height() )
3317 + aRetSize.Height()++;
3318 + return awt::Size( aRetSize.Width(), aRetSize.Height() );
3321 +// -----------------------------------------------------------------------
3323 +awt::Point PPTWriterBase::MapPoint( const awt::Point& rPoint )
3325 + Point aRet( OutputDevice::LogicToLogic( Point( rPoint.X, rPoint.Y ), maMapModeSrc, maMapModeDest ) );
3326 + return awt::Point( aRet.X(), aRet.Y() );
3329 +// -----------------------------------------------------------------------
3331 +Rectangle PPTWriterBase::MapRectangle( const awt::Rectangle& rRect )
3333 + ::com::sun::star::awt::Point aPoint( rRect.X, rRect.Y );
3334 + ::com::sun::star::awt::Size aSize( rRect.Width, rRect.Height );
3335 + ::com::sun::star::awt::Point aP( MapPoint( aPoint ) );
3336 + ::com::sun::star::awt::Size aS( MapSize( aSize ) );
3337 + return Rectangle( Point( aP.X, aP.Y ), Size( aS.Width, aS.Height ) );
3341 +// -----------------------------------------------------------------------
3343 +sal_Bool PPTWriterBase::GetShapeByIndex( sal_uInt32 nIndex, sal_Bool bGroup )
3345 + while(TRUE)
3347 + if ( ( bGroup == FALSE ) || ( GetCurrentGroupLevel() == 0 ) )
3349 + Any aAny( mXShapes->getByIndex( nIndex ) );
3350 + aAny >>= mXShape;
3352 + else
3354 + Any aAny( GetCurrentGroupAccess()->getByIndex( GetCurrentGroupIndex() ) );
3355 + aAny >>= mXShape;
3357 + if ( !mXShape.is() )
3358 + break;
3360 + Any aAny( mXShape->queryInterface( ::getCppuType( (const Reference< XPropertySet >*) 0 ) ));
3361 + aAny >>= mXPropSet;
3363 + if ( !mXPropSet.is() )
3364 + break;
3365 + maPosition = MapPoint( mXShape->getPosition() );
3366 + maSize = MapSize( mXShape->getSize() );
3367 + maRect = Rectangle( Point( maPosition.X, maPosition.Y ), Size( maSize.Width, maSize.Height ) );
3368 + mType = ByteString( String( mXShape->getShapeType() ), RTL_TEXTENCODING_UTF8 );
3369 + mType.Erase( 0, 13 ); // "com.sun.star." entfernen
3370 + sal_uInt16 nPos = mType.Search( (const char*)"Shape" );
3371 + mType.Erase( nPos, 5 );
3373 + mbPresObj = mbEmptyPresObj = FALSE;
3374 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsPresentationObject" ) ) ) )
3375 + mAny >>= mbPresObj;
3377 + if ( mbPresObj && ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsEmptyPresentationObject" ) ) ) )
3378 + mAny >>= mbEmptyPresObj;
3380 + mnAngle = ( PropValue::GetPropertyValue( aAny,
3381 + mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "RotateAngle" ) ), sal_True ) )
3382 + ? *((sal_Int32*)aAny.getValue() )
3383 + : 0;
3385 + return TRUE;
3387 + return FALSE;
3390 +// -----------------------------------------------------------------------
3392 +sal_Int8 PPTWriterBase::GetTransition( sal_Int16 nTransitionType, sal_Int16 nTransitionSubtype, FadeEffect eEffect, sal_uInt8& nDirection )
3394 + sal_Int8 nPPTTransitionType = 0;
3395 + nDirection = 0;
3397 + switch( nTransitionType )
3399 + case TransitionType::FADE :
3401 + if ( nTransitionSubtype == TransitionSubType::CROSSFADE )
3402 + nPPTTransitionType = PPT_TRANSITION_TYPE_SMOOTHFADE;
3403 + else if ( nTransitionSubtype == TransitionSubType::FADEOVERCOLOR )
3404 + nPPTTransitionType = PPT_TRANSITION_TYPE_FADE;
3406 + break;
3407 + case PPT_TRANSITION_TYPE_COMB :
3409 + nPPTTransitionType = PPT_TRANSITION_TYPE_COMB;
3410 + if ( nTransitionSubtype == TransitionSubType::COMBVERTICAL )
3411 + nDirection++;
3413 + break;
3414 + case TransitionType::PUSHWIPE :
3416 + nPPTTransitionType = PPT_TRANSITION_TYPE_PUSH;
3417 + switch( nTransitionSubtype )
3419 + case TransitionSubType::FROMRIGHT: nDirection = 0; break;
3420 + case TransitionSubType::FROMBOTTOM: nDirection = 1; break;
3421 + case TransitionSubType::FROMLEFT: nDirection = 2; break;
3422 + case TransitionSubType::FROMTOP: nDirection = 3; break;
3425 + break;
3426 + case TransitionType::PINWHEELWIPE :
3428 + nPPTTransitionType = PPT_TRANSITION_TYPE_WHEEL;
3429 + switch( nTransitionSubtype )
3431 + case TransitionSubType::ONEBLADE: nDirection = 1; break;
3432 + case TransitionSubType::TWOBLADEVERTICAL : nDirection = 2; break;
3433 + case TransitionSubType::THREEBLADE : nDirection = 3; break;
3434 + case TransitionSubType::FOURBLADE: nDirection = 4; break;
3435 + case TransitionSubType::EIGHTBLADE: nDirection = 8; break;
3438 + break;
3439 + case TransitionType::FANWIPE :
3441 + nPPTTransitionType = PPT_TRANSITION_TYPE_WEDGE;
3443 + break;
3444 + case TransitionType::ELLIPSEWIPE :
3446 + nPPTTransitionType = PPT_TRANSITION_TYPE_CIRCLE;
3448 + break;
3449 + case TransitionType::FOURBOXWIPE :
3451 + nPPTTransitionType = PPT_TRANSITION_TYPE_PLUS;
3453 + break;
3454 + case TransitionType::IRISWIPE :
3456 + switch( nTransitionSubtype ) {
3457 + case TransitionSubType::RECTANGLE:
3458 + nPPTTransitionType = PPT_TRANSITION_TYPE_ZOOM;
3459 + nDirection = (eEffect == FadeEffect_FADE_FROM_CENTER) ? 0 : 1;
3460 + break;
3461 + default:
3462 + nPPTTransitionType = PPT_TRANSITION_TYPE_DIAMOND;
3463 + break;
3466 + break;
3469 + return nPPTTransitionType;
3472 +sal_Int8 PPTWriterBase::GetTransition( FadeEffect eEffect, sal_uInt8& nDirection )
3474 + sal_Int8 nPPTTransitionType = 0;
3476 + switch ( eEffect )
3478 + default :
3479 + case FadeEffect_RANDOM :
3480 + nPPTTransitionType = PPT_TRANSITION_TYPE_RANDOM;
3481 + break;
3483 + case FadeEffect_HORIZONTAL_STRIPES :
3484 + nDirection++;
3485 + case FadeEffect_VERTICAL_STRIPES :
3486 + nPPTTransitionType = PPT_TRANSITION_TYPE_BLINDS;
3487 + break;
3489 + case FadeEffect_VERTICAL_CHECKERBOARD :
3490 + nDirection++;
3491 + case FadeEffect_HORIZONTAL_CHECKERBOARD :
3492 + nPPTTransitionType = PPT_TRANSITION_TYPE_CHECKER;
3493 + break;
3495 + case FadeEffect_MOVE_FROM_UPPERLEFT :
3496 + nDirection++;
3497 + case FadeEffect_MOVE_FROM_UPPERRIGHT :
3498 + nDirection++;
3499 + case FadeEffect_MOVE_FROM_LOWERLEFT :
3500 + nDirection++;
3501 + case FadeEffect_MOVE_FROM_LOWERRIGHT :
3502 + nDirection++;
3503 + case FadeEffect_MOVE_FROM_TOP :
3504 + nDirection++;
3505 + case FadeEffect_MOVE_FROM_LEFT :
3506 + nDirection++;
3507 + case FadeEffect_MOVE_FROM_BOTTOM :
3508 + nDirection++;
3509 + case FadeEffect_MOVE_FROM_RIGHT :
3510 + nPPTTransitionType = PPT_TRANSITION_TYPE_COVER;
3511 + break;
3513 + case FadeEffect_DISSOLVE :
3514 + nPPTTransitionType = PPT_TRANSITION_TYPE_DISSOLVE;
3515 + break;
3517 + case FadeEffect_VERTICAL_LINES :
3518 + nDirection++;
3519 + case FadeEffect_HORIZONTAL_LINES :
3520 + nPPTTransitionType = PPT_TRANSITION_TYPE_RANDOM_BARS;
3521 + break;
3523 + case FadeEffect_CLOSE_HORIZONTAL :
3524 + nDirection++;
3525 + case FadeEffect_OPEN_HORIZONTAL :
3526 + nDirection++;
3527 + case FadeEffect_CLOSE_VERTICAL :
3528 + nDirection++;
3529 + case FadeEffect_OPEN_VERTICAL :
3530 + nPPTTransitionType = PPT_TRANSITION_TYPE_SPLIT;
3531 + break;
3533 + case FadeEffect_FADE_FROM_UPPERLEFT :
3534 + nDirection++;
3535 + case FadeEffect_FADE_FROM_UPPERRIGHT :
3536 + nDirection++;
3537 + case FadeEffect_FADE_FROM_LOWERLEFT :
3538 + nDirection++;
3539 + case FadeEffect_FADE_FROM_LOWERRIGHT :
3540 + nDirection += 4;
3541 + nPPTTransitionType = PPT_TRANSITION_TYPE_STRIPS;
3542 + break;
3544 + case FadeEffect_UNCOVER_TO_LOWERRIGHT :
3545 + nDirection++;
3546 + case FadeEffect_UNCOVER_TO_LOWERLEFT :
3547 + nDirection++;
3548 + case FadeEffect_UNCOVER_TO_UPPERRIGHT :
3549 + nDirection++;
3550 + case FadeEffect_UNCOVER_TO_UPPERLEFT :
3551 + nDirection++;
3552 + case FadeEffect_UNCOVER_TO_BOTTOM :
3553 + nDirection++;
3554 + case FadeEffect_UNCOVER_TO_RIGHT :
3555 + nDirection++;
3556 + case FadeEffect_UNCOVER_TO_TOP :
3557 + nDirection++;
3558 + case FadeEffect_UNCOVER_TO_LEFT :
3559 + nPPTTransitionType = PPT_TRANSITION_TYPE_PULL;
3560 + break;
3562 + case FadeEffect_FADE_FROM_TOP :
3563 + nDirection++;
3564 + case FadeEffect_FADE_FROM_LEFT :
3565 + nDirection++;
3566 + case FadeEffect_FADE_FROM_BOTTOM :
3567 + nDirection++;
3568 + case FadeEffect_FADE_FROM_RIGHT :
3569 + nPPTTransitionType = PPT_TRANSITION_TYPE_WIPE;
3570 + break;
3572 + case FadeEffect_ROLL_FROM_TOP :
3573 + nDirection++;
3574 + case FadeEffect_ROLL_FROM_LEFT :
3575 + nDirection++;
3576 + case FadeEffect_ROLL_FROM_BOTTOM :
3577 + nDirection++;
3578 + case FadeEffect_ROLL_FROM_RIGHT :
3579 + nPPTTransitionType = PPT_TRANSITION_TYPE_WIPE;
3580 + break;
3582 + case FadeEffect_FADE_TO_CENTER :
3583 + nDirection++;
3584 + case FadeEffect_FADE_FROM_CENTER :
3585 + nPPTTransitionType = PPT_TRANSITION_TYPE_ZOOM;
3586 + break;
3588 + case FadeEffect_NONE :
3589 + nDirection = 2;
3590 + break;
3593 + return nPPTTransitionType;
3596 +// -----------------------------------------------------------------------
3598 +sal_Bool PPTWriterBase::ContainsOtherShapeThanPlaceholders( sal_Bool bForOOMLX )
3600 + sal_uInt32 nShapes = mXShapes->getCount();
3601 + sal_Bool bOtherThanPlaceHolders = FALSE;
3603 + if ( nShapes )
3604 + for ( sal_uInt32 nIndex = 0; ( nIndex < nShapes ) && ( bOtherThanPlaceHolders == FALSE ); nIndex++ ) {
3605 + if ( GetShapeByIndex( nIndex ) && mType != "drawing.Page" ) {
3606 + if( bForOOMLX &&
3607 + ( mType == "presentation.Page" ||
3608 + mType == "presentation.Notes" ) ) {
3609 + Reference< XSimpleText > rXText( mXShape, UNO_QUERY );
3611 + if( rXText.is() && rXText->getString().getLength() != 0 )
3612 + bOtherThanPlaceHolders = TRUE;
3613 + } else
3614 + bOtherThanPlaceHolders = TRUE;
3616 + DBG(printf("mType == %s\n", mType.GetBuffer()));
3619 + return bOtherThanPlaceHolders;
3621 diff --git sd/source/filter/eppt/epptbase.hxx sd/source/filter/eppt/epptbase.hxx
3622 new file mode 100644
3623 index 0000000..ba5eca6
3624 --- /dev/null
3625 +++ sd/source/filter/pptx/epptbase.hxx
3626 @@ -0,0 +1,411 @@
3627 +#ifndef EPP_EPPTBASE_HXX
3628 +#define EPP_EPPTBASE_HXX
3630 +#include "grouptable.hxx"
3631 +#include <vector>
3632 +#include <vcl/mapmod.hxx>
3633 +#include <tools/list.hxx>
3634 +#include <tools/string.hxx>
3635 +#include <tools/stream.hxx>
3636 +#include <tools/gen.hxx>
3637 +#include <com/sun/star/beans/XPropertySet.hpp>
3638 +#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
3639 +#include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
3640 +#include <com/sun/star/drawing/XMasterPageTarget.hpp>
3641 +#include <com/sun/star/frame/XModel.hpp>
3642 +#include <com/sun/star/presentation/XPresentationSupplier.hpp>
3643 +#include <com/sun/star/presentation/FadeEffect.hpp>
3644 +#include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
3646 +// PLACEMENT_ID
3647 +#define EPP_LAYOUT_TITLESLIDE 0 /* The slide is a title slide */
3648 +#define EPP_LAYOUT_TITLEANDBODYSLIDE 1 /* Title and body slide */
3649 +#define EPP_LAYOUT_TITLEMASTERSLIDE 2 /* Title master slide */
3650 +#define EPP_LAYOUT_MASTERSLIDE 3 /* Master slide layout */
3651 +#define EPP_LAYOUT_MASTERNOTES 4 /* Master notes layout */
3652 +#define EPP_LAYOUT_NOTESTITLEBODY 5 /* Notes title/body layout */
3653 +#define EPP_LAYOUT_HANDOUTLAYOUT 6 /* Handout layout, therefore it doesn't have placeholders except header, footer, and date */
3654 +#define EPP_LAYOUT_ONLYTITLE 7 /* Only title placeholder */
3655 +#define EPP_LAYOUT_2COLUMNSANDTITLE 8 /* Body of the slide has 2 columns and a title */
3656 +#define EPP_LAYOUT_2ROWSANDTITLE 9 /* Slide's body has 2 rows and a title */
3657 +#define EPP_LAYOUT_RIGHTCOLUMN2ROWS 10 /* Body contains 2 columns, right column has 2 rows */
3658 +#define EPP_LAYOUT_LEFTCOLUMN2ROWS 11 /* Body contains 2 columns, left column has 2 rows */
3659 +#define EPP_LAYOUT_BOTTOMROW2COLUMNS 12 /* Body contains 2 rows, bottom row has 2 columns */
3660 +#define EPP_LAYOUT_TOPROW2COLUMN 13 /* Body contains 2 rows, top row has 2 columns */
3661 +#define EPP_LAYOUT_4OBJECTS 14 /* 4 objects */
3662 +#define EPP_LAYOUT_BIGOBJECT 15 /* Big object */
3663 +#define EPP_LAYOUT_BLANCSLIDE 16 /* Blank slide */
3664 +#define EPP_LAYOUT_TITLERIGHTBODYLEFT 17 /* Vertical title on the right, body on the left */
3665 +#define EPP_LAYOUT_TITLERIGHT2BODIESLEFT 18 /* Vertical title on the right, body on the left split into 2 rows */
3667 +#define EPP_LAYOUT_SIZE 25
3669 +class PptEscherEx;
3671 +struct PHLayout
3673 + sal_Int32 nLayout;
3674 + sal_uInt8 nPlaceHolder[ 8 ];
3676 + sal_uInt8 nUsedObjectPlaceHolder;
3677 + sal_uInt8 nTypeOfTitle;
3678 + sal_uInt8 nTypeOfOutliner;
3680 + BOOL bTitlePossible;
3681 + BOOL bOutlinerPossible;
3682 + BOOL bSecOutlinerPossible;
3685 +enum PageType { NORMAL = 0, MASTER = 1, NOTICE = 2, UNDEFINED = 3 };
3687 +class PropValue
3689 + protected :
3691 + ::com::sun::star::uno::Any mAny;
3693 + ::com::sun::star::uno::Reference
3694 + < ::com::sun::star::beans::XPropertySet > mXPropSet;
3696 + sal_Bool ImplGetPropertyValue( const String& rString );
3697 + sal_Bool ImplGetPropertyValue( const ::com::sun::star::uno::Reference
3698 + < ::com::sun::star::beans::XPropertySet > &, const String& );
3700 + public :
3702 + PropValue() {}
3704 + PropValue( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet )
3705 + : mXPropSet( rXPropSet )
3706 + {}
3708 + ::com::sun::star::uno::Any GetAny() { return mAny; }
3710 + static sal_Bool GetPropertyValue(
3711 + ::com::sun::star::uno::Any& rAny,
3712 + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
3713 + const String& rPropertyName,
3714 + sal_Bool bTestPropertyAvailability = sal_False );
3716 + static ::com::sun::star::beans::PropertyState GetPropertyState(
3717 + const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > &,
3718 + const String& rPropertyName );
3721 +class EscherGraphicProvider;
3722 +class PPTExBulletProvider
3724 + friend struct PPTExParaSheet;
3726 + protected :
3728 + SvMemoryStream aBuExPictureStream;
3729 + SvMemoryStream aBuExOutlineStream;
3730 + SvMemoryStream aBuExMasterStream;
3732 + EscherGraphicProvider* pGraphicProv;
3734 + public :
3736 + sal_uInt16 GetId( const ByteString& rUniqueId, Size& rGraphicSize );
3738 + PPTExBulletProvider();
3739 + ~PPTExBulletProvider();
3742 +struct FontCollectionEntry
3744 + String Name;
3745 + double Scaling;
3746 + sal_Int16 Family;
3747 + sal_Int16 Pitch;
3748 + sal_Int16 CharSet;
3750 + String Original;
3751 + sal_Bool bIsConverted;
3753 + FontCollectionEntry( const String& rName, sal_Int16 nFamily, sal_Int16 nPitch, sal_Int16 nCharSet ) :
3754 + Scaling ( 1.0 ),
3755 + Family ( nFamily ),
3756 + Pitch ( nPitch ),
3757 + CharSet ( nCharSet ),
3758 + Original( rName )
3760 + ImplInit( rName );
3761 + };
3763 + FontCollectionEntry( const String& rName ) :
3764 + Scaling ( 1.0 ),
3765 + Original( rName )
3767 + ImplInit( rName );
3768 + };
3769 + ~FontCollectionEntry();
3771 + private :
3773 + FontCollectionEntry() {};
3775 + void ImplInit( const String& rName );
3778 +class VirtualDevice;
3779 +class FontCollection : private List
3781 + VirtualDevice* pVDev;
3782 + public :
3783 + FontCollection();
3784 + ~FontCollection();
3786 + short GetScriptDirection( const String& rText ) const;
3787 + sal_uInt32 GetId( FontCollectionEntry& rFontDescriptor );
3788 + sal_uInt32 GetCount() const { return List::Count(); };
3789 + const FontCollectionEntry* GetById( sal_uInt32 nId );
3790 + FontCollectionEntry& GetLast() { return *(FontCollectionEntry*)List::Last(); };
3793 +// ------------------------------------------------------------------------
3795 +#define PPTEX_STYLESHEETENTRYS 9
3797 +enum PPTExTextAttr
3799 + ParaAttr_BulletOn,
3800 + ParaAttr_BuHardFont,
3801 + ParaAttr_BuHardColor,
3802 + ParaAttr_BuHardHeight,
3803 + ParaAttr_BulletChar,
3804 + ParaAttr_BulletFont,
3805 + ParaAttr_BulletHeight,
3806 + ParaAttr_BulletColor,
3807 + ParaAttr_Adjust,
3808 + ParaAttr_LineFeed,
3809 + ParaAttr_UpperDist,
3810 + ParaAttr_LowerDist,
3811 + ParaAttr_TextOfs,
3812 + ParaAttr_BulletOfs,
3813 + ParaAttr_DefaultTab,
3814 + ParaAttr_AsianLB_1,
3815 + ParaAttr_AsianLB_2,
3816 + ParaAttr_AsianLB_3,
3817 + ParaAttr_BiDi,
3818 + CharAttr_Bold,
3819 + CharAttr_Italic,
3820 + CharAttr_Underline,
3821 + CharAttr_Shadow,
3822 + CharAttr_Strikeout,
3823 + CharAttr_Embossed,
3824 + CharAttr_Font,
3825 + CharAttr_AsianOrComplexFont,
3826 + CharAttr_Symbol,
3827 + CharAttr_FontHeight,
3828 + CharAttr_FontColor,
3829 + CharAttr_Escapement
3832 +struct PPTExCharLevel
3834 + sal_uInt16 mnFlags;
3835 + sal_uInt16 mnFont;
3836 + sal_uInt16 mnAsianOrComplexFont;
3837 + sal_uInt16 mnFontHeight;
3838 + sal_uInt16 mnEscapement;
3839 + sal_uInt32 mnFontColor;
3842 +struct PPTExCharSheet
3844 + PPTExCharLevel maCharLevel[ 5 ];
3846 + PPTExCharSheet( int nInstance );
3848 + void SetStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
3849 + FontCollection& rFontCollection, int nLevel );
3850 + void Write( SvStream& rSt, PptEscherEx* pEx, sal_uInt16 nLev, sal_Bool bFirst, sal_Bool bSimpleText,
3851 + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPagePropSet );
3855 +struct PPTExParaLevel
3857 + sal_Bool mbIsBullet;
3858 + sal_uInt16 mnBulletChar;
3859 + sal_uInt16 mnBulletFont;
3860 + sal_uInt16 mnBulletHeight;
3861 + sal_uInt32 mnBulletColor;
3863 + sal_uInt16 mnAdjust;
3864 + sal_Int16 mnOOAdjust;
3865 + sal_uInt16 mnLineFeed;
3866 + sal_uInt16 mnUpperDist;
3867 + sal_uInt16 mnLowerDist;
3868 + sal_uInt16 mnTextOfs;
3869 + sal_uInt16 mnBulletOfs;
3870 + sal_uInt16 mnDefaultTab;
3872 + sal_Bool mbExtendedBulletsUsed;
3873 + sal_uInt16 mnBulletId;
3874 + sal_uInt16 mnBulletStart;
3875 + sal_uInt32 mnMappedNumType;
3876 + sal_uInt32 mnNumberingType;
3877 + sal_uInt16 mnAsianSettings;
3878 + sal_uInt16 mnBiDi;
3881 +struct PPTExParaSheet
3883 + PPTExBulletProvider& rBuProv;
3885 + sal_uInt32 mnInstance;
3887 + PPTExParaLevel maParaLevel[ 5 ];
3888 + PPTExParaSheet( int nInstance, sal_uInt16 nDefaultTab, PPTExBulletProvider& rProv );
3890 + void SetStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
3891 + FontCollection& rFontCollection, int nLevel, const PPTExCharLevel& rCharLevel );
3892 + void Write( SvStream& rSt, PptEscherEx* pEx, sal_uInt16 nLev, sal_Bool bFirst, sal_Bool bSimpleText,
3893 + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPagePropSet );
3896 +class PPTExStyleSheet
3899 + public :
3901 + PPTExCharSheet* mpCharSheet[ PPTEX_STYLESHEETENTRYS ];
3902 + PPTExParaSheet* mpParaSheet[ PPTEX_STYLESHEETENTRYS ];
3904 + PPTExStyleSheet( sal_uInt16 nDefaultTab, PPTExBulletProvider& rBuProv );
3905 + ~PPTExStyleSheet();
3907 + PPTExParaSheet& GetParaSheet( int nInstance ) { return *mpParaSheet[ nInstance ]; };
3908 + PPTExCharSheet& GetCharSheet( int nInstance ) { return *mpCharSheet[ nInstance ]; };
3910 + void SetStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
3911 + FontCollection& rFontCollection, int nInstance, int nLevel );
3912 + sal_Bool IsHardAttribute( sal_uInt32 nInstance, sal_uInt32 nLevel, PPTExTextAttr eAttr, sal_uInt32 nValue );
3914 + sal_uInt32 SizeOfTxCFStyleAtom() const;
3915 + void WriteTxCFStyleAtom( SvStream& rSt );
3918 +// ------------------------------------------------------------------------
3920 +class PPTWriterBase : public PropValue, public GroupTable
3922 +protected:
3923 + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mXModel;
3924 + ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > mXStatusIndicator;
3926 + sal_Bool mbStatusIndicator;
3928 + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPagesSupplier > mXDrawPagesSupplier;
3929 + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XMasterPagesSupplier > mXMasterPagesSupplier;
3930 + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPages > mXDrawPages;
3931 + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > mXDrawPage;
3932 + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mXPagePropSet;
3933 + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mXBackgroundPropSet;
3934 + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mXShapes;
3935 + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXShape;
3936 + ::com::sun::star::awt::Size maSize;
3937 + ::com::sun::star::awt::Point maPosition;
3938 + Rectangle maRect;
3939 + ByteString mType;
3940 + sal_Bool mbPresObj;
3941 + sal_Bool mbEmptyPresObj;
3942 + sal_Int32 mnAngle;
3944 + sal_uInt32 mnPages; // number of Slides ( w/o master pages & notes & handout )
3945 + sal_uInt32 mnMasterPages;
3947 + Fraction maFraction;
3948 + MapMode maMapModeSrc;
3949 + MapMode maMapModeDest;
3950 + ::com::sun::star::awt::Size maDestPageSize;
3951 + ::com::sun::star::awt::Size maNotesPageSize;
3953 + PageType meLatestPageType;
3954 + std::vector< PPTExStyleSheet* > maStyleSheetList;
3955 + PPTExStyleSheet* mpStyleSheet;
3957 + FontCollection maFontCollection;
3959 + List maTextRuleList; // TextRuleEntry's
3961 + virtual void ImplWriteSlide( sal_uInt32 /* nPageNum */, sal_uInt32 /* nMasterNum */, sal_uInt16 /* nMode */,
3962 + sal_Bool /* bHasBackground */, ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > /* aXBackgroundPropSet */ ) {}
3963 + virtual void ImplWriteNotes( sal_uInt32 nPageNum ) = 0;
3964 + virtual void ImplWriteSlideMaster( sal_uInt32 /* nPageNum */, ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > /* aXBackgroundPropSet */ ) {}
3965 + virtual void ImplWriteLayout( sal_Int32 /* nOffset */, sal_uInt32 /* nMasterNum */ ) {}
3967 + virtual void exportPPTPre() {}
3968 + virtual void exportPPTPost() {}
3970 + virtual sal_Bool ImplCreateDocument()=0;
3971 + virtual sal_Bool ImplCreateMainNotes()=0;
3973 + sal_Bool GetStyleSheets();
3974 + sal_Bool GetShapeByIndex( sal_uInt32 nIndex, sal_Bool bGroup = FALSE );
3976 + sal_Bool CreateMainNotes();
3978 + ::com::sun::star::awt::Size MapSize( const ::com::sun::star::awt::Size& );
3979 + ::com::sun::star::awt::Point MapPoint( const ::com::sun::star::awt::Point& );
3980 + Rectangle MapRectangle( const ::com::sun::star::awt::Rectangle& );
3982 + sal_Bool ContainsOtherShapeThanPlaceholders( sal_Bool bForOOMLX );
3984 +public:
3985 + PPTWriterBase();
3986 + PPTWriterBase( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & rModel,
3987 + const ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > & rStatInd );
3989 + ~PPTWriterBase();
3991 + void exportPPT();
3993 + sal_Bool InitSOIface();
3994 + sal_Bool GetPageByIndex( sal_uInt32 nIndex, PageType );
3995 + sal_uInt32 GetMasterIndex( PageType ePageType );
3996 + sal_Bool SetCurrentStyleSheet( sal_uInt32 nPageNum );
3998 + sal_Bool GetPresObj() { return mbPresObj; }
4000 + PHLayout& GetLayout( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rXPropSet ) const;
4001 + PHLayout& GetLayout( sal_Int32 nOffset ) const;
4002 + sal_Int32 GetLayoutOffset( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rXPropSet ) const;
4004 + sal_Bool CreateSlide( sal_uInt32 nPageNum );
4005 + sal_Bool CreateSlideMaster( sal_uInt32 nPageNum );
4006 + sal_Bool CreateNotes( sal_uInt32 nPageNum );
4008 + static sal_Int8 GetTransition( sal_Int16 nTransitionType, sal_Int16 nTransitionSubtype, ::com::sun::star::presentation::FadeEffect eEffect, sal_uInt8& nDirection );
4009 + static sal_Int8 GetTransition( ::com::sun::star::presentation::FadeEffect eEffect, sal_uInt8& nDirection );
4012 +#define PPT_TRANSITION_TYPE_NONE 0
4013 +#define PPT_TRANSITION_TYPE_RANDOM 1
4014 +#define PPT_TRANSITION_TYPE_BLINDS 2
4015 +#define PPT_TRANSITION_TYPE_CHECKER 3
4016 +#define PPT_TRANSITION_TYPE_COVER 4
4017 +#define PPT_TRANSITION_TYPE_DISSOLVE 5
4018 +#define PPT_TRANSITION_TYPE_FADE 6
4019 +#define PPT_TRANSITION_TYPE_PULL 7
4020 +#define PPT_TRANSITION_TYPE_RANDOM_BARS 8
4021 +#define PPT_TRANSITION_TYPE_STRIPS 9
4022 +#define PPT_TRANSITION_TYPE_WIPE 10
4023 +#define PPT_TRANSITION_TYPE_ZOOM 11
4024 +#define PPT_TRANSITION_TYPE_SPLIT 13
4026 +// effects, new in xp
4027 +#define PPT_TRANSITION_TYPE_DIAMOND 17
4028 +#define PPT_TRANSITION_TYPE_PLUS 18
4029 +#define PPT_TRANSITION_TYPE_WEDGE 19
4030 +#define PPT_TRANSITION_TYPE_PUSH 20
4031 +#define PPT_TRANSITION_TYPE_COMB 21
4032 +#define PPT_TRANSITION_TYPE_NEWSFLASH 22
4033 +#define PPT_TRANSITION_TYPE_SMOOTHFADE 23
4034 +#define PPT_TRANSITION_TYPE_WHEEL 26
4035 +#define PPT_TRANSITION_TYPE_CIRCLE 27
4037 +#endif
4038 diff --git sd/source/filter/eppt/epptooxml.cxx sd/source/filter/eppt/epptooxml.cxx
4039 new file mode 100644
4040 index 0000000..f8e0790
4041 --- /dev/null
4042 +++ sd/source/filter/pptx/pptx-epptooxml.cxx
4043 @@ -0,0 +1,1449 @@
4044 +#include <hash_map>
4045 +#include <stdio.h>
4046 +#include <oox/drawingml/chart/chartconverter.hxx>
4047 +#include <oox/core/tokens.hxx>
4048 +#include <epptooxml.hxx>
4049 +#include <epptdef.hxx>
4050 +#include <oox/export/shapes.hxx>
4052 +#include <cppuhelper/factory.hxx>
4053 +#include <sax/fshelper.hxx>
4054 +#include <rtl/ustrbuf.hxx>
4055 +#include <svx/escherex.hxx>
4056 +#include <tools/poly.hxx>
4058 +#include <com/sun/star/drawing/FillStyle.hpp>
4059 +#include <com/sun/star/drawing/RectanglePoint.hpp>
4060 +#include <com/sun/star/beans/Property.hpp>
4061 +#include <com/sun/star/beans/XPropertySetInfo.hpp>
4062 +#include <com/sun/star/text/XSimpleText.hpp>
4063 +#include <com/sun/star/presentation/AnimationSpeed.hpp>
4065 +#include <oox/export/utils.hxx>
4067 +// presentation namespaces
4068 +#define PNMSS FSNS( XML_xmlns, XML_a ), "http://schemas.openxmlformats.org/drawingml/2006/main", \
4069 + FSNS( XML_xmlns, XML_p ), "http://schemas.openxmlformats.org/presentationml/2006/main", \
4070 + FSNS( XML_xmlns, XML_r ), "http://schemas.openxmlformats.org/officeDocument/2006/relationships"
4072 +using ::rtl::OString;
4073 +using ::rtl::OUString;
4074 +using ::rtl::OUStringBuffer;
4075 +using namespace ::com::sun::star;
4076 +using namespace ::com::sun::star::uno;
4077 +using namespace ::com::sun::star::drawing;
4078 +using namespace ::com::sun::star::presentation;
4079 +using ::com::sun::star::beans::XPropertySet;
4080 +using ::com::sun::star::beans::XPropertySetInfo;
4081 +using ::com::sun::star::lang::XMultiServiceFactory;
4082 +using ::com::sun::star::container::XIndexAccess;
4083 +using ::com::sun::star::frame::XModel;
4084 +using ::com::sun::star::io::XOutputStream;
4085 +using ::com::sun::star::task::XStatusIndicator;
4086 +using ::com::sun::star::text::XSimpleText;
4087 +using ::sax_fastparser::FastSerializerHelper;
4088 +using ::sax_fastparser::FSHelperPtr;
4090 +void dump_pset(Reference< XPropertySet > rXPropSet);
4092 +#define IDS(x) (OString(#x " ") + OString::valueOf( mnShapeIdMax++ )).getStr()
4094 +namespace oox {
4095 + using namespace drawingml;
4096 + namespace core {
4098 +class PowerPointShapeExport : public ShapeExport
4100 + PowerPointExport& mrExport;
4101 + PageType mePageType;
4102 + sal_Bool mbMaster;
4103 +public:
4104 + PowerPointShapeExport( FSHelperPtr pFS, PowerPointExport* pFB );
4105 + void SetMaster( sal_Bool bMaster );
4106 + void SetPageType( PageType ePageType );
4107 + ShapeExport& WriteNonVisualProperties( Reference< XShape > xShape );
4108 + ShapeExport& WriteTextShape( Reference< XShape > xShape );
4109 + ShapeExport& WriteUnknownShape( Reference< XShape > xShape );
4112 +PowerPointShapeExport::PowerPointShapeExport( FSHelperPtr pFS, PowerPointExport* pFB )
4113 + : ShapeExport( XML_p, pFS, pFB )
4114 + , mrExport( *pFB )
4118 +void PowerPointShapeExport::SetMaster( sal_Bool bMaster )
4120 + mbMaster = bMaster;
4123 +void PowerPointShapeExport::SetPageType( PageType ePageType )
4125 + mePageType = ePageType;
4128 +ShapeExport& PowerPointShapeExport::WriteNonVisualProperties( Reference< XShape > )
4130 + GetFS()->singleElementNS( XML_p, XML_nvPr, FSEND );
4132 + return *this;
4135 +ShapeExport& PowerPointShapeExport::WriteTextShape( Reference< XShape > xShape )
4137 + OUString sShapeType = xShape->getShapeType();
4139 + DBG(printf( "shape(text): %s\n", USS(sShapeType) ));
4141 + if( sShapeType.equalsAscii( "com.sun.star.drawing.TextShape" ) )
4143 + ShapeExport::WriteTextShape( xShape );
4145 + else if( sShapeType.equalsAscii( "com.sun.star.presentation.DateTimeShape" ) )
4147 + if( !mrExport.WritePlaceholder( GetFS(), *this, DateAndTime, mbMaster ) )
4148 + ShapeExport::WriteTextShape( xShape );
4150 + else if( sShapeType.equalsAscii( "com.sun.star.presentation.FooterShape" ) )
4152 + if( !mrExport.WritePlaceholder( GetFS(), *this, Footer, mbMaster ) )
4153 + ShapeExport::WriteTextShape( xShape );
4155 + else if( sShapeType.equalsAscii( "com.sun.star.presentation.HeaderShape" ) )
4157 + if( !mrExport.WritePlaceholder( GetFS(), *this, Header, mbMaster ) )
4158 + ShapeExport::WriteTextShape( xShape );
4160 + else if( sShapeType.equalsAscii( "com.sun.star.presentation.NotesShape" ) )
4162 + if( mePageType == NOTICE && mrExport.GetPresObj() )
4163 + mrExport.WritePlaceholderShape( GetFS(), *this, Notes );
4164 + else
4165 + ShapeExport::WriteTextShape( xShape );
4167 + else if( sShapeType.equalsAscii( "com.sun.star.presentation.OutlinerShape" ) )
4169 + if( !mrExport.WritePlaceholder( GetFS(), *this, Outliner, mbMaster ) )
4170 + ShapeExport::WriteTextShape( xShape );
4172 + else if( sShapeType.equalsAscii( "com.sun.star.presentation.SlideNumberShape" ) )
4174 + if( !mrExport.WritePlaceholder( GetFS(), *this, SlideNumber, mbMaster ) )
4175 + ShapeExport::WriteTextShape( xShape );
4177 + else if( sShapeType.equalsAscii( "com.sun.star.presentation.TitleTextShape" ) )
4179 + if( !mrExport.WritePlaceholder( GetFS(), *this, Title, mbMaster ) )
4180 + ShapeExport::WriteTextShape( xShape );
4183 + return *this;
4186 +ShapeExport& PowerPointShapeExport::WriteUnknownShape( Reference< XShape > xShape )
4188 + OUString sShapeType = xShape->getShapeType();
4190 + DBG(printf( "shape(unknown): %s\n", USS(sShapeType) ));
4192 + if( sShapeType.equalsAscii( "com.sun.star.drawing.Group" ) )
4194 + Reference< XIndexAccess > rXIndexAccess( xShape, UNO_QUERY );
4196 + mrExport.EnterGroup( rXIndexAccess );
4197 + DBG(printf( "enter group\n" ));
4199 + else if( sShapeType.equalsAscii( "com.sun.star.drawing.Group" ) )
4201 + mrExport.WritePageShape( GetFS(), *this, mePageType );
4203 + else if( sShapeType.equalsAscii( "com.sun.star.drawing.PageShape" ) )
4205 + mrExport.WritePageShape( GetFS(), *this, mePageType );
4207 + else if( sShapeType.equalsAscii( "com.sun.star.presentation.SubtitleShape" ) )
4209 + if( !mrExport.WritePlaceholder( GetFS(), *this, Subtitle, mbMaster ) )
4210 + ShapeExport::WriteTextShape( xShape );
4213 + return *this;
4216 +PowerPointExport::PowerPointExport( const Reference< XMultiServiceFactory > & rSMgr )
4217 + : XmlFilterBase( rSMgr ),
4218 + PPTWriterBase(),
4219 + mxChartConv( new ::oox::drawingml::chart::ChartConverter ),
4220 + mnLayoutFileIdMax( 1 ),
4221 + mnSlideIdMax( 1 << 8 ),
4222 + mnSlideMasterIdMax( 1 << 31 ),
4223 + mnShapeIdMax( 1 ),
4224 + mnPictureIdMax( 1 )
4226 + memset( mLayoutInfo, 0, sizeof(mLayoutInfo) );
4229 +PowerPointExport::~PowerPointExport()
4233 +bool PowerPointExport::importDocument() throw()
4235 + return false;
4238 +//------------------------------------------------------------------------------------------------------------------------------------------------------------------
4240 +bool PowerPointExport::exportDocument() throw()
4242 + DrawingML::ResetCounters();
4244 + addRelation( US( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" ), S( "ppt/presentation.xml" ) );
4246 + mPresentationFS = openOutputStreamWithSerializer( US( "ppt/presentation.xml" ),
4247 + US( "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml" ) );
4249 + addRelation( mPresentationFS->getOutputStream(),
4250 + US( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" ),
4251 + US( "theme/theme1.xml" ) );
4253 + mPresentationFS->startElementNS( XML_p, XML_presentation, PNMSS, FSEND );
4255 + mXModel.set( getModel(), UNO_QUERY );
4256 + mXStatusIndicator.set( getStatusIndicator(), UNO_QUERY );
4258 + exportPPT();
4260 + mPresentationFS->singleElementNS( XML_p, XML_sldSz,
4261 + XML_cx, IS( PPTtoEMU( maDestPageSize.Width ) ),
4262 + XML_cy, IS( PPTtoEMU( maDestPageSize.Height ) ),
4263 + FSEND );
4264 + // for some reason if added before slides list it will not load the slides (alas with error reports) in mso
4265 + mPresentationFS->singleElementNS( XML_p, XML_notesSz,
4266 + XML_cx, IS( PPTtoEMU( maNotesPageSize.Width ) ),
4267 + XML_cy, IS( PPTtoEMU( maNotesPageSize.Height ) ),
4268 + FSEND );
4270 + mPresentationFS->endElementNS( XML_p, XML_presentation );
4271 + mPresentationFS.reset();
4273 + commit();
4275 + return true;
4278 +//------------------------------------------------------------------------------------------------------------------------------------------------------------------
4280 +void PowerPointExport::ImplWriteBackground( FSHelperPtr pFS, Reference< XPropertySet > rXPropSet )
4282 + FillStyle aFillStyle( FillStyle_NONE );
4283 + if ( ImplGetPropertyValue( rXPropSet, S( "FillStyle" ) ) )
4284 + mAny >>= aFillStyle;
4286 + if( aFillStyle == FillStyle_BITMAP ) {
4287 + //DBG(printf ("FillStyle_BITMAP properties\n"));
4288 + //DBG(dump_pset(rXPropSet));
4291 + if( aFillStyle == FillStyle_NONE ||
4292 + aFillStyle == FillStyle_GRADIENT ||
4293 + aFillStyle == FillStyle_HATCH )
4294 + return;
4296 + pFS->startElementNS( XML_p, XML_bg, FSEND );
4297 + pFS->startElementNS( XML_p, XML_bgPr, FSEND );
4299 + PowerPointShapeExport( pFS, this ).WriteFill( rXPropSet );
4301 + pFS->endElementNS( XML_p, XML_bgPr );
4302 + pFS->endElementNS( XML_p, XML_bg );
4305 +//------------------------------------------------------------------------------------------------------------------------------------------------------------------
4307 +#define MINIMAL_SPTREE "<p:spTree>\
4308 + <p:nvGrpSpPr>\
4309 + <p:cNvPr id=\"1\" name=\"\"/>\
4310 + <p:cNvGrpSpPr/>\
4311 + <p:nvPr/>\
4312 + </p:nvGrpSpPr>\
4313 + <p:grpSpPr>\
4314 + <a:xfrm>\
4315 + <a:off x=\"0\" y=\"0\"/>\
4316 + <a:ext cx=\"0\" cy=\"0\"/>\
4317 + <a:chOff x=\"0\" y=\"0\"/>\
4318 + <a:chExt cx=\"0\" cy=\"0\"/>\
4319 + </a:xfrm>\
4320 + </p:grpSpPr>\
4321 + </p:spTree>"
4323 +#define MAIN_GROUP \
4324 + "<p:nvGrpSpPr>\
4325 + <p:cNvPr id=\"1\" name=\"\"/>\
4326 + <p:cNvGrpSpPr/>\
4327 + <p:nvPr/>\
4328 + </p:nvGrpSpPr>\
4329 + <p:grpSpPr>\
4330 + <a:xfrm>\
4331 + <a:off x=\"0\" y=\"0\"/>\
4332 + <a:ext cx=\"0\" cy=\"0\"/>\
4333 + <a:chOff x=\"0\" y=\"0\"/>\
4334 + <a:chExt cx=\"0\" cy=\"0\"/>\
4335 + </a:xfrm>\
4336 + </p:grpSpPr>"
4339 +#define GETA(propName) \
4340 + ImplGetPropertyValue( mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( #propName ) ) )
4342 +#define GET(variable, propName) \
4343 + if ( GETA(propName) ) \
4344 + mAny >>= variable;
4346 +const char* PowerPointExport::GetSideDirection( sal_uInt8 nDirection )
4348 + const char* pDirection = NULL;
4350 + switch( nDirection ) {
4351 + case 0:
4352 + pDirection = "r";
4353 + break;
4354 + case 1:
4355 + pDirection = "d";
4356 + break;
4357 + case 2:
4358 + pDirection = "l";
4359 + break;
4360 + case 3:
4361 + pDirection = "u";
4362 + break;
4365 + return pDirection;
4368 +const char* PowerPointExport::GetCornerDirection( sal_uInt8 nDirection )
4370 + const char* pDirection = NULL;
4372 + switch( nDirection ) {
4373 + case 4:
4374 + pDirection = "rd";
4375 + break;
4376 + case 5:
4377 + pDirection = "ld";
4378 + break;
4379 + case 6:
4380 + pDirection = "ru";
4381 + break;
4382 + case 7:
4383 + pDirection = "lu";
4384 + break;
4387 + return pDirection;
4390 +const char* PowerPointExport::Get8Direction( sal_uInt8 nDirection )
4392 + const char* pDirection = GetSideDirection( nDirection );
4394 + if( !pDirection )
4395 + pDirection = GetCornerDirection( nDirection );
4397 + return pDirection;
4400 +void PowerPointExport::ImplWriteSlide( sal_uInt32 nPageNum, sal_uInt32 nMasterNum, sal_uInt16 /* nMode */,
4401 + sal_Bool bHasBackground, Reference< XPropertySet > aXBackgroundPropSet )
4403 + DBG(printf("write slide: %d\n----------------\n", nPageNum));
4405 + // slides list
4406 + if( nPageNum == 0 )
4407 + mPresentationFS->startElementNS( XML_p, XML_sldIdLst, FSEND );
4409 + // add explicit relation of presentation to this slide
4410 + OUString sRelId = addRelation( mPresentationFS->getOutputStream(),
4411 + US( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide" ),
4412 + OUStringBuffer()
4413 + .appendAscii( "slides/slide" )
4414 + .append( (sal_Int32) nPageNum + 1 )
4415 + .appendAscii( ".xml" )
4416 + .makeStringAndClear() );
4418 + mPresentationFS->singleElementNS( XML_p, XML_sldId,
4419 + XML_id, I32S( GetNewSlideId() ),
4420 + FSNS( XML_r, XML_id ), USS( sRelId ),
4421 + FSEND );
4423 + if( nPageNum == mnPages - 1 )
4424 + mPresentationFS->endElementNS( XML_p, XML_sldIdLst );
4426 + FSHelperPtr pFS = openOutputStreamWithSerializer( OUStringBuffer()
4427 + .appendAscii( "ppt/slides/slide" )
4428 + .append( (sal_Int32) nPageNum + 1 )
4429 + .appendAscii( ".xml" )
4430 + .makeStringAndClear(),
4431 + US( "application/vnd.openxmlformats-officedocument.presentationml.slide+xml" ) );
4433 + if( mpSlidesFSArray.size() < mnPages )
4434 + mpSlidesFSArray.resize( mnPages );
4435 + mpSlidesFSArray[ nPageNum ] = pFS;
4437 + pFS->startElementNS( XML_p, XML_sld, PNMSS, FSEND );
4439 + pFS->startElementNS( XML_p, XML_cSld, FSEND );
4441 + // background
4442 + if( bHasBackground ) {
4443 + ImplWriteBackground( pFS, aXBackgroundPropSet );
4446 + WriteShapeTree( pFS, NORMAL, FALSE );
4448 + pFS->endElementNS( XML_p, XML_cSld );
4450 + FadeEffect eFadeEffect = FadeEffect_NONE;
4451 + GET( eFadeEffect, Effect );
4453 + OSL_TRACE("fade effect %d", eFadeEffect);
4455 + sal_Int16 nTransitionType = 0, nTransitionSubtype = 0;
4456 + sal_Int8 nPPTTransitionType = 0;
4457 + sal_uInt8 nDirection = 0;
4459 + if( GETA( TransitionType ) && ( mAny >>= nTransitionType ) &&
4460 + GETA( TransitionSubtype ) && ( mAny >>= nTransitionSubtype ) )
4461 + nPPTTransitionType = GetTransition( nTransitionType, nTransitionSubtype, eFadeEffect, nDirection );
4463 + if( !nPPTTransitionType && eFadeEffect != FadeEffect_NONE )
4464 + nPPTTransitionType = GetTransition( eFadeEffect, nDirection );
4466 + if( nPPTTransitionType ) {
4467 + AnimationSpeed animationSpeed = AnimationSpeed_MEDIUM;
4468 + const char* speed = NULL;
4469 + sal_Int32 advanceTiming = -1;
4470 + sal_Int32 changeType = 0;
4472 + if( GETA( Speed ) ) {
4473 + mAny >>= animationSpeed;
4475 + switch( animationSpeed ) {
4476 + default:
4477 + case AnimationSpeed_MEDIUM:
4478 + speed = "med";
4479 + break;
4480 + case AnimationSpeed_SLOW:
4481 + speed = "slow";
4482 + break;
4483 + case AnimationSpeed_FAST:
4484 + break;
4488 + if( GETA( Change ) )
4489 + mAny >>= changeType;
4491 + // 1 means automatic, 2 half automatic - not sure what it means - at least I don't see it in UI
4492 + if( changeType == 1 && GETA( Duration ) )
4493 + mAny >>= advanceTiming;
4495 + pFS->startElementNS( XML_p, XML_transition,
4496 + XML_spd, speed,
4497 + XML_advTm, advanceTiming != -1 ? I32S( advanceTiming*1000 ) : NULL,
4498 + FSEND );
4500 + sal_Int32 nTransition = 0;
4501 + const char* pDirection = NULL;
4502 + const char* pOrientation = NULL;
4503 + const char* pThruBlk = NULL;
4504 + const char* pSpokes = NULL;
4505 + char pSpokesTmp[2] = "0";
4507 + switch( nPPTTransitionType ) {
4508 + case PPT_TRANSITION_TYPE_BLINDS:
4509 + nTransition = XML_blinds;
4510 + pDirection = ( nDirection == 0) ? "vert" : "horz";
4511 + break;
4512 + case PPT_TRANSITION_TYPE_CHECKER:
4513 + nTransition = XML_checker;
4514 + pDirection = ( nDirection == 1) ? "vert" : "horz";
4515 + break;
4516 + case PPT_TRANSITION_TYPE_CIRCLE:
4517 + nTransition = XML_circle;
4518 + break;
4519 + case PPT_TRANSITION_TYPE_COMB:
4520 + nTransition = XML_comb;
4521 + pDirection = ( nDirection == 1) ? "vert" : "horz";
4522 + break;
4523 + case PPT_TRANSITION_TYPE_COVER:
4524 + nTransition = XML_cover;
4525 + pDirection = Get8Direction( nDirection );
4526 + break;
4527 +// we don't have cut transition AFAIK
4528 +// case PPT_TRANSITION_TYPE_CUT:
4529 +// nTransition = XML_cut;
4530 +// break;
4531 + case PPT_TRANSITION_TYPE_DIAMOND:
4532 + nTransition = XML_diamond;
4533 + break;
4534 + case PPT_TRANSITION_TYPE_DISSOLVE:
4535 + nTransition = XML_dissolve;
4536 + break;
4537 + case PPT_TRANSITION_TYPE_FADE:
4538 + nTransition = XML_fade;
4539 + pThruBlk = "true";
4540 + break;
4541 + case PPT_TRANSITION_TYPE_SMOOTHFADE:
4542 + nTransition = XML_fade;
4543 + break;
4544 + case PPT_TRANSITION_TYPE_NEWSFLASH:
4545 + nTransition = XML_newsflash;
4546 + break;
4547 + case PPT_TRANSITION_TYPE_PLUS:
4548 + nTransition = XML_plus;
4549 + break;
4550 + case PPT_TRANSITION_TYPE_PULL:
4551 + nTransition = XML_pull;
4552 + pDirection = Get8Direction( nDirection );
4553 + break;
4554 + case PPT_TRANSITION_TYPE_PUSH:
4555 + nTransition = XML_push;
4556 + pDirection = GetSideDirection( nDirection );
4557 + break;
4558 + case PPT_TRANSITION_TYPE_RANDOM:
4559 + nTransition = XML_random;
4560 + break;
4561 + case PPT_TRANSITION_TYPE_RANDOM_BARS:
4562 + nTransition = XML_randomBar;
4563 + pDirection = ( nDirection == 1) ? "vert" : "horz";
4564 + break;
4565 + case PPT_TRANSITION_TYPE_SPLIT:
4566 + nTransition = XML_split;
4567 + pDirection = ( nDirection & 1) ? "in" : "out";
4568 + pOrientation = ( nDirection < 2) ? "horz" : "vert";
4569 + break;
4570 + case PPT_TRANSITION_TYPE_STRIPS:
4571 + nTransition = XML_strips;
4572 + pDirection = GetCornerDirection( nDirection );
4573 + break;
4574 + case PPT_TRANSITION_TYPE_WEDGE:
4575 + nTransition = XML_wedge;
4576 + break;
4577 + case PPT_TRANSITION_TYPE_WHEEL:
4578 + nTransition = XML_wheel;
4579 + if( nDirection != 4 && nDirection <= 9 ) {
4580 + pSpokesTmp[0] = '0' + nDirection;
4581 + pSpokes = pSpokesTmp;
4583 + break;
4584 + case PPT_TRANSITION_TYPE_WIPE:
4585 + nTransition = XML_wipe;
4586 + pDirection = GetSideDirection( nDirection );
4587 + break;
4588 + case PPT_TRANSITION_TYPE_ZOOM:
4589 + nTransition = XML_zoom;
4590 + pDirection = ( nDirection == 1) ? "in" : "out";
4591 + break;
4592 + case PPT_TRANSITION_TYPE_NONE:
4593 + default:
4594 + nTransition = 0;
4597 + if( nTransition )
4598 + pFS->singleElementNS( XML_p, nTransition,
4599 + XML_dir, pDirection,
4600 + XML_orient, pOrientation,
4601 + XML_spokes, pSpokes,
4602 + XML_thruBlk, pThruBlk,
4603 + FSEND );
4605 + pFS->endElementNS( XML_p, XML_transition );
4608 + pFS->endElementNS( XML_p, XML_sld );
4610 + // add implicit relation to slide layout
4611 + addRelation( pFS->getOutputStream(),
4612 + US( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" ),
4613 + OUStringBuffer()
4614 + .appendAscii( "../slideLayouts/slideLayout" )
4615 + .append( GetLayoutFileId( GetLayoutOffset( mXPagePropSet ), nMasterNum ) )
4616 + .appendAscii( ".xml" )
4617 + .makeStringAndClear() );
4619 + DBG(printf("----------------\n"));
4622 +void PowerPointExport::ImplWriteNotes( sal_uInt32 nPageNum )
4624 + if( !mbCreateNotes || !ContainsOtherShapeThanPlaceholders( TRUE ) )
4625 + return;
4627 + DBG(printf("write Notes %d\n----------------\n", nPageNum));
4629 + FSHelperPtr pFS = openOutputStreamWithSerializer( OUStringBuffer()
4630 + .appendAscii( "ppt/notesSlides/notesSlide" )
4631 + .append( (sal_Int32) nPageNum + 1 )
4632 + .appendAscii( ".xml" )
4633 + .makeStringAndClear(),
4634 + US( "application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml" ) );
4636 + pFS->startElementNS( XML_p, XML_notes, PNMSS, FSEND );
4638 + pFS->startElementNS( XML_p, XML_cSld, FSEND );
4640 + // background
4641 +// if( bHasBackground ) {
4642 +// ImplWriteBackground( pFS, aXBackgroundPropSet );
4643 +// }
4645 + WriteShapeTree( pFS, NOTICE, FALSE );
4647 + pFS->endElementNS( XML_p, XML_cSld );
4649 + pFS->endElementNS( XML_p, XML_notes );
4651 + // add implicit relation to slide
4652 + addRelation( pFS->getOutputStream(),
4653 + US( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide" ),
4654 + OUStringBuffer()
4655 + .appendAscii( "../slides/slide" )
4656 + .append( (sal_Int32) nPageNum + 1 )
4657 + .appendAscii( ".xml" )
4658 + .makeStringAndClear() );
4660 + // add slide implicit relation to notes
4661 + if( mpSlidesFSArray.size() >= nPageNum )
4662 + addRelation( mpSlidesFSArray[ nPageNum ]->getOutputStream(),
4663 + US( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide" ),
4664 + OUStringBuffer()
4665 + .appendAscii( "../notesSlides/notesSlide" )
4666 + .append( (sal_Int32) nPageNum + 1 )
4667 + .appendAscii( ".xml" )
4668 + .makeStringAndClear() );
4670 + // add implicit relation to notes master
4671 + addRelation( pFS->getOutputStream(),
4672 + US( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster" ),
4673 + US( "../notesMasters/notesMaster1.xml" ) );
4675 + DBG(printf("----------------\n"));
4678 +//------------------------------------------------------------------------------------------------------------------------------------------------------------------
4680 +void PowerPointExport::AddLayoutIdAndRelation( FSHelperPtr pFS, sal_Int32 nLayoutFileId )
4682 + // add implicit relation of slide master to slide layout
4683 + OUString sRelId = addRelation( pFS->getOutputStream(),
4684 + US( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" ),
4685 + OUStringBuffer()
4686 + .appendAscii( "../slideLayouts/slideLayout" )
4687 + .append( nLayoutFileId )
4688 + .appendAscii( ".xml" )
4689 + .makeStringAndClear() );
4691 + pFS->singleElementNS( XML_p, XML_sldLayoutId,
4692 + XML_id, I64S( GetNewSlideMasterId() ),
4693 + FSNS( XML_r, XML_id ), USS( sRelId ),
4694 + FSEND );
4697 +//------------------------------------------------------------------------------------------------------------------------------------------------------------------
4699 +sal_Int32 PowerPointExport::nStyleLevelToken[5] =
4701 + XML_lvl1pPr,
4702 + XML_lvl2pPr,
4703 + XML_lvl3pPr,
4704 + XML_lvl4pPr,
4705 + XML_lvl5pPr
4708 +void PowerPointExport::WriteTextStyleLevel( FSHelperPtr pFS, int nInstance, int nLevel )
4710 + OSL_ASSERT( nLevel >= 0 && nLevel < 5 );
4711 + OSL_ASSERT( nInstance >= 0 && nInstance < 9 );
4713 + PPTExCharLevel rCharLevel = mpStyleSheet->GetCharSheet( nInstance ).maCharLevel[ nLevel ];
4714 + PPTExParaLevel rParaLevel = mpStyleSheet->GetParaSheet( nInstance ).maParaLevel[ nLevel ];
4716 + pFS->startElementNS( XML_a, PowerPointExport::nStyleLevelToken[ nLevel ],
4717 + XML_algn, DrawingML::GetAlignment( rParaLevel.mnOOAdjust ),
4718 + FSEND );
4720 + pFS->endElementNS( XML_a, PowerPointExport::nStyleLevelToken[ nLevel ] );
4723 +void PowerPointExport::WriteTextStyle( FSHelperPtr pFS, int nInstance, sal_Int32 xmlToken )
4725 + pFS->startElementNS( XML_p, xmlToken, FSEND );
4727 + for( int nLevel = 0; nLevel < 5; nLevel ++ )
4728 + WriteTextStyleLevel( pFS, nInstance, nLevel );
4730 + pFS->endElementNS( XML_p, xmlToken );
4733 +void PowerPointExport::WriteTextStyles( FSHelperPtr pFS )
4735 + pFS->startElementNS( XML_p, XML_txBody, FSEND );
4737 + WriteTextStyle( pFS, EPP_TEXTTYPE_Title, XML_titleStyle );
4738 + WriteTextStyle( pFS, EPP_TEXTTYPE_Body, XML_bodyStyle );
4739 + WriteTextStyle( pFS, EPP_TEXTTYPE_Other, XML_otherStyle );
4741 + pFS->endElementNS( XML_p, XML_txBody );
4744 +void PowerPointExport::ImplWriteSlideMaster( sal_uInt32 nPageNum, Reference< XPropertySet > aXBackgroundPropSet )
4746 + DBG(printf("write slide master: %d\n----------------\n", nPageNum));
4748 + // slides list
4749 + if( nPageNum == 0 )
4750 + mPresentationFS->startElementNS( XML_p, XML_sldMasterIdLst, FSEND );
4752 + OUString sRelId = addRelation( mPresentationFS->getOutputStream(),
4753 + US( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" ),
4754 + OUStringBuffer()
4755 + .appendAscii( "slideMasters/slideMaster" )
4756 + .append( (sal_Int32) nPageNum + 1 )
4757 + .appendAscii( ".xml" )
4758 + .makeStringAndClear() );
4760 + mPresentationFS->singleElementNS( XML_p, XML_sldMasterId,
4761 + XML_id, OString::valueOf( (sal_Int64) GetNewSlideMasterId() ).getStr(),
4762 + FSNS( XML_r, XML_id ), USS( sRelId ),
4763 + FSEND );
4765 + if( nPageNum == mnMasterPages - 1 )
4766 + mPresentationFS->endElementNS( XML_p, XML_sldMasterIdLst );
4768 + FSHelperPtr pFS =
4769 + openOutputStreamWithSerializer( OUStringBuffer()
4770 + .appendAscii( "ppt/slideMasters/slideMaster" )
4771 + .append( (sal_Int32) nPageNum + 1 )
4772 + .appendAscii( ".xml" )
4773 + .makeStringAndClear(),
4774 + US( "application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml" ) );
4775 + if( mpMasterFSArray.size() < mnMasterPages )
4776 + mpMasterFSArray.resize( mnMasterPages );
4777 + mpMasterFSArray[ nPageNum ] = pFS;
4779 + // write theme per master
4780 + WriteTheme( nPageNum );
4782 + // add implicit relation to the presentation theme
4783 + addRelation( pFS->getOutputStream(),
4784 + US( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" ),
4785 + OUStringBuffer()
4786 + .appendAscii( "../theme/theme" )
4787 + .append( (sal_Int32) nPageNum + 1 )
4788 + .appendAscii( ".xml" )
4789 + .makeStringAndClear() );
4791 + pFS->startElementNS( XML_p, XML_sldMaster, PNMSS, FSEND );
4793 + pFS->startElementNS( XML_p, XML_cSld, FSEND );
4795 + ImplWriteBackground( pFS, aXBackgroundPropSet );
4796 + WriteShapeTree( pFS, MASTER, TRUE );
4798 + pFS->endElementNS( XML_p, XML_cSld );
4800 + // color map - now it uses colors from hardcoded theme, once we eventually generate theme, this might need update
4801 + pFS->singleElementNS( XML_p, XML_clrMap,
4802 + XML_bg1, "lt1",
4803 + XML_bg2, "lt2",
4804 + XML_tx1, "dk1",
4805 + XML_tx2, "dk2",
4806 + XML_accent1, "accent1",
4807 + XML_accent2, "accent2",
4808 + XML_accent3, "accent3",
4809 + XML_accent4, "accent4",
4810 + XML_accent5, "accent5",
4811 + XML_accent6, "accent6",
4812 + XML_hlink, "hlink",
4813 + XML_folHlink, "folHlink",
4814 + FSEND );
4816 + // use master's id type as they have same range, mso does that as well
4817 + pFS->startElementNS( XML_p, XML_sldLayoutIdLst, FSEND );
4819 + int nCount = 0;
4820 + for( int i = 0; i < EPP_LAYOUT_SIZE; i++) {
4822 + sal_Int32 nLayoutFileId = GetLayoutFileId( i, nPageNum );
4823 + if( nLayoutFileId > 0 ) {
4824 + AddLayoutIdAndRelation( pFS, nLayoutFileId );
4825 + nCount++;
4829 + if( nCount == 0 ) {
4830 + // add at least empty layout, so that we don't have master page
4831 + // without layout, such master cannot be used in ppt
4832 + ImplWriteLayout( 0, nPageNum );
4833 + AddLayoutIdAndRelation( pFS, GetLayoutFileId( 0, nPageNum ) );
4836 + pFS->endElementNS( XML_p, XML_sldLayoutIdLst );
4838 + // WriteTextStyles( pFS );
4840 + pFS->endElementNS( XML_p, XML_sldMaster );
4842 + DBG(printf("----------------\n"));
4845 +//------------------------------------------------------------------------------------------------------------------------------------------------------------------
4847 +sal_Int32 PowerPointExport::GetLayoutFileId( sal_Int32 nOffset, sal_uInt32 nMasterNum )
4849 + if( mLayoutInfo[ nOffset ].mnFileIdArray.size() <= nMasterNum )
4850 + return 0;
4852 + return mLayoutInfo[ nOffset ].mnFileIdArray[ nMasterNum ];
4855 +//------------------------------------------------------------------------------------------------------------------------------------------------------------------
4857 +void PowerPointExport::ImplWriteLayout( sal_Int32 nOffset, sal_uInt32 nMasterNum )
4859 + if( mLayoutInfo[ nOffset ].mnFileIdArray.size() < mnMasterPages ) {
4860 + mLayoutInfo[ nOffset ].mnFileIdArray.resize( mnMasterPages );
4863 + if( mLayoutInfo[ nOffset ].mnFileIdArray[ nMasterNum ] != 0 )
4864 + return;
4866 + FSHelperPtr pFS
4867 + = openOutputStreamWithSerializer( OUStringBuffer()
4868 + .appendAscii( "ppt/slideLayouts/slideLayout" )
4869 + .append( (sal_Int32) mnLayoutFileIdMax )
4870 + .appendAscii( ".xml" )
4871 + .makeStringAndClear(),
4872 + US( "application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml" ) );
4874 +// LayoutInfo& rLayoutInfo = GetLayoutInfo( mXPagePropSet );
4876 + // add implicit relation of slide layout to slide master
4877 + addRelation( pFS->getOutputStream(),
4878 + US( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" ),
4879 + OUStringBuffer()
4880 + .appendAscii( "../slideMasters/slideMaster" )
4881 + .append( (sal_Int32) nMasterNum + 1 )
4882 + .appendAscii( ".xml" )
4883 + .makeStringAndClear() );
4885 + pFS->startElementNS( XML_p, XML_sldLayout,
4886 + PNMSS,
4887 + XML_type, "title",
4888 + XML_preserve, "1",
4889 + FSEND );
4891 + pFS->startElementNS( XML_p, XML_cSld,
4892 + XML_name, "Title Slide",
4893 + FSEND );
4894 + pFS->write( MINIMAL_SPTREE ); // TODO: write actual shape tree
4895 + pFS->endElementNS( XML_p, XML_cSld );
4897 + pFS->endElementNS( XML_p, XML_sldLayout );
4899 + mLayoutInfo[ nOffset ].mnFileIdArray[ nMasterNum ] = mnLayoutFileIdMax;
4901 + mnLayoutFileIdMax ++;
4904 +//------------------------------------------------------------------------------------------------------------------------------------------------------------------
4906 +void PowerPointExport::WriteShapeTree( FSHelperPtr pFS, PageType ePageType, sal_Bool bMaster )
4908 + PowerPointShapeExport aDML( pFS, this );
4909 + aDML.SetMaster( bMaster );
4910 + aDML.SetPageType( ePageType );
4911 + sal_uInt32 nShapes;
4913 + pFS->startElementNS( XML_p, XML_spTree, FSEND );
4914 + pFS->write( MAIN_GROUP );
4916 + ResetGroupTable( nShapes = mXShapes->getCount() );
4918 + while( GetNextGroupEntry() ) {
4920 + sal_uInt32 nGroups = GetGroupsClosed();
4921 + for ( sal_uInt32 i = 0; i < nGroups; i++ ) {
4922 + DBG(printf( "leave group\n" ));
4925 + if ( GetShapeByIndex( GetCurrentGroupIndex(), TRUE ) ) {
4926 + DBG(printf( "mType: \"%s\"\n", mType.GetBuffer() ));
4927 + aDML.WriteShape( mXShape );
4931 + pFS->endElementNS( XML_p, XML_spTree );
4934 +#define BEGIN_SHAPE pFS->startElementNS( XML_p, XML_sp, FSEND )
4935 +#define END_SHAPE pFS->endElementNS( XML_p, XML_sp )
4937 +void PowerPointExport::WritePageShape( FSHelperPtr pFS, ShapeExport& rDML, PageType ePageType )
4939 + if( ePageType == NOTICE && mbPresObj )
4940 + WritePlaceholderShape( pFS, rDML, SlideImage );
4941 + else
4942 + rDML.WriteTextShape( mXShape );
4945 +sal_Bool PowerPointExport::WritePlaceholder( FSHelperPtr pFS, ShapeExport& rDML, PlaceholderType ePlaceholder, sal_Bool bMaster )
4947 + if( bMaster && ShapeExport::NonEmptyText( mXShape ) ) {
4948 + WritePlaceholderShape( pFS, rDML, ePlaceholder );
4950 + return TRUE;
4953 + return FALSE;
4956 +void PowerPointExport::WritePlaceholderShape( FSHelperPtr pFS, ShapeExport& rDML, PlaceholderType ePlaceholder )
4958 + BEGIN_SHAPE;
4960 + // non visual shape properties
4961 + pFS->startElementNS( XML_p, XML_nvSpPr, FSEND );
4962 + rDML.WriteNonVisualDrawingProperties( mXShape, IDS( PlaceHolder ) );
4963 + pFS->startElementNS( XML_p, XML_cNvSpPr, FSEND );
4964 + pFS->singleElementNS( XML_a, XML_spLocks, XML_noGrp, "1", FSEND );
4965 + pFS->endElementNS( XML_p, XML_cNvSpPr );
4966 + pFS->startElementNS( XML_p, XML_nvPr, FSEND );
4968 + const char* pType = NULL;
4969 + switch( ePlaceholder ) {
4970 + case SlideImage:
4971 + pType = "sldImg";
4972 + break;
4973 + case Notes:
4974 + pType = "body";
4975 + break;
4976 + case Header:
4977 + pType = "hdr";
4978 + break;
4979 + case Footer:
4980 + pType = "ftr";
4981 + break;
4982 + case SlideNumber:
4983 + pType = "sldNum";
4984 + break;
4985 + case DateAndTime:
4986 + pType = "dt";
4987 + break;
4988 + case Outliner:
4989 + pType = "body";
4990 + break;
4991 + case Title:
4992 + pType = "title";
4993 + break;
4994 + case Subtitle:
4995 + pType = "subTitle";
4996 + break;
4997 + default:
4998 + DBG(printf("warning: unhandled placeholder type: %d\n", ePlaceholder));
5000 + pFS->singleElementNS( XML_p, XML_ph, XML_type, pType, FSEND );
5001 + pFS->endElementNS( XML_p, XML_nvPr );
5002 + pFS->endElementNS( XML_p, XML_nvSpPr );
5004 + // visual shape properties
5005 + pFS->startElementNS( XML_p, XML_spPr, FSEND );
5006 + rDML.WriteShapeTransformation( mXShape );
5007 + rDML.WritePresetShape( "rect" );
5008 + rDML.WriteBlipFill( mXPropSet, S( "GraphicURL" ) );
5009 + pFS->endElementNS( XML_p, XML_spPr );
5011 + rDML.WriteTextBox( mXShape );
5013 + END_SHAPE;
5016 +//------------------------------------------------------------------------------------------------------------------------------------------------------------------
5018 +#define MINIMAL_THEME " <a:themeElements>\
5019 + <a:clrScheme name=\"Office\">\
5020 + <a:dk1>\
5021 + <a:sysClr val=\"windowText\" lastClr=\"000000\"/>\
5022 + </a:dk1>\
5023 + <a:lt1>\
5024 + <a:sysClr val=\"window\" lastClr=\"FFFFFF\"/>\
5025 + </a:lt1>\
5026 + <a:dk2>\
5027 + <a:srgbClr val=\"1F497D\"/>\
5028 + </a:dk2>\
5029 + <a:lt2>\
5030 + <a:srgbClr val=\"EEECE1\"/>\
5031 + </a:lt2>\
5032 + <a:accent1>\
5033 + <a:srgbClr val=\"4F81BD\"/>\
5034 + </a:accent1>\
5035 + <a:accent2>\
5036 + <a:srgbClr val=\"C0504D\"/>\
5037 + </a:accent2>\
5038 + <a:accent3>\
5039 + <a:srgbClr val=\"9BBB59\"/>\
5040 + </a:accent3>\
5041 + <a:accent4>\
5042 + <a:srgbClr val=\"8064A2\"/>\
5043 + </a:accent4>\
5044 + <a:accent5>\
5045 + <a:srgbClr val=\"4BACC6\"/>\
5046 + </a:accent5>\
5047 + <a:accent6>\
5048 + <a:srgbClr val=\"F79646\"/>\
5049 + </a:accent6>\
5050 + <a:hlink>\
5051 + <a:srgbClr val=\"0000FF\"/>\
5052 + </a:hlink>\
5053 + <a:folHlink>\
5054 + <a:srgbClr val=\"800080\"/>\
5055 + </a:folHlink>\
5056 + </a:clrScheme>\
5057 + <a:fontScheme name=\"Office\">\
5058 + <a:majorFont>\
5059 + <a:latin typeface=\"Arial\"/>\
5060 + <a:ea typeface=\"DejaVu Sans\"/>\
5061 + <a:cs typeface=\"DejaVu Sans\"/>\
5062 + </a:majorFont>\
5063 + <a:minorFont>\
5064 + <a:latin typeface=\"Arial\"/>\
5065 + <a:ea typeface=\"DejaVu Sans\"/>\
5066 + <a:cs typeface=\"DejaVu Sans\"/>\
5067 + </a:minorFont>\
5068 + </a:fontScheme>\
5069 + <a:fmtScheme name=\"Office\">\
5070 + <a:fillStyleLst>\
5071 + <a:solidFill>\
5072 + <a:schemeClr val=\"phClr\"/>\
5073 + </a:solidFill>\
5074 + <a:gradFill rotWithShape=\"1\">\
5075 + <a:gsLst>\
5076 + <a:gs pos=\"0\">\
5077 + <a:schemeClr val=\"phClr\">\
5078 + <a:tint val=\"50000\"/>\
5079 + <a:satMod val=\"300000\"/>\
5080 + </a:schemeClr>\
5081 + </a:gs>\
5082 + <a:gs pos=\"35000\">\
5083 + <a:schemeClr val=\"phClr\">\
5084 + <a:tint val=\"37000\"/>\
5085 + <a:satMod val=\"300000\"/>\
5086 + </a:schemeClr>\
5087 + </a:gs>\
5088 + <a:gs pos=\"100000\">\
5089 + <a:schemeClr val=\"phClr\">\
5090 + <a:tint val=\"15000\"/>\
5091 + <a:satMod val=\"350000\"/>\
5092 + </a:schemeClr>\
5093 + </a:gs>\
5094 + </a:gsLst>\
5095 + <a:lin ang=\"16200000\" scaled=\"1\"/>\
5096 + </a:gradFill>\
5097 + <a:gradFill rotWithShape=\"1\">\
5098 + <a:gsLst>\
5099 + <a:gs pos=\"0\">\
5100 + <a:schemeClr val=\"phClr\">\
5101 + <a:shade val=\"51000\"/>\
5102 + <a:satMod val=\"130000\"/>\
5103 + </a:schemeClr>\
5104 + </a:gs>\
5105 + <a:gs pos=\"80000\">\
5106 + <a:schemeClr val=\"phClr\">\
5107 + <a:shade val=\"93000\"/>\
5108 + <a:satMod val=\"130000\"/>\
5109 + </a:schemeClr>\
5110 + </a:gs>\
5111 + <a:gs pos=\"100000\">\
5112 + <a:schemeClr val=\"phClr\">\
5113 + <a:shade val=\"94000\"/>\
5114 + <a:satMod val=\"135000\"/>\
5115 + </a:schemeClr>\
5116 + </a:gs>\
5117 + </a:gsLst>\
5118 + <a:lin ang=\"16200000\" scaled=\"0\"/>\
5119 + </a:gradFill>\
5120 + </a:fillStyleLst>\
5121 + <a:lnStyleLst>\
5122 + <a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">\
5123 + <a:solidFill>\
5124 + <a:schemeClr val=\"phClr\">\
5125 + <a:shade val=\"95000\"/>\
5126 + <a:satMod val=\"105000\"/>\
5127 + </a:schemeClr>\
5128 + </a:solidFill>\
5129 + <a:prstDash val=\"solid\"/>\
5130 + </a:ln>\
5131 + <a:ln w=\"25400\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">\
5132 + <a:solidFill>\
5133 + <a:schemeClr val=\"phClr\"/>\
5134 + </a:solidFill>\
5135 + <a:prstDash val=\"solid\"/>\
5136 + </a:ln>\
5137 + <a:ln w=\"38100\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">\
5138 + <a:solidFill>\
5139 + <a:schemeClr val=\"phClr\"/>\
5140 + </a:solidFill>\
5141 + <a:prstDash val=\"solid\"/>\
5142 + </a:ln>\
5143 + </a:lnStyleLst>\
5144 + <a:effectStyleLst>\
5145 + <a:effectStyle>\
5146 + <a:effectLst>\
5147 + <a:outerShdw blurRad=\"40000\" dist=\"20000\" dir=\"5400000\" rotWithShape=\"0\">\
5148 + <a:srgbClr val=\"000000\">\
5149 + <a:alpha val=\"38000\"/>\
5150 + </a:srgbClr>\
5151 + </a:outerShdw>\
5152 + </a:effectLst>\
5153 + </a:effectStyle>\
5154 + <a:effectStyle>\
5155 + <a:effectLst>\
5156 + <a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\">\
5157 + <a:srgbClr val=\"000000\">\
5158 + <a:alpha val=\"35000\"/>\
5159 + </a:srgbClr>\
5160 + </a:outerShdw>\
5161 + </a:effectLst>\
5162 + </a:effectStyle>\
5163 + <a:effectStyle>\
5164 + <a:effectLst>\
5165 + <a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\">\
5166 + <a:srgbClr val=\"000000\">\
5167 + <a:alpha val=\"35000\"/>\
5168 + </a:srgbClr>\
5169 + </a:outerShdw>\
5170 + </a:effectLst>\
5171 + <a:scene3d>\
5172 + <a:camera prst=\"orthographicFront\">\
5173 + <a:rot lat=\"0\" lon=\"0\" rev=\"0\"/>\
5174 + </a:camera>\
5175 + <a:lightRig rig=\"threePt\" dir=\"t\">\
5176 + <a:rot lat=\"0\" lon=\"0\" rev=\"1200000\"/>\
5177 + </a:lightRig>\
5178 + </a:scene3d>\
5179 + <a:sp3d>\
5180 + <a:bevelT w=\"63500\" h=\"25400\"/>\
5181 + </a:sp3d>\
5182 + </a:effectStyle>\
5183 + </a:effectStyleLst>\
5184 + <a:bgFillStyleLst>\
5185 + <a:solidFill>\
5186 + <a:schemeClr val=\"phClr\"/>\
5187 + </a:solidFill>\
5188 + <a:gradFill rotWithShape=\"1\">\
5189 + <a:gsLst>\
5190 + <a:gs pos=\"0\">\
5191 + <a:schemeClr val=\"phClr\">\
5192 + <a:tint val=\"40000\"/>\
5193 + <a:satMod val=\"350000\"/>\
5194 + </a:schemeClr>\
5195 + </a:gs>\
5196 + <a:gs pos=\"40000\">\
5197 + <a:schemeClr val=\"phClr\">\
5198 + <a:tint val=\"45000\"/>\
5199 + <a:shade val=\"99000\"/>\
5200 + <a:satMod val=\"350000\"/>\
5201 + </a:schemeClr>\
5202 + </a:gs>\
5203 + <a:gs pos=\"100000\">\
5204 + <a:schemeClr val=\"phClr\">\
5205 + <a:shade val=\"20000\"/>\
5206 + <a:satMod val=\"255000\"/>\
5207 + </a:schemeClr>\
5208 + </a:gs>\
5209 + </a:gsLst>\
5210 + <a:path path=\"circle\">\
5211 + <a:fillToRect l=\"50000\" t=\"-80000\" r=\"50000\" b=\"180000\"/>\
5212 + </a:path>\
5213 + </a:gradFill>\
5214 + <a:gradFill rotWithShape=\"1\">\
5215 + <a:gsLst>\
5216 + <a:gs pos=\"0\">\
5217 + <a:schemeClr val=\"phClr\">\
5218 + <a:tint val=\"80000\"/>\
5219 + <a:satMod val=\"300000\"/>\
5220 + </a:schemeClr>\
5221 + </a:gs>\
5222 + <a:gs pos=\"100000\">\
5223 + <a:schemeClr val=\"phClr\">\
5224 + <a:shade val=\"30000\"/>\
5225 + <a:satMod val=\"200000\"/>\
5226 + </a:schemeClr>\
5227 + </a:gs>\
5228 + </a:gsLst>\
5229 + <a:path path=\"circle\">\
5230 + <a:fillToRect l=\"50000\" t=\"50000\" r=\"50000\" b=\"50000\"/>\
5231 + </a:path>\
5232 + </a:gradFill>\
5233 + </a:bgFillStyleLst>\
5234 + </a:fmtScheme>\
5235 + </a:themeElements>"
5237 +void PowerPointExport::WriteTheme( sal_Int32 nThemeNum )
5239 + FSHelperPtr pFS = openOutputStreamWithSerializer( OUStringBuffer()
5240 + .appendAscii( "ppt/theme/theme" )
5241 + .append( (sal_Int32) nThemeNum + 1 )
5242 + .appendAscii( ".xml" )
5243 + .makeStringAndClear(),
5244 + US( "application/vnd.openxmlformats-officedocument.theme+xml" ) );
5246 + pFS->startElementNS( XML_a, XML_theme,
5247 + FSNS( XML_xmlns, XML_a), "http://schemas.openxmlformats.org/drawingml/2006/main",
5248 + XML_name, "Office Theme",
5249 + FSEND );
5251 + pFS->write( MINIMAL_THEME );
5252 + pFS->endElementNS( XML_a, XML_theme );
5255 +//------------------------------------------------------------------------------------------------------------------------------------------------------------------
5257 +sal_Bool PowerPointExport::ImplCreateDocument()
5259 + mbCreateNotes = FALSE;
5261 + for( sal_uInt32 i = 0; i < mnPages; i++ )
5263 + if ( !GetPageByIndex( i, NOTICE ) )
5264 + return FALSE;
5266 + if( ContainsOtherShapeThanPlaceholders( TRUE ) ) {
5267 + mbCreateNotes = TRUE;
5268 + break;
5272 + return TRUE;
5275 +//------------------------------------------------------------------------------------------------------------------------------------------------------------------
5277 +sal_Bool PowerPointExport::WriteNotesMaster()
5279 + DBG(printf("write Notes master\n----------------\n"));
5281 + mPresentationFS->startElementNS( XML_p, XML_notesMasterIdLst, FSEND );
5283 + OUString sRelId = addRelation( mPresentationFS->getOutputStream(),
5284 + US( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster" ),
5285 + US( "notesMasters/notesMaster1.xml" ) );
5287 + mPresentationFS->singleElementNS( XML_p, XML_notesMasterId,
5288 + FSNS( XML_r, XML_id ), USS( sRelId ),
5289 + FSEND );
5291 + mPresentationFS->endElementNS( XML_p, XML_notesMasterIdLst );
5293 + FSHelperPtr pFS =
5294 + openOutputStreamWithSerializer( US( "ppt/notesMasters/notesMaster1.xml" ),
5295 + US( "application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml" ) );
5296 + // write theme per master
5297 + WriteTheme( mnMasterPages );
5299 + // add implicit relation to the presentation theme
5300 + addRelation( pFS->getOutputStream(),
5301 + US( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" ),
5302 + OUStringBuffer()
5303 + .appendAscii( "../theme/theme" )
5304 + .append( (sal_Int32) mnMasterPages + 1 )
5305 + .appendAscii( ".xml" )
5306 + .makeStringAndClear() );
5308 + pFS->startElementNS( XML_p, XML_notesMaster, PNMSS, FSEND );
5310 + pFS->startElementNS( XML_p, XML_cSld, FSEND );
5312 + Reference< XPropertySet > aXBackgroundPropSet;
5313 + if( ImplGetPropertyValue( mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Background" ) ) ) &&
5314 + ( mAny >>= aXBackgroundPropSet ) )
5315 + ImplWriteBackground( pFS, aXBackgroundPropSet );
5317 + WriteShapeTree( pFS, NOTICE, TRUE );
5319 + pFS->endElementNS( XML_p, XML_cSld );
5321 + // color map - now it uses colors from hardcoded theme, once we eventually generate theme, this might need update
5322 + pFS->singleElementNS( XML_p, XML_clrMap,
5323 + XML_bg1, "lt1",
5324 + XML_bg2, "lt2",
5325 + XML_tx1, "dk1",
5326 + XML_tx2, "dk2",
5327 + XML_accent1, "accent1",
5328 + XML_accent2, "accent2",
5329 + XML_accent3, "accent3",
5330 + XML_accent4, "accent4",
5331 + XML_accent5, "accent5",
5332 + XML_accent6, "accent6",
5333 + XML_hlink, "hlink",
5334 + XML_folHlink, "folHlink",
5335 + FSEND );
5337 + pFS->endElementNS( XML_p, XML_notesMaster );
5339 + DBG(printf("----------------\n"));
5341 + return TRUE;
5344 +//------------------------------------------------------------------------------------------------------------------------------------------------------------------
5346 +sal_Bool PowerPointExport::ImplCreateMainNotes()
5348 + if( mbCreateNotes )
5349 + return WriteNotesMaster();
5351 + return TRUE;
5354 +//------------------------------------------------------------------------------------------------------------------------------------------------------------------
5356 +drawingml::chart::ChartConverter& PowerPointExport::getChartConverter()
5358 + return *mxChartConv;
5361 +#define IMPL_NAME "com.sun.star.comp.Impress.oox.PowerPointExport"
5363 +OUString SAL_CALL PowerPointExport_getImplementationName() throw()
5365 + return CREATE_OUSTRING( IMPL_NAME );
5368 +uno::Sequence< OUString > SAL_CALL PowerPointExport_getSupportedServiceNames() throw()
5370 + const OUString aServiceName = CREATE_OUSTRING( "com.sun.star.comp.ooxpptx" );
5371 + const Sequence< OUString > aSeq( &aServiceName, 1 );
5372 + return aSeq;
5375 +uno::Reference< uno::XInterface > SAL_CALL PowerPointExport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception )
5377 + return (cppu::OWeakObject*)new PowerPointExport( rSMgr );
5380 +OUString PowerPointExport::implGetImplementationName() const
5382 + return PowerPointExport_getImplementationName();
5387 +// UNO component
5388 +// ------------------------------------------
5389 +// - component_getImplementationEnvironment -
5390 +// ------------------------------------------
5392 +#ifdef __cplusplus
5393 +extern "C"
5395 +#endif
5397 +SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ )
5399 + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
5402 +// -----------------------
5403 +// - component_writeInfo -
5404 +// -----------------------
5406 +SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey )
5408 + sal_Bool bRet = sal_False;
5410 + if( pRegistryKey )
5412 + try
5414 + uno::Reference< registry::XRegistryKey > xNewKey1(
5415 + static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey(
5416 + ::rtl::OUString::createFromAscii( IMPL_NAME "/UNO/SERVICES/" ) ) );
5417 + xNewKey1->createKey( oox::core::PowerPointExport_getSupportedServiceNames().getConstArray()[0] );
5419 + bRet = sal_True;
5421 + catch( registry::InvalidRegistryException& )
5423 + OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
5427 + return bRet;
5430 +// ------------------------
5431 +// - component_getFactory -
5432 +// ------------------------
5434 +SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /* pRegistryKey */ )
5436 + uno::Reference< lang::XSingleServiceFactory > xFactory;
5437 + void* pRet = 0;
5439 + if( rtl_str_compare( pImplName, IMPL_NAME ) == 0 )
5441 + const ::rtl::OUString aServiceName( ::rtl::OUString::createFromAscii( IMPL_NAME ) );
5443 + xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory(
5444 + reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ),
5445 + oox::core::PowerPointExport_getImplementationName(),
5446 + oox::core::PowerPointExport_createInstance,
5447 + oox::core::PowerPointExport_getSupportedServiceNames() ) );
5450 + if( xFactory.is() )
5452 + xFactory->acquire();
5453 + pRet = xFactory.get();
5456 + return pRet;
5459 +#ifdef __cplusplus
5461 +#endif
5463 +DBG(
5464 +void dump_pset(Reference< XPropertySet > rXPropSet)
5466 + Reference< XPropertySetInfo > info = rXPropSet->getPropertySetInfo ();
5467 + Sequence< beans::Property > props = info->getProperties ();
5469 + for (int i=0; i < props.getLength (); i++) {
5470 + OString name = OUStringToOString( props [i].Name, RTL_TEXTENCODING_UTF8);
5471 + printf ("%30s = ", name.getStr() );
5473 + Any value = rXPropSet->getPropertyValue( props [i].Name );
5475 + OUString strValue;
5476 + sal_Int32 intValue;
5477 + bool boolValue;
5478 + RectanglePoint pointValue;
5480 + if( value >>= strValue )
5481 + printf ("\"%s\"\n", USS( strValue ) );
5482 + else if( value >>= intValue )
5483 + printf ("%d (hex: %x)\n", intValue, intValue);
5484 + else if( value >>= boolValue )
5485 + printf ("%d (bool)\n", boolValue);
5486 + else if( value >>= pointValue )
5487 + printf ("%d (RectanglePoint)\n", pointValue);
5488 + else
5489 + printf ("??? <unhandled type>\n");
5493 diff --git sd/source/filter/eppt/epptooxml.hxx sd/source/filter/eppt/epptooxml.hxx
5494 new file mode 100644
5495 index 0000000..2a49d1f
5496 --- /dev/null
5497 +++ sd/source/filter/pptx/epptooxml.hxx
5498 @@ -0,0 +1,120 @@
5499 +#ifndef EPPT_POWERPOINT_EXPORT_HXX
5500 +#define EPPT_POWERPOINT_EXPORT_HXX
5502 +#include <oox/core/xmlfilterbase.hxx>
5503 +#include <oox/helper/zipstorage.hxx>
5505 +#include "epptbase.hxx"
5507 +namespace oox {
5508 + namespace drawingml {
5509 + class ShapeExport;
5511 +namespace core {
5513 +class PowerPointShapeExport;
5515 +struct LayoutInfo
5517 + std::vector< sal_Int32 > mnFileIdArray;
5520 +enum PlaceholderType
5522 + None,
5523 + SlideImage,
5524 + Notes,
5525 + Header,
5526 + Footer,
5527 + SlideNumber,
5528 + DateAndTime,
5529 + Outliner,
5530 + Title,
5531 + Subtitle
5534 +class PowerPointExport : public XmlFilterBase, public PPTWriterBase
5536 + friend class PowerPointShapeExport;
5537 +public:
5539 + PowerPointExport( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rSMgr );
5540 + ~PowerPointExport();
5542 + // from FilterBase
5543 + virtual bool importDocument() throw();
5544 + virtual bool exportDocument() throw();
5546 + // only needed for import, leave them empty, refactor later XmlFilterBase to export and import base?
5547 + virtual sal_Int32 getSchemeClr( sal_Int32 /* nColorSchemeToken */ ) const { return 0; }
5548 + virtual const oox::vml::DrawingPtr getDrawings() { return oox::vml::DrawingPtr(); }
5549 + virtual const oox::drawingml::Theme* getCurrentTheme() const { return NULL; }
5550 + virtual const oox::drawingml::table::TableStyleListPtr getTableStyles() { return oox::drawingml::table::TableStyleListPtr(); }
5551 + virtual oox::drawingml::chart::ChartConverter& getChartConverter();
5553 + static const char* GetSideDirection( sal_uInt8 nDirection );
5554 + static const char* GetCornerDirection( sal_uInt8 nDirection );
5555 + static const char* Get8Direction( sal_uInt8 nDirection );
5557 +protected:
5559 + virtual void ImplWriteSlide( sal_uInt32 nPageNum, sal_uInt32 nMasterNum, sal_uInt16 nMode,
5560 + sal_Bool bHasBackground, ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > aXBackgroundPropSet );
5561 + virtual void ImplWriteNotes( sal_uInt32 nPageNum );
5562 + virtual void ImplWriteSlideMaster( sal_uInt32 nPageNum, ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > aXBackgroundPropSet );
5563 + virtual void ImplWriteLayout( sal_Int32 nOffset, sal_uInt32 nMasterNum );
5564 + void WriteTheme( sal_Int32 nThemeNum );
5566 + virtual sal_Bool ImplCreateDocument();
5567 + virtual sal_Bool ImplCreateMainNotes();
5569 + sal_Bool WriteNotesMaster();
5571 + void WriteTextStyles( ::sax_fastparser::FSHelperPtr pFS );
5572 + void WriteTextStyle( ::sax_fastparser::FSHelperPtr pFS, int nInstance, sal_Int32 xmlToken );
5573 + void WriteTextStyleLevel( ::sax_fastparser::FSHelperPtr pFS, int nInstance, int nLevel );
5574 + void ImplWriteBackground( ::sax_fastparser::FSHelperPtr pFS, ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > aXBackgroundPropSet );
5576 + sal_Int32 GetLayoutFileId( sal_Int32 nOffset, sal_uInt32 nMasterNum );
5578 + // shapes
5579 + void WriteShapeTree( ::sax_fastparser::FSHelperPtr pFS, PageType ePageType, sal_Bool bMaster );
5581 + void WritePlaceholderShape( ::sax_fastparser::FSHelperPtr pFS, drawingml::ShapeExport& rDML, PlaceholderType ePlaceholder );
5582 + void WritePageShape( ::sax_fastparser::FSHelperPtr pFS, drawingml::ShapeExport& rDML, PageType ePageType );
5584 + // helper parts
5585 + sal_Bool WritePlaceholder( ::sax_fastparser::FSHelperPtr pFS, drawingml::ShapeExport& rDML, PlaceholderType ePlaceholder, sal_Bool bMaster );
5587 + sal_uInt32 GetNewSlideId() { return mnSlideIdMax ++; }
5588 + sal_uInt32 GetNewSlideMasterId() { return mnSlideMasterIdMax ++; }
5590 +private:
5591 + void AddLayoutIdAndRelation( ::sax_fastparser::FSHelperPtr pFS, sal_Int32 nLayoutFileId );
5593 + virtual ::rtl::OUString implGetImplementationName() const;
5595 + ::boost::shared_ptr< ::oox::drawingml::chart::ChartConverter > mxChartConv;
5597 + ::sax_fastparser::FSHelperPtr mPresentationFS;
5599 + LayoutInfo mLayoutInfo[EPP_LAYOUT_SIZE];
5600 + std::vector< ::sax_fastparser::FSHelperPtr > mpSlidesFSArray;
5601 + std::vector< ::sax_fastparser::FSHelperPtr > mpMasterFSArray;
5602 + sal_Int32 mnLayoutFileIdMax;
5604 + sal_uInt32 mnSlideIdMax;
5605 + sal_uInt32 mnSlideMasterIdMax;
5607 + sal_Int32 mnShapeIdMax;
5608 + sal_Int32 mnPictureIdMax;
5610 + sal_Bool mbCreateNotes;
5612 + static sal_Int32 nStyleLevelToken[5];
5618 +#endif
5619 diff --git sd/source/filter/eppt/epptso.cxx sd/source/filter/eppt/epptso.cxx
5620 index 84d6e3b..c846a85 100644
5621 --- sd/source/filter/pptx/pptx-epptso.cxx
5622 +++ sd/source/filter/pptx/pptx-epptso.cxx
5623 @@ -32,6 +32,7 @@
5624 #include "precompiled_sd.hxx"
5625 #include <osl/endian.h>
5626 #include <eppt.hxx>
5627 +#include "text.hxx"
5628 #include "epptdef.hxx"
5629 #ifndef _PptEscherEx_HXX
5630 #include "escherex.hxx"
5631 @@ -46,7 +47,6 @@
5632 #include <vcl/virdev.hxx>
5633 #include <vcl/gradient.hxx>
5634 #include <sfx2/app.hxx>
5635 -#include <svtools/languageoptions.hxx>
5636 //#ifndef _SVX_XIT_HXX
5637 //#include <svx/xit.hxx>
5638 //#endif
5639 @@ -55,7 +55,6 @@
5640 #include <svx/svdoashp.hxx>
5641 #include <com/sun/star/style/VerticalAlignment.hpp>
5642 #include <com/sun/star/container/XIndexReplace.hpp>
5643 -#include <com/sun/star/presentation/XPresentationPage.hpp>
5644 #include <com/sun/star/awt/XFont.hpp>
5645 #ifndef _COM_SUN_STAR_AWT_XFONTWEIGHT_HPP_
5646 #include <com/sun/star/awt/FontWeight.hpp>
5647 @@ -63,9 +62,6 @@
5648 #ifndef _COM_SUN_STAR_AWT_XFONTUNDERLINE_HPP_
5649 #include <com/sun/star/awt/FontUnderline.hpp>
5650 #endif
5651 -#include <com/sun/star/style/ParagraphAdjust.hpp>
5652 -#include <com/sun/star/style/LineSpacing.hpp>
5653 -#include <com/sun/star/style/LineSpacingMode.hpp>
5654 #ifndef _COM_SUN_STAR_STYLE_XSTYLEFAMILIESSUPPLIER_PP_
5655 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
5656 #endif
5657 @@ -154,9 +150,6 @@ using namespace ::com::sun::star;
5659 // ---------------------------------------------------------------------------------------------
5661 -com::sun::star::uno::Reference< com::sun::star::i18n::XBreakIterator > xPPTBreakIter;
5662 -com::sun::star::uno::Reference< com::sun::star::i18n::XScriptTypeDetector > xScriptTypeDetector;
5664 PPTExBulletProvider::PPTExBulletProvider()
5666 pGraphicProv = new EscherGraphicProvider( _E_GRAPH_PROV_USE_INSTANCES | _E_GRAPH_PROV_DO_NOT_ROTATE_METAFILES );
5667 @@ -215,219 +208,6 @@ sal_uInt16 PPTExBulletProvider::GetId( const ByteString& rUniqueId, Size& rGraph
5669 // ---------------------------------------------------------------------------------------------
5671 -GroupTable::GroupTable() :
5672 - mnCurrentGroupEntry ( 0 ),
5673 - mnMaxGroupEntry ( 0 ),
5674 - mnGroupsClosed ( 0 ),
5675 - mpGroupEntry ( NULL )
5677 - ImplResizeGroupTable( 32 );
5680 -// ---------------------------------------------------------------------------------------------
5682 -GroupTable::~GroupTable()
5684 - for ( sal_uInt32 i = 0; i < mnCurrentGroupEntry; delete mpGroupEntry[ i++ ] ) ;
5685 - delete[] mpGroupEntry;
5688 -// ---------------------------------------------------------------------------------------------
5690 -void GroupTable::ImplResizeGroupTable( sal_uInt32 nEntrys )
5692 - if ( nEntrys > mnMaxGroupEntry )
5694 - mnMaxGroupEntry = nEntrys;
5695 - GroupEntry** pTemp = new GroupEntry*[ nEntrys ];
5696 - for ( sal_uInt32 i = 0; i < mnCurrentGroupEntry; i++ )
5697 - pTemp[ i ] = mpGroupEntry[ i ];
5698 - if ( mpGroupEntry )
5699 - delete[] mpGroupEntry;
5700 - mpGroupEntry = pTemp;
5704 -// ---------------------------------------------------------------------------------------------
5706 -sal_Bool GroupTable::EnterGroup( ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& rXIndexAccessRef )
5708 - sal_Bool bRet = sal_False;
5709 - if ( rXIndexAccessRef.is() )
5711 - GroupEntry* pNewGroup = new GroupEntry( rXIndexAccessRef );
5712 - if ( pNewGroup->mnCount )
5714 - if ( mnMaxGroupEntry == mnCurrentGroupEntry )
5715 - ImplResizeGroupTable( mnMaxGroupEntry + 8 );
5716 - mpGroupEntry[ mnCurrentGroupEntry++ ] = pNewGroup;
5717 - bRet = sal_True;
5719 - else
5720 - delete pNewGroup;
5722 - return bRet;
5725 -// ---------------------------------------------------------------------------------------------
5727 -sal_uInt32 GroupTable::GetGroupsClosed()
5729 - sal_uInt32 nRet = mnGroupsClosed;
5730 - mnGroupsClosed = 0;
5731 - return nRet;
5734 -// ---------------------------------------------------------------------------------------------
5736 -void GroupTable::ClearGroupTable()
5738 - for ( sal_uInt32 i = 0; i < mnCurrentGroupEntry; i++, delete mpGroupEntry[ i ] ) ;
5739 - mnCurrentGroupEntry = 0;
5742 -// ---------------------------------------------------------------------------------------------
5744 -void GroupTable::ResetGroupTable( sal_uInt32 nCount )
5746 - ClearGroupTable();
5747 - mpGroupEntry[ mnCurrentGroupEntry++ ] = new GroupEntry( nCount );
5750 -// ---------------------------------------------------------------------------------------------
5752 -sal_Bool GroupTable::GetNextGroupEntry()
5754 - while ( mnCurrentGroupEntry )
5756 - mnIndex = mpGroupEntry[ mnCurrentGroupEntry - 1 ]->mnCurrentPos++;
5758 - if ( mpGroupEntry[ mnCurrentGroupEntry - 1 ]->mnCount > mnIndex )
5759 - return TRUE;
5761 - delete ( mpGroupEntry[ --mnCurrentGroupEntry ] );
5763 - if ( mnCurrentGroupEntry )
5764 - mnGroupsClosed++;
5766 - return FALSE;
5769 -// ---------------------------------------------------------------------------------------------
5771 -void GroupTable::SkipCurrentGroup()
5773 - if ( mnCurrentGroupEntry )
5774 - delete ( mpGroupEntry[ --mnCurrentGroupEntry ] );
5777 -// ---------------------------------------------------------------------------------------------
5779 -FontCollectionEntry::~FontCollectionEntry()
5783 -// ---------------------------------------------------------------------------------------------
5785 -void FontCollectionEntry::ImplInit( const String& rName )
5787 - String aSubstName( GetSubsFontName( rName, SUBSFONT_ONLYONE | SUBSFONT_MS ) );
5788 - if ( aSubstName.Len() )
5790 - Name = aSubstName;
5791 - bIsConverted = sal_True;
5793 - else
5795 - Name = rName;
5796 - bIsConverted = sal_False;
5800 -FontCollection::~FontCollection()
5802 - for( void* pStr = List::First(); pStr; pStr = List::Next() )
5803 - delete (FontCollectionEntry*)pStr;
5804 - delete pVDev;
5805 - xPPTBreakIter = NULL;
5806 - xScriptTypeDetector = NULL;
5809 -FontCollection::FontCollection() :
5810 - pVDev ( NULL )
5812 - com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
5813 - xMSF = ::comphelper::getProcessServiceFactory();
5814 - com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
5815 - xInterface = xMSF->createInstance( rtl::OUString::createFromAscii( "com.sun.star.i18n.BreakIterator" ) );
5816 - if ( xInterface.is() )
5817 - xPPTBreakIter = com::sun::star::uno::Reference< com::sun::star::i18n::XBreakIterator >
5818 - ( xInterface, com::sun::star::uno::UNO_QUERY );
5820 - xInterface = xMSF->createInstance( rtl::OUString::createFromAscii( "com.sun.star.i18n.ScriptTypeDetector" ) );
5821 - if ( xInterface.is() )
5822 - xScriptTypeDetector = com::sun::star::uno::Reference< com::sun::star::i18n::XScriptTypeDetector >
5823 - ( xInterface, com::sun::star::uno::UNO_QUERY );
5826 -short FontCollection::GetScriptDirection( const String& rString ) const
5828 - short nRet = com::sun::star::i18n::ScriptDirection::NEUTRAL;
5829 - if ( xScriptTypeDetector.is() )
5831 - const rtl::OUString sT( rString );
5832 - nRet = xScriptTypeDetector->getScriptDirection( sT, 0, com::sun::star::i18n::ScriptDirection::NEUTRAL );
5834 - return nRet;
5837 -sal_uInt32 FontCollection::GetId( FontCollectionEntry& rEntry )
5839 - if( rEntry.Name.Len() )
5841 - const sal_uInt32 nFonts = GetCount();
5843 - for( sal_uInt32 i = 0; i < nFonts; i++ )
5845 - const FontCollectionEntry* pEntry = GetById( i );
5846 - if( pEntry->Name == rEntry.Name )
5847 - return i;
5849 - Font aFont;
5850 - aFont.SetCharSet( rEntry.CharSet );
5851 - aFont.SetName( rEntry.Original );
5852 -// aFont.SetFamily( rEntry.Family );
5853 -// aFont.SetPitch( rEntry.Pitch );
5854 - aFont.SetHeight( 100 );
5856 - if ( !pVDev )
5857 - pVDev = new VirtualDevice;
5859 - pVDev->SetFont( aFont );
5860 - FontMetric aMetric( pVDev->GetFontMetric() );
5862 - sal_uInt16 nTxtHeight = (sal_uInt16)aMetric.GetAscent() + (sal_uInt16)aMetric.GetDescent();
5864 - if ( nTxtHeight )
5866 - double fScaling = (double)nTxtHeight / 120.0;
5867 - if ( ( fScaling > 0.50 ) && ( fScaling < 1.5 ) )
5868 - rEntry.Scaling = fScaling;
5871 - List::Insert( new FontCollectionEntry( rEntry ), LIST_APPEND );
5872 - return nFonts;
5874 - return 0;
5877 -const FontCollectionEntry* FontCollection::GetById( sal_uInt32 nId )
5879 - return (FontCollectionEntry*)List::GetObject( nId );
5882 -// ---------------------------------------------------------------------------------------------
5884 sal_uInt32 PPTWriter::ImplVBAInfoContainer( SvStream* pStrm )
5886 sal_uInt32 nSize = 28;
5887 @@ -977,360 +757,6 @@ sal_Bool PropStateValue::ImplGetPropertyValue( const String& rString, sal_Bool b
5889 // ---------------------------------------------------------------------------------------------
5891 -sal_Bool PPTWriter::ImplInitSOIface()
5893 - while( TRUE )
5895 - mXDrawPagesSupplier = ::com::sun::star::uno::Reference<
5896 - ::com::sun::star::drawing::XDrawPagesSupplier >
5897 - ( mXModel, ::com::sun::star::uno::UNO_QUERY );
5898 - if ( !mXDrawPagesSupplier.is() )
5899 - break;
5901 - mXMasterPagesSupplier = ::com::sun::star::uno::Reference<
5902 - ::com::sun::star::drawing::XMasterPagesSupplier >
5903 - ( mXModel, ::com::sun::star::uno::UNO_QUERY );
5904 - if ( !mXMasterPagesSupplier.is() )
5905 - break;
5906 - mXDrawPages = mXMasterPagesSupplier->getMasterPages();
5907 - if ( !mXDrawPages.is() )
5908 - break;
5909 - mnMasterPages = mXDrawPages->getCount();
5910 - mXDrawPages = mXDrawPagesSupplier->getDrawPages();
5911 - if( !mXDrawPages.is() )
5912 - break;
5913 - mnPages = mXDrawPages->getCount();
5914 - if ( !ImplGetPageByIndex( 0, NORMAL ) )
5915 - break;
5917 - return TRUE;
5919 - return FALSE;
5922 -// ---------------------------------------------------------------------------------------------
5924 -sal_Bool PPTWriter::ImplSetCurrentStyleSheet( sal_uInt32 nPageNum )
5926 - sal_Bool bRet = sal_False;
5927 - if ( nPageNum >= maStyleSheetList.size() )
5928 - nPageNum = 0;
5929 - else
5930 - bRet = sal_True;
5931 - mpStyleSheet = maStyleSheetList[ nPageNum ];
5932 - return bRet;
5935 -// ---------------------------------------------------------------------------------------------
5937 -sal_Bool PPTWriter::ImplGetPageByIndex( sal_uInt32 nIndex, PageType ePageType )
5939 - while( TRUE )
5941 - if ( ePageType != meLatestPageType )
5943 - switch( ePageType )
5945 - case NORMAL :
5946 - case NOTICE :
5948 - mXDrawPages = mXDrawPagesSupplier->getDrawPages();
5949 - if( !mXDrawPages.is() )
5950 - return FALSE;
5952 - break;
5954 - case MASTER :
5956 - mXDrawPages = mXMasterPagesSupplier->getMasterPages();
5957 - if( !mXDrawPages.is() )
5958 - return FALSE;
5960 - break;
5961 - default:
5962 - break;
5964 - meLatestPageType = ePageType;
5966 - ::com::sun::star::uno::Any aAny( mXDrawPages->getByIndex( nIndex ) );
5967 - aAny >>= mXDrawPage;
5968 - if ( !mXDrawPage.is() )
5969 - break;
5970 - if ( ePageType == NOTICE )
5972 - ::com::sun::star::uno::Reference< ::com::sun::star::presentation::XPresentationPage >
5973 - aXPresentationPage( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
5974 - if ( !aXPresentationPage.is() )
5975 - break;
5976 - mXDrawPage = aXPresentationPage->getNotesPage();
5977 - if ( !mXDrawPage.is() )
5978 - break;
5980 - mXPagePropSet = ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
5981 - ( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
5982 - if ( !mXPagePropSet.is() )
5983 - break;
5985 - mXShapes = ::com::sun::star::uno::Reference<
5986 - ::com::sun::star::drawing::XShapes >
5987 - ( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
5988 - if ( !mXShapes.is() )
5989 - break;
5991 - /* try to get the "real" background PropertySet. If the normal page is not supporting this property, it is
5992 - taken the property from the master */
5993 - sal_Bool bHasBackground = GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Background" ) ), sal_True );
5994 - if ( bHasBackground )
5995 - bHasBackground = ( aAny >>= mXBackgroundPropSet );
5996 - if ( !bHasBackground )
5998 - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XMasterPageTarget >
5999 - aXMasterPageTarget( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
6000 - if ( aXMasterPageTarget.is() )
6002 - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > aXMasterDrawPage;
6003 - aXMasterDrawPage = aXMasterPageTarget->getMasterPage();
6004 - if ( aXMasterDrawPage.is() )
6006 - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > aXMasterPagePropSet;
6007 - aXMasterPagePropSet = ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
6008 - ( aXMasterDrawPage, ::com::sun::star::uno::UNO_QUERY );
6009 - if ( aXMasterPagePropSet.is() )
6011 - sal_Bool bBackground = GetPropertyValue( aAny, aXMasterPagePropSet,
6012 - String( RTL_CONSTASCII_USTRINGPARAM( "Background" ) ) );
6013 - if ( bBackground )
6015 - aAny >>= mXBackgroundPropSet;
6021 - return TRUE;
6023 - return FALSE;
6026 -// ---------------------------------------------------------------------------------------------
6028 -sal_Bool PPTWriter::ImplGetShapeByIndex( sal_uInt32 nIndex, sal_Bool bGroup )
6030 - while(TRUE)
6032 - if ( ( bGroup == FALSE ) || ( GetCurrentGroupLevel() == 0 ) )
6034 - ::com::sun::star::uno::Any aAny( mXShapes->getByIndex( nIndex ) );
6035 - aAny >>= mXShape;
6037 - else
6039 - ::com::sun::star::uno::Any aAny( GetCurrentGroupAccess()->getByIndex( GetCurrentGroupIndex() ) );
6040 - aAny >>= mXShape;
6042 - if ( !mXShape.is() )
6043 - break;
6045 - ::com::sun::star::uno::Any aAny( mXShape->queryInterface( ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >*) 0 ) ));
6046 - aAny >>= mXPropSet;
6048 - if ( !mXPropSet.is() )
6049 - break;
6050 - maPosition = ImplMapPoint( mXShape->getPosition() );
6051 - maSize = ImplMapSize( mXShape->getSize() );
6052 - maRect = Rectangle( Point( maPosition.X, maPosition.Y ), Size( maSize.Width, maSize.Height ) );
6053 - mType = ByteString( String( mXShape->getShapeType() ), RTL_TEXTENCODING_UTF8 );
6054 - mType.Erase( 0, 13 ); // "com.sun.star." entfernen
6055 - sal_uInt16 nPos = mType.Search( (const char*)"Shape" );
6056 - mType.Erase( nPos, 5 );
6058 - mbPresObj = mbEmptyPresObj = FALSE;
6059 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsPresentationObject" ) ) ) )
6060 - mAny >>= mbPresObj;
6062 - if ( mbPresObj && ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsEmptyPresentationObject" ) ) ) )
6063 - mAny >>= mbEmptyPresObj;
6065 - mnAngle = ( PropValue::GetPropertyValue( aAny,
6066 - mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "RotateAngle" ) ), sal_True ) )
6067 - ? *((sal_Int32*)aAny.getValue() )
6068 - : 0;
6070 - return TRUE;
6072 - return FALSE;
6075 -// -----------------------------------------------------------------------
6077 -sal_uInt32 PPTWriter::ImplGetMasterIndex( PageType ePageType )
6079 - sal_uInt32 nRetValue = 0;
6080 - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XMasterPageTarget >
6081 - aXMasterPageTarget( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
6083 - if ( aXMasterPageTarget.is() )
6085 - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >
6086 - aXDrawPage = aXMasterPageTarget->getMasterPage();
6087 - if ( aXDrawPage.is() )
6089 - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
6090 - aXPropertySet( aXDrawPage, ::com::sun::star::uno::UNO_QUERY );
6092 - if ( aXPropertySet.is() )
6094 - if ( ImplGetPropertyValue( aXPropertySet, String( RTL_CONSTASCII_USTRINGPARAM( "Number" ) ) ) )
6095 - nRetValue |= *(sal_Int16*)mAny.getValue();
6096 - if ( nRetValue & 0xffff ) // ueberlauf vermeiden
6097 - nRetValue--;
6101 - if ( ePageType == NOTICE )
6102 - nRetValue += mnMasterPages;
6103 - return nRetValue;
6106 -// -----------------------------------------------------------------------
6108 -sal_Bool PPTWriter::ImplGetStyleSheets()
6110 - int nInstance, nLevel;
6111 - sal_Bool bRetValue = sal_False;
6112 - sal_uInt32 nPageNum;
6114 - for ( nPageNum = 0; nPageNum < mnMasterPages; nPageNum++ )
6116 - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed >
6117 - aXNamed;
6119 - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
6120 - aXNameAccess;
6122 - ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyleFamiliesSupplier >
6123 - aXStyleFamiliesSupplier( mXModel, ::com::sun::star::uno::UNO_QUERY );
6125 - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
6126 - aXPropSet( mXModel, ::com::sun::star::uno::UNO_QUERY );
6128 - sal_uInt16 nDefaultTab = ( aXPropSet.is() && ImplGetPropertyValue( aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TabStop" ) ) ) )
6129 - ? (sal_uInt16)( *(sal_Int32*)mAny.getValue() / 4.40972 )
6130 - : 1250;
6132 - maStyleSheetList.push_back( new PPTExStyleSheet( nDefaultTab, (PPTExBulletProvider&)*this ) );
6133 - ImplSetCurrentStyleSheet( nPageNum );
6134 - if ( ImplGetPageByIndex( nPageNum, MASTER ) )
6135 - aXNamed = ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed >
6136 - ( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
6138 - if ( aXStyleFamiliesSupplier.is() )
6139 - aXNameAccess = aXStyleFamiliesSupplier->getStyleFamilies();
6141 - bRetValue = aXNamed.is() && aXNameAccess.is() && aXStyleFamiliesSupplier.is();
6142 - if ( bRetValue )
6144 - for ( nInstance = EPP_TEXTTYPE_Title; nInstance <= EPP_TEXTTYPE_CenterTitle; nInstance++ )
6146 - String aStyle;
6147 - String aFamily;
6148 - switch ( nInstance )
6150 - case EPP_TEXTTYPE_CenterTitle :
6151 - case EPP_TEXTTYPE_Title :
6153 - aStyle = String( RTL_CONSTASCII_USTRINGPARAM( "title" ) );
6154 - aFamily = aXNamed->getName();
6156 - break;
6157 - case EPP_TEXTTYPE_Body :
6159 - aStyle = String( RTL_CONSTASCII_USTRINGPARAM( "outline1" ) ); // SD_LT_SEPARATOR
6160 - aFamily = aXNamed->getName();
6162 - break;
6163 - case EPP_TEXTTYPE_Other :
6165 - aStyle = String( RTL_CONSTASCII_USTRINGPARAM( "standard" ) );
6166 - aFamily = String( RTL_CONSTASCII_USTRINGPARAM( "graphics" ) );
6168 - break;
6169 - case EPP_TEXTTYPE_CenterBody :
6171 - aStyle = String( RTL_CONSTASCII_USTRINGPARAM( "subtitle" ) );
6172 - aFamily = aXNamed->getName();
6174 - break;
6176 - if ( aStyle.Len() && aFamily.Len() )
6178 - try
6180 - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >xNameAccess;
6181 - if ( aXNameAccess->hasByName( aFamily ) )
6183 - ::com::sun::star::uno::Any aAny( aXNameAccess->getByName( aFamily ) );
6184 - if( aAny.getValue() && ::cppu::extractInterface( xNameAccess, aAny ) )
6186 - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > aXFamily;
6187 - if ( aAny >>= aXFamily )
6189 - if ( aXFamily->hasByName( aStyle ) )
6191 - ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle > xStyle;
6192 - aAny = aXFamily->getByName( aStyle );
6193 - if( aAny.getValue() && ::cppu::extractInterface( xStyle, aAny ) )
6195 - ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle > aXStyle;
6196 - aAny >>= aXStyle;
6197 - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
6198 - xPropSet( aXStyle, ::com::sun::star::uno::UNO_QUERY );
6199 - if( xPropSet.is() )
6200 - mpStyleSheet->SetStyleSheet( xPropSet, maFontCollection, nInstance, 0 );
6201 - for ( nLevel = 1; nLevel < 5; nLevel++ )
6203 - if ( nInstance == EPP_TEXTTYPE_Body )
6205 - sal_Unicode cTemp = aStyle.GetChar( aStyle.Len() - 1 );
6206 - aStyle.SetChar( aStyle.Len() - 1, ++cTemp );
6207 - if ( aXFamily->hasByName( aStyle ) )
6209 - aXFamily->getByName( aStyle ) >>= xStyle;
6210 - if( xStyle.is() )
6212 - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
6213 - xPropertySet( xStyle, ::com::sun::star::uno::UNO_QUERY );
6214 - if ( xPropertySet.is() )
6215 - mpStyleSheet->SetStyleSheet( xPropertySet, maFontCollection, nInstance, nLevel );
6219 - else
6220 - mpStyleSheet->SetStyleSheet( xPropSet, maFontCollection, nInstance, nLevel );
6228 - catch( ::com::sun::star::uno::Exception& )
6230 - //
6234 - for ( ; nInstance <= EPP_TEXTTYPE_QuarterBody; nInstance++ )
6240 - return bRetValue;
6243 -// -----------------------------------------------------------------------
6245 void PPTWriter::ImplWriteParagraphs( SvStream& rOut, TextObj& rTextObj )
6247 sal_Bool bFirstParagraph = TRUE;
6248 @@ -1707,1385 +1133,6 @@ void PPTWriter::ImplFlipBoundingBox( EscherPropertyContainer& rPropOpt )
6250 // -----------------------------------------------------------------------
6252 -struct FieldEntry
6254 - sal_uInt32 nFieldType;
6255 - sal_uInt32 nFieldStartPos;
6256 - sal_uInt32 nFieldEndPos;
6257 - String aRepresentation;
6258 - String aFieldUrl;
6260 - FieldEntry( sal_uInt32 nType, sal_uInt32 nStart, sal_uInt32 nEnd )
6262 - nFieldType = nType;
6263 - nFieldStartPos = nStart;
6264 - nFieldEndPos = nEnd;
6268 -// -----------------------------------------------------------------------
6270 -PortionObj::PortionObj( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
6271 - FontCollection& rFontCollection ) :
6272 - mnCharAttrHard ( 0 ),
6273 - mnCharAttr ( 0 ),
6274 - mnFont ( 0 ),
6275 - mnAsianOrComplexFont( 0xffff ),
6276 - mnTextSize ( 0 ),
6277 - mbLastPortion ( TRUE ),
6278 - mpText ( NULL ),
6279 - mpFieldEntry ( NULL )
6281 - mXPropSet = rXPropSet;
6283 - ImplGetPortionValues( rFontCollection, FALSE );
6286 -PortionObj::PortionObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & rXTextRange,
6287 - sal_Bool bLast, FontCollection& rFontCollection ) :
6288 - mnCharAttrHard ( 0 ),
6289 - mnCharAttr ( 0 ),
6290 - mnFont ( 0 ),
6291 - mnAsianOrComplexFont ( 0xffff ),
6292 - mbLastPortion ( bLast ),
6293 - mpText ( NULL ),
6294 - mpFieldEntry ( NULL )
6296 - String aString( rXTextRange->getString() );
6297 - String aURL;
6298 - BOOL bRTL_endingParen = FALSE;
6300 - mnTextSize = aString.Len();
6301 - if ( bLast )
6302 - mnTextSize++;
6304 - if ( mnTextSize )
6306 - mpFieldEntry = NULL;
6307 - sal_uInt32 nFieldType = 0;
6309 - mXPropSet = ::com::sun::star::uno::Reference<
6310 - ::com::sun::star::beans::XPropertySet >
6311 - ( rXTextRange, ::com::sun::star::uno::UNO_QUERY );
6312 - mXPropState = ::com::sun::star::uno::Reference<
6313 - ::com::sun::star::beans::XPropertyState >
6314 - ( rXTextRange, ::com::sun::star::uno::UNO_QUERY );
6316 - sal_Bool bPropSetsValid = ( mXPropSet.is() && mXPropState.is() );
6317 - if ( bPropSetsValid )
6318 - nFieldType = ImplGetTextField( rXTextRange, mXPropSet, aURL );
6319 - if ( nFieldType )
6321 - mpFieldEntry = new FieldEntry( nFieldType, 0, mnTextSize );
6322 - if ( ( nFieldType >> 28 == 4 ) )
6324 - mpFieldEntry->aRepresentation = aString;
6325 - mpFieldEntry->aFieldUrl = aURL;
6328 - sal_Bool bSymbol = FALSE;
6330 - if ( bPropSetsValid && ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontCharSet" ) ), FALSE ) )
6332 - sal_Int16 nCharset;
6333 - mAny >>= nCharset;
6334 - if ( nCharset == ::com::sun::star::awt::CharSet::SYMBOL )
6335 - bSymbol = TRUE;
6337 - if ( mpFieldEntry && ( nFieldType & 0x800000 ) ) // placeholder ?
6339 - mnTextSize = 1;
6340 - if ( bLast )
6341 - mnTextSize++;
6342 - mpText = new sal_uInt16[ mnTextSize ];
6343 - mpText[ 0 ] = 0x2a;
6345 - else
6347 - const sal_Unicode* pText = aString.GetBuffer();
6348 - // For i39516 - a closing parenthesis that ends an RTL string is displayed backwards by PPT
6349 - // Solution: add a Unicode Right-to-Left Mark, following the method described in i18024
6350 - if ( bLast && pText[ aString.Len() - 1 ] == sal_Unicode(')') && rFontCollection.GetScriptDirection( aString ) == com::sun::star::i18n::ScriptDirection::RIGHT_TO_LEFT )
6352 - mnTextSize++;
6353 - bRTL_endingParen = TRUE;
6355 - mpText = new sal_uInt16[ mnTextSize ];
6356 - sal_uInt16 nChar;
6357 - for ( int i = 0; i < aString.Len(); i++ )
6359 - nChar = (sal_uInt16)pText[ i ];
6360 - if ( nChar == 0xa )
6361 - nChar++;
6362 - else if ( !bSymbol )
6364 - switch ( nChar )
6366 - // Currency
6367 - case 128: nChar = 0x20AC; break;
6368 - // Punctuation and other
6369 - case 130: nChar = 0x201A; break;// SINGLE LOW-9 QUOTATION MARK
6370 - case 131: nChar = 0x0192; break;// LATIN SMALL LETTER F WITH HOOK
6371 - case 132: nChar = 0x201E; break;// DOUBLE LOW-9 QUOTATION MARK
6372 - // LOW DOUBLE PRIME QUOTATION MARK
6373 - case 133: nChar = 0x2026; break;// HORIZONTAL ELLIPSES
6374 - case 134: nChar = 0x2020; break;// DAGGER
6375 - case 135: nChar = 0x2021; break;// DOUBLE DAGGER
6376 - case 136: nChar = 0x02C6; break;// MODIFIER LETTER CIRCUMFLEX ACCENT
6377 - case 137: nChar = 0x2030; break;// PER MILLE SIGN
6378 - case 138: nChar = 0x0160; break;// LATIN CAPITAL LETTER S WITH CARON
6379 - case 139: nChar = 0x2039; break;// SINGLE LEFT-POINTING ANGLE QUOTATION MARK
6380 - case 140: nChar = 0x0152; break;// LATIN CAPITAL LIGATURE OE
6381 - case 142: nChar = 0x017D; break;// LATIN CAPITAL LETTER Z WITH CARON
6382 - case 145: nChar = 0x2018; break;// LEFT SINGLE QUOTATION MARK
6383 - // MODIFIER LETTER TURNED COMMA
6384 - case 146: nChar = 0x2019; break;// RIGHT SINGLE QUOTATION MARK
6385 - // MODIFIER LETTER APOSTROPHE
6386 - case 147: nChar = 0x201C; break;// LEFT DOUBLE QUOTATION MARK
6387 - // REVERSED DOUBLE PRIME QUOTATION MARK
6388 - case 148: nChar = 0x201D; break;// RIGHT DOUBLE QUOTATION MARK
6389 - // REVERSED DOUBLE PRIME QUOTATION MARK
6390 - case 149: nChar = 0x2022; break;// BULLET
6391 - case 150: nChar = 0x2013; break;// EN DASH
6392 - case 151: nChar = 0x2014; break;// EM DASH
6393 - case 152: nChar = 0x02DC; break;// SMALL TILDE
6394 - case 153: nChar = 0x2122; break;// TRADE MARK SIGN
6395 - case 154: nChar = 0x0161; break;// LATIN SMALL LETTER S WITH CARON
6396 - case 155: nChar = 0x203A; break;// SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
6397 - case 156: nChar = 0x0153; break;// LATIN SMALL LIGATURE OE
6398 - case 158: nChar = 0x017E; break;// LATIN SMALL LETTER Z WITH CARON
6399 - case 159: nChar = 0x0178; break;// LATIN CAPITAL LETTER Y WITH DIAERESIS
6400 -// case 222: nChar = 0x00B6; break;// PILCROW SIGN / PARAGRAPH SIGN
6403 - mpText[ i ] = nChar;
6406 - if ( bRTL_endingParen )
6407 - mpText[ mnTextSize - 2 ] = 0x200F; // Unicode Right-to-Left mark
6409 - if ( bLast )
6410 - mpText[ mnTextSize - 1 ] = 0xd;
6412 - if ( bPropSetsValid )
6413 - ImplGetPortionValues( rFontCollection, TRUE );
6417 -PortionObj::PortionObj( PortionObj& rPortionObj )
6418 -: PropStateValue( rPortionObj )
6420 - ImplConstruct( rPortionObj );
6423 -PortionObj::~PortionObj()
6425 - ImplClear();
6428 -void PortionObj::Write( SvStream* pStrm, sal_Bool bLast )
6430 - sal_uInt32 nCount = mnTextSize;
6431 - if ( bLast && mbLastPortion )
6432 - nCount--;
6433 - for ( sal_uInt32 i = 0; i < nCount; i++ )
6434 - *pStrm << (sal_uInt16)mpText[ i ];
6437 -void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool bGetPropStateValue )
6440 - sal_Bool bOk = ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontName" ) ), bGetPropStateValue );
6441 - meFontName = ePropState;
6442 - if ( bOk )
6444 - FontCollectionEntry aFontDesc( *(::rtl::OUString*)mAny.getValue() );
6445 - sal_uInt32 nCount = rFontCollection.GetCount();
6446 - mnFont = (sal_uInt16)rFontCollection.GetId( aFontDesc );
6447 - if ( mnFont == nCount )
6449 - FontCollectionEntry& rFontDesc = rFontCollection.GetLast();
6450 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontCharSet" ) ), sal_False ) )
6451 - mAny >>= rFontDesc.CharSet;
6452 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontFamily" ) ), sal_False ) )
6453 - mAny >>= rFontDesc.Family;
6454 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontPitch" ) ), sal_False ) )
6455 - mAny >>= rFontDesc.Pitch;
6459 - sal_Int16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( Application::GetSettings().GetLanguage() );
6460 - if ( mpText && mnTextSize && xPPTBreakIter.is() )
6462 - rtl::OUString sT( mpText, mnTextSize );
6463 - nScriptType = xPPTBreakIter->getScriptType( sT, 0 );
6465 - if ( nScriptType != com::sun::star::i18n::ScriptType::COMPLEX )
6467 - bOk = ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontNameAsian" ) ), bGetPropStateValue );
6468 - meAsianOrComplexFont = ePropState;
6469 - if ( bOk )
6471 - FontCollectionEntry aFontDesc( *(::rtl::OUString*)mAny.getValue() );
6472 - sal_uInt32 nCount = rFontCollection.GetCount();
6473 - mnAsianOrComplexFont = (sal_uInt16)rFontCollection.GetId( aFontDesc );
6474 - if ( mnAsianOrComplexFont == nCount )
6476 - FontCollectionEntry& rFontDesc = rFontCollection.GetLast();
6477 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontCharSetAsian" ) ), sal_False ) )
6478 - mAny >>= rFontDesc.CharSet;
6479 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontFamilyAsian" ) ), sal_False ) )
6480 - mAny >>= rFontDesc.Family;
6481 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontPitchAsian" ) ), sal_False ) )
6482 - mAny >>= rFontDesc.Pitch;
6486 - else
6488 - bOk = ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontNameComplex" ) ), bGetPropStateValue );
6489 - meAsianOrComplexFont = ePropState;
6490 - if ( bOk )
6492 - FontCollectionEntry aFontDesc( *(::rtl::OUString*)mAny.getValue() );
6493 - sal_uInt32 nCount = rFontCollection.GetCount();
6494 - mnAsianOrComplexFont = (sal_uInt16)rFontCollection.GetId( aFontDesc );
6495 - if ( mnAsianOrComplexFont == nCount )
6497 - FontCollectionEntry& rFontDesc = rFontCollection.GetLast();
6498 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontCharSetComplex" ) ), sal_False ) )
6499 - mAny >>= rFontDesc.CharSet;
6500 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontFamilyComplex" ) ), sal_False ) )
6501 - mAny >>= rFontDesc.Family;
6502 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontPitchComplex" ) ), sal_False ) )
6503 - mAny >>= rFontDesc.Pitch;
6508 - if ( nScriptType != com::sun::star::i18n::ScriptType::COMPLEX )
6510 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharWeight" ) ), bGetPropStateValue ) )
6512 - float fFloat;
6513 - mAny >>= fFloat;
6514 - if ( fFloat >= ::com::sun::star::awt::FontWeight::SEMIBOLD )
6515 - mnCharAttr |= 1;
6518 - else
6520 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharWeightComplex" ) ), bGetPropStateValue ) )
6522 - float fFloat;
6523 - mAny >>= fFloat;
6524 - if ( fFloat >= ::com::sun::star::awt::FontWeight::SEMIBOLD )
6525 - mnCharAttr |= 1;
6529 - if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
6530 - mnCharAttrHard |= 1;
6532 - if ( nScriptType != com::sun::star::i18n::ScriptType::COMPLEX )
6534 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharPosture" ) ), bGetPropStateValue ) )
6536 - ::com::sun::star::awt::FontSlant aFS;
6537 - mAny >>= aFS;
6538 - switch ( aFS )
6540 - case ::com::sun::star::awt::FontSlant_OBLIQUE :
6541 - case ::com::sun::star::awt::FontSlant_ITALIC :
6542 - mnCharAttr |= 2;
6543 - break;
6544 - default:
6545 - break;
6549 - else
6551 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharPostureComplex" ) ), bGetPropStateValue ) )
6553 - ::com::sun::star::awt::FontSlant aFS;
6554 - mAny >>= aFS;
6555 - switch ( aFS )
6557 - case ::com::sun::star::awt::FontSlant_OBLIQUE :
6558 - case ::com::sun::star::awt::FontSlant_ITALIC :
6559 - mnCharAttr |= 2;
6560 - break;
6561 - default:
6562 - break;
6567 - if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
6568 - mnCharAttrHard |= 2;
6570 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharUnderline" ) ), bGetPropStateValue ) )
6572 - sal_Int16 nVal;
6573 - mAny >>= nVal;
6574 - switch ( nVal )
6576 - case ::com::sun::star::awt::FontUnderline::SINGLE :
6577 - case ::com::sun::star::awt::FontUnderline::DOUBLE :
6578 - case ::com::sun::star::awt::FontUnderline::DOTTED :
6579 - mnCharAttr |= 4;
6582 - if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
6583 - mnCharAttrHard |= 4;
6585 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharShadowed" ) ), bGetPropStateValue ) )
6587 - sal_Bool bBool;
6588 - mAny >>= bBool;
6589 - if ( bBool )
6590 - mnCharAttr |= 0x10;
6592 - if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
6593 - mnCharAttrHard |= 16;
6595 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharLocale" ) ), bGetPropStateValue ) )
6597 - com::sun::star::lang::Locale eLocale;
6598 - if ( mAny >>= eLocale )
6599 - meCharLocale = eLocale;
6602 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharRelief" ) ), bGetPropStateValue ) )
6604 - sal_Int16 nVal;
6605 - mAny >>= nVal;
6606 - if ( nVal != ::com::sun::star::text::FontRelief::NONE )
6607 - mnCharAttr |= 512;
6609 - if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
6610 - mnCharAttrHard |= 512;
6612 - mnCharHeight = 24;
6613 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharHeight" ) ), bGetPropStateValue ) )
6615 - float fVal;
6616 - mAny >>= fVal;
6617 - mnCharHeight = (sal_uInt16)( fVal + 0.5 );
6619 - meCharHeight = ePropState;
6621 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharColor" ) ), bGetPropStateValue ) )
6623 - sal_uInt32 nSOColor = *( (sal_uInt32*)mAny.getValue() );
6624 - mnCharColor = nSOColor & 0xff00ff00; // green and hibyte
6625 - mnCharColor |= (sal_uInt8)( nSOColor ) << 16; // red and blue is switched
6626 - mnCharColor |= (sal_uInt8)( nSOColor >> 16 );
6628 - meCharColor = ePropState;
6630 - mnCharEscapement = 0;
6631 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharEscapement" ) ), bGetPropStateValue ) )
6633 - mAny >>= mnCharEscapement;
6634 - if ( mnCharEscapement > 100 )
6635 - mnCharEscapement = 33;
6636 - else if ( mnCharEscapement < -100 )
6637 - mnCharEscapement = -33;
6639 - meCharEscapement = ePropState;
6642 -void PortionObj::ImplClear()
6644 - delete (FieldEntry*)mpFieldEntry;
6645 - delete[] mpText;
6648 -void PortionObj::ImplConstruct( PortionObj& rPortionObj )
6650 - mbLastPortion = rPortionObj.mbLastPortion;
6651 - mnTextSize = rPortionObj.mnTextSize;
6652 - mnCharColor = rPortionObj.mnCharColor;
6653 - mnCharEscapement = rPortionObj.mnCharEscapement;
6654 - mnCharAttr = rPortionObj.mnCharAttr;
6655 - mnCharHeight = rPortionObj.mnCharHeight;
6656 - mnFont = rPortionObj.mnFont;
6657 - mnAsianOrComplexFont = rPortionObj.mnAsianOrComplexFont;
6659 - if ( rPortionObj.mpText )
6661 - mpText = new sal_uInt16[ mnTextSize ];
6662 - memcpy( mpText, rPortionObj.mpText, mnTextSize << 1 );
6664 - else
6665 - mpText = NULL;
6667 - if ( rPortionObj.mpFieldEntry )
6668 - mpFieldEntry = new FieldEntry( *( rPortionObj.mpFieldEntry ) );
6669 - else
6670 - mpFieldEntry = NULL;
6673 -sal_uInt32 PortionObj::ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition )
6675 - if ( mpFieldEntry && ( !mpFieldEntry->nFieldStartPos ) )
6677 - mpFieldEntry->nFieldStartPos += nCurrentTextPosition;
6678 - mpFieldEntry->nFieldEndPos += nCurrentTextPosition;
6680 - return mnTextSize;
6683 -// -----------------------------------------------------------------------
6684 -// Rueckgabe: 0 = kein TextField
6685 -// bit28->31 text field type :
6686 -// 1 = Date
6687 -// 2 = Time
6688 -// 3 = SlideNumber
6689 -// 4 = Url
6690 -// 5 = DateTime
6691 -// 6 = header
6692 -// 7 = footer
6693 -// bit24->27 text field sub type (optional)
6694 -// 23-> PPT Textfield needs a placeholder
6696 -sal_uInt32 PortionObj::ImplGetTextField( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & ,
6697 - const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet, String& rURL )
6699 - sal_uInt32 nRetValue = 0;
6700 - sal_Int32 nFormat;
6701 - ::com::sun::star::uno::Any aAny;
6702 - if ( GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextPortionType" ) ), sal_True ) )
6704 - String aTextFieldType( *(::rtl::OUString*)aAny.getValue() );
6705 - if ( aTextFieldType == String( RTL_CONSTASCII_USTRINGPARAM( "TextField" ) ) )
6707 - if ( GetPropertyValue( aAny, rXPropSet, aTextFieldType, sal_True ) )
6709 - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextField > aXTextField;
6710 - if ( aAny >>= aXTextField )
6712 - if ( aXTextField.is() )
6714 - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
6715 - xFieldPropSet( aXTextField, ::com::sun::star::uno::UNO_QUERY );
6716 - if ( xFieldPropSet.is() )
6718 - String aFieldKind( aXTextField->getPresentation( TRUE ) );
6719 - if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "Date" ) ) )
6721 - if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsFix" ) ) ), sal_True )
6723 - sal_Bool bBool;
6724 - aAny >>= bBool;
6725 - if ( !bBool ) // Fixed DateFields gibt es in PPT nicht
6727 - if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Format" ) ) ), sal_True )
6729 - nFormat = *(sal_Int32*)aAny.getValue();
6730 - switch ( nFormat )
6732 - default:
6733 - case 5 :
6734 - case 4 :
6735 - case 2 : nFormat = 0; break;
6736 - case 8 :
6737 - case 9 :
6738 - case 3 : nFormat = 1; break;
6739 - case 7 :
6740 - case 6 : nFormat = 2; break;
6742 - nRetValue |= ( ( ( 1 << 4 ) | nFormat ) << 24 ) | 0x800000;
6747 - else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) )
6749 - if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) ), sal_True )
6750 - rURL = String( *(::rtl::OUString*)aAny.getValue() );
6751 - nRetValue = 4 << 28;
6753 - else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "Page" ) ) )
6755 - nRetValue = 3 << 28 | 0x800000;
6757 - else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "Pages" ) ) )
6761 - else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "Time" ) ) )
6763 - if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsFix" ) ) ), sal_True )
6765 - sal_Bool bBool;
6766 - aAny >>= bBool;
6767 - if ( !bBool )
6769 - if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsFix" ) ) ), sal_True )
6771 - nFormat = *(sal_Int32*)aAny.getValue();
6772 - nRetValue |= ( ( ( 2 << 4 ) | nFormat ) << 24 ) | 0x800000;
6777 - else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "File" ) ) )
6781 - else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "Table" ) ) )
6785 - else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "ExtTime" ) ) )
6787 - if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsFix" ) ) ), sal_True )
6789 - sal_Bool bBool;
6790 - aAny >>= bBool;
6791 - if ( !bBool )
6793 - if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Format" ) ) ), sal_True )
6795 - nFormat = *(sal_Int32*)aAny.getValue();
6796 - switch ( nFormat )
6798 - default:
6799 - case 6 :
6800 - case 7 :
6801 - case 8 :
6802 - case 2 : nFormat = 12; break;
6803 - case 3 : nFormat = 9; break;
6804 - case 5 :
6805 - case 4 : nFormat = 10; break;
6808 - nRetValue |= ( ( ( 2 << 4 ) | nFormat ) << 24 ) | 0x800000;
6813 - else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "ExtFile" ) ) )
6817 - else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "Author" ) ) )
6821 - else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "DateTime" ) ) )
6823 - nRetValue = 5 << 28 | 0x800000;
6825 - else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "Header" ) ) )
6827 - nRetValue = 6 << 28 | 0x800000;
6829 - else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "Footer" ) ) )
6831 - nRetValue = 7 << 28 | 0x800000;
6839 - return nRetValue;
6842 -PortionObj& PortionObj::operator=( PortionObj& rPortionObj )
6844 - if ( this != &rPortionObj )
6846 - ImplClear();
6847 - ImplConstruct( rPortionObj );
6849 - return *this;
6852 -// -----------------------------------------------------------------------
6854 -ParagraphObj::ParagraphObj( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
6855 - PPTExBulletProvider& rProv ) :
6856 - maMapModeSrc ( MAP_100TH_MM ),
6857 - maMapModeDest ( MAP_INCH, Point(), Fraction( 1, 576 ), Fraction( 1, 576 ) )
6859 - mXPropSet = rXPropSet;
6861 - bExtendedParameters = FALSE;
6863 - nDepth = 0;
6864 - nBulletFlags = 0;
6865 - nParaFlags = 0;
6867 - ImplGetParagraphValues( rProv, FALSE );
6870 - ParagraphObj::ParagraphObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > & rXTextContent,
6871 - ParaFlags aParaFlags, FontCollection& rFontCollection, PPTExBulletProvider& rProv ) :
6872 - maMapModeSrc ( MAP_100TH_MM ),
6873 - maMapModeDest ( MAP_INCH, Point(), Fraction( 1, 576 ), Fraction( 1, 576 ) ),
6874 - mbFirstParagraph ( aParaFlags.bFirstParagraph ),
6875 - mbLastParagraph ( aParaFlags.bLastParagraph )
6877 - bExtendedParameters = FALSE;
6879 - nDepth = 0;
6880 - nBulletFlags = 0;
6881 - nParaFlags = 0;
6883 - mXPropSet = ::com::sun::star::uno::Reference<
6884 - ::com::sun::star::beans::XPropertySet >
6885 - ( rXTextContent, ::com::sun::star::uno::UNO_QUERY );
6887 - mXPropState = ::com::sun::star::uno::Reference<
6888 - ::com::sun::star::beans::XPropertyState >
6889 - ( rXTextContent, ::com::sun::star::uno::UNO_QUERY );
6891 - if ( mXPropSet.is() && mXPropState.is() )
6893 - ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess >
6894 - aXTextPortionEA( rXTextContent, ::com::sun::star::uno::UNO_QUERY );
6895 - if ( aXTextPortionEA.is() )
6897 - ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration >
6898 - aXTextPortionE( aXTextPortionEA->createEnumeration() );
6899 - if ( aXTextPortionE.is() )
6901 - while ( aXTextPortionE->hasMoreElements() )
6903 - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > aXCursorText;
6904 - ::com::sun::star::uno::Any aAny( aXTextPortionE->nextElement() );
6905 - if ( aAny >>= aXCursorText )
6907 - PortionObj* pPortionObj = new PortionObj( aXCursorText, !aXTextPortionE->hasMoreElements(), rFontCollection );
6908 - if ( pPortionObj->Count() )
6909 - Insert( pPortionObj, LIST_APPEND );
6910 - else
6911 - delete pPortionObj;
6916 - ImplGetParagraphValues( rProv, TRUE );//
6920 -ParagraphObj::ParagraphObj( ParagraphObj& rObj )
6921 -: List()
6922 -, PropStateValue()
6923 -, SOParagraph()
6925 - ImplConstruct( rObj );
6928 -ParagraphObj::~ParagraphObj()
6930 - ImplClear();
6933 -void ParagraphObj::Write( SvStream* pStrm )
6935 - for ( void* pPtr = First(); pPtr; pPtr = Next() )
6936 - ((PortionObj*)pPtr)->Write( pStrm, mbLastParagraph );
6939 -void ParagraphObj::ImplClear()
6941 - for ( void* pPtr = First(); pPtr; pPtr = Next() )
6942 - delete (PortionObj*)pPtr;
6945 -void ParagraphObj::CalculateGraphicBulletSize( sal_uInt16 nFontHeight )
6947 - if ( ( (SvxExtNumType)nNumberingType == SVX_NUM_BITMAP ) && ( nBulletId != 0xffff ) )
6949 - // calculate the bulletrealsize for this grafik
6950 - if ( aBuGraSize.Width() && aBuGraSize.Height() )
6952 - double fCharHeight = nFontHeight;
6953 - double fLen = aBuGraSize.Height();
6954 - fCharHeight = fCharHeight * 0.2540;
6955 - double fQuo = fLen / fCharHeight;
6956 - nBulletRealSize = (sal_Int16)( fQuo + 0.5 );
6957 - if ( (sal_uInt16)nBulletRealSize > 400 )
6958 - nBulletRealSize = 400;
6963 -// from sw/source/filter/ww8/wrtw8num.cxx for default bullets to export to MS intact
6964 -static void lcl_SubstituteBullet(String& rNumStr, rtl_TextEncoding& rChrSet, String& rFontName)
6966 - StarSymbolToMSMultiFont *pConvert = 0;
6967 - FontFamily eFamily = FAMILY_DECORATIVE;
6969 - if (!pConvert)
6971 - pConvert = CreateStarSymbolToMSMultiFont();
6972 - }
6973 - sal_Unicode cChar = rNumStr.GetChar(0);
6974 - String sFont = pConvert->ConvertChar(cChar);
6975 - if (sFont.Len())
6977 - rNumStr = static_cast< sal_Unicode >(cChar | 0xF000);
6978 - rFontName = sFont;
6979 - rChrSet = RTL_TEXTENCODING_SYMBOL;
6981 - else if ( (rNumStr.GetChar(0) < 0xE000 || rNumStr.GetChar(0) > 0xF8FF) )
6983 - /*
6984 - Ok we can't fit into a known windows unicode font, but
6985 - we are not in the private area, so we are a
6986 - standardized symbol, so turn off the symbol bit and
6987 - let words own font substitution kick in
6988 - */
6989 - rChrSet = RTL_TEXTENCODING_UNICODE;
6990 - eFamily = FAMILY_SWISS;
6991 - rFontName = ::GetFontToken(rFontName, 0);
6993 - else
6995 - /*
6996 - Well we don't have an available substition, and we're
6997 - in our private area, so give up and show a standard
6998 - bullet symbol
6999 - */
7000 - rFontName.AssignAscii(RTL_CONSTASCII_STRINGPARAM("Wingdings"));
7001 - rNumStr = static_cast< sal_Unicode >(0x6C);
7002 - }
7003 - delete pConvert;
7006 -void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int16 nNumberingDepth, sal_Bool bIsBullet, sal_Bool bGetPropStateValue )
7008 - ::com::sun::star::uno::Any aAny;
7009 - if ( GetPropertyValue( aAny, mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "ParaLeftMargin" ) ) ) )
7011 - sal_Int32 nVal;
7012 - if ( aAny >>= nVal )
7013 - nTextOfs = static_cast< sal_Int16 >( nVal / ( 2540.0 / 576 ) + 0.5 ) ;
7015 - if ( GetPropertyValue( aAny, mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "ParaFirstLineIndent" ) ) ) )
7017 - if ( aAny >>= nBulletOfs )
7018 - nBulletOfs = static_cast< sal_Int32 >( nBulletOfs / ( 2540.0 / 576 ) + 0.5 );
7020 - if ( GetPropertyValue( aAny, mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "NumberingIsNumber" ) ) ) )
7021 - aAny >>= bNumberingIsNumber;
7023 - ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace > aXIndexReplace;
7025 - if ( bIsBullet && ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "NumberingRules" ) ), bGetPropStateValue ) )
7027 - if ( ( mAny >>= aXIndexReplace ) && nNumberingDepth < aXIndexReplace->getCount() )
7029 - mAny <<= aXIndexReplace->getByIndex( nNumberingDepth );
7030 - ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>
7031 - aPropertySequence( *( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>*)mAny.getValue() );
7033 - const ::com::sun::star::beans::PropertyValue* pPropValue = aPropertySequence.getArray();
7035 - sal_Int32 nPropertyCount = aPropertySequence.getLength();
7036 - if ( nPropertyCount )
7038 - bExtendedParameters = TRUE;
7039 - nBulletRealSize = 100;
7040 - nMappedNumType = 0;
7042 - String aGraphicURL;
7043 - for ( sal_Int32 i = 0; i < nPropertyCount; i++ )
7045 - const void* pValue = pPropValue[ i ].Value.getValue();
7046 - if ( pValue )
7048 - ::rtl::OUString aPropName( pPropValue[ i ].Name );
7049 - if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "NumberingType" ) ) )
7050 - nNumberingType = *( (sal_Int16*)pValue );
7051 - else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Adjust" ) ) )
7052 - nHorzAdjust = *( (sal_Int16*)pValue );
7053 - else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "BulletChar" ) ) )
7055 - String aString( *( (String*)pValue ) );
7056 - if ( aString.Len() )
7057 - cBulletId = aString.GetChar( 0 );
7059 - else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "BulletFont" ) ) )
7061 - aFontDesc = *( (::com::sun::star::awt::FontDescriptor*)pValue );
7063 - // Our numbullet dialog has set the wrong textencoding for our "StarSymbol" font,
7064 - // instead of a Unicode encoding the encoding RTL_TEXTENCODING_SYMBOL was used.
7065 - // Because there might exist a lot of damaged documemts I added this two lines
7066 - // which fixes the bullet problem for the export.
7067 - if ( aFontDesc.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "StarSymbol" ) ) )
7068 - aFontDesc.CharSet = RTL_TEXTENCODING_MS_1252;
7071 - else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "GraphicURL" ) ) )
7072 - aGraphicURL = ( *(::rtl::OUString*)pValue );
7073 - else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "GraphicSize" ) ) )
7075 - if ( pPropValue[ i ].Value.getValueType() == ::getCppuType( (::com::sun::star::awt::Size*)0) )
7077 - // don't cast awt::Size to Size as on 64-bits they are not the same.
7078 - ::com::sun::star::awt::Size aSize;
7079 - pPropValue[ i ].Value >>= aSize;
7080 - aBuGraSize.nA = aSize.Width;
7081 - aBuGraSize.nB = aSize.Height;
7084 - else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "StartWith" ) ) )
7085 - nStartWith = *( (sal_Int16*)pValue );
7086 - else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "LeftMargin" ) ) )
7087 - nTextOfs = nTextOfs + static_cast< sal_Int16 >( *( (sal_Int32*)pValue ) / ( 2540.0 / 576 ) );
7088 - else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "FirstLineOffset" ) ) )
7089 - nBulletOfs += (sal_Int16)( *( (sal_Int32*)pValue ) / ( 2540.0 / 576 ) );
7090 - else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "BulletColor" ) ) )
7092 - sal_uInt32 nSOColor = *( (sal_uInt32*)pValue );
7093 - nBulletColor = nSOColor & 0xff00ff00; // green and hibyte
7094 - nBulletColor |= (sal_uInt8)( nSOColor ) << 16; // red
7095 - nBulletColor |= (sal_uInt8)( nSOColor >> 16 ) | 0xfe000000; // blue
7097 - else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "BulletRelSize" ) ) )
7099 - nBulletRealSize = *( (sal_Int16*)pValue );
7100 - nParaFlags |= 0x40;
7101 - nBulletFlags |= 8;
7103 - else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Prefix" ) ) )
7104 - sPrefix = ( *(::rtl::OUString*)pValue );
7105 - else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Suffix" ) ) )
7106 - sSuffix = ( *(::rtl::OUString*)pValue );
7107 -#ifdef DBG_UTIL
7108 - else if ( ! (
7109 - ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "SymbolTextDistance" ) ) )
7110 - || ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Graphic" ) ) ) ) )
7112 - DBG_ERROR( "Unbekanntes Property" );
7114 -#endif
7118 - if ( aGraphicURL.Len() )
7120 - if ( aBuGraSize.Width() && aBuGraSize.Height() )
7122 - xub_StrLen nIndex = aGraphicURL.Search( (sal_Unicode)':', 0 );
7123 - if ( nIndex != STRING_NOTFOUND )
7125 - nIndex++;
7126 - if ( aGraphicURL.Len() > nIndex )
7128 - ByteString aUniqueId( aGraphicURL, nIndex, aGraphicURL.Len() - nIndex, RTL_TEXTENCODING_UTF8 );
7129 - if ( aUniqueId.Len() )
7131 - nBulletId = rBuProv.GetId( aUniqueId, aBuGraSize );
7132 - if ( nBulletId != 0xffff )
7133 - bExtendedBulletsUsed = TRUE;
7138 - else
7140 - nNumberingType = SVX_NUM_NUMBER_NONE;
7144 - PortionObj* pPortion = (PortionObj*)First();
7145 - CalculateGraphicBulletSize( ( pPortion ) ? pPortion->mnCharHeight : 24 );
7147 - switch( (SvxExtNumType)nNumberingType )
7149 - case SVX_NUM_NUMBER_NONE : nParaFlags |= 0xf; break;
7151 - case SVX_NUM_CHAR_SPECIAL : // Bullet
7153 - if ( aFontDesc.Name.equalsIgnoreAsciiCaseAscii("starsymbol") ||
7154 - aFontDesc.Name.equalsIgnoreAsciiCaseAscii("opensymbol") )
7156 - String sFontName = aFontDesc.Name;
7157 - String sNumStr = cBulletId;
7158 - rtl_TextEncoding eChrSet = aFontDesc.CharSet;
7159 - lcl_SubstituteBullet(sNumStr,eChrSet,sFontName);
7160 - aFontDesc.Name = sFontName;
7161 - cBulletId = sNumStr.GetChar( 0 );
7162 - aFontDesc.CharSet = eChrSet;
7165 - if ( aFontDesc.Name.getLength() )
7168 - if ( aFontDesc.CharSet != ::com::sun::star::awt::CharSet::SYMBOL )
7170 - switch ( cBulletId )
7172 - // Currency
7173 - case 128: cBulletId = 0x20AC; break;
7174 - // Punctuation and other
7175 - case 130: cBulletId = 0x201A; break;// SINGLE LOW-9 QUOTATION MARK
7176 - case 131: cBulletId = 0x0192; break;// LATIN SMALL LETTER F WITH HOOK
7177 - case 132: cBulletId = 0x201E; break;// DOUBLE LOW-9 QUOTATION MARK
7178 - // LOW DOUBLE PRIME QUOTATION MARK
7179 - case 133: cBulletId = 0x2026; break;// HORIZONTAL ELLIPSES
7180 - case 134: cBulletId = 0x2020; break;// DAGGER
7181 - case 135: cBulletId = 0x2021; break;// DOUBLE DAGGER
7182 - case 136: cBulletId = 0x02C6; break;// MODIFIER LETTER CIRCUMFLEX ACCENT
7183 - case 137: cBulletId = 0x2030; break;// PER MILLE SIGN
7184 - case 138: cBulletId = 0x0160; break;// LATIN CAPITAL LETTER S WITH CARON
7185 - case 139: cBulletId = 0x2039; break;// SINGLE LEFT-POINTING ANGLE QUOTATION MARK
7186 - case 140: cBulletId = 0x0152; break;// LATIN CAPITAL LIGATURE OE
7187 - case 142: cBulletId = 0x017D; break;// LATIN CAPITAL LETTER Z WITH CARON
7188 - case 145: cBulletId = 0x2018; break;// LEFT SINGLE QUOTATION MARK
7189 - // MODIFIER LETTER TURNED COMMA
7190 - case 146: cBulletId = 0x2019; break;// RIGHT SINGLE QUOTATION MARK
7191 - // MODIFIER LETTER APOSTROPHE
7192 - case 147: cBulletId = 0x201C; break;// LEFT DOUBLE QUOTATION MARK
7193 - // REVERSED DOUBLE PRIME QUOTATION MARK
7194 - case 148: cBulletId = 0x201D; break;// RIGHT DOUBLE QUOTATION MARK
7195 - // REVERSED DOUBLE PRIME QUOTATION MARK
7196 - case 149: cBulletId = 0x2022; break;// BULLET
7197 - case 150: cBulletId = 0x2013; break;// EN DASH
7198 - case 151: cBulletId = 0x2014; break;// EM DASH
7199 - case 152: cBulletId = 0x02DC; break;// SMALL TILDE
7200 - case 153: cBulletId = 0x2122; break;// TRADE MARK SIGN
7201 - case 154: cBulletId = 0x0161; break;// LATIN SMALL LETTER S WITH CARON
7202 - case 155: cBulletId = 0x203A; break;// SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
7203 - case 156: cBulletId = 0x0153; break;// LATIN SMALL LIGATURE OE
7204 - case 158: cBulletId = 0x017E; break;// LATIN SMALL LETTER Z WITH CARON
7205 - case 159: cBulletId = 0x0178; break;// LATIN CAPITAL LETTER Y WITH DIAERESIS
7206 -// case 222: cBulletId = 0x00B6; break;// PILCROW SIGN / PARAGRAPH SIGN
7210 - nParaFlags |= 0x90; // wir geben den Font und den Charset vor
7213 - case SVX_NUM_CHARS_UPPER_LETTER : // zaehlt von a-z, aa - az, ba - bz, ...
7214 - case SVX_NUM_CHARS_LOWER_LETTER :
7215 - case SVX_NUM_ROMAN_UPPER :
7216 - case SVX_NUM_ROMAN_LOWER :
7217 - case SVX_NUM_ARABIC :
7218 - case SVX_NUM_PAGEDESC : // Numerierung aus der Seitenvorlage
7219 - case SVX_NUM_BITMAP :
7220 - case SVX_NUM_CHARS_UPPER_LETTER_N : // zaehlt von a-z, aa-zz, aaa-zzz
7221 - case SVX_NUM_CHARS_LOWER_LETTER_N :
7223 - if ( nNumberingType != SVX_NUM_CHAR_SPECIAL )
7225 - bExtendedBulletsUsed = TRUE;
7226 - if ( nNumberingDepth & 1 )
7227 - cBulletId = 0x2013; // defaulting bullet characters for ppt97
7228 - else if ( nNumberingDepth == 4 )
7229 - cBulletId = 0xbb;
7230 - else
7231 - cBulletId = 0x2022;
7233 - switch( (SvxExtNumType)nNumberingType )
7235 - case SVX_NUM_CHARS_UPPER_LETTER :
7236 - case SVX_NUM_CHARS_UPPER_LETTER_N :
7238 - if ( sSuffix == String( RTL_CONSTASCII_USTRINGPARAM( ")" ) ) )
7240 - if ( sPrefix == String( RTL_CONSTASCII_USTRINGPARAM( "(" ) ) )
7241 - nMappedNumType = 0xa0001; // (A)
7242 - else
7243 - nMappedNumType = 0xb0001; // A)
7245 - else
7246 - nMappedNumType = 0x10001; // A.
7248 - break;
7249 - case SVX_NUM_CHARS_LOWER_LETTER :
7250 - case SVX_NUM_CHARS_LOWER_LETTER_N :
7252 - if ( sSuffix == String( RTL_CONSTASCII_USTRINGPARAM( ")" ) ) )
7254 - if ( sPrefix == String( RTL_CONSTASCII_USTRINGPARAM( "(" ) ) )
7255 - nMappedNumType = 0x80001; // (a)
7256 - else
7257 - nMappedNumType = 0x90001; // a)
7259 - else
7260 - nMappedNumType = 0x00001; // a.
7262 - break;
7263 - case SVX_NUM_ROMAN_UPPER :
7265 - if ( sSuffix == String( RTL_CONSTASCII_USTRINGPARAM( ")" ) ) )
7267 - if ( sPrefix == String( RTL_CONSTASCII_USTRINGPARAM( "(" ) ) )
7268 - nMappedNumType = 0xe0001; // (I)
7269 - else
7270 - nMappedNumType = 0xf0001; // I)
7272 - else
7273 - nMappedNumType = 0x70001; // I.
7275 - break;
7276 - case SVX_NUM_ROMAN_LOWER :
7278 - if ( sSuffix == String( RTL_CONSTASCII_USTRINGPARAM( ")" ) ) )
7280 - if ( sPrefix == String( RTL_CONSTASCII_USTRINGPARAM( "(" ) ) )
7281 - nMappedNumType = 0x40001; // (i)
7282 - else
7283 - nMappedNumType = 0x50001; // i)
7285 - else
7286 - nMappedNumType = 0x60001; // i.
7288 - break;
7289 - case SVX_NUM_ARABIC :
7291 - if ( sSuffix == String( RTL_CONSTASCII_USTRINGPARAM( ")" ) ) )
7293 - if ( sPrefix == String( RTL_CONSTASCII_USTRINGPARAM( "(" ) ) )
7294 - nMappedNumType = 0xc0001; // (1)
7295 - else
7296 - nMappedNumType = 0x20001; // 1)
7298 - else
7300 - if ( ! ( sSuffix.Len() + sPrefix.Len() ) )
7301 - nMappedNumType = 0xd0001; // 1
7302 - else
7303 - nMappedNumType = 0x30001; // 1.
7306 - break;
7307 - default:
7308 - break;
7311 - nParaFlags |= 0x2f;
7312 - nBulletFlags |= 6;
7313 - if ( mbIsBullet && bNumberingIsNumber )
7314 - nBulletFlags |= 1;
7320 - nBulletOfs = nTextOfs + nBulletOfs;
7321 - if ( nBulletOfs < 0 )
7322 - nBulletOfs = 0;
7325 -void ParagraphObj::ImplGetParagraphValues( PPTExBulletProvider& rBuProv, sal_Bool bGetPropStateValue )
7327 - static String sNumberingLevel ( RTL_CONSTASCII_USTRINGPARAM( "NumberingLevel" ) );
7329 - ::com::sun::star::uno::Any aAny;
7330 - if ( GetPropertyValue( aAny, mXPropSet, sNumberingLevel, sal_True ) )
7332 - if ( bGetPropStateValue )
7333 - meBullet = GetPropertyState( mXPropSet, sNumberingLevel );
7334 - nDepth = *( (sal_Int16*)aAny.getValue() );
7336 - if ( nDepth < 0 )
7338 - mbIsBullet = sal_False;
7339 - nDepth = 0;
7341 - else
7343 - if ( nDepth > 4 )
7344 - nDepth = 4;
7345 - mbIsBullet = sal_True;
7348 - else
7350 - nDepth = 0;
7351 - mbIsBullet = sal_False;
7353 - ImplGetNumberingLevel( rBuProv, nDepth, mbIsBullet, bGetPropStateValue );
7355 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "ParaTabStops" ) ), bGetPropStateValue ) )
7356 - maTabStop = *( ::com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop>*)mAny.getValue();
7357 - sal_Int16 eTextAdjust( ::com::sun::star::style::ParagraphAdjust_LEFT );
7358 - if ( GetPropertyValue( aAny, mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "ParaAdjust" ) ), bGetPropStateValue ) )
7359 - aAny >>= eTextAdjust;
7360 - switch ( (::com::sun::star::style::ParagraphAdjust)eTextAdjust )
7362 - case ::com::sun::star::style::ParagraphAdjust_CENTER :
7363 - mnTextAdjust = 1;
7364 - break;
7365 - case ::com::sun::star::style::ParagraphAdjust_RIGHT :
7366 - mnTextAdjust = 2;
7367 - break;
7368 - case ::com::sun::star::style::ParagraphAdjust_BLOCK :
7369 - mnTextAdjust = 3;
7370 - break;
7371 - default :
7372 - case ::com::sun::star::style::ParagraphAdjust_LEFT :
7373 - mnTextAdjust = 0;
7374 - break;
7376 - meTextAdjust = ePropState;
7378 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "ParaLineSpacing" ) ), bGetPropStateValue ) )
7380 - ::com::sun::star::style::LineSpacing aLineSpacing
7381 - = *( (::com::sun::star::style::LineSpacing*)mAny.getValue() );
7382 - switch ( aLineSpacing.Mode )
7384 - case ::com::sun::star::style::LineSpacingMode::FIX :
7385 - mnLineSpacing = (sal_Int16)(-( aLineSpacing.Height ) );
7386 - mbFixedLineSpacing = TRUE;
7387 - break;
7388 - case ::com::sun::star::style::LineSpacingMode::MINIMUM :
7389 - case ::com::sun::star::style::LineSpacingMode::LEADING :
7390 - mnLineSpacing = (sal_Int16)(-( aLineSpacing.Height ) );
7391 - mbFixedLineSpacing = FALSE;
7392 - break;
7394 - case ::com::sun::star::style::LineSpacingMode::PROP :
7395 - default:
7396 - mnLineSpacing = (sal_Int16)( aLineSpacing.Height );
7397 - break;
7400 - meLineSpacing = ePropState;
7402 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "ParaBottomMargin" ) ), bGetPropStateValue ) )
7404 - double fSpacing = *( (sal_uInt32*)mAny.getValue() ) + ( 2540.0 / 576.0 ) - 1;
7405 - mnLineSpacingBottom = (sal_Int16)(-( fSpacing * 576.0 / 2540.0 ) );
7407 - meLineSpacingBottom = ePropState;
7409 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "ParaTopMargin" ) ), bGetPropStateValue ) )
7411 - double fSpacing = *( (sal_uInt32*)mAny.getValue() ) + ( 2540.0 / 576.0 ) - 1;
7412 - mnLineSpacingTop = (sal_Int16)(-( fSpacing * 576.0 / 2540.0 ) );
7414 - meLineSpacingTop = ePropState;
7416 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "ParaIsForbiddenRules" ) ), bGetPropStateValue ) )
7417 - mAny >>= mbForbiddenRules;
7418 - meForbiddenRules = ePropState;
7420 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "ParaIsHangingPunctuation" ) ), bGetPropStateValue ) )
7421 - mAny >>= mbParagraphPunctation;
7422 - meParagraphPunctation = ePropState;
7424 - mnBiDi = 0;
7425 - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "WritingMode" ) ), bGetPropStateValue ) )
7427 - sal_Int16 nWritingMode;
7428 - mAny >>= nWritingMode;
7430 - SvxFrameDirection eWritingMode( (SvxFrameDirection)nWritingMode );
7431 - if ( ( eWritingMode == FRMDIR_HORI_RIGHT_TOP )
7432 - || ( eWritingMode == FRMDIR_VERT_TOP_RIGHT ) )
7434 - mnBiDi = 1;
7437 - meBiDi = ePropState;
7440 -void ParagraphObj::ImplConstruct( ParagraphObj& rParagraphObj )
7442 - mnTextSize = rParagraphObj.mnTextSize;
7443 - mnTextAdjust = rParagraphObj.mnTextAdjust;
7444 - mnLineSpacing = rParagraphObj.mnLineSpacing;
7445 - mnLineSpacingTop = rParagraphObj.mnLineSpacingTop;
7446 - mnLineSpacingBottom = rParagraphObj.mnLineSpacingBottom;
7447 - mbFirstParagraph = rParagraphObj.mbFirstParagraph;
7448 - mbLastParagraph = rParagraphObj.mbLastParagraph;
7449 - mbParagraphPunctation = rParagraphObj.mbParagraphPunctation;
7450 - mbForbiddenRules = rParagraphObj.mbForbiddenRules;
7451 - mnBiDi = rParagraphObj.mnBiDi;
7453 - for ( void* pPtr = rParagraphObj.First(); pPtr; pPtr = rParagraphObj.Next() )
7454 - Insert( new PortionObj( *(PortionObj*)pPtr ), LIST_APPEND );
7456 - maTabStop = rParagraphObj.maTabStop;
7457 - bExtendedParameters = rParagraphObj.bExtendedParameters;
7458 - nParaFlags = rParagraphObj.nParaFlags;
7459 - nBulletFlags = rParagraphObj.nBulletFlags;
7460 - sPrefix = rParagraphObj.sPrefix;
7461 - sSuffix = rParagraphObj.sSuffix;
7462 - sGraphicUrl = rParagraphObj.sGraphicUrl; // String auf eine Graphic
7463 - aBuGraSize = rParagraphObj.aBuGraSize;
7464 - nNumberingType = rParagraphObj.nNumberingType; // in wirlichkeit ist dies ein SvxEnum
7465 - nHorzAdjust = rParagraphObj.nHorzAdjust;
7466 - nBulletColor = rParagraphObj.nBulletColor;
7467 - nBulletOfs = rParagraphObj.nBulletOfs;
7468 - nStartWith = rParagraphObj.nStartWith; // Start der nummerierung
7469 - nTextOfs = rParagraphObj.nTextOfs;
7470 - nBulletRealSize = rParagraphObj.nBulletRealSize; // GroessenVerhaeltnis in Proz
7471 - nDepth = rParagraphObj.nDepth; // aktuelle tiefe
7472 - cBulletId = rParagraphObj.cBulletId; // wenn Numbering Type == CharSpecial
7473 - aFontDesc = rParagraphObj.aFontDesc;
7475 - bExtendedBulletsUsed = rParagraphObj.bExtendedBulletsUsed;
7476 - nBulletId = rParagraphObj.nBulletId;
7479 -::com::sun::star::awt::Size ParagraphObj::ImplMapSize( const ::com::sun::star::awt::Size& rSize )
7481 - Size aSize( OutputDevice::LogicToLogic( Size( rSize.Width, rSize.Height ), maMapModeSrc, maMapModeDest ) );
7482 - if ( !aSize.Width() )
7483 - aSize.Width()++;
7484 - if ( !aSize.Height() )
7485 - aSize.Height()++;
7486 - return ::com::sun::star::awt::Size( aSize.Width(), aSize.Height() );
7489 -sal_uInt32 ParagraphObj::ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition )
7491 - mnTextSize = 0;
7492 - for ( void* pPtr = First(); pPtr; pPtr = Next() )
7493 - mnTextSize += ((PortionObj*)pPtr)->ImplCalculateTextPositions( nCurrentTextPosition + mnTextSize );
7494 - return mnTextSize;
7497 -ParagraphObj& ParagraphObj::operator=( ParagraphObj& rParagraphObj )
7499 - if ( this != &rParagraphObj )
7501 - ImplClear();
7502 - ImplConstruct( rParagraphObj );
7504 - return *this;
7507 -// -----------------------------------------------------------------------
7509 -ImplTextObj::ImplTextObj( int nInstance )
7511 - mnRefCount = 1;
7512 - mnTextSize = 0;
7513 - mnInstance = nInstance;
7514 - mpList = new List;
7515 - mbHasExtendedBullets = FALSE;
7516 - mbFixedCellHeightUsed = FALSE;
7519 -ImplTextObj::~ImplTextObj()
7521 - for ( ParagraphObj* pPtr = (ParagraphObj*)mpList->First(); pPtr; pPtr = (ParagraphObj*)mpList->Next() )
7522 - delete pPtr;
7523 - delete mpList;
7526 -TextObj::TextObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XSimpleText > & rXTextRef,
7527 - int nInstance, FontCollection& rFontCollection, PPTExBulletProvider& rProv )
7529 - mpImplTextObj = new ImplTextObj( nInstance );
7531 - ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess >
7532 - aXTextParagraphEA( rXTextRef, ::com::sun::star::uno::UNO_QUERY );
7534 - if ( aXTextParagraphEA.is() )
7536 - ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration >
7537 - aXTextParagraphE( aXTextParagraphEA->createEnumeration() );
7538 - if ( aXTextParagraphE.is() )
7540 - ParaFlags aParaFlags;
7541 - while ( aXTextParagraphE->hasMoreElements() )
7543 - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > aXParagraph;
7544 - ::com::sun::star::uno::Any aAny( aXTextParagraphE->nextElement() );
7545 - if ( aAny >>= aXParagraph )
7547 - if ( !aXTextParagraphE->hasMoreElements() )
7548 - aParaFlags.bLastParagraph = TRUE;
7549 - ParagraphObj* pPara = new ParagraphObj( aXParagraph, aParaFlags, rFontCollection, rProv );
7550 - mpImplTextObj->mbHasExtendedBullets |= pPara->bExtendedBulletsUsed;
7551 - mpImplTextObj->mpList->Insert( pPara, LIST_APPEND );
7552 - aParaFlags.bFirstParagraph = FALSE;
7557 - ImplCalculateTextPositions();
7560 -TextObj::TextObj( TextObj& rTextObj )
7562 - mpImplTextObj = rTextObj.mpImplTextObj;
7563 - mpImplTextObj->mnRefCount++;
7566 -TextObj::~TextObj()
7568 - if ( ! ( --mpImplTextObj->mnRefCount ) )
7569 - delete mpImplTextObj;
7572 -void TextObj::Write( SvStream* pStrm )
7574 - sal_uInt32 nSize, nPos = pStrm->Tell();
7575 - *pStrm << (sal_uInt32)( EPP_TextCharsAtom << 16 ) << (sal_uInt32)0;
7576 - for ( void* pPtr = First(); pPtr; pPtr = Next() )
7577 - ((ParagraphObj*)pPtr)->Write( pStrm );
7578 - nSize = pStrm->Tell() - nPos;
7579 - pStrm->SeekRel( - ( (sal_Int32)nSize - 4 ) );
7580 - *pStrm << (sal_uInt32)( nSize - 8 );
7581 - pStrm->SeekRel( nSize - 8 );
7584 -void TextObj::ImplCalculateTextPositions()
7586 - mpImplTextObj->mnTextSize = 0;
7587 - for ( void* pPtr = First(); pPtr; pPtr = Next() )
7588 - mpImplTextObj->mnTextSize += ((ParagraphObj*)pPtr)->ImplCalculateTextPositions( mpImplTextObj->mnTextSize );
7591 -TextObj& TextObj::operator=( TextObj& rTextObj )
7593 - if ( this != &rTextObj )
7595 - if ( ! ( --mpImplTextObj->mnRefCount ) )
7596 - delete mpImplTextObj;
7597 - mpImplTextObj = rTextObj.mpImplTextObj;
7598 - mpImplTextObj->mnRefCount++;
7600 - return *this;
7603 -void TextObj::WriteTextSpecInfo( SvStream* pStrm )
7605 - sal_uInt32 nCharactersLeft( Count() );
7606 - if ( nCharactersLeft >= 1 )
7608 - EscherExAtom aAnimationInfoAtom( *pStrm, EPP_TextSpecInfoAtom, 0, 0 );
7609 - for ( ParagraphObj* pPtr = static_cast < ParagraphObj * >( First() ); nCharactersLeft && pPtr; pPtr = static_cast< ParagraphObj* >( Next() ) )
7611 - for ( PortionObj* pPortion = static_cast< PortionObj* >( pPtr->First() ); nCharactersLeft && pPortion; pPortion = static_cast< PortionObj* >( pPtr->Next() ) )
7613 - sal_Int32 nPortionSize = pPortion->mnTextSize >= nCharactersLeft ? nCharactersLeft : pPortion->mnTextSize;
7614 - sal_Int32 nFlags = 7;
7615 - nCharactersLeft -= nPortionSize;
7616 - *pStrm << static_cast< sal_uInt32 >( nPortionSize )
7617 - << nFlags
7618 - << static_cast< sal_Int16 >( 1 ) // spellinfo -> needs rechecking
7619 - << static_cast< sal_Int16 >( MsLangId::convertLocaleToLanguageWithFallback( pPortion->meCharLocale ) )
7620 - << static_cast< sal_Int16 >( 0 ); // alt language
7623 - if ( nCharactersLeft )
7624 - *pStrm << nCharactersLeft << static_cast< sal_Int32 >( 1 ) << static_cast< sal_Int16 >( 1 );
7629 -// -----------------------------------------------------------------------
7631 void PPTWriter::ImplAdjustFirstLineLineSpacing( TextObj& rTextObj, EscherPropertyContainer& rPropOpt )
7633 if ( !mbFontIndependentLineSpacing )
7634 @@ -3160,7 +1207,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u
7635 if ( !mbEmptyPresObj )
7637 ParagraphObj* pPara;
7638 - TextObj aTextObj( mXText, nTextInstance, maFontCollection, (PPTExBulletProvider&)*this );
7639 + TextObjBinary aTextObj( mXText, nTextInstance, maFontCollection, (PPTExBulletProvider&)*this );
7641 // leaving out EPP_TextCharsAtom w/o text - still write out
7642 // attribute info though
7643 @@ -3317,7 +1364,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u
7645 nParaFlags >>= 16;
7647 - sal_uInt32 nDefaultTabSize = ImplMapSize( ::com::sun::star::awt::Size( 2011, 1 ) ).Width;
7648 + sal_uInt32 nDefaultTabSize = MapSize( ::com::sun::star::awt::Size( 2011, 1 ) ).Width;
7649 sal_uInt32 nDefaultTabs = abs( maRect.GetWidth() ) / nDefaultTabSize;
7650 if ( nTabs )
7651 nDefaultTabs -= (sal_Int32)( ( ( pTabStop[ nTabs - 1 ].Position / 4.40972 ) + nTextOfs ) / nDefaultTabSize );
7652 @@ -4117,7 +2164,7 @@ void PPTWriter::ImplWriteClickAction( SvStream& rSt, ::com::sun::star::presentat
7654 rSt << (sal_uInt32)( ( EPP_InteractiveInfo << 16 ) | 0x1f ) << (sal_uInt32)24 // Mouse Over Action
7655 << (sal_uInt32)( EPP_InteractiveInfo << 16 ) << (sal_uInt32)16;
7656 - for ( int i = 0; i < 4; i++, rSt << (sal_uInt32)0 ) ;
7657 + for ( int i = 0; i < 4; i++, rSt << (sal_uInt32)0 ) {}
7660 // -----------------------------------------------------------------------
7661 @@ -4269,9 +2316,9 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
7664 nGroups = GetGroupsClosed();
7665 - for ( sal_uInt32 i = 0; i < nGroups; i++, mpPptEscherEx->LeaveGroup() ) ;
7666 + for ( sal_uInt32 i = 0; i < nGroups; i++, mpPptEscherEx->LeaveGroup() ) {}
7668 - if ( ImplGetShapeByIndex( GetCurrentGroupIndex(), TRUE ) )
7669 + if ( GetShapeByIndex( GetCurrentGroupIndex(), TRUE ) )
7671 sal_Bool bIsSound;
7672 sal_Bool bMediaClickAction = sal_False;
7673 @@ -4341,8 +2388,8 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
7674 if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "BoundRect" ) ) ) )
7676 ::com::sun::star::awt::Rectangle aRect( *(::com::sun::star::awt::Rectangle*)mAny.getValue() );
7677 - maPosition = ImplMapPoint( ::com::sun::star::awt::Point( aRect.X, aRect.Y ) );
7678 - maSize = ImplMapSize( ::com::sun::star::awt::Size( aRect.Width, aRect.Height ) );
7679 + maPosition = MapPoint( ::com::sun::star::awt::Point( aRect.X, aRect.Y ) );
7680 + maSize = MapSize( ::com::sun::star::awt::Size( aRect.Width, aRect.Height ) );
7681 maRect = Rectangle( Point( maPosition.X, maPosition.Y ), Size( maSize.Width, maSize.Height ) );
7683 mType = "drawing.dontknow";
7684 @@ -4369,8 +2416,8 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
7685 if ( pObj )
7687 Rectangle aBound = pObj->GetCurrentBoundRect();
7688 - maPosition = ImplMapPoint( ::com::sun::star::awt::Point( aBound.Left(), aBound.Top() ) );
7689 - maSize = ImplMapSize( ::com::sun::star::awt::Size ( aBound.GetWidth(), aBound.GetHeight() ) );
7690 + maPosition = MapPoint( ::com::sun::star::awt::Point( aBound.Left(), aBound.Top() ) );
7691 + maSize = MapSize( ::com::sun::star::awt::Size ( aBound.GetWidth(), aBound.GetHeight() ) );
7692 maRect = Rectangle( Point( maPosition.X, maPosition.Y ), Size( maSize.Width, maSize.Height ) );
7693 mnAngle = 0;
7695 @@ -4395,7 +2442,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
7696 if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CornerRadius" ) ) ) )
7698 mAny >>= nRadius;
7699 - nRadius = ImplMapSize( ::com::sun::star::awt::Size( nRadius, 0 ) ).Width;
7700 + nRadius = MapSize( ::com::sun::star::awt::Size( nRadius, 0 ) ).Width;
7702 if ( nRadius )
7704 @@ -4514,7 +2561,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
7706 break;
7708 - maRect = ImplMapRectangle( aNewRect );
7709 + maRect = MapRectangle( aNewRect );
7710 maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
7711 maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
7712 if ( bNeedText && ImplGetText() )
7713 @@ -4658,7 +2705,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
7714 if ( aPropOpt.CreateConnectorProperties( mXShape, aSolverContainer, aNewRect, nSpType, nSpFlags ) == sal_False )
7715 continue;
7717 - maRect = ImplMapRectangle( aNewRect );
7718 + maRect = MapRectangle( aNewRect );
7719 maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
7720 maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
7722 @@ -4673,7 +2720,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
7724 ::com::sun::star::awt::Rectangle aNewRect;
7725 aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_LINE, sal_False, aNewRect, NULL );
7726 - maRect = ImplMapRectangle( aNewRect );
7727 + maRect = MapRectangle( aNewRect );
7728 maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
7729 maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
7730 if ( ImplGetText() )
7731 @@ -4708,7 +2755,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
7732 ImplCreateShape( ESCHER_ShpInst_NotPrimitive, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
7733 ::com::sun::star::awt::Rectangle aNewRect;
7734 aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, sal_False, aNewRect, NULL );
7735 - maRect = ImplMapRectangle( aNewRect );
7736 + maRect = MapRectangle( aNewRect );
7737 maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
7738 maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
7739 aPropOpt.CreateFillProperties( mXPropSet, sal_True );
7740 @@ -4727,7 +2774,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
7741 ImplCreateShape( ESCHER_ShpInst_NotPrimitive, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
7742 ::com::sun::star::awt::Rectangle aNewRect;
7743 aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, sal_False, aNewRect, NULL );
7744 - maRect = ImplMapRectangle( aNewRect );
7745 + maRect = MapRectangle( aNewRect );
7746 maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
7747 maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
7748 aPropOpt.CreateLineProperties( mXPropSet, sal_False );
7749 @@ -4746,7 +2793,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
7750 ImplCreateShape( ESCHER_ShpInst_NotPrimitive, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
7751 ::com::sun::star::awt::Rectangle aNewRect;
7752 aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, sal_True, aNewRect, NULL );
7753 - maRect = ImplMapRectangle( aNewRect );
7754 + maRect = MapRectangle( aNewRect );
7755 maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
7756 maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
7757 aPropOpt.CreateLineProperties( mXPropSet, sal_False );
7758 @@ -4765,7 +2812,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
7759 ImplCreateShape( ESCHER_ShpInst_NotPrimitive, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
7760 ::com::sun::star::awt::Rectangle aNewRect;
7761 aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, sal_True, aNewRect, NULL );
7762 - maRect = ImplMapRectangle( aNewRect );
7763 + maRect = MapRectangle( aNewRect );
7764 maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
7765 maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
7766 aPropOpt.CreateFillProperties( mXPropSet, sal_True );
7767 @@ -4847,7 +2894,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
7768 bIsTitlePossible = FALSE;
7770 ImplGetText();
7771 - TextObj aTextObj( mXText, EPP_TEXTTYPE_Title, maFontCollection, (PPTExBulletProvider&)*this );
7772 + TextObjBinary aTextObj( mXText, EPP_TEXTTYPE_Title, maFontCollection, (PPTExBulletProvider&)*this );
7773 if ( ePageType == MASTER )
7775 if ( mnTextSize )
7776 @@ -4938,12 +2985,12 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
7777 if ( mbPresObj )
7779 nOutlinerCount++;
7780 - if ( rLayout.bOutlinerPossible && ( nOutlinerCount == 1 ) ||
7781 + if ( ( rLayout.bOutlinerPossible && ( nOutlinerCount == 1 ) ) ||
7782 ( ( rLayout.bSecOutlinerPossible && ( nOutlinerCount == 2 ) )
7783 && ( nPrevTextStyle == EPP_TEXTSTYLE_BODY ) ) )
7785 ImplGetText();
7786 - TextObj aTextObj( mXText, EPP_TEXTTYPE_Body, maFontCollection, (PPTExBulletProvider&)*this );
7787 + TextObjBinary aTextObj( mXText, EPP_TEXTTYPE_Body, maFontCollection, (PPTExBulletProvider&)*this );
7788 if ( ePageType == MASTER )
7790 nPrevTextStyle = EPP_TEXTSTYLE_TITLE;
7791 @@ -5503,44 +3550,12 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
7793 ClearGroupTable(); // gruppierungen wegschreiben, sofern noch irgendwelche offen sind, was eigendlich nicht sein sollte
7794 nGroups = GetGroupsClosed();
7795 - for ( sal_uInt32 i = 0; i < nGroups; i++, mpPptEscherEx->LeaveGroup() ) ;
7796 + for ( sal_uInt32 i = 0; i < nGroups; i++, mpPptEscherEx->LeaveGroup() ) {}
7797 mnPagesWritten++;
7800 // -----------------------------------------------------------------------
7802 -::com::sun::star::awt::Point PPTWriter::ImplMapPoint( const ::com::sun::star::awt::Point& rPoint )
7804 - Point aRet( OutputDevice::LogicToLogic( Point( rPoint.X, rPoint.Y ), maMapModeSrc, maMapModeDest ) );
7805 - return ::com::sun::star::awt::Point( aRet.X(), aRet.Y() );
7808 -// -----------------------------------------------------------------------
7810 -::com::sun::star::awt::Size PPTWriter::ImplMapSize( const ::com::sun::star::awt::Size& rSize )
7812 - Size aRetSize( OutputDevice::LogicToLogic( Size( rSize.Width, rSize.Height ), maMapModeSrc, maMapModeDest ) );
7814 - if ( !aRetSize.Width() )
7815 - aRetSize.Width()++;
7816 - if ( !aRetSize.Height() )
7817 - aRetSize.Height()++;
7818 - return ::com::sun::star::awt::Size( aRetSize.Width(), aRetSize.Height() );
7821 -// -----------------------------------------------------------------------
7823 -Rectangle PPTWriter::ImplMapRectangle( const ::com::sun::star::awt::Rectangle& rRect )
7825 - ::com::sun::star::awt::Point aPoint( rRect.X, rRect.Y );
7826 - ::com::sun::star::awt::Size aSize( rRect.Width, rRect.Height );
7827 - ::com::sun::star::awt::Point aP( ImplMapPoint( aPoint ) );
7828 - ::com::sun::star::awt::Size aS( ImplMapSize( aSize ) );
7829 - return Rectangle( Point( aP.X, aP.Y ), Size( aS.Width, aS.Height ) );
7832 -// -----------------------------------------------------------------------
7834 struct CellBorder
7836 sal_Int32 mnPos; // specifies the distance to the top/left position of the table
7837 @@ -5615,14 +3630,14 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
7838 std::vector< std::pair< sal_Int32, sal_Int32 > > aColumns;
7839 std::vector< std::pair< sal_Int32, sal_Int32 > > aRows;
7841 - awt::Point aPosition( ImplMapPoint( rXShape->getPosition() ) );
7842 + awt::Point aPosition( MapPoint( rXShape->getPosition() ) );
7843 sal_uInt32 nPosition = aPosition.X;
7844 for ( sal_Int32 x = 0; x < nColumnCount; x++ )
7846 uno::Reference< beans::XPropertySet > xPropSet( xColumns->getByIndex( x ), uno::UNO_QUERY_THROW );
7847 awt::Size aS( 0, 0 );
7848 xPropSet->getPropertyValue( sWidth ) >>= aS.Width;
7849 - awt::Size aM( ImplMapSize( aS ) );
7850 + awt::Size aM( MapSize( aS ) );
7851 aColumns.push_back( std::pair< sal_Int32, sal_Int32 >( nPosition, aM.Width ) );
7852 nPosition += aM.Width;
7854 @@ -5633,7 +3648,7 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
7855 uno::Reference< beans::XPropertySet > xPropSet( xRows->getByIndex( y ), uno::UNO_QUERY_THROW );
7856 awt::Size aS( 0, 0 );
7857 xPropSet->getPropertyValue( sHeight ) >>= aS.Height;
7858 - awt::Size aM( ImplMapSize( aS ) );
7859 + awt::Size aM( MapSize( aS ) );
7860 aRows.push_back( std::pair< sal_Int32, sal_Int32 >( nPosition, aM.Height ) );
7861 nPosition += aM.Height;
7863 @@ -5752,17 +3767,17 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
7864 static const rtl::OUString sDiagonalBLTR( RTL_CONSTASCII_USTRINGPARAM ( "DiagonalBLTR" ) );
7866 // creating horz lines
7867 - sal_Int32 nYPos = ImplMapPoint( rXShape->getPosition() ).Y;
7868 + sal_Int32 nYPos = MapPoint( rXShape->getPosition() ).Y;
7869 for( sal_Int32 nLine = 0; nLine < ( xRows->getCount() + 1 ); nLine++ )
7871 - sal_Int32 nXPos = ImplMapPoint( rXShape->getPosition() ).X;
7872 + sal_Int32 nXPos = MapPoint( rXShape->getPosition() ).X;
7873 std::vector< CellBorder > vCellBorders;
7874 for( sal_Int32 nColumn = 0; nColumn < xColumns->getCount(); nColumn++ )
7876 uno::Reference< beans::XPropertySet > xPropSet( xColumns->getByIndex( nColumn ), uno::UNO_QUERY_THROW );
7877 awt::Size aS( 0, 0 );
7878 xPropSet->getPropertyValue( sWidth ) >>= aS.Width;
7879 - awt::Size aM( ImplMapSize( aS ) );
7880 + awt::Size aM( MapSize( aS ) );
7882 CellBorder aCellBorder;
7883 aCellBorder.mnPos = nXPos;
7884 @@ -5798,23 +3813,23 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
7885 uno::Reference< beans::XPropertySet > xPropSet( xRows->getByIndex( nLine ), uno::UNO_QUERY_THROW );
7886 awt::Size aS( 0, 0 );
7887 xPropSet->getPropertyValue( sHeight ) >>= aS.Height;
7888 - awt::Size aM( ImplMapSize( aS ) );
7889 + awt::Size aM( MapSize( aS ) );
7890 nYPos += aM.Height;
7894 // creating vertical lines
7895 - sal_Int32 nXPos = ImplMapPoint( rXShape->getPosition() ).X;
7896 + sal_Int32 nXPos = MapPoint( rXShape->getPosition() ).X;
7897 for( sal_Int32 nLine = 0; nLine < ( xColumns->getCount() + 1 ); nLine++ )
7899 - nYPos = ImplMapPoint( rXShape->getPosition() ).Y;
7900 + nYPos = MapPoint( rXShape->getPosition() ).Y;
7901 std::vector< CellBorder > vCellBorders;
7902 for( sal_Int32 nRow = 0; nRow < xRows->getCount(); nRow++ )
7904 uno::Reference< beans::XPropertySet > xPropSet( xRows->getByIndex( nRow ), uno::UNO_QUERY_THROW );
7905 awt::Size aS( 0, 0 );
7906 xPropSet->getPropertyValue( sHeight ) >>= aS.Height;
7907 - awt::Size aM( ImplMapSize( aS ) );
7908 + awt::Size aM( MapSize( aS ) );
7910 CellBorder aCellBorder;
7911 aCellBorder.mnPos = nYPos;
7912 @@ -5850,7 +3865,7 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
7913 uno::Reference< beans::XPropertySet > xPropSet( xColumns->getByIndex( nLine ), uno::UNO_QUERY_THROW );
7914 awt::Size aS( 0, 0 );
7915 xPropSet->getPropertyValue( sWidth ) >>= aS.Width;
7916 - awt::Size aM( ImplMapSize( aS ) );
7917 + awt::Size aM( MapSize( aS ) );
7918 nXPos += aM.Width;
7921 @@ -5862,3 +3877,43 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
7923 mpPptEscherEx->CloseContainer();
7926 +//----------------------------------------------------------------------------------------------------------
7928 +void TextObjBinary::Write( SvStream* pStrm )
7930 + sal_uInt32 nSize, nPos = pStrm->Tell();
7931 + *pStrm << (sal_uInt32)( EPP_TextCharsAtom << 16 ) << (sal_uInt32)0;
7932 + for ( void* pPtr = First(); pPtr; pPtr = Next() )
7933 + ((ParagraphObj*)pPtr)->Write( pStrm );
7934 + nSize = pStrm->Tell() - nPos;
7935 + pStrm->SeekRel( - ( (sal_Int32)nSize - 4 ) );
7936 + *pStrm << (sal_uInt32)( nSize - 8 );
7937 + pStrm->SeekRel( nSize - 8 );
7940 +void TextObjBinary::WriteTextSpecInfo( SvStream* pStrm )
7942 + sal_uInt32 nCharactersLeft( Count() );
7943 + if ( nCharactersLeft >= 1 )
7945 + EscherExAtom aAnimationInfoAtom( *pStrm, EPP_TextSpecInfoAtom, 0, 0 );
7946 + for ( ParagraphObj* pPtr = static_cast < ParagraphObj * >( First() ); nCharactersLeft && pPtr; pPtr = static_cast< ParagraphObj* >( Next() ) )
7948 + for ( PortionObj* pPortion = static_cast< PortionObj* >( pPtr->First() ); nCharactersLeft && pPortion; pPortion = static_cast< PortionObj* >( pPtr->Next() ) )
7950 + sal_Int32 nPortionSize = pPortion->mnTextSize >= nCharactersLeft ? nCharactersLeft : pPortion->mnTextSize;
7951 + sal_Int32 nFlags = 7;
7952 + nCharactersLeft -= nPortionSize;
7953 + *pStrm << static_cast< sal_uInt32 >( nPortionSize )
7954 + << nFlags
7955 + << static_cast< sal_Int16 >( 1 ) // spellinfo -> needs rechecking
7956 + << static_cast< sal_Int16 >( MsLangId::convertLocaleToLanguageWithFallback( pPortion->meCharLocale ) )
7957 + << static_cast< sal_Int16 >( 0 ); // alt language
7960 + if ( nCharactersLeft )
7961 + *pStrm << nCharactersLeft << static_cast< sal_Int32 >( 1 ) << static_cast< sal_Int16 >( 1 );
7965 diff --git sd/source/filter/eppt/exports.map sd/source/filter/eppt/exports.map
7966 deleted file mode 100644
7967 index e69de29..0000000
7968 diff --git sd/source/filter/eppt/grouptable.cxx sd/source/filter/eppt/grouptable.cxx
7969 new file mode 100644
7970 index 0000000..1ed031c
7971 --- /dev/null
7972 +++ sd/source/filter/pptx/pptx-grouptable.cxx
7973 @@ -0,0 +1,114 @@
7974 +#include "grouptable.hxx"
7976 +#include <tools/gen.hxx>
7978 +using ::com::sun::star::uno::Reference;
7979 +using ::com::sun::star::container::XIndexAccess;
7981 +// ---------------------------------------------------------------------------------------------
7983 +GroupTable::GroupTable() :
7984 + mnCurrentGroupEntry ( 0 ),
7985 + mnMaxGroupEntry ( 0 ),
7986 + mnGroupsClosed ( 0 ),
7987 + mpGroupEntry ( NULL )
7989 + ImplResizeGroupTable( 32 );
7992 +// ---------------------------------------------------------------------------------------------
7994 +GroupTable::~GroupTable()
7996 + for ( sal_uInt32 i = 0; i < mnCurrentGroupEntry; delete mpGroupEntry[ i++ ] ) {}
7997 + delete[] mpGroupEntry;
8000 +// ---------------------------------------------------------------------------------------------
8002 +void GroupTable::ImplResizeGroupTable( sal_uInt32 nEntrys )
8004 + if ( nEntrys > mnMaxGroupEntry )
8006 + mnMaxGroupEntry = nEntrys;
8007 + GroupEntry** pTemp = new GroupEntry*[ nEntrys ];
8008 + for ( sal_uInt32 i = 0; i < mnCurrentGroupEntry; i++ )
8009 + pTemp[ i ] = mpGroupEntry[ i ];
8010 + if ( mpGroupEntry )
8011 + delete[] mpGroupEntry;
8012 + mpGroupEntry = pTemp;
8016 +// ---------------------------------------------------------------------------------------------
8018 +sal_Bool GroupTable::EnterGroup( Reference< XIndexAccess >& rXIndexAccessRef )
8020 + sal_Bool bRet = sal_False;
8021 + if ( rXIndexAccessRef.is() )
8023 + GroupEntry* pNewGroup = new GroupEntry( rXIndexAccessRef );
8024 + if ( pNewGroup->mnCount )
8026 + if ( mnMaxGroupEntry == mnCurrentGroupEntry )
8027 + ImplResizeGroupTable( mnMaxGroupEntry + 8 );
8028 + mpGroupEntry[ mnCurrentGroupEntry++ ] = pNewGroup;
8029 + bRet = sal_True;
8031 + else
8032 + delete pNewGroup;
8034 + return bRet;
8037 +// ---------------------------------------------------------------------------------------------
8039 +sal_uInt32 GroupTable::GetGroupsClosed()
8041 + sal_uInt32 nRet = mnGroupsClosed;
8042 + mnGroupsClosed = 0;
8043 + return nRet;
8046 +// ---------------------------------------------------------------------------------------------
8048 +void GroupTable::ClearGroupTable()
8050 + for ( sal_uInt32 i = 0; i < mnCurrentGroupEntry; i++, delete mpGroupEntry[ i ] ) {}
8051 + mnCurrentGroupEntry = 0;
8054 +// ---------------------------------------------------------------------------------------------
8056 +void GroupTable::ResetGroupTable( sal_uInt32 nCount )
8058 + ClearGroupTable();
8059 + mpGroupEntry[ mnCurrentGroupEntry++ ] = new GroupEntry( nCount );
8062 +// ---------------------------------------------------------------------------------------------
8064 +sal_Bool GroupTable::GetNextGroupEntry()
8066 + while ( mnCurrentGroupEntry )
8068 + mnIndex = mpGroupEntry[ mnCurrentGroupEntry - 1 ]->mnCurrentPos++;
8070 + if ( mpGroupEntry[ mnCurrentGroupEntry - 1 ]->mnCount > mnIndex )
8071 + return TRUE;
8073 + delete ( mpGroupEntry[ --mnCurrentGroupEntry ] );
8075 + if ( mnCurrentGroupEntry )
8076 + mnGroupsClosed++;
8078 + return FALSE;
8081 +// ---------------------------------------------------------------------------------------------
8083 +void GroupTable::SkipCurrentGroup()
8085 + if ( mnCurrentGroupEntry )
8086 + delete ( mpGroupEntry[ --mnCurrentGroupEntry ] );
8088 diff --git sd/source/filter/eppt/grouptable.hxx sd/source/filter/eppt/grouptable.hxx
8089 new file mode 100644
8090 index 0000000..c79ffa8
8091 --- /dev/null
8092 +++ sd/source/filter/pptx/grouptable.hxx
8093 @@ -0,0 +1,58 @@
8094 +#ifndef EPPT_GROUP_TABLE
8095 +#define EPPT_GROUP_TABLE
8097 +#include <com/sun/star/container/XIndexAccess.hpp>
8099 +struct GroupEntry
8101 + sal_uInt32 mnCurrentPos;
8102 + sal_uInt32 mnCount;
8103 + ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > mXIndexAccess;
8105 + GroupEntry( ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > & rIndex )
8107 + mXIndexAccess = rIndex;
8108 + mnCount =mXIndexAccess->getCount();
8109 + mnCurrentPos = 0;
8110 + };
8112 + GroupEntry( sal_uInt32 nCount )
8114 + mnCount = nCount;
8115 + mnCurrentPos = 0;
8116 + };
8118 + ~GroupEntry(){};
8122 +class GroupTable
8124 + protected:
8126 + sal_uInt32 mnIndex;
8127 + sal_uInt32 mnCurrentGroupEntry;
8128 + sal_uInt32 mnMaxGroupEntry;
8129 + sal_uInt32 mnGroupsClosed;
8130 + GroupEntry** mpGroupEntry;
8132 + void ImplResizeGroupTable( sal_uInt32 nEntrys );
8134 + public:
8136 + sal_uInt32 GetCurrentGroupIndex() const { return mnIndex; };
8137 + sal_Int32 GetCurrentGroupLevel() const { return mnCurrentGroupEntry - 1; };
8138 + ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > &
8139 + GetCurrentGroupAccess() const { return mpGroupEntry[ mnCurrentGroupEntry - 1 ]->mXIndexAccess; };
8140 + sal_uInt32 GetGroupsClosed();
8141 + void SkipCurrentGroup();
8142 + void ResetGroupTable( sal_uInt32 nCount );
8143 + void ClearGroupTable();
8144 + sal_Bool EnterGroup( ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > & rIndex );
8145 + sal_Bool GetNextGroupEntry();
8146 + GroupTable();
8147 + ~GroupTable();
8151 +#endif
8152 # commented out for the libpptx diff --git sd/source/filter/eppt/makefile.mk sd/source/filter/eppt/makefile.mk
8153 # commented out for the libpptx index 808984a..20ad859 100644
8154 # commented out for the libpptx --- sd/source/filter/pptx/makefile.mk
8155 # commented out for the libpptx +++ sd/source/filter/pptx/makefile.mk
8156 # commented out for the libpptx @@ -46,10 +46,15 @@ NOOPTFILES= $(SLO)$/epptso.obj
8157 # commented out for the libpptx .ENDIF
8158 # commented out for the libpptx
8159 # commented out for the libpptx SLOFILES = $(SLO)$/eppt.obj \
8160 # commented out for the libpptx - $(SLO)$/epptso.obj \
8161 # commented out for the libpptx + $(SLO)$/epptbase.obj \
8162 # commented out for the libpptx + $(SLO)$/epptooxml.obj \
8163 # commented out for the libpptx + $(SLO)$/epptso.obj \
8164 # commented out for the libpptx $(SLO)$/escherex.obj \
8165 # commented out for the libpptx + $(SLO)$/grouptable.obj \
8166 # commented out for the libpptx $(SLO)$/pptexanimations.obj \
8167 # commented out for the libpptx - $(SLO)$/pptexsoundcollection.obj
8168 # commented out for the libpptx + $(SLO)$/pptexsoundcollection.obj \
8169 # commented out for the libpptx + $(SLO)$/text.obj \
8170 # commented out for the libpptx + $(SLO)$/stylesheet.obj
8171 # commented out for the libpptx
8172 # commented out for the libpptx # --- Targets --------------------------------------------------------------
8173 # commented out for the libpptx
8174 diff --git sd/source/filter/eppt/stylesheet.cxx sd/source/filter/eppt/stylesheet.cxx
8175 new file mode 100644
8176 index 0000000..8e4ef54
8177 --- /dev/null
8178 +++ sd/source/filter/pptx/pptx-stylesheet.cxx
8179 @@ -0,0 +1,485 @@
8180 +#include <epptbase.hxx>
8181 +#include <epptdef.hxx>
8182 +#include <text.hxx>
8183 +#include <tools/color.hxx>
8184 +#include <svx/svxenum.hxx>
8186 +using namespace ::com::sun::star;
8188 +PPTExCharSheet::PPTExCharSheet( int nInstance )
8190 + sal_uInt16 nFontHeight = 24;
8192 + for ( int nDepth = 0; nDepth < 5; nDepth++ )
8194 + PPTExCharLevel& rLev = maCharLevel[ nDepth ];
8195 + switch ( nInstance )
8197 + case EPP_TEXTTYPE_Title :
8198 + case EPP_TEXTTYPE_CenterTitle :
8199 + nFontHeight = 44;
8200 + break;
8201 + case EPP_TEXTTYPE_Body :
8202 + case EPP_TEXTTYPE_CenterBody :
8203 + case EPP_TEXTTYPE_HalfBody :
8204 + case EPP_TEXTTYPE_QuarterBody :
8206 + switch ( nDepth )
8208 + case 0 : nFontHeight = 32; break;
8209 + case 1 : nFontHeight = 28; break;
8210 + case 2 : nFontHeight = 24; break;
8211 + default :nFontHeight = 20; break;
8214 + break;
8215 + case EPP_TEXTTYPE_Notes :
8216 + nFontHeight = 12;
8217 + break;
8218 + case EPP_TEXTTYPE_notUsed :
8219 + case EPP_TEXTTYPE_Other :
8220 + nFontHeight = 24;
8221 + break;
8223 + rLev.mnFlags = 0;
8224 + rLev.mnFont = 0;
8225 + rLev.mnAsianOrComplexFont = 0xffff;
8226 + rLev.mnFontHeight = nFontHeight;
8227 + rLev.mnFontColor = 0;
8228 + rLev.mnEscapement = 0;
8233 +void PPTExCharSheet::SetStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
8234 + FontCollection& rFontCollection, int nLevel )
8236 + PortionObj aPortionObj( rXPropSet, rFontCollection );
8238 + PPTExCharLevel& rLev = maCharLevel[ nLevel ];
8240 + if ( aPortionObj.meCharColor == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
8241 + rLev.mnFontColor = aPortionObj.mnCharColor;
8242 + if ( aPortionObj.meCharEscapement == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
8243 + rLev.mnEscapement = aPortionObj.mnCharEscapement;
8244 + if ( aPortionObj.meCharHeight == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
8245 + rLev.mnFontHeight = aPortionObj.mnCharHeight;
8246 + if ( aPortionObj.meFontName == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
8247 + rLev.mnFont = aPortionObj.mnFont;
8248 + if ( aPortionObj.meAsianOrComplexFont == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
8249 + rLev.mnAsianOrComplexFont = aPortionObj.mnAsianOrComplexFont;
8250 + rLev.mnFlags = aPortionObj.mnCharAttr;
8253 +void PPTExCharSheet::Write( SvStream& rSt, PptEscherEx*, sal_uInt16 nLev, sal_Bool, sal_Bool bSimpleText,
8254 + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPagePropSet )
8256 + const PPTExCharLevel& rLev = maCharLevel[ nLev ];
8258 + sal_uInt32 nCharFlags = 0xefffff;
8259 + if ( bSimpleText )
8260 + nCharFlags = 0x7ffff;
8262 + rSt << nCharFlags
8263 + << rLev.mnFlags
8264 + << rLev.mnFont;
8266 + sal_uInt32 nFontColor = rLev.mnFontColor;
8267 + if ( nFontColor == COL_AUTO )
8269 + sal_Bool bIsDark = sal_False;
8270 + ::com::sun::star::uno::Any aAny;
8271 + if ( PropValue::GetPropertyValue( aAny, rPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundDark" ) ), sal_True ) )
8272 + aAny >>= bIsDark;
8273 + nFontColor = bIsDark ? 0xffffff : 0x000000;
8275 + nFontColor &= 0xffffff;
8276 + nFontColor |= 0xfe000000;
8277 + if ( bSimpleText )
8279 + rSt << rLev.mnFontHeight
8280 + << nFontColor;
8282 + else
8284 + rSt << rLev.mnAsianOrComplexFont
8285 + << (sal_uInt16)0xffff // unbekannt
8286 + << (sal_uInt16)0xffff // unbekannt
8287 + << rLev.mnFontHeight
8288 + << nFontColor
8289 + << rLev.mnEscapement;
8293 +PPTExParaSheet::PPTExParaSheet( int nInstance, sal_uInt16 nDefaultTab, PPTExBulletProvider& rProv ) :
8294 + rBuProv ( rProv ),
8295 + mnInstance ( nInstance )
8297 + sal_Bool bHasBullet = FALSE;
8299 + sal_uInt16 nUpperDist = 0;
8300 + sal_uInt16 nBulletChar = 0x2022;
8301 + sal_uInt16 nBulletOfs = 0;
8302 + sal_uInt16 nTextOfs = 0;
8304 + for ( int nDepth = 0; nDepth < 5; nDepth++ )
8306 + PPTExParaLevel& rLev = maParaLevel[ nDepth ];
8307 + switch ( nInstance )
8309 + case EPP_TEXTTYPE_Title :
8310 + case EPP_TEXTTYPE_CenterTitle :
8311 + break;
8312 + case EPP_TEXTTYPE_Body :
8313 + case EPP_TEXTTYPE_CenterBody :
8314 + case EPP_TEXTTYPE_HalfBody :
8315 + case EPP_TEXTTYPE_QuarterBody :
8317 + bHasBullet = TRUE;
8318 + nUpperDist = 0x14;
8320 + break;
8321 + case EPP_TEXTTYPE_Notes :
8322 + nUpperDist = 0x1e;
8323 + break;
8325 +// default :
8326 +// case EPP_TEXTTYPE_notUsed :
8327 +// case EPP_TEXTTYPE_Other :
8328 +// break;
8330 + switch ( nDepth )
8332 + case 0 :
8334 + nBulletChar = 0x2022;
8335 + nBulletOfs = 0;
8336 + nTextOfs = ( bHasBullet ) ? 0xd8 : 0;
8338 + break;
8339 + case 1 :
8341 + nBulletChar = 0x2013;
8342 + nBulletOfs = 0x120;
8343 + nTextOfs = 0x1d4;
8345 + break;
8346 + case 2 :
8348 + nBulletChar = 0x2022;
8349 + nBulletOfs = 0x240;
8350 + nTextOfs = 0x2d0;
8352 + break;
8353 + case 3 :
8355 + nBulletChar = 0x2013;
8356 + nBulletOfs = 0x360;
8357 + nTextOfs = 0x3f0;
8359 + break;
8360 + case 4 :
8362 + nBulletChar = 0xbb;
8363 + nBulletOfs = 0x480;
8364 + nTextOfs = 0x510;
8366 + break;
8368 + rLev.mbIsBullet = bHasBullet;
8369 + rLev.mnBulletChar = nBulletChar;
8370 + rLev.mnBulletFont = 0;
8371 + rLev.mnBulletHeight = 100;
8372 + rLev.mnBulletColor = 0;
8373 + rLev.mnAdjust = 0;
8374 + rLev.mnLineFeed = 100;
8375 + rLev.mnLowerDist = 0;
8376 + rLev.mnUpperDist = nUpperDist;
8377 + rLev.mnTextOfs = nTextOfs;
8378 + rLev.mnBulletOfs = nBulletOfs;
8379 + rLev.mnDefaultTab = nDefaultTab;
8380 + rLev.mnAsianSettings = 2;
8381 + rLev.mnBiDi = 0;
8383 + rLev.mbExtendedBulletsUsed = FALSE;
8384 + rLev.mnBulletId = 0xffff;
8385 + rLev.mnBulletStart = 0;
8386 + rLev.mnMappedNumType = 0;
8387 + rLev.mnNumberingType = 0;
8391 +void PPTExParaSheet::SetStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
8392 + FontCollection& rFontCollection, int nLevel, const PPTExCharLevel& rCharLevel )
8394 + ParagraphObj aParagraphObj( rXPropSet, rBuProv );
8395 + aParagraphObj.CalculateGraphicBulletSize( rCharLevel.mnFontHeight );
8396 + PPTExParaLevel& rLev = maParaLevel[ nLevel ];
8398 + if ( aParagraphObj.meTextAdjust == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
8399 + rLev.mnAdjust = aParagraphObj.mnTextAdjust;
8400 + rLev.mnOOAdjust = aParagraphObj.mnOOTextAdjust;
8401 + if ( aParagraphObj.meLineSpacing == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
8403 + sal_Int16 nLineSpacing = aParagraphObj.mnLineSpacing;
8404 + if ( nLineSpacing > 0 ) // if nLinespacing is < 0 the linespacing is an absolute spacing
8406 + sal_Bool bFixedLineSpacing = sal_False;
8407 + uno::Any aAny = rXPropSet->getPropertyValue( ::rtl::OUString(
8408 + RTL_CONSTASCII_USTRINGPARAM(
8409 + "FontIndependentLineSpacing" ) ) );
8410 + if( !(aAny >>= bFixedLineSpacing) || !bFixedLineSpacing )
8412 + const FontCollectionEntry* pDesc = rFontCollection.GetById( rCharLevel.mnFont );
8413 + if ( pDesc )
8414 + nLineSpacing = (sal_Int16)( (double)nLineSpacing * pDesc->Scaling + 0.5 );
8417 + else
8419 + if ( rCharLevel.mnFontHeight > (sal_uInt16)( ((double)-nLineSpacing) * 0.001 * 72.0 / 2.54 ) ) // 1/100mm to point
8421 + const FontCollectionEntry* pDesc = rFontCollection.GetById( rCharLevel.mnFont );
8422 + if ( pDesc )
8423 + nLineSpacing = (sal_Int16)( (double)100.0 * pDesc->Scaling + 0.5 );
8424 + else
8425 + nLineSpacing = 100;
8427 + else
8428 + nLineSpacing = (sal_Int16)( (double)nLineSpacing / 4.40972 );
8430 + rLev.mnLineFeed = nLineSpacing;
8432 + if ( aParagraphObj.meLineSpacingBottom == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
8433 + rLev.mnLowerDist = aParagraphObj.mnLineSpacingBottom;
8434 + if ( aParagraphObj.meLineSpacingTop == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
8435 + rLev.mnUpperDist = aParagraphObj.mnLineSpacingTop;
8436 + if ( aParagraphObj.meForbiddenRules == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
8438 + rLev.mnAsianSettings &=~1;
8439 + if ( aParagraphObj.mbForbiddenRules )
8440 + rLev.mnAsianSettings |= 1;
8442 + if ( aParagraphObj.meParagraphPunctation == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
8444 + rLev.mnAsianSettings &=~4;
8445 + if ( aParagraphObj.mbParagraphPunctation )
8446 + rLev.mnAsianSettings |= 4;
8449 + if ( aParagraphObj.meBiDi == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
8450 + rLev.mnBiDi = aParagraphObj.mnBiDi;
8452 + rLev.mbIsBullet = aParagraphObj.mbIsBullet; //( ( aParagraphObj.nBulletFlags & 1 ) != 0 );
8454 + if ( !nLevel )
8456 + if ( ( aParagraphObj.meBullet == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
8457 + && aParagraphObj.bExtendedParameters )
8459 + for ( sal_Int16 i = 0; i < 5; i++ )
8461 + PPTExParaLevel& rLevel = maParaLevel[ i ];
8462 + if ( i )
8463 + aParagraphObj.ImplGetNumberingLevel( rBuProv, i, FALSE );
8464 +// rLevel.mbIsBullet = ( ( aParagraphObj.nBulletFlags & 1 ) != 0 );
8465 + rLevel.mnTextOfs = aParagraphObj.nTextOfs;
8466 + rLevel.mnBulletOfs = (sal_uInt16)aParagraphObj.nBulletOfs;
8467 + rLevel.mnBulletChar = aParagraphObj.cBulletId;
8468 + FontCollectionEntry aFontDescEntry( aParagraphObj.aFontDesc.Name, aParagraphObj.aFontDesc.Family,
8469 + aParagraphObj.aFontDesc.Pitch, aParagraphObj.aFontDesc.CharSet );
8470 + rLevel.mnBulletFont = (sal_uInt16)rFontCollection.GetId( aFontDescEntry );
8471 + rLevel.mnBulletHeight = aParagraphObj.nBulletRealSize;
8472 + rLevel.mnBulletColor = aParagraphObj.nBulletColor;
8474 + rLevel.mbExtendedBulletsUsed = aParagraphObj.bExtendedBulletsUsed;
8475 + rLevel.mnBulletId = aParagraphObj.nBulletId;
8476 + rLevel.mnNumberingType = aParagraphObj.nNumberingType;
8477 + rLevel.mnBulletStart = aParagraphObj.nStartWith;
8478 + rLevel.mnMappedNumType = aParagraphObj.nMappedNumType;
8484 +void PPTExParaSheet::Write( SvStream& rSt, PptEscherEx*, sal_uInt16 nLev, sal_Bool, sal_Bool bSimpleText,
8485 + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPagePropSet )
8487 + const PPTExParaLevel& rLev = maParaLevel[ nLev ];
8489 + if ( maParaLevel[ 0 ].mbExtendedBulletsUsed || maParaLevel[ 1 ].mbExtendedBulletsUsed ||
8490 + maParaLevel[ 2 ].mbExtendedBulletsUsed || maParaLevel[ 3 ].mbExtendedBulletsUsed ||
8491 + maParaLevel[ 4 ].mbExtendedBulletsUsed )
8493 + SvStream& rOut = rBuProv.aBuExMasterStream;
8494 + if ( !nLev )
8496 + rOut << (sal_uInt32)( ( EPP_PST_ExtendedParagraphMasterAtom << 16 ) | ( mnInstance << 4 ) )
8497 + << (sal_uInt32)( 5 * 16 + 2 )
8498 + << (sal_uInt16)5; // depth
8500 + sal_uInt16 nBulletId = rLev.mnBulletId;
8501 + if ( rLev.mnNumberingType != SVX_NUM_BITMAP )
8502 + nBulletId = 0xffff;
8503 + rOut << (sal_uInt32)0x03800000
8504 + << (sal_uInt16)nBulletId
8505 + << (sal_uInt32)rLev.mnMappedNumType
8506 + << (sal_uInt16)rLev.mnBulletStart
8507 + << (sal_uInt32)0;
8510 + sal_uInt32 nParaFlags = 0x3ffdff;
8511 + sal_uInt16 nBulletFlags = ( rLev.mbIsBullet ) ? 0xf : 0xe;
8513 + if ( nLev )
8514 + nParaFlags &= 0x207fff;
8515 + if ( bSimpleText )
8516 + nParaFlags &= 0x7fff;
8517 + sal_uInt32 nBulletColor = rLev.mnBulletColor;
8518 + if ( nBulletColor == COL_AUTO )
8520 + sal_Bool bIsDark = sal_False;
8521 + ::com::sun::star::uno::Any aAny;
8522 + if ( PropValue::GetPropertyValue( aAny, rPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundDark" ) ), sal_True ) )
8523 + aAny >>= bIsDark;
8524 + nBulletColor = bIsDark ? 0xffffff : 0x000000;
8526 + nBulletColor &= 0xffffff;
8527 + nBulletColor |= 0xfe000000;
8528 + rSt << nParaFlags
8529 + << nBulletFlags
8530 + << rLev.mnBulletChar
8531 + << rLev.mnBulletFont
8532 + << rLev.mnBulletHeight
8533 + << nBulletColor
8534 + << rLev.mnAdjust
8535 + << rLev.mnLineFeed
8536 + << rLev.mnUpperDist
8537 + << rLev.mnLowerDist
8538 + << rLev.mnTextOfs
8539 + << rLev.mnBulletOfs;
8541 + if ( bSimpleText || nLev )
8543 + if ( nParaFlags & 0x200000 )
8544 + rSt << rLev.mnBiDi;
8546 + else
8548 + rSt << rLev.mnDefaultTab
8549 + << (sal_uInt16)0
8550 + << (sal_uInt16)0
8551 + << rLev.mnAsianSettings
8552 + << rLev.mnBiDi;
8557 +PPTExStyleSheet::PPTExStyleSheet( sal_uInt16 nDefaultTab, PPTExBulletProvider& rBuProv )
8559 + for ( int nInstance = EPP_TEXTTYPE_Title; nInstance <= EPP_TEXTTYPE_QuarterBody; nInstance++ )
8561 + mpParaSheet[ nInstance ] = ( nInstance == EPP_TEXTTYPE_notUsed ) ? NULL : new PPTExParaSheet( nInstance, nDefaultTab, rBuProv );
8562 + mpCharSheet[ nInstance ] = ( nInstance == EPP_TEXTTYPE_notUsed ) ? NULL : new PPTExCharSheet( nInstance );
8566 +PPTExStyleSheet::~PPTExStyleSheet()
8568 + for ( int nInstance = EPP_TEXTTYPE_Title; nInstance <= EPP_TEXTTYPE_QuarterBody; nInstance++ )
8570 + if ( nInstance == EPP_TEXTTYPE_notUsed )
8571 + continue;
8573 + delete mpParaSheet[ nInstance ];
8574 + delete mpCharSheet[ nInstance ];
8578 +void PPTExStyleSheet::SetStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
8579 + FontCollection& rFontCollection, int nInstance, int nLevel )
8581 + if ( nInstance == EPP_TEXTTYPE_notUsed )
8582 + return;
8583 + mpCharSheet[ nInstance ]->SetStyleSheet( rXPropSet, rFontCollection, nLevel );
8584 + mpParaSheet[ nInstance ]->SetStyleSheet( rXPropSet, rFontCollection, nLevel, mpCharSheet[ nInstance ]->maCharLevel[ nLevel ] );
8587 +sal_Bool PPTExStyleSheet::IsHardAttribute( sal_uInt32 nInstance, sal_uInt32 nLevel, PPTExTextAttr eAttr, sal_uInt32 nValue )
8589 + const PPTExParaLevel& rPara = mpParaSheet[ nInstance ]->maParaLevel[ nLevel ];
8590 + const PPTExCharLevel& rChar = mpCharSheet[ nInstance ]->maCharLevel[ nLevel ];
8592 + sal_uInt32 nFlag = 0;
8594 + switch ( eAttr )
8596 + case ParaAttr_BulletOn : return ( rPara.mbIsBullet ) ? ( nValue ) ? FALSE : TRUE : ( nValue ) ? TRUE : FALSE;
8597 + case ParaAttr_BuHardFont :
8598 + case ParaAttr_BulletFont : return ( rPara.mnBulletFont != nValue );
8599 + case ParaAttr_BuHardColor :
8600 + case ParaAttr_BulletColor : return ( rPara.mnBulletColor != nValue );
8601 + case ParaAttr_BuHardHeight :
8602 + case ParaAttr_BulletHeight : return ( rPara.mnBulletHeight != nValue );
8603 + case ParaAttr_BulletChar : return ( rPara.mnBulletChar != nValue );
8604 + case ParaAttr_Adjust : return ( rPara.mnAdjust != nValue );
8605 + case ParaAttr_LineFeed : return ( rPara.mnLineFeed != nValue );
8606 + case ParaAttr_UpperDist : return ( rPara.mnUpperDist != nValue );
8607 + case ParaAttr_LowerDist : return ( rPara.mnLowerDist != nValue );
8608 + case ParaAttr_TextOfs : return ( rPara.mnTextOfs != nValue );
8609 + case ParaAttr_BulletOfs : return ( rPara.mnBulletOfs != nValue );
8610 + case ParaAttr_DefaultTab : return ( rPara.mnDefaultTab != nValue );
8611 + case ParaAttr_BiDi : return ( rPara.mnBiDi != nValue );
8612 + case CharAttr_Bold : nFlag = 1; break;
8613 + case CharAttr_Italic : nFlag = 2; break;
8614 + case CharAttr_Underline : nFlag = 4; break;
8615 + case CharAttr_Shadow : nFlag = 16; break;
8616 + case CharAttr_Strikeout : nFlag = 256; break;
8617 + case CharAttr_Embossed : nFlag = 512; break;
8618 + case CharAttr_Font : return ( rChar.mnFont != nValue );
8619 + case CharAttr_AsianOrComplexFont : return ( rChar.mnAsianOrComplexFont != nValue );
8620 + case CharAttr_Symbol : return TRUE;
8621 + case CharAttr_FontHeight : return ( rChar.mnFontHeight != nValue );
8622 + case CharAttr_FontColor : return ( rChar.mnFontColor != nValue );
8623 + case CharAttr_Escapement : return ( rChar.mnEscapement != nValue );
8624 + default:
8625 + break;
8626 + };
8627 + if ( nFlag )
8629 + if ( rChar.mnFlags & nFlag )
8630 + return ( ( nValue & nFlag ) == 0 );
8631 + else
8632 + return ( ( nValue & nFlag ) != 0 );
8634 + return TRUE;
8637 +sal_uInt32 PPTExStyleSheet::SizeOfTxCFStyleAtom() const
8639 + return 24;
8642 +// the TxCFStyleAtom stores the text properties that are used
8643 +// when creating new objects in PowerPoint.
8645 +void PPTExStyleSheet::WriteTxCFStyleAtom( SvStream& rSt )
8647 + const PPTExCharLevel& rCharStyle = mpCharSheet[ EPP_TEXTTYPE_Other ]->maCharLevel[ 0 ];
8649 + sal_uInt16 nFlags = 0x60 // ??
8650 + | 0x02 // fontsize;
8651 + | 0x04; // fontcolor
8653 + sal_uInt32 nCharFlags = rCharStyle.mnFlags;
8654 + nCharFlags &= CharAttr_Italic | CharAttr_Bold | CharAttr_Underline | CharAttr_Shadow;
8656 + rSt << (sal_uInt32)( EPP_TxCFStyleAtom << 16 ) // recordheader
8657 + << SizeOfTxCFStyleAtom() - 8
8658 + << (sal_uInt16)( 0x80 | nCharFlags )
8659 + << (sal_uInt16)nFlags
8660 + << (sal_uInt16)nCharFlags
8661 + << (sal_Int32)-1 // ?
8662 + << rCharStyle.mnFontHeight
8663 + << rCharStyle.mnFontColor;
8665 diff --git sd/source/filter/eppt/text.cxx sd/source/filter/eppt/text.cxx
8666 new file mode 100644
8667 index 0000000..e5820ca
8668 --- /dev/null
8669 +++ sd/source/filter/pptx/pptx-text.cxx
8670 @@ -0,0 +1,1411 @@
8671 +#include "text.hxx"
8673 +#include <com/sun/star/awt/CharSet.hpp>
8674 +#include <com/sun/star/awt/FontWeight.hpp>
8675 +#include <com/sun/star/awt/FontUnderline.hpp>
8676 +#include <com/sun/star/beans/XPropertyState.hpp>
8677 +#include <com/sun/star/container/XEnumerationAccess.hpp>
8678 +#include <com/sun/star/container/XIndexReplace.hpp>
8679 +#include <com/sun/star/i18n/XBreakIterator.hpp>
8680 +#include <com/sun/star/i18n/ScriptDirection.hpp>
8681 +#include <com/sun/star/i18n/ScriptType.hpp>
8682 +#include <com/sun/star/i18n/XScriptTypeDetector.hpp>
8683 +#include <com/sun/star/text/FontRelief.hpp>
8684 +#include <com/sun/star/text/XTextField.hpp>
8685 +#include <com/sun/star/text/XTextRange.hpp>
8686 +#include <com/sun/star/style/LineSpacing.hpp>
8687 +#include <com/sun/star/style/LineSpacingMode.hpp>
8688 +#include <com/sun/star/style/ParagraphAdjust.hpp>
8689 +#include <com/sun/star/style/TabStop.hpp>
8691 +#include <svtools/languageoptions.hxx>
8692 +#include <sfx2/app.hxx>
8693 +#include <svx/svxenum.hxx>
8694 +#include <svx/frmdir.hxx>
8695 +#include <vcl/fontcvt.hxx>
8696 +#include <vcl/metric.hxx>
8697 +#include <vcl/outdev.hxx>
8698 +#include <vcl/virdev.hxx>
8699 +#include <comphelper/processfactory.hxx>
8700 +#include <oox/export/drawingml.hxx> // for SubstituteBullet
8702 +com::sun::star::uno::Reference< com::sun::star::i18n::XBreakIterator > xPPTBreakIter;
8703 +com::sun::star::uno::Reference< com::sun::star::i18n::XScriptTypeDetector > xScriptTypeDetector;
8705 +// -----------------------------------------------------------------------
8707 +PortionObj::PortionObj( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
8708 + FontCollection& rFontCollection ) :
8709 + mnCharAttrHard ( 0 ),
8710 + mnCharAttr ( 0 ),
8711 + mnFont ( 0 ),
8712 + mnAsianOrComplexFont( 0xffff ),
8713 + mnTextSize ( 0 ),
8714 + mbLastPortion ( TRUE ),
8715 + mpText ( NULL ),
8716 + mpFieldEntry ( NULL )
8718 + mXPropSet = rXPropSet;
8720 + ImplGetPortionValues( rFontCollection, FALSE );
8723 +PortionObj::PortionObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & rXTextRange,
8724 + sal_Bool bLast, FontCollection& rFontCollection ) :
8725 + mnCharAttrHard ( 0 ),
8726 + mnCharAttr ( 0 ),
8727 + mnFont ( 0 ),
8728 + mnAsianOrComplexFont ( 0xffff ),
8729 + mbLastPortion ( bLast ),
8730 + mpText ( NULL ),
8731 + mpFieldEntry ( NULL )
8733 + String aString( rXTextRange->getString() );
8734 + String aURL;
8735 + BOOL bRTL_endingParen = FALSE;
8737 + mnTextSize = aString.Len();
8738 + if ( bLast )
8739 + mnTextSize++;
8741 + if ( mnTextSize )
8743 + mpFieldEntry = NULL;
8744 + sal_uInt32 nFieldType = 0;
8746 + mXPropSet = ::com::sun::star::uno::Reference<
8747 + ::com::sun::star::beans::XPropertySet >
8748 + ( rXTextRange, ::com::sun::star::uno::UNO_QUERY );
8749 + mXPropState = ::com::sun::star::uno::Reference<
8750 + ::com::sun::star::beans::XPropertyState >
8751 + ( rXTextRange, ::com::sun::star::uno::UNO_QUERY );
8753 + sal_Bool bPropSetsValid = ( mXPropSet.is() && mXPropState.is() );
8754 + if ( bPropSetsValid )
8755 + nFieldType = ImplGetTextField( rXTextRange, mXPropSet, aURL );
8756 + if ( nFieldType )
8758 + mpFieldEntry = new FieldEntry( nFieldType, 0, mnTextSize );
8759 + if ( ( nFieldType >> 28 == 4 ) )
8761 + mpFieldEntry->aRepresentation = aString;
8762 + mpFieldEntry->aFieldUrl = aURL;
8765 + sal_Bool bSymbol = FALSE;
8767 + if ( bPropSetsValid && ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontCharSet" ) ), FALSE ) )
8769 + sal_Int16 nCharset = 0;
8770 + mAny >>= nCharset;
8771 + if ( nCharset == ::com::sun::star::awt::CharSet::SYMBOL )
8772 + bSymbol = TRUE;
8774 + if ( mpFieldEntry && ( nFieldType & 0x800000 ) ) // placeholder ?
8776 + mnTextSize = 1;
8777 + if ( bLast )
8778 + mnTextSize++;
8779 + mpText = new sal_uInt16[ mnTextSize ];
8780 + mpText[ 0 ] = 0x2a;
8782 + else
8784 + const sal_Unicode* pText = aString.GetBuffer();
8785 + // For i39516 - a closing parenthesis that ends an RTL string is displayed backwards by PPT
8786 + // Solution: add a Unicode Right-to-Left Mark, following the method described in i18024
8787 + if ( bLast && pText[ aString.Len() - 1 ] == sal_Unicode(')') && rFontCollection.GetScriptDirection( aString ) == com::sun::star::i18n::ScriptDirection::RIGHT_TO_LEFT )
8789 + mnTextSize++;
8790 + bRTL_endingParen = TRUE;
8792 + mpText = new sal_uInt16[ mnTextSize ];
8793 + sal_uInt16 nChar;
8794 + for ( int i = 0; i < aString.Len(); i++ )
8796 + nChar = (sal_uInt16)pText[ i ];
8797 + if ( nChar == 0xa )
8798 + nChar++;
8799 + else if ( !bSymbol )
8801 + switch ( nChar )
8803 + // Currency
8804 + case 128: nChar = 0x20AC; break;
8805 + // Punctuation and other
8806 + case 130: nChar = 0x201A; break;// SINGLE LOW-9 QUOTATION MARK
8807 + case 131: nChar = 0x0192; break;// LATIN SMALL LETTER F WITH HOOK
8808 + case 132: nChar = 0x201E; break;// DOUBLE LOW-9 QUOTATION MARK
8809 + // LOW DOUBLE PRIME QUOTATION MARK
8810 + case 133: nChar = 0x2026; break;// HORIZONTAL ELLIPSES
8811 + case 134: nChar = 0x2020; break;// DAGGER
8812 + case 135: nChar = 0x2021; break;// DOUBLE DAGGER
8813 + case 136: nChar = 0x02C6; break;// MODIFIER LETTER CIRCUMFLEX ACCENT
8814 + case 137: nChar = 0x2030; break;// PER MILLE SIGN
8815 + case 138: nChar = 0x0160; break;// LATIN CAPITAL LETTER S WITH CARON
8816 + case 139: nChar = 0x2039; break;// SINGLE LEFT-POINTING ANGLE QUOTATION MARK
8817 + case 140: nChar = 0x0152; break;// LATIN CAPITAL LIGATURE OE
8818 + case 142: nChar = 0x017D; break;// LATIN CAPITAL LETTER Z WITH CARON
8819 + case 145: nChar = 0x2018; break;// LEFT SINGLE QUOTATION MARK
8820 + // MODIFIER LETTER TURNED COMMA
8821 + case 146: nChar = 0x2019; break;// RIGHT SINGLE QUOTATION MARK
8822 + // MODIFIER LETTER APOSTROPHE
8823 + case 147: nChar = 0x201C; break;// LEFT DOUBLE QUOTATION MARK
8824 + // REVERSED DOUBLE PRIME QUOTATION MARK
8825 + case 148: nChar = 0x201D; break;// RIGHT DOUBLE QUOTATION MARK
8826 + // REVERSED DOUBLE PRIME QUOTATION MARK
8827 + case 149: nChar = 0x2022; break;// BULLET
8828 + case 150: nChar = 0x2013; break;// EN DASH
8829 + case 151: nChar = 0x2014; break;// EM DASH
8830 + case 152: nChar = 0x02DC; break;// SMALL TILDE
8831 + case 153: nChar = 0x2122; break;// TRADE MARK SIGN
8832 + case 154: nChar = 0x0161; break;// LATIN SMALL LETTER S WITH CARON
8833 + case 155: nChar = 0x203A; break;// SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
8834 + case 156: nChar = 0x0153; break;// LATIN SMALL LIGATURE OE
8835 + case 158: nChar = 0x017E; break;// LATIN SMALL LETTER Z WITH CARON
8836 + case 159: nChar = 0x0178; break;// LATIN CAPITAL LETTER Y WITH DIAERESIS
8837 +// case 222: nChar = 0x00B6; break;// PILCROW SIGN / PARAGRAPH SIGN
8840 + mpText[ i ] = nChar;
8843 + if ( bRTL_endingParen )
8844 + mpText[ mnTextSize - 2 ] = 0x200F; // Unicode Right-to-Left mark
8846 + if ( bLast )
8847 + mpText[ mnTextSize - 1 ] = 0xd;
8849 + if ( bPropSetsValid )
8850 + ImplGetPortionValues( rFontCollection, TRUE );
8854 +PortionObj::PortionObj( PortionObj& rPortionObj )
8855 +: PropStateValue( rPortionObj )
8857 + ImplConstruct( rPortionObj );
8860 +PortionObj::~PortionObj()
8862 + ImplClear();
8865 +void PortionObj::Write( SvStream* pStrm, sal_Bool bLast )
8867 + sal_uInt32 nCount = mnTextSize;
8868 + if ( bLast && mbLastPortion )
8869 + nCount--;
8870 + for ( sal_uInt32 i = 0; i < nCount; i++ )
8871 + *pStrm << (sal_uInt16)mpText[ i ];
8874 +void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool bGetPropStateValue )
8877 + sal_Bool bOk = ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontName" ) ), bGetPropStateValue );
8878 + meFontName = ePropState;
8879 + if ( bOk )
8881 + FontCollectionEntry aFontDesc( *(::rtl::OUString*)mAny.getValue() );
8882 + sal_uInt32 nCount = rFontCollection.GetCount();
8883 + mnFont = (sal_uInt16)rFontCollection.GetId( aFontDesc );
8884 + if ( mnFont == nCount )
8886 + FontCollectionEntry& rFontDesc = rFontCollection.GetLast();
8887 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontCharSet" ) ), sal_False ) )
8888 + mAny >>= rFontDesc.CharSet;
8889 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontFamily" ) ), sal_False ) )
8890 + mAny >>= rFontDesc.Family;
8891 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontPitch" ) ), sal_False ) )
8892 + mAny >>= rFontDesc.Pitch;
8896 + sal_Int16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( Application::GetSettings().GetLanguage() );
8897 + if ( mpText && mnTextSize && xPPTBreakIter.is() )
8899 + rtl::OUString sT( mpText, mnTextSize );
8900 + nScriptType = xPPTBreakIter->getScriptType( sT, 0 );
8902 + if ( nScriptType != com::sun::star::i18n::ScriptType::COMPLEX )
8904 + bOk = ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontNameAsian" ) ), bGetPropStateValue );
8905 + meAsianOrComplexFont = ePropState;
8906 + if ( bOk )
8908 + FontCollectionEntry aFontDesc( *(::rtl::OUString*)mAny.getValue() );
8909 + sal_uInt32 nCount = rFontCollection.GetCount();
8910 + mnAsianOrComplexFont = (sal_uInt16)rFontCollection.GetId( aFontDesc );
8911 + if ( mnAsianOrComplexFont == nCount )
8913 + FontCollectionEntry& rFontDesc = rFontCollection.GetLast();
8914 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontCharSetAsian" ) ), sal_False ) )
8915 + mAny >>= rFontDesc.CharSet;
8916 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontFamilyAsian" ) ), sal_False ) )
8917 + mAny >>= rFontDesc.Family;
8918 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontPitchAsian" ) ), sal_False ) )
8919 + mAny >>= rFontDesc.Pitch;
8923 + else
8925 + bOk = ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontNameComplex" ) ), bGetPropStateValue );
8926 + meAsianOrComplexFont = ePropState;
8927 + if ( bOk )
8929 + FontCollectionEntry aFontDesc( *(::rtl::OUString*)mAny.getValue() );
8930 + sal_uInt32 nCount = rFontCollection.GetCount();
8931 + mnAsianOrComplexFont = (sal_uInt16)rFontCollection.GetId( aFontDesc );
8932 + if ( mnAsianOrComplexFont == nCount )
8934 + FontCollectionEntry& rFontDesc = rFontCollection.GetLast();
8935 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontCharSetComplex" ) ), sal_False ) )
8936 + mAny >>= rFontDesc.CharSet;
8937 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontFamilyComplex" ) ), sal_False ) )
8938 + mAny >>= rFontDesc.Family;
8939 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharFontPitchComplex" ) ), sal_False ) )
8940 + mAny >>= rFontDesc.Pitch;
8945 + if ( nScriptType != com::sun::star::i18n::ScriptType::COMPLEX )
8947 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharWeight" ) ), bGetPropStateValue ) )
8949 + float fFloat = 0;
8950 + mAny >>= fFloat;
8951 + if ( fFloat >= ::com::sun::star::awt::FontWeight::SEMIBOLD )
8952 + mnCharAttr |= 1;
8955 + else
8957 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharWeightComplex" ) ), bGetPropStateValue ) )
8959 + float fFloat = 0;
8960 + mAny >>= fFloat;
8961 + if ( fFloat >= ::com::sun::star::awt::FontWeight::SEMIBOLD )
8962 + mnCharAttr |= 1;
8966 + if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
8967 + mnCharAttrHard |= 1;
8969 + if ( nScriptType != com::sun::star::i18n::ScriptType::COMPLEX )
8971 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharPosture" ) ), bGetPropStateValue ) )
8973 + ::com::sun::star::awt::FontSlant aFS;
8974 + mAny >>= aFS;
8975 + switch ( aFS )
8977 + case ::com::sun::star::awt::FontSlant_OBLIQUE :
8978 + case ::com::sun::star::awt::FontSlant_ITALIC :
8979 + mnCharAttr |= 2;
8980 + break;
8981 + default:
8982 + break;
8986 + else
8988 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharPostureComplex" ) ), bGetPropStateValue ) )
8990 + ::com::sun::star::awt::FontSlant aFS;
8991 + mAny >>= aFS;
8992 + switch ( aFS )
8994 + case ::com::sun::star::awt::FontSlant_OBLIQUE :
8995 + case ::com::sun::star::awt::FontSlant_ITALIC :
8996 + mnCharAttr |= 2;
8997 + break;
8998 + default:
8999 + break;
9004 + if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
9005 + mnCharAttrHard |= 2;
9007 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharUnderline" ) ), bGetPropStateValue ) )
9009 + sal_Int16 nVal = 0;
9010 + mAny >>= nVal;
9011 + switch ( nVal )
9013 + case ::com::sun::star::awt::FontUnderline::SINGLE :
9014 + case ::com::sun::star::awt::FontUnderline::DOUBLE :
9015 + case ::com::sun::star::awt::FontUnderline::DOTTED :
9016 + mnCharAttr |= 4;
9019 + if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
9020 + mnCharAttrHard |= 4;
9022 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharShadowed" ) ), bGetPropStateValue ) )
9024 + sal_Bool bBool = false;
9025 + mAny >>= bBool;
9026 + if ( bBool )
9027 + mnCharAttr |= 0x10;
9029 + if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
9030 + mnCharAttrHard |= 16;
9032 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharLocale" ) ), bGetPropStateValue ) )
9034 + com::sun::star::lang::Locale eLocale;
9035 + if ( mAny >>= eLocale )
9036 + meCharLocale = eLocale;
9039 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharRelief" ) ), bGetPropStateValue ) )
9041 + sal_Int16 nVal = ::com::sun::star::text::FontRelief::NONE;
9042 + mAny >>= nVal;
9043 + if ( nVal != ::com::sun::star::text::FontRelief::NONE )
9044 + mnCharAttr |= 512;
9046 + if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE )
9047 + mnCharAttrHard |= 512;
9049 + mnCharHeight = 24;
9050 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharHeight" ) ), bGetPropStateValue ) )
9052 + float fVal = 0;
9053 + mAny >>= fVal;
9054 + mnCharHeight = (sal_uInt16)( fVal + 0.5 );
9056 + meCharHeight = ePropState;
9058 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharColor" ) ), bGetPropStateValue ) )
9060 + sal_uInt32 nSOColor = *( (sal_uInt32*)mAny.getValue() );
9061 + mnCharColor = nSOColor & 0xff00ff00; // green and hibyte
9062 + mnCharColor |= (sal_uInt8)( nSOColor ) << 16; // red and blue is switched
9063 + mnCharColor |= (sal_uInt8)( nSOColor >> 16 );
9065 + meCharColor = ePropState;
9067 + mnCharEscapement = 0;
9068 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharEscapement" ) ), bGetPropStateValue ) )
9070 + mAny >>= mnCharEscapement;
9071 + if ( mnCharEscapement > 100 )
9072 + mnCharEscapement = 33;
9073 + else if ( mnCharEscapement < -100 )
9074 + mnCharEscapement = -33;
9076 + meCharEscapement = ePropState;
9079 +void PortionObj::ImplClear()
9081 + delete (FieldEntry*)mpFieldEntry;
9082 + delete[] mpText;
9085 +void PortionObj::ImplConstruct( PortionObj& rPortionObj )
9087 + mbLastPortion = rPortionObj.mbLastPortion;
9088 + mnTextSize = rPortionObj.mnTextSize;
9089 + mnCharColor = rPortionObj.mnCharColor;
9090 + mnCharEscapement = rPortionObj.mnCharEscapement;
9091 + mnCharAttr = rPortionObj.mnCharAttr;
9092 + mnCharHeight = rPortionObj.mnCharHeight;
9093 + mnFont = rPortionObj.mnFont;
9094 + mnAsianOrComplexFont = rPortionObj.mnAsianOrComplexFont;
9096 + if ( rPortionObj.mpText )
9098 + mpText = new sal_uInt16[ mnTextSize ];
9099 + memcpy( mpText, rPortionObj.mpText, mnTextSize << 1 );
9101 + else
9102 + mpText = NULL;
9104 + if ( rPortionObj.mpFieldEntry )
9105 + mpFieldEntry = new FieldEntry( *( rPortionObj.mpFieldEntry ) );
9106 + else
9107 + mpFieldEntry = NULL;
9110 +sal_uInt32 PortionObj::ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition )
9112 + if ( mpFieldEntry && ( !mpFieldEntry->nFieldStartPos ) )
9114 + mpFieldEntry->nFieldStartPos += nCurrentTextPosition;
9115 + mpFieldEntry->nFieldEndPos += nCurrentTextPosition;
9117 + return mnTextSize;
9120 +// -----------------------------------------------------------------------
9121 +// Rueckgabe: 0 = kein TextField
9122 +// bit28->31 text field type :
9123 +// 1 = Date
9124 +// 2 = Time
9125 +// 3 = SlideNumber
9126 +// 4 = Url
9127 +// 5 = DateTime
9128 +// 6 = header
9129 +// 7 = footer
9130 +// bit24->27 text field sub type (optional)
9131 +// 23-> PPT Textfield needs a placeholder
9133 +sal_uInt32 PortionObj::ImplGetTextField( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & ,
9134 + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet, String& rURL )
9136 + sal_uInt32 nRetValue = 0;
9137 + sal_Int32 nFormat;
9138 + ::com::sun::star::uno::Any aAny;
9139 + if ( GetPropertyValue( aAny, rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "TextPortionType" ) ), sal_True ) )
9141 + String aTextFieldType( *(::rtl::OUString*)aAny.getValue() );
9142 + if ( aTextFieldType == String( RTL_CONSTASCII_USTRINGPARAM( "TextField" ) ) )
9144 + if ( GetPropertyValue( aAny, rXPropSet, aTextFieldType, sal_True ) )
9146 + ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextField > aXTextField;
9147 + if ( aAny >>= aXTextField )
9149 + if ( aXTextField.is() )
9151 + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
9152 + xFieldPropSet( aXTextField, ::com::sun::star::uno::UNO_QUERY );
9153 + if ( xFieldPropSet.is() )
9155 + String aFieldKind( aXTextField->getPresentation( TRUE ) );
9156 + if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "Date" ) ) )
9158 + if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsFix" ) ) ), sal_True )
9160 + sal_Bool bBool = true;
9161 + aAny >>= bBool;
9162 + if ( !bBool ) // Fixed DateFields gibt es in PPT nicht
9164 + if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Format" ) ) ), sal_True )
9166 + nFormat = *(sal_Int32*)aAny.getValue();
9167 + switch ( nFormat )
9169 + default:
9170 + case 5 :
9171 + case 4 :
9172 + case 2 : nFormat = 0; break;
9173 + case 8 :
9174 + case 9 :
9175 + case 3 : nFormat = 1; break;
9176 + case 7 :
9177 + case 6 : nFormat = 2; break;
9179 + nRetValue |= ( ( ( 1 << 4 ) | nFormat ) << 24 ) | 0x800000;
9184 + else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) )
9186 + if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) ), sal_True )
9187 + rURL = String( *(::rtl::OUString*)aAny.getValue() );
9188 + nRetValue = 4 << 28;
9190 + else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "Page" ) ) )
9192 + nRetValue = 3 << 28 | 0x800000;
9194 + else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "Pages" ) ) )
9198 + else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "Time" ) ) )
9200 + if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsFix" ) ) ), sal_True )
9202 + sal_Bool bBool = true;
9203 + aAny >>= bBool;
9204 + if ( !bBool )
9206 + if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsFix" ) ) ), sal_True )
9208 + nFormat = *(sal_Int32*)aAny.getValue();
9209 + nRetValue |= ( ( ( 2 << 4 ) | nFormat ) << 24 ) | 0x800000;
9214 + else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "File" ) ) )
9218 + else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "Table" ) ) )
9222 + else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "ExtTime" ) ) )
9224 + if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsFix" ) ) ), sal_True )
9226 + sal_Bool bBool = true;
9227 + aAny >>= bBool;
9228 + if ( !bBool )
9230 + if ( GetPropertyValue( aAny, xFieldPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Format" ) ) ), sal_True )
9232 + nFormat = *(sal_Int32*)aAny.getValue();
9233 + switch ( nFormat )
9235 + default:
9236 + case 6 :
9237 + case 7 :
9238 + case 8 :
9239 + case 2 : nFormat = 12; break;
9240 + case 3 : nFormat = 9; break;
9241 + case 5 :
9242 + case 4 : nFormat = 10; break;
9245 + nRetValue |= ( ( ( 2 << 4 ) | nFormat ) << 24 ) | 0x800000;
9250 + else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "ExtFile" ) ) )
9254 + else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "Author" ) ) )
9258 + else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "DateTime" ) ) )
9260 + nRetValue = 5 << 28 | 0x800000;
9262 + else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "Header" ) ) )
9264 + nRetValue = 6 << 28 | 0x800000;
9266 + else if ( aFieldKind == String( RTL_CONSTASCII_USTRINGPARAM( "Footer" ) ) )
9268 + nRetValue = 7 << 28 | 0x800000;
9276 + return nRetValue;
9279 +PortionObj& PortionObj::operator=( PortionObj& rPortionObj )
9281 + if ( this != &rPortionObj )
9283 + ImplClear();
9284 + ImplConstruct( rPortionObj );
9286 + return *this;
9289 +// -----------------------------------------------------------------------
9291 +ParagraphObj::ParagraphObj( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
9292 + PPTExBulletProvider& rProv ) :
9293 + maMapModeSrc ( MAP_100TH_MM ),
9294 + maMapModeDest ( MAP_INCH, Point(), Fraction( 1, 576 ), Fraction( 1, 576 ) )
9296 + mXPropSet = rXPropSet;
9298 + bExtendedParameters = FALSE;
9300 + nDepth = 0;
9301 + nBulletFlags = 0;
9302 + nParaFlags = 0;
9304 + ImplGetParagraphValues( rProv, FALSE );
9307 + ParagraphObj::ParagraphObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > & rXTextContent,
9308 + ParaFlags aParaFlags, FontCollection& rFontCollection, PPTExBulletProvider& rProv ) :
9309 + maMapModeSrc ( MAP_100TH_MM ),
9310 + maMapModeDest ( MAP_INCH, Point(), Fraction( 1, 576 ), Fraction( 1, 576 ) ),
9311 + mbFirstParagraph ( aParaFlags.bFirstParagraph ),
9312 + mbLastParagraph ( aParaFlags.bLastParagraph )
9314 + bExtendedParameters = FALSE;
9316 + nDepth = 0;
9317 + nBulletFlags = 0;
9318 + nParaFlags = 0;
9320 + mXPropSet = ::com::sun::star::uno::Reference<
9321 + ::com::sun::star::beans::XPropertySet >
9322 + ( rXTextContent, ::com::sun::star::uno::UNO_QUERY );
9324 + mXPropState = ::com::sun::star::uno::Reference<
9325 + ::com::sun::star::beans::XPropertyState >
9326 + ( rXTextContent, ::com::sun::star::uno::UNO_QUERY );
9328 + if ( mXPropSet.is() && mXPropState.is() )
9330 + ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess >
9331 + aXTextPortionEA( rXTextContent, ::com::sun::star::uno::UNO_QUERY );
9332 + if ( aXTextPortionEA.is() )
9334 + ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration >
9335 + aXTextPortionE( aXTextPortionEA->createEnumeration() );
9336 + if ( aXTextPortionE.is() )
9338 + while ( aXTextPortionE->hasMoreElements() )
9340 + ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > aXCursorText;
9341 + ::com::sun::star::uno::Any aAny( aXTextPortionE->nextElement() );
9342 + if ( aAny >>= aXCursorText )
9344 + PortionObj* pPortionObj = new PortionObj( aXCursorText, !aXTextPortionE->hasMoreElements(), rFontCollection );
9345 + if ( pPortionObj->Count() )
9346 + Insert( pPortionObj, LIST_APPEND );
9347 + else
9348 + delete pPortionObj;
9353 + ImplGetParagraphValues( rProv, TRUE );//
9357 +ParagraphObj::ParagraphObj( ParagraphObj& rObj )
9358 +: List()
9359 +, PropStateValue()
9360 +, SOParagraph()
9362 + ImplConstruct( rObj );
9365 +ParagraphObj::~ParagraphObj()
9367 + ImplClear();
9370 +void ParagraphObj::Write( SvStream* pStrm )
9372 + for ( void* pPtr = First(); pPtr; pPtr = Next() )
9373 + ((PortionObj*)pPtr)->Write( pStrm, mbLastParagraph );
9376 +void ParagraphObj::ImplClear()
9378 + for ( void* pPtr = First(); pPtr; pPtr = Next() )
9379 + delete (PortionObj*)pPtr;
9382 +void ParagraphObj::CalculateGraphicBulletSize( sal_uInt16 nFontHeight )
9384 + if ( ( (SvxExtNumType)nNumberingType == SVX_NUM_BITMAP ) && ( nBulletId != 0xffff ) )
9386 + // calculate the bulletrealsize for this grafik
9387 + if ( aBuGraSize.Width() && aBuGraSize.Height() )
9389 + double fCharHeight = nFontHeight;
9390 + double fLen = aBuGraSize.Height();
9391 + fCharHeight = fCharHeight * 0.2540;
9392 + double fQuo = fLen / fCharHeight;
9393 + nBulletRealSize = (sal_Int16)( fQuo + 0.5 );
9394 + if ( (sal_uInt16)nBulletRealSize > 400 )
9395 + nBulletRealSize = 400;
9400 +void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int16 nNumberingDepth, sal_Bool bIsBullet, sal_Bool bGetPropStateValue )
9402 + ::com::sun::star::uno::Any aAny;
9403 + if ( GetPropertyValue( aAny, mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "ParaLeftMargin" ) ) ) )
9405 + sal_Int32 nVal;
9406 + if ( aAny >>= nVal )
9407 + nTextOfs = static_cast< sal_Int16 >( nVal / ( 2540.0 / 576 ) + 0.5 ) ;
9409 + if ( GetPropertyValue( aAny, mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "ParaFirstLineIndent" ) ) ) )
9411 + if ( aAny >>= nBulletOfs )
9412 + nBulletOfs = static_cast< sal_Int32 >( nBulletOfs / ( 2540.0 / 576 ) + 0.5 );
9414 + if ( GetPropertyValue( aAny, mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "NumberingIsNumber" ) ) ) )
9415 + aAny >>= bNumberingIsNumber;
9417 + ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace > aXIndexReplace;
9419 + if ( bIsBullet && ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "NumberingRules" ) ), bGetPropStateValue ) )
9421 + if ( ( mAny >>= aXIndexReplace ) && nNumberingDepth < aXIndexReplace->getCount() )
9423 + mAny <<= aXIndexReplace->getByIndex( nNumberingDepth );
9424 + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>
9425 + aPropertySequence( *( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>*)mAny.getValue() );
9427 + const ::com::sun::star::beans::PropertyValue* pPropValue = aPropertySequence.getArray();
9429 + sal_Int32 nPropertyCount = aPropertySequence.getLength();
9430 + if ( nPropertyCount )
9432 + bExtendedParameters = TRUE;
9433 + nBulletRealSize = 100;
9434 + nMappedNumType = 0;
9436 + String aGraphicURL;
9437 + for ( sal_Int32 i = 0; i < nPropertyCount; i++ )
9439 + const void* pValue = pPropValue[ i ].Value.getValue();
9440 + if ( pValue )
9442 + ::rtl::OUString aPropName( pPropValue[ i ].Name );
9443 + if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "NumberingType" ) ) )
9444 + nNumberingType = *( (sal_Int16*)pValue );
9445 + else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Adjust" ) ) )
9446 + nHorzAdjust = *( (sal_Int16*)pValue );
9447 + else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "BulletChar" ) ) )
9449 + String aString( *( (String*)pValue ) );
9450 + if ( aString.Len() )
9451 + cBulletId = aString.GetChar( 0 );
9453 + else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "BulletFont" ) ) )
9455 + aFontDesc = *( (::com::sun::star::awt::FontDescriptor*)pValue );
9457 + // Our numbullet dialog has set the wrong textencoding for our "StarSymbol" font,
9458 + // instead of a Unicode encoding the encoding RTL_TEXTENCODING_SYMBOL was used.
9459 + // Because there might exist a lot of damaged documemts I added this two lines
9460 + // which fixes the bullet problem for the export.
9461 + if ( aFontDesc.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "StarSymbol" ) ) )
9462 + aFontDesc.CharSet = RTL_TEXTENCODING_MS_1252;
9465 + else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "GraphicURL" ) ) )
9466 + aGraphicURL = ( *(::rtl::OUString*)pValue );
9467 + else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "GraphicSize" ) ) )
9469 + if ( pPropValue[ i ].Value.getValueType() == ::getCppuType( (::com::sun::star::awt::Size*)0) )
9471 + // don't cast awt::Size to Size as on 64-bits they are not the same.
9472 + ::com::sun::star::awt::Size aSize;
9473 + pPropValue[ i ].Value >>= aSize;
9474 + aBuGraSize.nA = aSize.Width;
9475 + aBuGraSize.nB = aSize.Height;
9478 + else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "StartWith" ) ) )
9479 + nStartWith = *( (sal_Int16*)pValue );
9480 + else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "LeftMargin" ) ) )
9481 + nTextOfs = nTextOfs + static_cast< sal_Int16 >( *( (sal_Int32*)pValue ) / ( 2540.0 / 576 ) );
9482 + else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "FirstLineOffset" ) ) )
9483 + nBulletOfs += (sal_Int16)( *( (sal_Int32*)pValue ) / ( 2540.0 / 576 ) );
9484 + else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "BulletColor" ) ) )
9486 + sal_uInt32 nSOColor = *( (sal_uInt32*)pValue );
9487 + nBulletColor = nSOColor & 0xff00ff00; // green and hibyte
9488 + nBulletColor |= (sal_uInt8)( nSOColor ) << 16; // red
9489 + nBulletColor |= (sal_uInt8)( nSOColor >> 16 ) | 0xfe000000; // blue
9491 + else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "BulletRelSize" ) ) )
9493 + nBulletRealSize = *( (sal_Int16*)pValue );
9494 + nParaFlags |= 0x40;
9495 + nBulletFlags |= 8;
9497 + else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Prefix" ) ) )
9498 + sPrefix = ( *(::rtl::OUString*)pValue );
9499 + else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Suffix" ) ) )
9500 + sSuffix = ( *(::rtl::OUString*)pValue );
9501 +#ifdef DBG_UTIL
9502 + else if ( ! (
9503 + ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "SymbolTextDistance" ) ) )
9504 + || ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Graphic" ) ) ) ) )
9506 + DBG_ERROR( "Unbekanntes Property" );
9508 +#endif
9512 + if ( aGraphicURL.Len() )
9514 + if ( aBuGraSize.Width() && aBuGraSize.Height() )
9516 + xub_StrLen nIndex = aGraphicURL.Search( (sal_Unicode)':', 0 );
9517 + if ( nIndex != STRING_NOTFOUND )
9519 + nIndex++;
9520 + if ( aGraphicURL.Len() > nIndex )
9522 + ByteString aUniqueId( aGraphicURL, nIndex, aGraphicURL.Len() - nIndex, RTL_TEXTENCODING_UTF8 );
9523 + if ( aUniqueId.Len() )
9525 + nBulletId = rBuProv.GetId( aUniqueId, aBuGraSize );
9526 + if ( nBulletId != 0xffff )
9527 + bExtendedBulletsUsed = TRUE;
9532 + else
9534 + nNumberingType = SVX_NUM_NUMBER_NONE;
9538 + PortionObj* pPortion = (PortionObj*)First();
9539 + CalculateGraphicBulletSize( ( pPortion ) ? pPortion->mnCharHeight : 24 );
9541 + switch( (SvxExtNumType)nNumberingType )
9543 + case SVX_NUM_NUMBER_NONE : nParaFlags |= 0xf; break;
9545 + case SVX_NUM_CHAR_SPECIAL : // Bullet
9547 + cBulletId = oox::drawingml::DrawingML::SubstituteBullet( cBulletId, aFontDesc );
9549 + if ( aFontDesc.Name.getLength() )
9552 + if ( aFontDesc.CharSet != ::com::sun::star::awt::CharSet::SYMBOL )
9554 + switch ( cBulletId )
9556 + // Currency
9557 + case 128: cBulletId = 0x20AC; break;
9558 + // Punctuation and other
9559 + case 130: cBulletId = 0x201A; break;// SINGLE LOW-9 QUOTATION MARK
9560 + case 131: cBulletId = 0x0192; break;// LATIN SMALL LETTER F WITH HOOK
9561 + case 132: cBulletId = 0x201E; break;// DOUBLE LOW-9 QUOTATION MARK
9562 + // LOW DOUBLE PRIME QUOTATION MARK
9563 + case 133: cBulletId = 0x2026; break;// HORIZONTAL ELLIPSES
9564 + case 134: cBulletId = 0x2020; break;// DAGGER
9565 + case 135: cBulletId = 0x2021; break;// DOUBLE DAGGER
9566 + case 136: cBulletId = 0x02C6; break;// MODIFIER LETTER CIRCUMFLEX ACCENT
9567 + case 137: cBulletId = 0x2030; break;// PER MILLE SIGN
9568 + case 138: cBulletId = 0x0160; break;// LATIN CAPITAL LETTER S WITH CARON
9569 + case 139: cBulletId = 0x2039; break;// SINGLE LEFT-POINTING ANGLE QUOTATION MARK
9570 + case 140: cBulletId = 0x0152; break;// LATIN CAPITAL LIGATURE OE
9571 + case 142: cBulletId = 0x017D; break;// LATIN CAPITAL LETTER Z WITH CARON
9572 + case 145: cBulletId = 0x2018; break;// LEFT SINGLE QUOTATION MARK
9573 + // MODIFIER LETTER TURNED COMMA
9574 + case 146: cBulletId = 0x2019; break;// RIGHT SINGLE QUOTATION MARK
9575 + // MODIFIER LETTER APOSTROPHE
9576 + case 147: cBulletId = 0x201C; break;// LEFT DOUBLE QUOTATION MARK
9577 + // REVERSED DOUBLE PRIME QUOTATION MARK
9578 + case 148: cBulletId = 0x201D; break;// RIGHT DOUBLE QUOTATION MARK
9579 + // REVERSED DOUBLE PRIME QUOTATION MARK
9580 + case 149: cBulletId = 0x2022; break;// BULLET
9581 + case 150: cBulletId = 0x2013; break;// EN DASH
9582 + case 151: cBulletId = 0x2014; break;// EM DASH
9583 + case 152: cBulletId = 0x02DC; break;// SMALL TILDE
9584 + case 153: cBulletId = 0x2122; break;// TRADE MARK SIGN
9585 + case 154: cBulletId = 0x0161; break;// LATIN SMALL LETTER S WITH CARON
9586 + case 155: cBulletId = 0x203A; break;// SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
9587 + case 156: cBulletId = 0x0153; break;// LATIN SMALL LIGATURE OE
9588 + case 158: cBulletId = 0x017E; break;// LATIN SMALL LETTER Z WITH CARON
9589 + case 159: cBulletId = 0x0178; break;// LATIN CAPITAL LETTER Y WITH DIAERESIS
9590 +// case 222: cBulletId = 0x00B6; break;// PILCROW SIGN / PARAGRAPH SIGN
9594 + nParaFlags |= 0x90; // wir geben den Font und den Charset vor
9597 + case SVX_NUM_CHARS_UPPER_LETTER : // zaehlt von a-z, aa - az, ba - bz, ...
9598 + case SVX_NUM_CHARS_LOWER_LETTER :
9599 + case SVX_NUM_ROMAN_UPPER :
9600 + case SVX_NUM_ROMAN_LOWER :
9601 + case SVX_NUM_ARABIC :
9602 + case SVX_NUM_PAGEDESC : // Numerierung aus der Seitenvorlage
9603 + case SVX_NUM_BITMAP :
9604 + case SVX_NUM_CHARS_UPPER_LETTER_N : // zaehlt von a-z, aa-zz, aaa-zzz
9605 + case SVX_NUM_CHARS_LOWER_LETTER_N :
9607 + if ( nNumberingType != SVX_NUM_CHAR_SPECIAL )
9609 + bExtendedBulletsUsed = TRUE;
9610 + if ( nNumberingDepth & 1 )
9611 + cBulletId = 0x2013; // defaulting bullet characters for ppt97
9612 + else if ( nNumberingDepth == 4 )
9613 + cBulletId = 0xbb;
9614 + else
9615 + cBulletId = 0x2022;
9617 + switch( (SvxExtNumType)nNumberingType )
9619 + case SVX_NUM_CHARS_UPPER_LETTER :
9620 + case SVX_NUM_CHARS_UPPER_LETTER_N :
9622 + if ( sSuffix == String( RTL_CONSTASCII_USTRINGPARAM( ")" ) ) )
9624 + if ( sPrefix == String( RTL_CONSTASCII_USTRINGPARAM( "(" ) ) )
9625 + nMappedNumType = 0xa0001; // (A)
9626 + else
9627 + nMappedNumType = 0xb0001; // A)
9629 + else
9630 + nMappedNumType = 0x10001; // A.
9632 + break;
9633 + case SVX_NUM_CHARS_LOWER_LETTER :
9634 + case SVX_NUM_CHARS_LOWER_LETTER_N :
9636 + if ( sSuffix == String( RTL_CONSTASCII_USTRINGPARAM( ")" ) ) )
9638 + if ( sPrefix == String( RTL_CONSTASCII_USTRINGPARAM( "(" ) ) )
9639 + nMappedNumType = 0x80001; // (a)
9640 + else
9641 + nMappedNumType = 0x90001; // a)
9643 + else
9644 + nMappedNumType = 0x00001; // a.
9646 + break;
9647 + case SVX_NUM_ROMAN_UPPER :
9649 + if ( sSuffix == String( RTL_CONSTASCII_USTRINGPARAM( ")" ) ) )
9651 + if ( sPrefix == String( RTL_CONSTASCII_USTRINGPARAM( "(" ) ) )
9652 + nMappedNumType = 0xe0001; // (I)
9653 + else
9654 + nMappedNumType = 0xf0001; // I)
9656 + else
9657 + nMappedNumType = 0x70001; // I.
9659 + break;
9660 + case SVX_NUM_ROMAN_LOWER :
9662 + if ( sSuffix == String( RTL_CONSTASCII_USTRINGPARAM( ")" ) ) )
9664 + if ( sPrefix == String( RTL_CONSTASCII_USTRINGPARAM( "(" ) ) )
9665 + nMappedNumType = 0x40001; // (i)
9666 + else
9667 + nMappedNumType = 0x50001; // i)
9669 + else
9670 + nMappedNumType = 0x60001; // i.
9672 + break;
9673 + case SVX_NUM_ARABIC :
9675 + if ( sSuffix == String( RTL_CONSTASCII_USTRINGPARAM( ")" ) ) )
9677 + if ( sPrefix == String( RTL_CONSTASCII_USTRINGPARAM( "(" ) ) )
9678 + nMappedNumType = 0xc0001; // (1)
9679 + else
9680 + nMappedNumType = 0x20001; // 1)
9682 + else
9684 + if ( ! ( sSuffix.Len() + sPrefix.Len() ) )
9685 + nMappedNumType = 0xd0001; // 1
9686 + else
9687 + nMappedNumType = 0x30001; // 1.
9690 + break;
9691 + default:
9692 + break;
9695 + nParaFlags |= 0x2f;
9696 + nBulletFlags |= 6;
9697 + if ( mbIsBullet && bNumberingIsNumber )
9698 + nBulletFlags |= 1;
9704 + nBulletOfs = nTextOfs + nBulletOfs;
9705 + if ( nBulletOfs < 0 )
9706 + nBulletOfs = 0;
9709 +void ParagraphObj::ImplGetParagraphValues( PPTExBulletProvider& rBuProv, sal_Bool bGetPropStateValue )
9711 + static String sNumberingLevel ( RTL_CONSTASCII_USTRINGPARAM( "NumberingLevel" ) );
9713 + ::com::sun::star::uno::Any aAny;
9714 + if ( GetPropertyValue( aAny, mXPropSet, sNumberingLevel, sal_True ) )
9716 + if ( bGetPropStateValue )
9717 + meBullet = GetPropertyState( mXPropSet, sNumberingLevel );
9718 + nDepth = *( (sal_Int16*)aAny.getValue() );
9720 + if ( nDepth < 0 )
9722 + mbIsBullet = sal_False;
9723 + nDepth = 0;
9725 + else
9727 + if ( nDepth > 4 )
9728 + nDepth = 4;
9729 + mbIsBullet = sal_True;
9732 + else
9734 + nDepth = 0;
9735 + mbIsBullet = sal_False;
9737 + ImplGetNumberingLevel( rBuProv, nDepth, mbIsBullet, bGetPropStateValue );
9739 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "ParaTabStops" ) ), bGetPropStateValue ) )
9740 + maTabStop = *( ::com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop>*)mAny.getValue();
9741 + mnOOTextAdjust = ::com::sun::star::style::ParagraphAdjust_LEFT;
9742 + if ( GetPropertyValue( aAny, mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "ParaAdjust" ) ), bGetPropStateValue ) )
9743 + aAny >>= mnOOTextAdjust;
9744 + switch ( (::com::sun::star::style::ParagraphAdjust)mnOOTextAdjust )
9746 + case ::com::sun::star::style::ParagraphAdjust_CENTER :
9747 + mnTextAdjust = 1;
9748 + break;
9749 + case ::com::sun::star::style::ParagraphAdjust_RIGHT :
9750 + mnTextAdjust = 2;
9751 + break;
9752 + case ::com::sun::star::style::ParagraphAdjust_BLOCK :
9753 + mnTextAdjust = 3;
9754 + break;
9755 + default :
9756 + case ::com::sun::star::style::ParagraphAdjust_LEFT :
9757 + mnTextAdjust = 0;
9758 + break;
9760 + meTextAdjust = ePropState;
9762 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "ParaLineSpacing" ) ), bGetPropStateValue ) )
9764 + ::com::sun::star::style::LineSpacing aLineSpacing
9765 + = *( (::com::sun::star::style::LineSpacing*)mAny.getValue() );
9766 + switch ( aLineSpacing.Mode )
9768 + case ::com::sun::star::style::LineSpacingMode::FIX :
9769 + mnLineSpacing = (sal_Int16)(-( aLineSpacing.Height ) );
9770 + mbFixedLineSpacing = TRUE;
9771 + break;
9772 + case ::com::sun::star::style::LineSpacingMode::MINIMUM :
9773 + case ::com::sun::star::style::LineSpacingMode::LEADING :
9774 + mnLineSpacing = (sal_Int16)(-( aLineSpacing.Height ) );
9775 + mbFixedLineSpacing = FALSE;
9776 + break;
9778 + case ::com::sun::star::style::LineSpacingMode::PROP :
9779 + default:
9780 + mnLineSpacing = (sal_Int16)( aLineSpacing.Height );
9781 + break;
9784 + meLineSpacing = ePropState;
9786 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "ParaBottomMargin" ) ), bGetPropStateValue ) )
9788 + double fSpacing = *( (sal_uInt32*)mAny.getValue() ) + ( 2540.0 / 576.0 ) - 1;
9789 + mnLineSpacingBottom = (sal_Int16)(-( fSpacing * 576.0 / 2540.0 ) );
9791 + meLineSpacingBottom = ePropState;
9793 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "ParaTopMargin" ) ), bGetPropStateValue ) )
9795 + double fSpacing = *( (sal_uInt32*)mAny.getValue() ) + ( 2540.0 / 576.0 ) - 1;
9796 + mnLineSpacingTop = (sal_Int16)(-( fSpacing * 576.0 / 2540.0 ) );
9798 + meLineSpacingTop = ePropState;
9800 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "ParaIsForbiddenRules" ) ), bGetPropStateValue ) )
9801 + mAny >>= mbForbiddenRules;
9802 + meForbiddenRules = ePropState;
9804 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "ParaIsHangingPunctuation" ) ), bGetPropStateValue ) )
9805 + mAny >>= mbParagraphPunctation;
9806 + meParagraphPunctation = ePropState;
9808 + mnBiDi = 0;
9809 + if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "WritingMode" ) ), bGetPropStateValue ) )
9811 + sal_Int16 nWritingMode = 0;
9812 + mAny >>= nWritingMode;
9814 + SvxFrameDirection eWritingMode( (SvxFrameDirection)nWritingMode );
9815 + if ( ( eWritingMode == FRMDIR_HORI_RIGHT_TOP )
9816 + || ( eWritingMode == FRMDIR_VERT_TOP_RIGHT ) )
9818 + mnBiDi = 1;
9821 + meBiDi = ePropState;
9824 +void ParagraphObj::ImplConstruct( ParagraphObj& rParagraphObj )
9826 + mnTextSize = rParagraphObj.mnTextSize;
9827 + mnTextAdjust = rParagraphObj.mnTextAdjust;
9828 + mnLineSpacing = rParagraphObj.mnLineSpacing;
9829 + mnLineSpacingTop = rParagraphObj.mnLineSpacingTop;
9830 + mnLineSpacingBottom = rParagraphObj.mnLineSpacingBottom;
9831 + mbFirstParagraph = rParagraphObj.mbFirstParagraph;
9832 + mbLastParagraph = rParagraphObj.mbLastParagraph;
9833 + mbParagraphPunctation = rParagraphObj.mbParagraphPunctation;
9834 + mbForbiddenRules = rParagraphObj.mbForbiddenRules;
9835 + mnBiDi = rParagraphObj.mnBiDi;
9837 + for ( void* pPtr = rParagraphObj.First(); pPtr; pPtr = rParagraphObj.Next() )
9838 + Insert( new PortionObj( *(PortionObj*)pPtr ), LIST_APPEND );
9840 + maTabStop = rParagraphObj.maTabStop;
9841 + bExtendedParameters = rParagraphObj.bExtendedParameters;
9842 + nParaFlags = rParagraphObj.nParaFlags;
9843 + nBulletFlags = rParagraphObj.nBulletFlags;
9844 + sPrefix = rParagraphObj.sPrefix;
9845 + sSuffix = rParagraphObj.sSuffix;
9846 + sGraphicUrl = rParagraphObj.sGraphicUrl; // String auf eine Graphic
9847 + aBuGraSize = rParagraphObj.aBuGraSize;
9848 + nNumberingType = rParagraphObj.nNumberingType; // in wirlichkeit ist dies ein SvxEnum
9849 + nHorzAdjust = rParagraphObj.nHorzAdjust;
9850 + nBulletColor = rParagraphObj.nBulletColor;
9851 + nBulletOfs = rParagraphObj.nBulletOfs;
9852 + nStartWith = rParagraphObj.nStartWith; // Start der nummerierung
9853 + nTextOfs = rParagraphObj.nTextOfs;
9854 + nBulletRealSize = rParagraphObj.nBulletRealSize; // GroessenVerhaeltnis in Proz
9855 + nDepth = rParagraphObj.nDepth; // aktuelle tiefe
9856 + cBulletId = rParagraphObj.cBulletId; // wenn Numbering Type == CharSpecial
9857 + aFontDesc = rParagraphObj.aFontDesc;
9859 + bExtendedBulletsUsed = rParagraphObj.bExtendedBulletsUsed;
9860 + nBulletId = rParagraphObj.nBulletId;
9863 +::com::sun::star::awt::Size ParagraphObj::ImplMapSize( const ::com::sun::star::awt::Size& rSize )
9865 + Size aSize( OutputDevice::LogicToLogic( Size( rSize.Width, rSize.Height ), maMapModeSrc, maMapModeDest ) );
9866 + if ( !aSize.Width() )
9867 + aSize.Width()++;
9868 + if ( !aSize.Height() )
9869 + aSize.Height()++;
9870 + return ::com::sun::star::awt::Size( aSize.Width(), aSize.Height() );
9873 +sal_uInt32 ParagraphObj::ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition )
9875 + mnTextSize = 0;
9876 + for ( void* pPtr = First(); pPtr; pPtr = Next() )
9877 + mnTextSize += ((PortionObj*)pPtr)->ImplCalculateTextPositions( nCurrentTextPosition + mnTextSize );
9878 + return mnTextSize;
9881 +ParagraphObj& ParagraphObj::operator=( ParagraphObj& rParagraphObj )
9883 + if ( this != &rParagraphObj )
9885 + ImplClear();
9886 + ImplConstruct( rParagraphObj );
9888 + return *this;
9891 +// -----------------------------------------------------------------------
9893 +ImplTextObj::ImplTextObj( int nInstance )
9895 + mnRefCount = 1;
9896 + mnTextSize = 0;
9897 + mnInstance = nInstance;
9898 + mpList = new List;
9899 + mbHasExtendedBullets = FALSE;
9900 + mbFixedCellHeightUsed = FALSE;
9903 +ImplTextObj::~ImplTextObj()
9905 + for ( ParagraphObj* pPtr = (ParagraphObj*)mpList->First(); pPtr; pPtr = (ParagraphObj*)mpList->Next() )
9906 + delete pPtr;
9907 + delete mpList;
9910 +TextObj::TextObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XSimpleText > & rXTextRef,
9911 + int nInstance, FontCollection& rFontCollection, PPTExBulletProvider& rProv )
9913 + mpImplTextObj = new ImplTextObj( nInstance );
9915 + ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess >
9916 + aXTextParagraphEA( rXTextRef, ::com::sun::star::uno::UNO_QUERY );
9918 + if ( aXTextParagraphEA.is() )
9920 + ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration >
9921 + aXTextParagraphE( aXTextParagraphEA->createEnumeration() );
9922 + if ( aXTextParagraphE.is() )
9924 + ParaFlags aParaFlags;
9925 + while ( aXTextParagraphE->hasMoreElements() )
9927 + ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > aXParagraph;
9928 + ::com::sun::star::uno::Any aAny( aXTextParagraphE->nextElement() );
9929 + if ( aAny >>= aXParagraph )
9931 + if ( !aXTextParagraphE->hasMoreElements() )
9932 + aParaFlags.bLastParagraph = TRUE;
9933 + ParagraphObj* pPara = new ParagraphObj( aXParagraph, aParaFlags, rFontCollection, rProv );
9934 + mpImplTextObj->mbHasExtendedBullets |= pPara->bExtendedBulletsUsed;
9935 + mpImplTextObj->mpList->Insert( pPara, LIST_APPEND );
9936 + aParaFlags.bFirstParagraph = FALSE;
9941 + ImplCalculateTextPositions();
9944 +TextObj::TextObj( TextObj& rTextObj )
9946 + mpImplTextObj = rTextObj.mpImplTextObj;
9947 + mpImplTextObj->mnRefCount++;
9950 +TextObj::~TextObj()
9952 + if ( ! ( --mpImplTextObj->mnRefCount ) )
9953 + delete mpImplTextObj;
9956 +void TextObj::ImplCalculateTextPositions()
9958 + mpImplTextObj->mnTextSize = 0;
9959 + for ( void* pPtr = First(); pPtr; pPtr = Next() )
9960 + mpImplTextObj->mnTextSize += ((ParagraphObj*)pPtr)->ImplCalculateTextPositions( mpImplTextObj->mnTextSize );
9963 +TextObj& TextObj::operator=( TextObj& rTextObj )
9965 + if ( this != &rTextObj )
9967 + if ( ! ( --mpImplTextObj->mnRefCount ) )
9968 + delete mpImplTextObj;
9969 + mpImplTextObj = rTextObj.mpImplTextObj;
9970 + mpImplTextObj->mnRefCount++;
9972 + return *this;
9975 +// ---------------------------------------------------------------------------------------------
9977 +FontCollectionEntry::~FontCollectionEntry()
9981 +// ---------------------------------------------------------------------------------------------
9983 +void FontCollectionEntry::ImplInit( const String& rName )
9985 + String aSubstName( GetSubsFontName( rName, SUBSFONT_ONLYONE | SUBSFONT_MS ) );
9986 + if ( aSubstName.Len() )
9988 + Name = aSubstName;
9989 + bIsConverted = sal_True;
9991 + else
9993 + Name = rName;
9994 + bIsConverted = sal_False;
9998 +FontCollection::~FontCollection()
10000 + for( void* pStr = List::First(); pStr; pStr = List::Next() )
10001 + delete (FontCollectionEntry*)pStr;
10002 + delete pVDev;
10003 + xPPTBreakIter = NULL;
10004 + xScriptTypeDetector = NULL;
10007 +FontCollection::FontCollection() :
10008 + pVDev ( NULL )
10010 + com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
10011 + xMSF = ::comphelper::getProcessServiceFactory();
10012 + com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
10013 + xInterface = xMSF->createInstance( rtl::OUString::createFromAscii( "com.sun.star.i18n.BreakIterator" ) );
10014 + if ( xInterface.is() )
10015 + xPPTBreakIter = com::sun::star::uno::Reference< com::sun::star::i18n::XBreakIterator >
10016 + ( xInterface, com::sun::star::uno::UNO_QUERY );
10018 + xInterface = xMSF->createInstance( rtl::OUString::createFromAscii( "com.sun.star.i18n.ScriptTypeDetector" ) );
10019 + if ( xInterface.is() )
10020 + xScriptTypeDetector = com::sun::star::uno::Reference< com::sun::star::i18n::XScriptTypeDetector >
10021 + ( xInterface, com::sun::star::uno::UNO_QUERY );
10024 +short FontCollection::GetScriptDirection( const String& rString ) const
10026 + short nRet = com::sun::star::i18n::ScriptDirection::NEUTRAL;
10027 + if ( xScriptTypeDetector.is() )
10029 + const rtl::OUString sT( rString );
10030 + nRet = xScriptTypeDetector->getScriptDirection( sT, 0, com::sun::star::i18n::ScriptDirection::NEUTRAL );
10032 + return nRet;
10035 +sal_uInt32 FontCollection::GetId( FontCollectionEntry& rEntry )
10037 + if( rEntry.Name.Len() )
10039 + const sal_uInt32 nFonts = GetCount();
10041 + for( sal_uInt32 i = 0; i < nFonts; i++ )
10043 + const FontCollectionEntry* pEntry = GetById( i );
10044 + if( pEntry->Name == rEntry.Name )
10045 + return i;
10047 + Font aFont;
10048 + aFont.SetCharSet( rEntry.CharSet );
10049 + aFont.SetName( rEntry.Original );
10050 +// aFont.SetFamily( rEntry.Family );
10051 +// aFont.SetPitch( rEntry.Pitch );
10052 + aFont.SetHeight( 100 );
10054 + if ( !pVDev )
10055 + pVDev = new VirtualDevice;
10057 + pVDev->SetFont( aFont );
10058 + FontMetric aMetric( pVDev->GetFontMetric() );
10060 + sal_uInt16 nTxtHeight = (sal_uInt16)aMetric.GetAscent() + (sal_uInt16)aMetric.GetDescent();
10062 + if ( nTxtHeight )
10064 + double fScaling = (double)nTxtHeight / 120.0;
10065 + if ( ( fScaling > 0.50 ) && ( fScaling < 1.5 ) )
10066 + rEntry.Scaling = fScaling;
10069 + List::Insert( new FontCollectionEntry( rEntry ), LIST_APPEND );
10070 + return nFonts;
10072 + return 0;
10075 +const FontCollectionEntry* FontCollection::GetById( sal_uInt32 nId )
10077 + return (FontCollectionEntry*)List::GetObject( nId );
10080 +// ---------------------------------------------------------------------------------------------
10082 diff --git sd/source/filter/eppt/text.hxx sd/source/filter/eppt/text.hxx
10083 new file mode 100644
10084 index 0000000..472c258
10085 --- /dev/null
10086 +++ sd/source/filter/pptx/text.hxx
10087 @@ -0,0 +1,246 @@
10088 +#ifndef EPPT_TEXT_HXX
10089 +#define EPPT_TEXT_HXX
10091 +#include "epptbase.hxx"
10092 +#include <rtl/textenc.h>
10093 +#include <com/sun/star/awt/FontDescriptor.hpp>
10094 +#include <com/sun/star/lang/Locale.hpp>
10096 +namespace com { namespace sun { namespace star {
10097 +namespace awt { class FontDescriptor; }
10098 +namespace beans { class XPropertyState; }
10099 +namespace text { class XTextRange; class XTextContent; class XSimpleText; }
10100 +namespace style { class TabStop; }
10101 +}}}
10103 +struct SOParagraph
10105 + sal_Bool bExtendedParameters;
10106 + sal_uInt32 nParaFlags;
10107 + sal_Int16 nBulletFlags;
10108 + String sPrefix;
10109 + String sSuffix;
10110 + String sGraphicUrl; // String auf eine Graphic
10111 + Size aBuGraSize;
10112 + sal_uInt32 nNumberingType; // in wirlichkeit ist dies ein SvxEnum
10113 + sal_uInt32 nHorzAdjust;
10114 + sal_uInt32 nBulletColor;
10115 + sal_Int32 nBulletOfs;
10116 + sal_Int16 nStartWith; // Start der nummerierung
10117 + sal_Int16 nTextOfs;
10118 + sal_Int16 nBulletRealSize; // GroessenVerhaeltnis in Proz
10119 + sal_Int16 nDepth; // aktuelle tiefe
10120 + sal_Unicode cBulletId; // wenn Numbering Type == CharSpecial
10121 + ::com::sun::star::awt::FontDescriptor aFontDesc;
10123 + sal_Bool bExtendedBulletsUsed;
10124 + sal_uInt16 nBulletId;
10125 + sal_uInt32 nMappedNumType;
10126 + sal_Bool bNumberingIsNumber;
10128 + SOParagraph()
10130 + nDepth = 0;
10131 + bExtendedParameters = FALSE;
10132 + nParaFlags = 0;
10133 + nBulletFlags = 0;
10134 + nBulletOfs = 0;
10135 + nTextOfs = 0;
10136 + bExtendedBulletsUsed = FALSE;
10137 + nBulletId = 0xffff;
10138 + bNumberingIsNumber = sal_True;
10139 + };
10142 +class PropStateValue : public PropValue
10144 + public:
10146 + PropStateValue() {}
10148 + PropStateValue( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet,
10149 + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState > rXPropState )
10150 + : PropValue( rXPropSet ),
10151 + mXPropState( rXPropState )
10152 + {}
10154 + protected :
10156 + ::com::sun::star::beans::PropertyState ePropState;
10157 + ::com::sun::star::uno::Reference
10158 + < ::com::sun::star::beans::XPropertyState > mXPropState;
10160 + sal_Bool ImplGetPropertyValue( const String& rString, sal_Bool bGetPropertyState = TRUE );
10164 +struct FieldEntry
10166 + sal_uInt32 nFieldType;
10167 + sal_uInt32 nFieldStartPos;
10168 + sal_uInt32 nFieldEndPos;
10169 + String aRepresentation;
10170 + String aFieldUrl;
10172 + FieldEntry( sal_uInt32 nType, sal_uInt32 nStart, sal_uInt32 nEnd )
10174 + nFieldType = nType;
10175 + nFieldStartPos = nStart;
10176 + nFieldEndPos = nEnd;
10180 +class PortionObj : public PropStateValue
10183 + friend class ParagraphObj;
10185 + protected :
10187 + void ImplClear();
10188 + void ImplConstruct( PortionObj& rPortionObj );
10189 + sal_uInt32 ImplGetTextField( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & rXTextRangeRef,
10190 + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSetRef, String& rURL );
10191 + sal_uInt32 ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition );
10192 + void ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool bGetPropStateValue = FALSE );
10194 + public :
10196 + ::com::sun::star::beans::PropertyState meCharColor;
10197 + ::com::sun::star::beans::PropertyState meCharHeight;
10198 + ::com::sun::star::beans::PropertyState meFontName;
10199 + ::com::sun::star::beans::PropertyState meAsianOrComplexFont;
10200 + ::com::sun::star::beans::PropertyState meCharEscapement;
10201 + ::com::sun::star::lang::Locale meCharLocale;
10202 + sal_uInt16 mnCharAttrHard;
10204 + sal_uInt32 mnCharColor;
10205 + sal_uInt16 mnCharAttr;
10206 + sal_uInt16 mnCharHeight;
10207 + sal_uInt16 mnFont;
10208 + sal_uInt16 mnAsianOrComplexFont;
10209 + sal_Int16 mnCharEscapement;
10211 + sal_uInt32 mnTextSize;
10212 + sal_Bool mbLastPortion;
10214 + sal_uInt16* mpText;
10215 + FieldEntry* mpFieldEntry;
10217 + PortionObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & rXTextRangeRef,
10218 + sal_Bool bLast, FontCollection& rFontCollection );
10219 + PortionObj( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSetRef,
10220 + FontCollection& rFontCollection );
10221 + PortionObj( PortionObj& rPortionObj );
10222 + ~PortionObj();
10224 + void Write( SvStream* pStrm, sal_Bool bLast );
10225 + sal_uInt32 Count() const { return mnTextSize; };
10227 + PortionObj& operator=( PortionObj& rPortionObj );
10230 +struct ParaFlags
10232 + sal_Bool bFirstParagraph : 1;
10233 + sal_Bool bLastParagraph : 1;
10235 + ParaFlags() { bFirstParagraph = TRUE; bLastParagraph = FALSE; };
10238 +class ParagraphObj : public List, public PropStateValue, public SOParagraph
10240 + friend class TextObj;
10241 + friend struct PPTExParaSheet;
10243 + MapMode maMapModeSrc;
10244 + MapMode maMapModeDest;
10246 + protected :
10248 + void ImplConstruct( ParagraphObj& rParagraphObj );
10249 + void ImplClear();
10250 + sal_uInt32 ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition );
10251 + ::com::sun::star::awt::Size ImplMapSize( const ::com::sun::star::awt::Size& rSize );
10252 + void ImplGetParagraphValues( PPTExBulletProvider& rBuProv, sal_Bool bGetPropStateValue = FALSE );
10253 + void ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int16 nDepth, sal_Bool bIsBullet, sal_Bool bGetPropStateValue = FALSE );
10255 + public :
10257 + ::com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop > maTabStop;
10259 + sal_uInt32 mnTextSize;
10261 + sal_Bool mbIsBullet;
10262 + sal_Bool mbFirstParagraph;
10263 + sal_Bool mbLastParagraph;
10265 + ::com::sun::star::beans::PropertyState meBullet;
10266 + ::com::sun::star::beans::PropertyState meTextAdjust;
10267 + ::com::sun::star::beans::PropertyState meLineSpacing;
10268 + ::com::sun::star::beans::PropertyState meLineSpacingTop;
10269 + ::com::sun::star::beans::PropertyState meLineSpacingBottom;
10270 + ::com::sun::star::beans::PropertyState meForbiddenRules;
10271 + ::com::sun::star::beans::PropertyState meParagraphPunctation;
10272 + ::com::sun::star::beans::PropertyState meBiDi;
10274 + sal_uInt16 mnTextAdjust;
10275 + sal_Int16 mnOOTextAdjust;
10276 + sal_Int16 mnLineSpacing;
10277 + sal_Bool mbFixedLineSpacing;
10278 + sal_Int16 mnLineSpacingTop;
10279 + sal_Int16 mnLineSpacingBottom;
10280 + sal_Bool mbForbiddenRules;
10281 + sal_Bool mbParagraphPunctation;
10282 + sal_uInt16 mnBiDi;
10284 + ParagraphObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > & rXTextContentRef,
10285 + ParaFlags, FontCollection& rFontCollection,
10286 + PPTExBulletProvider& rBuProv );
10287 + ParagraphObj( ParagraphObj& rParargraphObj );
10288 + ParagraphObj( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSetRef,
10289 + PPTExBulletProvider& rBuProv );
10291 + void CalculateGraphicBulletSize( sal_uInt16 nFontHeight );
10292 + ~ParagraphObj();
10294 + void Write( SvStream* pStrm );
10295 + sal_uInt32 Count() const { return mnTextSize; };
10297 + ParagraphObj& operator=( ParagraphObj& rParagraphObj );
10300 +struct ImplTextObj
10302 + sal_uInt32 mnRefCount;
10303 + sal_uInt32 mnTextSize;
10304 + int mnInstance;
10305 + List* mpList;
10306 + sal_Bool mbHasExtendedBullets;
10307 + sal_Bool mbFixedCellHeightUsed;
10309 + ImplTextObj( int nInstance );
10310 + ~ImplTextObj();
10313 +class TextObj
10315 + ImplTextObj* mpImplTextObj;
10316 + void ImplCalculateTextPositions();
10318 + public :
10319 + TextObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XSimpleText > &
10320 + rXText, int nInstance, FontCollection& rFontCollection, PPTExBulletProvider& rBuProv );
10321 + TextObj( TextObj& rTextObj );
10322 + ~TextObj();
10324 + ParagraphObj* First(){ return (ParagraphObj*)mpImplTextObj->mpList->First(); };
10325 + ParagraphObj* Next(){ return(ParagraphObj*)mpImplTextObj->mpList->Next(); };
10326 + sal_uInt32 Count() const { return mpImplTextObj->mnTextSize; };
10327 + int GetInstance() const { return mpImplTextObj->mnInstance; };
10328 + sal_Bool HasExtendedBullets(){ return mpImplTextObj->mbHasExtendedBullets; };
10330 + TextObj& operator=( TextObj& rTextObj );
10333 +#endif
10334 # commented out for the libpptx diff --git sd/util/makefile.mk sd/util/makefile.mk
10335 # commented out for the libpptx index fb5e7af..e569219 100644
10336 # commented out for the libpptx --- sd/util/makefile.mk
10337 # commented out for the libpptx +++ sd/util/makefile.mk
10338 # commented out for the libpptx @@ -268,7 +268,9 @@ SHL5STDLIBS = $(ISDLIB) \
10339 # commented out for the libpptx $(CPPULIB) \
10340 # commented out for the libpptx $(SALLIB) \
10341 # commented out for the libpptx $(COMPHELPERLIB) \
10342 # commented out for the libpptx - $(I18NISOLANGLIB)
10343 # commented out for the libpptx + $(I18NISOLANGLIB) \
10344 # commented out for the libpptx + $(OOXLIB) \
10345 # commented out for the libpptx + $(SAXLIB)
10346 # commented out for the libpptx
10347 # commented out for the libpptx # --- Targets -------------------------------------------------------------
10348 # commented out for the libpptx
10349 # commented out for the libpptx diff --git sd/util/sdfilt.map sd/util/sdfilt.map
10350 # commented out for the libpptx index ac6b782..e939e57 100644
10351 # commented out for the libpptx --- sd/util/sdfilt.map
10352 # commented out for the libpptx +++ sd/util/sdfilt.map
10353 # commented out for the libpptx @@ -2,6 +2,9 @@ PPTEXPORTER_1_0 {
10354 # commented out for the libpptx global:
10355 # commented out for the libpptx ExportPPT;
10356 # commented out for the libpptx ImportPPT;
10357 # commented out for the libpptx + component_getImplementationEnvironment;
10358 # commented out for the libpptx + component_writeInfo;
10359 # commented out for the libpptx + component_getFactory;
10360 # commented out for the libpptx
10361 # commented out for the libpptx local:
10362 # commented out for the libpptx *;