diff options
author | Thorsten Behrens <tbehrens@suse.com> | 2013-10-07 11:16:04 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-09 13:23:01 +0000 |
commit | 34c5218c9a33d136bbb9b1e2f91f0f4557ab3fad (patch) | |
tree | 4888886640ef952ed52bff3df2601bd30d4655cb | |
parent | 128a744416bd0c23738ce285ad3e8d7c3e26fbc5 (diff) |
Fix fdo#70220 Superscript not imported from pptx.
Import works now, though EditEngine still fscks up font scaling -
seems for CharEscapementHeight to work, there has to be reference,
non-scaled text in the same portion ...
Change-Id: I5505ae83bd6b700ebe8c3465beec40a4df2efb78
Reviewed-on: https://gerrit.libreoffice.org/6154
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | include/oox/drawingml/textcharacterproperties.hxx | 1 | ||||
-rw-r--r-- | oox/source/drawingml/textcharacterproperties.cxx | 7 | ||||
-rw-r--r-- | oox/source/drawingml/textcharacterpropertiescontext.cxx | 39 |
3 files changed, 23 insertions, 24 deletions
diff --git a/include/oox/drawingml/textcharacterproperties.hxx b/include/oox/drawingml/textcharacterproperties.hxx index 99792fe7725d..2e519c95f5b8 100644 --- a/include/oox/drawingml/textcharacterproperties.hxx +++ b/include/oox/drawingml/textcharacterproperties.hxx @@ -46,6 +46,7 @@ struct TextCharacterProperties OptValue< sal_Int32 > moHeight; OptValue< sal_Int32 > moSpacing; OptValue< sal_Int32 > moUnderline; + OptValue< sal_Int32 > moBaseline; OptValue< sal_Int32 > moStrikeout; OptValue< sal_Int32 > moCaseMap; OptValue< bool > moBold; diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx index 11a551a5294b..a5fe786d3542 100644 --- a/oox/source/drawingml/textcharacterproperties.cxx +++ b/oox/source/drawingml/textcharacterproperties.cxx @@ -21,6 +21,7 @@ #include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/awt/FontSlant.hpp> #include <com/sun/star/awt/FontWeight.hpp> +#include <editeng/escapementitem.hxx> #include "oox/helper/helper.hxx" #include "oox/helper/propertyset.hxx" #include "oox/core/xmlfilterbase.hxx" @@ -51,6 +52,7 @@ void TextCharacterProperties::assignUsed( const TextCharacterProperties& rSource moHeight.assignIfUsed( rSourceProps.moHeight ); moSpacing.assignIfUsed( rSourceProps.moSpacing ); moUnderline.assignIfUsed( rSourceProps.moUnderline ); + moBaseline.assignIfUsed( rSourceProps.moBaseline ); moStrikeout.assignIfUsed( rSourceProps.moStrikeout ); moCaseMap.assignIfUsed( rSourceProps.moCaseMap ); moBold.assignIfUsed( rSourceProps.moBold ); @@ -123,6 +125,11 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil rPropMap[ PROP_CharStrikeout ] <<= GetFontStrikeout( moStrikeout.get( XML_noStrike ) ); rPropMap[ PROP_CharCaseMap ] <<= GetCaseMap( moCaseMap.get( XML_none ) ); + if( !bUseOptional || moBaseline.has() ) { + rPropMap[ PROP_CharEscapement ] <<= sal_Int16(moBaseline.get( 0 ) / 1000); + rPropMap[ PROP_CharEscapementHeight ] <<= sal_Int8(DFLT_ESC_PROP); + } + if( !bUseOptional || moBold.has() ) { float fWeight = moBold.get( false ) ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL; rPropMap[ PROP_CharWeight ] <<= fWeight; diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx index ed2ef6e88726..862255813249 100644 --- a/oox/source/drawingml/textcharacterpropertiescontext.cxx +++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx @@ -55,36 +55,27 @@ TextCharacterPropertiesContext::TextCharacterPropertiesContext( mrTextCharacterProperties.moUnderline = aAttribs.getToken( XML_u ); if ( aAttribs.hasAttribute( XML_strike ) ) mrTextCharacterProperties.moStrikeout = aAttribs.getToken( XML_strike ); + if ( aAttribs.hasAttribute( XML_baseline ) ) + mrTextCharacterProperties.moBaseline = aAttribs.getInteger( XML_baseline ); -// mrTextCharacterProperties.moCaseMap = aAttribs.getToken( XML_cap ); if ( aAttribs.hasAttribute( XML_b ) ) mrTextCharacterProperties.moBold = aAttribs.getBool( XML_b ); if ( aAttribs.hasAttribute( XML_i ) ) mrTextCharacterProperties.moItalic = aAttribs.getBool( XML_i ); -// TODO -/* todo: we need to be able to iterate over the XFastAttributes - - // ST_TextNonNegativePoint - const OUString sCharKerning( "CharKerning" ); - //case A_TOKEN( kern ): - - // ST_TextLanguageID - OUString sAltLang = rXAttributes->getOptionalValue( XML_altLang ); - - case A_TOKEN( kumimoji ): // xsd:boolean - break; - case A_TOKEN( spc ): // ST_TextPoint - case A_TOKEN( normalizeH ): // xsd:boolean - case A_TOKEN( baseline ): // ST_Percentage - case A_TOKEN( noProof ): // xsd:boolean - case A_TOKEN( dirty ): // xsd:boolean - case A_TOKEN( err ): // xsd:boolean - case A_TOKEN( smtClean ): // xsd:boolean - case A_TOKEN( smtId ): // xsd:unsignedInt - break; -*/ - + /* TODO / unhandled so far: + XML_cap + A_TOKEN( kern ) + XML_altLang + A_TOKEN( kumimoji ) + A_TOKEN( spc ) + A_TOKEN( normalizeH ) + A_TOKEN( noProof ) + A_TOKEN( dirty ) + A_TOKEN( err ) + A_TOKEN( smtClean ) + A_TOKEN( smtId ) + */ } TextCharacterPropertiesContext::~TextCharacterPropertiesContext() |