diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-06-28 11:02:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-06-28 14:30:53 +0200 |
commit | 6701329f5b7d9c39fbd00f2f735dcd375992aa8e (patch) | |
tree | 4645f37a3b98ebfd6e9bdcf6593be38bdba540fc /writerfilter/source | |
parent | 0aa7ee7827fc77b5b4c0479402bfbd9a4e5d9e84 (diff) |
[API CHANGE] drop ShapeContextHandler service and interface
There is zero chance an extension is using this, because it is so
intimately tired together with the oox and writerfilter interactions.
I'm removing this so I can expose the ShapeContextHandler and then
override it's implementation in a more fashion without jumping through
UNO hoops.
Change-Id: I79ef30247f4642303dfdb92bbf8f6e6226234829
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117996
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'writerfilter/source')
4 files changed, 10 insertions, 12 deletions
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx index 0331d3539508..e0eb6bc48119 100644 --- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx @@ -834,23 +834,23 @@ const uno::Sequence<beans::PropertyValue>& OOXMLDocumentImpl::getMediaDescriptor return maMediaDescriptor; } -void OOXMLDocumentImpl::setShapeContext( uno::Reference<xml::sax::XFastShapeContextHandler> xContext ) +void OOXMLDocumentImpl::setShapeContext( rtl::Reference<oox::shape::ShapeContextHandler> xContext ) { if (!maShapeContexts.empty()) maShapeContexts.top() = xContext; } -uno::Reference<xml::sax::XFastShapeContextHandler> OOXMLDocumentImpl::getShapeContext( ) +rtl::Reference<oox::shape::ShapeContextHandler> OOXMLDocumentImpl::getShapeContext( ) { if (!maShapeContexts.empty()) return maShapeContexts.top(); else - return uno::Reference<xml::sax::XFastShapeContextHandler>(); + return {}; } void OOXMLDocumentImpl::pushShapeContext() { - maShapeContexts.push(uno::Reference<xml::sax::XFastShapeContextHandler>()); + maShapeContexts.push({}); } void OOXMLDocumentImpl::popShapeContext() diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.hxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.hxx index ed9db125cbe8..c97c208534cf 100644 --- a/writerfilter/source/ooxml/OOXMLDocumentImpl.hxx +++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.hxx @@ -43,7 +43,7 @@ class OOXMLDocumentImpl : public OOXMLDocument css::uno::Reference<css::xml::dom::XDocument> mxGlossaryDocDom; css::uno::Sequence < css::uno::Sequence< css::uno::Any > > mxGlossaryDomList; /// Stack of shape contexts, 1 element for VML, 1 element / nesting level for drawingML. - std::stack< css::uno::Reference<css::xml::sax::XFastShapeContextHandler> > maShapeContexts; + std::stack< rtl::Reference<oox::shape::ShapeContextHandler> > maShapeContexts; css::uno::Reference<css::xml::dom::XDocument> mxThemeDom; css::uno::Sequence<css::uno::Reference<css::xml::dom::XDocument> > mxCustomXmlDomList; css::uno::Sequence<css::uno::Reference<css::xml::dom::XDocument> > mxCustomXmlDomPropsList; @@ -126,8 +126,8 @@ public: virtual void setXNoteId(const sal_Int32 nId) override; virtual sal_Int32 getXNoteId() const override; virtual const OUString & getTarget() const override; - virtual css::uno::Reference<css::xml::sax::XFastShapeContextHandler> getShapeContext( ) override; - virtual void setShapeContext( css::uno::Reference<css::xml::sax::XFastShapeContextHandler> xContext ) override; + virtual rtl::Reference<oox::shape::ShapeContextHandler> getShapeContext( ) override; + virtual void setShapeContext( rtl::Reference<oox::shape::ShapeContextHandler> xContext ) override; void pushShapeContext() override; void popShapeContext() override; virtual css::uno::Reference<css::xml::dom::XDocument> getThemeDom() override; diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx index efd097405c90..16abb4987d35 100644 --- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx +++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx @@ -20,7 +20,6 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/text/RelOrientation.hpp> #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> -#include <com/sun/star/xml/sax/FastShapeContextHandler.hpp> #include <com/sun/star/xml/sax/SAXException.hpp> #include <ooxml/resourceids.hxx> #include <oox/mathml/import.hxx> @@ -1692,11 +1691,11 @@ void OOXMLFastContextHandlerShape::setToken(Token_t nToken) getDocument()->pushShapeContext(); } - mrShapeContext.set(getDocument()->getShapeContext()); + mrShapeContext = getDocument()->getShapeContext(); if (!mrShapeContext.is()) { // Define the shape context for the whole document - mrShapeContext = css::xml::sax::FastShapeContextHandler::create(getComponentContext()); + mrShapeContext = new oox::shape::ShapeContextHandler(getComponentContext()); getDocument()->setShapeContext(mrShapeContext); } diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx index dc5c369aa0fe..0e6590a60f69 100644 --- a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx +++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx @@ -23,7 +23,6 @@ #include <cppuhelper/implbase.hxx> #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/xml/sax/XFastContextHandler.hpp> -#include <com/sun/star/xml/sax/XFastShapeContextHandler.hpp> #include <oox/mathml/importutils.hxx> #include <rtl/ref.hxx> #include "OOXMLParserState.hxx" @@ -448,7 +447,7 @@ class OOXMLFastContextHandlerShape: public OOXMLFastContextHandlerProperties bool m_bShapeStarted; /// Is it necessary to pop the stack in the dtor? bool m_bShapeContextPushed; - css::uno::Reference<css::xml::sax::XFastShapeContextHandler> mrShapeContext; + rtl::Reference<oox::shape::ShapeContextHandler> mrShapeContext; public: explicit OOXMLFastContextHandlerShape(OOXMLFastContextHandler * pContext); |