diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2022-12-12 16:10:05 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-12-12 22:45:11 +0000 |
commit | 4bcf6d9c905e7b5558ee8d9f7f616ce61eadb8f8 (patch) | |
tree | 094198ec55b768247c80e430cebfcbd096ad307a /framework/inc/dispatch/dispatchprovider.hxx | |
parent | 2ef1439ae90b3621198728b4e1e67b2e72fc376c (diff) |
tdf#151376 framework: fix calling in-document macros with reused frames
The bugdoc has a macro in it, and after closing the document -> start
center -> opening it again, you could no longer trigger the macro by
clicking on the URL field in the Calc cell.
The problem is that we cache protocol handler instances since
3f768cddd28a2f04eb1ffa30bed4474deb6fbfc4 (framework: avoid re-creating
protocol handler instances all the time, 2022-05-02) in frames, but we
failed to invalidate this cache when the component of the frame changes.
Fix the problem by clearing the cache in XFrameImpl::setComponent(),
which gets called in this somewhat rare case when a frame gets reused to
host a different component.
[ No testcase, I'm not sure how to close a document without disposing
its XFrame from code. ]
Change-Id: I73ee83ec017f476803010cbf9e514315fc797371
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143998
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'framework/inc/dispatch/dispatchprovider.hxx')
-rw-r--r-- | framework/inc/dispatch/dispatchprovider.hxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/framework/inc/dispatch/dispatchprovider.hxx b/framework/inc/dispatch/dispatchprovider.hxx index 3b544807337c..c6656948ebee 100644 --- a/framework/inc/dispatch/dispatchprovider.hxx +++ b/framework/inc/dispatch/dispatchprovider.hxx @@ -88,6 +88,8 @@ class DispatchProvider final : public ::cppu::WeakImplHelper< css::frame::XDispa sal_Int32 nSearchFlags ) override; virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& lDescriptions ) override; + void ClearProtocolHandlers() { m_aProtocolHandlers.clear(); } + /* helper */ private: // Let him protected! So nobody can use us as base ... |