summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-12-22 18:30:43 +0100
committerAndras Timar <andras.timar@collabora.com>2015-01-05 13:54:31 +0000
commit50c9a8bf7473bf369ccd7e3060ef732ac6cf58f5 (patch)
tree8f8d94a9f585c09cd4e6879eb4eb5ad889b8d4ff /oox
parent4679ba35ad02a720789a8d0c571fafe4122d91a2 (diff)
bnc#862510: PPTX import: Wrong text horizontal 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. (cherry picked from commit 7a64988dbc7a1542aa38f0e8f9a8a47941fbc67d) Conflicts: sd/qa/unit/import-tests.cxx Conflicts: sd/qa/unit/import-tests.cxx Change-Id: Ic294c5d7cc477f7515aea1c071ad9b67275c012d Reviewed-on: https://gerrit.libreoffice.org/13607 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/textparagraphproperties.cxx12
-rw-r--r--oox/source/drawingml/textparagraphpropertiescontext.cxx5
2 files changed, 16 insertions, 1 deletions
diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx
index 76e162218240..1e260666b3db 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 "oox/helper/helper.hxx"
#include "oox/helper/propertyset.hxx"
@@ -380,6 +381,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,
@@ -477,6 +480,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 e592841000e2..390cb1658be0 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