Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include "drawingml/textparagraphproperties.hxx"
21 :
22 : #include <com/sun/star/text/XNumberingRulesSupplier.hpp>
23 : #include <com/sun/star/container/XIndexReplace.hpp>
24 : #include <com/sun/star/text/HoriOrientation.hpp>
25 : #include <com/sun/star/awt/FontDescriptor.hpp>
26 : #include <com/sun/star/awt/XBitmap.hpp>
27 : #include <com/sun/star/graphic/XGraphic.hpp>
28 : #include <com/sun/star/beans/PropertyValue.hpp>
29 : #include <com/sun/star/style/TabStop.hpp>
30 : #include <com/sun/star/text/PositionAndSpaceMode.hpp>
31 :
32 : #include "oox/helper/helper.hxx"
33 : #include "oox/helper/propertyset.hxx"
34 : #include "oox/core/xmlfilterbase.hxx"
35 : #include "oox/drawingml/drawingmltypes.hxx"
36 :
37 : #if OSL_DEBUG_LEVEL > 0
38 : #include <vcl/unohelp.hxx>
39 : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
40 : #include <com/sun/star/text/XText.hpp>
41 : #include <com/sun/star/drawing/XShape.hpp>
42 : #include <comphelper/genericpropertyset.hxx>
43 : #include <oox/ppt/pptimport.hxx>
44 : #include <oox/ppt/slidepersist.hxx>
45 : #endif
46 :
47 : using namespace ::oox::core;
48 : using namespace ::com::sun::star::uno;
49 : using namespace ::com::sun::star::beans;
50 : using namespace ::com::sun::star::style;
51 : using namespace ::com::sun::star::text;
52 : using namespace ::com::sun::star::container;
53 : using ::com::sun::star::awt::FontDescriptor;
54 :
55 : namespace oox { namespace drawingml {
56 :
57 572492 : BulletList::BulletList( )
58 572492 : : maBulletColorPtr( new Color() )
59 : {
60 572492 : }
61 :
62 6864 : bool BulletList::is() const
63 : {
64 6864 : return mnNumberingType.hasValue();
65 : }
66 :
67 922 : void BulletList::setBulletChar( const OUString & sChar )
68 : {
69 922 : mnNumberingType <<= NumberingType::CHAR_SPECIAL;
70 922 : msBulletChar <<= sChar;
71 922 : }
72 :
73 0 : void BulletList::setGraphic( ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& rXGraphic )
74 : {
75 0 : mnNumberingType <<= NumberingType::BITMAP;
76 0 : maGraphic <<= rXGraphic;
77 0 : }
78 :
79 604 : void BulletList::setNone( )
80 : {
81 604 : mnNumberingType <<= NumberingType::NUMBER_NONE;
82 604 : }
83 :
84 0 : void BulletList::setSuffixParenBoth()
85 : {
86 0 : msNumberingSuffix <<= OUString( ")" );
87 0 : msNumberingPrefix <<= OUString( "(" );
88 0 : }
89 :
90 0 : void BulletList::setSuffixParenRight()
91 : {
92 0 : msNumberingSuffix <<= OUString( ")" );
93 0 : msNumberingPrefix <<= OUString();
94 0 : }
95 :
96 0 : void BulletList::setSuffixPeriod()
97 : {
98 0 : msNumberingSuffix <<= OUString( "." );
99 0 : msNumberingPrefix <<= OUString();
100 0 : }
101 :
102 0 : void BulletList::setSuffixNone()
103 : {
104 0 : msNumberingSuffix <<= OUString();
105 0 : msNumberingPrefix <<= OUString();
106 0 : }
107 :
108 0 : void BulletList::setSuffixMinusRight()
109 : {
110 0 : msNumberingSuffix <<= OUString( "-" );
111 0 : msNumberingPrefix <<= OUString();
112 0 : }
113 :
114 0 : void BulletList::setType( sal_Int32 nType )
115 : {
116 : OSL_ASSERT((nType & sal_Int32(0xFFFF0000))==0);
117 : // OSL_TRACE( "OOX: set list numbering type %d", nType);
118 0 : switch( nType )
119 : {
120 : case XML_alphaLcParenBoth:
121 0 : mnNumberingType <<= NumberingType::CHARS_LOWER_LETTER;
122 0 : setSuffixParenBoth();
123 0 : break;
124 : case XML_alphaLcParenR:
125 0 : mnNumberingType <<= NumberingType::CHARS_LOWER_LETTER;
126 0 : setSuffixParenRight();
127 0 : break;
128 : case XML_alphaLcPeriod:
129 0 : mnNumberingType <<= NumberingType::CHARS_LOWER_LETTER;
130 0 : setSuffixPeriod();
131 0 : break;
132 : case XML_alphaUcParenBoth:
133 0 : mnNumberingType <<= NumberingType::CHARS_UPPER_LETTER;
134 0 : setSuffixParenBoth();
135 0 : break;
136 : case XML_alphaUcParenR:
137 0 : mnNumberingType <<= NumberingType::CHARS_UPPER_LETTER;
138 0 : setSuffixParenRight();
139 0 : break;
140 : case XML_alphaUcPeriod:
141 0 : mnNumberingType <<= NumberingType::CHARS_UPPER_LETTER;
142 0 : setSuffixPeriod();
143 0 : break;
144 : case XML_arabic1Minus:
145 : case XML_arabic2Minus:
146 : case XML_arabicDbPeriod:
147 : case XML_arabicDbPlain:
148 : // TODO
149 0 : break;
150 : case XML_arabicParenBoth:
151 0 : mnNumberingType <<= NumberingType::ARABIC;
152 0 : setSuffixParenBoth();
153 0 : break;
154 : case XML_arabicParenR:
155 0 : mnNumberingType <<= NumberingType::ARABIC;
156 0 : setSuffixParenRight();
157 0 : break;
158 : case XML_arabicPeriod:
159 0 : mnNumberingType <<= NumberingType::ARABIC;
160 0 : setSuffixPeriod();
161 0 : break;
162 : case XML_arabicPlain:
163 0 : mnNumberingType <<= NumberingType::ARABIC;
164 0 : setSuffixNone();
165 0 : break;
166 : case XML_circleNumDbPlain:
167 : case XML_circleNumWdBlackPlain:
168 : case XML_circleNumWdWhitePlain:
169 0 : mnNumberingType <<= NumberingType::CIRCLE_NUMBER;
170 0 : break;
171 : case XML_ea1ChsPeriod:
172 0 : mnNumberingType <<= NumberingType::NUMBER_UPPER_ZH;
173 0 : setSuffixPeriod();
174 0 : break;
175 : case XML_ea1ChsPlain:
176 0 : mnNumberingType <<= NumberingType::NUMBER_UPPER_ZH;
177 0 : setSuffixNone();
178 0 : break;
179 : case XML_ea1ChtPeriod:
180 0 : mnNumberingType <<= NumberingType::NUMBER_UPPER_ZH_TW;
181 0 : setSuffixPeriod();
182 0 : break;
183 : case XML_ea1ChtPlain:
184 0 : mnNumberingType <<= NumberingType::NUMBER_UPPER_ZH_TW;
185 0 : setSuffixNone();
186 0 : break;
187 : case XML_ea1JpnChsDbPeriod:
188 : case XML_ea1JpnKorPeriod:
189 : case XML_ea1JpnKorPlain:
190 0 : break;
191 : case XML_hebrew2Minus:
192 0 : mnNumberingType <<= NumberingType::CHARS_HEBREW;
193 0 : setSuffixMinusRight();
194 0 : break;
195 : case XML_hindiAlpha1Period:
196 : case XML_hindiAlphaPeriod:
197 : case XML_hindiNumParenR:
198 : case XML_hindiNumPeriod:
199 : // TODO
200 0 : break;
201 : case XML_romanLcParenBoth:
202 0 : mnNumberingType <<= NumberingType::ROMAN_LOWER;
203 0 : setSuffixParenBoth();
204 0 : break;
205 : case XML_romanLcParenR:
206 0 : mnNumberingType <<= NumberingType::ROMAN_LOWER;
207 0 : setSuffixParenRight();
208 0 : break;
209 : case XML_romanLcPeriod:
210 0 : mnNumberingType <<= NumberingType::ROMAN_LOWER;
211 0 : setSuffixPeriod();
212 0 : break;
213 : case XML_romanUcParenBoth:
214 0 : mnNumberingType <<= NumberingType::ROMAN_UPPER;
215 0 : setSuffixParenBoth();
216 0 : break;
217 : case XML_romanUcParenR:
218 0 : mnNumberingType <<= NumberingType::ROMAN_UPPER;
219 0 : setSuffixParenRight();
220 0 : break;
221 : case XML_romanUcPeriod:
222 0 : mnNumberingType <<= NumberingType::ROMAN_UPPER;
223 0 : setSuffixPeriod();
224 0 : break;
225 : case XML_thaiAlphaParenBoth:
226 : case XML_thaiNumParenBoth:
227 0 : mnNumberingType <<= NumberingType::CHARS_THAI;
228 0 : setSuffixParenBoth();
229 0 : break;
230 : case XML_thaiAlphaParenR:
231 : case XML_thaiNumParenR:
232 0 : mnNumberingType <<= NumberingType::CHARS_THAI;
233 0 : setSuffixParenRight();
234 0 : break;
235 : case XML_thaiAlphaPeriod:
236 : case XML_thaiNumPeriod:
237 0 : mnNumberingType <<= NumberingType::CHARS_THAI;
238 0 : setSuffixPeriod();
239 0 : break;
240 : }
241 0 : }
242 :
243 312 : void BulletList::setBulletSize(sal_Int16 nSize)
244 : {
245 312 : mnSize <<= nSize;
246 312 : }
247 :
248 0 : void BulletList::setFontSize(sal_Int16 nSize)
249 : {
250 0 : mnFontSize <<= nSize;
251 0 : }
252 :
253 110464 : void BulletList::apply( const BulletList& rSource )
254 : {
255 110464 : if ( rSource.maBulletColorPtr->isUsed() )
256 258 : maBulletColorPtr = rSource.maBulletColorPtr;
257 110464 : if ( rSource.mbBulletColorFollowText.hasValue() )
258 4 : mbBulletColorFollowText = rSource.mbBulletColorFollowText;
259 110464 : if ( rSource.mbBulletFontFollowText.hasValue() )
260 236 : mbBulletFontFollowText = rSource.mbBulletFontFollowText;
261 110464 : maBulletFont.assignIfUsed( rSource.maBulletFont );
262 110464 : if ( rSource.msBulletChar.hasValue() )
263 2688 : msBulletChar = rSource.msBulletChar;
264 110464 : if ( rSource.mnStartAt.hasValue() )
265 0 : mnStartAt = rSource.mnStartAt;
266 110464 : if ( rSource.mnNumberingType.hasValue() )
267 4470 : mnNumberingType = rSource.mnNumberingType;
268 110464 : if ( rSource.msNumberingPrefix.hasValue() )
269 0 : msNumberingPrefix = rSource.msNumberingPrefix;
270 110464 : if ( rSource.msNumberingSuffix.hasValue() )
271 0 : msNumberingSuffix = rSource.msNumberingSuffix;
272 110464 : if ( rSource.mnSize.hasValue() )
273 276 : mnSize = rSource.mnSize;
274 110464 : if ( rSource.mnFontSize.hasValue() )
275 0 : mnFontSize = rSource.mnFontSize;
276 110464 : if ( rSource.maStyleName.hasValue() )
277 17324 : maStyleName = rSource.maStyleName;
278 110464 : if ( rSource.maGraphic.hasValue() )
279 0 : maGraphic = rSource.maGraphic;
280 110464 : }
281 :
282 2328 : void BulletList::pushToPropMap( const ::oox::core::XmlFilterBase* pFilterBase, PropertyMap& rPropMap ) const
283 : {
284 2328 : if( msNumberingPrefix.hasValue() )
285 0 : rPropMap.setProperty( PROP_Prefix, msNumberingPrefix);
286 2328 : if( msNumberingSuffix.hasValue() )
287 0 : rPropMap.setProperty( PROP_Suffix, msNumberingSuffix);
288 2328 : if( mnStartAt.hasValue() )
289 0 : rPropMap.setProperty( PROP_StartWith, mnStartAt);
290 2328 : rPropMap.setProperty( PROP_Adjust, HoriOrientation::LEFT);
291 :
292 2328 : if( mnNumberingType.hasValue() )
293 948 : rPropMap.setProperty( PROP_NumberingType, mnNumberingType);
294 :
295 2328 : OUString aBulletFontName;
296 2328 : sal_Int16 nBulletFontPitch = 0;
297 2328 : sal_Int16 nBulletFontFamily = 0;
298 2328 : bool bSymbolFont = false;
299 2328 : if( pFilterBase) {
300 2328 : if (maBulletFont.getFontData( aBulletFontName, nBulletFontPitch, nBulletFontFamily, *pFilterBase ) )
301 : {
302 776 : FontDescriptor aFontDesc;
303 776 : sal_Int16 nFontSize = 0;
304 776 : if( mnFontSize >>= nFontSize )
305 0 : aFontDesc.Height = nFontSize;
306 :
307 : // TODO move the to the TextFont struct.
308 776 : aFontDesc.Name = aBulletFontName;
309 776 : aFontDesc.Pitch = nBulletFontPitch;
310 776 : aFontDesc.Family = nBulletFontFamily;
311 2254 : if ( aBulletFontName.equalsIgnoreAsciiCase("Wingdings") ||
312 1404 : aBulletFontName.equalsIgnoreAsciiCase("Wingdings 2") ||
313 1404 : aBulletFontName.equalsIgnoreAsciiCase("Wingdings 3") ||
314 1404 : aBulletFontName.equalsIgnoreAsciiCase("Monotype Sorts") ||
315 1404 : aBulletFontName.equalsIgnoreAsciiCase("Monotype Sorts 2") ||
316 1404 : aBulletFontName.equalsIgnoreAsciiCase("Webdings") ||
317 1404 : aBulletFontName.equalsIgnoreAsciiCase("StarBats") ||
318 2180 : aBulletFontName.equalsIgnoreAsciiCase("StarMath") ||
319 702 : aBulletFontName.equalsIgnoreAsciiCase("ZapfDingbats") ) {
320 74 : aFontDesc.CharSet = RTL_TEXTENCODING_SYMBOL;
321 74 : bSymbolFont = true;
322 : }
323 776 : rPropMap.setProperty( PROP_BulletFont, aFontDesc);
324 776 : rPropMap.setProperty( PROP_BulletFontName, aBulletFontName);
325 : }
326 : }
327 2328 : if ( msBulletChar.hasValue() ) {
328 780 : OUString sBuChar;
329 :
330 780 : msBulletChar >>= sBuChar;
331 :
332 780 : if( pFilterBase && sBuChar.getLength() == 1 && maBulletFont.getFontData( aBulletFontName, nBulletFontPitch, nBulletFontFamily, *pFilterBase ) && bSymbolFont )
333 : {
334 0 : sal_Unicode nBuChar = sBuChar.toChar();
335 0 : nBuChar &= 0x00ff;
336 0 : nBuChar |= 0xf000;
337 0 : sBuChar = OUString( &nBuChar, 1 );
338 : }
339 :
340 780 : rPropMap.setProperty( PROP_BulletChar, sBuChar);
341 : }
342 2328 : if ( maGraphic.hasValue() )
343 : {
344 0 : Reference< com::sun::star::awt::XBitmap > xBitmap( maGraphic, UNO_QUERY );
345 0 : if ( xBitmap.is() )
346 0 : rPropMap.setProperty( PROP_Graphic, xBitmap);
347 : }
348 2328 : if( mnSize.hasValue() )
349 108 : rPropMap.setProperty( PROP_BulletRelSize, mnSize);
350 2328 : if ( maStyleName.hasValue() )
351 2166 : rPropMap.setProperty( PROP_CharStyleName, maStyleName);
352 2328 : if (pFilterBase ) {
353 2328 : if ( maBulletColorPtr->isUsed() )
354 96 : rPropMap.setProperty( PROP_BulletColor, maBulletColorPtr->getColor( pFilterBase->getGraphicHelper() ));
355 2328 : }
356 2328 : }
357 :
358 572492 : TextParagraphProperties::TextParagraphProperties()
359 572492 : : mnLevel( 0 )
360 : {
361 572492 : }
362 :
363 588080 : TextParagraphProperties::~TextParagraphProperties()
364 : {
365 588080 : }
366 :
367 110464 : void TextParagraphProperties::apply( const TextParagraphProperties& rSourceProps )
368 : {
369 110464 : maTextParagraphPropertyMap.assignAll( rSourceProps.maTextParagraphPropertyMap );
370 110464 : maBulletList.apply( rSourceProps.maBulletList );
371 110464 : maTextCharacterProperties.assignUsed( rSourceProps.maTextCharacterProperties );
372 110464 : if ( rSourceProps.maParaTopMargin.bHasValue )
373 6466 : maParaTopMargin = rSourceProps.maParaTopMargin;
374 110464 : if ( rSourceProps.maParaBottomMargin.bHasValue )
375 11372 : maParaBottomMargin = rSourceProps.maParaBottomMargin;
376 110464 : if ( rSourceProps.moParaLeftMargin )
377 13974 : moParaLeftMargin = rSourceProps.moParaLeftMargin;
378 110464 : if ( rSourceProps.moFirstLineIndentation )
379 4256 : moFirstLineIndentation = rSourceProps.moFirstLineIndentation;
380 110464 : if( rSourceProps.mnLevel )
381 130 : mnLevel = rSourceProps.mnLevel;
382 110464 : }
383 :
384 2328 : void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* pFilterBase,
385 : const Reference < XPropertySet >& xPropSet, PropertyMap& rioBulletMap, const BulletList* pMasterBuList, bool bApplyBulletMap, float fCharacterSize,
386 : bool bPushDefaultValues ) const
387 : {
388 2328 : PropertySet aPropSet( xPropSet );
389 2328 : aPropSet.setProperties( maTextParagraphPropertyMap );
390 :
391 2328 : sal_Int32 nNumberingType = NumberingType::NUMBER_NONE;
392 2328 : if ( maBulletList.mnNumberingType.hasValue() )
393 948 : maBulletList.mnNumberingType >>= nNumberingType;
394 1380 : else if ( pMasterBuList && pMasterBuList->mnNumberingType.hasValue() )
395 0 : pMasterBuList->mnNumberingType >>= nNumberingType;
396 2328 : if ( nNumberingType == NumberingType::NUMBER_NONE )
397 2200 : aPropSet.setProperty< sal_Int16 >( PROP_NumberingLevel, -1 );
398 :
399 2328 : maBulletList.pushToPropMap( pFilterBase, rioBulletMap );
400 :
401 2328 : if ( maParaTopMargin.bHasValue || bPushDefaultValues )
402 2192 : aPropSet.setProperty( PROP_ParaTopMargin, maParaTopMargin.toMargin( fCharacterSize != 0.0 ? fCharacterSize : getCharHeightPoints ( 12.0 ) ) );
403 2328 : if ( maParaBottomMargin.bHasValue || bPushDefaultValues )
404 2192 : aPropSet.setProperty( PROP_ParaBottomMargin, maParaBottomMargin.toMargin( fCharacterSize != 0.0 ? fCharacterSize : getCharHeightPoints ( 12.0 ) ) );
405 2328 : if ( nNumberingType == NumberingType::BITMAP )
406 : {
407 0 : fCharacterSize = getCharHeightPoints( fCharacterSize );
408 :
409 0 : com::sun::star::awt::Size aBulletSize;
410 0 : aBulletSize.Width = aBulletSize.Height = static_cast< sal_Int32 >( ( fCharacterSize * ( 2540.0 / 72.0 ) * 0.8 ) );
411 0 : rioBulletMap.setProperty( PROP_GraphicSize, aBulletSize);
412 : }
413 :
414 4656 : boost::optional< sal_Int32 > noParaLeftMargin( moParaLeftMargin );
415 4656 : boost::optional< sal_Int32 > noFirstLineIndentation( moFirstLineIndentation );
416 :
417 2328 : if ( nNumberingType != NumberingType::NUMBER_NONE )
418 : {
419 128 : if ( noParaLeftMargin )
420 : {
421 118 : aPropSet.setProperty( PROP_ParaLeftMargin, static_cast< sal_Int32 >(0));
422 118 : rioBulletMap.setProperty( PROP_LeftMargin, static_cast< sal_Int32 >( *noParaLeftMargin ));
423 118 : noParaLeftMargin = boost::none;
424 : }
425 128 : if ( noFirstLineIndentation )
426 : {
427 : // Force Paragraph property as zero - impress seems to use the value from previous
428 : // (non) bullet line if not set to zero explicitly :(
429 118 : aPropSet.setProperty( PROP_ParaFirstLineIndent, static_cast< sal_Int32 >(0) );
430 118 : rioBulletMap.setProperty( PROP_FirstLineOffset, static_cast< sal_Int32 >( *noFirstLineIndentation ));
431 118 : noFirstLineIndentation = boost::none;
432 : }
433 128 : if ( nNumberingType != NumberingType::BITMAP && !rioBulletMap.hasProperty( PROP_BulletColor ) && pFilterBase )
434 8 : rioBulletMap.setProperty( PROP_BulletColor, static_cast< sal_Int32 >( maTextCharacterProperties.maCharColor.getColor( pFilterBase->getGraphicHelper())));
435 : }
436 :
437 2328 : if ( bApplyBulletMap )
438 : {
439 2328 : Reference< XIndexReplace > xNumRule;
440 2328 : aPropSet.getProperty( xNumRule, PROP_NumberingRules );
441 : OSL_ENSURE( xNumRule.is(), "can't get Numbering rules");
442 :
443 : try
444 : {
445 2328 : if( xNumRule.is() )
446 : {
447 2328 : if( !rioBulletMap.empty() )
448 : {
449 : // fix default bullet size to be 100%
450 2328 : if( !rioBulletMap.hasProperty( PROP_BulletRelSize ) )
451 2220 : rioBulletMap.setProperty( PROP_BulletRelSize, static_cast< sal_Int16 >( 100 ));
452 2328 : Sequence< PropertyValue > aBulletPropSeq = rioBulletMap.makePropertyValueSequence();
453 2328 : xNumRule->replaceByIndex( getLevel(), makeAny( aBulletPropSeq ) );
454 : }
455 :
456 2328 : aPropSet.setProperty( PROP_NumberingRules, xNumRule );
457 : }
458 : }
459 0 : catch (const Exception &)
460 : {
461 : // Don't warn for now, expected to fail for Writer.
462 2328 : }
463 : }
464 2328 : if ( noParaLeftMargin )
465 1072 : aPropSet.setProperty( PROP_ParaLeftMargin, sal_Int32( *noParaLeftMargin ) );
466 2328 : if ( noFirstLineIndentation )
467 : {
468 732 : aPropSet.setProperty( PROP_ParaFirstLineIndent, *noFirstLineIndentation );
469 732 : if( bPushDefaultValues )
470 : {
471 : // Reset TabStops - these would be auto calculated by Impress
472 732 : TabStop aTabStop;
473 732 : aTabStop.Position = 0;
474 732 : Sequence< TabStop > aSeq(1);
475 732 : aSeq[0] = aTabStop;
476 732 : aPropSet.setProperty( PROP_ParaTabStops, aSeq );
477 : }
478 2328 : }
479 2328 : }
480 :
481 154 : float TextParagraphProperties::getCharHeightPoints( float fDefault ) const
482 : {
483 154 : return maTextCharacterProperties.getCharHeightPoints( fDefault );
484 : }
485 :
486 : #ifdef DBG_UTIL
487 : // Note: Please don't remove this function. This is required for
488 : // debugging pptx import problems.
489 : void TextParagraphProperties::dump() const
490 : {
491 : Reference< ::com::sun::star::drawing::XShape > xShape( oox::ppt::PowerPointImport::mpDebugFilterBase->getModelFactory()->createInstance( "com.sun.star.presentation.TitleTextShape" ), UNO_QUERY );
492 : Reference< ::com::sun::star::text::XText > xText( xShape, UNO_QUERY );
493 :
494 : Reference< com::sun::star::drawing::XDrawPage > xDebugPage(ppt::SlidePersist::mxDebugPage.get(), UNO_QUERY);
495 : if (xDebugPage.is())
496 : xDebugPage->add( xShape );
497 :
498 : PropertyMap emptyMap;
499 :
500 : const OUString sText = "debug";
501 : xText->setString( sText );
502 : Reference< ::com::sun::star::text::XTextCursor > xStart( xText->createTextCursor(), UNO_QUERY );
503 : Reference< ::com::sun::star::text::XTextRange > xRange( xStart, UNO_QUERY );
504 : xStart->gotoEnd( sal_True );
505 : Reference< XPropertySet > xPropSet( xRange, UNO_QUERY );
506 : pushToPropSet( NULL, xPropSet, emptyMap, NULL, false, 0 );
507 : PropertySet pSet( xPropSet );
508 : pSet.dump();
509 : }
510 : #endif
511 408 : } }
512 :
513 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|