diff options
author | Jan Holesovsky <kendy@collabora.com> | 2016-02-08 20:09:37 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2016-02-11 15:14:21 +0100 |
commit | d11bf83b3f28fccdaac4c90dfb283b47f3617a7d (patch) | |
tree | 47708b3126f03fa3d50ade4ffc009c469a0ca3bc /desktop | |
parent | c962b9b62c6fe173c64dfdc90f447ba5f8b11de8 (diff) |
lok: Interaction handler for saveAs() too.
The LOK does not have to be fully initialized, eg. during the unit tests,
don't use the interaction handler in such a case.
Change-Id: I11bb8db37c92b05e2c1ad06e1a6632db7fb0ea60
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index eaac9927d06f..4e7525838c97 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -663,6 +663,17 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const cha aSaveMediaDescriptor["FilterName"] <<= aFilterName; aSaveMediaDescriptor[MediaDescriptor::PROP_FILTEROPTIONS()] <<= aFilterOptions; + // add interaction handler too + if (gImpl) + { + // gImpl does not have to exist when running from a unit test + rtl::Reference<LOKInteractionHandler> const pInteraction( + new LOKInteractionHandler(::comphelper::getProcessComponentContext(), "saveas", gImpl, pDocument)); + uno::Reference<task::XInteractionHandler2> const xInteraction(pInteraction.get()); + + aSaveMediaDescriptor[MediaDescriptor::PROP_INTERACTIONHANDLER()] <<= xInteraction; + } + uno::Reference<frame::XStorable> xStorable(pDocument->mxComponent, uno::UNO_QUERY_THROW); xStorable->storeToURL(aURL, aSaveMediaDescriptor.getAsConstPropertyValueList()); |