tdf#103756 - CTRL+Z not working to undo changes performed through Navigator
Hooked up the tree control to do explicit handling of accelerator key input. Change-Id: I8b47fc2d651f7db2549c73c5314fbc4a7f4efecc Reviewed-on: https://gerrit.libreoffice.org/30694 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
This commit is contained in:
committed by
Miklos Vajna
parent
2ed4034aa5
commit
e9da91fd02
@@ -49,6 +49,7 @@
|
|||||||
#include <com/sun/star/embed/XEmbedPersist.hpp>
|
#include <com/sun/star/embed/XEmbedPersist.hpp>
|
||||||
#include <com/sun/star/frame/Desktop.hpp>
|
#include <com/sun/star/frame/Desktop.hpp>
|
||||||
#include <com/sun/star/frame/XFramesSupplier.hpp>
|
#include <com/sun/star/frame/XFramesSupplier.hpp>
|
||||||
|
#include <svtools/acceleratorexecute.hxx>
|
||||||
#include <svtools/embedtransfer.hxx>
|
#include <svtools/embedtransfer.hxx>
|
||||||
#include <svtools/svlbitm.hxx>
|
#include <svtools/svlbitm.hxx>
|
||||||
#include <svtools/treelistentry.hxx>
|
#include <svtools/treelistentry.hxx>
|
||||||
@@ -56,6 +57,8 @@
|
|||||||
#include <comphelper/processfactory.hxx>
|
#include <comphelper/processfactory.hxx>
|
||||||
#include <tools/diagnose_ex.h>
|
#include <tools/diagnose_ex.h>
|
||||||
#include <o3tl/make_unique.hxx>
|
#include <o3tl/make_unique.hxx>
|
||||||
|
|
||||||
|
|
||||||
using namespace com::sun::star;
|
using namespace com::sun::star;
|
||||||
|
|
||||||
class SdPageObjsTLB::IconProvider
|
class SdPageObjsTLB::IconProvider
|
||||||
@@ -214,8 +217,19 @@ SdPageObjsTLB::SdPageObjsTLB( vcl::Window* pParentWin, WinBits nStyle )
|
|||||||
SetDragDropMode(
|
SetDragDropMode(
|
||||||
DragDropMode::CTRL_MOVE | DragDropMode::CTRL_COPY |
|
DragDropMode::CTRL_MOVE | DragDropMode::CTRL_COPY |
|
||||||
DragDropMode::APP_MOVE | DragDropMode::APP_COPY | DragDropMode::APP_DROP );
|
DragDropMode::APP_MOVE | DragDropMode::APP_COPY | DragDropMode::APP_DROP );
|
||||||
|
|
||||||
|
m_pAccel = ::svt::AcceleratorExecute::createAcceleratorHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SdPageObjsTLB::SetViewFrame( SfxViewFrame* pViewFrame )
|
||||||
|
{
|
||||||
|
mpFrame = pViewFrame;
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SdPageObjsTLB::~SdPageObjsTLB()
|
SdPageObjsTLB::~SdPageObjsTLB()
|
||||||
{
|
{
|
||||||
disposeOnce();
|
disposeOnce();
|
||||||
@@ -230,6 +244,7 @@ void SdPageObjsTLB::dispose()
|
|||||||
delete mpMedium;
|
delete mpMedium;
|
||||||
mpParent.clear();
|
mpParent.clear();
|
||||||
mpDropNavWin.clear();
|
mpDropNavWin.clear();
|
||||||
|
m_pAccel.reset();
|
||||||
SvTreeListBox::dispose();
|
SvTreeListBox::dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1037,6 +1052,10 @@ void SdPageObjsTLB::SelectHdl()
|
|||||||
*/
|
*/
|
||||||
void SdPageObjsTLB::KeyInput( const KeyEvent& rKEvt )
|
void SdPageObjsTLB::KeyInput( const KeyEvent& rKEvt )
|
||||||
{
|
{
|
||||||
|
const vcl::KeyCode& aKeyCode = rKEvt.GetKeyCode();
|
||||||
|
if ( m_pAccel->execute( aKeyCode ) )
|
||||||
|
// the accelerator consumed the event
|
||||||
|
return;
|
||||||
if( rKEvt.GetKeyCode().GetCode() == KEY_RETURN )
|
if( rKEvt.GetKeyCode().GetCode() == KEY_RETURN )
|
||||||
{
|
{
|
||||||
// commented code from svtools/source/contnr/svimpbox.cxx
|
// commented code from svtools/source/contnr/svimpbox.cxx
|
||||||
|
@@ -50,6 +50,9 @@ class DrawDocShell;
|
|||||||
typedef ::tools::SvRef<DrawDocShell> DrawDocShellRef;
|
typedef ::tools::SvRef<DrawDocShell> DrawDocShellRef;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
namespace svt {
|
||||||
|
class AcceleratorExecute;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Effect-Tab-Dialog
|
* Effect-Tab-Dialog
|
||||||
@@ -62,6 +65,8 @@ private:
|
|||||||
|
|
||||||
// set contenttree in SdNavigatorWin
|
// set contenttree in SdNavigatorWin
|
||||||
bool bisInSdNavigatorWin;
|
bool bisInSdNavigatorWin;
|
||||||
|
|
||||||
|
::std::unique_ptr< ::svt::AcceleratorExecute> m_pAccel;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// nested class to implement the TransferableHelper
|
// nested class to implement the TransferableHelper
|
||||||
@@ -192,7 +197,7 @@ public:
|
|||||||
virtual void SelectHdl() override;
|
virtual void SelectHdl() override;
|
||||||
virtual void KeyInput( const KeyEvent& rKEvt ) override;
|
virtual void KeyInput( const KeyEvent& rKEvt ) override;
|
||||||
|
|
||||||
void SetViewFrame( SfxViewFrame* pViewFrame ) { mpFrame = pViewFrame; }
|
void SetViewFrame( SfxViewFrame* pViewFrame );
|
||||||
|
|
||||||
void Fill( const SdDrawDocument*, bool bAllPages, const OUString& rDocName );
|
void Fill( const SdDrawDocument*, bool bAllPages, const OUString& rDocName );
|
||||||
void Fill( const SdDrawDocument*, SfxMedium* pSfxMedium, const OUString& rDocName );
|
void Fill( const SdDrawDocument*, SfxMedium* pSfxMedium, const OUString& rDocName );
|
||||||
|
Reference in New Issue
Block a user