diff options
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/templatedlg.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 114c6a7120a0..63056eb7254a 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -299,6 +299,27 @@ short SfxTemplateManagerDlg::Execute() return ModalDialog::Execute(); } +bool SfxTemplateManagerDlg::EventNotify( NotifyEvent& rNEvt ) +{ + if (mpSearchFilter != nullptr && + mpSearchFilter->HasControlFocus() && + !mpSearchFilter->GetText().isEmpty() && + rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) + { + const KeyEvent* pKEvt = rNEvt.GetKeyEvent(); + vcl::KeyCode aKeyCode = pKEvt->GetKeyCode(); + sal_uInt16 nKeyCode = aKeyCode.GetCode(); + + if ( nKeyCode == KEY_ESCAPE ) + { + mpSearchFilter->SetText(""); + mpSearchFilter->UpdateData(); + return true; + } + } + return ModalDialog::EventNotify(rNEvt); +} + void SfxTemplateManagerDlg::setDocumentModel(const uno::Reference<frame::XModel> &rModel) { m_xModel = rModel; |