diff options
author | Radek Doulik <rodo@novell.com> | 2010-10-08 15:00:50 +0200 |
---|---|---|
committer | Radek Doulik <rodo@novell.com> | 2010-10-08 15:00:50 +0200 |
commit | a57a4078fcd9a0490bd661e3ced6fcbbe69fae73 (patch) | |
tree | f1c696c5f79c4249814c343023bf006cdd841808 /oox/source/drawingml/textbodypropertiescontext.cxx | |
parent | 166bd174a855c160e925fe2329d8d5428d889693 (diff) |
oox-pptx-import-fix-placeholder-text-style.diff: fix placeholders style.
n#592906, n#479834
Diffstat (limited to 'oox/source/drawingml/textbodypropertiescontext.cxx')
-rw-r--r-- | oox/source/drawingml/textbodypropertiescontext.cxx | 59 |
1 files changed, 32 insertions, 27 deletions
diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx index 4a54386fca60..29af79217a0c 100644 --- a/oox/source/drawingml/textbodypropertiescontext.cxx +++ b/oox/source/drawingml/textbodypropertiescontext.cxx @@ -89,23 +89,26 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler& rParent, } // ST_TextAnchoringType - drawing::TextVerticalAdjust eVA( drawing::TextVerticalAdjust_TOP ); - switch( xAttributes->getOptionalValueToken( XML_anchor, XML_t ) ) - { - case XML_b : eVA = drawing::TextVerticalAdjust_BOTTOM; break; - case XML_dist : - case XML_just : - case XML_ctr : eVA = drawing::TextVerticalAdjust_CENTER; break; - default: - case XML_t : eVA = drawing::TextVerticalAdjust_TOP; break; + if( xAttributes->hasAttribute( XML_anchor ) ) { + drawing::TextVerticalAdjust eVA( drawing::TextVerticalAdjust_TOP ); + switch( xAttributes->getOptionalValueToken( XML_anchor, XML_t ) ) + { + case XML_b : eVA = drawing::TextVerticalAdjust_BOTTOM; break; + case XML_dist : + case XML_just : + case XML_ctr : eVA = drawing::TextVerticalAdjust_CENTER; break; + default: + case XML_t : eVA = drawing::TextVerticalAdjust_TOP; break; + } + mrTextBodyProp.maPropertyMap[ PROP_TextVerticalAdjust ] <<= eVA; } - mrTextBodyProp.maPropertyMap[ PROP_TextVerticalAdjust ] <<= eVA; bool bAnchorCenter = aAttribs.getBool( XML_anchorCtr, false ); - if( bAnchorCenter ) - mrTextBodyProp.maPropertyMap[ PROP_TextHorizontalAdjust ] <<= - TextHorizontalAdjust_CENTER; - + if( xAttributes->hasAttribute( XML_anchorCtr ) ) { + if( bAnchorCenter ) + mrTextBodyProp.maPropertyMap[ PROP_TextHorizontalAdjust ] <<= + TextHorizontalAdjust_CENTER; + } // bool bCompatLineSpacing = aAttribs.getBool( XML_compatLnSpc, false ); // bool bForceAA = aAttribs.getBool( XML_forceAA, false ); // bool bFromWordArt = aAttribs.getBool( XML_fromWordArt, false ); @@ -128,19 +131,21 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler& rParent, // bool bUpRight = aAttribs.getBool( XML_upright, 0 ); // ST_TextVerticalType - mrTextBodyProp.moVert = aAttribs.getToken( XML_vert ); - bool bRtl = aAttribs.getBool( XML_rtl, false ); - sal_Int32 tVert = mrTextBodyProp.moVert.get( XML_horz ); - if( tVert == XML_vert || tVert == XML_eaVert || tVert == XML_vert270 || tVert == XML_mongolianVert ) { - mrTextBodyProp.maPropertyMap[ PROP_TextWritingMode ] - <<= WritingMode_TB_RL; - // workaround for TB_LR as using WritingMode2 doesn't work - if( !bAnchorCenter ) - mrTextBodyProp.maPropertyMap[ PROP_TextHorizontalAdjust ] <<= - TextHorizontalAdjust_LEFT; - } else - mrTextBodyProp.maPropertyMap[ PROP_TextWritingMode ] - <<= ( bRtl ? WritingMode_RL_TB : WritingMode_LR_TB ); + if( xAttributes->hasAttribute( XML_vert ) ) { + mrTextBodyProp.moVert = aAttribs.getToken( XML_vert ); + bool bRtl = aAttribs.getBool( XML_rtl, false ); + sal_Int32 tVert = mrTextBodyProp.moVert.get( XML_horz ); + if( tVert == XML_vert || tVert == XML_eaVert || tVert == XML_vert270 || tVert == XML_mongolianVert ) { + mrTextBodyProp.maPropertyMap[ PROP_TextWritingMode ] + <<= WritingMode_TB_RL; + // workaround for TB_LR as using WritingMode2 doesn't work + if( !bAnchorCenter ) + mrTextBodyProp.maPropertyMap[ PROP_TextHorizontalAdjust ] <<= + TextHorizontalAdjust_LEFT; + } else + mrTextBodyProp.maPropertyMap[ PROP_TextWritingMode ] + <<= ( bRtl ? WritingMode_RL_TB : WritingMode_LR_TB ); + } } // -------------------------------------------------------------------- |