summaryrefslogtreecommitdiff
path: root/include/oox/core
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-24 10:26:23 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-24 10:26:23 +0200
commita449e0d2425fdedc02fae793a925dd0702d70319 (patch)
tree35edbc1ad66cc14fd0b936bb1220f5f1bfc9e979 /include/oox/core
parentb1211e965aa7883b0c3fc157f6c56b48c8bb0462 (diff)
use rtl::Reference in FastParser
instead of storing both a raw pointer and a uno::Reference Change-Id: I6b67a6098a3ccdce7e29ee8d601c743897032eaf
Diffstat (limited to 'include/oox/core')
-rw-r--r--include/oox/core/fastparser.hxx17
-rw-r--r--include/oox/core/xmlfilterbase.hxx2
2 files changed, 9 insertions, 10 deletions
diff --git a/include/oox/core/fastparser.hxx b/include/oox/core/fastparser.hxx
index 69cc111c4b49..d28e724e84b0 100644
--- a/include/oox/core/fastparser.hxx
+++ b/include/oox/core/fastparser.hxx
@@ -26,6 +26,7 @@
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/xml/sax/SAXException.hpp>
#include <rtl/ustring.hxx>
+#include <rtl/ref.hxx>
#include <sal/types.h>
namespace com { namespace sun { namespace star {
@@ -57,10 +58,12 @@ class FastParser
{
public:
/// @throws css::uno::RuntimeException
- explicit FastParser(
- const css::uno::Reference< css::uno::XComponentContext >& rxContext )
+ explicit FastParser()
throw( css::uno::RuntimeException );
+ FastParser(const FastParser&) = delete;
+ FastParser& operator=(const FastParser&) = delete;
+
virtual ~FastParser();
/** Registers an OOXML namespace at the parser.
@@ -110,13 +113,9 @@ public:
getTokenHandler() const { return mxTokenHandler; }
private:
- css::uno::Reference< css::xml::sax::XFastParser >
- mxParser;
- css::uno::Reference< css::xml::sax::XFastTokenHandler >
- mxTokenHandler;
- const NamespaceMap& mrNamespaceMap;
-
- sax_fastparser::FastSaxParser* mpParser;
+ css::uno::Reference<css::xml::sax::XFastTokenHandler> mxTokenHandler;
+ const NamespaceMap& mrNamespaceMap;
+ rtl::Reference<sax_fastparser::FastSaxParser> mxParser;
};
diff --git a/include/oox/core/xmlfilterbase.hxx b/include/oox/core/xmlfilterbase.hxx
index c9769d7fadb8..51497836a885 100644
--- a/include/oox/core/xmlfilterbase.hxx
+++ b/include/oox/core/xmlfilterbase.hxx
@@ -230,7 +230,7 @@ public:
void importDocumentProperties();
- FastParser* createParser() const;
+ static FastParser* createParser();
bool isMSO2007Document() const;