summaryrefslogtreecommitdiff
path: root/oox/source/drawingml/textparagraph.cxx
diff options
context:
space:
mode:
authorRadek Doulik <rodo@novell.com>2011-03-30 17:32:44 +0200
committerRadek Doulik <rodo@novell.com>2011-03-30 17:36:59 +0200
commit97ed03b04834e56ab0b9360eef6638e7cfc56076 (patch)
treea97a2fdcfe10ef62b0c1cf2ba80147de19aedf91 /oox/source/drawingml/textparagraph.cxx
parent4912be984caa4d33e9d43d61d70e34449c355d8e (diff)
fix import of percentual top and bottom paragraph margins
Diffstat (limited to 'oox/source/drawingml/textparagraph.cxx')
-rw-r--r--oox/source/drawingml/textparagraph.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/oox/source/drawingml/textparagraph.cxx b/oox/source/drawingml/textparagraph.cxx
index 9ca2650bc7ba..54ae10ba1f80 100644
--- a/oox/source/drawingml/textparagraph.cxx
+++ b/oox/source/drawingml/textparagraph.cxx
@@ -80,19 +80,23 @@ void TextParagraph::insertAt(
xText->insertControlCharacter( xStart, ControlCharacter::APPEND_PARAGRAPH, sal_False );
xAt->gotoEnd( sal_True );
}
+
+ sal_Int32 nCharHeight = 0;
if ( maRuns.begin() == maRuns.end() )
{
PropertySet aPropSet( xStart );
TextCharacterProperties aTextCharacterProps( aTextCharacterStyle );
aTextCharacterProps.assignUsed( maEndProperties );
+ if ( aTextCharacterProps.moHeight.has() )
+ nCharHeight = aTextCharacterProps.moHeight.get();
aTextCharacterProps.pushToPropSet( aPropSet, rFilterBase );
}
else
{
for( TextRunVector::const_iterator aIt = maRuns.begin(), aEnd = maRuns.end(); aIt != aEnd; ++aIt )
{
- (*aIt)->insertAt( rFilterBase, xText, xAt, aTextCharacterStyle );
+ nCharHeight = std::max< sal_Int32 >( nCharHeight, (*aIt)->insertAt( rFilterBase, xText, xAt, aTextCharacterStyle ) );
nParagraphSize += (*aIt)->getText().getLength();
}
}
@@ -100,11 +104,11 @@ void TextParagraph::insertAt(
PropertyMap aioBulletList;
Reference< XPropertySet > xProps( xStart, UNO_QUERY);
- float fCharacterSize = 18;
+ float fCharacterSize = nCharHeight > 0 ? GetFontHeight( nCharHeight ) : 18;
if ( pTextParagraphStyle.get() )
{
pTextParagraphStyle->pushToPropSet( &rFilterBase, xProps, aioBulletList, NULL, sal_False, fCharacterSize );
- fCharacterSize = pTextParagraphStyle->getCharHeightPoints( 18 );
+ fCharacterSize = pTextParagraphStyle->getCharHeightPoints( fCharacterSize );
}
maProperties.pushToPropSet( &rFilterBase, xProps, aioBulletList, &pTextParagraphStyle->getBulletList(), sal_True, fCharacterSize );