diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-12-24 10:06:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-24 18:42:25 +0100 |
commit | 4621e719c283cb24ec6b884b55a6719a321336f3 (patch) | |
tree | baf5025a695196830a46983c90149316e6125fc0 | |
parent | 69b6c87eca7d7fa1e83653750e79e04ae1d5d384 (diff) |
use comphelper::WeakComponentImplHelper in SvXMLGraphicHelper
and remove unused disposing() override
Change-Id: I6423d9c3c418bb07f84e1622c8df6eac8ad762c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127406
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | include/svx/xmlgrhlp.hxx | 8 | ||||
-rw-r--r-- | svx/source/xml/xmlgrhlp.cxx | 16 |
2 files changed, 5 insertions, 19 deletions
diff --git a/include/svx/xmlgrhlp.hxx b/include/svx/xmlgrhlp.hxx index 8a72664a5b55..0e54e1cb102b 100644 --- a/include/svx/xmlgrhlp.hxx +++ b/include/svx/xmlgrhlp.hxx @@ -20,8 +20,7 @@ #ifndef INCLUDED_SVX_XMLGRHLP_HXX #define INCLUDED_SVX_XMLGRHLP_HXX -#include <cppuhelper/basemutex.hxx> -#include <cppuhelper/compbase.hxx> +#include <comphelper/compbase.hxx> #include <vcl/graph.hxx> #include <rtl/ref.hxx> @@ -47,8 +46,7 @@ struct SvxGraphicHelperStream_Impl }; class SVXCORE_DLLPUBLIC SvXMLGraphicHelper final : - public cppu::BaseMutex, - public cppu::WeakComponentImplHelper<css::document::XGraphicObjectResolver, + public comphelper::WeakComponentImplHelper<css::document::XGraphicObjectResolver, css::document::XGraphicStorageHandler, css::document::XBinaryStreamResolver> { @@ -82,8 +80,6 @@ private: SvXMLGraphicHelperMode eCreateMode, const OUString& rGraphicMimeType = OUString() ); - virtual void SAL_CALL disposing() override; - SVX_DLLPRIVATE OUString implSaveGraphic(css::uno::Reference<css::graphic::XGraphic> const & rxGraphic, OUString & rOutMimeType, std::u16string_view rRequestName); diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 35d3a247c56a..96be71b78769 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -367,18 +367,12 @@ const GraphicObject& SvXMLGraphicOutputStream::GetGraphicObject() } SvXMLGraphicHelper::SvXMLGraphicHelper(SvXMLGraphicHelperMode eCreateMode) - : cppu::WeakComponentImplHelper<document::XGraphicObjectResolver, - document::XGraphicStorageHandler, - document::XBinaryStreamResolver>(m_aMutex) { Init( nullptr, eCreateMode ); } SvXMLGraphicHelper::SvXMLGraphicHelper() - : cppu::WeakComponentImplHelper<document::XGraphicObjectResolver, - document::XGraphicStorageHandler, - document::XBinaryStreamResolver>(m_aMutex) - , meCreateMode(SvXMLGraphicHelperMode::Read) + : meCreateMode(SvXMLGraphicHelperMode::Read) { } @@ -386,10 +380,6 @@ SvXMLGraphicHelper::~SvXMLGraphicHelper() { } -void SAL_CALL SvXMLGraphicHelper::disposing() -{ -} - bool SvXMLGraphicHelper::ImplGetStreamNames( const OUString& rURLStr, OUString& rPictureStorageName, OUString& rPictureStreamName ) @@ -580,7 +570,7 @@ OUString SAL_CALL SvXMLGraphicHelper::resolveGraphicObjectURL( const OUString& / // XGraphicStorageHandler uno::Reference<graphic::XGraphic> SAL_CALL SvXMLGraphicHelper::loadGraphic(OUString const & rURL) { - osl::MutexGuard aGuard(m_aMutex); + std::unique_lock aGuard(m_aMutex); uno::Reference<graphic::XGraphic> xGraphic; @@ -612,7 +602,7 @@ uno::Reference<graphic::XGraphic> SAL_CALL SvXMLGraphicHelper::loadGraphic(OUStr uno::Reference<graphic::XGraphic> SAL_CALL SvXMLGraphicHelper::loadGraphicFromOutputStream(uno::Reference<io::XOutputStream> const & rxOutputStream) { - osl::MutexGuard aGuard(m_aMutex); + std::unique_lock aGuard(m_aMutex); uno::Reference<graphic::XGraphic> xGraphic; |