From 0af5348f5d724abc6047055d1585fe3fda9ee6e1 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 6 Dec 2016 16:11:31 +0200 Subject: tdf#103756 fix crash of this on 5-2 with initial backport MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This crashing when the user hits ctrl-Z, because when I backported: commit d1909ab7940109ce7d43da04e480db4e82b8310f Author: Noel Grandin Date: Tue Nov 8 16:15:55 2016 +0200 tdf#103756 - CTRL+Z not working to undo changes performed through Navigator I missed that the older version of SdPageObjsTLB has two constructors while the new version (on master) only has one, and I only added the new line of code to one of them. Change-Id: Ic5bc59a20e26fecb823f5b0fadba874b947e77ad Reviewed-on: https://gerrit.libreoffice.org/31680 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara (cherry picked from commit 78223678b7513ffe46804cb08f2dc5bc899b2bab) Reviewed-on: https://gerrit.libreoffice.org/31708 Reviewed-by: Andras Timar Reviewed-by: Noel Grandin --- sd/source/ui/dlg/sdtreelb.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 0aeab054e253..5f1a7c5789c6 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -224,6 +224,8 @@ SdPageObjsTLB::SdPageObjsTLB( vcl::Window* pParentWin, const SdResId& rSdResId ) SetDragDropMode( DragDropMode::CTRL_MOVE | DragDropMode::CTRL_COPY | DragDropMode::APP_MOVE | DragDropMode::APP_COPY | DragDropMode::APP_DROP ); + + m_pAccel = ::svt::AcceleratorExecute::createAcceleratorHelper(); } SdPageObjsTLB::SdPageObjsTLB( vcl::Window* pParentWin, WinBits nStyle ) @@ -262,12 +264,9 @@ SdPageObjsTLB::SdPageObjsTLB( vcl::Window* pParentWin, WinBits nStyle ) void SdPageObjsTLB::SetViewFrame( SfxViewFrame* pViewFrame ) { mpFrame = pViewFrame; - if (m_pAccel) - { - sd::ViewShellBase* pBase = sd::ViewShellBase::GetViewShellBase(pViewFrame); - const css::uno::Reference< css::frame::XFrame > xFrame = pBase->GetMainViewShell()->GetViewFrame()->GetFrame().GetFrameInterface(); - m_pAccel->init(::comphelper::getProcessComponentContext(), xFrame); - } + sd::ViewShellBase* pBase = sd::ViewShellBase::GetViewShellBase(pViewFrame); + const css::uno::Reference< css::frame::XFrame > xFrame = pBase->GetMainViewShell()->GetViewFrame()->GetFrame().GetFrameInterface(); + m_pAccel->init(::comphelper::getProcessComponentContext(), xFrame); } -- cgit