summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-03-21 12:40:40 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-03-21 12:50:36 +0100
commit359a7d4b7fe3ea2c8f18d1f2b4a17c60ac42ae1d (patch)
tree67db6248fbfc03be1a0838495197cdecdec392e1
parenteac72c2197d9b772d147c31d5737d511a82d9bb8 (diff)
Remove unnecessary dynamic_cast
OOXMLDocumentImpl is the only implementation of OOXMLDocument, though code outside the ooxml directory has no access to OOXMLDocumentImpl. However, in that directory passing OOXMLDocumentImpl* as OOXMLDocument*, then using dynamic_cast to get back OOXMLDocumentImpl* is quite pointless. Change-Id: I06dcf85180def1db33b57bd356749f5d92aefa80
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.cxx7
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.hxx4
-rw-r--r--writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx2
-rw-r--r--writerfilter/source/ooxml/OOXMLFastDocumentHandler.hxx4
-rw-r--r--writerfilter/source/ooxml/OOXMLParserState.cxx4
-rw-r--r--writerfilter/source/ooxml/OOXMLParserState.hxx8
6 files changed, 14 insertions, 15 deletions
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index b735441b47f6..ce4b3a9a7965 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -558,8 +558,7 @@ void OOXMLFastContextHandler::setParent
OOXMLPropertySet * OOXMLFastContextHandler::getPicturePropSet
(const OUString & rId)
{
- return dynamic_cast<OOXMLDocumentImpl *>(mpParserState->getDocument())->
- getPicturePropSet(rId);
+ return mpParserState->getDocument()->getPicturePropSet(rId);
}
void OOXMLFastContextHandler::sendTableDepth() const
@@ -1148,12 +1147,12 @@ void OOXMLFastContextHandler::setDefaultStringValue()
{
}
-void OOXMLFastContextHandler::setDocument(OOXMLDocument * pDocument)
+void OOXMLFastContextHandler::setDocument(OOXMLDocumentImpl* pDocument)
{
mpParserState->setDocument(pDocument);
}
-OOXMLDocument * OOXMLFastContextHandler::getDocument()
+OOXMLDocumentImpl* OOXMLFastContextHandler::getDocument()
{
return mpParserState->getDocument();
}
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
index 9217da6bd3b2..c7e7729a9670 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
@@ -168,8 +168,8 @@ public:
(Token_t Element,
const uno::Reference< xml::sax::XFastAttributeList > & Attribs);
- void setDocument(OOXMLDocument * pDocument);
- OOXMLDocument * getDocument();
+ void setDocument(OOXMLDocumentImpl* pDocument);
+ OOXMLDocumentImpl* getDocument();
void setXNoteId(OOXMLValue::Pointer_t pValue);
void setXNoteId(const sal_Int32 nId);
sal_Int32 getXNoteId() const;
diff --git a/writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx b/writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx
index 4df3596e4787..4ac9f8016faa 100644
--- a/writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx
@@ -38,7 +38,7 @@ using namespace ::std;
OOXMLFastDocumentHandler::OOXMLFastDocumentHandler(
uno::Reference< uno::XComponentContext > const & context,
Stream* pStream,
- OOXMLDocument* pDocument,
+ OOXMLDocumentImpl* pDocument,
sal_Int32 nXNoteId )
: m_xContext(context)
, mpStream( pStream )
diff --git a/writerfilter/source/ooxml/OOXMLFastDocumentHandler.hxx b/writerfilter/source/ooxml/OOXMLFastDocumentHandler.hxx
index 00cf8594dc24..78aa3583678d 100644
--- a/writerfilter/source/ooxml/OOXMLFastDocumentHandler.hxx
+++ b/writerfilter/source/ooxml/OOXMLFastDocumentHandler.hxx
@@ -43,7 +43,7 @@ public:
OOXMLFastDocumentHandler(
uno::Reference< uno::XComponentContext > const & context,
Stream* pStream,
- OOXMLDocument* pDocument,
+ OOXMLDocumentImpl* pDocument,
sal_Int32 nXNoteId );
virtual ~OOXMLFastDocumentHandler() {}
@@ -98,7 +98,7 @@ private:
#ifdef DEBUG_ELEMENT
Stream::Pointer_t mpTmpStream;
#endif
- OOXMLDocument * mpDocument;
+ OOXMLDocumentImpl* mpDocument;
sal_Int32 mnXNoteId;
mutable boost::shared_ptr<OOXMLFastContextHandler> mpContextHandler;
boost::shared_ptr<OOXMLFastContextHandler> getContextHandler() const;
diff --git a/writerfilter/source/ooxml/OOXMLParserState.cxx b/writerfilter/source/ooxml/OOXMLParserState.cxx
index d8b562bf0821..235e089b0db0 100644
--- a/writerfilter/source/ooxml/OOXMLParserState.cxx
+++ b/writerfilter/source/ooxml/OOXMLParserState.cxx
@@ -113,12 +113,12 @@ void OOXMLParserState::setHandle()
mnHandle = mnContexts;
}
-void OOXMLParserState::setDocument(OOXMLDocument * pDocument)
+void OOXMLParserState::setDocument(OOXMLDocumentImpl* pDocument)
{
mpDocument = pDocument;
}
-OOXMLDocument * OOXMLParserState::getDocument() const
+OOXMLDocumentImpl* OOXMLParserState::getDocument() const
{
return mpDocument;
}
diff --git a/writerfilter/source/ooxml/OOXMLParserState.hxx b/writerfilter/source/ooxml/OOXMLParserState.hxx
index 5762f35faf09..16996fca709c 100644
--- a/writerfilter/source/ooxml/OOXMLParserState.hxx
+++ b/writerfilter/source/ooxml/OOXMLParserState.hxx
@@ -20,7 +20,7 @@
#define INCLUDE_OOXML_PARSER_STATE_HXX
#include <stack>
-#include <ooxml/OOXMLDocument.hxx>
+#include "OOXMLDocumentImpl.hxx"
#include "OOXMLPropertySetImpl.hxx"
#if OSL_DEBUG_LEVEL > 1
@@ -43,7 +43,7 @@ class OOXMLParserState
bool mbForwardEvents;
unsigned int mnContexts;
unsigned int mnHandle;
- OOXMLDocument * mpDocument;
+ OOXMLDocumentImpl* mpDocument;
OUString msTarget;
OOXMLPropertySet::Pointer_t mpCharacterProps;
stack<OOXMLPropertySet::Pointer_t> mCellProps;
@@ -82,8 +82,8 @@ public:
const string getHandle() const;
void setHandle();
- void setDocument(OOXMLDocument * pDocument);
- OOXMLDocument * getDocument() const;
+ void setDocument(OOXMLDocumentImpl* pDocument);
+ OOXMLDocumentImpl* getDocument() const;
void setXNoteId(const sal_Int32 rId);
sal_Int32 getXNoteId() const;