Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <osl/endian.h>
30 : : #include <eppt.hxx>
31 : : #include "text.hxx"
32 : : #include "epptdef.hxx"
33 : : #include "escherex.hxx"
34 : : #include <tools/poly.hxx>
35 : : #include <vcl/bmpacc.hxx>
36 : : #include <vcl/gradient.hxx>
37 : : #include <vcl/gfxlink.hxx>
38 : : #include <tools/stream.hxx>
39 : : #include <sot/storage.hxx>
40 : : #include <vcl/outdev.hxx>
41 : : #include <vcl/virdev.hxx>
42 : : #include <sfx2/app.hxx>
43 : : #include <svl/languageoptions.hxx>
44 : : #include <editeng/svxenum.hxx>
45 : : #include <svx/unoapi.hxx>
46 : : #include <svx/svdoashp.hxx>
47 : : #include <com/sun/star/style/VerticalAlignment.hpp>
48 : : #include <com/sun/star/container/XIndexReplace.hpp>
49 : : #include <com/sun/star/presentation/XPresentationPage.hpp>
50 : : #include <com/sun/star/awt/XFont.hpp>
51 : : #include <com/sun/star/awt/FontWeight.hpp>
52 : : #include <com/sun/star/awt/FontUnderline.hpp>
53 : : #include <com/sun/star/style/ParagraphAdjust.hpp>
54 : : #include <com/sun/star/style/LineSpacing.hpp>
55 : : #include <com/sun/star/style/LineSpacingMode.hpp>
56 : : #ifndef _COM_SUN_STAR_STYLE_XSTYLEFAMILIESSUPPLIER_PP_
57 : : #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
58 : : #endif
59 : : #include <com/sun/star/style/XStyle.hpp>
60 : : #include <com/sun/star/drawing/PointSequence.hpp>
61 : : #include <com/sun/star/drawing/FlagSequence.hpp>
62 : : #include <com/sun/star/drawing/PolygonFlags.hpp>
63 : : #include <com/sun/star/beans/PropertyValue.hpp>
64 : : #include <com/sun/star/drawing/XControlShape.hpp>
65 : : #include <comphelper/processfactory.hxx>
66 : : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
67 : : #include <com/sun/star/i18n/XBreakIterator.hpp>
68 : : #include <com/sun/star/i18n/XScriptTypeDetector.hpp>
69 : : #include <com/sun/star/i18n/ScriptType.hpp>
70 : : #include <com/sun/star/i18n/ScriptDirection.hpp>
71 : : #include <com/sun/star/embed/Aspects.hpp>
72 : : #include <vcl/cvtgrf.hxx>
73 : : #include <tools/urlobj.hxx>
74 : : #include <comphelper/extract.hxx>
75 : : #include <cppuhelper/proptypehlp.hxx>
76 : : #include <ucbhelper/content.hxx>
77 : : #include <ucbhelper/contentbroker.hxx>
78 : : #include <toolkit/unohlp.hxx>
79 : : #include <rtl/crc.h>
80 : : #include <sot/clsids.hxx>
81 : : #include <unotools/ucbstreamhelper.hxx>
82 : : #include <com/sun/star/text/FontRelief.hpp>
83 : : #include <editeng/frmdiritem.hxx>
84 : : #include <svtools/fltcall.hxx>
85 : : #include <com/sun/star/table/XTable.hpp>
86 : : #include <com/sun/star/table/XMergeableCell.hpp>
87 : : #include <com/sun/star/table/BorderLine.hpp>
88 : : #include <set>
89 : : #include <oox/ole/olehelper.hxx>
90 : : #include "i18npool/mslangid.hxx"
91 : :
92 : : using namespace ::com::sun::star;
93 : :
94 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
95 : :
96 : : #define ANSI_CHARSET 0
97 : : #define SYMBOL_CHARSET 2
98 : :
99 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
100 : :
101 : : /* Font Families */
102 : : #define FF_DONTCARE 0x00
103 : : #define FF_ROMAN 0x10
104 : : #define FF_SWISS 0x20
105 : : #define FF_MODERN 0x30
106 : : #define FF_SCRIPT 0x40
107 : : #define FF_DECORATIVE 0x50
108 : :
109 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
110 : :
111 : : #define DEFAULT_PITCH 0x00
112 : : #define FIXED_PITCH 0x01
113 : : #define VARIABLE_PITCH 0x02
114 : :
115 : : // ---------------------------------------------------------------------------------------------
116 : :
117 [ # # ][ # # ]: 0 : PPTExBulletProvider::PPTExBulletProvider()
118 : : {
119 [ # # ][ # # ]: 0 : pGraphicProv = new EscherGraphicProvider( _E_GRAPH_PROV_USE_INSTANCES | _E_GRAPH_PROV_DO_NOT_ROTATE_METAFILES );
120 : 0 : }
121 : :
122 [ # # ][ # # ]: 0 : PPTExBulletProvider::~PPTExBulletProvider()
123 : : {
124 [ # # ][ # # ]: 0 : delete pGraphicProv;
125 : 0 : }
126 : :
127 : 0 : sal_uInt16 PPTExBulletProvider::GetId( const rtl::OString& rUniqueId, Size& rGraphicSize )
128 : : {
129 : 0 : sal_uInt16 nRetValue = 0xffff;
130 : :
131 [ # # ]: 0 : if ( !rUniqueId.isEmpty() )
132 : : {
133 [ # # ]: 0 : Rectangle aRect;
134 [ # # ]: 0 : GraphicObject aGraphicObject( rUniqueId );
135 [ # # ][ # # ]: 0 : Graphic aMappedGraphic, aGraphic( aGraphicObject.GetGraphic() );
[ # # ]
136 [ # # ]: 0 : Size aPrefSize( aGraphic.GetPrefSize() );
137 [ # # ]: 0 : BitmapEx aBmpEx( aGraphic.GetBitmapEx() );
138 : :
139 [ # # ][ # # ]: 0 : if ( rGraphicSize.Width() && rGraphicSize.Height() )
[ # # ]
140 : : {
141 : 0 : double fQ1 = ( (double)aPrefSize.Width() / (double)aPrefSize.Height() );
142 : 0 : double fQ2 = ( (double)rGraphicSize.Width() / (double)rGraphicSize.Height() );
143 : 0 : double fXScale = 1;
144 : 0 : double fYScale = 1;
145 : :
146 [ # # ]: 0 : if ( fQ1 > fQ2 )
147 : 0 : fYScale = fQ1 / fQ2;
148 [ # # ]: 0 : else if ( fQ1 < fQ2 )
149 : 0 : fXScale = fQ2 / fQ1;
150 : :
151 [ # # ][ # # ]: 0 : if ( ( fXScale != 1.0 ) || ( fYScale != 1.0 ) )
152 : : {
153 [ # # ]: 0 : aBmpEx.Scale( fXScale, fYScale );
154 : 0 : Size aNewSize( (sal_Int32)((double)rGraphicSize.Width() / fXScale + 0.5 ),
155 : 0 : (sal_Int32)((double)rGraphicSize.Height() / fYScale + 0.5 ) );
156 : :
157 : 0 : rGraphicSize = aNewSize;
158 : :
159 [ # # ][ # # ]: 0 : aMappedGraphic = Graphic( aBmpEx );
[ # # ]
160 [ # # ][ # # ]: 0 : aGraphicObject = GraphicObject( aMappedGraphic );
[ # # ]
161 : : }
162 : : }
163 [ # # ][ # # ]: 0 : sal_uInt32 nId = pGraphicProv->GetBlibID( aBuExPictureStream, aGraphicObject.GetUniqueID(), aRect, NULL, NULL );
164 : :
165 [ # # ][ # # ]: 0 : if ( nId && ( nId < 0x10000 ) )
166 [ # # ][ # # ]: 0 : nRetValue = (sal_uInt16)nId - 1;
[ # # ][ # # ]
167 : : }
168 : 0 : return nRetValue;
169 : : }
170 : :
171 : : // ---------------------------------------------------------------------------------------------
172 : :
173 : 0 : sal_uInt32 PPTWriter::ImplVBAInfoContainer( SvStream* pStrm )
174 : : {
175 : 0 : sal_uInt32 nSize = 28;
176 [ # # ]: 0 : if ( pStrm )
177 : : {
178 : 0 : *pStrm << (sal_uInt32)( 0x1f | ( EPP_VBAInfo << 16 ) )
179 : 0 : << (sal_uInt32)( nSize - 8 )
180 : 0 : << (sal_uInt32)( 2 | ( EPP_VBAInfoAtom << 16 ) )
181 : 0 : << (sal_uInt32)12;
182 : 0 : mpPptEscherEx->InsertPersistOffset( EPP_Persist_VBAInfoAtom, pStrm->Tell() );
183 : 0 : *pStrm << (sal_uInt32)0
184 : 0 : << (sal_uInt32)0
185 : 0 : << (sal_uInt32)1;
186 : : }
187 : 0 : return nSize;
188 : : }
189 : :
190 : : // ---------------------------------------------------------------------------------------------
191 : :
192 : 0 : sal_uInt32 PPTWriter::ImplSlideViewInfoContainer( sal_uInt32 nInstance, SvStream* pStrm )
193 : : {
194 : 0 : sal_uInt32 nSize = 111;
195 [ # # ]: 0 : if ( pStrm )
196 : : {
197 : 0 : sal_uInt8 bShowGuides = 0;
198 : 0 : sal_uInt8 bSnapToGrid = 1;
199 : 0 : sal_uInt8 bSnapToShape = 0;
200 : :
201 : 0 : sal_Int32 nScaling = 85;
202 : 0 : sal_Int32 nMasterCoordinate = 0xdda;
203 : 0 : sal_Int32 nXOrigin = -780;
204 : 0 : sal_Int32 nYOrigin = -84;
205 : :
206 : 0 : sal_Int32 nPosition1 = 0x870;
207 : 0 : sal_Int32 nPosition2 = 0xb40;
208 : :
209 [ # # ]: 0 : if ( nInstance )
210 : : {
211 : 0 : bShowGuides = 1;
212 : 0 : nScaling = 0x3b;
213 : 0 : nMasterCoordinate = 0xf0c;
214 : 0 : nXOrigin = -1752;
215 : 0 : nYOrigin = -72;
216 : 0 : nPosition1 = 0xb40;
217 : 0 : nPosition2 = 0x870;
218 : : }
219 : 0 : *pStrm << (sal_uInt32)( 0xf | ( EPP_SlideViewInfo << 16 ) | ( nInstance << 4 ) )
220 : 0 : << (sal_uInt32)( nSize - 8 )
221 : 0 : << (sal_uInt32)( EPP_SlideViewInfoAtom << 16 ) << (sal_uInt32)3
222 : 0 : << bShowGuides << bSnapToGrid << bSnapToShape
223 : 0 : << (sal_uInt32)( EPP_ViewInfoAtom << 16 ) << (sal_uInt32)52
224 : 0 : << nScaling << (sal_Int32)100 << nScaling << (sal_Int32)100 // scaling atom - Keeps the current scale
225 : 0 : << nScaling << (sal_Int32)100 << nScaling << (sal_Int32)100 // scaling atom - Keeps the previous scale
226 : 0 : << (sal_Int32)0x17ac << nMasterCoordinate// Origin - Keeps the origin in master coordinates
227 : 0 : << nXOrigin << nYOrigin // Origin
228 : 0 : << (sal_uInt8)1 // Bool1 varScale - Set if zoom to fit is set
229 : 0 : << (sal_uInt8)0 // bool1 draftMode - Not used
230 : 0 : << (sal_uInt16)0 // padword
231 : 0 : << (sal_uInt32)( ( 7 << 4 ) | ( EPP_GuideAtom << 16 ) ) << (sal_uInt32)8
232 : 0 : << (sal_uInt32)0 // Type of the guide. If the guide is horizontal this value is zero. If it's vertical, it's one.
233 : 0 : << nPosition1 // Position of the guide in master coordinates. X coordinate if it's vertical, and Y coordinate if it's horizontal.
234 : 0 : << (sal_uInt32)( ( 7 << 4 ) | ( EPP_GuideAtom << 16 ) ) << (sal_uInt32)8
235 : 0 : << (sal_Int32)1 // Type of the guide. If the guide is horizontal this value is zero. If it's vertical, it's one.
236 : 0 : << nPosition2; // Position of the guide in master coordinates. X coordinate if it's vertical, and Y coordinate if it's horizontal.
237 : : }
238 : 0 : return nSize;
239 : : }
240 : :
241 : : // ---------------------------------------------------------------------------------------------
242 : :
243 : 0 : sal_uInt32 PPTWriter::ImplOutlineViewInfoContainer( SvStream* pStrm )
244 : : {
245 : 0 : sal_uInt32 nSize = 68;
246 [ # # ]: 0 : if ( pStrm )
247 : : {
248 : 0 : *pStrm << (sal_uInt32)( 0xf | ( EPP_OutlineViewInfo << 16 ) ) << (sal_uInt32)( nSize - 8 )
249 : 0 : << (sal_uInt32)( EPP_ViewInfoAtom << 16 ) << (sal_uInt32)52
250 : 0 : << (sal_Int32)170 << (sal_Int32)200 << (sal_Int32)170 << (sal_Int32)200 // scaling atom - Keeps the current scale
251 : 0 : << (sal_Int32)170 << (sal_Int32)200 << (sal_Int32)170 << (sal_Int32)200 // scaling atom - Keeps the previous scale
252 : 0 : << (sal_Int32)0x17ac << (sal_Int32)0xdda // Origin - Keeps the origin in master coordinates
253 : 0 : << (sal_Int32)-780 << (sal_Int32)-84 // Origin
254 : 0 : << (sal_uInt8)1 // bool1 varScale - Set if zoom to fit is set
255 : 0 : << (sal_uInt8)0 // bool1 draftMode - Not used
256 : 0 : << (sal_uInt16)0; // padword
257 : : }
258 : 0 : return nSize;
259 : : }
260 : :
261 : : // ---------------------------------------------------------------------------------------------
262 : :
263 : 0 : sal_uInt32 PPTWriter::ImplProgBinaryTag( SvStream* pStrm )
264 : : {
265 : 0 : sal_uInt32 nPictureStreamSize, nOutlineStreamSize, nSize = 8;
266 : :
267 : 0 : nPictureStreamSize = aBuExPictureStream.Tell();
268 [ # # ]: 0 : if ( nPictureStreamSize )
269 : 0 : nSize += nPictureStreamSize + 8;
270 : :
271 : 0 : nOutlineStreamSize = aBuExOutlineStream.Tell();
272 [ # # ]: 0 : if ( nOutlineStreamSize )
273 : 0 : nSize += nOutlineStreamSize + 8;
274 : :
275 [ # # ]: 0 : if ( pStrm )
276 : : {
277 : 0 : *pStrm << (sal_uInt32)( EPP_BinaryTagData << 16 ) << (sal_uInt32)( nSize - 8 );
278 [ # # ]: 0 : if ( nPictureStreamSize )
279 : : {
280 : 0 : *pStrm << (sal_uInt32)( 0xf | ( EPP_PST_ExtendedBuGraContainer << 16 ) ) << nPictureStreamSize;
281 : 0 : pStrm->Write( aBuExPictureStream.GetData(), nPictureStreamSize );
282 : : }
283 [ # # ]: 0 : if ( nOutlineStreamSize )
284 : : {
285 : 0 : *pStrm << (sal_uInt32)( 0xf | ( EPP_PST_ExtendedPresRuleContainer << 16 ) ) << nOutlineStreamSize;
286 : 0 : pStrm->Write( aBuExOutlineStream.GetData(), nOutlineStreamSize );
287 : : }
288 : : }
289 : 0 : return nSize;
290 : : }
291 : :
292 : : // ---------------------------------------------------------------------------------------------
293 : :
294 : 0 : sal_uInt32 PPTWriter::ImplProgBinaryTagContainer( SvStream* pStrm, SvMemoryStream* pBinTagStrm )
295 : : {
296 : 0 : sal_uInt32 nSize = 8 + 8 + 14;
297 [ # # ]: 0 : if ( pStrm )
298 : : {
299 : 0 : *pStrm << (sal_uInt32)( 0xf | ( EPP_ProgBinaryTag << 16 ) ) << (sal_uInt32)0
300 : 0 : << (sal_uInt32)( EPP_CString << 16 ) << (sal_uInt32)14
301 : 0 : << (sal_uInt32)0x5f005f << (sal_uInt32)0x50005f
302 : 0 : << (sal_uInt32)0x540050 << (sal_uInt16)0x39;
303 : : }
304 [ # # ]: 0 : if ( pBinTagStrm )
305 : : {
306 : 0 : sal_uInt32 nLen = pBinTagStrm->Tell();
307 : 0 : nSize += nLen + 8;
308 : 0 : *pStrm << (sal_uInt32)( EPP_BinaryTagData << 16 ) << nLen;
309 : 0 : pStrm->Write( pBinTagStrm->GetData(), nLen );
310 : : }
311 : : else
312 : 0 : nSize += ImplProgBinaryTag( pStrm );
313 : :
314 [ # # ]: 0 : if ( pStrm )
315 : : {
316 : 0 : pStrm->SeekRel( - ( (sal_Int32)nSize - 4 ) );
317 : 0 : *pStrm << (sal_uInt32)( nSize - 8 );
318 : 0 : pStrm->SeekRel( nSize - 8 );
319 : : }
320 : 0 : return nSize;
321 : : }
322 : :
323 : : // ---------------------------------------------------------------------------------------------
324 : :
325 : 0 : sal_uInt32 PPTWriter::ImplProgTagContainer( SvStream* pStrm, SvMemoryStream* pBinTagStrm )
326 : : {
327 : 0 : sal_uInt32 nSize = 0;
328 [ # # ][ # # ]: 0 : if ( aBuExPictureStream.Tell() || aBuExOutlineStream.Tell() || pBinTagStrm )
[ # # ][ # # ]
329 : : {
330 : 0 : nSize = 8;
331 [ # # ]: 0 : if ( pStrm )
332 : : {
333 : 0 : *pStrm << (sal_uInt32)( 0xf | ( EPP_ProgTags << 16 ) ) << (sal_uInt32)0;
334 : : }
335 : 0 : nSize += ImplProgBinaryTagContainer( pStrm, pBinTagStrm );
336 [ # # ]: 0 : if ( pStrm )
337 : : {
338 : 0 : pStrm->SeekRel( - ( (sal_Int32)nSize - 4 ) );
339 : 0 : *pStrm << (sal_uInt32)( nSize - 8 );
340 : 0 : pStrm->SeekRel( nSize - 8 );
341 : : }
342 : : }
343 : 0 : return nSize;
344 : : }
345 : :
346 : : // ---------------------------------------------------------------------------------------------
347 : :
348 : 0 : sal_uInt32 PPTWriter::ImplDocumentListContainer( SvStream* pStrm )
349 : : {
350 : 0 : sal_uInt32 nSize = 8;
351 [ # # ]: 0 : if ( pStrm )
352 : : {
353 : 0 : *pStrm << (sal_uInt32)( ( EPP_List << 16 ) | 0xf ) << (sal_uInt32)0;
354 : : }
355 : :
356 : 0 : nSize += ImplVBAInfoContainer( pStrm );
357 : 0 : nSize += ImplSlideViewInfoContainer( 0, pStrm );
358 : 0 : nSize += ImplOutlineViewInfoContainer( pStrm );
359 : 0 : nSize += ImplSlideViewInfoContainer( 1, pStrm );
360 : 0 : nSize += ImplProgTagContainer( pStrm );
361 : :
362 [ # # ]: 0 : if ( pStrm )
363 : : {
364 : 0 : pStrm->SeekRel( - ( (sal_Int32)nSize - 4 ) );
365 : 0 : *pStrm << (sal_uInt32)( nSize - 8 );
366 : 0 : pStrm->SeekRel( nSize - 8 );
367 : : }
368 : 0 : return nSize;
369 : : }
370 : :
371 : : // ---------------------------------------------------------------------------------------------
372 : :
373 : 0 : sal_uInt32 PPTWriter::ImplMasterSlideListContainer( SvStream* pStrm )
374 : : {
375 : 0 : sal_uInt32 i, nSize = 28 * mnMasterPages + 8;
376 [ # # ]: 0 : if ( pStrm )
377 : : {
378 : 0 : *pStrm << (sal_uInt32)( 0x1f | ( EPP_SlideListWithText << 16 ) ) << (sal_uInt32)( nSize - 8 );
379 : :
380 [ # # ]: 0 : for ( i = 0; i < mnMasterPages; i++ )
381 : : {
382 : 0 : *pStrm << (sal_uInt32)( EPP_SlidePersistAtom << 16 ) << (sal_uInt32)20;
383 : 0 : mpPptEscherEx->InsertPersistOffset( EPP_MAINMASTER_PERSIST_KEY | i, pStrm->Tell() );
384 : 0 : *pStrm << (sal_uInt32)0 // psrReference - logical reference to the slide persist object ( EPP_MAINMASTER_PERSIST_KEY )
385 : 0 : << (sal_uInt32)0 // flags - only bit 3 used, if set then slide contains shapes other than placeholders
386 : 0 : << (sal_Int32)0 // numberTexts - number of placeholder texts stored with the persist object. Allows to display outline view without loading the slide persist objects
387 : 0 : << (sal_Int32)( 0x80000000 | i ) // slideId - Unique slide identifier, used for OLE link monikers for example
388 : 0 : << (sal_uInt32)0; // reserved, usualy 0
389 : : }
390 : : }
391 : 0 : return nSize;
392 : : }
393 : :
394 : : // ---------------------------------------------------------------------------------------------
395 : :
396 : 0 : sal_uInt32 PPTWriter::ImplInsertBookmarkURL( const String& rBookmarkURL, const sal_uInt32 nType,
397 : : const String& rStringVer0, const String& rStringVer1, const String& rStringVer2, const String& rStringVer3 )
398 : : {
399 : 0 : sal_uInt32 nHyperId = ++mnExEmbed;
400 : :
401 [ # # ]: 0 : rtl::OUString sBookmarkURL( rBookmarkURL );
402 [ # # ]: 0 : INetURLObject aBaseURI( maBaseURI );
403 [ # # ][ # # ]: 0 : INetURLObject aBookmarkURI( rBookmarkURL );
404 [ # # ]: 0 : if( aBaseURI.GetProtocol() == aBookmarkURI.GetProtocol() )
405 : : {
406 : : rtl::OUString aRelUrl( INetURLObject::GetRelURL( maBaseURI, rBookmarkURL,
407 [ # # ][ # # ]: 0 : INetURLObject::WAS_ENCODED, INetURLObject::DECODE_TO_IURI, RTL_TEXTENCODING_UTF8, INetURLObject::FSYS_DETECT ) );
408 [ # # ]: 0 : if ( !aRelUrl.isEmpty() )
409 : 0 : sBookmarkURL = aRelUrl;
410 : : }
411 [ # # ][ # # ]: 0 : maHyperlink.push_back( EPPTHyperlink( sBookmarkURL, nType ) );
[ # # ][ # # ]
[ # # ]
412 : :
413 [ # # ]: 0 : *mpExEmbed << (sal_uInt16)0xf
414 [ # # ]: 0 : << (sal_uInt16)EPP_ExHyperlink
415 [ # # ]: 0 : << (sal_uInt32)0;
416 : 0 : sal_uInt32 nHyperSize, nHyperStart = mpExEmbed->Tell();
417 [ # # ]: 0 : *mpExEmbed << (sal_uInt16)0
418 [ # # ]: 0 : << (sal_uInt16)EPP_ExHyperlinkAtom
419 [ # # ]: 0 : << (sal_uInt32)4
420 [ # # ]: 0 : << nHyperId;
421 : :
422 : : sal_uInt16 i, nStringLen;
423 : 0 : nStringLen = rStringVer0.Len();
424 [ # # ]: 0 : if ( nStringLen )
425 : : {
426 [ # # ][ # # ]: 0 : *mpExEmbed << (sal_uInt32)( EPP_CString << 16 ) << (sal_uInt32)( nStringLen * 2 );
427 [ # # ]: 0 : for ( i = 0; i < nStringLen; i++ )
428 : : {
429 [ # # ]: 0 : *mpExEmbed << rStringVer0.GetChar( i );
430 : : }
431 : : }
432 : 0 : nStringLen = rStringVer1.Len();
433 [ # # ]: 0 : if ( nStringLen )
434 : : {
435 [ # # ][ # # ]: 0 : *mpExEmbed << (sal_uInt32)( ( EPP_CString << 16 ) | 0x10 ) << (sal_uInt32)( nStringLen * 2 );
436 [ # # ]: 0 : for ( i = 0; i < nStringLen; i++ )
437 : : {
438 [ # # ]: 0 : *mpExEmbed << rStringVer1.GetChar( i );
439 : : }
440 : : }
441 : 0 : nStringLen = rStringVer2.Len();
442 [ # # ]: 0 : if ( nStringLen )
443 : : {
444 [ # # ][ # # ]: 0 : *mpExEmbed << (sal_uInt32)( ( EPP_CString << 16 ) | 0x20 ) << (sal_uInt32)( nStringLen * 2 );
445 [ # # ]: 0 : for ( i = 0; i < nStringLen; i++ )
446 : : {
447 [ # # ]: 0 : *mpExEmbed << rStringVer2.GetChar( i );
448 : : }
449 : : }
450 : 0 : nStringLen = rStringVer3.Len();
451 [ # # ]: 0 : if ( nStringLen )
452 : : {
453 [ # # ][ # # ]: 0 : *mpExEmbed << (sal_uInt32)( ( EPP_CString << 16 ) | 0x30 ) << (sal_uInt32)( nStringLen * 2 );
454 [ # # ]: 0 : for ( i = 0; i < nStringLen; i++ )
455 : : {
456 [ # # ]: 0 : *mpExEmbed << rStringVer3.GetChar( i );
457 : : }
458 : : }
459 : 0 : nHyperSize = mpExEmbed->Tell() - nHyperStart;
460 [ # # ]: 0 : mpExEmbed->SeekRel( - ( (sal_Int32)nHyperSize + 4 ) );
461 [ # # ]: 0 : *mpExEmbed << nHyperSize;
462 [ # # ]: 0 : mpExEmbed->SeekRel( nHyperSize );
463 [ # # ][ # # ]: 0 : return nHyperId;
464 : : }
465 : :
466 : : // ---------------------------------------------------------------------------------------------
467 : :
468 : 0 : sal_Bool PPTWriter::ImplCloseDocument()
469 : : {
470 : 0 : sal_uInt32 nOfs = mpPptEscherEx->PtGetOffsetByID( EPP_Persist_Document );
471 [ # # ]: 0 : if ( nOfs )
472 : : {
473 [ # # ]: 0 : mpPptEscherEx->PtReplaceOrInsert( EPP_Persist_CurrentPos, mpStrm->Tell() );
474 [ # # ]: 0 : mpStrm->Seek( nOfs );
475 : :
476 : : // creating the TxMasterStyleAtom
477 [ # # ]: 0 : SvMemoryStream aTxMasterStyleAtomStrm( 0x200, 0x200 );
478 : : {
479 [ # # ]: 0 : EscherExAtom aTxMasterStyleAtom( aTxMasterStyleAtomStrm, EPP_TxMasterStyleAtom, EPP_TEXTTYPE_Other );
480 [ # # ]: 0 : aTxMasterStyleAtomStrm << (sal_uInt16)5; // paragraph count
481 : : sal_uInt16 nLev;
482 : 0 : sal_Bool bFirst = sal_True;
483 [ # # ]: 0 : for ( nLev = 0; nLev < 5; nLev++ )
484 : : {
485 [ # # ]: 0 : mpStyleSheet->mpParaSheet[ EPP_TEXTTYPE_Other ]->Write( aTxMasterStyleAtomStrm, mpPptEscherEx, nLev, bFirst, sal_False, mXPagePropSet );
486 [ # # ]: 0 : mpStyleSheet->mpCharSheet[ EPP_TEXTTYPE_Other ]->Write( aTxMasterStyleAtomStrm, mpPptEscherEx, nLev, bFirst, sal_False, mXPagePropSet );
487 : 0 : bFirst = sal_False;
488 [ # # ]: 0 : }
489 : : }
490 : :
491 [ # # ]: 0 : mpExEmbed->Seek( STREAM_SEEK_TO_END );
492 : 0 : sal_uInt32 nExEmbedSize = mpExEmbed->Tell();
493 : :
494 : : // nEnviroment : Gesamtgroesse des Environment Containers
495 [ # # ]: 0 : sal_uInt32 nEnvironment = maFontCollection.GetCount() * 76 // 68 bytes pro Fontenityatom und je 8 Bytes fuer die Header
496 : : + 8 // 1 FontCollection Container
497 : : + 20 // SrKinsoku Container
498 : : + 18 // 1 TxSiStyleAtom
499 : 0 : + aTxMasterStyleAtomStrm.Tell() // 1 TxMasterStyleAtom;
500 [ # # ]: 0 : + mpStyleSheet->SizeOfTxCFStyleAtom();
501 : :
502 : 0 : sal_uInt32 nBytesToInsert = nEnvironment + 8;
503 : :
504 [ # # ]: 0 : if ( nExEmbedSize )
505 : 0 : nBytesToInsert += nExEmbedSize + 8 + 12;
506 : :
507 [ # # ]: 0 : nBytesToInsert += maSoundCollection.GetSize();
508 [ # # ]: 0 : nBytesToInsert += mpPptEscherEx->DrawingGroupContainerSize();
509 [ # # ]: 0 : nBytesToInsert += ImplMasterSlideListContainer( NULL );
510 [ # # ]: 0 : nBytesToInsert += ImplDocumentListContainer( NULL );
511 : :
512 : : // nBytes im Stream einfuegen, und abhaengige Container anpassen
513 [ # # ]: 0 : mpPptEscherEx->InsertAtCurrentPos( nBytesToInsert, false );
514 : :
515 : : // CREATE HYPERLINK CONTAINER
516 [ # # ]: 0 : if ( nExEmbedSize )
517 : : {
518 [ # # ]: 0 : *mpStrm << (sal_uInt16)0xf
519 [ # # ]: 0 : << (sal_uInt16)EPP_ExObjList
520 [ # # ]: 0 : << (sal_uInt32)( nExEmbedSize + 12 )
521 [ # # ]: 0 : << (sal_uInt16)0
522 [ # # ]: 0 : << (sal_uInt16)EPP_ExObjListAtom
523 [ # # ]: 0 : << (sal_uInt32)4
524 [ # # ]: 0 : << (sal_uInt32)mnExEmbed;
525 [ # # ]: 0 : mpPptEscherEx->InsertPersistOffset( EPP_Persist_ExObj, mpStrm->Tell() );
526 [ # # ][ # # ]: 0 : mpStrm->Write( mpExEmbed->GetData(), nExEmbedSize );
527 : : }
528 : :
529 : : // CREATE ENVIRONMENT
530 [ # # ][ # # ]: 0 : *mpStrm << (sal_uInt16)0xf << (sal_uInt16)EPP_Environment << (sal_uInt32)nEnvironment;
[ # # ]
531 : :
532 : : // Open Container ( EPP_SrKinsoku )
533 [ # # ][ # # ]: 0 : *mpStrm << (sal_uInt16)0x2f << (sal_uInt16)EPP_SrKinsoku << (sal_uInt32)12;
[ # # ]
534 [ # # ]: 0 : mpPptEscherEx->AddAtom( 4, EPP_SrKinsokuAtom, 0, 3 );
535 [ # # ]: 0 : *mpStrm << (sal_Int32)0; // SrKinsoku Level 0
536 : :
537 : : // Open Container ( EPP_FontCollection )
538 [ # # ][ # # ]: 0 : *mpStrm << (sal_uInt16)0xf << (sal_uInt16)EPP_FontCollection << (sal_uInt32)maFontCollection.GetCount() * 76;
[ # # ][ # # ]
539 : :
540 [ # # ][ # # ]: 0 : for ( sal_uInt32 i = 0; i < maFontCollection.GetCount(); i++ )
541 : : {
542 [ # # ]: 0 : mpPptEscherEx->AddAtom( 68, EPP_FontEnityAtom, 0, i );
543 [ # # ]: 0 : const FontCollectionEntry* pDesc = maFontCollection.GetById( i );
544 : 0 : sal_uInt32 nFontLen = pDesc->Name.Len();
545 [ # # ]: 0 : if ( nFontLen > 31 )
546 : 0 : nFontLen = 31;
547 [ # # ]: 0 : for ( sal_uInt16 n = 0; n < 32; n++ )
548 : : {
549 : 0 : sal_Unicode nUniCode = 0;
550 [ # # ]: 0 : if ( n < nFontLen )
551 : 0 : nUniCode = pDesc->Name.GetChar( n );
552 [ # # ]: 0 : *mpStrm << nUniCode;
553 : : }
554 : 0 : sal_uInt8 lfCharSet = ANSI_CHARSET;
555 : 0 : sal_uInt8 lfClipPrecision = 0;
556 : 0 : sal_uInt8 lfQuality = 6;
557 : 0 : sal_uInt8 lfPitchAndFamily = 0;
558 : :
559 [ # # ]: 0 : if ( pDesc->CharSet == RTL_TEXTENCODING_SYMBOL )
560 : 0 : lfCharSet = SYMBOL_CHARSET;
561 : :
562 [ # # # # : 0 : switch( pDesc->Family )
# # ]
563 : : {
564 : : case ::com::sun::star::awt::FontFamily::ROMAN :
565 : 0 : lfPitchAndFamily |= FF_ROMAN;
566 : 0 : break;
567 : :
568 : : case ::com::sun::star::awt::FontFamily::SWISS :
569 : 0 : lfPitchAndFamily |= FF_SWISS;
570 : 0 : break;
571 : :
572 : : case ::com::sun::star::awt::FontFamily::MODERN :
573 : 0 : lfPitchAndFamily |= FF_MODERN;
574 : 0 : break;
575 : :
576 : : case ::com::sun::star::awt::FontFamily::SCRIPT:
577 : 0 : lfPitchAndFamily |= FF_SCRIPT;
578 : 0 : break;
579 : :
580 : : case ::com::sun::star::awt::FontFamily::DECORATIVE:
581 : 0 : lfPitchAndFamily |= FF_DECORATIVE;
582 : 0 : break;
583 : :
584 : : default:
585 : 0 : lfPitchAndFamily |= FAMILY_DONTKNOW;
586 : 0 : break;
587 : : }
588 [ # # ]: 0 : switch( pDesc->Pitch )
589 : : {
590 : : case ::com::sun::star::awt::FontPitch::FIXED:
591 : 0 : lfPitchAndFamily |= FIXED_PITCH;
592 : 0 : break;
593 : :
594 : : default:
595 : 0 : lfPitchAndFamily |= DEFAULT_PITCH;
596 : 0 : break;
597 : : }
598 [ # # ]: 0 : *mpStrm << lfCharSet
599 [ # # ]: 0 : << lfClipPrecision
600 [ # # ]: 0 : << lfQuality
601 [ # # ]: 0 : << lfPitchAndFamily;
602 : : }
603 [ # # ]: 0 : mpStyleSheet->WriteTxCFStyleAtom( *mpStrm ); // create style that is used for new standard objects
604 [ # # ]: 0 : mpPptEscherEx->AddAtom( 10, EPP_TxSIStyleAtom );
605 [ # # ]: 0 : *mpStrm << (sal_uInt32)7 // ?
606 [ # # ]: 0 : << (sal_Int16)2 // ?
607 [ # # ]: 0 : << (sal_uInt8)9 // ?
608 [ # # ]: 0 : << (sal_uInt8)8 // ?
609 [ # # ]: 0 : << (sal_Int16)0; // ?
610 : :
611 [ # # ][ # # ]: 0 : mpStrm->Write( aTxMasterStyleAtomStrm.GetData(), aTxMasterStyleAtomStrm.Tell() );
612 [ # # ]: 0 : maSoundCollection.Write( *mpStrm );
613 [ # # ]: 0 : mpPptEscherEx->WriteDrawingGroupContainer( *mpStrm );
614 [ # # ]: 0 : ImplMasterSlideListContainer( mpStrm );
615 [ # # ]: 0 : ImplDocumentListContainer( mpStrm );
616 : :
617 [ # # ]: 0 : sal_uInt32 nOldPos = mpPptEscherEx->PtGetOffsetByID( EPP_Persist_CurrentPos );
618 [ # # ]: 0 : if ( nOldPos )
619 : : {
620 [ # # ]: 0 : mpStrm->Seek( nOldPos );
621 : 0 : return sal_True;
622 [ # # ][ # # ]: 0 : }
623 : : }
624 : 0 : return sal_False;
625 : : }
626 : :
627 : : // ---------------------------------------------------------------------------------------------
628 : :
629 : 0 : sal_Bool PropValue::GetPropertyValue(
630 : : ::com::sun::star::uno::Any& rAny,
631 : : const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
632 : : const String& rString,
633 : : sal_Bool bTestPropertyAvailability )
634 : : {
635 : 0 : sal_Bool bRetValue = sal_True;
636 [ # # ]: 0 : if ( bTestPropertyAvailability )
637 : : {
638 : 0 : bRetValue = sal_False;
639 : : try
640 : : {
641 : : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
642 [ # # ][ # # ]: 0 : aXPropSetInfo( rXPropSet->getPropertySetInfo() );
643 [ # # ]: 0 : if ( aXPropSetInfo.is() )
644 [ # # ][ # # ]: 0 : bRetValue = aXPropSetInfo->hasPropertyByName( rString );
[ # # ][ # # ]
645 : : }
646 : 0 : catch( ::com::sun::star::uno::Exception& )
647 : : {
648 : 0 : bRetValue = sal_False;
649 : : }
650 : : }
651 [ # # ]: 0 : if ( bRetValue )
652 : : {
653 : : try
654 : : {
655 [ # # ][ # # ]: 0 : rAny = rXPropSet->getPropertyValue( rString );
[ # # ][ # # ]
656 [ # # ]: 0 : if ( !rAny.hasValue() )
657 : 0 : bRetValue = sal_False;
658 : : }
659 : 0 : catch( ::com::sun::star::uno::Exception& )
660 : : {
661 : 0 : bRetValue = sal_False;
662 : : }
663 : : }
664 : 0 : return bRetValue;
665 : : }
666 : :
667 : : // ---------------------------------------------------------------------------------------------
668 : :
669 : 0 : ::com::sun::star::beans::PropertyState PropValue::GetPropertyState(
670 : : const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
671 : : const String& rPropertyName )
672 : : {
673 : 0 : ::com::sun::star::beans::PropertyState eRetValue = ::com::sun::star::beans::PropertyState_AMBIGUOUS_VALUE;
674 : : try
675 : : {
676 : : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState > aXPropState
677 [ # # ]: 0 : ( rXPropSet, ::com::sun::star::uno::UNO_QUERY );
678 [ # # ]: 0 : if ( aXPropState.is() )
679 [ # # ][ # # ]: 0 : eRetValue = aXPropState->getPropertyState( rPropertyName );
[ # # ][ # # ]
680 : : }
681 : 0 : catch( ::com::sun::star::uno::Exception& )
682 : : {
683 : : //...
684 : : }
685 : 0 : return eRetValue;
686 : : }
687 : :
688 : : // ---------------------------------------------------------------------------------------------
689 : :
690 : 0 : sal_Bool PropValue::ImplGetPropertyValue( const String& rString )
691 : : {
692 : 0 : return GetPropertyValue( mAny, mXPropSet, rString );
693 : : }
694 : :
695 : : // ---------------------------------------------------------------------------------------------
696 : :
697 : 0 : sal_Bool PropValue::ImplGetPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & aXPropSet, const String& rString )
698 : : {
699 : 0 : return GetPropertyValue( mAny, aXPropSet, rString );
700 : : }
701 : :
702 : : // ---------------------------------------------------------------------------------------------
703 : :
704 : 0 : sal_Bool PropStateValue::ImplGetPropertyValue( const String& rString, sal_Bool bGetPropertyState )
705 : : {
706 : 0 : ePropState = ::com::sun::star::beans::PropertyState_AMBIGUOUS_VALUE;
707 : 0 : sal_Bool bRetValue = sal_True;
708 : : #ifdef UNX
709 : : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
710 [ # # ][ # # ]: 0 : aXPropSetInfo( mXPropSet->getPropertySetInfo() );
711 [ # # ]: 0 : if ( !aXPropSetInfo.is() )
712 : 0 : return sal_False;
713 : : #endif
714 : : try
715 : : {
716 [ # # ][ # # ]: 0 : mAny = mXPropSet->getPropertyValue( rString );
[ # # ]
717 [ # # ]: 0 : if ( !mAny.hasValue() )
718 : 0 : bRetValue = sal_False;
719 [ # # ]: 0 : else if ( bGetPropertyState )
720 [ # # ][ # # ]: 0 : ePropState = mXPropState->getPropertyState( rString );
[ # # ][ # # ]
721 : : else
722 : 0 : ePropState = ::com::sun::star::beans::PropertyState_DIRECT_VALUE;
723 : : }
724 [ # # ]: 0 : catch( ::com::sun::star::uno::Exception& )
725 : : {
726 : 0 : bRetValue = sal_False;
727 : : }
728 : 0 : return bRetValue;
729 : : }
730 : :
731 : : // ---------------------------------------------------------------------------------------------
732 : :
733 : 0 : void PPTWriter::ImplWriteParagraphs( SvStream& rOut, TextObj& rTextObj )
734 : : {
735 : 0 : sal_Bool bFirstParagraph = sal_True;
736 : : sal_uInt32 nCharCount;
737 : 0 : sal_uInt32 nPropertyFlags = 0;
738 : 0 : sal_uInt16 nDepth = 0;
739 : : sal_Int16 nLineSpacing;
740 : 0 : int nInstance = rTextObj.GetInstance();
741 : :
742 [ # # ]: 0 : for ( sal_uInt32 i = 0; i < rTextObj.ParagraphCount(); ++i, bFirstParagraph = sal_False )
743 : : {
744 [ # # ]: 0 : ParagraphObj* pPara = rTextObj.GetParagraph(i);
745 [ # # ]: 0 : PortionObj* pPortion = pPara->front();
746 : 0 : nCharCount = pPara->size();
747 : :
748 : 0 : nDepth = pPara->nDepth;
749 [ # # ]: 0 : if ( nDepth > 4)
750 : 0 : nDepth = 4;
751 : :
752 [ # # ][ # # ]: 0 : if ( ( pPara->meTextAdjust == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) ||
[ # # ]
753 [ # # ]: 0 : ( mpStyleSheet->IsHardAttribute( nInstance, pPara->nDepth, ParaAttr_Adjust, pPara->mnTextAdjust ) ) )
754 : 0 : nPropertyFlags |= 0x00000800;
755 : 0 : nLineSpacing = pPara->mnLineSpacing;
756 : :
757 [ # # ]: 0 : const FontCollectionEntry* pDesc = maFontCollection.GetById( pPortion->mnFont );
758 : 0 : sal_Int16 nNormalSpacing = 100;
759 [ # # ][ # # ]: 0 : if ( !mbFontIndependentLineSpacing && pDesc )
760 : : {
761 : 0 : double fN = 100.0;
762 : 0 : fN *= pDesc->Scaling;
763 : 0 : nNormalSpacing = (sal_Int16)( fN + 0.5 );
764 : : }
765 [ # # ][ # # ]: 0 : if ( !mbFontIndependentLineSpacing && bFirstParagraph && ( nLineSpacing > nNormalSpacing ) ) // sj: i28747, no replacement for fixed linespacing
[ # # ]
766 : : {
767 : 0 : nLineSpacing = nNormalSpacing;
768 : 0 : nPropertyFlags |= 0x00001000;
769 : : }
770 : : else
771 : : {
772 [ # # ]: 0 : if ( nLineSpacing > 0 )
773 : : {
774 [ # # ][ # # ]: 0 : if ( !mbFontIndependentLineSpacing && pDesc )
775 : 0 : nLineSpacing = (sal_Int16)( (double)nLineSpacing * pDesc->Scaling + 0.5 );
776 : : }
777 : : else
778 : : {
779 [ # # ][ # # ]: 0 : if ( !pPara->mbFixedLineSpacing && pPortion && pPortion->mnCharHeight > (sal_uInt16)( ((double)-nLineSpacing) * 0.001 * 72.0 / 2.54 ) ) // 1/100mm to point
[ # # ]
780 : 0 : nLineSpacing = nNormalSpacing;
781 : : else
782 : 0 : nLineSpacing = (sal_Int16)( (double)nLineSpacing / 4.40972 );
783 : : }
784 [ # # ][ # # ]: 0 : if ( ( pPara->meLineSpacing == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) ||
[ # # ]
785 [ # # ]: 0 : ( mpStyleSheet->IsHardAttribute( nInstance, pPara->nDepth, ParaAttr_LineFeed, nLineSpacing ) ) )
786 : 0 : nPropertyFlags |= 0x00001000;
787 : : }
788 [ # # ][ # # ]: 0 : if ( ( pPara->meLineSpacingTop == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) ||
[ # # ]
789 [ # # ]: 0 : ( mpStyleSheet->IsHardAttribute( nInstance, pPara->nDepth, ParaAttr_UpperDist, pPara->mnLineSpacingTop ) ) )
790 : 0 : nPropertyFlags |= 0x00002000;
791 [ # # ][ # # ]: 0 : if ( ( pPara->meLineSpacingBottom == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) ||
[ # # ]
792 [ # # ]: 0 : ( mpStyleSheet->IsHardAttribute( nInstance, pPara->nDepth, ParaAttr_LowerDist, pPara->mnLineSpacingBottom ) ) )
793 : 0 : nPropertyFlags |= 0x00004000;
794 [ # # ][ # # ]: 0 : if ( ( pPara->meForbiddenRules == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) ||
[ # # ]
795 [ # # ]: 0 : ( mpStyleSheet->IsHardAttribute( nInstance, pPara->nDepth, ParaAttr_UpperDist, pPara->mbForbiddenRules ) ) )
796 : 0 : nPropertyFlags |= 0x00020000;
797 [ # # ][ # # ]: 0 : if ( ( pPara->meParagraphPunctation == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) ||
[ # # ]
798 [ # # ]: 0 : ( mpStyleSheet->IsHardAttribute( nInstance, pPara->nDepth, ParaAttr_UpperDist, pPara->mbParagraphPunctation ) ) )
799 : 0 : nPropertyFlags |= 0x00080000;
800 [ # # ][ # # ]: 0 : if ( ( pPara->meBiDi == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) ||
[ # # ]
801 [ # # ]: 0 : ( mpStyleSheet->IsHardAttribute( nInstance, nDepth, ParaAttr_BiDi, pPara->mnBiDi ) ) )
802 : 0 : nPropertyFlags |= 0x00200000;
803 : :
804 : 0 : sal_Int32 nBuRealSize = pPara->nBulletRealSize;
805 : 0 : sal_Int16 nBulletFlags = pPara->nBulletFlags;
806 : :
807 [ # # ]: 0 : if ( pPara->bExtendedParameters )
808 : 0 : nPropertyFlags |= pPara->nParaFlags;
809 : : else
810 : : {
811 : 0 : nPropertyFlags |= 1; // turn off bullet explicit
812 : 0 : nBulletFlags = 0;
813 : : }
814 [ # # ][ # # ]: 0 : FontCollectionEntry aFontDescEntry( pPara->aFontDesc.Name, pPara->aFontDesc.Family, pPara->aFontDesc.Pitch, pPara->aFontDesc.CharSet );
[ # # ]
815 [ # # ]: 0 : sal_uInt16 nFontId = (sal_uInt16)maFontCollection.GetId( aFontDescEntry );
816 : :
817 [ # # ]: 0 : rOut << nCharCount
818 [ # # ]: 0 : << nDepth // Level
819 [ # # ]: 0 : << (sal_uInt32)nPropertyFlags; // Paragraph Attribut Set
820 : :
821 [ # # ]: 0 : if ( nPropertyFlags & 0xf )
822 [ # # ]: 0 : rOut << nBulletFlags;
823 [ # # ]: 0 : if ( nPropertyFlags & 0x80 )
824 [ # # ]: 0 : rOut << (sal_uInt16)( pPara->cBulletId );
825 [ # # ]: 0 : if ( nPropertyFlags & 0x10 )
826 [ # # ]: 0 : rOut << nFontId;
827 [ # # ]: 0 : if ( nPropertyFlags & 0x40 )
828 [ # # ]: 0 : rOut << (sal_Int16)nBuRealSize;
829 [ # # ]: 0 : if ( nPropertyFlags & 0x20 )
830 : : {
831 : 0 : sal_uInt32 nBulletColor = pPara->nBulletColor;
832 [ # # ]: 0 : if ( nBulletColor == COL_AUTO )
833 : : {
834 : 0 : sal_Bool bIsDark = sal_False;
835 : 0 : ::com::sun::star::uno::Any aAny;
836 [ # # ][ # # ]: 0 : if ( PropValue::GetPropertyValue( aAny, mXPagePropSet, rtl::OUString( "IsBackgroundDark" ), sal_True ) )
[ # # ][ # # ]
837 : 0 : aAny >>= bIsDark;
838 [ # # ]: 0 : nBulletColor = bIsDark ? 0xffffff : 0x000000;
839 : : }
840 : 0 : nBulletColor &= 0xffffff;
841 : 0 : nBulletColor |= 0xfe000000;
842 [ # # ]: 0 : rOut << nBulletColor;
843 : : }
844 [ # # ]: 0 : if ( nPropertyFlags & 0x00000800 )
845 [ # # ]: 0 : rOut << (sal_uInt16)( pPara->mnTextAdjust );
846 [ # # ]: 0 : if ( nPropertyFlags & 0x00001000 )
847 [ # # ]: 0 : rOut << (sal_uInt16)( nLineSpacing );
848 [ # # ]: 0 : if ( nPropertyFlags & 0x00002000 )
849 [ # # ]: 0 : rOut << (sal_uInt16)( pPara->mnLineSpacingTop );
850 [ # # ]: 0 : if ( nPropertyFlags & 0x00004000 )
851 [ # # ]: 0 : rOut << (sal_uInt16)( pPara->mnLineSpacingBottom );
852 [ # # ]: 0 : if ( nPropertyFlags & 0x000e0000 )
853 : : {
854 : 0 : sal_uInt16 nAsianSettings = 0;
855 [ # # ]: 0 : if ( pPara->mbForbiddenRules )
856 : 0 : nAsianSettings |= 1;
857 [ # # ]: 0 : if ( pPara->mbParagraphPunctation )
858 : 0 : nAsianSettings |= 4;
859 [ # # ]: 0 : rOut << nAsianSettings;
860 : : }
861 [ # # ]: 0 : if ( nPropertyFlags & 0x200000 )
862 [ # # ]: 0 : rOut << pPara->mnBiDi;
863 [ # # ]: 0 : }
864 : 0 : }
865 : :
866 : : // -----------------------------------------------------------------------
867 : :
868 : 0 : void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj )
869 : : {
870 : : sal_uInt32 nPropertyFlags;
871 : 0 : int nInstance = rTextObj.GetInstance();
872 : :
873 [ # # ]: 0 : for ( sal_uInt32 i = 0; i < rTextObj.ParagraphCount(); ++i )
874 : : {
875 : 0 : ParagraphObj* pPara = rTextObj.GetParagraph(i);
876 [ # # ][ # # ]: 0 : for ( ParagraphObj::const_iterator it = pPara->begin(); it != pPara->end(); ++it )
[ # # ]
877 : : {
878 : 0 : PortionObj* pPortion = *it;
879 : 0 : nPropertyFlags = 0;
880 : 0 : sal_uInt32 nCharAttr = pPortion->mnCharAttr;
881 : 0 : sal_uInt32 nCharColor = pPortion->mnCharColor;
882 : :
883 [ # # ]: 0 : if ( nCharColor == COL_AUTO ) // nCharColor depends to the background color
884 : : {
885 : 0 : sal_Bool bIsDark = sal_False;
886 : 0 : ::com::sun::star::uno::Any aAny;
887 [ # # ][ # # ]: 0 : if ( PropValue::GetPropertyValue( aAny, mXPagePropSet, rtl::OUString( "IsBackgroundDark" ), sal_True ) )
[ # # ][ # # ]
888 : 0 : aAny >>= bIsDark;
889 [ # # ]: 0 : nCharColor = bIsDark ? 0xffffff : 0x000000;
890 : : }
891 : :
892 : 0 : nCharColor &= 0xffffff;
893 : :
894 : : /* the portion is using the embossed or engraved attribute, which we want to map to the relief feature of PPT.
895 : : Because the relief feature of PPT is dependent to the background color, such a mapping can not always be used. */
896 [ # # ]: 0 : if ( nCharAttr & 0x200 )
897 : : {
898 : 0 : sal_uInt32 nBackgroundColor = 0xffffff;
899 : :
900 [ # # ]: 0 : if ( !nCharColor ) // special threatment for
901 : 0 : nCharColor = 0xffffff; // black fontcolor
902 : :
903 : 0 : ::com::sun::star::uno::Any aAny;
904 : 0 : ::com::sun::star::drawing::FillStyle aFS( ::com::sun::star::drawing::FillStyle_NONE );
905 [ # # ][ # # ]: 0 : if ( PropValue::GetPropertyValue( aAny, mXPropSet, rtl::OUString( "FillStyle" ) ) )
[ # # ][ # # ]
906 [ # # ]: 0 : aAny >>= aFS;
907 [ # # # # ]: 0 : switch( aFS )
908 : : {
909 : : case ::com::sun::star::drawing::FillStyle_GRADIENT :
910 : : {
911 : 0 : Point aEmptyPoint = Point();
912 [ # # ]: 0 : Rectangle aRect( aEmptyPoint, Size( 28000, 21000 ) );
913 [ # # ][ # # ]: 0 : EscherPropertyContainer aPropOpt( mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aRect );
914 [ # # ]: 0 : aPropOpt.CreateGradientProperties( mXPropSet );
915 [ # # ][ # # ]: 0 : aPropOpt.GetOpt( ESCHER_Prop_fillColor, nBackgroundColor );
916 : : }
917 : 0 : break;
918 : : case ::com::sun::star::drawing::FillStyle_SOLID :
919 : : {
920 [ # # ][ # # ]: 0 : if ( PropValue::GetPropertyValue( aAny, mXPropSet, rtl::OUString( "FillColor" ) ) )
[ # # ][ # # ]
921 [ # # ]: 0 : nBackgroundColor = mpPptEscherEx->GetColor( *((sal_uInt32*)aAny.getValue()) );
922 : : }
923 : 0 : break;
924 : : case ::com::sun::star::drawing::FillStyle_NONE :
925 : : {
926 : 0 : ::com::sun::star::uno::Any aBackAny;
927 : 0 : ::com::sun::star::drawing::FillStyle aBackFS( ::com::sun::star::drawing::FillStyle_NONE );
928 [ # # ][ # # ]: 0 : if ( PropValue::GetPropertyValue( aBackAny, mXBackgroundPropSet, rtl::OUString( "FillStyle" ) ) )
[ # # ][ # # ]
929 [ # # ]: 0 : aBackAny >>= aBackFS;
930 [ # # # ]: 0 : switch( aBackFS )
931 : : {
932 : : case ::com::sun::star::drawing::FillStyle_GRADIENT :
933 : : {
934 : 0 : Point aEmptyPoint = Point();
935 [ # # ]: 0 : Rectangle aRect( aEmptyPoint, Size( 28000, 21000 ) );
936 [ # # ][ # # ]: 0 : EscherPropertyContainer aPropOpt( mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aRect );
937 [ # # ]: 0 : aPropOpt.CreateGradientProperties( mXBackgroundPropSet );
938 [ # # ][ # # ]: 0 : aPropOpt.GetOpt( ESCHER_Prop_fillColor, nBackgroundColor );
939 : : }
940 : 0 : break;
941 : : case ::com::sun::star::drawing::FillStyle_SOLID :
942 : : {
943 [ # # ][ # # ]: 0 : if ( PropValue::GetPropertyValue( aAny, mXBackgroundPropSet, rtl::OUString( "FillColor" ) ) )
[ # # ][ # # ]
944 [ # # ]: 0 : nBackgroundColor = mpPptEscherEx->GetColor( *((sal_uInt32*)aAny.getValue()) );
945 : : }
946 : 0 : break;
947 : : default:
948 : 0 : break;
949 : 0 : }
950 : : }
951 : 0 : break;
952 : : default:
953 : 0 : break;
954 : : }
955 : :
956 : 0 : sal_Int32 nB = nBackgroundColor & 0xff;
957 : 0 : nB += (sal_uInt8)( nBackgroundColor >> 8 );
958 : 0 : nB += (sal_uInt8)( nBackgroundColor >> 16 );
959 : : // if the background color is nearly black, relief can't been used, because the text would not be visible
960 [ # # ][ # # ]: 0 : if ( nB < 0x60 || ( nBackgroundColor != nCharColor ) )
961 : : {
962 : 0 : nCharAttr &=~ 0x200;
963 : :
964 : : // now check if the text is part of a group, and if the previous object has the same color than the fontcolor
965 : : // ( and if fillcolor is not available the background color ), it is sometimes
966 : : // not possible to export the 'embossed' flag
967 [ # # ][ # # ]: 0 : if ( ( GetCurrentGroupLevel() > 0 ) && ( GetCurrentGroupIndex() >= 1 ) )
[ # # ]
968 : : {
969 [ # # ][ # # ]: 0 : ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > aGroupedShape( GetCurrentGroupAccess()->getByIndex( GetCurrentGroupIndex() - 1 ), uno::UNO_QUERY );
[ # # ]
970 [ # # ]: 0 : if( aGroupedShape.is() )
971 : : {
972 : : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > aPropSetOfNextShape
973 [ # # ]: 0 : ( aGroupedShape, ::com::sun::star::uno::UNO_QUERY );
974 [ # # ]: 0 : if ( aPropSetOfNextShape.is() )
975 : : {
976 [ # # ]: 0 : if ( PropValue::GetPropertyValue( aAny, aPropSetOfNextShape,
977 [ # # ][ # # ]: 0 : rtl::OUString( "FillColor" ), sal_True ) )
[ # # ]
978 : : {
979 [ # # ][ # # ]: 0 : if ( nCharColor == mpPptEscherEx->GetColor( *((sal_uInt32*)aAny.getValue()) ) )
980 : : {
981 : 0 : nCharAttr |= 0x200;
982 : : }
983 : : }
984 : 0 : }
985 : 0 : }
986 : : }
987 : 0 : }
988 : : }
989 : 0 : nCharColor |= 0xfe000000;
990 [ # # ]: 0 : if ( nInstance == 4 ) // special handling for normal textobjects:
991 : 0 : nPropertyFlags |= nCharAttr & 0x217; // not all attributes ar inherited
992 : : else
993 : : {
994 [ # # ]: 0 : if ( /* ( pPortion->mnCharAttrHard & 1 ) || */
995 [ # # ]: 0 : ( mpStyleSheet->IsHardAttribute( nInstance, pPara->nDepth, CharAttr_Bold, nCharAttr ) ) )
996 : 0 : nPropertyFlags |= 1;
997 [ # # ]: 0 : if ( /* ( pPortion->mnCharAttrHard & 2 ) || */
998 [ # # ]: 0 : ( mpStyleSheet->IsHardAttribute( nInstance, pPara->nDepth, CharAttr_Italic, nCharAttr ) ) )
999 : 0 : nPropertyFlags |= 2;
1000 [ # # ]: 0 : if ( /* ( pPortion->mnCharAttrHard & 4 ) || */
1001 [ # # ]: 0 : ( mpStyleSheet->IsHardAttribute( nInstance, pPara->nDepth, CharAttr_Underline, nCharAttr ) ) )
1002 : 0 : nPropertyFlags |= 4;
1003 [ # # ]: 0 : if ( /* ( pPortion->mnCharAttrHard & 0x10 ) || */
1004 [ # # ]: 0 : ( mpStyleSheet->IsHardAttribute( nInstance, pPara->nDepth, CharAttr_Shadow, nCharAttr ) ) )
1005 : 0 : nPropertyFlags |= 0x10;
1006 [ # # ]: 0 : if ( /* ( pPortion->mnCharAttrHard & 0x200 ) || */
1007 [ # # ]: 0 : ( mpStyleSheet->IsHardAttribute( nInstance, pPara->nDepth, CharAttr_Embossed, nCharAttr ) ) )
1008 : 0 : nPropertyFlags |= 512;
1009 : : }
1010 [ # # ]: 0 : if ( rTextObj.HasExtendedBullets() )
1011 : : {
1012 : 0 : nPropertyFlags |= ( i & 0x3f ) << 10 ;
1013 : 0 : nCharAttr |= ( i & 0x3f ) << 10;
1014 : : }
1015 [ # # ][ # # ]: 0 : if ( ( pPortion->meFontName == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) ||
[ # # ]
1016 [ # # ]: 0 : ( mpStyleSheet->IsHardAttribute( nInstance, pPara->nDepth, CharAttr_Font, pPortion->mnFont ) ) )
1017 : 0 : nPropertyFlags |= 0x00010000;
1018 [ # # ][ # # ]: 0 : if ( ( pPortion->meAsianOrComplexFont == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) ||
[ # # ]
1019 [ # # ]: 0 : ( mpStyleSheet->IsHardAttribute( nInstance, pPara->nDepth, CharAttr_AsianOrComplexFont, pPortion->mnAsianOrComplexFont ) ) )
1020 : 0 : nPropertyFlags |= 0x00200000;
1021 [ # # ][ # # ]: 0 : if ( ( pPortion->meCharHeight == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) ||
[ # # ]
1022 [ # # ]: 0 : ( mpStyleSheet->IsHardAttribute( nInstance, pPara->nDepth, CharAttr_FontHeight, pPortion->mnCharHeight ) ) )
1023 : 0 : nPropertyFlags |= 0x00020000;
1024 [ # # ][ # # ]: 0 : if ( ( pPortion->meCharColor == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) ||
[ # # ]
1025 [ # # ]: 0 : ( mpStyleSheet->IsHardAttribute( nInstance, pPara->nDepth, CharAttr_FontColor, nCharColor & 0xffffff ) ) )
1026 : 0 : nPropertyFlags |= 0x00040000;
1027 [ # # ][ # # ]: 0 : if ( ( pPortion->meCharEscapement == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) ||
[ # # ]
1028 [ # # ]: 0 : ( mpStyleSheet->IsHardAttribute( nInstance, pPara->nDepth, CharAttr_Escapement, pPortion->mnCharEscapement ) ) )
1029 : 0 : nPropertyFlags |= 0x00080000;
1030 : :
1031 : 0 : sal_uInt32 nCharCount = pPortion->Count();
1032 : :
1033 [ # # ]: 0 : rOut << nCharCount
1034 [ # # ]: 0 : << nPropertyFlags; //PropertyFlags
1035 : :
1036 [ # # ]: 0 : if ( nPropertyFlags & 0xffff )
1037 [ # # ]: 0 : rOut << (sal_uInt16)( nCharAttr );
1038 [ # # ]: 0 : if ( nPropertyFlags & 0x00010000 )
1039 [ # # ]: 0 : rOut << pPortion->mnFont;
1040 [ # # ]: 0 : if ( nPropertyFlags & 0x00200000 )
1041 [ # # ]: 0 : rOut << pPortion->mnAsianOrComplexFont;
1042 [ # # ]: 0 : if ( nPropertyFlags & 0x00020000 )
1043 [ # # ]: 0 : rOut << (sal_uInt16)( pPortion->mnCharHeight );
1044 [ # # ]: 0 : if ( nPropertyFlags & 0x00040000 )
1045 [ # # ]: 0 : rOut << (sal_uInt32)nCharColor;
1046 [ # # ]: 0 : if ( nPropertyFlags & 0x00080000 )
1047 [ # # ]: 0 : rOut << pPortion->mnCharEscapement;
1048 : : }
1049 : : }
1050 : 0 : }
1051 : :
1052 : : // ----------------------------------------------------------------------------------------
1053 : : // laedt und konvertiert text aus shape, ergebnis ist mnTextSize gespeichert;
1054 : 0 : sal_Bool PPTWriter::ImplGetText()
1055 : : {
1056 : 0 : mnTextSize = 0;
1057 : 0 : mbFontIndependentLineSpacing = sal_False;
1058 : : mXText = ::com::sun::star::uno::Reference<
1059 : : ::com::sun::star::text::XSimpleText >
1060 [ # # ]: 0 : ( mXShape, ::com::sun::star::uno::UNO_QUERY );
1061 : :
1062 [ # # ]: 0 : if ( mXText.is() )
1063 : : {
1064 [ # # ][ # # ]: 0 : mnTextSize = mXText->getString().getLength();
1065 : 0 : ::com::sun::star::uno::Any aAny;
1066 [ # # ][ # # ]: 0 : if ( GetPropertyValue( aAny, mXPropSet, rtl::OUString( "FontIndependentLineSpacing" ) ), sal_True )
[ # # ][ # # ]
1067 : 0 : aAny >>= mbFontIndependentLineSpacing;
1068 : : }
1069 : 0 : return ( mnTextSize != 0 );
1070 : : }
1071 : :
1072 : : // -----------------------------------------------------------------------
1073 : :
1074 : 0 : void PPTWriter::ImplFlipBoundingBox( EscherPropertyContainer& rPropOpt )
1075 : : {
1076 [ # # ]: 0 : if ( mnAngle < 0 )
1077 : 0 : mnAngle = ( 36000 + mnAngle ) % 36000;
1078 : : else
1079 : 0 : mnAngle = ( 36000 - ( mnAngle % 36000 ) );
1080 : :
1081 : 0 : double fCos = cos( (double)mnAngle * F_PI18000 );
1082 : 0 : double fSin = sin( (double)mnAngle * F_PI18000 );
1083 : :
1084 : 0 : double fWidthHalf = maRect.GetWidth() / 2;
1085 : 0 : double fHeightHalf = maRect.GetHeight() / 2;
1086 : :
1087 : 0 : double fXDiff = fCos * fWidthHalf + fSin * (-fHeightHalf);
1088 : 0 : double fYDiff = - ( fSin * fWidthHalf - fCos * ( -fHeightHalf ) );
1089 : :
1090 : 0 : maRect.Move( (sal_Int32)( -( fWidthHalf - fXDiff ) ), (sal_Int32)( - ( fHeightHalf + fYDiff ) ) );
1091 : 0 : mnAngle *= 655;
1092 : 0 : mnAngle += 0x8000;
1093 : 0 : mnAngle &=~0xffff; // nAngle auf volle Gradzahl runden
1094 : 0 : rPropOpt.AddOpt( ESCHER_Prop_Rotation, mnAngle );
1095 : :
1096 [ # # ][ # # ]: 0 : if ( ( mnAngle >= ( 45 << 16 ) && mnAngle < ( 135 << 16 ) ) ||
[ # # ][ # # ]
1097 : : ( mnAngle >= ( 225 << 16 ) && mnAngle < ( 315 << 16 ) ) )
1098 : : {
1099 : : // In diesen beiden Bereichen steht in PPT gemeinerweise die
1100 : : // BoundingBox bereits senkrecht. Daher muss diese VOR
1101 : : // DER ROTATION flachgelegt werden.
1102 : : ::com::sun::star::awt::Point
1103 : 0 : aTopLeft( (sal_Int32)( maRect.Left() + fWidthHalf - fHeightHalf ), (sal_Int32)( maRect.Top() + fHeightHalf - fWidthHalf ) );
1104 [ # # ][ # # ]: 0 : Size aNewSize( maRect.GetHeight(), maRect.GetWidth() );
1105 [ # # ]: 0 : maRect = Rectangle( Point( aTopLeft.X, aTopLeft.Y ), aNewSize );
1106 : : }
1107 : 0 : }
1108 : :
1109 : : // -----------------------------------------------------------------------
1110 : :
1111 : 0 : void PPTWriter::ImplAdjustFirstLineLineSpacing( TextObj& rTextObj, EscherPropertyContainer& rPropOpt )
1112 : : {
1113 [ # # ]: 0 : if ( !mbFontIndependentLineSpacing )
1114 : : {
1115 [ # # ]: 0 : if ( rTextObj.ParagraphCount() )
1116 : : {
1117 : 0 : ParagraphObj* pPara = rTextObj.GetParagraph(0);
1118 [ # # ]: 0 : if ( !pPara->empty() )
1119 : : {
1120 : 0 : PortionObj* pPortion = pPara->front();
1121 : 0 : sal_Int16 nLineSpacing = pPara->mnLineSpacing;
1122 : 0 : const FontCollectionEntry* pDesc = maFontCollection.GetById( pPortion->mnFont );
1123 [ # # ]: 0 : if ( pDesc )
1124 : 0 : nLineSpacing = (sal_Int16)( (double)nLineSpacing * pDesc->Scaling + 0.5 );
1125 : :
1126 [ # # ][ # # ]: 0 : if ( ( nLineSpacing > 0 ) && ( nLineSpacing < 100 ) )
1127 : : {
1128 : 0 : double fCharHeight = pPortion->mnCharHeight;
1129 : 0 : fCharHeight *= 2540 / 72;
1130 : 0 : fCharHeight *= 100 - nLineSpacing;
1131 : 0 : fCharHeight /= 100;
1132 : :
1133 : 0 : sal_uInt32 nUpperDistance = 0;
1134 [ # # ]: 0 : rPropOpt.GetOpt( ESCHER_Prop_dyTextTop, nUpperDistance );
1135 : 0 : nUpperDistance += static_cast< sal_uInt32 >( fCharHeight * 360.0 );
1136 [ # # ]: 0 : rPropOpt.AddOpt( ESCHER_Prop_dyTextTop, nUpperDistance );
1137 : : }
1138 : : }
1139 : : }
1140 : : }
1141 : 0 : }
1142 : :
1143 : : // -----------------------------------------------------------------------
1144 : :
1145 : 0 : void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_uInt32 nAtomInstance,
1146 : : TextRuleEntry* pTextRule, SvStream& rExtBuStr, EscherPropertyContainer* pPropOpt )
1147 : : {
1148 : 0 : PPTExParaSheet& rParaSheet = mpStyleSheet->GetParaSheet( nTextInstance );
1149 : :
1150 : 0 : rOut << (sal_uInt32)( ( EPP_TextHeaderAtom << 16 ) | ( nAtomInstance << 4 ) ) << (sal_uInt32)4
1151 : 0 : << sal_Int32(nTextInstance);
1152 : :
1153 [ # # ]: 0 : if ( mbEmptyPresObj )
1154 : 0 : mnTextSize = 0;
1155 [ # # ]: 0 : if ( !mbEmptyPresObj )
1156 : : {
1157 : : ParagraphObj* pPara;
1158 [ # # ]: 0 : TextObjBinary aTextObj( mXText, nTextInstance, maFontCollection, (PPTExBulletProvider&)*this );
1159 : :
1160 : : // leaving out EPP_TextCharsAtom w/o text - still write out
1161 : : // attribute info though
1162 [ # # ]: 0 : if ( mnTextSize )
1163 [ # # ]: 0 : aTextObj.Write( &rOut );
1164 : :
1165 [ # # ]: 0 : if ( pPropOpt )
1166 [ # # ]: 0 : ImplAdjustFirstLineLineSpacing( aTextObj, *pPropOpt );
1167 : :
1168 : 0 : sal_uInt32 nSize, nPos = rOut.Tell();
1169 : :
1170 [ # # ][ # # ]: 0 : rOut << (sal_uInt32)( EPP_StyleTextPropAtom << 16 ) << (sal_uInt32)0;
1171 [ # # ]: 0 : ImplWriteParagraphs( rOut, aTextObj );
1172 [ # # ]: 0 : ImplWritePortions( rOut, aTextObj );
1173 : 0 : nSize = rOut.Tell() - nPos;
1174 [ # # ]: 0 : rOut.SeekRel( - ( (sal_Int32)nSize - 4 ) );
1175 [ # # ]: 0 : rOut << (sal_uInt32)( nSize - 8 );
1176 [ # # ]: 0 : rOut.SeekRel( nSize - 8 );
1177 : :
1178 [ # # ]: 0 : for ( sal_uInt32 i = 0; i < aTextObj.ParagraphCount(); ++i )
1179 : : {
1180 [ # # ]: 0 : pPara = aTextObj.GetParagraph(i);
1181 [ # # ][ # # ]: 0 : for ( ParagraphObj::const_iterator it = pPara->begin(); it != pPara->end(); ++it )
[ # # ]
1182 : : {
1183 : 0 : PortionObj* pPortion = *it;
1184 [ # # ]: 0 : if ( pPortion->mpFieldEntry )
1185 : : {
1186 : 0 : const FieldEntry* pFieldEntry = pPortion->mpFieldEntry;
1187 : :
1188 [ # # # # : 0 : switch ( pFieldEntry->nFieldType >> 28 )
# # # ]
1189 : : {
1190 : : case 1 :
1191 : : case 2 :
1192 : : {
1193 [ # # ][ # # ]: 0 : rOut << (sal_uInt32)( EPP_DateTimeMCAtom << 16 ) << (sal_uInt32)8
1194 [ # # ]: 0 : << (sal_uInt32)( pFieldEntry->nFieldStartPos ) // TxtOffset auf TxtField;
1195 [ # # ]: 0 : << (sal_uInt8)( pFieldEntry->nFieldType & 0xff ) // Type
1196 [ # # ][ # # ]: 0 : << (sal_uInt8)0 << (sal_uInt16)0; // PadBytes
1197 : : }
1198 : 0 : break;
1199 : : case 3 :
1200 : : {
1201 [ # # ][ # # ]: 0 : rOut << (sal_uInt32)( EPP_SlideNumberMCAtom << 16 ) << (sal_uInt32 ) 4
1202 [ # # ]: 0 : << (sal_uInt32)( pFieldEntry->nFieldStartPos );
1203 : : }
1204 : 0 : break;
1205 : : case 4 :
1206 : : {
1207 : 0 : sal_uInt32 nPageIndex = 0;
1208 [ # # ]: 0 : String aPageUrl;
1209 [ # # ]: 0 : String aEmpty;
1210 [ # # ]: 0 : String aFile( pFieldEntry->aFieldUrl );
1211 [ # # ]: 0 : String aTarget( pFieldEntry->aFieldUrl );
1212 [ # # ][ # # ]: 0 : INetURLObject aUrl( pFieldEntry->aFieldUrl );
1213 [ # # ]: 0 : if ( INET_PROT_FILE == aUrl.GetProtocol() )
1214 [ # # ][ # # ]: 0 : aFile = aUrl.PathToFileName();
1215 [ # # ]: 0 : else if ( INET_PROT_SMB == aUrl.GetProtocol() )
1216 : : {
1217 : : // Convert smb notation to '\\' and skip the 'smb:' part
1218 [ # # ][ # # ]: 0 : aFile = aUrl.GetMainURL(INetURLObject::NO_DECODE).copy(4);
1219 [ # # ]: 0 : aFile.SearchAndReplaceAll( '/', '\\' );
1220 [ # # ]: 0 : aTarget = aFile;
1221 : : }
1222 [ # # ]: 0 : else if ( pFieldEntry->aFieldUrl.GetChar( 0 ) == '#' )
1223 : : {
1224 [ # # ][ # # ]: 0 : String aPage( INetURLObject::decode( pFieldEntry->aFieldUrl, '%', INetURLObject::DECODE_WITH_CHARSET ) );
[ # # ]
1225 [ # # ]: 0 : aPage.Erase( 0, 1 );
1226 : :
1227 [ # # ]: 0 : rtl::OUString aUPage(aPage);
1228 : : std::vector<rtl::OUString>::const_iterator pIter = std::find(
1229 [ # # ][ # # ]: 0 : maSlideNameList.begin(),maSlideNameList.end(),aUPage);
1230 : :
1231 [ # # ][ # # ]: 0 : if ( pIter != maSlideNameList.end() )
1232 : : {
1233 [ # # ]: 0 : nPageIndex = pIter - maSlideNameList.begin();
1234 [ # # ]: 0 : aPageUrl = rtl::OUString::valueOf(static_cast<sal_Int32>(256 + nPageIndex));
1235 [ # # ][ # # ]: 0 : aPageUrl.Append( rtl::OUString( "," ) );
[ # # ]
1236 [ # # ][ # # ]: 0 : aPageUrl.Append( String::CreateFromInt32( nPageIndex + 1 ) );
[ # # ]
1237 [ # # ][ # # ]: 0 : aPageUrl.Append( rtl::OUString( ",Slide " ) );
[ # # ]
1238 [ # # ][ # # ]: 0 : aPageUrl.Append( String::CreateFromInt32( nPageIndex + 1 ) );
[ # # ]
1239 [ # # ]: 0 : }
1240 : : }
1241 : 0 : sal_uInt32 nHyperId(0);
1242 [ # # ]: 0 : if ( aPageUrl.Len() )
1243 [ # # ]: 0 : nHyperId = ImplInsertBookmarkURL( aPageUrl, 1 | ( nPageIndex << 8 ) | ( 1 << 31 ), pFieldEntry->aRepresentation, aEmpty, aEmpty, aPageUrl );
1244 : : else
1245 [ # # ]: 0 : nHyperId = ImplInsertBookmarkURL( pFieldEntry->aFieldUrl, 2 | ( nHyperId << 8 ), aFile, aTarget, aEmpty, aEmpty );
1246 : :
1247 [ # # ][ # # ]: 0 : rOut << (sal_uInt32)( ( EPP_InteractiveInfo << 16 ) | 0xf ) << (sal_uInt32)24
1248 [ # # ][ # # ]: 0 : << (sal_uInt32)( EPP_InteractiveInfoAtom << 16 ) << (sal_uInt32)16
1249 [ # # ]: 0 : << (sal_uInt32)0 // soundref
1250 [ # # ]: 0 : << nHyperId // hyperlink id
1251 [ # # ]: 0 : << (sal_uInt8)4 // hyperlink action
1252 [ # # ]: 0 : << (sal_uInt8)0 // ole verb
1253 [ # # ]: 0 : << (sal_uInt8)0 // jump
1254 [ # # ]: 0 : << (sal_uInt8)0 // flags
1255 [ # # ]: 0 : << (sal_uInt8)8 // hyperlink type ?
1256 [ # # ][ # # ]: 0 : << (sal_uInt8)0 << (sal_uInt8)0 << (sal_uInt8)0
[ # # ]
1257 [ # # ][ # # ]: 0 : << (sal_uInt32)( EPP_TxInteractiveInfoAtom << 16 ) << (sal_uInt32)8
1258 [ # # ]: 0 : << (sal_uInt32)( pFieldEntry->nFieldStartPos )
1259 [ # # ][ # # ]: 0 : << (sal_uInt32)( pFieldEntry->nFieldEndPos );
[ # # ][ # # ]
[ # # ][ # # ]
1260 : : }
1261 : 0 : break;
1262 : : case 5 :
1263 : : {
1264 [ # # ][ # # ]: 0 : rOut << (sal_uInt32)( EPP_GenericDateMCAtom << 16 ) << (sal_uInt32)4
1265 [ # # ]: 0 : << (sal_uInt32)( pFieldEntry->nFieldStartPos );
1266 : : }
1267 : 0 : break;
1268 : : case 6 :
1269 : : {
1270 [ # # ][ # # ]: 0 : rOut << (sal_uInt32)( EPP_HeaderMCAtom << 16 ) << (sal_uInt32 ) 4
1271 [ # # ]: 0 : << (sal_uInt32)( pFieldEntry->nFieldStartPos );
1272 : : }
1273 : 0 : break;
1274 : : case 7 :
1275 : : {
1276 [ # # ][ # # ]: 0 : rOut << (sal_uInt32)( EPP_FooterMCAtom << 16 ) << (sal_uInt32 ) 4
1277 [ # # ]: 0 : << (sal_uInt32)( pFieldEntry->nFieldStartPos );
1278 : : }
1279 : 0 : break;
1280 : : default:
1281 : 0 : break;
1282 : : }
1283 : : }
1284 : : }
1285 : : }
1286 : :
1287 [ # # ]: 0 : aTextObj.WriteTextSpecInfo( &rOut );
1288 : :
1289 : : // Star Office Default TabSizes schreiben ( wenn noetig )
1290 [ # # ]: 0 : if ( aTextObj.ParagraphCount() )
1291 : : {
1292 [ # # ]: 0 : pPara = aTextObj.GetParagraph(0);
1293 : 0 : sal_uInt32 nParaFlags = 0x1f;
1294 : : sal_Int16 nDepth, nMask, nNumberingRule[ 10 ];
1295 : 0 : sal_uInt32 nTextOfs = pPara->nTextOfs;
1296 : 0 : sal_uInt32 nTabs = pPara->maTabStop.getLength();
1297 : 0 : const ::com::sun::star::style::TabStop* pTabStop = ( const ::com::sun::star::style::TabStop* )pPara->maTabStop.getConstArray();
1298 : :
1299 [ # # ]: 0 : for ( sal_uInt32 i = 0; i < aTextObj.ParagraphCount(); ++i )
1300 : : {
1301 [ # # ]: 0 : pPara = aTextObj.GetParagraph(i);
1302 [ # # ]: 0 : if ( pPara->bExtendedParameters )
1303 : : {
1304 : 0 : nDepth = pPara->nDepth;
1305 [ # # ]: 0 : if ( nDepth < 5 )
1306 : : {
1307 : 0 : nMask = 1 << nDepth;
1308 [ # # ]: 0 : if ( nParaFlags & nMask )
1309 : : {
1310 : 0 : nParaFlags &=~ nMask;
1311 [ # # ][ # # ]: 0 : if ( ( rParaSheet.maParaLevel[ nDepth ].mnTextOfs != pPara->nTextOfs ) ||
1312 : : ( rParaSheet.maParaLevel[ nDepth ].mnBulletOfs != pPara->nBulletOfs ) )
1313 : : {
1314 : 0 : nParaFlags |= nMask << 16;
1315 : 0 : nNumberingRule[ nDepth << 1 ] = pPara->nTextOfs;
1316 : 0 : nNumberingRule[ ( nDepth << 1 ) + 1 ] = (sal_Int16)pPara->nBulletOfs;
1317 : : }
1318 : : }
1319 : : }
1320 : : }
1321 : : }
1322 : 0 : nParaFlags >>= 16;
1323 : :
1324 [ # # ]: 0 : sal_uInt32 nDefaultTabSize = MapSize( ::com::sun::star::awt::Size( 2011, 1 ) ).Width;
1325 [ # # ]: 0 : sal_uInt32 nDefaultTabs = abs( maRect.GetWidth() ) / nDefaultTabSize;
1326 [ # # ]: 0 : if ( nTabs )
1327 : 0 : nDefaultTabs -= (sal_Int32)( ( ( pTabStop[ nTabs - 1 ].Position / 4.40972 ) + nTextOfs ) / nDefaultTabSize );
1328 [ # # ]: 0 : if ( (sal_Int32)nDefaultTabs < 0 )
1329 : 0 : nDefaultTabs = 0;
1330 : :
1331 : 0 : sal_uInt32 nTabCount = nTabs + nDefaultTabs;
1332 : 0 : sal_uInt32 i, nTextRulerAtomFlags = 0;
1333 : :
1334 [ # # ]: 0 : if ( nTabCount )
1335 : 0 : nTextRulerAtomFlags |= 4;
1336 [ # # ]: 0 : if ( nParaFlags )
1337 : 0 : nTextRulerAtomFlags |= ( ( nParaFlags << 3 ) | ( nParaFlags << 8 ) );
1338 : :
1339 [ # # ]: 0 : if ( nTextRulerAtomFlags )
1340 : : {
1341 : 0 : SvStream* pRuleOut = &rOut;
1342 [ # # ]: 0 : if ( pTextRule )
1343 [ # # ][ # # ]: 0 : pRuleOut = pTextRule->pOut = new SvMemoryStream( 0x100, 0x100 );
1344 : :
1345 : 0 : sal_uInt32 nRulePos = pRuleOut->Tell();
1346 [ # # ][ # # ]: 0 : *pRuleOut << (sal_uInt32)( EPP_TextRulerAtom << 16 ) << (sal_uInt32)0;
1347 [ # # ]: 0 : *pRuleOut << nTextRulerAtomFlags;
1348 [ # # ]: 0 : if ( nTextRulerAtomFlags & 4 )
1349 : : {
1350 [ # # ]: 0 : *pRuleOut << (sal_uInt16)nTabCount;
1351 [ # # ]: 0 : for ( i = 0; i < nTabs; i++ )
1352 : : {
1353 : 0 : sal_uInt16 nPosition = (sal_uInt16)( ( pTabStop[ i ].Position / 4.40972 ) + nTextOfs );
1354 : : sal_uInt16 nType;
1355 [ # # # # ]: 0 : switch ( pTabStop[ i ].Alignment )
1356 : : {
1357 : 0 : case ::com::sun::star::style::TabAlign_DECIMAL : nType = 3; break;
1358 : 0 : case ::com::sun::star::style::TabAlign_RIGHT : nType = 2; break;
1359 : 0 : case ::com::sun::star::style::TabAlign_CENTER : nType = 1; break;
1360 : :
1361 : : case ::com::sun::star::style::TabAlign_LEFT :
1362 : 0 : default: nType = 0;
1363 : : };
1364 [ # # ]: 0 : *pRuleOut << nPosition
1365 [ # # ]: 0 : << nType;
1366 : : }
1367 : :
1368 : 0 : sal_uInt32 nWidth = 1;
1369 [ # # ]: 0 : if ( nTabs )
1370 : 0 : nWidth += (sal_Int32)( ( ( pTabStop[ nTabs - 1 ].Position / 4.40972 + nTextOfs ) / nDefaultTabSize ) );
1371 : 0 : nWidth *= nDefaultTabSize;
1372 [ # # ]: 0 : for ( i = 0; i < nDefaultTabs; i++, nWidth += nDefaultTabSize )
1373 [ # # ]: 0 : *pRuleOut << nWidth;
1374 : : }
1375 [ # # ]: 0 : for ( i = 0; i < 5; i++ )
1376 : : {
1377 [ # # ]: 0 : if ( nTextRulerAtomFlags & ( 8 << i ) )
1378 [ # # ]: 0 : *pRuleOut << nNumberingRule[ i << 1 ];
1379 [ # # ]: 0 : if ( nTextRulerAtomFlags & ( 256 << i ) )
1380 [ # # ]: 0 : *pRuleOut << nNumberingRule[ ( i << 1 ) + 1 ];
1381 : : }
1382 : 0 : sal_uInt32 nBufSize = pRuleOut->Tell() - nRulePos;
1383 [ # # ]: 0 : pRuleOut->SeekRel( - ( (sal_Int32)nBufSize - 4 ) );
1384 [ # # ]: 0 : *pRuleOut << (sal_uInt32)( nBufSize - 8 );
1385 [ # # ]: 0 : pRuleOut->SeekRel( nBufSize - 8 );
1386 : : }
1387 : : }
1388 [ # # ]: 0 : if ( aTextObj.HasExtendedBullets() )
1389 : : {
1390 [ # # ]: 0 : if ( aTextObj.ParagraphCount() )
1391 : : {
1392 [ # # ]: 0 : ParagraphObj* pBulletPara = aTextObj.GetParagraph(0);
1393 : 0 : sal_uInt32 nBulletFlags = 0;
1394 : 0 : sal_uInt32 nNumberingType = 0, nPos2 = rExtBuStr.Tell();
1395 : :
1396 [ # # ][ # # ]: 0 : rExtBuStr << (sal_uInt32)( EPP_PST_ExtendedParagraphAtom << 16 ) << (sal_uInt32)0;
1397 : :
1398 [ # # ]: 0 : for ( sal_uInt32 i = 0; i < aTextObj.ParagraphCount(); ++i )
1399 : : {
1400 [ # # ]: 0 : pBulletPara = aTextObj.GetParagraph(i);
1401 : 0 : nBulletFlags = 0;
1402 : 0 : sal_uInt16 nBulletId = pBulletPara->nBulletId;
1403 [ # # ]: 0 : if ( pBulletPara->bExtendedBulletsUsed )
1404 : : {
1405 : 0 : nBulletFlags = 0x800000;
1406 [ # # ]: 0 : if ( pBulletPara->nNumberingType != SVX_NUM_BITMAP )
1407 : 0 : nBulletFlags = 0x3000000;
1408 : : }
1409 [ # # ]: 0 : rExtBuStr << (sal_uInt32)nBulletFlags;
1410 : :
1411 [ # # ]: 0 : if ( nBulletFlags & 0x800000 )
1412 [ # # ]: 0 : rExtBuStr << nBulletId;
1413 [ # # ]: 0 : if ( nBulletFlags & 0x1000000 )
1414 : : {
1415 [ # # # # ]: 0 : switch( pBulletPara->nNumberingType )
1416 : : {
1417 : : case SVX_NUM_NUMBER_NONE :
1418 : : case SVX_NUM_CHAR_SPECIAL :
1419 : 0 : nNumberingType = 0;
1420 : 0 : break;
1421 : : case SVX_NUM_CHARS_UPPER_LETTER :
1422 : : case SVX_NUM_CHARS_UPPER_LETTER_N :
1423 : : case SVX_NUM_CHARS_LOWER_LETTER :
1424 : : case SVX_NUM_CHARS_LOWER_LETTER_N :
1425 : : case SVX_NUM_ROMAN_UPPER :
1426 : : case SVX_NUM_ROMAN_LOWER :
1427 : : case SVX_NUM_ARABIC :
1428 : 0 : nNumberingType = pBulletPara->nMappedNumType;
1429 : 0 : break;
1430 : :
1431 : : case SVX_NUM_BITMAP :
1432 : 0 : nNumberingType = 0;
1433 : 0 : break;
1434 : :
1435 : : }
1436 [ # # ]: 0 : rExtBuStr << (sal_uInt32)nNumberingType;
1437 : : }
1438 [ # # ]: 0 : if ( nBulletFlags & 0x2000000 )
1439 [ # # ]: 0 : rExtBuStr << (sal_uInt16)pBulletPara->nStartWith;
1440 [ # # ][ # # ]: 0 : rExtBuStr << (sal_uInt32)0 << (sal_uInt32)0;
1441 : : }
1442 : 0 : sal_uInt32 nBulletSize = ( rExtBuStr.Tell() - nPos2 ) - 8;
1443 [ # # ]: 0 : rExtBuStr.SeekRel( - ( (sal_Int32)nBulletSize + 4 ) );
1444 [ # # ]: 0 : rExtBuStr << nBulletSize;
1445 [ # # ]: 0 : rExtBuStr.SeekRel( nBulletSize );
1446 : : }
1447 [ # # ]: 0 : }
1448 : : }
1449 : 0 : }
1450 : :
1451 : : // -----------------------------------------------------------------------
1452 : :
1453 : 0 : void PPTWriter::ImplWriteObjectEffect( SvStream& rSt,
1454 : : ::com::sun::star::presentation::AnimationEffect eAe,
1455 : : ::com::sun::star::presentation::AnimationEffect eTe,
1456 : : sal_uInt16 nOrder )
1457 : : {
1458 [ # # ]: 0 : EscherExContainer aAnimationInfo( rSt, EPP_AnimationInfo );
1459 [ # # ]: 0 : EscherExAtom aAnimationInfoAtom( rSt, EPP_AnimationInfoAtom, 0, 1 );
1460 : 0 : sal_uInt32 nDimColor = 0x7000000; // color to use for dimming
1461 : 0 : sal_uInt32 nFlags = 0x4400; // set of flags that determine type of build
1462 : 0 : sal_uInt32 nSoundRef = 0; // 0 if storage is from clipboard. Otherwise index(ID) in SoundCollection list.
1463 : 0 : sal_uInt32 nDelayTime = 0; // delay before playing object
1464 : 0 : sal_uInt16 nSlideCount = 1; // number of slides to play object
1465 : 0 : sal_uInt8 nBuildType = 1; // type of build
1466 : 0 : sal_uInt8 nFlyMethod = 0; // animation effect( fly, zoom, appear, etc )
1467 : 0 : sal_uInt8 nFlyDirection = 0; // Animation direction( left, right, up, down, etc )
1468 : 0 : sal_uInt8 nAfterEffect = 0; // what to do after build
1469 : 0 : sal_uInt8 nSubEffect = 0; // build by word or letter
1470 : 0 : sal_uInt8 nOleVerb = 0; // Determines object's class (sound, video, other)
1471 : :
1472 [ # # ]: 0 : if ( eAe == ::com::sun::star::presentation::AnimationEffect_NONE )
1473 : : {
1474 : 0 : nBuildType = 0;
1475 : 0 : eAe = eTe;
1476 : : }
1477 [ # # # # : 0 : switch ( eAe )
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # ]
1478 : : {
1479 : : case ::com::sun::star::presentation::AnimationEffect_NONE :
1480 : 0 : break;
1481 : : case ::com::sun::star::presentation::AnimationEffect_FADE_FROM_LEFT :
1482 : : {
1483 : 0 : nFlyDirection = 2;
1484 : 0 : nFlyMethod = 10;
1485 : : }
1486 : 0 : break;
1487 : : case ::com::sun::star::presentation::AnimationEffect_FADE_FROM_TOP :
1488 : : {
1489 : 0 : nFlyDirection = 3;
1490 : 0 : nFlyMethod = 10;
1491 : : }
1492 : 0 : break;
1493 : : case ::com::sun::star::presentation::AnimationEffect_FADE_FROM_RIGHT :
1494 : : {
1495 : 0 : nFlyDirection = 0;
1496 : 0 : nFlyMethod = 10;
1497 : : }
1498 : 0 : break;
1499 : : case ::com::sun::star::presentation::AnimationEffect_FADE_FROM_BOTTOM :
1500 : : {
1501 : 0 : nFlyDirection = 1;
1502 : 0 : nFlyMethod = 10;
1503 : : }
1504 : 0 : break;
1505 : : case ::com::sun::star::presentation::AnimationEffect_FADE_TO_CENTER :
1506 : : {
1507 : 0 : nFlyDirection = 1;
1508 : 0 : nFlyMethod = 11;
1509 : : }
1510 : 0 : break;
1511 : : case ::com::sun::star::presentation::AnimationEffect_FADE_FROM_CENTER :
1512 : : {
1513 : 0 : nFlyDirection = 0;
1514 : 0 : nFlyMethod = 11;
1515 : : }
1516 : 0 : break;
1517 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_FROM_LEFT :
1518 : : {
1519 : 0 : nFlyDirection = 0;
1520 : 0 : nFlyMethod = 12;
1521 : : }
1522 : 0 : break;
1523 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_FROM_TOP :
1524 : : {
1525 : 0 : nFlyDirection = 1;
1526 : 0 : nFlyMethod = 12;
1527 : : }
1528 : 0 : break;
1529 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_FROM_RIGHT :
1530 : : {
1531 : 0 : nFlyDirection = 2;
1532 : 0 : nFlyMethod = 12;
1533 : : }
1534 : 0 : break;
1535 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_FROM_BOTTOM :
1536 : : {
1537 : 0 : nFlyDirection = 3;
1538 : 0 : nFlyMethod = 12;
1539 : : }
1540 : 0 : break;
1541 : : case ::com::sun::star::presentation::AnimationEffect_VERTICAL_STRIPES :
1542 : : {
1543 : 0 : nFlyDirection = 0;
1544 : 0 : nFlyMethod = 2;
1545 : : }
1546 : 0 : break;
1547 : : case ::com::sun::star::presentation::AnimationEffect_HORIZONTAL_STRIPES :
1548 : : {
1549 : 0 : nFlyDirection = 1;
1550 : 0 : nFlyMethod = 2;
1551 : : }
1552 : 0 : break;
1553 : : case ::com::sun::star::presentation::AnimationEffect_CLOCKWISE :
1554 : : {
1555 : 0 : nFlyDirection = 1;
1556 : 0 : nFlyMethod = 3;
1557 : : }
1558 : 0 : break;
1559 : : case ::com::sun::star::presentation::AnimationEffect_COUNTERCLOCKWISE :
1560 : : {
1561 : 0 : nFlyDirection = 0;
1562 : 0 : nFlyMethod = 3;
1563 : : }
1564 : 0 : break;
1565 : : case ::com::sun::star::presentation::AnimationEffect_FADE_FROM_UPPERLEFT :
1566 : : {
1567 : 0 : nFlyDirection = 7;
1568 : 0 : nFlyMethod = 9;
1569 : : }
1570 : 0 : break;
1571 : : case ::com::sun::star::presentation::AnimationEffect_FADE_FROM_UPPERRIGHT :
1572 : : {
1573 : 0 : nFlyDirection = 6;
1574 : 0 : nFlyMethod = 9;
1575 : : }
1576 : 0 : break;
1577 : : case ::com::sun::star::presentation::AnimationEffect_FADE_FROM_LOWERLEFT :
1578 : : {
1579 : 0 : nFlyDirection = 5;
1580 : 0 : nFlyMethod = 9;
1581 : : }
1582 : 0 : break;
1583 : : case ::com::sun::star::presentation::AnimationEffect_FADE_FROM_LOWERRIGHT :
1584 : : {
1585 : 0 : nFlyDirection = 4;
1586 : 0 : nFlyMethod = 9;
1587 : : }
1588 : 0 : break;
1589 : : case ::com::sun::star::presentation::AnimationEffect_CLOSE_VERTICAL :
1590 : : {
1591 : 0 : nFlyDirection = 1;
1592 : 0 : nFlyMethod = 13;
1593 : : }
1594 : 0 : break;
1595 : : case ::com::sun::star::presentation::AnimationEffect_CLOSE_HORIZONTAL :
1596 : : {
1597 : 0 : nFlyDirection = 3;
1598 : 0 : nFlyMethod = 13;
1599 : : }
1600 : 0 : break;
1601 : : case ::com::sun::star::presentation::AnimationEffect_OPEN_VERTICAL :
1602 : : {
1603 : 0 : nFlyDirection = 0;
1604 : 0 : nFlyMethod = 13;
1605 : : }
1606 : 0 : break;
1607 : : case ::com::sun::star::presentation::AnimationEffect_OPEN_HORIZONTAL :
1608 : : {
1609 : 0 : nFlyDirection = 2;
1610 : 0 : nFlyMethod = 13;
1611 : : }
1612 : 0 : break;
1613 : : case ::com::sun::star::presentation::AnimationEffect_PATH :
1614 : : {
1615 : 0 : nFlyDirection = 28;
1616 : 0 : nFlyMethod = 12;
1617 : : }
1618 : 0 : break;
1619 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_TO_LEFT :
1620 : : {
1621 : 0 : nFlyDirection = 0;
1622 : 0 : nFlyMethod = 1;
1623 : : }
1624 : 0 : break;
1625 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_TO_TOP :
1626 : : {
1627 : 0 : nFlyDirection = 0;
1628 : 0 : nFlyMethod = 1;
1629 : : }
1630 : 0 : break;
1631 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_TO_RIGHT :
1632 : : {
1633 : 0 : nFlyDirection = 0;
1634 : 0 : nFlyMethod = 1;
1635 : : }
1636 : 0 : break;
1637 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_TO_BOTTOM :
1638 : : {
1639 : 0 : nFlyDirection = 0;
1640 : 0 : nFlyMethod = 1;
1641 : : }
1642 : 0 : break;
1643 : : case ::com::sun::star::presentation::AnimationEffect_SPIRALIN_LEFT :
1644 : : case ::com::sun::star::presentation::AnimationEffect_SPIRALIN_RIGHT :
1645 : : case ::com::sun::star::presentation::AnimationEffect_SPIRALOUT_LEFT :
1646 : : case ::com::sun::star::presentation::AnimationEffect_SPIRALOUT_RIGHT :
1647 : : {
1648 : 0 : nFlyDirection = 0x1c;
1649 : 0 : nFlyMethod = 0xc;
1650 : : }
1651 : 0 : break;
1652 : : case ::com::sun::star::presentation::AnimationEffect_DISSOLVE :
1653 : : {
1654 : 0 : nFlyDirection = 0;
1655 : 0 : nFlyMethod = 5;
1656 : : }
1657 : 0 : break;
1658 : : case ::com::sun::star::presentation::AnimationEffect_WAVYLINE_FROM_LEFT :
1659 : : {
1660 : 0 : nFlyDirection = 2;
1661 : 0 : nFlyMethod = 10;
1662 : : }
1663 : 0 : break;
1664 : : case ::com::sun::star::presentation::AnimationEffect_WAVYLINE_FROM_TOP :
1665 : : {
1666 : 0 : nFlyDirection = 3;
1667 : 0 : nFlyMethod = 10;
1668 : : }
1669 : 0 : break;
1670 : : case ::com::sun::star::presentation::AnimationEffect_WAVYLINE_FROM_RIGHT :
1671 : : {
1672 : 0 : nFlyDirection = 0;
1673 : 0 : nFlyMethod = 10;
1674 : : }
1675 : 0 : break;
1676 : : case ::com::sun::star::presentation::AnimationEffect_WAVYLINE_FROM_BOTTOM :
1677 : : {
1678 : 0 : nFlyDirection = 1;
1679 : 0 : nFlyMethod = 10;
1680 : : }
1681 : 0 : break;
1682 : : case ::com::sun::star::presentation::AnimationEffect_RANDOM :
1683 : : {
1684 : 0 : nFlyDirection = 0;
1685 : 0 : nFlyMethod = 1;
1686 : : }
1687 : 0 : break;
1688 : : case ::com::sun::star::presentation::AnimationEffect_VERTICAL_LINES :
1689 : : {
1690 : 0 : nFlyDirection = 1;
1691 : 0 : nFlyMethod = 8;
1692 : : }
1693 : 0 : break;
1694 : : case ::com::sun::star::presentation::AnimationEffect_HORIZONTAL_LINES :
1695 : : {
1696 : 0 : nFlyDirection = 0;
1697 : 0 : nFlyMethod = 8;
1698 : : }
1699 : 0 : break;
1700 : : case ::com::sun::star::presentation::AnimationEffect_LASER_FROM_LEFT :
1701 : : {
1702 : 0 : nFlyDirection = 2;
1703 : 0 : nFlyMethod = 10;
1704 : : }
1705 : 0 : break;
1706 : : case ::com::sun::star::presentation::AnimationEffect_LASER_FROM_TOP :
1707 : : {
1708 : 0 : nFlyDirection = 3;
1709 : 0 : nFlyMethod = 10;
1710 : : }
1711 : 0 : break;
1712 : : case ::com::sun::star::presentation::AnimationEffect_LASER_FROM_RIGHT :
1713 : : {
1714 : 0 : nFlyDirection = 0;
1715 : 0 : nFlyMethod = 10;
1716 : : }
1717 : 0 : break;
1718 : : case ::com::sun::star::presentation::AnimationEffect_LASER_FROM_BOTTOM :
1719 : : {
1720 : 0 : nFlyDirection = 1;
1721 : 0 : nFlyMethod = 10;
1722 : : }
1723 : 0 : break;
1724 : : case ::com::sun::star::presentation::AnimationEffect_LASER_FROM_UPPERLEFT :
1725 : : {
1726 : 0 : nFlyDirection = 7;
1727 : 0 : nFlyMethod = 9;
1728 : : }
1729 : 0 : break;
1730 : : case ::com::sun::star::presentation::AnimationEffect_LASER_FROM_UPPERRIGHT :
1731 : : {
1732 : 0 : nFlyDirection = 6;
1733 : 0 : nFlyMethod = 9;
1734 : : }
1735 : 0 : break;
1736 : : case ::com::sun::star::presentation::AnimationEffect_LASER_FROM_LOWERLEFT :
1737 : : {
1738 : 0 : nFlyDirection = 5;
1739 : 0 : nFlyMethod = 9;
1740 : : }
1741 : 0 : break;
1742 : : case ::com::sun::star::presentation::AnimationEffect_LASER_FROM_LOWERRIGHT :
1743 : : {
1744 : 0 : nFlyDirection = 4;
1745 : 0 : nFlyMethod = 9;
1746 : : }
1747 : 0 : break;
1748 : : case ::com::sun::star::presentation::AnimationEffect_APPEAR :
1749 : 0 : break;
1750 : : case ::com::sun::star::presentation::AnimationEffect_HIDE :
1751 : : {
1752 : 0 : nFlyDirection = 0;
1753 : 0 : nFlyMethod = 1;
1754 : : }
1755 : 0 : break;
1756 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_FROM_UPPERLEFT :
1757 : : {
1758 : 0 : nFlyDirection = 4;
1759 : 0 : nFlyMethod = 12;
1760 : : }
1761 : 0 : break;
1762 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_FROM_UPPERRIGHT :
1763 : : {
1764 : 0 : nFlyDirection = 5;
1765 : 0 : nFlyMethod = 12;
1766 : : }
1767 : 0 : break;
1768 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_FROM_LOWERRIGHT :
1769 : : {
1770 : 0 : nFlyDirection = 7;
1771 : 0 : nFlyMethod = 12;
1772 : : }
1773 : 0 : break;
1774 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_FROM_LOWERLEFT :
1775 : : {
1776 : 0 : nFlyDirection = 6;
1777 : 0 : nFlyMethod = 12;
1778 : : }
1779 : 0 : break;
1780 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_TO_UPPERLEFT :
1781 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_TO_UPPERRIGHT :
1782 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_TO_LOWERRIGHT :
1783 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_TO_LOWERLEFT :
1784 : 0 : nAfterEffect |= 2;
1785 : 0 : break;
1786 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_SHORT_FROM_LEFT :
1787 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_SHORT_FROM_UPPERLEFT :
1788 : : {
1789 : 0 : nFlyDirection = 8;
1790 : 0 : nFlyMethod = 12;
1791 : : }
1792 : 0 : break;
1793 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_SHORT_FROM_TOP :
1794 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_SHORT_FROM_UPPERRIGHT :
1795 : : {
1796 : 0 : nFlyDirection = 11;
1797 : 0 : nFlyMethod = 12;
1798 : : }
1799 : 0 : break;
1800 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_SHORT_FROM_RIGHT :
1801 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_SHORT_FROM_LOWERRIGHT :
1802 : : {
1803 : 0 : nFlyDirection = 10;
1804 : 0 : nFlyMethod = 12;
1805 : : }
1806 : 0 : break;
1807 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_SHORT_FROM_BOTTOM :
1808 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_SHORT_FROM_LOWERLEFT :
1809 : : {
1810 : 0 : nFlyDirection = 9;
1811 : 0 : nFlyMethod = 12;
1812 : : }
1813 : 0 : break;
1814 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_SHORT_TO_LEFT :
1815 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_SHORT_TO_UPPERLEFT :
1816 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_SHORT_TO_TOP :
1817 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_SHORT_TO_UPPERRIGHT :
1818 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_SHORT_TO_RIGHT :
1819 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_SHORT_TO_LOWERRIGHT :
1820 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_SHORT_TO_BOTTOM :
1821 : : case ::com::sun::star::presentation::AnimationEffect_MOVE_SHORT_TO_LOWERLEFT :
1822 : 0 : nAfterEffect |= 2;
1823 : 0 : break;
1824 : : case ::com::sun::star::presentation::AnimationEffect_VERTICAL_CHECKERBOARD :
1825 : : {
1826 : 0 : nFlyDirection = 1;
1827 : 0 : nFlyMethod = 3;
1828 : : }
1829 : 0 : break;
1830 : : case ::com::sun::star::presentation::AnimationEffect_HORIZONTAL_CHECKERBOARD :
1831 : : {
1832 : 0 : nFlyDirection = 0;
1833 : 0 : nFlyMethod = 3;
1834 : : }
1835 : 0 : break;
1836 : : case ::com::sun::star::presentation::AnimationEffect_HORIZONTAL_ROTATE :
1837 : : case ::com::sun::star::presentation::AnimationEffect_VERTICAL_ROTATE :
1838 : : {
1839 : 0 : nFlyDirection = 27;
1840 : 0 : nFlyMethod = 12;
1841 : : }
1842 : 0 : break;
1843 : : case ::com::sun::star::presentation::AnimationEffect_HORIZONTAL_STRETCH :
1844 : : case ::com::sun::star::presentation::AnimationEffect_VERTICAL_STRETCH :
1845 : : {
1846 : 0 : nFlyDirection = 22;
1847 : 0 : nFlyMethod = 12;
1848 : : }
1849 : 0 : break;
1850 : : case ::com::sun::star::presentation::AnimationEffect_STRETCH_FROM_LEFT :
1851 : : case ::com::sun::star::presentation::AnimationEffect_STRETCH_FROM_UPPERLEFT :
1852 : : {
1853 : 0 : nFlyDirection = 23;
1854 : 0 : nFlyMethod = 12;
1855 : : }
1856 : 0 : break;
1857 : : case ::com::sun::star::presentation::AnimationEffect_STRETCH_FROM_TOP :
1858 : : case ::com::sun::star::presentation::AnimationEffect_STRETCH_FROM_UPPERRIGHT :
1859 : : {
1860 : 0 : nFlyDirection = 24;
1861 : 0 : nFlyMethod = 12;
1862 : : }
1863 : 0 : break;
1864 : : case ::com::sun::star::presentation::AnimationEffect_STRETCH_FROM_RIGHT :
1865 : : case ::com::sun::star::presentation::AnimationEffect_STRETCH_FROM_LOWERRIGHT :
1866 : : {
1867 : 0 : nFlyDirection = 25;
1868 : 0 : nFlyMethod = 12;
1869 : : }
1870 : 0 : break;
1871 : : case ::com::sun::star::presentation::AnimationEffect_STRETCH_FROM_BOTTOM :
1872 : : case ::com::sun::star::presentation::AnimationEffect_STRETCH_FROM_LOWERLEFT :
1873 : : {
1874 : 0 : nFlyDirection = 26;
1875 : 0 : nFlyMethod = 12;
1876 : : }
1877 : 0 : break;
1878 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_IN :
1879 : : {
1880 : 0 : nFlyDirection = 16;
1881 : 0 : nFlyMethod = 12;
1882 : : }
1883 : 0 : break;
1884 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_IN_SMALL :
1885 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_IN_SPIRAL :
1886 : : {
1887 : 0 : nFlyDirection = 17;
1888 : 0 : nFlyMethod = 12;
1889 : : }
1890 : 0 : break;
1891 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_OUT :
1892 : : {
1893 : 0 : nFlyDirection = 18;
1894 : 0 : nFlyMethod = 12;
1895 : : }
1896 : 0 : break;
1897 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_OUT_SMALL :
1898 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_OUT_SPIRAL :
1899 : : {
1900 : 0 : nFlyDirection = 19;
1901 : 0 : nFlyMethod = 12;
1902 : : }
1903 : 0 : break;
1904 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_IN_FROM_LEFT :
1905 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_IN_FROM_UPPERLEFT :
1906 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_IN_FROM_TOP :
1907 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_IN_FROM_UPPERRIGHT :
1908 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_IN_FROM_RIGHT :
1909 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_IN_FROM_LOWERRIGHT :
1910 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_IN_FROM_BOTTOM :
1911 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_IN_FROM_LOWERLEFT :
1912 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_IN_FROM_CENTER :
1913 : : {
1914 : 0 : nFlyDirection = 16;
1915 : 0 : nFlyMethod = 12;
1916 : : }
1917 : 0 : break;
1918 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_OUT_FROM_LEFT :
1919 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_OUT_FROM_UPPERLEFT :
1920 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_OUT_FROM_TOP :
1921 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_OUT_FROM_UPPERRIGHT :
1922 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_OUT_FROM_RIGHT :
1923 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_OUT_FROM_LOWERRIGHT :
1924 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_OUT_FROM_BOTTOM :
1925 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_OUT_FROM_LOWERLEFT :
1926 : : case ::com::sun::star::presentation::AnimationEffect_ZOOM_OUT_FROM_CENTER :
1927 : 0 : nAfterEffect |= 2;
1928 : 0 : break;
1929 : : default:
1930 : 0 : break;
1931 : : }
1932 [ # # ]: 0 : if ( mnDiaMode >= 1 )
1933 : 0 : nFlags |= 4;
1934 [ # # ]: 0 : if ( eTe != ::com::sun::star::presentation::AnimationEffect_NONE )
1935 : 0 : nBuildType = 2;
1936 [ # # ][ # # ]: 0 : if ( ImplGetPropertyValue( rtl::OUString( "SoundOn" ) ) )
[ # # ][ # # ]
1937 : : {
1938 : 0 : sal_Bool bBool(sal_False);
1939 : 0 : mAny >>= bBool;
1940 [ # # ]: 0 : if ( bBool )
1941 : : {
1942 [ # # ][ # # ]: 0 : if ( ImplGetPropertyValue( rtl::OUString( "Sound" ) ) )
[ # # ][ # # ]
1943 : : {
1944 [ # # ]: 0 : nSoundRef = maSoundCollection.GetId( *(::rtl::OUString*)mAny.getValue() );
1945 [ # # ]: 0 : if ( nSoundRef )
1946 : 0 : nFlags |= 0x10;
1947 : : }
1948 : : }
1949 : : }
1950 : 0 : sal_Bool bDimHide = sal_False;
1951 : 0 : sal_Bool bDimPrevious = sal_False;
1952 [ # # ][ # # ]: 0 : if ( ImplGetPropertyValue( rtl::OUString( "DimHide" ) ) )
[ # # ][ # # ]
1953 : 0 : mAny >>= bDimHide;
1954 [ # # ][ # # ]: 0 : if ( ImplGetPropertyValue( rtl::OUString( "DimPrevious" ) ) )
[ # # ][ # # ]
1955 : 0 : mAny >>= bDimPrevious;
1956 [ # # ]: 0 : if ( bDimPrevious )
1957 : 0 : nAfterEffect |= 1;
1958 [ # # ]: 0 : if ( bDimHide )
1959 : 0 : nAfterEffect |= 2;
1960 [ # # ][ # # ]: 0 : if ( ImplGetPropertyValue( rtl::OUString( "DimColor" ) ) )
[ # # ][ # # ]
1961 [ # # ]: 0 : nDimColor = mpPptEscherEx->GetColor( *((sal_uInt32*)mAny.getValue()) ) | 0xfe000000;
1962 : :
1963 [ # # ][ # # ]: 0 : rSt << nDimColor << nFlags << nSoundRef << nDelayTime
[ # # ][ # # ]
1964 [ # # ]: 0 : << nOrder // order of build ( 1.. )
1965 [ # # ][ # # ]: 0 : << nSlideCount << nBuildType << nFlyMethod << nFlyDirection
[ # # ][ # # ]
1966 [ # # ][ # # ]: 0 : << nAfterEffect << nSubEffect << nOleVerb
[ # # ]
1967 [ # # ][ # # ]: 0 : << (sal_uInt16)0; // PadWord
[ # # ]
1968 : 0 : }
1969 : :
1970 : : // -----------------------------------------------------------------------
1971 : :
1972 : 0 : void PPTWriter::ImplWriteClickAction( SvStream& rSt, ::com::sun::star::presentation::ClickAction eCa, sal_Bool bMediaClickAction )
1973 : : {
1974 : 0 : sal_uInt32 nSoundRef = 0; // a reference to a sound in the sound collection, or NULL.
1975 : 0 : sal_uInt32 nHyperLinkID = 0;// a persistent unique identifier to an external hyperlink object (only valid when action == HyperlinkAction).
1976 : 0 : sal_uInt8 nAction = 0; // Action See Action Table
1977 : 0 : sal_uInt8 nOleVerb = 0; // OleVerb Only valid when action == OLEAction. OLE verb to use, 0 = first verb, 1 = second verb, etc.
1978 : 0 : sal_uInt8 nJump = 0; // Jump See Jump Table
1979 : 0 : sal_uInt8 nFlags = 0; // Bit 1: Animated. If 1, then button is animated
1980 : : // Bit 2: Stop sound. If 1, then stop current sound when button is pressed.
1981 : : // Bit 3: CustomShowReturn. If 1, and this is a jump to custom show, then return to this slide after custom show.
1982 : 0 : sal_uInt8 nHyperLinkType = 0;// HyperlinkType a value from the LinkTo enum, such as LT_URL (only valid when action == HyperlinkAction).
1983 : :
1984 [ # # ]: 0 : String aFile;
1985 : :
1986 : : /*
1987 : : Action Table: Action Value
1988 : : NoAction 0
1989 : : MacroAction 1
1990 : : RunProgramAction 2
1991 : : JumpAction 3
1992 : : HyperlinkAction 4
1993 : : OLEAction 5
1994 : : MediaAction 6
1995 : : CustomShowAction 7
1996 : :
1997 : : Jump Table: Jump Value
1998 : : NoJump 0
1999 : : NextSlide, 1
2000 : : PreviousSlide, 2
2001 : : FirstSlide, 3
2002 : : LastSlide, 4
2003 : : LastSlideViewed 5
2004 : : EndShow 6
2005 : : */
2006 : :
2007 [ # # ]: 0 : if ( bMediaClickAction )
2008 : 0 : nAction = 6;
2009 [ # # # # : 0 : else switch( eCa )
# # # # #
# ]
2010 : : {
2011 : : case ::com::sun::star::presentation::ClickAction_STOPPRESENTATION :
2012 : 0 : nJump += 2;
2013 : : case ::com::sun::star::presentation::ClickAction_LASTPAGE :
2014 : 0 : nJump++;
2015 : : case ::com::sun::star::presentation::ClickAction_FIRSTPAGE :
2016 : 0 : nJump++;
2017 : : case ::com::sun::star::presentation::ClickAction_PREVPAGE :
2018 : 0 : nJump++;
2019 : : case ::com::sun::star::presentation::ClickAction_NEXTPAGE :
2020 : : {
2021 : 0 : nJump++;
2022 : 0 : nAction = 3;
2023 : : }
2024 : 0 : break;
2025 : : case ::com::sun::star::presentation::ClickAction_SOUND :
2026 : : {
2027 [ # # ][ # # ]: 0 : if ( ImplGetPropertyValue( rtl::OUString( "Bookmark" ) ) )
[ # # ][ # # ]
2028 [ # # ]: 0 : nSoundRef = maSoundCollection.GetId( *(::rtl::OUString*)mAny.getValue() );
2029 : : }
2030 : 0 : break;
2031 : : case ::com::sun::star::presentation::ClickAction_PROGRAM :
2032 : : {
2033 [ # # ][ # # ]: 0 : if ( ImplGetPropertyValue( rtl::OUString( "Bookmark" ) ) )
[ # # ][ # # ]
2034 : : {
2035 [ # # ]: 0 : INetURLObject aUrl( *(::rtl::OUString*)mAny.getValue() );
2036 [ # # ]: 0 : if ( INET_PROT_FILE == aUrl.GetProtocol() )
2037 : : {
2038 [ # # ][ # # ]: 0 : aFile = aUrl.PathToFileName();
2039 : 0 : nAction = 2;
2040 [ # # ]: 0 : }
2041 : : }
2042 : : }
2043 : 0 : break;
2044 : :
2045 : : case ::com::sun::star::presentation::ClickAction_BOOKMARK :
2046 : : {
2047 [ # # ][ # # ]: 0 : if ( ImplGetPropertyValue( rtl::OUString( "Bookmark" ) ) )
[ # # ][ # # ]
2048 : : {
2049 : 0 : rtl::OUString aBookmark( *(::rtl::OUString*)mAny.getValue() );
2050 : 0 : sal_uInt32 nIndex = 0;
2051 : 0 : std::vector<rtl::OUString>::const_iterator pIter;
2052 [ # # ][ # # ]: 0 : for ( pIter = maSlideNameList.begin(); pIter != maSlideNameList.end(); ++pIter, nIndex++ )
[ # # ]
2053 : : {
2054 [ # # ]: 0 : if ( *pIter == aBookmark )
2055 : : {
2056 : : // Bookmark ist ein link zu einer Dokumentseite
2057 : 0 : nAction = 4;
2058 : 0 : nHyperLinkType = 7;
2059 : :
2060 [ # # ]: 0 : String aEmpty;
2061 [ # # ]: 0 : String aHyperString = rtl::OUString::valueOf(static_cast<sal_Int32>(256 + nIndex));
2062 [ # # ][ # # ]: 0 : aHyperString.Append( rtl::OUString( "," ) );
[ # # ]
2063 [ # # ][ # # ]: 0 : aHyperString.Append( String::CreateFromInt32( nIndex + 1 ) );
[ # # ]
2064 [ # # ][ # # ]: 0 : aHyperString.Append( rtl::OUString( ",Slide " ) );
[ # # ]
2065 [ # # ][ # # ]: 0 : aHyperString.Append( String::CreateFromInt32( nIndex + 1 ) );
[ # # ]
2066 [ # # ][ # # ]: 0 : nHyperLinkID = ImplInsertBookmarkURL( aHyperString, 1 | ( nIndex << 8 ) | ( 1 << 31 ), aBookmark, aEmpty, aEmpty, aHyperString );
[ # # ][ # # ]
[ # # ]
2067 : : }
2068 : 0 : }
2069 : : }
2070 : : }
2071 : 0 : break;
2072 : :
2073 : : case ::com::sun::star::presentation::ClickAction_DOCUMENT :
2074 : : {
2075 [ # # ][ # # ]: 0 : if ( ImplGetPropertyValue( rtl::OUString( "Bookmark" ) ) )
[ # # ][ # # ]
2076 : : {
2077 [ # # ]: 0 : String aBookmark( *(::rtl::OUString*)mAny.getValue() );
2078 [ # # ]: 0 : if ( aBookmark.Len() )
2079 : : {
2080 : 0 : nAction = 4;
2081 : 0 : nHyperLinkType = 8;
2082 : :
2083 [ # # ]: 0 : String aEmpty;
2084 [ # # ]: 0 : String aBookmarkFile( aBookmark );
2085 [ # # ][ # # ]: 0 : INetURLObject aUrl( aBookmark );
2086 [ # # ]: 0 : if ( INET_PROT_FILE == aUrl.GetProtocol() )
2087 [ # # ][ # # ]: 0 : aBookmarkFile = aUrl.PathToFileName();
2088 [ # # ][ # # ]: 0 : nHyperLinkID = ImplInsertBookmarkURL( aBookmark, (sal_uInt32)(2 | ( 1 << 31 )), aBookmarkFile, aBookmark, aEmpty, aEmpty );
[ # # ][ # # ]
2089 [ # # ]: 0 : }
2090 : : }
2091 : : }
2092 : 0 : break;
2093 : :
2094 : : case ::com::sun::star::presentation::ClickAction_INVISIBLE :
2095 : : case ::com::sun::star::presentation::ClickAction_VERB :
2096 : : case ::com::sun::star::presentation::ClickAction_VANISH :
2097 : : case ::com::sun::star::presentation::ClickAction_MACRO :
2098 : : default :
2099 : 0 : break;
2100 : : }
2101 : :
2102 : 0 : sal_uInt32 nContainerSize = 24;
2103 [ # # ]: 0 : if ( nAction == 2 )
2104 : 0 : nContainerSize += ( aFile.Len() * 2 ) + 8;
2105 [ # # ][ # # ]: 0 : rSt << (sal_uInt32)( ( EPP_InteractiveInfo << 16 ) | 0xf ) << (sal_uInt32)nContainerSize
2106 [ # # ][ # # ]: 0 : << (sal_uInt32)( EPP_InteractiveInfoAtom << 16 ) << (sal_uInt32)16
2107 [ # # ]: 0 : << nSoundRef
2108 [ # # ]: 0 : << nHyperLinkID
2109 [ # # ]: 0 : << nAction
2110 [ # # ]: 0 : << nOleVerb
2111 [ # # ]: 0 : << nJump
2112 [ # # ]: 0 : << nFlags
2113 [ # # ]: 0 : << (sal_uInt32)nHyperLinkType;
2114 : :
2115 [ # # ]: 0 : if ( nAction == 2 ) // run program Action
2116 : : {
2117 : 0 : sal_uInt16 i, nLen = aFile.Len();
2118 [ # # ][ # # ]: 0 : rSt << (sal_uInt32)( ( EPP_CString << 16 ) | 0x20 ) << (sal_uInt32)( nLen * 2 );
2119 [ # # ]: 0 : for ( i = 0; i < nLen; i++ )
2120 [ # # ]: 0 : rSt << aFile.GetChar( i );
2121 : : }
2122 : :
2123 [ # # ][ # # ]: 0 : rSt << (sal_uInt32)( ( EPP_InteractiveInfo << 16 ) | 0x1f ) << (sal_uInt32)24 // Mouse Over Action
2124 [ # # ][ # # ]: 0 : << (sal_uInt32)( EPP_InteractiveInfo << 16 ) << (sal_uInt32)16;
2125 [ # # ][ # # ]: 0 : for ( int i = 0; i < 4; i++, rSt << (sal_uInt32)0 ) ;
[ # # ]
2126 : 0 : }
2127 : :
2128 : : // -----------------------------------------------------------------------
2129 : :
2130 : 0 : sal_Bool PPTWriter::ImplGetEffect( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPropSet,
2131 : : ::com::sun::star::presentation::AnimationEffect& eEffect,
2132 : : ::com::sun::star::presentation::AnimationEffect& eTextEffect,
2133 : : sal_Bool& bIsSound )
2134 : : {
2135 : 0 : ::com::sun::star::uno::Any aAny;
2136 [ # # ][ # # ]: 0 : if ( GetPropertyValue( aAny, rPropSet, rtl::OUString( "Effect" ) ) )
[ # # ][ # # ]
2137 [ # # ]: 0 : aAny >>= eEffect;
2138 : : else
2139 : 0 : eEffect = ::com::sun::star::presentation::AnimationEffect_NONE;
2140 : :
2141 [ # # ][ # # ]: 0 : if ( GetPropertyValue( aAny, rPropSet, rtl::OUString( "TextEffect" ) ) )
[ # # ][ # # ]
2142 [ # # ]: 0 : aAny >>= eTextEffect;
2143 : : else
2144 : 0 : eTextEffect = ::com::sun::star::presentation::AnimationEffect_NONE;
2145 [ # # ][ # # ]: 0 : if ( GetPropertyValue( aAny, rPropSet, rtl::OUString( "SoundOn" ) ) )
[ # # ][ # # ]
2146 : 0 : aAny >>= bIsSound;
2147 : : else
2148 : 0 : bIsSound = sal_False;
2149 : :
2150 : : sal_Bool bHasEffect = ( ( eEffect != ::com::sun::star::presentation::AnimationEffect_NONE )
2151 : : || ( eTextEffect != ::com::sun::star::presentation::AnimationEffect_NONE )
2152 [ # # ][ # # ]: 0 : || bIsSound );
[ # # ]
2153 : 0 : return bHasEffect;
2154 : : };
2155 : :
2156 : : // -----------------------------------------------------------------------
2157 : :
2158 : 0 : sal_Bool PPTWriter::ImplCreatePresentationPlaceholder( const sal_Bool bMasterPage, const PageType /* ePageType */,
2159 : : const sal_uInt32 nStyleInstance, const sal_uInt8 nPlaceHolderId )
2160 : : {
2161 : 0 : sal_Bool bRet = ImplGetText();
2162 [ # # ][ # # ]: 0 : if ( bRet && bMasterPage )
2163 : : {
2164 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
2165 [ # # ]: 0 : sal_uInt32 nPresShapeID = mpPptEscherEx->GenerateShapeId();
2166 [ # # ]: 0 : mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xa00, nPresShapeID );// Flags: HaveAnchor | HasSpt
2167 [ # # ]: 0 : EscherPropertyContainer aPropOpt;
2168 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x50001 );
2169 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_lTxid, mnTxId += 0x60 );
2170 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_AnchorText, ESCHER_AnchorMiddle );
2171 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x110001 );
2172 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_lineColor, 0x8000001 );
2173 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_shadowColor, 0x8000002 );
2174 [ # # ]: 0 : aPropOpt.CreateFillProperties( mXPropSet, sal_True );
2175 : 0 : sal_uInt32 nLineFlags = 0x90001;
2176 [ # # ][ # # ]: 0 : if ( aPropOpt.GetOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags ) )
2177 : 0 : nLineFlags |= 0x10001; // draw dashed line if no line
2178 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags );
2179 : :
2180 [ # # ]: 0 : SvMemoryStream aExtBu( 0x200, 0x200 );
2181 [ # # ]: 0 : SvMemoryStream aClientTextBox( 0x200, 0x200 );
2182 [ # # ]: 0 : ImplWriteTextStyleAtom( aClientTextBox, nStyleInstance, 0, NULL, aExtBu, &aPropOpt );
2183 : :
2184 [ # # ]: 0 : aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
2185 [ # # ]: 0 : aPropOpt.CreateShapeProperties( mXShape );
2186 [ # # ]: 0 : aPropOpt.Commit( *mpStrm );
2187 [ # # ]: 0 : mpPptEscherEx->AddAtom( 8, ESCHER_ClientAnchor );
2188 [ # # ][ # # ]: 0 : *mpStrm << (sal_Int16)maRect.Top() << (sal_Int16)maRect.Left() << (sal_Int16)maRect.Right() << (sal_Int16)maRect.Bottom(); // oben, links, rechts, unten ????
[ # # ][ # # ]
2189 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_ClientData );
2190 [ # # ]: 0 : mpPptEscherEx->AddAtom( 8, EPP_OEPlaceholderAtom );
2191 [ # # ]: 0 : *mpStrm << (sal_uInt32)0 // PlacementID
2192 [ # # ]: 0 : << (sal_uInt8)nPlaceHolderId // PlaceHolderID
2193 [ # # ]: 0 : << (sal_uInt8)0 // Size of PlaceHolder ( 0 = FULL, 1 = HALF, 2 = QUARTER )
2194 [ # # ]: 0 : << (sal_uInt16)0; // padword
2195 [ # # ]: 0 : mpPptEscherEx->CloseContainer(); // ESCHER_ClientData
2196 : :
2197 [ # # ]: 0 : if ( aClientTextBox.Tell() )
2198 : : {
2199 [ # # ]: 0 : *mpStrm << (sal_uInt32)( ( ESCHER_ClientTextbox << 16 ) | 0xf )
2200 [ # # ]: 0 : << (sal_uInt32)aClientTextBox.Tell();
2201 : :
2202 [ # # ][ # # ]: 0 : mpStrm->Write( aClientTextBox.GetData(), aClientTextBox.Tell() );
2203 : : }
2204 [ # # ][ # # ]: 0 : mpPptEscherEx->CloseContainer(); // ESCHER_SpContainer
[ # # ][ # # ]
2205 : : }
2206 : : else
2207 : 0 : bRet = sal_False;
2208 : 0 : return bRet;
2209 : : }
2210 : :
2211 : : // -----------------------------------------------------------------------
2212 : :
2213 : 0 : void PPTWriter::ImplCreateShape( sal_uInt32 nType, sal_uInt32 nFlags, EscherSolverContainer& rSolver )
2214 : : {
2215 : 0 : sal_uInt32 nId = mpPptEscherEx->GenerateShapeId();
2216 : 0 : mpPptEscherEx->AddShape( nType, nFlags, nId );
2217 : 0 : rSolver.AddShape( mXShape, nId );
2218 : 0 : }
2219 : :
2220 : 0 : void PPTWriter::ImplCreateTextShape( EscherPropertyContainer& rPropOpt, EscherSolverContainer& rSolver, sal_Bool bFill )
2221 : : {
2222 : 0 : mnTextStyle = EPP_TEXTSTYLE_TEXT;
2223 : 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
2224 : 0 : ImplCreateShape( ESCHER_ShpInst_TextBox, 0xa00, rSolver );
2225 [ # # ]: 0 : if ( bFill )
2226 : 0 : rPropOpt.CreateFillProperties( mXPropSet, sal_True );
2227 [ # # ]: 0 : if ( ImplGetText() )
2228 : 0 : rPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
2229 : 0 : }
2230 : :
2231 : 0 : void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& aSolverContainer, PageType ePageType, sal_Bool bMasterPage, int nPageNumber )
2232 : : {
2233 : 0 : sal_uInt32 nInstance, nGroups, nShapes, nShapeCount, nPer, nLastPer, nIndices, nGroupLevel = 0, nOlePictureId;
2234 : : sal_uInt16 nEffectCount;
2235 : 0 : ::com::sun::star::awt::Point aTextRefPoint;
2236 : :
2237 [ # # ][ # # ]: 0 : ResetGroupTable( nShapes = mXShapes->getCount() );
[ # # ]
2238 : :
2239 : 0 : nIndices = nInstance = nLastPer = nShapeCount = nEffectCount = 0;
2240 : :
2241 : 0 : sal_Bool bIsTitlePossible = sal_True; // bei mehr als einem title geht powerpoint in die knie
2242 : :
2243 : 0 : sal_uInt32 nOutlinerCount = 0; // die gliederungsobjekte muessen dem layout entsprechen,
2244 : 0 : sal_uInt32 nPrevTextStyle = 0; // es darf nicht mehr als zwei geben
2245 : :
2246 : 0 : nOlePictureId = 0;
2247 : :
2248 : 0 : sal_Bool bAdditionalText = sal_False;
2249 : :
2250 : 0 : sal_Bool bSecOutl = sal_False;
2251 : 0 : sal_uInt32 nPObjects = 0;
2252 : :
2253 : 0 : SvMemoryStream* pClientTextBox = NULL;
2254 : 0 : SvMemoryStream* pClientData = NULL;
2255 : :
2256 [ # # ][ # # ]: 0 : while( GetNextGroupEntry() )
2257 : : {
2258 : 0 : nShapeCount++;
2259 : :
2260 : 0 : nPer = ( 5 * nShapeCount ) / nShapes;
2261 [ # # ]: 0 : if ( nPer != nLastPer )
2262 : : {
2263 : 0 : nLastPer = nPer;
2264 : 0 : sal_uInt32 nValue = mnPagesWritten * 5 + nPer;
2265 [ # # ]: 0 : if ( nValue > mnStatMaxValue )
2266 : 0 : nValue = mnStatMaxValue;
2267 [ # # ][ # # ]: 0 : if ( mbStatusIndicator && ( nValue > mnLatestStatValue ) )
2268 : : {
2269 [ # # ][ # # ]: 0 : mXStatusIndicator->setValue( nValue );
2270 : 0 : mnLatestStatValue = nValue;
2271 : : }
2272 : : }
2273 [ # # ]: 0 : nGroups = GetGroupsClosed();
2274 [ # # ][ # # ]: 0 : for ( sal_uInt32 i = 0; i < nGroups; i++, mpPptEscherEx->LeaveGroup() ) ;
2275 : :
2276 [ # # ][ # # ]: 0 : if ( GetShapeByIndex( GetCurrentGroupIndex(), sal_True ) )
2277 : : {
2278 : : sal_Bool bIsSound;
2279 : 0 : sal_Bool bMediaClickAction = sal_False;
2280 : : ::com::sun::star::presentation::AnimationEffect eAe;
2281 : : ::com::sun::star::presentation::AnimationEffect eTe;
2282 : :
2283 [ # # ][ # # ]: 0 : if ( ImplGetPropertyValue( rtl::OUString( "PresentationOrder" ) ) )
[ # # ][ # # ]
2284 : 0 : nEffectCount = *(sal_uInt16*)mAny.getValue();
2285 : :
2286 [ # # ]: 0 : sal_Bool bEffect = ImplGetEffect( mXPropSet, eAe, eTe, bIsSound );
2287 : 0 : ::com::sun::star::presentation::ClickAction eCa = ::com::sun::star::presentation::ClickAction_NONE;
2288 [ # # ][ # # ]: 0 : if ( ImplGetPropertyValue( rtl::OUString( "OnClick" ) ) )
[ # # ][ # # ]
2289 [ # # ]: 0 : mAny >>= eCa;
2290 : :
2291 : 0 : sal_Bool bGroup = mType == "drawing.Group";
2292 : 0 : sal_Bool bOpenBezier = mType == "drawing.OpenBezier";
2293 : 0 : sal_Bool bClosedBezier = mType == "drawing.ClosedBezier";
2294 : 0 : sal_Bool bPolyPolygon = mType == "drawing.PolyPolygon";
2295 : 0 : sal_Bool bPolyLine = mType == "drawing.PolyLine";
2296 : :
2297 [ # # ]: 0 : Rectangle aPolyBoundRect;
2298 : :
2299 [ # # ][ # # ]: 0 : const ::com::sun::star::awt::Size aSize100thmm( mXShape->getSize() );
2300 [ # # ][ # # ]: 0 : const ::com::sun::star::awt::Point aPoint100thmm( mXShape->getPosition() );
2301 [ # # ]: 0 : Rectangle aRect100thmm( Point( aPoint100thmm.X, aPoint100thmm.Y ), Size( aSize100thmm.Width, aSize100thmm.Height ) );
2302 [ # # ][ # # ]: 0 : EscherPropertyContainer aPropOpt( mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aRect100thmm );
2303 : :
2304 [ # # ]: 0 : if ( bGroup )
2305 : : {
2306 : 0 : SvMemoryStream* pTmp = NULL;
2307 : : ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >
2308 [ # # ]: 0 : aXIndexAccess( mXShape, ::com::sun::star::uno::UNO_QUERY );
2309 [ # # ][ # # ]: 0 : if ( EnterGroup( aXIndexAccess ) )
2310 : : {
2311 [ # # ][ # # ]: 0 : if ( bEffect && !mbUseNewAnimations )
2312 : : {
2313 [ # # ][ # # ]: 0 : pTmp = new SvMemoryStream( 0x200, 0x200 );
2314 [ # # ]: 0 : ImplWriteObjectEffect( *pTmp, eAe, eTe, ++nEffectCount );
2315 : : }
2316 [ # # ]: 0 : if ( eCa != ::com::sun::star::presentation::ClickAction_NONE )
2317 : : {
2318 [ # # ]: 0 : if ( !pTmp )
2319 [ # # ][ # # ]: 0 : pTmp = new SvMemoryStream( 0x200, 0x200 );
2320 [ # # ]: 0 : ImplWriteClickAction( *pTmp, eCa, bMediaClickAction );
2321 : : }
2322 [ # # ]: 0 : sal_uInt32 nShapeId = mpPptEscherEx->EnterGroup( &maRect, pTmp );
2323 [ # # ]: 0 : aSolverContainer.AddShape( mXShape, nShapeId );
2324 [ # # ][ # # ]: 0 : delete pTmp;
2325 : 0 : }
2326 : : }
2327 : : else
2328 : : {
2329 : 0 : sal_Bool bIsFontwork = sal_False;
2330 : 0 : sal_Bool bIsHatching = sal_False;
2331 : 0 : ::com::sun::star::uno::Any aAny;
2332 : : ::com::sun::star::drawing::FillStyle eFS;
2333 [ # # ][ # # ]: 0 : if ( GetPropertyValue( aAny, mXPropSet, rtl::OUString( "IsFontwork" ), sal_True ) )
[ # # ][ # # ]
2334 : 0 : aAny >>= bIsFontwork;
2335 [ # # ][ # # ]: 0 : if ( GetPropertyValue( aAny, mXPropSet, rtl::OUString( "FillStyle" ), sal_True ) )
[ # # ][ # # ]
2336 : : {
2337 [ # # ]: 0 : aAny >>= eFS;
2338 : 0 : bIsHatching = eFS == ::com::sun::star::drawing::FillStyle_HATCH;
2339 : : }
2340 [ # # ][ # # ]: 0 : if ( bIsHatching || bIsFontwork || ( mType == "drawing.Measure" ) || ( mType == "drawing.Caption" ) )
[ # # ][ # # ]
[ # # ]
2341 : : {
2342 [ # # ][ # # ]: 0 : if ( ImplGetPropertyValue( rtl::OUString( "BoundRect" ) ) )
[ # # ][ # # ]
2343 : : {
2344 : 0 : ::com::sun::star::awt::Rectangle aRect( *(::com::sun::star::awt::Rectangle*)mAny.getValue() );
2345 [ # # ]: 0 : maPosition = MapPoint( ::com::sun::star::awt::Point( aRect.X, aRect.Y ) );
2346 [ # # ]: 0 : maSize = MapSize( ::com::sun::star::awt::Size( aRect.Width, aRect.Height ) );
2347 [ # # ]: 0 : maRect = Rectangle( Point( maPosition.X, maPosition.Y ), Size( maSize.Width, maSize.Height ) );
2348 : : }
2349 : 0 : mType = "drawing.dontknow";
2350 : 0 : }
2351 : : }
2352 : 0 : sal_uInt8 nPlaceHolderAtom = EPP_PLACEHOLDER_NONE;
2353 : :
2354 : 0 : mnTextSize = 0;
2355 : 0 : mnTextStyle = EPP_TEXTSTYLE_NORMAL;
2356 : :
2357 [ # # ]: 0 : if ( mType == "drawing.Custom" )
2358 : : {
2359 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
2360 : : sal_uInt32 nMirrorFlags;
2361 : 0 : rtl::OUString sCustomShapeType;
2362 [ # # ]: 0 : MSO_SPT eShapeType = aPropOpt.GetCustomShapeType( mXShape, nMirrorFlags, sCustomShapeType );
2363 [ # # ][ # # ]: 0 : if ( sCustomShapeType == "col-502ad400" || sCustomShapeType == "col-60da8460" )
[ # # ]
2364 : : { // sj: creating metafile for customshapes that can't be saved to ms format properly
2365 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_PictureFrame, 0xa00, aSolverContainer );
2366 [ # # ][ # # ]: 0 : if ( aPropOpt.CreateGraphicProperties( mXPropSet, rtl::OUString( "MetaFile" ), sal_False ) )
[ # # ][ # # ]
2367 : : {
2368 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
2369 : 0 : SdrObject* pObj = GetSdrObjectFromXShape( mXShape );
2370 [ # # ]: 0 : if ( pObj )
2371 : : {
2372 [ # # ]: 0 : Rectangle aBound = pObj->GetCurrentBoundRect();
2373 [ # # ]: 0 : maPosition = MapPoint( ::com::sun::star::awt::Point( aBound.Left(), aBound.Top() ) );
2374 [ # # ][ # # ]: 0 : maSize = MapSize( ::com::sun::star::awt::Size ( aBound.GetWidth(), aBound.GetHeight() ) );
[ # # ]
2375 [ # # ]: 0 : maRect = Rectangle( Point( maPosition.X, maPosition.Y ), Size( maSize.Width, maSize.Height ) );
2376 : 0 : mnAngle = 0;
2377 : : }
2378 : : }
2379 : : }
2380 : : else
2381 : : {
2382 [ # # ]: 0 : ImplCreateShape( eShapeType, nMirrorFlags | 0xa00, aSolverContainer );
2383 [ # # ]: 0 : aPropOpt.CreateCustomShapeProperties( eShapeType, mXShape );
2384 [ # # ]: 0 : aPropOpt.CreateFillProperties( mXPropSet, sal_True );
2385 [ # # ][ # # ]: 0 : if ( ImplGetText() )
2386 : : {
2387 [ # # ][ # # ]: 0 : if ( !aPropOpt.IsFontWork() )
2388 [ # # ]: 0 : aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_True, sal_True );
2389 : : }
2390 : 0 : }
2391 : : }
2392 [ # # ]: 0 : else if ( mType == "drawing.Rectangle" )
2393 : : {
2394 : 0 : sal_Int32 nRadius = 0;
2395 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
2396 [ # # ][ # # ]: 0 : if ( ImplGetPropertyValue( rtl::OUString( "CornerRadius" ) ) )
[ # # ][ # # ]
2397 : : {
2398 : 0 : mAny >>= nRadius;
2399 [ # # ]: 0 : nRadius = MapSize( ::com::sun::star::awt::Size( nRadius, 0 ) ).Width;
2400 : : }
2401 [ # # ]: 0 : if ( nRadius )
2402 : : {
2403 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_RoundRectangle, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
2404 [ # # ]: 0 : sal_Int32 nLenght = maRect.GetWidth();
2405 [ # # ][ # # ]: 0 : if ( nLenght > maRect.GetHeight() )
2406 [ # # ]: 0 : nLenght = maRect.GetHeight();
2407 : 0 : nLenght >>= 1;
2408 [ # # ]: 0 : if ( nRadius >= nLenght )
2409 : 0 : nRadius = 0x2a30; // 0x2a30 ist PPTs maximum radius
2410 : : else
2411 : 0 : nRadius = ( 0x2a30 * nRadius ) / nLenght;
2412 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_adjustValue, nRadius );
2413 : : }
2414 : : else
2415 : : {
2416 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_Rectangle, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
2417 : : }
2418 [ # # ]: 0 : aPropOpt.CreateFillProperties( mXPropSet, sal_True );
2419 [ # # ][ # # ]: 0 : if ( ImplGetText() )
2420 [ # # ]: 0 : aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_False );
2421 : : }
2422 [ # # ]: 0 : else if ( mType == "drawing.Ellipse" )
2423 : : {
2424 : 0 : ::com::sun::star::drawing::CircleKind eCircleKind( ::com::sun::star::drawing::CircleKind_FULL );
2425 : 0 : PolyStyle ePolyKind = POLY_CHORD;
2426 [ # # ][ # # ]: 0 : if ( ImplGetPropertyValue( rtl::OUString( "CircleKind" ) ) )
[ # # ][ # # ]
2427 : : {
2428 [ # # ]: 0 : mAny >>= eCircleKind;
2429 [ # # # # ]: 0 : switch ( eCircleKind )
2430 : : {
2431 : : case ::com::sun::star::drawing::CircleKind_SECTION :
2432 : : {
2433 : 0 : ePolyKind = POLY_PIE;
2434 : : }
2435 : 0 : break;
2436 : : case ::com::sun::star::drawing::CircleKind_ARC :
2437 : : {
2438 : 0 : ePolyKind = POLY_ARC;
2439 : : }
2440 : 0 : break;
2441 : :
2442 : : case ::com::sun::star::drawing::CircleKind_CUT :
2443 : : {
2444 : 0 : ePolyKind = POLY_CHORD;
2445 : : }
2446 : 0 : break;
2447 : :
2448 : : default:
2449 : 0 : eCircleKind = ::com::sun::star::drawing::CircleKind_FULL;
2450 : : }
2451 : : }
2452 [ # # ]: 0 : if ( eCircleKind == ::com::sun::star::drawing::CircleKind_FULL )
2453 : : {
2454 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
2455 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_Ellipse, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
2456 [ # # ]: 0 : aPropOpt.CreateFillProperties( mXPropSet, sal_True );
2457 [ # # ][ # # ]: 0 : if ( ImplGetText() )
2458 [ # # ]: 0 : aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_False );
2459 : : }
2460 : : else
2461 : : {
2462 : : sal_Int32 nStartAngle, nEndAngle;
2463 [ # # ][ # # ]: 0 : if ( !ImplGetPropertyValue( rtl::OUString( "CircleStartAngle" ) ) )
[ # # ][ # # ]
2464 : 0 : continue;
2465 : 0 : nStartAngle = *( (sal_Int32*)mAny.getValue() );
2466 [ # # ][ # # ]: 0 : if( !ImplGetPropertyValue( rtl::OUString( "CircleEndAngle" ) ) )
[ # # ][ # # ]
2467 : 0 : continue;
2468 : 0 : nEndAngle = *( (sal_Int32*)mAny.getValue() );
2469 [ # # ][ # # ]: 0 : ::com::sun::star::awt::Point aPoint( mXShape->getPosition() );
2470 [ # # ][ # # ]: 0 : ::com::sun::star::awt::Size aSize( mXShape->getSize() );
2471 : 0 : ::com::sun::star::awt::Point aStart, aEnd, aCenter;
2472 [ # # ]: 0 : Rectangle aRect( Point( aPoint.X, aPoint.Y ), Size( aSize.Width, aSize.Height ) );
2473 : 0 : aStart.X = (sal_Int32)( ( cos( (double)( nStartAngle * F_PI18000 ) ) * 100.0 ) );
2474 : 0 : aStart.Y = - (sal_Int32)( ( sin( (double)( nStartAngle * F_PI18000 ) ) * 100.0 ) );
2475 : 0 : aEnd.X = (sal_Int32)( ( cos( (double)( nEndAngle * F_PI18000 ) ) * 100.0 ) );
2476 : 0 : aEnd.Y = - (sal_Int32)( ( sin( (double)( nEndAngle * F_PI18000 ) ) * 100.0 ) );
2477 : 0 : aCenter.X = aPoint.X + ( aSize.Width / 2 );
2478 : 0 : aCenter.Y = aPoint.Y + ( aSize.Height / 2 );
2479 : 0 : aStart.X += aCenter.X;
2480 : 0 : aStart.Y += aCenter.Y;
2481 : 0 : aEnd.X += aCenter.X;
2482 : 0 : aEnd.Y += aCenter.Y;
2483 [ # # ]: 0 : Polygon aPolygon( aRect, Point( aStart.X, aStart.Y ), Point( aEnd.X, aEnd.Y ), ePolyKind );
2484 : 0 : sal_Bool bNeedText = sal_True;
2485 [ # # ]: 0 : if ( mnAngle )
2486 : : {
2487 [ # # ]: 0 : aPolygon.Rotate( aRect.TopLeft(), (sal_uInt16)( mnAngle / 10 ) );
2488 [ # # ][ # # ]: 0 : if ( ImplGetText() )
2489 : : {
2490 [ # # ]: 0 : mpPptEscherEx->EnterGroup( 0,0 );
2491 : 0 : nGroupLevel = mpPptEscherEx->GetGroupLevel();
2492 : 0 : bNeedText = sal_False;
2493 : 0 : bAdditionalText = sal_True;
2494 : 0 : mnTextSize = 0;
2495 : : }
2496 : 0 : mnAngle = 0;
2497 : : }
2498 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
2499 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_NotPrimitive, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
2500 : 0 : ::com::sun::star::awt::Rectangle aNewRect;
2501 [ # # # ]: 0 : switch ( ePolyKind )
2502 : : {
2503 : : case POLY_PIE :
2504 : : case POLY_CHORD :
2505 : : {
2506 [ # # ][ # # ]: 0 : if ( aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, sal_False, aNewRect, &aPolygon ) )
2507 [ # # ]: 0 : aPropOpt.CreateFillProperties( mXPropSet, sal_True );
2508 : : }
2509 : 0 : break;
2510 : :
2511 : : case POLY_ARC :
2512 : : {
2513 [ # # ][ # # ]: 0 : if ( aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, sal_False, aNewRect, &aPolygon ) )
2514 [ # # ]: 0 : aPropOpt.CreateLineProperties( mXPropSet, sal_False );
2515 : : }
2516 : 0 : break;
2517 : : }
2518 [ # # ]: 0 : maRect = MapRectangle( aNewRect );
2519 : 0 : maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
2520 [ # # ][ # # ]: 0 : maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
2521 [ # # ][ # # ]: 0 : if ( bNeedText && ImplGetText() )
[ # # ][ # # ]
2522 [ # # ][ # # ]: 0 : aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_False );
2523 : : }
2524 : : }
2525 [ # # ]: 0 : else if ( mType == "drawing.Control" )
2526 : : {
2527 : : ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XControlShape >
2528 [ # # ]: 0 : aXControlShape( mXShape, ::com::sun::star::uno::UNO_QUERY );
2529 [ # # ]: 0 : if ( !aXControlShape.is() )
2530 : 0 : continue;
2531 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >
2532 [ # # ][ # # ]: 0 : aXControlModel( aXControlShape->getControl() );
2533 [ # # ]: 0 : if ( !aXControlModel.is() )
2534 : 0 : continue;
2535 : :
2536 : 0 : sal_Int64 nAspect = ::com::sun::star::embed::Aspects::MSOLE_CONTENT;
2537 : : try
2538 : : {
2539 : : // try to get the aspect when available
2540 : : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
2541 [ # # ]: 0 : xShapeProps( mXShape, ::com::sun::star::uno::UNO_QUERY_THROW );
2542 [ # # ][ # # ]: 0 : xShapeProps->getPropertyValue( ::rtl::OUString( "Aspect" ) ) >>= nAspect;
[ # # ]
2543 : : }
2544 [ # # ]: 0 : catch( ::com::sun::star::uno::Exception& )
2545 : : {}
2546 : :
2547 [ # # ]: 0 : *mpExEmbed << (sal_uInt32)( 0xf | ( EPP_ExControl << 16 ) )
2548 [ # # ]: 0 : << (sal_uInt32)0; // Size of this container
2549 : :
2550 : 0 : sal_uInt32 nSize, nOldPos = mpExEmbed->Tell();
2551 : :
2552 : 0 : sal_uInt32 nPageId = nPageNumber;
2553 [ # # ]: 0 : if ( ePageType == MASTER )
2554 : 0 : nPageId |= 0x80000000;
2555 : : else
2556 : 0 : nPageId += 0x100;
2557 [ # # ]: 0 : *mpExEmbed << (sal_uInt32)( EPP_ExControlAtom << 16 )
2558 [ # # ]: 0 : << (sal_uInt32)4
2559 [ # # ]: 0 : << nPageId;
2560 [ # # ][ # # ]: 0 : PPTExOleObjEntry* pEntry = new PPTExOleObjEntry( OCX_CONTROL, mpExEmbed->Tell() );
2561 [ # # ]: 0 : pEntry->xControlModel = aXControlModel;
2562 [ # # ]: 0 : maExOleObj.push_back( pEntry );
2563 : :
2564 : 0 : mnExEmbed++;
2565 : :
2566 [ # # ]: 0 : *mpExEmbed << (sal_uInt32)( 1 | ( EPP_ExOleObjAtom << 16 ) )
2567 [ # # ]: 0 : << (sal_uInt32)24
2568 [ # # ]: 0 : << (sal_uInt32)nAspect
2569 [ # # ]: 0 : << (sal_uInt32)2
2570 [ # # ]: 0 : << (sal_uInt32)mnExEmbed
2571 [ # # ]: 0 : << (sal_uInt32)0
2572 [ # # ]: 0 : << (sal_uInt32)4 // index to the persist table
2573 [ # # ]: 0 : << (sal_uInt32)0x0012de00;
2574 : :
2575 : 0 : ::com::sun::star::awt::Size aSize;
2576 : 0 : rtl::OUString aControlName;
2577 [ # # ][ # # ]: 0 : SvStorageRef xTemp( new SvStorage( new SvMemoryStream(), sal_True ) );
[ # # ][ # # ]
2578 [ # # ][ # # ]: 0 : if ( oox::ole::MSConvertOCXControls::WriteOCXStream( mXModel, xTemp, aXControlModel, aSize, aControlName ) )
2579 : : {
2580 [ # # ]: 0 : String aUserName( xTemp->GetUserName() );
2581 [ # # ]: 0 : String aOleIdentifier;
2582 [ # # ]: 0 : if ( aUserName.Len() )
2583 : : {
2584 : : SvStorageStreamRef xCompObj = xTemp->OpenSotStream(
2585 : : rtl::OUString( "\1CompObj" ),
2586 [ # # ][ # # ]: 0 : STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYALL );
[ # # ]
2587 [ # # ]: 0 : xCompObj->Seek( STREAM_SEEK_TO_END );
2588 : 0 : sal_uInt32 nStreamLen = xCompObj->Tell();
2589 [ # # ]: 0 : xCompObj->Seek( 0 );
2590 : : sal_Int16 nVersion, nByteOrder;
2591 : : sal_Int32 nWinVersion, nVal, nStringLen;
2592 [ # # ]: 0 : *xCompObj >> nVersion
2593 [ # # ]: 0 : >> nByteOrder
2594 [ # # ]: 0 : >> nWinVersion
2595 [ # # ]: 0 : >> nVal;
2596 [ # # ]: 0 : xCompObj->SeekRel( 16 ); // skipping clsid
2597 [ # # ]: 0 : *xCompObj >> nStringLen;
2598 [ # # ]: 0 : if ( ( xCompObj->Tell() + nStringLen ) < nStreamLen )
2599 : : {
2600 [ # # ]: 0 : xCompObj->SeekRel( nStringLen ); // now skipping the UserName;
2601 [ # # ]: 0 : *xCompObj >> nStringLen;
2602 [ # # ]: 0 : if ( ( xCompObj->Tell() + nStringLen ) < nStreamLen )
2603 : : {
2604 [ # # ]: 0 : xCompObj->SeekRel( nStringLen ); // now skipping the clipboard formatname
2605 [ # # ]: 0 : *xCompObj >> nStringLen;
2606 [ # # ][ # # ]: 0 : if ( ( nStringLen > 1 ) && ( ( xCompObj->Tell() + nStringLen ) < nStreamLen ) )
[ # # ]
2607 : : { // i think that the OleIdentifier will follow
2608 [ # # ]: 0 : rtl::OString aTemp = read_uInt8s_ToOString(*xCompObj, nStringLen - 1);
2609 [ # # ][ # # ]: 0 : aOleIdentifier = rtl::OStringToOUString(aTemp, RTL_TEXTENCODING_MS_1252);
2610 : : }
2611 : : }
2612 [ # # ]: 0 : }
2613 : : }
2614 : :
2615 [ # # ]: 0 : if ( !aControlName.isEmpty() )
2616 [ # # ][ # # ]: 0 : PPTWriter::WriteCString( *mpExEmbed, aControlName, 1 );
[ # # ]
2617 [ # # ]: 0 : if ( aOleIdentifier.Len() )
2618 [ # # ]: 0 : PPTWriter::WriteCString( *mpExEmbed, aOleIdentifier, 2 );
2619 [ # # ]: 0 : if ( aUserName.Len() )
2620 [ # # ][ # # ]: 0 : PPTWriter::WriteCString( *mpExEmbed, aUserName, 3 );
[ # # ]
2621 : : }
2622 : 0 : nSize = mpExEmbed->Tell() - nOldPos;
2623 [ # # ]: 0 : mpExEmbed->Seek( nOldPos - 4 );
2624 [ # # ]: 0 : *mpExEmbed << nSize;
2625 [ # # ]: 0 : mpExEmbed->Seek( STREAM_SEEK_TO_END );
2626 : 0 : nOlePictureId = mnExEmbed;
2627 : :
2628 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
2629 : 0 : sal_uInt32 nSpFlags = SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_OLESHAPE;
2630 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_HostControl, nSpFlags, aSolverContainer );
2631 [ # # ][ # # ]: 0 : if ( aPropOpt.CreateGraphicProperties( mXPropSet, rtl::OUString( "MetaFile" ), sal_False ) )
[ # # ][ # # ]
2632 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
2633 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_pictureId, mnExEmbed );
2634 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_pictureActive, 0x10000 );
2635 : :
2636 [ # # ]: 0 : if ( !aControlName.isEmpty() )
2637 : : {
2638 : : sal_uInt16 i, nBufSize;
2639 : 0 : nBufSize = ( aControlName.getLength() + 1 ) << 1;
2640 [ # # ]: 0 : sal_uInt8* pBuf = new sal_uInt8[ nBufSize ];
2641 : 0 : sal_uInt8* pTmp = pBuf;
2642 [ # # ]: 0 : for ( i = 0; i < aControlName.getLength(); i++ )
2643 : : {
2644 : 0 : sal_Unicode nUnicode = *(aControlName.getStr() + i);
2645 : 0 : *pTmp++ = (sal_uInt8)nUnicode;
2646 : 0 : *pTmp++ = (sal_uInt8)( nUnicode >> 8 );
2647 : : }
2648 : 0 : *pTmp++ = 0;
2649 : 0 : *pTmp = 0;
2650 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_wzName, sal_True, nBufSize, pBuf, nBufSize );
2651 [ # # ][ # # ]: 0 : }
[ # # ]
2652 : : }
2653 [ # # ]: 0 : else if ( mType == "drawing.Connector" )
2654 : : {
2655 : : sal_uInt16 nSpType, nSpFlags;
2656 : 0 : ::com::sun::star::awt::Rectangle aNewRect;
2657 [ # # ][ # # ]: 0 : if ( aPropOpt.CreateConnectorProperties( mXShape, aSolverContainer, aNewRect, nSpType, nSpFlags ) == sal_False )
2658 : 0 : continue;
2659 : :
2660 [ # # ]: 0 : maRect = MapRectangle( aNewRect );
2661 : 0 : maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
2662 [ # # ][ # # ]: 0 : maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
2663 : :
2664 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
2665 [ # # ]: 0 : ImplCreateShape( nSpType, nSpFlags, aSolverContainer );
2666 : : }
2667 [ # # ]: 0 : else if ( mType == "drawing.Measure" )
2668 : : {
2669 : 0 : continue;
2670 : : }
2671 [ # # ]: 0 : else if ( mType == "drawing.Line" )
2672 : : {
2673 : 0 : ::com::sun::star::awt::Rectangle aNewRect;
2674 [ # # ]: 0 : aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_LINE, sal_False, aNewRect, NULL );
2675 [ # # ]: 0 : maRect = MapRectangle( aNewRect );
2676 : 0 : maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
2677 [ # # ][ # # ]: 0 : maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
2678 [ # # ][ # # ]: 0 : if ( ImplGetText() )
2679 : : {
2680 : 0 : aTextRefPoint = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
2681 : 0 : mnTextSize = 0;
2682 : 0 : bAdditionalText = sal_True;
2683 [ # # ]: 0 : mpPptEscherEx->EnterGroup( &maRect,0 );
2684 : : }
2685 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
2686 : 0 : sal_uInt32 nFlags = 0xa00; // Flags: Connector | HasSpt
2687 [ # # ]: 0 : if ( maRect.Top() > maRect.Bottom() )
2688 : 0 : nFlags |= 0x80; // Flags: VertMirror
2689 [ # # ]: 0 : if ( maRect.Left() > maRect.Right() )
2690 : 0 : nFlags |= 0x40; // Flags: HorzMirror
2691 : :
2692 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_Line, nFlags, aSolverContainer );
2693 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_shapePath, ESCHER_ShapeComplex );
2694 [ # # ]: 0 : aPropOpt.CreateLineProperties( mXPropSet, sal_False );
2695 : 0 : mnAngle = 0;
2696 : : }
2697 [ # # ]: 0 : else if ( bPolyPolygon )
2698 : : {
2699 [ # # ][ # # ]: 0 : if ( ImplGetText() )
2700 : : {
2701 [ # # ]: 0 : mpPptEscherEx->EnterGroup( 0,0 );
2702 : 0 : nGroupLevel = mpPptEscherEx->GetGroupLevel();
2703 : 0 : bAdditionalText = sal_True;
2704 : 0 : mnTextSize = 0;
2705 : : }
2706 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
2707 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_NotPrimitive, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
2708 : 0 : ::com::sun::star::awt::Rectangle aNewRect;
2709 [ # # ]: 0 : aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, sal_False, aNewRect, NULL );
2710 [ # # ]: 0 : maRect = MapRectangle( aNewRect );
2711 : 0 : maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
2712 [ # # ][ # # ]: 0 : maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
2713 [ # # ]: 0 : aPropOpt.CreateFillProperties( mXPropSet, sal_True );
2714 : 0 : mnAngle = 0;
2715 : : }
2716 [ # # ]: 0 : else if ( bPolyLine )
2717 : : {
2718 [ # # ][ # # ]: 0 : if ( ImplGetText() )
2719 : : {
2720 [ # # ]: 0 : mpPptEscherEx->EnterGroup( 0,0 );
2721 : 0 : nGroupLevel = mpPptEscherEx->GetGroupLevel();
2722 : 0 : bAdditionalText = sal_True;
2723 : 0 : mnTextSize = 0;
2724 : : }
2725 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
2726 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_NotPrimitive, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
2727 : 0 : ::com::sun::star::awt::Rectangle aNewRect;
2728 [ # # ]: 0 : aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, sal_False, aNewRect, NULL );
2729 [ # # ]: 0 : maRect = MapRectangle( aNewRect );
2730 : 0 : maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
2731 [ # # ][ # # ]: 0 : maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
2732 [ # # ]: 0 : aPropOpt.CreateLineProperties( mXPropSet, sal_False );
2733 : 0 : mnAngle = 0;
2734 : : }
2735 [ # # ]: 0 : else if ( bOpenBezier )
2736 : : {
2737 [ # # ][ # # ]: 0 : if ( ImplGetText() )
2738 : : {
2739 [ # # ]: 0 : mpPptEscherEx->EnterGroup( 0,0 );
2740 : 0 : nGroupLevel = mpPptEscherEx->GetGroupLevel();
2741 : 0 : bAdditionalText = sal_True;
2742 : 0 : mnTextSize = 0;
2743 : : }
2744 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
2745 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_NotPrimitive, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
2746 : 0 : ::com::sun::star::awt::Rectangle aNewRect;
2747 [ # # ]: 0 : aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, sal_True, aNewRect, NULL );
2748 [ # # ]: 0 : maRect = MapRectangle( aNewRect );
2749 : 0 : maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
2750 [ # # ][ # # ]: 0 : maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
2751 [ # # ]: 0 : aPropOpt.CreateLineProperties( mXPropSet, sal_False );
2752 : 0 : mnAngle = 0;
2753 : : }
2754 [ # # ]: 0 : else if ( bClosedBezier )
2755 : : {
2756 [ # # ][ # # ]: 0 : if ( ImplGetText() )
2757 : : {
2758 [ # # ]: 0 : mpPptEscherEx->EnterGroup( 0,0 );
2759 : 0 : nGroupLevel = mpPptEscherEx->GetGroupLevel();
2760 : 0 : bAdditionalText = sal_True;
2761 : 0 : mnTextSize = 0;
2762 : : }
2763 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
2764 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_NotPrimitive, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
2765 : 0 : ::com::sun::star::awt::Rectangle aNewRect;
2766 [ # # ]: 0 : aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, sal_True, aNewRect, NULL );
2767 [ # # ]: 0 : maRect = MapRectangle( aNewRect );
2768 : 0 : maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
2769 [ # # ][ # # ]: 0 : maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
2770 [ # # ]: 0 : aPropOpt.CreateFillProperties( mXPropSet, sal_True );
2771 : 0 : mnAngle = 0;
2772 : : }
2773 [ # # ][ # # ]: 0 : else if ( ( mType == "drawing.GraphicObject" ) || ( mType == "presentation.GraphicObject" ) )
[ # # ]
2774 : : {
2775 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
2776 : :
2777 : : // ein GraphicObject kann auch ein ClickMe Element sein
2778 [ # # ][ # # ]: 0 : if ( mbEmptyPresObj && ( ePageType == NORMAL ) )
2779 : : {
2780 : 0 : nPlaceHolderAtom = rLayout.nUsedObjectPlaceHolder;
2781 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_Rectangle, 0x220, aSolverContainer ); // Flags: HaveAnchor | HaveMaster
2782 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_lTxid, mnTxId += 0x60 );
2783 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x10001 );
2784 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x10001 );
2785 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_hspMaster, mnShapeMasterBody );
2786 : : }
2787 : : else
2788 : : {
2789 : : mXText = ::com::sun::star::uno::Reference<
2790 : : ::com::sun::star::text::XSimpleText >
2791 [ # # ][ # # ]: 0 : ( mXShape, ::com::sun::star::uno::UNO_QUERY );
2792 : :
2793 [ # # ]: 0 : if ( mXText.is() )
2794 [ # # ][ # # ]: 0 : mnTextSize = mXText->getString().getLength();
2795 : :
2796 [ # # ]: 0 : if ( mnTextSize ) // graphic object oder Flachenfuellung
2797 : : {
2798 : : /* SJ #i34951#: because M. documents are not allowing GraphicObjects containing text, we
2799 : : have to create a simpe Rectangle with fill bitmap instead (while not allowing BitmapMode_Repeat).
2800 : : */
2801 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_Rectangle, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
2802 [ # # ][ # # ]: 0 : if ( aPropOpt.CreateGraphicProperties( mXPropSet, rtl::OUString( "GraphicURL" ), sal_True, sal_True, sal_False ) )
[ # # ][ # # ]
2803 : : {
2804 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_WrapText, ESCHER_WrapNone );
2805 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_AnchorText, ESCHER_AnchorMiddle );
2806 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x140014 );
2807 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_fillBackColor, 0x8000000 );
2808 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x80000 );
2809 [ # # ][ # # ]: 0 : if ( ImplGetText() )
2810 [ # # ]: 0 : aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_False );
2811 : : }
2812 : : }
2813 : : else
2814 : : {
2815 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_PictureFrame, 0xa00, aSolverContainer );
2816 [ # # ][ # # ]: 0 : if ( aPropOpt.CreateGraphicProperties( mXPropSet, rtl::OUString( "GraphicURL" ), sal_False, sal_True ) )
[ # # ][ # # ]
2817 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
2818 : : }
2819 : : }
2820 : : }
2821 [ # # ][ # # ]: 0 : else if ( ( mType == "drawing.Text" ) || ( mType == "presentation.Notes" ) )
[ # # ]
2822 : : {
2823 [ # # ][ # # ]: 0 : if ( ( ePageType == NOTICE ) && mbPresObj )
2824 : : {
2825 [ # # ][ # # ]: 0 : if ( ImplCreatePresentationPlaceholder( bMasterPage, ePageType, EPP_TEXTTYPE_Notes, EPP_PLACEHOLDER_MASTERNOTESBODYIMAGE ) )
2826 : 0 : continue;
2827 : : else
2828 : 0 : nPlaceHolderAtom = EPP_PLACEHOLDER_NOTESBODY;
2829 : : }
2830 [ # # ]: 0 : ImplCreateTextShape( aPropOpt, aSolverContainer, sal_True );
2831 : : }
2832 [ # # ]: 0 : else if ( mType == "presentation.TitleText" )
2833 : : {
2834 [ # # ]: 0 : if ( mbPresObj )
2835 : : {
2836 [ # # ][ # # ]: 0 : if ( ( ePageType == NOTICE ) && mbEmptyPresObj )
2837 : : {
2838 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
2839 : 0 : nPlaceHolderAtom = EPP_PLACEHOLDER_MASTERNOTESBODYIMAGE;
2840 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_Rectangle, 0x200, aSolverContainer );
2841 [ # # ]: 0 : aPropOpt.CreateLineProperties( mXPropSet, sal_False );
2842 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x10001 );
2843 : : }
2844 [ # # ][ # # ]: 0 : else if ( rLayout.bTitlePossible && bIsTitlePossible )
2845 : : {
2846 : 0 : bIsTitlePossible = sal_False;
2847 : :
2848 [ # # ]: 0 : ImplGetText();
2849 [ # # ]: 0 : TextObjBinary aTextObj( mXText, EPP_TEXTTYPE_Title, maFontCollection, (PPTExBulletProvider&)*this );
2850 [ # # ]: 0 : if ( ePageType == MASTER )
2851 : : {
2852 [ # # ]: 0 : if ( mnTextSize )
2853 : : {
2854 [ # # ][ # # ]: 0 : ::rtl::OUString aUString( mXText->getString() );
2855 : : sal_uInt16 nChar;
2856 : :
2857 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
2858 [ # # ]: 0 : mnShapeMasterTitle = mpPptEscherEx->GenerateShapeId();
2859 [ # # ]: 0 : mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xa00, mnShapeMasterTitle );// Flags: HaveAnchor | HasSpt
2860 [ # # ]: 0 : EscherPropertyContainer aPropertyOptions;
2861 [ # # ]: 0 : aPropertyOptions.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x50001 );
2862 [ # # ]: 0 : aPropertyOptions.AddOpt( ESCHER_Prop_lTxid, mnTxId += 0x60 );
2863 [ # # ]: 0 : aPropertyOptions.AddOpt( ESCHER_Prop_AnchorText, ESCHER_AnchorMiddle );
2864 [ # # ]: 0 : aPropertyOptions.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x110001 );
2865 [ # # ]: 0 : aPropertyOptions.AddOpt( ESCHER_Prop_lineColor, 0x8000001 );
2866 [ # # ]: 0 : aPropertyOptions.AddOpt( ESCHER_Prop_shadowColor, 0x8000002 );
2867 [ # # ]: 0 : aPropertyOptions.CreateFillProperties( mXPropSet, sal_True );
2868 : 0 : sal_uInt32 nLineFlags = 0x90001;
2869 [ # # ][ # # ]: 0 : if ( aPropertyOptions.GetOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags ) )
2870 : 0 : nLineFlags |= 0x10001; // draw dashed line if no line
2871 [ # # ]: 0 : aPropertyOptions.AddOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags );
2872 [ # # ]: 0 : aPropertyOptions.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
2873 [ # # ]: 0 : ImplAdjustFirstLineLineSpacing( aTextObj, aPropOpt );
2874 [ # # ]: 0 : aPropertyOptions.Commit( *mpStrm );
2875 [ # # ]: 0 : mpPptEscherEx->AddAtom( 8, ESCHER_ClientAnchor );
2876 [ # # ][ # # ]: 0 : *mpStrm << (sal_Int16)maRect.Top() << (sal_Int16)maRect.Left() << (sal_Int16)maRect.Right() << (sal_Int16)maRect.Bottom(); // oben, links, rechts, unten ????
[ # # ][ # # ]
2877 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_ClientData );
2878 [ # # ]: 0 : mpPptEscherEx->AddAtom( 8, EPP_OEPlaceholderAtom );
2879 [ # # ]: 0 : *mpStrm << (sal_uInt32)0 // PlacementID
2880 [ # # ]: 0 : << (sal_uInt8)EPP_PLACEHOLDER_MASTERTITLE // PlaceHolderID
2881 [ # # ]: 0 : << (sal_uInt8)0 // Size of PlaceHolder ( 0 = FULL, 1 = HALF, 2 = QUARTER )
2882 [ # # ]: 0 : << (sal_uInt16)0; // padword
2883 [ # # ]: 0 : mpPptEscherEx->CloseContainer(); // ESCHER_ClientData
2884 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_ClientTextbox );
2885 [ # # ]: 0 : mpPptEscherEx->AddAtom( 4, EPP_TextHeaderAtom );
2886 [ # # ]: 0 : *mpStrm << (sal_uInt32)EPP_TEXTTYPE_Title;
2887 [ # # ]: 0 : mpPptEscherEx->AddAtom( mnTextSize << 1, EPP_TextCharsAtom );
2888 : 0 : const sal_Unicode* pString = aUString.getStr();
2889 [ # # ]: 0 : for ( sal_uInt32 i = 0; i < mnTextSize; i++ )
2890 : : {
2891 : 0 : nChar = pString[ i ]; // 0xa -> 0xb weicher Zeilenumbruch
2892 [ # # ]: 0 : if ( nChar == 0xa )
2893 : 0 : nChar++; // 0xd -> 0xd harter Zeilenumbruch
2894 [ # # ]: 0 : *mpStrm << nChar;
2895 : : }
2896 [ # # ]: 0 : mpPptEscherEx->AddAtom( 6, EPP_BaseTextPropAtom );
2897 [ # # ][ # # ]: 0 : *mpStrm << (sal_uInt32)( mnTextSize + 1 ) << (sal_uInt16)0;
2898 [ # # ]: 0 : mpPptEscherEx->AddAtom( 10, EPP_TextSpecInfoAtom );
2899 [ # # ][ # # ]: 0 : *mpStrm << (sal_uInt32)( mnTextSize + 1 ) << (sal_uInt32)1 << (sal_uInt16)0;
[ # # ]
2900 [ # # ]: 0 : mpPptEscherEx->CloseContainer(); // ESCHER_ClientTextBox
2901 [ # # ][ # # ]: 0 : mpPptEscherEx->CloseContainer(); // ESCHER_SpContainer
2902 : : }
2903 : 0 : continue;
2904 : : }
2905 : : else
2906 : : {
2907 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
2908 : 0 : mnTextStyle = EPP_TEXTSTYLE_TITLE;
2909 : 0 : nPlaceHolderAtom = rLayout.nTypeOfTitle;
2910 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_Rectangle, 0x220, aSolverContainer ); // Flags: HaveAnchor | HaveMaster
2911 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_hspMaster, mnShapeMasterTitle );
2912 [ # # ]: 0 : aPropOpt.CreateFillProperties( mXPropSet, sal_True );
2913 [ # # ]: 0 : aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
2914 [ # # ]: 0 : ImplAdjustFirstLineLineSpacing( aTextObj, aPropOpt );
2915 [ # # ]: 0 : if ( mbEmptyPresObj )
2916 : : {
2917 : 0 : sal_uInt32 nNoLineDrawDash = 0;
2918 [ # # ]: 0 : aPropOpt.GetOpt( ESCHER_Prop_fNoLineDrawDash, nNoLineDrawDash );
2919 : 0 : nNoLineDrawDash |= 0x10001;
2920 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, nNoLineDrawDash );
2921 : : }
2922 [ # # ][ # # ]: 0 : }
2923 : : }
2924 : : else
2925 : 0 : mbPresObj = sal_False;
2926 : : }
2927 [ # # ]: 0 : if ( !mbPresObj )
2928 : : {
2929 : 0 : mType = "drawing.Text";
2930 [ # # ]: 0 : ImplCreateTextShape( aPropOpt, aSolverContainer, sal_True );
2931 : : }
2932 : : }
2933 [ # # ][ # # ]: 0 : else if ( ( mType == "presentation.Outliner" ) || ( mType == "presentation.Subtitle" ) )
[ # # ]
2934 : : {
2935 [ # # ]: 0 : if ( mbPresObj )
2936 : : {
2937 : 0 : nOutlinerCount++;
2938 [ # # ][ # # ]: 0 : if ( (rLayout.bOutlinerPossible && ( nOutlinerCount == 1 )) ||
[ # # ][ # # ]
[ # # ]
2939 : : (( rLayout.bSecOutlinerPossible && ( nOutlinerCount == 2 ) ) && ( nPrevTextStyle == EPP_TEXTSTYLE_BODY ))
2940 : : )
2941 : : {
2942 [ # # ]: 0 : ImplGetText();
2943 [ # # ]: 0 : TextObjBinary aTextObj( mXText, EPP_TEXTTYPE_Body, maFontCollection, (PPTExBulletProvider&)*this );
2944 [ # # ]: 0 : if ( ePageType == MASTER )
2945 : : {
2946 : 0 : nPrevTextStyle = EPP_TEXTSTYLE_TITLE;
2947 [ # # ]: 0 : if ( mnTextSize )
2948 : : {
2949 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
2950 [ # # ]: 0 : mnShapeMasterBody = mpPptEscherEx->GenerateShapeId();
2951 [ # # ]: 0 : mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xa00, mnShapeMasterBody ); // Flags: HaveAnchor | HasSpt
2952 [ # # ]: 0 : EscherPropertyContainer aPropOpt2;
2953 [ # # ]: 0 : aPropOpt2.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x50001 );
2954 [ # # ]: 0 : aPropOpt2.AddOpt( ESCHER_Prop_lTxid, mnTxId += 0x60 );
2955 [ # # ]: 0 : aPropOpt2.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x110001 );
2956 [ # # ]: 0 : aPropOpt2.AddOpt( ESCHER_Prop_lineColor, 0x8000001 );
2957 [ # # ]: 0 : aPropOpt2.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x90001 );
2958 [ # # ]: 0 : aPropOpt2.AddOpt( ESCHER_Prop_shadowColor, 0x8000002 );
2959 [ # # ]: 0 : aPropOpt2.CreateFillProperties( mXPropSet, sal_True );
2960 : 0 : sal_uInt32 nLineFlags = 0x90001;
2961 [ # # ][ # # ]: 0 : if ( aPropOpt2.GetOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags ) )
2962 : 0 : nLineFlags |= 0x10001; // draw dashed line if no line
2963 [ # # ]: 0 : aPropOpt2.AddOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags );
2964 [ # # ]: 0 : aPropOpt2.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
2965 [ # # ]: 0 : ImplAdjustFirstLineLineSpacing( aTextObj, aPropOpt2 );
2966 [ # # ]: 0 : aPropOpt2.Commit( *mpStrm );
2967 [ # # ]: 0 : mpPptEscherEx->AddAtom( 8, ESCHER_ClientAnchor );
2968 [ # # ][ # # ]: 0 : *mpStrm << (sal_Int16)maRect.Top() << (sal_Int16)maRect.Left() << (sal_Int16)maRect.Right() << (sal_Int16)maRect.Bottom(); // oben, links, rechts, unten ????
[ # # ][ # # ]
2969 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_ClientData );
2970 [ # # ]: 0 : mpPptEscherEx->AddAtom( 8, EPP_OEPlaceholderAtom );
2971 [ # # ]: 0 : *mpStrm << (sal_uInt32)1 // PlacementID
2972 [ # # ]: 0 : << (sal_uInt8)EPP_PLACEHOLDER_MASTERBODY // PlaceHolderID
2973 [ # # ]: 0 : << (sal_uInt8)0 // Size of PlaceHolder ( 0 = FULL, 1 = HALF, 2 = QUARTER )
2974 [ # # ]: 0 : << (sal_uInt16)0; // padword
2975 [ # # ]: 0 : mpPptEscherEx->CloseContainer(); // ESCHER_ClientData
2976 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_ClientTextbox ); // printf
2977 [ # # ]: 0 : mpPptEscherEx->AddAtom( 4, EPP_TextHeaderAtom );
2978 [ # # ]: 0 : *mpStrm << (sal_uInt32)EPP_TEXTTYPE_Body;
2979 : 0 : mnTextSize = aTextObj.Count();
2980 [ # # ]: 0 : aTextObj.Write( mpStrm );
2981 [ # # ]: 0 : mpPptEscherEx->BeginAtom();
2982 [ # # ]: 0 : for ( sal_uInt32 i = 0; i < aTextObj.ParagraphCount() ; ++i )
2983 : : {
2984 [ # # ]: 0 : ParagraphObj* pPara = aTextObj.GetParagraph(i);
2985 : 0 : sal_uInt32 nCharCount = pPara->Count();
2986 : 0 : sal_uInt16 nDepth = pPara->nDepth;
2987 [ # # ]: 0 : if ( nDepth > 4)
2988 : 0 : nDepth = 4;
2989 : :
2990 [ # # ]: 0 : *mpStrm << nCharCount
2991 [ # # ]: 0 : << nDepth;
2992 : : }
2993 [ # # ]: 0 : mpPptEscherEx->EndAtom( EPP_BaseTextPropAtom );
2994 [ # # ]: 0 : mpPptEscherEx->AddAtom( 10, EPP_TextSpecInfoAtom );
2995 [ # # ][ # # ]: 0 : *mpStrm << (sal_uInt32)( mnTextSize ) << (sal_uInt32)1 << (sal_uInt16)0;
[ # # ]
2996 : :
2997 [ # # ]: 0 : mpPptEscherEx->CloseContainer(); // ESCHER_ClientTextBox
2998 [ # # ][ # # ]: 0 : mpPptEscherEx->CloseContainer(); // ESCHER_SpContainer
2999 : : }
3000 : 0 : continue;
3001 : : }
3002 : : else
3003 : : {
3004 : 0 : mnTextStyle = EPP_TEXTSTYLE_BODY;
3005 : 0 : nPlaceHolderAtom = rLayout.nTypeOfOutliner;
3006 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
3007 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_Rectangle, 0x220, aSolverContainer ); // Flags: HaveAnchor | HaveMaster
3008 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_hspMaster, mnShapeMasterBody );
3009 [ # # ]: 0 : aPropOpt.CreateFillProperties( mXPropSet, sal_True );
3010 [ # # ]: 0 : aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
3011 [ # # ]: 0 : ImplAdjustFirstLineLineSpacing( aTextObj, aPropOpt );
3012 [ # # ]: 0 : if ( mbEmptyPresObj )
3013 : : {
3014 : 0 : sal_uInt32 nNoLineDrawDash = 0;
3015 [ # # ]: 0 : aPropOpt.GetOpt( ESCHER_Prop_fNoLineDrawDash, nNoLineDrawDash );
3016 : 0 : nNoLineDrawDash |= 0x10001;
3017 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, nNoLineDrawDash );
3018 : : }
3019 [ # # ][ # # ]: 0 : }
3020 : : }
3021 : : else
3022 : 0 : mbPresObj = sal_False;
3023 : : }
3024 [ # # ]: 0 : if ( !mbPresObj )
3025 : : {
3026 : 0 : mType = "drawing.Text";
3027 [ # # ]: 0 : ImplCreateTextShape( aPropOpt, aSolverContainer, sal_True );
3028 : : }
3029 : : }
3030 [ # # ][ # # ]: 0 : else if ( ( mType == "drawing.Page" ) || ( mType == "presentation.Page" ) )
[ # # ]
3031 : : {
3032 [ # # ][ # # ]: 0 : if ( ( ePageType == NOTICE ) && mbPresObj )
3033 : : {
3034 [ # # ][ # # ]: 0 : if ( ImplCreatePresentationPlaceholder( bMasterPage, ePageType, EPP_TEXTTYPE_Notes, EPP_PLACEHOLDER_MASTERNOTESSLIDEIMAGE ) )
3035 : 0 : continue;
3036 : : else
3037 : 0 : nPlaceHolderAtom = EPP_PLACEHOLDER_NOTESSLIDEIMAGE;
3038 : : }
3039 [ # # ]: 0 : ImplCreateTextShape( aPropOpt, aSolverContainer, sal_True );
3040 : : }
3041 [ # # ]: 0 : else if ( mType == "drawing.Frame" )
3042 : : {
3043 : 0 : continue;
3044 : : }
3045 [ # # ][ # # : 0 : else if ( ( mType == "drawing.OLE2" ) || ( mType == "presentation.OLE2" )
# # # # #
# ][ # # ]
3046 : 0 : || ( mType == "presentation.Chart" ) || ( mType == "presentation.Calc" )
3047 : 0 : || ( mType == "presentation.OrgChart" ) )
3048 : : {
3049 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
3050 [ # # ][ # # ]: 0 : if ( mbEmptyPresObj && ( ePageType == NORMAL ) )
3051 : : {
3052 : 0 : nPlaceHolderAtom = rLayout.nUsedObjectPlaceHolder;
3053 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_Rectangle, 0x220, aSolverContainer ); // Flags: HaveAnchor | HaveMaster
3054 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_lTxid, mnTxId += 0x60 );
3055 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x10001 );
3056 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x10001 );
3057 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_hspMaster, mnShapeMasterBody );
3058 : : }
3059 : : else
3060 : : {
3061 [ # # ]: 0 : *mpExEmbed << (sal_uInt32)( 0xf | ( EPP_ExEmbed << 16 ) )
3062 [ # # ]: 0 : << (sal_uInt32)0; // Size of this container
3063 : :
3064 : 0 : sal_uInt32 nSize, nOldPos = mpExEmbed->Tell();
3065 : :
3066 [ # # ]: 0 : *mpExEmbed << (sal_uInt32)( EPP_ExEmbedAtom << 16 )
3067 [ # # ]: 0 : << (sal_uInt32)8
3068 [ # # ]: 0 : << (sal_uInt32)0 // follow colorscheme : 0->do not follow
3069 : : // 1->follow collorscheme
3070 : : // 2->follow text and background scheme
3071 [ # # ]: 0 : << (sal_uInt8)1 // (bool)set if embedded server can not be locked
3072 [ # # ]: 0 : << (sal_uInt8)0 // (bool)do not need to send dimension
3073 [ # # ]: 0 : << (sal_uInt8)0 // (bool)is object a world table
3074 [ # # ]: 0 : << (sal_uInt8)0; // pad byte
3075 : :
3076 [ # # ][ # # ]: 0 : PPTExOleObjEntry* pE = new PPTExOleObjEntry( NORMAL_OLE_OBJECT, mpExEmbed->Tell() );
3077 [ # # ]: 0 : pE->xShape = mXShape;
3078 [ # # ]: 0 : maExOleObj.push_back( pE );
3079 : :
3080 : 0 : mnExEmbed++;
3081 : :
3082 : 0 : sal_Int64 nAspect = ::com::sun::star::embed::Aspects::MSOLE_CONTENT;
3083 : : try
3084 : : {
3085 : : // try to get the aspect when available
3086 : : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
3087 [ # # ]: 0 : xShapeProps( mXShape, ::com::sun::star::uno::UNO_QUERY_THROW );
3088 [ # # ][ # # ]: 0 : xShapeProps->getPropertyValue( ::rtl::OUString( "Aspect" ) ) >>= nAspect;
[ # # ]
3089 : : }
3090 [ # # ]: 0 : catch( ::com::sun::star::uno::Exception& )
3091 : : {}
3092 : :
3093 [ # # ]: 0 : *mpExEmbed << (sal_uInt32)( 1 | ( EPP_ExOleObjAtom << 16 ) )
3094 [ # # ]: 0 : << (sal_uInt32)24
3095 [ # # ]: 0 : << (sal_uInt32)nAspect // Aspect
3096 [ # # ]: 0 : << (sal_uInt32)0
3097 [ # # ]: 0 : << (sal_uInt32)mnExEmbed // index to the persist table
3098 [ # # ]: 0 : << (sal_uInt32)0 // subtype
3099 [ # # ]: 0 : << (sal_uInt32)0
3100 [ # # ]: 0 : << (sal_uInt32)0x0012b600;
3101 : :
3102 : 0 : nSize = mpExEmbed->Tell() - nOldPos;
3103 [ # # ]: 0 : mpExEmbed->Seek( nOldPos - 4 );
3104 [ # # ]: 0 : *mpExEmbed << nSize;
3105 [ # # ]: 0 : mpExEmbed->Seek( STREAM_SEEK_TO_END );
3106 : 0 : nOlePictureId = mnExEmbed;
3107 : :
3108 : 0 : sal_uInt32 nSpFlags = 0xa00;
3109 [ # # ]: 0 : if ( nOlePictureId )
3110 : 0 : nSpFlags |= 0x10;
3111 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_PictureFrame, nSpFlags, aSolverContainer );
3112 [ # # ][ # # ]: 0 : if ( aPropOpt.CreateOLEGraphicProperties( mXShape ) )
3113 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
3114 [ # # ]: 0 : if ( nOlePictureId )
3115 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_pictureId, nOlePictureId );
3116 : : }
3117 : : }
3118 [ # # ]: 0 : else if ( mType == "presentation.Header" )
3119 : : {
3120 [ # # ][ # # ]: 0 : if ( ImplCreatePresentationPlaceholder( bMasterPage, ePageType, EPP_TEXTTYPE_Other, EPP_PLACEHOLDER_MASTERHEADER ) )
3121 : 0 : continue;
3122 : : else
3123 : : {
3124 : 0 : mbPresObj = sal_False;
3125 : 0 : mType = "drawing.Text";
3126 [ # # ]: 0 : ImplCreateTextShape( aPropOpt, aSolverContainer, sal_True );
3127 : : }
3128 : : }
3129 [ # # ]: 0 : else if ( mType == "presentation.Footer" )
3130 : : {
3131 [ # # ][ # # ]: 0 : if ( ImplCreatePresentationPlaceholder( bMasterPage, ePageType, EPP_TEXTTYPE_Other, EPP_PLACEHOLDER_MASTERFOOTER ) )
3132 : 0 : continue;
3133 : : else
3134 : : {
3135 : 0 : mbPresObj = sal_False;
3136 : 0 : mType = "drawing.Text";
3137 [ # # ]: 0 : ImplCreateTextShape( aPropOpt, aSolverContainer, sal_True );
3138 : : }
3139 : : }
3140 [ # # ]: 0 : else if ( mType == "presentation.DateTime" )
3141 : : {
3142 [ # # ][ # # ]: 0 : if ( ImplCreatePresentationPlaceholder( bMasterPage, ePageType, EPP_TEXTTYPE_Other, EPP_PLACEHOLDER_MASTERDATE ) )
3143 : 0 : continue;
3144 : : else
3145 : : {
3146 : 0 : mbPresObj = sal_False;
3147 : 0 : mType = "drawing.Text";
3148 [ # # ]: 0 : ImplCreateTextShape( aPropOpt, aSolverContainer, sal_True );
3149 : : }
3150 : : }
3151 [ # # ]: 0 : else if ( mType == "presentation.SlideNumber" )
3152 : : {
3153 [ # # ][ # # ]: 0 : if ( ImplCreatePresentationPlaceholder( bMasterPage, ePageType, EPP_TEXTTYPE_Other, EPP_PLACEHOLDER_MASTERSLIDENUMBER ) )
3154 : 0 : continue;
3155 : : else
3156 : : {
3157 : 0 : mbPresObj = sal_False;
3158 : 0 : mType = "drawing.Text";
3159 [ # # ]: 0 : ImplCreateTextShape( aPropOpt, aSolverContainer, sal_True );
3160 : : }
3161 : : }
3162 [ # # ][ # # ]: 0 : else if ( (mType.getLength() > 9) && (mType[8] == '3') && (mType[9] == 'D') ) // drawing.3D
[ # # ][ # # ]
3163 : : {
3164 : : // SceneObject, CubeObject, SphereObject, LatheObject, ExtrudeObject, PolygonObject
3165 [ # # ][ # # ]: 0 : if ( !ImplGetPropertyValue( rtl::OUString( "Bitmap" ) ) )
[ # # ][ # # ]
3166 : 0 : continue;
3167 : :
3168 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
3169 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_PictureFrame, 0xa00, aSolverContainer );
3170 : :
3171 [ # # ][ # # ]: 0 : if ( aPropOpt.CreateGraphicProperties( mXPropSet, rtl::OUString( "Bitmap" ), sal_False ) )
[ # # ][ # # ]
3172 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
3173 : : }
3174 [ # # ]: 0 : else if ( mType == "drawing.Media" )
3175 : : {
3176 : 0 : mnAngle = 0;
3177 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
3178 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_PictureFrame, 0xa00, aSolverContainer );
3179 : :
3180 : 0 : ::com::sun::star::uno::Any aAny;
3181 [ # # ][ # # ]: 0 : if ( PropValue::GetPropertyValue( aAny, mXPropSet, rtl::OUString( "MediaURL" ), sal_True ) )
[ # # ][ # # ]
3182 : : {
3183 : 0 : rtl::OUString aMediaURL;
3184 [ # # ][ # # ]: 0 : if ( (aAny >>= aMediaURL ) && !aMediaURL.isEmpty() )
[ # # ]
3185 : : {
3186 : : // SJ: creating the Media RefObj
3187 : 0 : sal_uInt32 nRefId = ++mnExEmbed;
3188 : :
3189 [ # # ]: 0 : *mpExEmbed << (sal_uInt16)0xf
3190 [ # # ]: 0 : << (sal_uInt16)EPP_ExMCIMovie // PPT_PST_ExAviMovie
3191 [ # # ]: 0 : << (sal_uInt32)0;
3192 : 0 : sal_uInt32 nSize, nStart = mpExEmbed->Tell();
3193 [ # # ]: 0 : *mpExEmbed << (sal_uInt16)0
3194 [ # # ]: 0 : << (sal_uInt16)EPP_ExObjRefAtom
3195 [ # # ]: 0 : << (sal_uInt32)4
3196 [ # # ]: 0 : << nRefId;
3197 [ # # ]: 0 : *mpExEmbed << (sal_uInt16)0xf
3198 [ # # ]: 0 : << (sal_uInt16)EPP_ExVideo
3199 [ # # ]: 0 : << (sal_uInt32)0;
3200 : :
3201 [ # # ]: 0 : *mpExEmbed << (sal_uInt16)0
3202 [ # # ]: 0 : << (sal_uInt16)EPP_ExMediaAtom
3203 [ # # ]: 0 : << (sal_uInt32)8
3204 [ # # ]: 0 : << nRefId
3205 [ # # ]: 0 : << (sal_uInt16)0
3206 [ # # ]: 0 : << (sal_uInt16)0x435;
3207 : :
3208 : 0 : sal_uInt16 i, nStringLen = (sal_uInt16)aMediaURL.getLength();
3209 [ # # ][ # # ]: 0 : *mpExEmbed << (sal_uInt32)( EPP_CString << 16 ) << (sal_uInt32)( nStringLen * 2 );
3210 [ # # ]: 0 : for ( i = 0; i < nStringLen; i++ )
3211 : : {
3212 : 0 : sal_Unicode nChar = aMediaURL[ i ];
3213 [ # # ]: 0 : *mpExEmbed << nChar;
3214 : : }
3215 : 0 : nSize = mpExEmbed->Tell() - nStart;
3216 [ # # ]: 0 : mpExEmbed->SeekRel( - ( (sal_Int32)nSize + 4 ) );
3217 [ # # ]: 0 : *mpExEmbed << nSize; // size of PPT_PST_ExMCIMovie
3218 [ # # ]: 0 : mpExEmbed->SeekRel( 0x10 );
3219 : 0 : nSize -= 20;
3220 [ # # ]: 0 : *mpExEmbed << nSize; // PPT_PST_ExMediaAtom
3221 [ # # ]: 0 : mpExEmbed->SeekRel( nSize );
3222 : :
3223 [ # # ]: 0 : if ( !pClientData )
3224 [ # # ][ # # ]: 0 : pClientData = new SvMemoryStream( 0x200, 0x200 );
3225 [ # # ]: 0 : *pClientData << (sal_uInt16)0
3226 [ # # ]: 0 : << (sal_uInt16)EPP_ExObjRefAtom
3227 [ # # ]: 0 : << (sal_uInt32)4
3228 [ # # ]: 0 : << nRefId;
3229 : 0 : }
3230 : 0 : }
3231 : : }
3232 [ # # ][ # # ]: 0 : else if ( (mType == "drawing.Table") || (mType == "presentation.Table") )
[ # # ]
3233 : : {
3234 : 0 : SvMemoryStream* pTmp = NULL;
3235 [ # # ][ # # ]: 0 : if ( bEffect && !mbUseNewAnimations )
3236 : : {
3237 [ # # ][ # # ]: 0 : pTmp = new SvMemoryStream( 0x200, 0x200 );
3238 [ # # ]: 0 : ImplWriteObjectEffect( *pTmp, eAe, eTe, ++nEffectCount );
3239 : : }
3240 [ # # ]: 0 : if ( eCa != ::com::sun::star::presentation::ClickAction_NONE )
3241 : : {
3242 [ # # ]: 0 : if ( !pTmp )
3243 [ # # ][ # # ]: 0 : pTmp = new SvMemoryStream( 0x200, 0x200 );
3244 [ # # ]: 0 : ImplWriteClickAction( *pTmp, eCa, bMediaClickAction );
3245 : : }
3246 [ # # ]: 0 : ImplCreateTable( mXShape, aSolverContainer, aPropOpt );
3247 : 0 : continue;
3248 : : }
3249 [ # # ]: 0 : else if ( mType == "drawing.dontknow" )
3250 : : {
3251 : 0 : mnAngle = 0;
3252 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
3253 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_PictureFrame, 0xa00, aSolverContainer );
3254 [ # # ][ # # ]: 0 : if ( aPropOpt.CreateGraphicProperties( mXPropSet, rtl::OUString( "MetaFile" ), sal_False ) )
[ # # ][ # # ]
3255 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
3256 : : }
3257 : : else
3258 : : {
3259 : 0 : continue;
3260 : : }
3261 : :
3262 : : sal_Bool bClientData = ( bEffect || ( eCa != ::com::sun::star::presentation::ClickAction_NONE ) ||
3263 [ # # ][ # # ]: 0 : nPlaceHolderAtom || nOlePictureId );
[ # # ][ # # ]
3264 [ # # ]: 0 : if ( bClientData )
3265 : : {
3266 [ # # ]: 0 : if ( nPlaceHolderAtom )
3267 : : {
3268 : 0 : sal_Int32 nPlacementID = -1;
3269 [ # # ][ # # ]: 0 : if ( ( mnTextStyle == EPP_TEXTSTYLE_TITLE ) || ( mnTextStyle == EPP_TEXTSTYLE_BODY ) )
3270 : 0 : nPlacementID = nIndices++;
3271 : : else
3272 : : {
3273 [ # # ]: 0 : switch ( nPlaceHolderAtom )
3274 : : {
3275 : : default :
3276 : : {
3277 [ # # ]: 0 : if ( nPlaceHolderAtom < 19 )
3278 : 0 : break;
3279 : : }
3280 : : case EPP_PLACEHOLDER_NOTESBODY :
3281 : : case EPP_PLACEHOLDER_MASTERDATE :
3282 : : case EPP_PLACEHOLDER_NOTESSLIDEIMAGE :
3283 : : case EPP_PLACEHOLDER_MASTERNOTESBODYIMAGE :
3284 : 0 : nPlacementID = nIndices++;
3285 : : }
3286 : : }
3287 [ # # ]: 0 : if ( !pClientData )
3288 [ # # ][ # # ]: 0 : pClientData = new SvMemoryStream( 0x200, 0x200 );
3289 : :
3290 [ # # ][ # # ]: 0 : *pClientData << (sal_uInt32)( EPP_OEPlaceholderAtom << 16 ) << (sal_uInt32)8
3291 [ # # ]: 0 : << nPlacementID // PlacementID
3292 [ # # ]: 0 : << (sal_uInt8)nPlaceHolderAtom // PlaceHolderID
3293 [ # # ]: 0 : << (sal_uInt8)0 // Size of PlaceHolder ( 0 = FULL, 1 = HALF, 2 = QUARTER )
3294 [ # # ]: 0 : << (sal_uInt16)0; // padword
3295 : : }
3296 [ # # ]: 0 : if ( nOlePictureId )
3297 : : {
3298 [ # # ]: 0 : if ( !pClientData )
3299 [ # # ][ # # ]: 0 : pClientData = new SvMemoryStream( 0x200, 0x200 );
3300 : :
3301 [ # # ][ # # ]: 0 : *pClientData << (sal_uInt32)( EPP_ExObjRefAtom << 16 ) << (sal_uInt32)4
3302 [ # # ]: 0 : << nOlePictureId;
3303 : 0 : nOlePictureId = 0;
3304 : : }
3305 [ # # ]: 0 : if ( bEffect )
3306 : : {
3307 [ # # ]: 0 : if ( !pClientData )
3308 [ # # ][ # # ]: 0 : pClientData = new SvMemoryStream( 0x200, 0x200 );
3309 : :
3310 : : // check if it is sensible to replace the object effect with text effect,
3311 : : // because in Impress there is the possibility to use a compound effect,
3312 : : // e.g. the object effect is an AnimationEffect_FADE_FROM_LEFT and the
3313 : : // text effect is a AnimationEffect_FADE_FROM_TOP, in PowerPoint there
3314 : : // can be used only one effect
3315 [ # # ][ # # ]: 0 : if ( mnTextSize && ( eTe != ::com::sun::star::presentation::AnimationEffect_NONE )
[ # # ][ # # ]
3316 : : && ( eAe != ::com::sun::star::presentation::AnimationEffect_NONE )
3317 : : && ( eTe != eAe ) )
3318 : : {
3319 : : sal_uInt32 nFillStyleFlags, nLineStyleFlags;
3320 [ # # ][ # # ]: 0 : if ( aPropOpt.GetOpt( ESCHER_Prop_fNoFillHitTest, nFillStyleFlags )
[ # # ][ # # ]
3321 [ # # ]: 0 : && aPropOpt.GetOpt( ESCHER_Prop_fNoLineDrawDash, nLineStyleFlags ) )
3322 : : {
3323 : : // there is no fillstyle and also no linestyle
3324 [ # # ]: 0 : if ( ! ( ( nFillStyleFlags & 0x10 ) + ( nLineStyleFlags & 9 ) ) )
3325 : 0 : eAe = eTe;
3326 : : }
3327 : : }
3328 [ # # ]: 0 : if ( !mbUseNewAnimations )
3329 [ # # ]: 0 : ImplWriteObjectEffect( *pClientData, eAe, eTe, ++nEffectCount );
3330 : : }
3331 : :
3332 [ # # ]: 0 : if ( eCa != ::com::sun::star::presentation::ClickAction_NONE )
3333 : : {
3334 [ # # ]: 0 : if ( !pClientData )
3335 [ # # ][ # # ]: 0 : pClientData = new SvMemoryStream( 0x200, 0x200 );
3336 [ # # ]: 0 : ImplWriteClickAction( *pClientData, eCa, bMediaClickAction );
3337 : : }
3338 : : }
3339 [ # # ][ # # ]: 0 : if ( ( mnTextStyle == EPP_TEXTSTYLE_TITLE ) || ( mnTextStyle == EPP_TEXTSTYLE_BODY ) )
3340 : : {
3341 [ # # ]: 0 : if ( !pClientTextBox )
3342 [ # # ][ # # ]: 0 : pClientTextBox = new SvMemoryStream( 0x200, 0x200 );
3343 : :
3344 [ # # ]: 0 : if ( mbEmptyPresObj == sal_False )
3345 : : {
3346 [ # # ][ # # ]: 0 : if ( ( ePageType == NORMAL ) && ( bMasterPage == sal_False ) )
3347 : : {
3348 : 0 : sal_uInt32 nTextType = EPP_TEXTTYPE_Body;
3349 [ # # ]: 0 : if ( mnTextStyle == EPP_TEXTSTYLE_BODY )
3350 : : {
3351 [ # # ]: 0 : if ( bSecOutl )
3352 : 0 : nTextType = EPP_TEXTTYPE_HalfBody;
3353 [ # # ]: 0 : else if ( mType == "presentation.Subtitle" )
3354 : 0 : nTextType = EPP_TEXTTYPE_CenterBody;
3355 : 0 : bSecOutl = sal_True;
3356 : : }
3357 : : else
3358 : 0 : nTextType = EPP_TEXTTYPE_Title;
3359 : :
3360 : 0 : TextRuleEntry aTextRule( nPageNumber );
3361 [ # # ]: 0 : SvMemoryStream aExtBu( 0x200, 0x200 );
3362 [ # # ]: 0 : ImplGetText();
3363 [ # # ]: 0 : ImplWriteTextStyleAtom( *pClientTextBox, nTextType, nPObjects, &aTextRule, aExtBu, NULL );
3364 [ # # ]: 0 : ImplWriteExtParaHeader( aExtBu, nPObjects++, nTextType, nPageNumber + 0x100 );
3365 : 0 : SvMemoryStream* pOut = aTextRule.pOut;
3366 [ # # ]: 0 : if ( pOut )
3367 : : {
3368 [ # # ][ # # ]: 0 : pClientTextBox->Write( pOut->GetData(), pOut->Tell() );
3369 [ # # ][ # # ]: 0 : delete pOut, aTextRule.pOut = NULL;
3370 : : }
3371 [ # # ]: 0 : if ( aExtBu.Tell() )
3372 : : {
3373 [ # # ]: 0 : if ( !pClientData )
3374 [ # # ][ # # ]: 0 : pClientData = new SvMemoryStream( 0x200, 0x200 );
3375 [ # # ]: 0 : ImplProgTagContainer( pClientData, &aExtBu );
3376 [ # # ][ # # ]: 0 : }
3377 : : }
3378 : 0 : }
3379 : : }
3380 : : else
3381 : : {
3382 [ # # ][ # # ]: 0 : if ( !aPropOpt.IsFontWork() )
3383 : : {
3384 [ # # ][ # # ]: 0 : if ( mnTextSize || ( nPlaceHolderAtom == EPP_PLACEHOLDER_MASTERDATE ) || ( nPlaceHolderAtom == EPP_PLACEHOLDER_NOTESBODY ) )
[ # # ]
3385 : : {
3386 : : int nInstance2;
3387 [ # # ][ # # ]: 0 : if ( ( nPlaceHolderAtom == EPP_PLACEHOLDER_MASTERDATE ) || ( nPlaceHolderAtom == EPP_PLACEHOLDER_NOTESBODY ) )
3388 : 0 : nInstance2 = 2;
3389 : : else
3390 : 0 : nInstance2 = EPP_TEXTTYPE_Other; // Text in a Shape
3391 : :
3392 [ # # ]: 0 : if ( !pClientTextBox )
3393 [ # # ][ # # ]: 0 : pClientTextBox = new SvMemoryStream( 0x200, 0x200 );
3394 : :
3395 [ # # ]: 0 : SvMemoryStream aExtBu( 0x200, 0x200 );
3396 [ # # ]: 0 : ImplWriteTextStyleAtom( *pClientTextBox, nInstance2, 0, NULL, aExtBu, &aPropOpt );
3397 [ # # ]: 0 : if ( aExtBu.Tell() )
3398 : : {
3399 [ # # ]: 0 : if ( !pClientData )
3400 [ # # ][ # # ]: 0 : pClientData = new SvMemoryStream( 0x200, 0x200 );
3401 [ # # ]: 0 : ImplProgTagContainer( pClientData, &aExtBu );
3402 [ # # ]: 0 : }
3403 : : }
3404 [ # # ]: 0 : else if ( nPlaceHolderAtom >= 19 )
3405 : : {
3406 [ # # ]: 0 : if ( !pClientTextBox )
3407 [ # # ][ # # ]: 0 : pClientTextBox = new SvMemoryStream( 12 );
3408 : :
3409 [ # # ][ # # ]: 0 : *pClientTextBox << (sal_uInt32)( EPP_TextHeaderAtom << 16 ) << (sal_uInt32)4
3410 [ # # ]: 0 : << (sal_uInt32)7;
3411 : : }
3412 : : }
3413 : : }
3414 : :
3415 [ # # ]: 0 : aPropOpt.CreateShadowProperties( mXPropSet );
3416 [ # # ]: 0 : maRect.Justify();
3417 [ # # ]: 0 : if ( mnAngle )
3418 [ # # ]: 0 : ImplFlipBoundingBox( aPropOpt );
3419 [ # # ]: 0 : aPropOpt.CreateShapeProperties( mXShape );
3420 [ # # ]: 0 : aPropOpt.Commit( *mpStrm );
3421 [ # # ]: 0 : if ( GetCurrentGroupLevel() > 0 )
3422 [ # # ]: 0 : mpPptEscherEx->AddChildAnchor( maRect );
3423 : : else
3424 [ # # ]: 0 : mpPptEscherEx->AddClientAnchor( maRect );
3425 : :
3426 [ # # ]: 0 : if ( pClientData )
3427 : : {
3428 [ # # ]: 0 : *mpStrm << (sal_uInt32)( ( ESCHER_ClientData << 16 ) | 0xf )
3429 [ # # ]: 0 : << (sal_uInt32)pClientData->Tell();
3430 : :
3431 [ # # ][ # # ]: 0 : mpStrm->Write( pClientData->GetData(), pClientData->Tell() );
3432 [ # # ][ # # ]: 0 : delete pClientData, pClientData = NULL;
3433 : : }
3434 [ # # ]: 0 : if ( pClientTextBox )
3435 : : {
3436 [ # # ]: 0 : *mpStrm << (sal_uInt32)( ( ESCHER_ClientTextbox << 16 ) | 0xf )
3437 [ # # ]: 0 : << (sal_uInt32)pClientTextBox->Tell();
3438 : :
3439 [ # # ][ # # ]: 0 : mpStrm->Write( pClientTextBox->GetData(), pClientTextBox->Tell() );
3440 [ # # ][ # # ]: 0 : delete pClientTextBox, pClientTextBox = NULL;
3441 : : }
3442 [ # # ][ # # ]: 0 : mpPptEscherEx->CloseContainer(); // ESCHER_SpContainer
[ # # ]
3443 : : }
3444 : 0 : nPrevTextStyle = mnTextStyle;
3445 : :
3446 [ # # ]: 0 : if ( bAdditionalText )
3447 : : {
3448 : 0 : bAdditionalText = sal_False;
3449 : :
3450 : 0 : ::com::sun::star::uno::Any aAny;
3451 [ # # ]: 0 : EscherPropertyContainer aPropOpt;
3452 : : mnAngle = ( PropValue::GetPropertyValue( aAny,
3453 [ # # ][ # # ]: 0 : mXPropSet, rtl::OUString( "RotateAngle" ), sal_True ) )
[ # # ]
3454 : 0 : ? *((sal_Int32*)aAny.getValue() )
3455 [ # # ]: 0 : : 0;
3456 : :
3457 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x90000 );
3458 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x100000 );
3459 [ # # ]: 0 : if ( mType == "drawing.Line" )
3460 : : {
3461 [ # # ][ # # ]: 0 : double fDist = hypot( maRect.GetWidth(), maRect.GetHeight() );
3462 : : maRect = Rectangle( Point( aTextRefPoint.X, aTextRefPoint.Y ),
3463 [ # # ]: 0 : Point( (sal_Int32)( aTextRefPoint.X + fDist ), aTextRefPoint.Y - 1 ) );
3464 [ # # ]: 0 : ImplCreateTextShape( aPropOpt, aSolverContainer, sal_False );
3465 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x60006 ); // Size Shape To Fit Text
3466 [ # # ]: 0 : if ( mnAngle < 0 )
3467 : 0 : mnAngle = ( 36000 + mnAngle ) % 36000;
3468 [ # # ]: 0 : if ( mnAngle )
3469 [ # # ]: 0 : ImplFlipBoundingBox( aPropOpt );
3470 : : }
3471 : : else
3472 : : {
3473 [ # # ]: 0 : ImplCreateTextShape( aPropOpt, aSolverContainer, sal_False );
3474 [ # # ]: 0 : if ( mnAngle < 0 )
3475 : 0 : mnAngle = ( 36000 + mnAngle ) % 36000;
3476 : : else
3477 : 0 : mnAngle = ( 36000 - ( mnAngle % 36000 ) );
3478 : :
3479 : 0 : mnAngle *= 655;
3480 : 0 : mnAngle += 0x8000;
3481 : 0 : mnAngle &=~0xffff; // nAngle auf volle Gradzahl runden
3482 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_Rotation, mnAngle );
3483 [ # # ]: 0 : mpPptEscherEx->SetGroupSnapRect( nGroupLevel, maRect );
3484 [ # # ]: 0 : mpPptEscherEx->SetGroupLogicRect( nGroupLevel, maRect );
3485 : : }
3486 [ # # ]: 0 : if ( !pClientTextBox )
3487 [ # # ][ # # ]: 0 : pClientTextBox = new SvMemoryStream( 0x200, 0x200 );
3488 : :
3489 [ # # ]: 0 : SvMemoryStream aExtBu( 0x200, 0x200 );
3490 [ # # ]: 0 : ImplWriteTextStyleAtom( *pClientTextBox, EPP_TEXTTYPE_Other, 0, NULL, aExtBu, &aPropOpt );
3491 : :
3492 [ # # ]: 0 : aPropOpt.CreateShapeProperties( mXShape );
3493 [ # # ]: 0 : aPropOpt.Commit( *mpStrm );
3494 [ # # ]: 0 : if ( GetCurrentGroupLevel() > 0 )
3495 [ # # ]: 0 : mpPptEscherEx->AddChildAnchor( maRect );
3496 : : else
3497 [ # # ]: 0 : mpPptEscherEx->AddClientAnchor( maRect );
3498 : :
3499 [ # # ]: 0 : *mpStrm << (sal_uInt32)( ( ESCHER_ClientTextbox << 16 ) | 0xf )
3500 [ # # ]: 0 : << (sal_uInt32)pClientTextBox->Tell();
3501 : :
3502 [ # # ][ # # ]: 0 : mpStrm->Write( pClientTextBox->GetData(), pClientTextBox->Tell() );
3503 [ # # ][ # # ]: 0 : delete pClientTextBox, pClientTextBox = NULL;
3504 : :
3505 [ # # ]: 0 : mpPptEscherEx->CloseContainer(); // ESCHER_SpContainer
3506 [ # # ][ # # ]: 0 : mpPptEscherEx->LeaveGroup();
[ # # ]
3507 : : }
3508 : : }
3509 [ # # ]: 0 : ClearGroupTable(); // gruppierungen wegschreiben, sofern noch irgendwelche offen sind, was eigendlich nicht sein sollte
3510 [ # # ]: 0 : nGroups = GetGroupsClosed();
3511 [ # # ][ # # ]: 0 : for ( sal_uInt32 i = 0; i < nGroups; i++, mpPptEscherEx->LeaveGroup() ) ;
3512 : 0 : mnPagesWritten++;
3513 : 0 : }
3514 : :
3515 : : // -----------------------------------------------------------------------
3516 : :
3517 : : struct CellBorder
3518 : : {
3519 : : sal_Int32 mnPos; // specifies the distance to the top/left position of the table
3520 : : sal_Int32 mnLength;
3521 : : table::BorderLine maCellBorder;
3522 : :
3523 : 0 : CellBorder() : mnPos ( 0 ), mnLength( 0 ){};
3524 : : };
3525 : :
3526 : 0 : void PPTWriter::ImplCreateCellBorder( const CellBorder* pCellBorder, sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int32 nY2 )
3527 : : {
3528 : 0 : sal_Int32 nLineWidth = pCellBorder->maCellBorder.OuterLineWidth + pCellBorder->maCellBorder.InnerLineWidth;
3529 [ # # ]: 0 : if ( nLineWidth )
3530 : : {
3531 : 0 : mnAngle = 0;
3532 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
3533 [ # # ]: 0 : EscherPropertyContainer aPropOptSp;
3534 : :
3535 [ # # ]: 0 : sal_uInt32 nId = mpPptEscherEx->GenerateShapeId();
3536 [ # # ]: 0 : mpPptEscherEx->AddShape( ESCHER_ShpInst_Line, 0xa02, nId );
3537 [ # # ]: 0 : aPropOptSp.AddOpt( ESCHER_Prop_shapePath, ESCHER_ShapeComplex );
3538 [ # # ]: 0 : aPropOptSp.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0xa0008 );
3539 [ # # ]: 0 : aPropOptSp.AddOpt( ESCHER_Prop_fshadowObscured, 0x20000 );
3540 : :
3541 : 0 : sal_uInt32 nBorderColor = pCellBorder->maCellBorder.Color & 0xff00; // green
3542 : 0 : nBorderColor |= static_cast< sal_uInt8 >( pCellBorder->maCellBorder.Color ) << 16; // red
3543 : 0 : nBorderColor |= static_cast< sal_uInt8 >( pCellBorder->maCellBorder.Color >> 16 ); // blue
3544 [ # # ]: 0 : aPropOptSp.AddOpt( ESCHER_Prop_lineColor, nBorderColor );
3545 : :
3546 [ # # ]: 0 : aPropOptSp.AddOpt( ESCHER_Prop_lineWidth, nLineWidth * 360 );
3547 [ # # ]: 0 : aPropOptSp.AddOpt( ESCHER_Prop_fc3DLightFace, 0x80000 );
3548 [ # # ]: 0 : aPropOptSp.Commit( *mpStrm );
3549 [ # # ]: 0 : mpPptEscherEx->AddAtom( 16, ESCHER_ChildAnchor );
3550 [ # # ]: 0 : *mpStrm << nX1
3551 [ # # ]: 0 : << nY1
3552 [ # # ]: 0 : << nX2
3553 [ # # ]: 0 : << nY2;
3554 [ # # ][ # # ]: 0 : mpPptEscherEx->CloseContainer();
3555 : : }
3556 : 0 : }
3557 : :
3558 : 0 : void PPTWriter::WriteCString( SvStream& rSt, const String& rString, sal_uInt32 nInstance )
3559 : : {
3560 : 0 : sal_uInt32 i, nLen = rString.Len();
3561 [ # # ]: 0 : if ( nLen )
3562 : : {
3563 : 0 : rSt << (sal_uInt32)( ( nInstance << 4 ) | ( EPP_CString << 16 ) )
3564 : 0 : << (sal_uInt32)( nLen << 1 );
3565 [ # # ]: 0 : for ( i = 0; i < nLen; i++ )
3566 : 0 : rSt << rString.GetChar( (sal_uInt16)i );
3567 : : }
3568 : 0 : }
3569 : :
3570 : 0 : void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, EscherSolverContainer& aSolverContainer,
3571 : : EscherPropertyContainer& aPropOpt )
3572 : : {
3573 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpgrContainer );
3574 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
3575 [ # # ]: 0 : mpPptEscherEx->AddAtom( 16, ESCHER_Spgr, 1 );
3576 [ # # ]: 0 : *mpStrm << (sal_Int32)maRect.Left() // Bounding box fuer die Gruppierten shapes an die sie attached werden
3577 [ # # ]: 0 : << (sal_Int32)maRect.Top()
3578 [ # # ]: 0 : << (sal_Int32)maRect.Right()
3579 [ # # ]: 0 : << (sal_Int32)maRect.Bottom();
3580 : :
3581 [ # # ]: 0 : sal_uInt32 nShapeId = mpPptEscherEx->GenerateShapeId();
3582 [ # # ]: 0 : mpPptEscherEx->AddShape( ESCHER_ShpInst_Min, 0x201, nShapeId ); // Flags: Group | Patriarch
3583 [ # # ]: 0 : aSolverContainer.AddShape( rXShape, nShapeId );
3584 [ # # ]: 0 : EscherPropertyContainer aPropOpt2;
3585 : : try
3586 : : {
3587 [ # # ][ # # ]: 0 : static const rtl::OUString sModel( "Model" );
3588 [ # # ][ # # ]: 0 : static const rtl::OUString sWidth( "Width" );
3589 [ # # ][ # # ]: 0 : static const rtl::OUString sHeight( "Height" );
3590 : :
3591 : 0 : uno::Reference< table::XTable > xTable;
3592 [ # # ][ # # ]: 0 : if ( mXPropSet->getPropertyValue( sModel ) >>= xTable )
[ # # ][ # # ]
3593 : : {
3594 [ # # ]: 0 : uno::Reference< table::XColumnRowRange > xColumnRowRange( xTable, uno::UNO_QUERY_THROW );
3595 [ # # ][ # # ]: 0 : uno::Reference< container::XIndexAccess > xColumns( xColumnRowRange->getColumns(), uno::UNO_QUERY_THROW );
[ # # ]
3596 [ # # ][ # # ]: 0 : uno::Reference< container::XIndexAccess > xRows( xColumnRowRange->getRows(), uno::UNO_QUERY_THROW );
[ # # ]
3597 [ # # ][ # # ]: 0 : sal_uInt16 nRowCount = static_cast< sal_uInt16 >( xRows->getCount() );
3598 [ # # ][ # # ]: 0 : sal_uInt16 nColumnCount = static_cast< sal_uInt16 >( xColumns->getCount() );
3599 : :
3600 [ # # ]: 0 : std::vector< std::pair< sal_Int32, sal_Int32 > > aColumns;
3601 [ # # ]: 0 : std::vector< std::pair< sal_Int32, sal_Int32 > > aRows;
3602 : :
3603 [ # # ][ # # ]: 0 : awt::Point aPosition( MapPoint( rXShape->getPosition() ) );
[ # # ]
3604 : 0 : sal_uInt32 nPosition = aPosition.X;
3605 [ # # ]: 0 : for ( sal_Int32 x = 0; x < nColumnCount; x++ )
3606 : : {
3607 [ # # ][ # # ]: 0 : uno::Reference< beans::XPropertySet > xPropSet( xColumns->getByIndex( x ), uno::UNO_QUERY_THROW );
[ # # ]
3608 : 0 : awt::Size aS( 0, 0 );
3609 [ # # ][ # # ]: 0 : xPropSet->getPropertyValue( sWidth ) >>= aS.Width;
3610 [ # # ]: 0 : awt::Size aM( MapSize( aS ) );
3611 [ # # ][ # # ]: 0 : aColumns.push_back( std::pair< sal_Int32, sal_Int32 >( nPosition, aM.Width ) );
3612 : 0 : nPosition += aM.Width;
3613 : 0 : }
3614 : :
3615 : 0 : nPosition = aPosition.Y;
3616 [ # # ]: 0 : for ( sal_Int32 y = 0; y < nRowCount; y++ )
3617 : : {
3618 [ # # ][ # # ]: 0 : uno::Reference< beans::XPropertySet > xPropSet( xRows->getByIndex( y ), uno::UNO_QUERY_THROW );
[ # # ]
3619 : 0 : awt::Size aS( 0, 0 );
3620 [ # # ][ # # ]: 0 : xPropSet->getPropertyValue( sHeight ) >>= aS.Height;
3621 [ # # ]: 0 : awt::Size aM( MapSize( aS ) );
3622 [ # # ][ # # ]: 0 : aRows.push_back( std::pair< sal_Int32, sal_Int32 >( nPosition, aM.Height ) );
3623 : 0 : nPosition += aM.Height;
3624 : 0 : }
3625 : :
3626 [ # # ]: 0 : if ( nRowCount )
3627 : : {
3628 [ # # ]: 0 : SvMemoryStream aMemStrm;
3629 : 0 : aMemStrm.ObjectOwnsMemory( sal_False );
3630 [ # # ]: 0 : aMemStrm << nRowCount
3631 [ # # ]: 0 : << nRowCount
3632 [ # # ]: 0 : << (sal_uInt16)4;
3633 : :
3634 [ # # ]: 0 : std::vector< std::pair< sal_Int32, sal_Int32 > >::const_iterator aIter( aRows.begin() );
3635 [ # # ][ # # ]: 0 : while( aIter != aRows.end() )
3636 [ # # ][ # # ]: 0 : aMemStrm << (*aIter++).second;
[ # # ]
3637 : :
3638 [ # # ]: 0 : aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x1000100 );
3639 [ # # ]: 0 : aPropOpt2.AddOpt( ESCHER_Prop_tableProperties, 1 );
3640 [ # # ][ # # ]: 0 : aPropOpt2.AddOpt( ESCHER_Prop_tableRowProperties, sal_True, aMemStrm.Tell(), static_cast< sal_uInt8* >( const_cast< void* >( aMemStrm.GetData() ) ), aMemStrm.Tell() );
3641 [ # # ]: 0 : aPropOpt.CreateShapeProperties( rXShape );
3642 [ # # ]: 0 : aPropOpt.Commit( *mpStrm );
3643 [ # # ]: 0 : aPropOpt2.Commit( *mpStrm, 3, ESCHER_UDefProp );
3644 [ # # ]: 0 : if ( GetCurrentGroupLevel() > 0 )
3645 [ # # ]: 0 : mpPptEscherEx->AddChildAnchor( maRect );
3646 : : else
3647 [ # # ]: 0 : mpPptEscherEx->AddClientAnchor( maRect );
3648 [ # # ]: 0 : mpPptEscherEx->CloseContainer();
3649 : :
3650 [ # # ]: 0 : uno::Reference< table::XCellRange > xCellRange( xTable, uno::UNO_QUERY_THROW );
3651 [ # # ][ # # ]: 0 : for( sal_Int32 nRow = 0; nRow < xRows->getCount(); nRow++ )
[ # # ]
3652 : : {
3653 [ # # ][ # # ]: 0 : for( sal_Int32 nColumn = 0; nColumn < xColumns->getCount(); nColumn++ )
[ # # ]
3654 : : {
3655 [ # # ][ # # ]: 0 : uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn, nRow ), uno::UNO_QUERY_THROW );
[ # # ]
3656 [ # # ][ # # ]: 0 : if ( !xCell->isMerged() )
[ # # ]
3657 : : {
3658 [ # # ]: 0 : sal_Int32 nLeft = aColumns[ nColumn ].first;
3659 [ # # ]: 0 : sal_Int32 nTop = aRows[ nRow ].first;
3660 [ # # ]: 0 : sal_Int32 nRight = nLeft + aColumns[ nColumn ].second;
3661 [ # # ]: 0 : sal_Int32 nBottom = nTop + aRows[ nRow ].second;
3662 : :
3663 [ # # ][ # # ]: 0 : for ( sal_Int32 nColumnSpan = 1; nColumnSpan < xCell->getColumnSpan(); nColumnSpan++ )
[ # # ]
3664 : : {
3665 : 0 : sal_uInt32 nC = nColumnSpan + nColumn;
3666 [ # # ]: 0 : if ( nC < aColumns.size() )
3667 [ # # ]: 0 : nRight += aColumns[ nC ].second;
3668 : : else
3669 : 0 : nRight = maRect.Right();
3670 : : }
3671 [ # # ][ # # ]: 0 : for ( sal_Int32 nRowSpan = 1; nRowSpan < xCell->getRowSpan(); nRowSpan++ )
[ # # ]
3672 : : {
3673 : 0 : sal_uInt32 nR = nRowSpan + nRow;
3674 [ # # ]: 0 : if ( nR < aColumns.size() )
3675 [ # # ]: 0 : nBottom += aRows[ nR ].second;
3676 : : else
3677 : 0 : nBottom = maRect.Bottom();
3678 : : }
3679 : :
3680 : 0 : mbFontIndependentLineSpacing = sal_False;
3681 [ # # ][ # # ]: 0 : mXPropSet = uno::Reference< beans::XPropertySet >( xCell, uno::UNO_QUERY_THROW );
3682 [ # # ][ # # ]: 0 : mXText = uno::Reference< text::XSimpleText >( xCell, uno::UNO_QUERY_THROW );
3683 [ # # ][ # # ]: 0 : mnTextSize = mXText->getString().getLength();
3684 : :
3685 : 0 : ::com::sun::star::uno::Any aAny;
3686 [ # # ][ # # ]: 0 : if ( GetPropertyValue( aAny, mXPropSet, rtl::OUString( "FontIndependentLineSpacing" ) ), sal_True )
[ # # ][ # # ]
3687 : 0 : aAny >>= mbFontIndependentLineSpacing;
3688 : :
3689 [ # # ]: 0 : EscherPropertyContainer aPropOptSp;
3690 [ # # ]: 0 : mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
3691 [ # # ]: 0 : ImplCreateShape( ESCHER_ShpInst_Rectangle, 0xa02, aSolverContainer ); // Flags: Connector | HasSpt | Child
3692 [ # # ]: 0 : aPropOptSp.CreateFillProperties( mXPropSet, sal_True );
3693 [ # # ]: 0 : aPropOptSp.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x90000 );
3694 [ # # ]: 0 : aPropOptSp.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
3695 [ # # ]: 0 : aPropOptSp.AddOpt( ESCHER_Prop_WrapText, ESCHER_WrapSquare );
3696 : :
3697 [ # # ]: 0 : SvMemoryStream aClientTextBox( 0x200, 0x200 );
3698 [ # # ]: 0 : SvMemoryStream aExtBu( 0x200, 0x200 );
3699 : :
3700 [ # # ]: 0 : ImplWriteTextStyleAtom( aClientTextBox, EPP_TEXTTYPE_Other, 0, NULL, aExtBu, &aPropOptSp );
3701 : :
3702 [ # # ]: 0 : aPropOptSp.Commit( *mpStrm );
3703 [ # # ]: 0 : mpPptEscherEx->AddAtom( 16, ESCHER_ChildAnchor );
3704 [ # # ]: 0 : *mpStrm << nLeft
3705 [ # # ]: 0 : << nTop
3706 [ # # ]: 0 : << nRight
3707 [ # # ]: 0 : << nBottom;
3708 : :
3709 [ # # ]: 0 : *mpStrm << (sal_uInt32)( ( ESCHER_ClientTextbox << 16 ) | 0xf )
3710 [ # # ]: 0 : << (sal_uInt32)aClientTextBox.Tell();
3711 : :
3712 [ # # ][ # # ]: 0 : mpStrm->Write( aClientTextBox.GetData(), aClientTextBox.Tell() );
3713 [ # # ][ # # ]: 0 : mpPptEscherEx->CloseContainer();
[ # # ][ # # ]
3714 : : }
3715 : 0 : }
3716 : : }
3717 : :
3718 [ # # ][ # # ]: 0 : static const rtl::OUString sTopBorder( "TopBorder" );
3719 [ # # ][ # # ]: 0 : static const rtl::OUString sBottomBorder( "BottomBorder" );
3720 [ # # ][ # # ]: 0 : static const rtl::OUString sLeftBorder( "LeftBorder" );
3721 [ # # ][ # # ]: 0 : static const rtl::OUString sRightBorder( "RightBorder" );
3722 : :
3723 : : // creating horz lines
3724 [ # # ][ # # ]: 0 : sal_Int32 nYPos = MapPoint( rXShape->getPosition() ).Y;
[ # # ]
3725 [ # # ][ # # ]: 0 : for( sal_Int32 nLine = 0; nLine < ( xRows->getCount() + 1 ); nLine++ )
[ # # ]
3726 : : {
3727 [ # # ][ # # ]: 0 : sal_Int32 nXPos = MapPoint( rXShape->getPosition() ).X;
[ # # ]
3728 [ # # ]: 0 : std::vector< CellBorder > vCellBorders;
3729 [ # # ][ # # ]: 0 : for( sal_Int32 nColumn = 0; nColumn < xColumns->getCount(); nColumn++ )
[ # # ]
3730 : : {
3731 [ # # ][ # # ]: 0 : uno::Reference< beans::XPropertySet > xPropSet( xColumns->getByIndex( nColumn ), uno::UNO_QUERY_THROW );
[ # # ]
3732 : 0 : awt::Size aS( 0, 0 );
3733 [ # # ][ # # ]: 0 : xPropSet->getPropertyValue( sWidth ) >>= aS.Width;
3734 [ # # ]: 0 : awt::Size aM( MapSize( aS ) );
3735 : :
3736 : 0 : CellBorder aCellBorder;
3737 : 0 : aCellBorder.mnPos = nXPos;
3738 : 0 : aCellBorder.mnLength = aM.Width;
3739 [ # # ][ # # ]: 0 : if ( nLine < xRows->getCount() )
[ # # ]
3740 : : { // top border
3741 [ # # ][ # # ]: 0 : uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn, nLine ), uno::UNO_QUERY_THROW );
[ # # ]
3742 [ # # ]: 0 : uno::Reference< beans::XPropertySet > xPropSet2( xCell, uno::UNO_QUERY_THROW );
3743 : 0 : table::BorderLine aBorderLine;
3744 [ # # ][ # # ]: 0 : if ( xPropSet2->getPropertyValue( sTopBorder ) >>= aBorderLine )
[ # # ][ # # ]
3745 : 0 : aCellBorder.maCellBorder = aBorderLine;
3746 : : }
3747 [ # # ]: 0 : if ( nLine )
3748 : : { // bottom border
3749 [ # # ][ # # ]: 0 : uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nColumn, nLine - 1 ), uno::UNO_QUERY_THROW );
[ # # ]
3750 [ # # ]: 0 : uno::Reference< beans::XPropertySet > xPropSet2( xCell, uno::UNO_QUERY_THROW );
3751 : 0 : table::BorderLine aBorderLine;
3752 [ # # ][ # # ]: 0 : if ( xPropSet2->getPropertyValue( sBottomBorder ) >>= aBorderLine )
[ # # ][ # # ]
3753 : 0 : aCellBorder.maCellBorder = aBorderLine;
3754 : : }
3755 [ # # ]: 0 : vCellBorders.push_back( aCellBorder );
3756 : 0 : nXPos += aM.Width;
3757 : 0 : }
3758 [ # # ]: 0 : std::vector< CellBorder >::const_iterator aCellBorderIter( vCellBorders.begin() );
3759 [ # # ][ # # ]: 0 : while( aCellBorderIter != vCellBorders.end() )
3760 : : {
3761 : 0 : ImplCreateCellBorder( &*aCellBorderIter, aCellBorderIter->mnPos, nYPos,
3762 [ # # ]: 0 : static_cast< sal_Int32 >( aCellBorderIter->mnPos + aCellBorderIter->mnLength ), nYPos );
3763 : 0 : ++aCellBorderIter;
3764 : : }
3765 [ # # ][ # # ]: 0 : if ( nLine < xRows->getCount() )
[ # # ]
3766 : : {
3767 [ # # ][ # # ]: 0 : uno::Reference< beans::XPropertySet > xPropSet( xRows->getByIndex( nLine ), uno::UNO_QUERY_THROW );
[ # # ]
3768 : 0 : awt::Size aS( 0, 0 );
3769 [ # # ][ # # ]: 0 : xPropSet->getPropertyValue( sHeight ) >>= aS.Height;
3770 [ # # ]: 0 : awt::Size aM( MapSize( aS ) );
3771 : 0 : nYPos += aM.Height;
3772 : : }
3773 : 0 : }
3774 : :
3775 : : // creating vertical lines
3776 [ # # ][ # # ]: 0 : sal_Int32 nXPos = MapPoint( rXShape->getPosition() ).X;
[ # # ]
3777 [ # # ][ # # ]: 0 : for( sal_Int32 nLine = 0; nLine < ( xColumns->getCount() + 1 ); nLine++ )
[ # # ]
3778 : : {
3779 [ # # ][ # # ]: 0 : nYPos = MapPoint( rXShape->getPosition() ).Y;
[ # # ]
3780 [ # # ]: 0 : std::vector< CellBorder > vCellBorders;
3781 [ # # ][ # # ]: 0 : for( sal_Int32 nRow = 0; nRow < xRows->getCount(); nRow++ )
[ # # ]
3782 : : {
3783 [ # # ][ # # ]: 0 : uno::Reference< beans::XPropertySet > xPropSet( xRows->getByIndex( nRow ), uno::UNO_QUERY_THROW );
[ # # ]
3784 : 0 : awt::Size aS( 0, 0 );
3785 [ # # ][ # # ]: 0 : xPropSet->getPropertyValue( sHeight ) >>= aS.Height;
3786 [ # # ]: 0 : awt::Size aM( MapSize( aS ) );
3787 : :
3788 : 0 : CellBorder aCellBorder;
3789 : 0 : aCellBorder.mnPos = nYPos;
3790 : 0 : aCellBorder.mnLength = aM.Height;
3791 [ # # ][ # # ]: 0 : if ( nLine < xColumns->getCount() )
[ # # ]
3792 : : { // left border
3793 [ # # ][ # # ]: 0 : uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nLine, nRow ), uno::UNO_QUERY_THROW );
[ # # ]
3794 [ # # ]: 0 : uno::Reference< beans::XPropertySet > xCellSet( xCell, uno::UNO_QUERY_THROW );
3795 : 0 : table::BorderLine aBorderLine;
3796 [ # # ][ # # ]: 0 : if ( xCellSet->getPropertyValue( sLeftBorder ) >>= aBorderLine )
[ # # ][ # # ]
3797 : 0 : aCellBorder.maCellBorder = aBorderLine;
3798 : : }
3799 [ # # ]: 0 : if ( nLine )
3800 : : { // right border
3801 [ # # ][ # # ]: 0 : uno::Reference< table::XMergeableCell > xCell( xCellRange->getCellByPosition( nLine - 1, nRow ), uno::UNO_QUERY_THROW );
[ # # ]
3802 [ # # ]: 0 : uno::Reference< beans::XPropertySet > xCellSet( xCell, uno::UNO_QUERY_THROW );
3803 : 0 : table::BorderLine aBorderLine;
3804 [ # # ][ # # ]: 0 : if ( xCellSet->getPropertyValue( sRightBorder ) >>= aBorderLine )
[ # # ][ # # ]
3805 : 0 : aCellBorder.maCellBorder = aBorderLine;
3806 : : }
3807 [ # # ]: 0 : vCellBorders.push_back( aCellBorder );
3808 : 0 : nYPos += aM.Height;
3809 : 0 : }
3810 [ # # ]: 0 : std::vector< CellBorder >::const_iterator aCellBorderIter( vCellBorders.begin() );
3811 [ # # ][ # # ]: 0 : while( aCellBorderIter != vCellBorders.end() )
3812 : : {
3813 : 0 : ImplCreateCellBorder( &*aCellBorderIter, nXPos, aCellBorderIter->mnPos,
3814 [ # # ]: 0 : nXPos, static_cast< sal_Int32 >( aCellBorderIter->mnPos + aCellBorderIter->mnLength ) );
3815 : 0 : ++aCellBorderIter;
3816 : : }
3817 [ # # ][ # # ]: 0 : if ( nLine < xColumns->getCount() )
[ # # ]
3818 : : {
3819 [ # # ][ # # ]: 0 : uno::Reference< beans::XPropertySet > xPropSet( xColumns->getByIndex( nLine ), uno::UNO_QUERY_THROW );
[ # # ]
3820 : 0 : awt::Size aS( 0, 0 );
3821 [ # # ][ # # ]: 0 : xPropSet->getPropertyValue( sWidth ) >>= aS.Width;
3822 [ # # ]: 0 : awt::Size aM( MapSize( aS ) );
3823 : 0 : nXPos += aM.Width;
3824 : : }
3825 [ # # ]: 0 : }
3826 : 0 : }
3827 [ # # ]: 0 : }
3828 : : }
3829 [ # # ]: 0 : catch( uno::Exception& )
3830 : : {
3831 : : }
3832 [ # # ][ # # ]: 0 : mpPptEscherEx->CloseContainer();
3833 : 0 : }
3834 : :
3835 : : //----------------------------------------------------------------------------------------------------------
3836 : :
3837 : 0 : void TextObjBinary::Write( SvStream* pStrm )
3838 : : {
3839 : 0 : sal_uInt32 nSize, nPos = pStrm->Tell();
3840 : 0 : *pStrm << (sal_uInt32)( EPP_TextCharsAtom << 16 ) << (sal_uInt32)0;
3841 [ # # ]: 0 : for ( sal_uInt32 i = 0; i < ParagraphCount(); ++i )
3842 : 0 : GetParagraph(i)->Write( pStrm );
3843 : 0 : nSize = pStrm->Tell() - nPos;
3844 : 0 : pStrm->SeekRel( - ( (sal_Int32)nSize - 4 ) );
3845 : 0 : *pStrm << (sal_uInt32)( nSize - 8 );
3846 : 0 : pStrm->SeekRel( nSize - 8 );
3847 : 0 : }
3848 : :
3849 : 0 : void TextObjBinary::WriteTextSpecInfo( SvStream* pStrm )
3850 : : {
3851 : 0 : sal_uInt32 nCharactersLeft( Count() );
3852 [ # # ]: 0 : if ( nCharactersLeft >= 1 )
3853 : : {
3854 [ # # ]: 0 : EscherExAtom aAnimationInfoAtom( *pStrm, EPP_TextSpecInfoAtom, 0, 0 );
3855 [ # # ][ # # ]: 0 : for ( sal_uInt32 i = 0; nCharactersLeft && i < ParagraphCount(); ++i )
[ # # ]
3856 : : {
3857 [ # # ]: 0 : ParagraphObj* pPtr = GetParagraph(i);
3858 [ # # ][ # # ]: 0 : for ( ParagraphObj::const_iterator it = pPtr->begin(); nCharactersLeft && it != pPtr->end(); ++it )
[ # # ][ # # ]
[ # # ]
[ # # # # ]
3859 : : {
3860 : 0 : PortionObj* pPortion = *it;
3861 [ # # ]: 0 : sal_Int32 nPortionSize = pPortion->mnTextSize >= nCharactersLeft ? nCharactersLeft : pPortion->mnTextSize;
3862 : 0 : sal_Int32 nFlags = 7;
3863 : 0 : nCharactersLeft -= nPortionSize;
3864 [ # # ]: 0 : *pStrm << static_cast< sal_uInt32 >( nPortionSize )
3865 [ # # ]: 0 : << nFlags
3866 [ # # ]: 0 : << static_cast< sal_Int16 >( 1 ) // spellinfo -> needs rechecking
3867 [ # # ][ # # ]: 0 : << static_cast< sal_Int16 >( MsLangId::convertLocaleToLanguageWithFallback( pPortion->meCharLocale ) )
3868 [ # # ]: 0 : << static_cast< sal_Int16 >( 0 ); // alt language
3869 : : }
3870 : : }
3871 [ # # ]: 0 : if ( nCharactersLeft )
3872 [ # # ][ # # ]: 0 : *pStrm << nCharactersLeft << static_cast< sal_Int32 >( 1 ) << static_cast< sal_Int16 >( 1 );
[ # # ][ # # ]
3873 : :
3874 : : }
3875 [ + - ][ + - ]: 9 : }
3876 : :
3877 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|