summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2017-11-24 18:50:05 +0100
committerJan Holesovsky <kendy@collabora.com>2017-11-28 19:49:18 +0100
commit80d9696eb76e69101996c7a35ffec4c247e079d8 (patch)
tree2594fea36623214f7be95ada417e2813bbc9a8ed /sw
parent42777e61a4060b7b78795a5bb89e3155327a2555 (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.hxx15
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx117
2 files changed, 4 insertions, 128 deletions
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index e16dc50f43f4..f8865610db15 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -69,7 +69,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>
@@ -131,7 +130,6 @@ class SW_DLLPUBLIC SwXTextDocument : public SwXTextDocumentBaseClass,
public SvxFmMSFactory,
public SfxBaseModel,
public vcl::ITiledRenderable,
- public vcl::IDialogRenderable,
public css::tiledrendering::XTiledRenderable
{
private:
@@ -452,17 +450,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 ) throw (::css::uno::RuntimeException, std::exception) override;
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index be7df40f4619..f92e720a34e8 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3711,123 +3711,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()