summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2015-11-06 08:06:00 +0100
committerJan Holesovsky <kendy@collabora.com>2015-11-10 10:30:47 +0100
commit03b7f55a859f9998d918557f19831a4579eca1db (patch)
treebc874bc94bb40e1124739074290e235734a538cc /sfx2/source
parent4815a27f41eb55aa29346a3e77dd870d88c385ee (diff)
tdf#92866 startcenter: Make the accellerators work again.
I still have no idea what is the root cause here (why the accellerators do not work 'automagically') - I suspect it is because we don't have a shell there, and instead only a vcl::Window, or something like that :-) Either way, when we handle the accellerators already in PreNotify(), it works as expected, so let's live with that for the time being. (cherry picked from commit 51c14b1c262bced0cb61c943caad044be9e95c15) Conflicts: sfx2/source/dialog/backingwindow.hxx Change-Id: Id050fd8f5fff38914821cb64eaa3ae7281fc6d50
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/dialog/backingwindow.cxx17
-rw-r--r--sfx2/source/dialog/backingwindow.hxx1
2 files changed, 5 insertions, 13 deletions
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index dabfeaf82ff1..5686c434d27a 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -413,6 +413,7 @@ bool BackingWindow::PreNotify( NotifyEvent& rNEvt )
{
const KeyEvent* pEvt = rNEvt.GetKeyEvent();
const vcl::KeyCode& rKeyCode(pEvt->GetKeyCode());
+
// Subwindows of BackingWindow: Sidebar and Thumbnail view
if( rKeyCode.GetCode() == KEY_F6 )
{
@@ -438,28 +439,20 @@ bool BackingWindow::PreNotify( NotifyEvent& rNEvt )
}
}
}
- }
- return Window::PreNotify( rNEvt );
-}
-bool BackingWindow::Notify( NotifyEvent& rNEvt )
-{
- if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
- {
// try the 'normal' accelerators (so that eg. Ctrl+Q works)
- if( !mpAccExec )
+ if (!mpAccExec)
{
mpAccExec = svt::AcceleratorExecute::createAcceleratorHelper();
mpAccExec->init( comphelper::getProcessComponentContext(), mxFrame);
}
- const KeyEvent* pEvt = rNEvt.GetKeyEvent();
- const vcl::KeyCode& rKeyCode(pEvt->GetKeyCode());
+
const OUString aCommand = mpAccExec->findCommand(svt::AcceleratorExecute::st_VCLKey2AWTKey(rKeyCode));
- if((aCommand != "vnd.sun.star.findbar:FocusToFindbar") && pEvt && mpAccExec->execute(rKeyCode))
+ if ((aCommand != "vnd.sun.star.findbar:FocusToFindbar") && pEvt && mpAccExec->execute(rKeyCode))
return true;
}
- return Window::Notify( rNEvt );
+ return Window::PreNotify( rNEvt );
}
void BackingWindow::GetFocus()
diff --git a/sfx2/source/dialog/backingwindow.hxx b/sfx2/source/dialog/backingwindow.hxx
index 1adc6e1be1a2..8dfa84f43e46 100644
--- a/sfx2/source/dialog/backingwindow.hxx
+++ b/sfx2/source/dialog/backingwindow.hxx
@@ -125,7 +125,6 @@ public:
virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
virtual bool PreNotify(NotifyEvent& rNEvt) SAL_OVERRIDE;
- virtual bool Notify(NotifyEvent& rNEvt) SAL_OVERRIDE;
virtual void GetFocus() SAL_OVERRIDE;
virtual Size GetOptimalSize() const SAL_OVERRIDE;