diff options
author | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2013-11-29 11:01:21 +0100 |
---|---|---|
committer | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2013-12-04 18:52:03 +0100 |
commit | 458b89b303145085a1745fe408f0e860686d7220 (patch) | |
tree | 1055720585b716d525df2cf743a5e1cc8222fbb9 /sw | |
parent | 9e47df8fd7c3cb1dcf556e009cec2d37b928d9b0 (diff) |
fdo#64232: Fix and preserve eastAsiaTheme attribute
The attribute eastAsiaTheme was not being processed properly (the
derived theme font was being assigned to complex-script instead of
eastAsia), so this patch fixes that and it also preserves the value
of the theme itself.
Change-Id: I1a91ab2080eb2bc79f41fda9ae4bf7afb05f69a3
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 3cb24aef5ef4..c8b4b9b2880d 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -6242,6 +6242,7 @@ void DocxAttributeOutput::CharGrabBag( const SfxGrabBagItem& rItem ) // get original font names and check if they have changed during the edition sal_Bool bWriteCSTheme = sal_True; sal_Bool bWriteAsciiTheme = sal_True; + sal_Bool bWriteEastAsiaTheme = sal_True; if ( m_pFontsAttrList ) { OUString sFontName; @@ -6259,6 +6260,12 @@ void DocxAttributeOutput::CharGrabBag( const SfxGrabBagItem& rItem ) bWriteAsciiTheme = ( m_pFontsAttrList->getOptionalValue( FSNS( XML_w, XML_ascii ) ) == sFontName ); } + else if ( i->first == "CharThemeFontNameEastAsia" ) + { + if ( i->second >>= sFontName ) + bWriteEastAsiaTheme = + ( m_pFontsAttrList->getOptionalValue( FSNS( XML_w, XML_eastAsia ) ) == sFontName ); + } } } @@ -6282,6 +6289,14 @@ void DocxAttributeOutput::CharGrabBag( const SfxGrabBagItem& rItem ) m_pFontsAttrList->add( FSNS( XML_w, XML_cstheme ), OUStringToOString( str, RTL_TEXTENCODING_UTF8 ) ); } + else if ( i->first == "CharThemeNameEastAsia" && bWriteEastAsiaTheme ) + { + i->second >>= str; + if (!m_pFontsAttrList) + m_pFontsAttrList = m_pSerializer->createAttrList(); + m_pFontsAttrList->add( FSNS( XML_w, XML_eastAsiaTheme ), + OUStringToOString( str, RTL_TEXTENCODING_UTF8 ) ); + } else if ( i->first == "CharThemeNameHAnsi" && bWriteAsciiTheme ) // this is not a mistake: in LibO we don't directly support the hAnsi family // of attributes so we save the same value from ascii attributes instead @@ -6293,7 +6308,8 @@ void DocxAttributeOutput::CharGrabBag( const SfxGrabBagItem& rItem ) OUStringToOString( str, RTL_TEXTENCODING_UTF8 ) ); } else if( i->first == "CharThemeFontNameCs" || - i->first == "CharThemeFontNameAscii" ) + i->first == "CharThemeFontNameAscii" || + i->first == "CharThemeFontNameEastAsia" ) { // just skip these, they were processed before } |