diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-06-30 14:22:40 +0530 |
---|---|---|
committer | Pranav Kant <pranavk@collabora.co.uk> | 2017-06-30 14:22:40 +0530 |
commit | a15784895e4933cfab06fb7fefdf8c7bd47f55a1 (patch) | |
tree | a9245fa8bedacb8ea132b6c54c4a5d6d04dcac62 | |
parent | 04a30aa545038193c9c061db2442aa2292a3470b (diff) |
Use the child window factory to create dialog via uno command
Change-Id: I76c78c5699dae9d23ff6868fe388570b9717c5b9
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index fcc5621354c5..8d5c72016cb7 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -61,6 +61,8 @@ #include <unoredlines.hxx> #include <unosrch.hxx> #include <sfx2/dispatch.hxx> +#include <sfx2/msg.hxx> +#include <sfx2/msgpool.hxx> #include <sfx2/request.hxx> #include <sfx2/objsh.hxx> #include <unoprnms.hxx> @@ -3571,16 +3573,16 @@ void SwXTextDocument::paintDialog(vcl::DialogID /*rDialogID*/, VirtualDevice& rD { SfxViewShell* pViewShell = pDocShell->GetView(); SfxViewFrame* pViewFrame = pViewShell->GetViewFrame(); - SfxChildWindow* pSfxChildWindow = SwSpellDialogChildWindow::CreateImpl(&pViewFrame->GetWindow(), SwSpellDialogChildWindow::GetChildWindowId(), - &pViewFrame->GetBindings(), nullptr); - Size aSize(nWidth, nHeight); + SwModule* pMod = SW_MOD(); + SfxSlotPool* pSlotPool = pMod->GetSlotPool(); + const SfxSlot* pSlot = pSlotPool->GetUnoSlot(".uno:SpellDialog"); - vcl::Window* pWindow = pSfxChildWindow->GetWindow(); + SfxChildWinFactory* pFactory = pMod->GetChildWinFactory(pSlot->GetSlotId()); + SfxChildWindow* pSfxChildWindow = pFactory->pCtor(&pViewFrame->GetWindow(), pFactory->nId, &pViewFrame->GetBindings(), &pFactory->aInfo); - pWindow->SetSizePixel(aSize); - pWindow->Show(); - pWindow->Paint(rDevice, tools::Rectangle(Point(), aSize)); + vcl::Window* pWindow = pSfxChildWindow->GetWindow(); + pWindow->PaintToDevice(&rDevice, Point(0, 0), Size(1, 1) /* Ignored */); } void SwXTextDocument::postDialogMouseEvent(vcl::DialogID /*rDialogID*/, int /*nType*/, int /*nCharCode*/, int /*nKeyCode*/) |