Kaydet (Commit) ae8530c5 authored tarafından Luboš Luňák's avatar Luboš Luňák

write also w:characterSet

üst 6e045a02
......@@ -2552,15 +2552,23 @@ void DocxAttributeOutput::FontAlternateName( const String& rName ) const
FSEND );
}
void DocxAttributeOutput::FontCharset( sal_uInt8 nCharSet ) const
void DocxAttributeOutput::FontCharset( sal_uInt8 nCharSet, rtl_TextEncoding nEncoding ) const
{
FastAttributeList* pAttr = m_pSerializer->createAttrList();
OString aCharSet( OString::valueOf( sal_Int32( nCharSet ), 16 ) );
if ( aCharSet.getLength() == 1 )
aCharSet = OString( "0" ) + aCharSet;
pAttr->add( FSNS( XML_w, XML_val ), aCharSet.getStr());
m_pSerializer->singleElementNS( XML_w, XML_charset,
FSNS( XML_w, XML_val ), aCharSet.getStr(),
FSEND );
const DocxExport& rExport = dynamic_cast< const DocxExport& >( GetExport() );
if( rExport.GetFilter().getVersion( ) != oox::core::ECMA_DIALECT )
{
if( const char* charset = rtl_getMimeCharsetFromTextEncoding( nEncoding ))
pAttr->add( FSNS( XML_w, XML_characterSet ), charset );
}
m_pSerializer->singleElementNS( XML_w, XML_charset, XFastAttributeListRef( pAttr ));
}
void DocxAttributeOutput::FontFamilyType( FontFamily eFamily ) const
......
......@@ -232,7 +232,7 @@ public:
void FontAlternateName( const String& rName ) const;
/// Font charset.
void FontCharset( sal_uInt8 nCharSet ) const;
void FontCharset( sal_uInt8 nCharSet, rtl_TextEncoding nEncoding ) const;
/// Font family.
void FontFamilyType( FontFamily eFamily ) const;
......
......@@ -712,7 +712,7 @@ void wwFont::WriteDocx( const DocxAttributeOutput* rAttrOutput ) const
if ( mbAlt )
rAttrOutput->FontAlternateName( msAltNm );
rAttrOutput->FontCharset( sw::ms::rtl_TextEncodingToWinCharset( meChrSet ) );
rAttrOutput->FontCharset( sw::ms::rtl_TextEncodingToWinCharset( meChrSet ), meChrSet );
rAttrOutput->FontFamilyType( meFamily );
rAttrOutput->FontPitchType( mePitch );
......
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