summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-12-02 02:47:38 +0530
committerPranav Kant <pranavk@collabora.co.uk>2017-12-04 17:14:03 +0530
commit727c2303cb70a62a35f2e7ff7cd47cdb3ccd556d (patch)
treec78693f81901c57172aaf64a4822a0f2435988aa /sfx2
parentb1bcc70d2a5a51d2cb4b2e9e2a8e6641719fe18b (diff)
lokdialog: multiview: Do not mix one view with other
In GTV, use correct application window object to fetch the dialog object. Use correct view shell to notify window (dialogs, etc.) callbacks. Change-Id: I7d82b39d4522a4b4904e156757a032c342c71efb
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/basedlgs.cxx5
-rw-r--r--sfx2/source/view/lokhelper.cxx8
-rw-r--r--sfx2/source/view/viewsh.cxx2
3 files changed, 7 insertions, 8 deletions
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 16b69cd9c0aa..1de5c4fb2f79 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -249,12 +249,9 @@ void SfxModelessDialog::StateChanged( StateChangedType nStateChange )
if (comphelper::LibreOfficeKit::isActive() && pViewShell)
{
SetLOKNotifier(pViewShell);
- // Below method doesn't really give the exact dimensions,
- // Check GetSizePixel() ?
- const Size aOptimalSize = GetOptimalSize();
std::vector<vcl::LOKPayloadItem> aItems;
aItems.emplace_back(std::make_pair("type", "dialog"));
- aItems.emplace_back(std::make_pair("size", aOptimalSize.toString()));
+ aItems.emplace_back(std::make_pair("size", GetOptimalSize().toString()));
pViewShell->notifyWindow(GetLOKWindowId(), "created", aItems);
}
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index d78763acd3f0..135c36003192 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -144,10 +144,13 @@ void SfxLokHelper::notifyOtherViews(SfxViewShell* pThisView, int nType, const OS
}
}
-void SfxLokHelper::notifyWindow(vcl::LOKWindowId nLOKWindowId,
+void SfxLokHelper::notifyWindow(const SfxViewShell* pThisView,
+ vcl::LOKWindowId nLOKWindowId,
const OUString& rAction,
const std::vector<vcl::LOKPayloadItem>& rPayload)
{
+ assert(pThisView);
+
if (SfxLokHelper::getViewsCount() <= 0 || nLOKWindowId == 0)
return;
@@ -164,8 +167,7 @@ void SfxLokHelper::notifyWindow(vcl::LOKWindowId nLOKWindowId,
}
aPayload += "}";
- if (SfxViewShell* pViewShell = SfxViewShell::Current())
- pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_WINDOW, aPayload.getStr());
+ pThisView->libreOfficeKitViewCallback(LOK_CALLBACK_WINDOW, aPayload.getStr());
}
void SfxLokHelper::notifyInvalidation(SfxViewShell const* pThisView, const OString& rPayload)
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 437a8a744db4..2c38ac071a31 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1950,7 +1950,7 @@ Reference< view::XRenderable > SfxViewShell::GetRenderable()
void SfxViewShell::notifyWindow(vcl::LOKWindowId nDialogId, const OUString& rAction, const std::vector<vcl::LOKPayloadItem>& rPayload) const
{
- SfxLokHelper::notifyWindow(nDialogId, rAction, rPayload);
+ SfxLokHelper::notifyWindow(this, nDialogId, rAction, rPayload);
}
uno::Reference< datatransfer::clipboard::XClipboardNotifier > SfxViewShell::GetClipboardNotifier()