diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2022-05-30 11:08:12 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-05-30 12:08:03 +0200 |
commit | b3f2ae52e381f7d5fa466dc9df7d04d3d13ca4b9 (patch) | |
tree | c0e45d2081ffc31c709c104f3784e2c86141cf7b /sdext | |
parent | e4e03e79fac598a9fafb0da8ab50da9a67c6978e (diff) |
framework: fix crash on Writer startup when using --enable-ext-wiki-publisher
As reported by Julien, once the mediawiki extension is installed, the
xHandler in framework::DispatchProvider::implts_searchProtocolHandler()
points to an UNO component implemented in Java, and we crash in
dynamic_cast<>(), at least on Linux with gcc 7.5 and libstdc++.
This dynamic_cast<>() call was added in commit
c0fa456436947a5c167c652d19a884064b43c03d (tdf#149261 sdext: fix crash on
starting the presenter console for the 2nd time, 2022-05-26), to allow
the presenter console to opt out from protocol handler caching. It was
expected that the proxy object created for a Java UNO component would
simply return nullptr when we try to dynamic_cast<>() it down to a C++
interface.
Fix the problem by moving the interface to an UNO one: this side-steps
the dynamic_cast<>() crash at the price of introducing an UNO interface,
which is not meant to be part of the public UNO API (but at least it's
not published).
It may still make sense to improve the bridges/ code at some stage to
not crash in dynamic_cast<>() on generated Java proxy objects.
Change-Id: Iaac44515339e0dc15dddc3be45ef7dee7331e47a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135114
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sdext')
-rw-r--r-- | sdext/source/presenter/PresenterProtocolHandler.hxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sdext/source/presenter/PresenterProtocolHandler.hxx b/sdext/source/presenter/PresenterProtocolHandler.hxx index eaced08d9e6a..217fb2658abe 100644 --- a/sdext/source/presenter/PresenterProtocolHandler.hxx +++ b/sdext/source/presenter/PresenterProtocolHandler.hxx @@ -26,14 +26,15 @@ #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/util/XCacheInfo.hpp> #include <rtl/ref.hxx> -#include <framework/dispatchhelper.hxx> namespace sdext::presenter { typedef ::cppu::WeakComponentImplHelper < css::lang::XInitialization, css::lang::XServiceInfo, + css::util::XCacheInfo, css::frame::XDispatchProvider > PresenterProtocolHandlerInterfaceBase; @@ -41,7 +42,6 @@ class PresenterController; class PresenterProtocolHandler : protected ::cppu::BaseMutex, - public framework::CacheInfo, public PresenterProtocolHandlerInterfaceBase { public: @@ -73,8 +73,8 @@ public: queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor>& rDescriptors) override; - /// See framework::CacheInfo::IsCachingAllowed(). - bool IsCachingAllowed() const override { return false; } + /// See XCacheInfo::IsCachingAllowed(). + sal_Bool SAL_CALL isCachingAllowed() override { return false; } private: class Dispatch; |