diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-08-03 14:42:55 +0530 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-11-15 17:07:11 +0100 |
commit | cc42b2599dfffa3483699d918f0b8eb28505b54f (patch) | |
tree | b9057eccb41acd41f58d757a4be33ac279faaa4d /sw | |
parent | bba61e62f3481fe389bc9d8cfb2f786624b96b5a (diff) |
lokdialog: Support for rendering floating window dialog widgets
Now gtktiledviewer can show floating window dialog widgets when user
clicks any of such widget in the dialog.
Change-Id: I13d756f236379bc8b2041ed41cb7b502f7fd9b24
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/unotxdoc.hxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 26 |
2 files changed, 29 insertions, 0 deletions
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index d9fa27507544..8dbe8584a49b 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -453,6 +453,7 @@ public: OUString getPostIts() override; void paintDialog(const vcl::DialogID& rDialogID, VirtualDevice& rDevice, int& nWidth, int& nHeight) override; + void paintActiveFloatingWindow(const vcl::DialogID& rDialogID, VirtualDevice& rDevice, int& nWidth, int& nHeight) override; void postDialogKeyEvent(const vcl::DialogID& rDialogID, int nType, int nCharCode, int nKeyCode) override; @@ -461,6 +462,8 @@ public: void notifyDialogInvalidation(const vcl::DialogID& rDialogID) override; + void notifyDialogChild(const vcl::DialogID& rDialogID, const OUString& rAction, const Point& rPos) override; + // css::tiledrendering::XTiledRenderable virtual void SAL_CALL paintTile( const ::css::uno::Any& Parent, ::sal_Int32 nOutputWidth, ::sal_Int32 nOutputHeight, ::sal_Int32 nTilePosX, ::sal_Int32 nTilePosY, ::sal_Int32 nTileWidth, ::sal_Int32 nTileHeight ) throw (::css::uno::RuntimeException, std::exception) override; diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 53844da23e0d..9ccb85598022 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3820,6 +3820,32 @@ void SwXTextDocument::notifyDialogInvalidation(const vcl::DialogID& rDialogID) SfxLokHelper::notifyDialogInvalidation(rDialogID); } +void SwXTextDocument::notifyDialogChild(const vcl::DialogID& rDialogID, const OUString& rAction, const Point& rPos) +{ + SfxLokHelper::notifyDialogChild(rDialogID, rAction, rPos); +} + +void SwXTextDocument::paintActiveFloatingWindow(const vcl::DialogID& rDialogID, VirtualDevice& rDevice, int& nWidth, int& nHeight) +{ + SfxViewFrame* pViewFrame = pDocShell->GetView()->GetViewFrame(); + SfxSlotPool* pSlotPool = SW_MOD()->GetSlotPool(); + const SfxSlot* pSlot = pSlotPool->GetUnoSlot(rDialogID); + if (!pSlot) + { + SAL_WARN("lok.dialog", "No slot found for " << rDialogID); + return; + } + SfxChildWindow* pChild = pViewFrame->GetChildWindow(pSlot->GetSlotId()); + if (!pChild) + return; + + Dialog* pDlg = static_cast<Dialog*>(pChild->GetWindow()); + // register the instance so that vcl::Dialog can emit LOK callbacks + const Size aSize = pDlg->PaintActiveFloatingWindow(rDevice); + nWidth = aSize.getWidth(); + nHeight = aSize.getHeight(); +} + void * SAL_CALL SwXTextDocument::operator new( size_t t) throw() { return SwXTextDocumentBaseClass::operator new(t); |