summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/dialog/templdlg.cxx1
-rw-r--r--sfx2/source/sidebar/PanelLayout.cxx9
2 files changed, 10 insertions, 0 deletions
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index c76f06b14bbe..27697a46dbfb 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -369,6 +369,7 @@ SfxTemplatePanelControl::SfxTemplatePanelControl(SfxBindings* pBindings, vcl::Wi
, pImpl(new SfxTemplateDialog_Impl(pBindings, this))
{
OSL_ASSERT(pBindings!=nullptr);
+ m_pInitialFocusWidget = pImpl->m_xActionTbL.get();
}
SfxTemplatePanelControl::~SfxTemplatePanelControl()
diff --git a/sfx2/source/sidebar/PanelLayout.cxx b/sfx2/source/sidebar/PanelLayout.cxx
index c419403bdf79..0e37e2278a73 100644
--- a/sfx2/source/sidebar/PanelLayout.cxx
+++ b/sfx2/source/sidebar/PanelLayout.cxx
@@ -18,6 +18,7 @@ using namespace sfx2::sidebar;
PanelLayout::PanelLayout(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription,
const css::uno::Reference<css::frame::XFrame> &rFrame)
: Control(pParent)
+ , m_pInitialFocusWidget(nullptr)
, m_bInClose(false)
, mxFrame(rFrame)
{
@@ -34,6 +35,13 @@ PanelLayout::PanelLayout(vcl::Window* pParent, const OString& rID, const OUStrin
m_xContainer = m_xBuilder->weld_container(rID);
}
+void PanelLayout::GetFocus()
+{
+ Control::GetFocus();
+ if (m_pInitialFocusWidget)
+ m_pInitialFocusWidget->grab_focus();
+}
+
PanelLayout::~PanelLayout()
{
disposeOnce();
@@ -42,6 +50,7 @@ PanelLayout::~PanelLayout()
void PanelLayout::dispose()
{
m_bInClose = true;
+ m_pInitialFocusWidget = nullptr;
m_aPanelLayoutIdle.Stop();
m_xContainer.reset();
m_xBuilder.reset();