summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-06-28 11:02:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-06-28 14:30:53 +0200
commit6701329f5b7d9c39fbd00f2f735dcd375992aa8e (patch)
tree4645f37a3b98ebfd6e9bdcf6593be38bdba540fc
parent0aa7ee7827fc77b5b4c0479402bfbd9a4e5d9e84 (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>
-rw-r--r--include/oox/shape/ShapeContextHandler.hxx (renamed from oox/source/shape/ShapeContextHandler.hxx)63
-rw-r--r--offapi/UnoApi_offapi.mk2
-rw-r--r--offapi/com/sun/star/xml/sax/FastShapeContextHandler.idl33
-rw-r--r--offapi/com/sun/star/xml/sax/XFastShapeContextHandler.idl62
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx61
-rw-r--r--oox/util/oox.component4
-rwxr-xr-xsolenv/bin/native-code.py1
-rw-r--r--solenv/clang-format/excludelist2
-rw-r--r--writerfilter/inc/ooxml/OOXMLDocument.hxx6
-rw-r--r--writerfilter/source/ooxml/OOXMLDocumentImpl.cxx8
-rw-r--r--writerfilter/source/ooxml/OOXMLDocumentImpl.hxx6
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.cxx5
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.hxx3
13 files changed, 54 insertions, 202 deletions
diff --git a/oox/source/shape/ShapeContextHandler.hxx b/include/oox/shape/ShapeContextHandler.hxx
index d9b171f045b0..5655cc25acf2 100644
--- a/oox/source/shape/ShapeContextHandler.hxx
+++ b/include/oox/shape/ShapeContextHandler.hxx
@@ -16,18 +16,19 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_OOX_SOURCE_SHAPE_SHAPECONTEXTHANDLER_HXX
-#define INCLUDED_OOX_SOURCE_SHAPE_SHAPECONTEXTHANDLER_HXX
+#pragma once
#include <memory>
-#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/implbase.hxx>
-#include <com/sun/star/xml/sax/XFastShapeContextHandler.hpp>
#include <oox/drawingml/graphicshapecontext.hxx>
#include <oox/core/fragmenthandler2.hxx>
#include <oox/core/xmlfilterbase.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
+#include <com/sun/star/graphic/XGraphicMapper.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <com/sun/star/frame/XModel.hpp>
namespace oox::shape {
@@ -45,9 +46,8 @@ public:
}
};
-class ShapeContextHandler:
- public ::cppu::WeakImplHelper< css::xml::sax::XFastShapeContextHandler,
- css::lang::XServiceInfo >
+class OOX_DLLPUBLIC ShapeContextHandler:
+ public ::cppu::WeakImplHelper< css::xml::sax::XFastContextHandler >
{
public:
explicit ShapeContextHandler
@@ -55,15 +55,6 @@ public:
virtual ~ShapeContextHandler() override;
- // css::lang::XServiceInfo:
- virtual OUString SAL_CALL getImplementationName() override;
-
- virtual sal_Bool SAL_CALL supportsService
- (const OUString & ServiceName) override;
-
- virtual css::uno::Sequence< OUString > SAL_CALL
- getSupportedServiceNames() override;
-
// css::xml::sax::XFastContextHandler:
virtual void SAL_CALL startFastElement
(::sal_Int32 Element,
@@ -93,35 +84,29 @@ public:
virtual void SAL_CALL characters(const OUString & aChars) override;
- // css::xml::sax::XFastShapeContextHandler:
- virtual css::uno::Reference< css::drawing::XShape > SAL_CALL getShape() override;
-
- virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getDrawPage() override;
+ css::uno::Reference< css::drawing::XShape > getShape();
- virtual void SAL_CALL setDrawPage
- (const css::uno::Reference< css::drawing::XDrawPage > & the_value) override;
+ css::uno::Reference< css::drawing::XDrawPage > getDrawPage();
+ void setDrawPage(const css::uno::Reference< css::drawing::XDrawPage > & the_value);
- virtual css::uno::Reference< css::frame::XModel > SAL_CALL getModel() override;
+ css::uno::Reference< css::frame::XModel > getModel();
+ void setModel(const css::uno::Reference< css::frame::XModel > & the_value);
- virtual void SAL_CALL setModel
- (const css::uno::Reference< css::frame::XModel > & the_value) override;
+ OUString getRelationFragmentPath();
+ void setRelationFragmentPath(const OUString & the_value);
- virtual OUString SAL_CALL getRelationFragmentPath() override;
- virtual void SAL_CALL setRelationFragmentPath
- (const OUString & the_value) override;
+ sal_Int32 getStartToken();
+ void setStartToken( sal_Int32 _starttoken );
- virtual ::sal_Int32 SAL_CALL getStartToken() override;
- virtual void SAL_CALL setStartToken( ::sal_Int32 _starttoken ) override;
+ css::awt::Point getPosition();
+ void setPosition(const css::awt::Point& rPosition);
- virtual css::awt::Point SAL_CALL getPosition() override;
- virtual void SAL_CALL setPosition(const css::awt::Point& rPosition) override;
+ void setDocumentProperties(const css::uno::Reference<css::document::XDocumentProperties>& xDocProps);
+ css::uno::Reference<css::document::XDocumentProperties> getDocumentProperties();
+ css::uno::Sequence<css::beans::PropertyValue> getMediaDescriptor();
+ void setMediaDescriptor(const css::uno::Sequence<css::beans::PropertyValue>& rMediaDescriptor);
- virtual void SAL_CALL setDocumentProperties(const css::uno::Reference<css::document::XDocumentProperties>& xDocProps) override;
- virtual css::uno::Reference<css::document::XDocumentProperties> SAL_CALL getDocumentProperties() override;
- virtual css::uno::Sequence<css::beans::PropertyValue> SAL_CALL getMediaDescriptor() override;
- virtual void SAL_CALL setMediaDescriptor(const css::uno::Sequence<css::beans::PropertyValue>& rMediaDescriptor) override;
-
- void SAL_CALL setGraphicMapper(css::uno::Reference<css::graphic::XGraphicMapper> const & rGraphicMapper) override;
+ void setGraphicMapper(css::uno::Reference<css::graphic::XGraphicMapper> const & rGraphicMapper);
private:
ShapeContextHandler(ShapeContextHandler const &) = delete;
@@ -163,6 +148,4 @@ private:
}
-#endif // INCLUDED_OOX_SOURCE_SHAPE_SHAPECONTEXTHANDLER_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 01dd48280fea..0de6196f54b4 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -476,7 +476,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/xml/dom,\
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/xml/sax,\
FastParser \
- FastShapeContextHandler \
FastTokenHandler \
Parser \
Writer \
@@ -4373,7 +4372,6 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/xml/sax,\
XFastDocumentHandler \
XFastParser \
XFastSAXSerializable \
- XFastShapeContextHandler \
XFastTokenHandler \
XLocator \
XParser \
diff --git a/offapi/com/sun/star/xml/sax/FastShapeContextHandler.idl b/offapi/com/sun/star/xml/sax/FastShapeContextHandler.idl
deleted file mode 100644
index 094482793219..000000000000
--- a/offapi/com/sun/star/xml/sax/FastShapeContextHandler.idl
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef __com_sun_star_xml_sax_FastShapeContextHandler_idl__
-#define __com_sun_star_xml_sax_FastShapeContextHandler_idl__
-
-#include <com/sun/star/xml/sax/XFastShapeContextHandler.idl>
-
-
-module com { module sun { module star { module xml { module sax {
-
-service FastShapeContextHandler : XFastShapeContextHandler;
-
-}; }; }; }; };
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/xml/sax/XFastShapeContextHandler.idl b/offapi/com/sun/star/xml/sax/XFastShapeContextHandler.idl
deleted file mode 100644
index 1475db6479b1..000000000000
--- a/offapi/com/sun/star/xml/sax/XFastShapeContextHandler.idl
+++ /dev/null
@@ -1,62 +0,0 @@
- /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef __com_sun_star_xml_sax_XFastShapeContextHandler_idl__
-#define __com_sun_star_xml_sax_XFastShapeContextHandler_idl__
-
-#include <com/sun/star/xml/sax/XFastContextHandler.idl>
-#include <com/sun/star/drawing/XShape.idl>
-#include <com/sun/star/drawing/XDrawPage.idl>
-#include <com/sun/star/frame/XModel.idl>
-#include <com/sun/star/io/XInputStream.idl>
-#include <com/sun/star/document/XDocumentProperties.idl>
-#include <com/sun/star/graphic/XGraphicMapper.idl>
-
-module com { module sun { module star { module xml { module sax {
-
-
-/** receives notification of sax document events from a
- XFastParser.
-
- @see XFastDocumentHandler
- */
-interface XFastShapeContextHandler: com::sun::star::xml::sax::XFastContextHandler
-{
- [attribute, readonly] com::sun::star::drawing::XShape Shape;
- [attribute] com::sun::star::drawing::XDrawPage DrawPage;
- [attribute] com::sun::star::frame::XModel Model;
- [attribute] string RelationFragmentPath;
- [attribute] long StartToken;
- [attribute] com::sun::star::awt::Point Position;
- [attribute] com::sun::star::document::XDocumentProperties DocumentProperties;
- [attribute] sequence< com::sun::star::beans::PropertyValue > MediaDescriptor;
-
- /** Graphic mapper to map a key/id string to a XGraphic. This is needed to
- remember for XGraphics for a path in the document storage
-
- @since LibreOffice 7.1
- */
- void setGraphicMapper([in] com::sun::star::graphic::XGraphicMapper xGraphicMapper);
-};
-
-
-}; }; }; }; };
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index 7cd7251c4aaf..4eb20ad36cda 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -21,7 +21,7 @@
#include <com/sun/star/xml/dom/XDocument.hpp>
#include <com/sun/star/xml/sax/XFastSAXSerializable.hpp>
-#include "ShapeContextHandler.hxx"
+#include <oox/shape/ShapeContextHandler.hxx>
#include "ShapeDrawingFragmentHandler.hxx"
#include "LockedCanvasContext.hxx"
#include "WpsContext.hxx"
@@ -389,8 +389,7 @@ void SAL_CALL ShapeContextHandler::characters(const OUString & aChars)
xContextHandler->characters(aChars);
}
-// css::xml::sax::XFastShapeContextHandler:
-uno::Reference< drawing::XShape > SAL_CALL
+uno::Reference< drawing::XShape >
ShapeContextHandler::getShape()
{
uno::Reference< drawing::XShape > xResult;
@@ -520,28 +519,24 @@ ShapeContextHandler::getShape()
return xResult;
}
-css::uno::Reference< css::drawing::XDrawPage > SAL_CALL
-ShapeContextHandler::getDrawPage()
+css::uno::Reference< css::drawing::XDrawPage > ShapeContextHandler::getDrawPage()
{
return mxDrawPage;
}
-void SAL_CALL ShapeContextHandler::setDrawPage
-(const css::uno::Reference< css::drawing::XDrawPage > & the_value)
+void ShapeContextHandler::setDrawPage(const css::uno::Reference< css::drawing::XDrawPage > & the_value)
{
mxDrawPage = the_value;
}
-css::uno::Reference< css::frame::XModel > SAL_CALL
-ShapeContextHandler::getModel()
+css::uno::Reference< css::frame::XModel > ShapeContextHandler::getModel()
{
if( !mxShapeFilterBase.is() )
throw uno::RuntimeException();
return mxShapeFilterBase->getModel();
}
-void SAL_CALL ShapeContextHandler::setModel
-(const css::uno::Reference< css::frame::XModel > & the_value)
+void ShapeContextHandler::setModel(const css::uno::Reference< css::frame::XModel > & the_value)
{
if( !mxShapeFilterBase.is() )
throw uno::RuntimeException();
@@ -549,84 +544,62 @@ void SAL_CALL ShapeContextHandler::setModel
mxShapeFilterBase->setTargetDocument(xComp);
}
-OUString SAL_CALL ShapeContextHandler::getRelationFragmentPath()
+OUString ShapeContextHandler::getRelationFragmentPath()
{
return msRelationFragmentPath;
}
-void SAL_CALL ShapeContextHandler::setRelationFragmentPath(const OUString & the_value)
+void ShapeContextHandler::setRelationFragmentPath(const OUString & the_value)
{
msRelationFragmentPath = the_value;
}
-::sal_Int32 SAL_CALL ShapeContextHandler::getStartToken()
+sal_Int32 ShapeContextHandler::getStartToken()
{
return mnStartToken;
}
-void SAL_CALL ShapeContextHandler::setStartToken( ::sal_Int32 _starttoken )
+void ShapeContextHandler::setStartToken( sal_Int32 _starttoken )
{
mnStartToken = _starttoken;
}
-awt::Point SAL_CALL ShapeContextHandler::getPosition()
+awt::Point ShapeContextHandler::getPosition()
{
return maPosition;
}
-void SAL_CALL ShapeContextHandler::setPosition(const awt::Point& rPosition)
+void ShapeContextHandler::setPosition(const awt::Point& rPosition)
{
maPosition = rPosition;
}
-void SAL_CALL ShapeContextHandler::setDocumentProperties(const uno::Reference<document::XDocumentProperties>& xDocProps)
+void ShapeContextHandler::setDocumentProperties(const uno::Reference<document::XDocumentProperties>& xDocProps)
{
mxDocumentProperties = xDocProps;
mxShapeFilterBase->checkDocumentProperties(mxDocumentProperties);
}
-uno::Reference<document::XDocumentProperties> SAL_CALL ShapeContextHandler::getDocumentProperties()
+uno::Reference<document::XDocumentProperties> ShapeContextHandler::getDocumentProperties()
{
return mxDocumentProperties;
}
-uno::Sequence<beans::PropertyValue> SAL_CALL ShapeContextHandler::getMediaDescriptor()
+uno::Sequence<beans::PropertyValue> ShapeContextHandler::getMediaDescriptor()
{
return maMediaDescriptor;
}
-void SAL_CALL ShapeContextHandler::setMediaDescriptor(const uno::Sequence<beans::PropertyValue>& rMediaDescriptor)
+void ShapeContextHandler::setMediaDescriptor(const uno::Sequence<beans::PropertyValue>& rMediaDescriptor)
{
maMediaDescriptor = rMediaDescriptor;
}
-void SAL_CALL ShapeContextHandler::setGraphicMapper(css::uno::Reference<css::graphic::XGraphicMapper> const & rxGraphicMapper)
+void ShapeContextHandler::setGraphicMapper(css::uno::Reference<css::graphic::XGraphicMapper> const & rxGraphicMapper)
{
mxShapeFilterBase->setGraphicMapper(rxGraphicMapper);
}
-OUString ShapeContextHandler::getImplementationName()
-{
- return "com.sun.star.comp.oox.ShapeContextHandler";
-}
-
-uno::Sequence< OUString > ShapeContextHandler::getSupportedServiceNames()
-{
- return { "com.sun.star.xml.sax.FastShapeContextHandler" };
-}
-
-sal_Bool SAL_CALL ShapeContextHandler::supportsService(const OUString & ServiceName)
-{
- return cppu::supportsService(this, ServiceName);
-}
-
-}
-
-extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
-com_sun_star_comp_oox_ShapeContextHandler_get_implementation(
- uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
-{
- return cppu::acquire(new oox::shape::ShapeContextHandler(pCtx));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/util/oox.component b/oox/util/oox.component
index ef54da9a11e2..3d717a469b07 100644
--- a/oox/util/oox.component
+++ b/oox/util/oox.component
@@ -36,10 +36,6 @@
<service name="com.sun.star.document.ImportFilter"/>
<service name="com.sun.star.document.ExportFilter"/>
</implementation>
- <implementation name="com.sun.star.comp.oox.ShapeContextHandler"
- constructor="com_sun_star_comp_oox_ShapeContextHandler_get_implementation">
- <service name="com.sun.star.xml.sax.FastShapeContextHandler"/>
- </implementation>
<implementation name="com.sun.star.comp.oox.crypto.StrongEncryptionDataSpace"
constructor="com_sun_star_comp_oox_crypto_StrongEncryptionDataSpace_get_implementation">
<service name="com.sun.star.packages.PackageEncryption"/>
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 4316bb233fbe..5ebfa359193a 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -544,7 +544,6 @@ core_constructor_list = [
"com_sun_star_comp_oox_FormatDetector_get_implementation",
"com_sun_star_comp_oox_docprop_DocumentPropertiesImporter_get_implementation",
"com_sun_star_comp_oox_ppt_PowerPointImport_get_implementation",
- "com_sun_star_comp_oox_ShapeContextHandler_get_implementation",
"com_sun_star_comp_oox_crypto_StrongEncryptionDataSpace_get_implementation",
]
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index eaf02c2c80ae..3af599b39f3e 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -5499,6 +5499,7 @@ include/oox/ppt/slidetransitioncontext.hxx
include/oox/ppt/soundactioncontext.hxx
include/oox/ppt/timenode.hxx
include/oox/ppt/timenodelistcontext.hxx
+include/oox/shape/ShapeContextHandler.hxx
include/oox/shape/ShapeFilterBase.hxx
include/oox/token/tokenmap.hxx
include/oox/vml/vmldrawing.hxx
@@ -7323,7 +7324,6 @@ oox/source/ppt/timenodelistcontext.cxx
oox/source/ppt/timetargetelementcontext.cxx
oox/source/ppt/timetargetelementcontext.hxx
oox/source/shape/ShapeContextHandler.cxx
-oox/source/shape/ShapeContextHandler.hxx
oox/source/shape/ShapeDrawingFragmentHandler.cxx
oox/source/shape/ShapeDrawingFragmentHandler.hxx
oox/source/shape/ShapeFilterBase.cxx
diff --git a/writerfilter/inc/ooxml/OOXMLDocument.hxx b/writerfilter/inc/ooxml/OOXMLDocument.hxx
index de0a8a7134de..8bf1502848ec 100644
--- a/writerfilter/inc/ooxml/OOXMLDocument.hxx
+++ b/writerfilter/inc/ooxml/OOXMLDocument.hxx
@@ -26,10 +26,10 @@
#include <com/sun/star/task/XStatusIndicator.hpp>
#include <com/sun/star/xml/sax/XFastParser.hpp>
#include <com/sun/star/xml/sax/XFastTokenHandler.hpp>
-#include <com/sun/star/xml/sax/XFastShapeContextHandler.hpp>
#include <com/sun/star/xml/dom/XDocument.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <oox/shape/ShapeContextHandler.hxx>
/**
@file OOXMLDocument.hxx
@@ -211,8 +211,8 @@ public:
virtual void setXNoteId(const sal_Int32 nId) = 0;
virtual sal_Int32 getXNoteId() const = 0;
virtual const OUString & getTarget() const = 0;
- virtual css::uno::Reference<css::xml::sax::XFastShapeContextHandler> getShapeContext( ) = 0;
- virtual void setShapeContext( css::uno::Reference<css::xml::sax::XFastShapeContextHandler> xContext ) = 0;
+ virtual rtl::Reference<oox::shape::ShapeContextHandler> getShapeContext( ) = 0;
+ virtual void setShapeContext( rtl::Reference<oox::shape::ShapeContextHandler> xContext ) = 0;
/// Push context of drawingML shapes, so nested shapes are handled separately.
virtual void pushShapeContext() = 0;
/// Pop context of a previously pushed drawingML shape.
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);