summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2017-06-22 12:20:01 +0200
committerJan Holesovsky <kendy@collabora.com>2017-11-15 17:07:05 +0100
commitd4a7b39d357fa152d3877e2f6022daa2e985b469 (patch)
tree4c9d4728f635d69e1bd3beaad41643af663bf9a1 /sw
parent388858efc64359875e7592013bee000f5e8b4710 (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 afaeb5226a59..1abd5c818edf 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
@@ -3712,12 +3713,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*/)