diff options
author | Jan Holesovsky <kendy@collabora.com> | 2017-11-24 18:50:05 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-11-29 10:16:57 +0100 |
commit | e2ae221f6164ba240da7d6470fd52c1982fa07d2 (patch) | |
tree | b8d37d7566c0bc4435c6c02e03d632912843ee0e /sw | |
parent | 5de24bea47e7ae971a53b51ee7d1b85d134bbe52 (diff) |
lokdialog: Move the painting down to Window, and enable Calc and Impress.
Tested with .uno:FormatCellDialog in Calc, Impress not tested.
Change-Id: I6d911c29616988db0625be9e2a63cf2172c69ee8
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/unotxdoc.hxx | 15 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 117 |
2 files changed, 4 insertions, 128 deletions
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 85c1d4a4ead6..288f32fa3df7 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -70,7 +70,6 @@ #include <cppuhelper/implbase.hxx> #include <vcl/event.hxx> #include <vcl/ITiledRenderable.hxx> -#include <vcl/IDialogRenderable.hxx> #include <com/sun/star/tiledrendering/XTiledRenderable.hpp> #include "unobaseclass.hxx" @@ -132,7 +131,6 @@ class SW_DLLPUBLIC SwXTextDocument : public SwXTextDocumentBaseClass, public SvxFmMSFactory, public SfxBaseModel, public vcl::ITiledRenderable, - public vcl::IDialogRenderable, public css::tiledrendering::XTiledRenderable { private: @@ -431,17 +429,8 @@ public: /// @see vcl::ITiledRenderable::getPostIts(). OUString getPostIts() override; - void paintDialog(const vcl::LOKWindowId& rLOKWindowId, VirtualDevice& rDevice) override; - void getDialogInfo(const vcl::LOKWindowId& rLOKWindowId, OUString& rDialogTitle, int& rWidth, int& rHeight) override; - void paintActiveFloatingWindow(const vcl::LOKWindowId& rLOKWindowId, VirtualDevice& rDevice, int& nWidth, int& nHeight) override; - void postDialogKeyEvent(const vcl::LOKWindowId& rLOKWindowId, int nType, - int nCharCode, int nKeyCode) override; - - void postDialogMouseEvent(const vcl::LOKWindowId& rLOKWindowId, int nType, int nX, int nY, - int nCount, int nButtons, int nModifier) override; - - void postDialogChildMouseEvent(const vcl::LOKWindowId& rLOKWindowId, int nType, int nX, int nY, - int nCount, int nButtons, int nModifier) override; + /// @see vcl::ITiledRenderable::findWindow(). + VclPtr<vcl::Window> findWindow(vcl::LOKWindowId nLOKWindowId) const 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 ) override; diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index fc7c7a6a2b59..cae647d2948b 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3639,123 +3639,10 @@ void SAL_CALL SwXTextDocument::paintTile( const ::css::uno::Any& Parent, ::sal_I #endif } -void SwXTextDocument::paintDialog(const vcl::LOKWindowId& rLOKWindowId, VirtualDevice& rDevice) +VclPtr<vcl::Window> SwXTextDocument::findWindow(vcl::LOKWindowId nLOKWindowId) const { SfxViewShell* pViewShell = SfxViewShell::Current(); - VclPtr<Dialog> pDlg = pViewShell->GetOpenedDlg(rLOKWindowId); - if (pDlg) - pDlg->paintDialog(rDevice); -} - -void SwXTextDocument::getDialogInfo(const vcl::LOKWindowId& rLOKWindowId, OUString& rDialogTitle, int& rWidth, int& rHeight) -{ - SfxViewShell* pViewShell = SfxViewShell::Current(); - VclPtr<Dialog> pDlg = pViewShell->GetOpenedDlg(rLOKWindowId); - if (pDlg) - { - rDialogTitle = pDlg->GetText(); - const Size aSize = pDlg->GetOptimalSize(); - rWidth = aSize.getWidth(); - rHeight = aSize.getHeight(); - } -} - -void SwXTextDocument::postDialogKeyEvent(const vcl::LOKWindowId& rLOKWindowId, int nType, int nCharCode, int nKeyCode) -{ - SolarMutexGuard aGuard; - - SfxViewShell* pViewShell = SfxViewShell::Current(); - VclPtr<Dialog> pDialog = pViewShell->GetOpenedDlg(rLOKWindowId); - if (pDialog) - { - KeyEvent aEvent(nCharCode, nKeyCode, 0); - - switch (nType) - { - case LOK_KEYEVENT_KEYINPUT: - pDialog->LOKKeyInput(aEvent); - break; - case LOK_KEYEVENT_KEYUP: - pDialog->LOKKeyUp(aEvent); - break; - default: - assert(false); - break; - } - } -} - -void SwXTextDocument::postDialogMouseEvent(const vcl::LOKWindowId& rLOKWindowId, int nType, int nX, int nY, - int nCount, int nButtons, int nModifier) -{ - SolarMutexGuard aGuard; - - SfxViewShell* pViewShell = SfxViewShell::Current(); - VclPtr<Dialog> pDialog = pViewShell->GetOpenedDlg(rLOKWindowId); - if (pDialog) - { - Point aPos(nX , nY); - MouseEvent aEvent(aPos, nCount, MouseEventModifiers::SIMPLECLICK, nButtons, nModifier); - - switch (nType) - { - case LOK_MOUSEEVENT_MOUSEBUTTONDOWN: - pDialog->LogicMouseButtonDown(aEvent); - break; - case LOK_MOUSEEVENT_MOUSEBUTTONUP: - pDialog->LogicMouseButtonUp(aEvent); - break; - case LOK_MOUSEEVENT_MOUSEMOVE: - pDialog->LogicMouseMove(aEvent); - break; - default: - assert(false); - break; - } - } -} - - -void SwXTextDocument::postDialogChildMouseEvent(const vcl::LOKWindowId& rLOKWindowId, int nType, int nX, int nY, - int nCount, int nButtons, int nModifier) -{ - SolarMutexGuard aGuard; - - SfxViewShell* pViewShell = SfxViewShell::Current(); - VclPtr<Dialog> pDialog = pViewShell->GetOpenedDlg(rLOKWindowId); - if (pDialog) - { - Point aPos(nX , nY); - MouseEvent aEvent(aPos, nCount, MouseEventModifiers::SIMPLECLICK, nButtons, nModifier); - - switch (nType) - { - case LOK_MOUSEEVENT_MOUSEBUTTONDOWN: - pDialog->LogicMouseButtonDownChild(aEvent); - break; - case LOK_MOUSEEVENT_MOUSEBUTTONUP: - pDialog->LogicMouseButtonUpChild(aEvent); - break; - case LOK_MOUSEEVENT_MOUSEMOVE: - pDialog->LogicMouseMoveChild(aEvent); - break; - default: - assert(false); - break; - } - } -} - -void SwXTextDocument::paintActiveFloatingWindow(const vcl::LOKWindowId& rLOKWindowId, VirtualDevice& rDevice, int& nWidth, int& nHeight) -{ - SfxViewShell* pViewShell = SfxViewShell::Current(); - VclPtr<Dialog> pDialog = pViewShell->GetOpenedDlg(rLOKWindowId); - if (pDialog) - { - const Size aSize = pDialog->PaintActiveFloatingWindow(rDevice); - nWidth = aSize.getWidth(); - nHeight = aSize.getHeight(); - } + return pViewShell->GetOpenedDlg(nLOKWindowId); } void * SAL_CALL SwXTextDocument::operator new( size_t t) throw() |