summaryrefslogtreecommitdiff
path: root/sd
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-21 21:33:30 +0200
commit5261417cbb3051b812164838d19c0f748573df45 (patch)
treed159cce1d6903854fc13437c5cca5ce15e48281f /sd
parentfda464112540011dd6e2bd267720d2800af3a5f2 (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 'sd')
-rw-r--r--sd/inc/Outliner.hxx6
-rw-r--r--sd/source/ui/view/Outliner.cxx20
2 files changed, 17 insertions, 9 deletions
diff --git a/sd/inc/Outliner.hxx b/sd/inc/Outliner.hxx
index 5f4056fdb556..47c3b5d95784 100644
--- a/sd/inc/Outliner.hxx
+++ b/sd/inc/Outliner.hxx
@@ -30,6 +30,10 @@ class SdrObject;
class SdrTextObj;
class SdDrawDocument;
+namespace weld {
+class Window;
+}
+
namespace sd {
class View;
@@ -516,7 +520,7 @@ private:
that the otherwise non-modal search or spell dialogs, if visible, are
locked, too.
*/
- VclPtr<vcl::Window> GetMessageBoxParent();
+ weld::Window* GetMessageBoxParent();
};
#endif
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index a98ad3cd0065..a91d5f70d5d4 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1205,8 +1205,8 @@ void SdOutliner::ShowEndOfSearchDialog()
aString = SdResId(STR_END_SPELLING);
// Show the message in an info box that is modal with respect to the whole application.
- VclPtr<vcl::Window> xParent(GetMessageBoxParent());
- std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(xParent ? xParent->GetFrameWeld() : nullptr,
+ weld::Window* pParent = GetMessageBoxParent();
+ std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pParent,
VclMessageType::Info, VclButtonsType::Ok, aString));
xInfoBox->run();
}
@@ -1246,8 +1246,8 @@ bool SdOutliner::ShowWrapArroundDialog()
// Pop up question box that asks the user whether to wrap around.
// The dialog is made modal with respect to the whole application.
- VclPtr<vcl::Window> xParent(GetMessageBoxParent());
- std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(xParent ? xParent->GetFrameWeld() : nullptr,
+ weld::Window* pParent = GetMessageBoxParent();
+ std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pParent,
VclMessageType::Question, VclButtonsType::YesNo, SdResId(pStringId)));
sal_uInt16 nBoxResult = xQueryBox->run();
@@ -1691,7 +1691,7 @@ bool SdOutliner::ConvertNextDocument()
return !mbEndOfSearch;
}
-VclPtr<vcl::Window> SdOutliner::GetMessageBoxParent()
+weld::Window* SdOutliner::GetMessageBoxParent()
{
// We assume that the parent of the given message box is NULL, i.e. it is
// modal with respect to the top application window. However, this
@@ -1699,7 +1699,7 @@ VclPtr<vcl::Window> SdOutliner::GetMessageBoxParent()
// while the message box is being shown. We also have to take into
// account that we are called during a spell check and the search dialog
// is not available.
- vcl::Window* pSearchDialog = nullptr;
+ weld::Window* pSearchDialog = nullptr;
SfxChildWindow* pChildWindow = nullptr;
switch (meMode)
{
@@ -1720,13 +1720,17 @@ VclPtr<vcl::Window> SdOutliner::GetMessageBoxParent()
}
if (pChildWindow != nullptr)
- pSearchDialog = pChildWindow->GetWindow();
+ {
+ auto xController = pChildWindow->GetController();
+ pSearchDialog = xController ? xController->getDialog() : nullptr;
+ }
if (pSearchDialog)
return pSearchDialog;
std::shared_ptr<sd::ViewShell> pViewShell (mpWeakViewShell.lock());
- return pViewShell->GetActiveWindow();
+ auto pWin = pViewShell->GetActiveWindow();
+ return pWin ? pWin->GetFrameWeld() : nullptr;
}
//===== SdOutliner::Implementation ==============================================