summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/view/lokhelper.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 856a007a4206..41131604709a 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -11,12 +11,17 @@
#include <boost/property_tree/json_parser.hpp>
+#include <com/sun/star/frame/Desktop.hpp>
+
+#include <comphelper/processfactory.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/request.hxx>
#include <sfx2/viewfrm.hxx>
#include <shellimpl.hxx>
+using namespace com::sun::star;
+
int SfxLokHelper::createView()
{
SfxViewFrame* pViewFrame = SfxViewFrame::GetFirst();
@@ -59,6 +64,11 @@ void SfxLokHelper::setView(int nId)
SfxViewFrame* pViewFrame = pViewShell->GetViewFrame();
pViewFrame->MakeActive_Impl(false);
+
+ // Make comphelper::dispatchCommand() find the correct frame.
+ uno::Reference<frame::XFrame> xFrame = pViewFrame->GetFrame().GetFrameInterface();
+ uno::Reference<frame::XDesktop2> xDesktop = frame::Desktop::create(comphelper::getProcessComponentContext());
+ xDesktop->setActiveFrame(xFrame);
return;
}
}