summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-02-05 10:06:40 +0100
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-02-05 10:48:37 +0100
commita468e386695f470f65616adde4673aa43a562c51 (patch)
treed15bde185f02eeb3e65de4a74720db75921d3f9f /oox
parentc53dd7ea947e0233d98edd3e5d2f07c65ea61f30 (diff)
drawingML import: paragraph adjustment inside group shape
Change-Id: I875cb1f12c9f81d329d7fe9cd3aa32a4cd818573
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/textbodycontext.cxx1
-rw-r--r--oox/source/drawingml/textparagraphpropertiescontext.cxx21
2 files changed, 22 insertions, 0 deletions
diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx
index b9921e093a33..48cf3ec5e72b 100644
--- a/oox/source/drawingml/textbodycontext.cxx
+++ b/oox/source/drawingml/textbodycontext.cxx
@@ -83,6 +83,7 @@ ContextHandlerRef TextParagraphContext::onCreateContext( sal_Int32 aElementToken
return new TextFieldContext( *this, rAttribs, *pField );
}
case A_TOKEN( pPr ):
+ case OOX_TOKEN( doc, pPr ):
return new TextParagraphPropertiesContext( *this, rAttribs, mrParagraph.getProperties() );
case A_TOKEN( endParaRPr ):
return new TextCharacterPropertiesContext( *this, rAttribs, mrParagraph.getEndProperties() );
diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx b/oox/source/drawingml/textparagraphpropertiescontext.cxx
index 4ec6b655fbeb..aca1d787ba92 100644
--- a/oox/source/drawingml/textparagraphpropertiescontext.cxx
+++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx
@@ -21,6 +21,7 @@
#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/awt/FontDescriptor.hpp>
+#include <com/sun/star/style/ParagraphAdjust.hpp>
#include "oox/drawingml/colorchoicecontext.hxx"
#include "oox/drawingml/textcharacterpropertiescontext.hxx"
@@ -153,6 +154,9 @@ TextParagraphPropertiesContext::~TextParagraphPropertiesContext()
sal_Int16 nLevel = mrTextParagraphProperties.getLevel();
rPropertyMap[ PROP_NumberingLevel ] <<= nLevel;
rPropertyMap[ PROP_NumberingIsNumber ] <<= sal_True;
+
+ if( mrTextParagraphProperties.getParaAdjust() )
+ rPropertyMap[ PROP_ParaAdjust ] <<= mrTextParagraphProperties.getParaAdjust().get();
}
// --------------------------------------------------------------------
@@ -238,6 +242,23 @@ ContextHandlerRef TextParagraphPropertiesContext::onCreateContext( sal_Int32 aEl
return new TextTabStopListContext( *this, maTabList );
case A_TOKEN( defRPr ): // CT_TextCharacterProperties
return new TextCharacterPropertiesContext( *this, rAttribs, mrTextParagraphProperties.getTextCharacterProperties() );
+ case OOX_TOKEN( doc, jc ):
+ {
+ OptValue< OUString > oParaAdjust = rAttribs.getString( OOX_TOKEN(doc, val) );
+ if( oParaAdjust.has() && !oParaAdjust.get().isEmpty() )
+ {
+ const OUString& sParaAdjust = oParaAdjust.get();
+ if( sParaAdjust == "left" )
+ mrTextParagraphProperties.setParaAdjust(ParagraphAdjust_LEFT);
+ else if ( sParaAdjust == "right" )
+ mrTextParagraphProperties.setParaAdjust(ParagraphAdjust_RIGHT);
+ else if ( sParaAdjust == "center" )
+ mrTextParagraphProperties.setParaAdjust(ParagraphAdjust_CENTER);
+ else if ( sParaAdjust == "both" )
+ mrTextParagraphProperties.setParaAdjust(ParagraphAdjust_BLOCK);
+ }
+ }
+ break;
}
return this;
}