summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--desktop/source/lib/init.cxx9
-rw-r--r--filter/source/storagefilterdetect/filterdetect.cxx7
2 files changed, 15 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 5721b56573d6..f3396a3f4bc7 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2380,7 +2380,7 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis,
Application::SetDialogCancelMode(DialogCancelMode::LOKSilent);
}
- uno::Sequence<css::beans::PropertyValue> aFilterOptions(3);
+ uno::Sequence<css::beans::PropertyValue> aFilterOptions(4);
aFilterOptions[0] = css::beans::PropertyValue( "FilterOptions",
0,
uno::makeAny(aOptions),
@@ -2427,6 +2427,13 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis,
aFilterOptions[3].Value <<= nUpdateDoc;
*/
+ // set this explicitly false to be able to load template files
+ // as regular files, otherwise we cannot save them; it will try
+ // to bring saveas dialog which cannot work with LOK case
+ aFilterOptions[3].Name = "AsTemplate";
+ aFilterOptions[3].Value <<= false;
+
+
const int nThisDocumentId = nDocumentIdCounter++;
SfxViewShell::SetCurrentDocId(ViewShellDocId(nThisDocumentId));
uno::Reference<lang::XComponent> xComponent = xComponentLoader->loadComponentFromURL(
diff --git a/filter/source/storagefilterdetect/filterdetect.cxx b/filter/source/storagefilterdetect/filterdetect.cxx
index 02ed875c6699..694251c389b3 100644
--- a/filter/source/storagefilterdetect/filterdetect.cxx
+++ b/filter/source/storagefilterdetect/filterdetect.cxx
@@ -33,6 +33,8 @@
#include <com/sun/star/packages/zip/ZipIOException.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <comphelper/lok.hxx>
+
using namespace ::com::sun::star;
using utl::MediaDescriptor;
@@ -103,6 +105,11 @@ OUString SAL_CALL StorageFilterDetect::detect(uno::Sequence<beans::PropertyValue
OUString aMediaType;
xStorageProperties->getPropertyValue( "MediaType" ) >>= aMediaType;
aTypeName = getInternalFromMediaType( aMediaType );
+ if (comphelper::LibreOfficeKit::isActive() && aTypeName == "draw8_template")
+ {
+ // save it as draw8 instead of template format
+ aTypeName = "draw8";
+ }
}
catch( const lang::WrappedTargetException& aWrap )