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