diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-01-06 10:49:31 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-01-06 11:29:17 +0100 |
commit | afa6a774936c34b09b37ab8539193ac529681798 (patch) | |
tree | 98bd8f03d627800dc57ac436907119febe3e5d12 /framework | |
parent | 499bfe4584ea3334cda1501daa9aa3026edd45be (diff) |
Don't crash on exiting print preview with Notebookbar
Crash caused by this sequence (tested in Writer):
1. Closing print preview, frame is attached to controller;
2. This calls SfxNotebookBar::StateMethod
3. There notebookbar's listener is added to list of the controller's
context change event listeners
4. Then in SwPagePreview::~SwPagePreview, notebookbar's listener is
added to that list again
5. ContextChangeEventMultiplexer::addContextChangeEventListener
detects second addition, and throws an unhandled exception.
I don't know why starting listening is needed in SwPagePreview dtor;
unfortunately commit d05b7b32d9ecb6fcb4a268eb68cdcee09bafa6dd doesn't
say much about context and reasons.
ControlListener is renamed to ControlListenerForCurrentController to
emphasize that it operates on the current controller of notebookbar's
frame; and its bListen parameter meaning was reverted: previously its
"true" value awkwardly meant "stop listening". All direct operations
with listener of notebookbar are replaced with calls to notebookbar's
methods.
In ContextChangeEventMultiplexer::addContextChangeEventListener,
uno::UNO_QUERY_THROW was replaced with uno::UNO_QUERY, because not
only chart controller may appear here, and it's not an error: e.g.
SfxBaseController doesn't implement lang::XServiceInfo.
Regression after commit d05b7b32d9ecb6fcb4a268eb68cdcee09bafa6dd.
Change-Id: Ief1aed188d8f02a6cfe3ea25f4d082dfdf449f32
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86257
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/services/ContextChangeEventMultiplexer.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/framework/source/services/ContextChangeEventMultiplexer.cxx b/framework/source/services/ContextChangeEventMultiplexer.cxx index c6da6be6b0d1..4dbc182ceaa5 100644 --- a/framework/source/services/ContextChangeEventMultiplexer.cxx +++ b/framework/source/services/ContextChangeEventMultiplexer.cxx @@ -166,7 +166,7 @@ void SAL_CALL ContextChangeEventMultiplexer::addContextChangeEventListener ( if (pFocusDescriptor->msCurrentApplicationName.isEmpty() && pFocusDescriptor->msCurrentContextName.isEmpty() && rxEventFocus.is()) { - Reference< lang::XServiceInfo > xServInfo( rxEventFocus, uno::UNO_QUERY_THROW ); + Reference< lang::XServiceInfo > xServInfo( rxEventFocus, uno::UNO_QUERY ); if( xServInfo.is() && xServInfo->getImplementationName() == "com.sun.star.comp.chart2.ChartController") { css::ui::ContextChangeEventObject aEvent ( |