summaryrefslogtreecommitdiff
path: root/sw/source/uibase/uno
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-11-11 14:31:18 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-11-11 22:40:41 +0100
commit1abf4e6d07ca0ac31bc54f812df84efc82d2af1b (patch)
tree40053fb54077d81a94f273a3adb9660aea09068b /sw/source/uibase/uno
parent6ab5c9e99dccec23a80eb1980dc46986b8c5abca (diff)
DOCX import: don't throw away cached value of SwHiddenTextField ...
... when we also have an SwUserField. The problem is that a DocVariable gets imported as an SwUserField, but then SwDocUpdateField::InsertFieldType() marks the field as dirty. This causes IsFieldsDirty() to return true, so then DocumentTimerManager::GetNextIdleJob() decides to recalc all fields. This leads to loosing the cached result of conditional fields. Change-Id: I4f5c032648f8fc2aff98e4f8c883492375c7752d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105596 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/source/uibase/uno')
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index c77f92073b20..bd56d0c7dcb4 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -1978,7 +1978,12 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, const Any&
bool bBool = {};
if (aValue >>= bBool)
{ // HACK: writerfilter has to use API to set this :(
- pDoc->SetInWriterfilterImport(bBool);
+ bool bOld = pDoc->IsInWriterfilterImport();
+ pDoc->SetInWriterfilterImport(bBool);
+ if (bOld && !bBool)
+ {
+ pDoc->getIDocumentFieldsAccess().SetFieldsDirty(false, nullptr, 0);
+ }
}
}
break;