summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2016-02-08 20:09:37 +0100
committerJan Holesovsky <kendy@collabora.com>2016-02-10 13:30:52 +0100
commit552ae012bd0321995a0b44501704e408f1d9d006 (patch)
treea63543c9f36e6db77280d4291844a5a992018364
parentac859e71e58329e52ba402ca69537778d196091f (diff)
lok: Interaction handler for saveAs() too.
The LOK does not have to be fully initialized, eg. during the unit tests. Change-Id: I11bb8db37c92b05e2c1ad06e1a6632db7fb0ea60
-rw-r--r--desktop/source/lib/init.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a3174fc8b6e1..507e4f828b20 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -680,11 +680,15 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const cha
aSaveMediaDescriptor[MediaDescriptor::PROP_FILTEROPTIONS()] <<= aFilterOptions;
// add interaction handler too
- rtl::Reference<LOKInteractionHandler> const pInteraction(
- new LOKInteractionHandler(::comphelper::getProcessComponentContext(), "saveas", gImpl, pDocument));
- uno::Reference<task::XInteractionHandler2> const xInteraction(pInteraction.get());
+ 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;
+ aSaveMediaDescriptor[MediaDescriptor::PROP_INTERACTIONHANDLER()] <<= xInteraction;
+ }
uno::Reference<frame::XStorable> xStorable(pDocument->mxComponent, uno::UNO_QUERY_THROW);
xStorable->storeToURL(aURL, aSaveMediaDescriptor.getAsConstPropertyValueList());