summaryrefslogtreecommitdiff
path: root/sw/source/uibase/uno/unotxdoc.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase/uno/unotxdoc.cxx')
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx24
1 files changed, 19 insertions, 5 deletions
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index ee9413b1231c..45e905646ed0 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3711,7 +3711,7 @@ void SAL_CALL SwXTextDocument::paintTile( const ::css::uno::Any& Parent, ::sal_I
#endif
}
-void SwXTextDocument::paintDialog(const vcl::DialogID& rDialogID, VirtualDevice& rDevice, OUString& rDialogTitle, int& nWidth, int& nHeight)
+void SwXTextDocument::paintDialog(const vcl::DialogID& rDialogID, VirtualDevice& rDevice)
{
SfxViewFrame* pViewFrame = pDocShell->GetView()->GetViewFrame();
SfxSlotPool* pSlotPool = SW_MOD()->GetSlotPool();
@@ -3737,12 +3737,27 @@ void SwXTextDocument::paintDialog(const vcl::DialogID& rDialogID, VirtualDevice&
// register the instance so that vcl::Dialog can emit LOK callbacks
pDlg->registerDialogRenderable(this, rDialogID);
pDlg->paintDialog(rDevice);
+}
+
+void SwXTextDocument::getDialogInfo(const vcl::DialogID& rDialogID, OUString& rDialogTitle, int& rWidth, int& rHeight)
+{
+ 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;
- // set outparams
+ Dialog* pDlg = static_cast<Dialog*>(pChild->GetWindow());
rDialogTitle = pDlg->GetText();
const Size aSize = pDlg->GetOptimalSize();
- nWidth = aSize.getWidth();
- nHeight = aSize.getHeight();
+ rWidth = aSize.getWidth();
+ rHeight = aSize.getHeight();
}
void SwXTextDocument::postDialogKeyEvent(const vcl::DialogID& rDialogID, int nType, int nCharCode, int nKeyCode)
@@ -3883,7 +3898,6 @@ void SwXTextDocument::paintActiveFloatingWindow(const vcl::DialogID& rDialogID,
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();