From 6de338782529f65e3adb945a5e48cc6eb4f60603 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 22 Sep 2016 09:19:09 +0100 Subject: Resolves: tdf#100670 Crash in: sfx2::sidebar::Panel::SetExpanded(bool) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit partial backport of commit e964c55f463c5b9daeb41dbed6c330b40911c313 Author: Caolán McNamara Date: Fri Jan 29 18:52:34 2016 +0000 implement missing FID_FUNCTION_BOX GetState since it was turned into a sidebar thing exact how-to-reproduce of tdf#102045 is currently avoided because of... commit e1e61bf5e5f368fc1ea579f8ae5eec9faafbd599 Author: Caolán McNamara Date: Fri Jun 3 11:06:22 2016 +0100 Resolves: tdf#88396 switching to sidebar panel will toggle it *off*... if its already visible. Change-Id: I17827488e49338a77ae55ba32a06415067123be8 Reviewed-on: https://gerrit.libreoffice.org/29170 Reviewed-by: Michael Stahl Tested-by: Christian Lohmaier --- sfx2/source/sidebar/Sidebar.cxx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sfx2/source/sidebar/Sidebar.cxx b/sfx2/source/sidebar/Sidebar.cxx index 02a17f43b8be..2fa29f4a6788 100644 --- a/sfx2/source/sidebar/Sidebar.cxx +++ b/sfx2/source/sidebar/Sidebar.cxx @@ -30,19 +30,21 @@ void Sidebar::ShowPanel ( const css::uno::Reference& rxFrame) { SidebarController* pController = SidebarController::GetSidebarControllerForFrame(rxFrame); + if (!pController) + return; std::shared_ptr xPanelDescriptor = pController->GetResourceManager()->GetPanelDescriptor(rsPanelId); - if (pController && xPanelDescriptor) - { - // This should be a lot more sophisticated: - // - Make the deck switching asynchronous - // - Make sure to use a context that really shows the panel + if (!xPanelDescriptor) + return; + + // This should be a lot more sophisticated: + // - Make the deck switching asynchronous + // - Make sure to use a context that really shows the panel - // All that is not necessary for the current use cases so lets - // keep it simple for the time being. - pController->OpenThenSwitchToDeck(xPanelDescriptor->msDeckId); - } + // All that is not necessary for the current use cases so lets + // keep it simple for the time being. + pController->OpenThenSwitchToDeck(xPanelDescriptor->msDeckId); } void Sidebar::TogglePanel ( -- cgit v1.2.3