summaryrefslogtreecommitdiffstats
path: root/oox
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2011-11-25 13:16:04 +0100
committerLuboš Luňák <l.lunak@suse.cz>2011-11-29 13:27:42 +0100
commitf034c452c5aad4f8a38045530486a6afd27aa215 (patch)
treee185a3b5d7c79344ebd0b2709caf0834c7126646 /oox
parentadd Amiri kashida example (diff)
downloadcore-f034c452c5aad4f8a38045530486a6afd27aa215.tar.gz
core-f034c452c5aad4f8a38045530486a6afd27aa215.zip
simplify attribute retrieval syntax a bit
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/oox/mathml/importutils.hxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/oox/inc/oox/mathml/importutils.hxx b/oox/inc/oox/mathml/importutils.hxx
index 3a59320317aa..ca212aad8029 100644
--- a/oox/inc/oox/mathml/importutils.hxx
+++ b/oox/inc/oox/mathml/importutils.hxx
@@ -91,6 +91,15 @@ public:
AttributeList attributes;
rtl::OUString text;
/**
+ This function returns value of the given attribute, or the passed default value if not found.
+ The type of the default value selects the return type (OUString here).
+ */
+ rtl::OUString attribute( int token, const rtl::OUString& def = rtl::OUString()) const;
+ /**
+ @overload
+ */
+ bool attribute( int token, bool def ) const;
+ /**
Converts to true if the tag has a valid token, false otherwise. Allows simple
usage in if(), for example 'if( XmlStream::Tag foo = stream.checkOpeningTag( footoken ))'.
*/
@@ -169,6 +178,18 @@ public:
void appendCharacters( const rtl::OUString& characters );
};
+inline
+rtl::OUString XmlStream::Tag::attribute( int t, const rtl::OUString& def ) const
+{
+ return attributes.attribute( t, def );
+}
+
+inline
+bool XmlStream::Tag::attribute( int t, bool def ) const
+{
+ return attributes.attribute( t, def );
+}
+
} // namespace
} // namespace