From f8cab2f422895ebad8be9b8b3bb76600e6eaf1d0 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 8 Nov 2018 17:43:16 +0100 Subject: sw_redlinehide_3: add layout parameter to SwField::ExpandField() If the bCached=true, it shouldn't matter what the layout is, because the field won't be expanded properly anyway. Except for the SwInputField which disables caching, but that one often has a different code path anyway. For most fields it doesn't matter anyway, e.g. database fields. Change-Id: I628195f43c5d26feba94af0a832386791c072ba1 --- sw/source/core/doc/doc.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sw/source/core/doc/doc.cxx') diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index cfb91b7f401c..23b5b7e58808 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1383,7 +1383,7 @@ bool SwDoc::FieldHidesPara(const SwField& rField) const return static_cast(rField).IsHidden(); case SwFieldIds::Database: return FieldCanHideParaWeight(SwFieldIds::Database) - && rField.ExpandField(true).isEmpty(); + && rField.ExpandField(true, nullptr).isEmpty(); default: return false; } @@ -1584,7 +1584,7 @@ bool SwDoc::RestoreInvisibleContent() return false; } -bool SwDoc::ConvertFieldsToText() +bool SwDoc::ConvertFieldsToText(SwRootFrame const& rLayout) { bool bRet = false; getIDocumentFieldsAccess().LockExpFields(); @@ -1631,7 +1631,7 @@ bool SwDoc::ConvertFieldsToText() nWhich != SwFieldIds::RefPageGet&& nWhich != SwFieldIds::RefPageSet)) { - OUString sText = pField->ExpandField(true); + OUString sText = pField->ExpandField(true, &rLayout); // database fields should not convert their command into text if( SwFieldIds::Database == pCurType->Which() && !static_cast(pField)->IsInitialized()) -- cgit v1.2.3