diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-12-22 16:36:27 +0100 |
---|---|---|
committer | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-12-22 16:36:59 +0100 |
commit | 7a64988dbc7a1542aa38f0e8f9a8a47941fbc67d (patch) | |
tree | 8359b96d20f356c946d192e3c6c474208a7376ce /oox | |
parent | bnc#862510: PPTX import: Wrong text color inside shape (diff) | |
download | core-7a64988dbc7a1542aa38f0e8f9a8a47941fbc67d.tar.gz core-7a64988dbc7a1542aa38f0e8f9a8a47941fbc67d.zip |
bnc#862510: PPTX import: Wrong text vertical adjustment inside shape.
When alignment is not specified, it should be set to the
default "left" value just on time, when properties are
pushed to the property set, otherwise uninitialized value
is better.
Change-Id: Ic294c5d7cc477f7515aea1c071ad9b67275c012d
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/textparagraphproperties.cxx | 12 | ||||
-rw-r--r-- | oox/source/drawingml/textparagraphpropertiescontext.cxx | 5 |
2 files changed, 16 insertions, 1 deletions
diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx index 22bab141121b..a4797f35d7e8 100644 --- a/oox/source/drawingml/textparagraphproperties.cxx +++ b/oox/source/drawingml/textparagraphproperties.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/style/TabStop.hpp> #include <com/sun/star/text/PositionAndSpaceMode.hpp> +#include <com/sun/star/style/ParagraphAdjust.hpp> #include <osl/diagnose.h> @@ -381,6 +382,8 @@ void TextParagraphProperties::apply( const TextParagraphProperties& rSourceProps moFirstLineIndentation = rSourceProps.moFirstLineIndentation; if( rSourceProps.mnLevel ) mnLevel = rSourceProps.mnLevel; + if( rSourceProps.moParaAdjust ) + moParaAdjust = rSourceProps.moParaAdjust; } void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* pFilterBase, @@ -478,6 +481,15 @@ void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* p aPropSet.setProperty( PROP_ParaTabStops, aSeq ); } } + + if ( moParaAdjust ) + { + aPropSet.setProperty( PROP_ParaAdjust, moParaAdjust.get()); + } + else + { + aPropSet.setProperty( PROP_ParaAdjust, com::sun::star::style::ParagraphAdjust_LEFT); + } } float TextParagraphProperties::getCharHeightPoints( float fDefault ) const diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx b/oox/source/drawingml/textparagraphpropertiescontext.cxx index 6d51ee5ca537..06c6625bd178 100644 --- a/oox/source/drawingml/textparagraphpropertiescontext.cxx +++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx @@ -54,7 +54,10 @@ TextParagraphPropertiesContext::TextParagraphPropertiesContext( ContextHandler2H PropertyMap& rPropertyMap( mrTextParagraphProperties.getTextParagraphPropertyMap() ); // ST_TextAlignType - rPropertyMap.setProperty( PROP_ParaAdjust, GetParaAdjust( rAttribs.getToken( XML_algn, XML_l ) )); + if ( rAttribs.hasAttribute( XML_algn ) ) + { + mrTextParagraphProperties.getParaAdjust() = GetParaAdjust( rAttribs.getToken( XML_algn, XML_l ) ); + } // TODO see to do the same with RubyAdjust // ST_Coordinate32 |