filter/source/config/cache/basecontainer.cxx | 10 +--------- filter/source/config/cache/basecontainer.hxx | 10 +++------- filter/source/config/cache/cacheupdatelistener.cxx | 6 ++---- filter/source/config/cache/contenthandlerfactory.cxx | 3 +-- filter/source/config/cache/filterfactory.cxx | 3 +-- filter/source/config/cache/frameloaderfactory.cxx | 3 +-- filter/source/config/cache/typedetection.cxx | 3 +-- 7 files changed, 10 insertions(+), 28 deletions(-)
New commits: commit e3f038db8a61e6c76ff40cd4d0d01f0b16e9378b Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue May 24 09:58:20 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue May 24 11:06:21 2022 +0200 ConfigFlush can be directly instantiated here Change-Id: I97934ecf7aafbeec3db9e7149e149a468ae21374 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134854 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/filter/source/config/cache/cacheupdatelistener.cxx b/filter/source/config/cache/cacheupdatelistener.cxx index 36e2ac160530..de9d5704e783 100644 --- a/filter/source/config/cache/cacheupdatelistener.cxx +++ b/filter/source/config/cache/cacheupdatelistener.cxx @@ -19,10 +19,10 @@ #include "cacheupdatelistener.hxx" +#include "configflush.hxx" #include <com/sun/star/util/XChangesNotifier.hpp> #include <com/sun/star/util/XRefreshable.hpp> -#include <com/sun/star/document/FilterConfigRefresh.hpp> #include <unotools/configpaths.hxx> #include <rtl/ustring.hxx> #include <comphelper/processfactory.hxx> @@ -161,9 +161,7 @@ void SAL_CALL CacheUpdateListener::changesOccurred(const css::util::ChangesEven // notify sfx cache about the changed filter cache .-) if (bNotifyRefresh) { - css::uno::Reference< css::uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); - css::uno::Reference< css::util::XRefreshable > xRefreshBroadcaster = - css::document::FilterConfigRefresh::create(xContext); + rtl::Reference< ConfigFlush > xRefreshBroadcaster = new ConfigFlush(); xRefreshBroadcaster->refresh(); } } commit 19251d0a9690a746e50b24742c5b92c150c434e6 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue May 24 09:55:46 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue May 24 11:06:07 2022 +0200 m_xRefreshBroadcaster in BaseContainer is dead code because we are assigning a newly created object to a weak reference, which means the newly created object is destroyed just after it is created (verified in a debugger). This was introduced in commit e03dd544aec890a6fdf4638380c95104430752a3 Date: Wed Jul 20 08:27:45 2005 +0000 INTEGRATION: CWS fwk18 (1.5.224); FILE MERGED 2005/07/06 09:29:56 as 1.5.224.1: #123808# update sfx filter cache at runtime and commit 49a28fd6309011ba71c8efe1c37c4a585b06f20f Date: Wed Jul 20 08:27:31 2005 +0000 INTEGRATION: CWS fwk18 (1.4.224); FILE MERGED 2005/07/14 12:22:13 as 1.4.224.2: #123808# listen on config to be informed about changes 2005/07/06 09:29:56 as 1.4.224.1: #123808# update sfx filter cache at runtime Change-Id: Ic27cae4a499439009e89b003635067df440d4cf2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134853 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/filter/source/config/cache/basecontainer.cxx b/filter/source/config/cache/basecontainer.cxx index c5c9ff939443..dbbb9bcc23da 100644 --- a/filter/source/config/cache/basecontainer.cxx +++ b/filter/source/config/cache/basecontainer.cxx @@ -21,7 +21,6 @@ #include "basecontainer.hxx" #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> -#include <com/sun/star/document/FilterConfigRefresh.hpp> #include <com/sun/star/uno/Type.h> #include <comphelper/enumhelper.hxx> #include <comphelper/sequence.hxx> @@ -45,8 +44,7 @@ BaseContainer::~BaseContainer() } -void BaseContainer::init(const css::uno::Reference< css::uno::XComponentContext >& rxContext , - const OUString& sImplementationName, +void BaseContainer::init(const OUString& sImplementationName, const css::uno::Sequence< OUString >& lServiceNames , FilterCache::EItemType eType ) { @@ -56,7 +54,6 @@ void BaseContainer::init(const css::uno::Reference< css::uno::XComponentContext m_sImplementationName = sImplementationName; m_lServiceNames = lServiceNames ; m_eType = eType ; - m_xRefreshBroadcaster = css::document::FilterConfigRefresh::create(rxContext); // <- SAFE } @@ -427,14 +424,9 @@ void SAL_CALL BaseContainer::flush() m_pFlushCache.reset(); - css::uno::Reference< css::util::XRefreshable > xRefreshBroadcaster = m_xRefreshBroadcaster; - aLock.clear(); // <- SAFE - if (xRefreshBroadcaster.is()) - xRefreshBroadcaster->refresh(); - // notify listener outside the lock! // The used listener helper lives if we live // and is threadsafe by itself. diff --git a/filter/source/config/cache/basecontainer.hxx b/filter/source/config/cache/basecontainer.hxx index 4ed14d4f603a..6691c1b49380 100644 --- a/filter/source/config/cache/basecontainer.hxx +++ b/filter/source/config/cache/basecontainer.hxx @@ -60,9 +60,6 @@ class BaseContainer : public cppu::BaseMutex protected: - // TODO - css::uno::WeakReference< css::util::XRefreshable > m_xRefreshBroadcaster; - /** @short the implementation name of our derived class, which we provide at the interface XServiceInfo of our class... */ OUString m_sImplementationName; @@ -145,10 +142,9 @@ class BaseContainer : public cppu::BaseMutex specify, which sub container of the used filter cache must be wrapped by this container interface. */ - void init(const css::uno::Reference< css::uno::XComponentContext >& rxContext , - const OUString& sImplementationName, - const css::uno::Sequence< OUString >& lServiceNames , - FilterCache::EItemType eType ); + void init( const OUString& sImplementationName, + const css::uno::Sequence< OUString >& lServiceNames , + FilterCache::EItemType eType ); // helper diff --git a/filter/source/config/cache/contenthandlerfactory.cxx b/filter/source/config/cache/contenthandlerfactory.cxx index 7e2ec4fc23cc..089f8db5ff62 100644 --- a/filter/source/config/cache/contenthandlerfactory.cxx +++ b/filter/source/config/cache/contenthandlerfactory.cxx @@ -29,8 +29,7 @@ namespace filter::config{ ContentHandlerFactory::ContentHandlerFactory(const css::uno::Reference< css::uno::XComponentContext >& rxContext) : m_xContext(rxContext) { - BaseContainer::init(rxContext , - "com.sun.star.comp.filter.config.ContentHandlerFactory" , + BaseContainer::init("com.sun.star.comp.filter.config.ContentHandlerFactory" , { "com.sun.star.frame.ContentHandlerFactory" }, FilterCache::E_CONTENTHANDLER ); } diff --git a/filter/source/config/cache/filterfactory.cxx b/filter/source/config/cache/filterfactory.cxx index 586229cb78c5..54225db86d7c 100644 --- a/filter/source/config/cache/filterfactory.cxx +++ b/filter/source/config/cache/filterfactory.cxx @@ -55,8 +55,7 @@ FilterCache& GetTheFilterCache() FilterFactory::FilterFactory(const css::uno::Reference< css::uno::XComponentContext >& rxContext) : m_xContext(rxContext) { - BaseContainer::init(rxContext , - "com.sun.star.comp.filter.config.FilterFactory" , + BaseContainer::init("com.sun.star.comp.filter.config.FilterFactory" , { "com.sun.star.document.FilterFactory" }, FilterCache::E_FILTER ); } diff --git a/filter/source/config/cache/frameloaderfactory.cxx b/filter/source/config/cache/frameloaderfactory.cxx index af03dbec96f2..ebe4823666ad 100644 --- a/filter/source/config/cache/frameloaderfactory.cxx +++ b/filter/source/config/cache/frameloaderfactory.cxx @@ -29,8 +29,7 @@ namespace filter::config{ FrameLoaderFactory::FrameLoaderFactory(const css::uno::Reference< css::uno::XComponentContext >& rxContext) : m_xContext(rxContext) { - BaseContainer::init(rxContext , - "com.sun.star.comp.filter.config.FrameLoaderFactory" , + BaseContainer::init("com.sun.star.comp.filter.config.FrameLoaderFactory" , { "com.sun.star.frame.FrameLoaderFactory" }, FilterCache::E_FRAMELOADER ); } diff --git a/filter/source/config/cache/typedetection.cxx b/filter/source/config/cache/typedetection.cxx index 88402fbfc672..1aae850fd535 100644 --- a/filter/source/config/cache/typedetection.cxx +++ b/filter/source/config/cache/typedetection.cxx @@ -55,8 +55,7 @@ TypeDetection::TypeDetection(const css::uno::Reference< css::uno::XComponentCont , m_bCancel(false) { css::frame::Desktop::create(m_xContext)->addTerminateListener(m_xTerminateListener); - BaseContainer::init(rxContext , - "com.sun.star.comp.filter.config.TypeDetection" , + BaseContainer::init("com.sun.star.comp.filter.config.TypeDetection" , { "com.sun.star.document.TypeDetection" }, FilterCache::E_TYPE ); }