diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-06-14 21:56:44 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-06-21 21:33:30 +0200 |
commit | 5261417cbb3051b812164838d19c0f748573df45 (patch) | |
tree | d159cce1d6903854fc13437c5cca5ce15e48281f /sfx2 | |
parent | fda464112540011dd6e2bd267720d2800af3a5f2 (diff) |
weld SpellDialog
a) use EditEngine instead of TextEngine as the former can be hosted in a
foreign widget
b) use a SfxGrabBagItem to hold the custom spellchecking info inside the
EditEngine
c) in longer paragraphs the current word is now auto-scrolled into view
d) rename Invalidate to InvalidateDialog
Change-Id: Ic6db019c32cdfd5f354c58ee7394fdaa040b86e1
Reviewed-on: https://gerrit.libreoffice.org/74119
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appinit.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/dialog/basedlgs.cxx | 15 |
2 files changed, 9 insertions, 12 deletions
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx index 543200717c87..89e1ea98d197 100644 --- a/sfx2/source/appl/appinit.cxx +++ b/sfx2/source/appl/appinit.cxx @@ -142,7 +142,7 @@ Sequence< OUString > SAL_CALL SfxTerminateListener_Impl::getSupportedServiceName } -typedef bool ( *PFunc_getSpecialCharsForEdit)( vcl::Window const * i_pParent, const vcl::Font& i_rFont, OUString& o_rOutString ); +typedef bool (*PFunc_getSpecialCharsForEdit)(weld::Widget* i_pParent, const vcl::Font& i_rFont, OUString& o_rOutString); // Lazy binding of the GetSpecialCharsForEdit function as it resides in @@ -155,11 +155,11 @@ extern "C" { static void thisModule() {} } #else -extern "C" bool GetSpecialCharsForEdit( vcl::Window const * i_pParent, const vcl::Font& i_rFont, OUString& o_rOutString ); +extern "C" bool GetSpecialCharsForEdit(weld::Widget* i_pParent, const vcl::Font& i_rFont, OUString& o_rOutString); #endif -static OUString SfxGetSpecialCharsForEdit(vcl::Window* pParent, const vcl::Font& rFont) +static OUString SfxGetSpecialCharsForEdit(weld::Widget* pParent, const vcl::Font& rFont) { static bool bDetermineFunction = false; static PFunc_getSpecialCharsForEdit pfunc_getSpecialCharsForEdit = nullptr; diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index f902196eccbe..e1f74636c58f 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -386,9 +386,12 @@ void SfxModelessDialogController::Init(SfxBindings *pBindinx, SfxChildWindow *pC If a ModelessDialog is enabled its ViewFrame will be activated. This is necessary by PluginInFrames. */ -IMPL_LINK_NOARG(SfxDialogController, FocusInHdl, weld::Widget&, void) +IMPL_LINK_NOARG(SfxDialogController, FocusChangeHdl, weld::Widget&, void) { - Activate(); + if (m_xDialog->has_toplevel_focus()) + Activate(); + else + Deactivate(); } void SfxModelessDialogController::Activate() @@ -399,11 +402,6 @@ void SfxModelessDialogController::Activate() m_xImpl->pMgr->Activate_Impl(); } -IMPL_LINK_NOARG(SfxDialogController, FocusOutHdl, weld::Widget&, void) -{ - Deactivate(); -} - void SfxModelessDialogController::Deactivate() { if (!m_xImpl) @@ -676,8 +674,7 @@ SfxDialogController::SfxDialogController(weld::Widget* pParent, const OUString& : GenericDialogController(pParent, rUIFile, rDialogId) { m_xDialog->SetInstallLOKNotifierHdl(LINK(this, SfxDialogController, InstallLOKNotifierHdl)); - m_xDialog->connect_focus_in(LINK(this, SfxDialogController, FocusInHdl)); - m_xDialog->connect_focus_out(LINK(this, SfxDialogController, FocusOutHdl)); + m_xDialog->connect_toplevel_focus_changed(LINK(this, SfxDialogController, FocusChangeHdl)); } IMPL_STATIC_LINK_NOARG(SfxDialogController, InstallLOKNotifierHdl, void*, vcl::ILibreOfficeKitNotifier*) |