diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-03-20 17:21:55 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-03-20 22:17:01 +0100 |
commit | 122839ea51b3e8ec54d97d43bdbf616db00ae9cd (patch) | |
tree | a0d8aaaa5bf2fba0acf4ee6d5435876e58bde3d1 | |
parent | 102822646c5729d4edea83ddd66ccd0115cfd83e (diff) |
tdf#124226 do fill-on-demand hack only on first visit
disconnect focus handler after the fill
Change-Id: I77bffe4fa4c516452c36ddb2d816cd5844000c1b
Reviewed-on: https://gerrit.libreoffice.org/69479
Tested-by: Xisco Faulí <xiscofauli@libreoffice.org>
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | cui/source/tabpages/page.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index 2a51bc302d30..94f15b630672 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -308,7 +308,6 @@ void SvxPageDescPage::Init_Impl() // adjust the handler m_xLayoutBox->connect_changed(LINK(this, SvxPageDescPage, LayoutHdl_Impl)); - m_xPaperTrayBox->connect_focus_in(LINK(this, SvxPageDescPage, PaperBinHdl_Impl)); m_xPaperSizeBox->connect_changed(LINK(this, SvxPageDescPage, PaperSizeSelect_Impl)); m_xPaperWidthEdit->connect_value_changed( LINK(this, SvxPageDescPage, PaperSizeModify_Impl)); m_xPaperHeightEdit->connect_value_changed(LINK(this, SvxPageDescPage, PaperSizeModify_Impl)); @@ -410,6 +409,10 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet ) m_xPaperTrayBox->append(OUString::number(nPaperBin), aBinName); m_xPaperTrayBox->set_active_text(aBinName); + // reset focus handler to default first so know none already connected + m_xPaperTrayBox->connect_focus_in(Link<weld::Widget&, void>()); + // update the list when widget gets focus + m_xPaperTrayBox->connect_focus_in(LINK(this, SvxPageDescPage, PaperBinHdl_Impl)); Size aPaperSize = SvxPaperInfo::GetPaperSize( mpDefPrinter ); pItem = GetItem( *rSet, SID_ATTR_PAGE_SIZE ); @@ -804,9 +807,8 @@ IMPL_LINK_NOARG(SvxPageDescPage, LayoutHdl_Impl, weld::ComboBox&, void) IMPL_LINK_NOARG(SvxPageDescPage, PaperBinHdl_Impl, weld::Widget&, void) { - if (m_xPaperTrayBox->get_count() > 1) - // already filled - return; + // tdf#124226 disconnect so not called again, unless Reset occurs + m_xPaperTrayBox->connect_focus_in(Link<weld::Widget&, void>()); OUString aOldName = m_xPaperTrayBox->get_active_text(); m_xPaperTrayBox->freeze(); @@ -826,6 +828,7 @@ IMPL_LINK_NOARG(SvxPageDescPage, PaperBinHdl_Impl, weld::Widget&, void) } m_xPaperTrayBox->set_active_text(aOldName); m_xPaperTrayBox->thaw(); + // tdf#123650 explicitly grab-focus after the modification otherwise gtk loses track // of there the focus should be m_xPaperTrayBox->grab_focus(); |