tdf#146848 sw: fix assert about input field in undo nodes
These should not be updated.
soffice.bin: sw/source/core/txtnode/atrfld.cxx:713: void SwTextInputField::UpdateTextNodeContent(const rtl::OUString&): Assertion `IsFieldInDoc() && "<SwTextInputField::UpdateTextNodeContent(..)> - misusage as Input Field is not in document content."' failed.
3 SwTextInputField::UpdateTextNodeContent(rtl::OUString const&)
4 SwTextInputField::NotifyContentChange(SwFormatField&) at sw/source/core/txtnode/atrfld.cxx:669
5 SwTextField::ExpandTextField(bool) const
6 SwFormatField::UpdateTextNode(SfxPoolItem const*, SfxPoolItem const*) at sw/source/core/txtnode/atrfld.cxx:407
7 SwFormatField::SwClientNotify(SwModify const&, SfxHint const&)
10 SwFieldType::UpdateFields() (this=0x7f7ff2d654b0) at sw/source/core/fields/fldbas.cxx:220
11 sw::DocumentFieldsManager::UpdateFields(bool)
12 SwFEShell::Paste(SwDoc&, bool) at sw/source/core/frmedt/fecopy.cxx:1117
Somehow this causes testTdf139843 to go from 7 to 6 pages, but opening
the bugdoc shows it as 6 pages too, not sure what's going on there.
Change-Id: Ie25b2b2c4d8fd262850da31cbade5e121e9ec361
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129919
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 71e8a947753d359bd5b4d1174f4d6332eaf4a309)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129933
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index c9ced5e..079c8a4 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -299,7 +299,7 @@ void SwFormatField::UpdateTextNode(const SfxPoolItem* pOld, const SfxPoolItem* p
return;
}
if( !mpTextField )
if (!IsFieldInDoc())
return;
// don't do anything, especially not expand!