summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-06-14 21:56:44 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-06-22 19:28:38 +0200
commit243b5b392906042ab03800e0b5765e6f3513372c (patch)
treed82300c65829578bddbb34e37e0fb08ac544d9aa /sfx2
parent01cd1d68d96057624db38b9baaa6c6795353758d (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/74535 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.cxx6
-rw-r--r--sfx2/source/dialog/basedlgs.cxx15
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 5dc2067dd23d..0d4da9eaaef9 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -423,9 +423,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()
@@ -436,11 +439,6 @@ void SfxModelessDialogController::Activate()
m_xImpl->pMgr->Activate_Impl();
}
-IMPL_LINK_NOARG(SfxDialogController, FocusOutHdl, weld::Widget&, void)
-{
- Deactivate();
-}
-
void SfxModelessDialogController::Deactivate()
{
if (!m_xImpl)
@@ -713,8 +711,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*)