diff options
author | Eike Rathke <erack@redhat.com> | 2017-07-06 17:06:14 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-07-21 06:13:48 +0200 |
commit | 3c4b67ac73aae4f44938c296d1a54ff68c6e2ae8 (patch) | |
tree | c4f81cd7a4edc8313a176a1e94c723e912762aa3 /sc | |
parent | a1afdfa15ec0410a735fd7e969219bd6cc1f33dd (diff) |
Blind fix tdf#108612 explicitly checking for and against clipboard document
This is a combination of 2 commits.
Attempt to blind fix tdf#108612 explicitly checking for clipboard document
It seems that for some yet unknown reason in an (un)certain constellation
ScDocument::IsClipboardSource() returns true because ScModule::GetClipDoc()
does not return the clipboard document but the actual document instead, so
destroying the clipboard document executes ScDocument::ClosingClipboardSource()
and (or in earlier versions) ScDocument::ForgetNoteCaptions() on the actual
document instead.
Check also that ScDocument::bIsClip is set, hopefully curing the symptom, the
real cause is something else.
(cherry picked from commit d5020f35aec54f0241fa58557dc6caadc149f5a9)
Another attempt to blind fix tdf#108612
Oddly in that scenario on Windows there are two clipboard documents alive when
destroying one, so the destroyed one erroneously is said to be a clipboard
source and then detachs the comments' caption information.
There's no legit case where a clipboard document could actually be the real
original source of another clipboard document, so bail out if the caller
already is one.
(cherry picked from commit 52e09f2c03f7cc024b2973c4806283c324fc23df)
0f8d240d8ec13bf91b77176dc6439a541cf14eaa
Change-Id: I5ffd0706592d2737808e7004630a56c53115295b
Reviewed-on: https://gerrit.libreoffice.org/40249
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/document.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 0aff3b5e9469..e597ae4485cf 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -2522,8 +2522,11 @@ void ScDocument::SetClipParam(const ScClipParam& rParam) bool ScDocument::IsClipboardSource() const { + if (bIsClip) + return false; + ScDocument* pClipDoc = ScModule::GetClipDoc(); - return xPoolHelper.is() && pClipDoc && pClipDoc->xPoolHelper.is() && + return pClipDoc && pClipDoc->bIsClip && pClipDoc->xPoolHelper.is() && xPoolHelper.is() && xPoolHelper->GetDocPool() == pClipDoc->xPoolHelper->GetDocPool(); } |