summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2017-09-19 17:29:07 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2017-09-22 14:42:55 +0200
commitf95e7ef38e0bf79fa9662bfd50de612d50ef71de (patch)
tree7b2e1cef5f9fd78029a28430ede15dcb105b7b5d
parenta7ce8404befaf59df5f1a476c8dd414633bbf823 (diff)
Don't crash when opening templates via WebDAV
When loading a ODT template via HTTP, it crashes LO with an lang::IllegalArgumentException in LockFileCommon::ResolveLinks. This happens when closing the loaded template, as LO tries to remove a not-existing lock. aDocURL at this point is empty, so HasError() is true. As stated in the comment, we don't need a lock for documents created from templates, as this opens an internal copy of the document, so don't mark the teplate document as locked. Change-Id: Ide60020b6287aa67861dbcc8ec1b94f37896b7ef Reviewed-on: https://gerrit.libreoffice.org/42485 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
-rw-r--r--sfx2/source/doc/docfile.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index f37a6c62746d..7437c66ee8ed 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1005,15 +1005,16 @@ void SfxMedium::LockOrigFileOnDemand( bool bLoading, bool bNoUI )
try
{
bool bResult = pImpl->m_bLocked;
+ bool bIsTemplate = false;
// so, this is webdav stuff...
if ( !bResult )
{
// no read-write access is necessary on loading if the document is explicitly opened as copy
const SfxBoolItem* pTemplateItem = SfxItemSet::GetItem<SfxBoolItem>(GetItemSet(), SID_TEMPLATE, false);
- bResult = ( bLoading && pTemplateItem && pTemplateItem->GetValue() );
+ bIsTemplate = ( bLoading && pTemplateItem && pTemplateItem->GetValue() );
}
- if ( !bResult && !IsReadOnly() )
+ if ( !bIsTemplate && !bResult && !IsReadOnly() )
{
ShowLockResult bUIStatus = ShowLockResult::NoLock;
do