summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-07-23 16:59:13 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-07-23 17:18:36 +0200
commit4a62512086fe71d98f3de95706ab1350625a7616 (patch)
treedde8d38055316471e466eab209d0ddabfb9e0be9 /oox
parentb8b792babfa63ce2f59104117c961e96d8e265a7 (diff)
oox::formulaimport::XmlStream: allow avoiding XFastAttributeList
Change-Id: Iba0ad5ae72920f27e8a443a043c5891b102aee98
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/oox/mathml/importutils.hxx7
-rw-r--r--oox/source/mathml/importutils.cxx16
2 files changed, 22 insertions, 1 deletions
diff --git a/oox/inc/oox/mathml/importutils.hxx b/oox/inc/oox/mathml/importutils.hxx
index fc0e276495ac..771851562996 100644
--- a/oox/inc/oox/mathml/importutils.hxx
+++ b/oox/inc/oox/mathml/importutils.hxx
@@ -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 );
diff --git a/oox/source/mathml/importutils.cxx b/oox/source/mathml/importutils.cxx
index 41a254d7d296..01c2ba7cee3a 100644
--- a/oox/source/mathml/importutils.cxx
+++ b/oox/source/mathml/importutils.cxx
@@ -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 )));