diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-01-03 12:07:30 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-01-03 12:39:26 +0100 |
commit | 92518d513fe021be58a0bbeb04fd9306eb23ebda (patch) | |
tree | 17b9fdcb9aedde2b59167c916918d51b4d65dd33 /oox | |
parent | 51145fa54451a7a068df30af0f7319b25104d1e6 (diff) |
drawingML import: fix default character height of WPG rectangles
The problem was that due to setting it to 18 in oox, the rectangle
didn't inherit the default 11 from the document.
Change-Id: I05c3b9c1d64eec58695e2039651a5f015df1f9e4
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/shape.cxx | 9 | ||||
-rw-r--r-- | oox/source/shape/WpgContext.cxx | 5 |
2 files changed, 9 insertions, 5 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index a6e61a7ddeae..46dedecf6682 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -82,7 +82,7 @@ namespace oox { namespace drawingml { // ============================================================================ -Shape::Shape( const sal_Char* pServiceName ) +Shape::Shape( const sal_Char* pServiceName, bool bDefaultHeight ) : mbIsChild( false ) , mpLinePropertiesPtr( new LineProperties ) , mpFillPropertiesPtr( new FillProperties ) @@ -103,7 +103,7 @@ Shape::Shape( const sal_Char* pServiceName ) { if ( pServiceName ) msServiceName = OUString::createFromAscii( pServiceName ); - setDefaults(); + setDefaults(bDefaultHeight); } Shape::Shape( const ShapePtr& pSourceShape ) @@ -151,7 +151,7 @@ table::TablePropertiesPtr Shape::getTableProperties() return mpTablePropertiesPtr; } -void Shape::setDefaults() +void Shape::setDefaults(bool bHeight) { maDefaultShapeProperties[ PROP_TextAutoGrowHeight ] <<= false; maDefaultShapeProperties[ PROP_TextWordWrap ] <<= true; @@ -159,7 +159,8 @@ void Shape::setDefaults() maDefaultShapeProperties[ PROP_TextUpperDistance ] <<= static_cast< sal_Int32 >( 125 ); maDefaultShapeProperties[ PROP_TextRightDistance ] <<= static_cast< sal_Int32 >( 250 ); maDefaultShapeProperties[ PROP_TextLowerDistance ] <<= static_cast< sal_Int32 >( 125 ); - maDefaultShapeProperties[ PROP_CharHeight ] <<= static_cast< float >( 18.0 ); + if (bHeight) + maDefaultShapeProperties[ PROP_CharHeight ] <<= static_cast< float >( 18.0 ); maDefaultShapeProperties[ PROP_TextVerticalAdjust ] <<= TextVerticalAdjust_TOP; maDefaultShapeProperties[ PROP_ParaAdjust ] <<= static_cast< sal_Int16 >( ParagraphAdjust_LEFT ); // check for RTL? } diff --git a/oox/source/shape/WpgContext.cxx b/oox/source/shape/WpgContext.cxx index 39bb4709b6a6..d66b51864eb8 100644 --- a/oox/source/shape/WpgContext.cxx +++ b/oox/source/shape/WpgContext.cxx @@ -46,7 +46,10 @@ oox::core::ContextHandlerRef WpgContext::onCreateContext(sal_Int32 nElementToken break; case XML_wsp: { - oox::drawingml::ShapePtr pShape(new oox::drawingml::Shape("com.sun.star.drawing.CustomShape")); + // Don't set default character height, Writer has its own way to set + // the default, and if we don't set it here, editeng properly inherits + // it. + oox::drawingml::ShapePtr pShape(new oox::drawingml::Shape("com.sun.star.drawing.CustomShape", /*bDefaultHeight=*/false)); return new oox::drawingml::ShapeContext(*this, mpShape, pShape); } break; |