Kaydet (Commit) 4a625120 authored tarafından Miklos Vajna's avatar Miklos Vajna

oox::formulaimport::XmlStream: allow avoiding XFastAttributeList

Change-Id: Iba0ad5ae72920f27e8a443a043c5891b102aee98
üst b8b792ba
......@@ -133,6 +133,7 @@ public:
struct OOX_DLLPUBLIC AttributeList
{
bool hasAttribute( int token ) const;
OUString& operator[] (int token);
rtl::OUString attribute( int token, const rtl::OUString& def = rtl::OUString()) const;
bool attribute( int token, bool def ) const;
sal_Unicode attribute( int token, sal_Unicode def ) const;
......@@ -148,6 +149,8 @@ public:
Tag( int token = XML_TOKEN_INVALID,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XFastAttributeList >& attributes = com::sun::star::uno::Reference< com::sun::star::xml::sax::XFastAttributeList >(),
const rtl::OUString& text = rtl::OUString());
Tag( int token,
const AttributeList& attribs);
int token; ///< tag type, or XML_TOKEN_INVALID
AttributeList attributes;
rtl::OUString text;
......@@ -236,7 +239,9 @@ class OOX_DLLPUBLIC XmlStreamBuilder
{
public:
void appendOpeningTag( int token,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XFastAttributeList >& attributes );
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XFastAttributeList >& attributes = com::sun::star::uno::Reference< com::sun::star::xml::sax::XFastAttributeList >());
void appendOpeningTag( int token,
const AttributeList& attribs );
void appendClosingTag( int token );
// appends the characters after the last appended token
void appendCharacters( const rtl::OUString& characters );
......
......@@ -114,6 +114,11 @@ static OUString tokenToString( int token )
} // namespace
OUString& XmlStream::AttributeList::operator[] (int token)
{
return attrs[token];
}
rtl::OUString XmlStream::AttributeList::attribute( int token, const rtl::OUString& def ) const
{
std::map< int, rtl::OUString >::const_iterator find = attrs.find( token );
......@@ -165,6 +170,12 @@ XmlStream::Tag::Tag( int t, const uno::Reference< xml::sax::XFastAttributeList >
{
}
XmlStream::Tag::Tag( int t, const AttributeList& a )
: token( t )
, attributes( a )
{
}
XmlStream::Tag::operator bool() const
{
......@@ -337,6 +348,11 @@ void XmlStreamBuilder::appendOpeningTag( int token, const uno::Reference< xml::s
tags.push_back( Tag( OPENING( token ), attrs ));
}
void XmlStreamBuilder::appendOpeningTag( int token, const AttributeList& attrs )
{
tags.push_back( Tag( OPENING( token ), attrs ));
}
void XmlStreamBuilder::appendClosingTag( int token )
{
tags.push_back( Tag( CLOSING( token )));
......
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