summaryrefslogtreecommitdiff
path: root/framework/source/loadenv/loadenv.cxx
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2016-04-27 16:19:13 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2016-04-27 18:36:57 +0000
commit579c2de3a88483eff0664d3a303b19cbd386db47 (patch)
tree2d8c898327d808517f93ab4c9a10fb9b67c198a5 /framework/source/loadenv/loadenv.cxx
parentef52ce82bf55b37279e344ea5fef67b4277fb009 (diff)
tdf#80999 Canceling password prompt should abort detection
... instead of continuing the detection loop and being "detected" as plain text. The detection API will from now return a type based on the file extension only, which is far more useful than "plain text" anyway. Plus the media descriptor has a flag to indicate that the detection wasn't completed, which can be also used by the loading code to abort the loading process. Change-Id: Ida37e2687bd5cd86b5780620724e9bce82e11946 Reviewed-on: https://gerrit.libreoffice.org/24428 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'framework/source/loadenv/loadenv.cxx')
-rw-r--r--framework/source/loadenv/loadenv.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 4c3c8b1d8646..64c0a8ffff69 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -791,6 +791,11 @@ void LoadEnv::impl_detectTypeAndFilter()
aWriteLock.clear();
// <- SAFE
+ // We do have potentially correct type, but the detection process was aborted.
+ if (m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_ABORTED(), false))
+ throw LoadEnvException(
+ LoadEnvException::ID_UNSUPPORTED_CONTENT, "type detection aborted");
+
// But the type isn't enough. For loading sometimes we need more information.
// E.g. for our "_default" feature, where we recycle any frame which contains
// and "Untitled" document, we must know if the new document is based on a template!