Kaydet (Commit) 840a8573 authored tarafından Thorsten Behrens's avatar Thorsten Behrens Kaydeden (comit) Thorsten Behrens

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
üst 49bae3b3
...@@ -46,6 +46,7 @@ struct TextCharacterProperties ...@@ -46,6 +46,7 @@ struct TextCharacterProperties
OptValue< sal_Int32 > moHeight; OptValue< sal_Int32 > moHeight;
OptValue< sal_Int32 > moSpacing; OptValue< sal_Int32 > moSpacing;
OptValue< sal_Int32 > moUnderline; OptValue< sal_Int32 > moUnderline;
OptValue< sal_Int32 > moBaseline;
OptValue< sal_Int32 > moStrikeout; OptValue< sal_Int32 > moStrikeout;
OptValue< sal_Int32 > moCaseMap; OptValue< sal_Int32 > moCaseMap;
OptValue< bool > moBold; OptValue< bool > moBold;
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <com/sun/star/awt/FontSlant.hpp> #include <com/sun/star/awt/FontSlant.hpp>
#include <com/sun/star/awt/FontWeight.hpp> #include <com/sun/star/awt/FontWeight.hpp>
#include <i18nlangtag/languagetag.hxx> #include <i18nlangtag/languagetag.hxx>
#include <editeng/escapementitem.hxx>
#include "oox/helper/helper.hxx" #include "oox/helper/helper.hxx"
#include "oox/helper/propertyset.hxx" #include "oox/helper/propertyset.hxx"
#include "oox/core/xmlfilterbase.hxx" #include "oox/core/xmlfilterbase.hxx"
...@@ -52,6 +53,7 @@ void TextCharacterProperties::assignUsed( const TextCharacterProperties& rSource ...@@ -52,6 +53,7 @@ void TextCharacterProperties::assignUsed( const TextCharacterProperties& rSource
moHeight.assignIfUsed( rSourceProps.moHeight ); moHeight.assignIfUsed( rSourceProps.moHeight );
moSpacing.assignIfUsed( rSourceProps.moSpacing ); moSpacing.assignIfUsed( rSourceProps.moSpacing );
moUnderline.assignIfUsed( rSourceProps.moUnderline ); moUnderline.assignIfUsed( rSourceProps.moUnderline );
moBaseline.assignIfUsed( rSourceProps.moBaseline );
moStrikeout.assignIfUsed( rSourceProps.moStrikeout ); moStrikeout.assignIfUsed( rSourceProps.moStrikeout );
moCaseMap.assignIfUsed( rSourceProps.moCaseMap ); moCaseMap.assignIfUsed( rSourceProps.moCaseMap );
moBold.assignIfUsed( rSourceProps.moBold ); moBold.assignIfUsed( rSourceProps.moBold );
...@@ -114,6 +116,11 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil ...@@ -114,6 +116,11 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
rPropMap[ PROP_CharStrikeout ] <<= GetFontStrikeout( moStrikeout.get( XML_noStrike ) ); rPropMap[ PROP_CharStrikeout ] <<= GetFontStrikeout( moStrikeout.get( XML_noStrike ) );
rPropMap[ PROP_CharCaseMap ] <<= GetCaseMap( moCaseMap.get( XML_none ) ); 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() ) { if( !bUseOptional || moBold.has() ) {
float fWeight = moBold.get( false ) ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL; float fWeight = moBold.get( false ) ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL;
rPropMap[ PROP_CharWeight ] <<= fWeight; rPropMap[ PROP_CharWeight ] <<= fWeight;
......
...@@ -52,36 +52,27 @@ TextCharacterPropertiesContext::TextCharacterPropertiesContext( ...@@ -52,36 +52,27 @@ TextCharacterPropertiesContext::TextCharacterPropertiesContext(
mrTextCharacterProperties.moUnderline = rAttribs.getToken( XML_u ); mrTextCharacterProperties.moUnderline = rAttribs.getToken( XML_u );
if ( rAttribs.hasAttribute( XML_strike ) ) if ( rAttribs.hasAttribute( XML_strike ) )
mrTextCharacterProperties.moStrikeout = rAttribs.getToken( XML_strike ); mrTextCharacterProperties.moStrikeout = rAttribs.getToken( XML_strike );
if ( aAttribs.hasAttribute( XML_baseline ) )
mrTextCharacterProperties.moBaseline = aAttribs.getInteger( XML_baseline );
// mrTextCharacterProperties.moCaseMap = rAttribs.getToken( XML_cap );
if ( rAttribs.hasAttribute( XML_b ) ) if ( rAttribs.hasAttribute( XML_b ) )
mrTextCharacterProperties.moBold = rAttribs.getBool( XML_b ); mrTextCharacterProperties.moBold = rAttribs.getBool( XML_b );
if ( rAttribs.hasAttribute( XML_i ) ) if ( rAttribs.hasAttribute( XML_i ) )
mrTextCharacterProperties.moItalic = rAttribs.getBool( XML_i ); mrTextCharacterProperties.moItalic = rAttribs.getBool( XML_i );
// TODO /* TODO / unhandled so far:
/* todo: we need to be able to iterate over the XFastAttributes XML_cap
A_TOKEN( kern )
// ST_TextNonNegativePoint XML_altLang
const OUString sCharKerning( "CharKerning" ); A_TOKEN( kumimoji )
//case A_TOKEN( kern ): A_TOKEN( spc )
A_TOKEN( normalizeH )
// ST_TextLanguageID A_TOKEN( noProof )
OUString sAltLang = rAttribs.getString( XML_altLang ).get(); A_TOKEN( dirty )
A_TOKEN( err )
case A_TOKEN( kumimoji ): // xsd:boolean A_TOKEN( smtClean )
break; A_TOKEN( smtId )
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;
*/
} }
TextCharacterPropertiesContext::~TextCharacterPropertiesContext() TextCharacterPropertiesContext::~TextCharacterPropertiesContext()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment