diff options
Diffstat (limited to 'sw/source/core/fields/docufld.cxx')
-rw-r--r-- | sw/source/core/fields/docufld.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 859c5d4ddc02..e2044622aa1d 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -2285,10 +2285,13 @@ void SwRefPageGetFieldType::UpdateField( SwTextField const * pTextField, const SwContentFrame *const pRefFrame = pRefTextField->GetTextNode().getLayoutFrame( pLayout, nullptr, &tmp); const SwPageFrame* pPgFrame = nullptr; - const short nDiff = ( pFrame && pRefFrame ) - ? (pPgFrame = pFrame->FindPageFrame())->GetPhyPageNum() - - pRefFrame->FindPageFrame()->GetPhyPageNum() + 1 - : 1; + short nDiff = 1; + if ( pFrame && pRefFrame ) + { + pPgFrame = pFrame->FindPageFrame(); + nDiff = pPgFrame->GetPhyPageNum() - + pRefFrame->FindPageFrame()->GetPhyPageNum() + 1; + } SvxNumType nTmpFormat = SVX_NUM_PAGEDESC == static_cast<SvxNumType>(pGetField->GetFormat()) ? ( !pPgFrame |