summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2017-06-22 12:20:01 +0200
committerPranav Kant <pranavk@collabora.co.uk>2017-10-02 10:54:11 +0530
commitabc2e3aaa5d7f201671b6fff2bc211bde0bbe22c (patch)
tree817c2e928856af5fc706a8e68192d752ab15fcf1 /sw
parente81338c4e66a3f1193ed338ebab8c436a830db6b (diff)
Instantiate spell dialog and paint in a paintDialog call
Change-Id: I7bd7f9cb33cd79d1e55ce51fe39917c5741bdf18
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx17
1 files changed, 13 insertions, 4 deletions
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index dfc75a7f824d..78d3ffe123fc 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -168,6 +168,7 @@
#include <svx/svdview.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/servicehelper.hxx>
+#include <SwSpellDialogChildWindow.hxx>
#include <memory>
#define TWIPS_PER_PIXEL 15
@@ -3640,12 +3641,20 @@ vcl::DialogID SwXTextDocument::findDialog()
return vcl::DialogID(0);
}
-void SwXTextDocument::paintDialog(vcl::DialogID /*rDialogID*/, VirtualDevice& /*rDevice*/, int /*nWidth*/, int /*nHeight*/)
+void SwXTextDocument::paintDialog(vcl::DialogID /*rDialogID*/, VirtualDevice& rDevice, int nWidth, int nHeight)
{
- //SwViewShell* pViewShell = pDocShell->GetWrtShell();
+ SfxViewShell* pViewShell = pDocShell->GetView();
+ SfxViewFrame* pViewFrame = pViewShell->GetViewFrame();
+ SfxChildWindow* pSfxChildWindow = SwSpellDialogChildWindow::CreateImpl(&pViewFrame->GetWindow(), SwSpellDialogChildWindow::GetChildWindowId(),
+ &pViewFrame->GetBindings(), nullptr);
+
+ Size aSize(nWidth, nHeight);
+
+ vcl::Window* pWindow = pSfxChildWindow->GetWindow();
- //SwSpellDialogChildWindow::CreateImpl(nullptr, SwSpellDialogChildWindow::GetChildWindowId(),
- // pViewShell->GetBindings(), );
+ pWindow->SetSizePixel(aSize);
+ pWindow->Show();
+ pWindow->Paint(rDevice, tools::Rectangle(Point(), aSize));
}
void SwXTextDocument::postDialogMouseEvent(vcl::DialogID /*rDialogID*/, int /*nType*/, int /*nCharCode*/, int /*nKeyCode*/)