summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2013-11-20 12:11:44 +0000
committerMichael Meeks <michael.meeks@collabora.com>2013-11-20 12:12:50 +0000
commit9491ca3f64bd44a6a8e63f7d2eae02164f792258 (patch)
tree5ed4973014c2fe04d5e67dd792ee2229c51928fa /include
parent55716b1ed969073f273c00baedb56d8f5de93761 (diff)
fastparser: avoid excessive alloc/frees for int / bool / double parsing
Change-Id: I596bbc723558f04588d9e767d64732164524e57a
Diffstat (limited to 'include')
-rw-r--r--include/oox/helper/attributelist.hxx6
-rw-r--r--include/sax/fastattribs.hxx4
2 files changed, 10 insertions, 0 deletions
diff --git a/include/oox/helper/attributelist.hxx b/include/oox/helper/attributelist.hxx
index 3fb6e8df113c..6aa035a0b331 100644
--- a/include/oox/helper/attributelist.hxx
+++ b/include/oox/helper/attributelist.hxx
@@ -27,6 +27,10 @@
#include <oox/token/tokens.hxx>
#include <oox/dllapi.h>
+namespace sax_fastparser {
+ class FastAttributeList;
+};
+
namespace oox {
// ============================================================================
@@ -159,6 +163,8 @@ public:
private:
::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >
mxAttribs;
+ mutable sax_fastparser::FastAttributeList *mpAttribList;
+ sax_fastparser::FastAttributeList *getAttribList() const;
};
// ============================================================================
diff --git a/include/sax/fastattribs.hxx b/include/sax/fastattribs.hxx
index c7806039eed4..fd87a946ea5a 100644
--- a/include/sax/fastattribs.hxx
+++ b/include/sax/fastattribs.hxx
@@ -73,6 +73,10 @@ public:
void addUnknown( const OUString& rNamespaceURL, const OString& rName, const sal_Char* pValue );
void addUnknown( const OString& rName, const sal_Char* pValue );
+ // performance sensitive shortcuts to avoid allocation ...
+ bool getAsInteger( sal_Int32 nToken, sal_Int32 &rInt);
+ bool getAsDouble( sal_Int32 nToken, double &rDouble);
+
// XFastAttributeList
virtual ::sal_Bool SAL_CALL hasAttribute( ::sal_Int32 Token ) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getValueToken( ::sal_Int32 Token ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);