diff options
Diffstat (limited to 'oox/source/mathml/importutils.cxx')
-rw-r--r-- | oox/source/mathml/importutils.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/oox/source/mathml/importutils.cxx b/oox/source/mathml/importutils.cxx index c6bf80ca0194..69fa1fc14f02 100644 --- a/oox/source/mathml/importutils.cxx +++ b/oox/source/mathml/importutils.cxx @@ -99,6 +99,22 @@ bool XmlStream::AttributeList::attribute( int token, bool def ) const return def; } +sal_Unicode XmlStream::AttributeList::attribute( int token, sal_Unicode def ) const +{ + std::map< int, rtl::OUString >::const_iterator find = attrs.find( token ); + if( find != attrs.end()) + { + if( find->second.getLength() >= 1 ) + { + if( find->second.getLength() != 1 ) + fprintf( stderr, "Cannot convert \'%s\' to sal_Unicode, stripping.\n", + rtl::OUStringToOString( find->second, RTL_TEXTENCODING_UTF8 ).getStr()); + return find->second[ 0 ]; + } + } + return def; +} + XmlStream::Tag::Tag( int t, const uno::Reference< xml::sax::XFastAttributeList >& a, const rtl::OUString& txt ) : token( t ) , attributes( AttributeListBuilder( a )) |