summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-12-22 18:29:36 +0100
committerAndras Timar <andras.timar@collabora.com>2015-01-05 16:16:36 +0000
commit5f2ceec031f06cf0b2756c8c699585e28ea1fcb8 (patch)
tree339b861e91e2e5c293f638c19bbd29baea199a67 /oox
parentd284e07bf30ce9f07000500f14d589ce386649c2 (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/13604 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 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