Blob Blame History Raw
From ed0cf5fe7f448b471a6627b045e2ea3df464e83f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= <tomaz.vajngerl@collabora.com>
Date: Thu, 4 Feb 2016 14:44:36 +0100
Subject: [PATCH 393/398] lok: fix saveAs for a loaded HTML document

a HTML document is reported as "com.sun.star.text.WebDocument"
which is a unsupported document type in LOK so report it as a
LOK_DOCTYPE_TEXT instead.

Change-Id: Iaa77cb8b1f55cf31ebbb4fd4d69c02702e60e251
(cherry picked from commit 806d34981f480908645038f4cfc29ebcf25ca145)
Reviewed-on: https://gerrit.libreoffice.org/22119
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
(cherry picked from commit 1deed8dae78be05cafde17768d111035c111b567)
---
 desktop/source/lib/init.cxx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index fe297fb09414..9e5c52917eb7 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -621,6 +621,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const cha
             break;
         case LOK_DOCTYPE_OTHER:
         default:
+            SAL_INFO("lok", "Can't save document - unsopported document type.");
             return false;
         }
 
@@ -756,7 +757,7 @@ static int doc_getDocumentType (LibreOfficeKitDocument* pThis)
         {
             return LOK_DOCTYPE_DRAWING;
         }
-        else if (xDocument->supportsService("com.sun.star.text.TextDocument"))
+        else if (xDocument->supportsService("com.sun.star.text.TextDocument") || xDocument->supportsService("com.sun.star.text.WebDocument"))
         {
             return LOK_DOCTYPE_TEXT;
         }
-- 
2.12.0