diff options
Diffstat (limited to 'sw/source/core/doc/DocumentFieldsManager.cxx')
-rw-r--r-- | sw/source/core/doc/DocumentFieldsManager.cxx | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx index c7915021be87..59f3b0b0fefa 100644 --- a/sw/source/core/doc/DocumentFieldsManager.cxx +++ b/sw/source/core/doc/DocumentFieldsManager.cxx @@ -34,6 +34,7 @@ #include <SwUndoField.hxx> #include <flddat.hxx> #include <cntfrm.hxx> +#include <node2lay.hxx> #include <section.hxx> #include <docufld.hxx> #include <calbck.hxx> @@ -725,9 +726,12 @@ void DocumentFieldsManager::UpdateTableFields( SfxPoolItem* pHt ) { SwPosition aPos( *pTableNd ); if( GetBodyTextNode( m_rDoc, aPos, *pFrame ) ) + { FieldsToCalc( *pCalc, SetGetExpField( - aPos.nNode, pFormatField->GetTextField(), - &aPos.nContent), pLayout); + aPos.nNode, pFormatField->GetTextField(), + &aPos.nContent, pFrame->GetPhyPageNum()), + pLayout); + } else pFrame = nullptr; } @@ -736,8 +740,11 @@ void DocumentFieldsManager::UpdateTableFields( SfxPoolItem* pHt ) { // create index to determine the TextNode SwNodeIndex aIdx( rTextNd ); + SwFrame const*const pFrame2 = ::sw::FindNeighbourFrameForNode(rTextNd); FieldsToCalc( *pCalc, - SetGetExpField(aIdx, pFormatField->GetTextField()), + SetGetExpField(aIdx, pFormatField->GetTextField(), + nullptr, + pFrame2 ? pFrame2->GetPhyPageNum() : 0), pLayout); } @@ -797,8 +804,11 @@ void DocumentFieldsManager::UpdateTableFields( SfxPoolItem* pHt ) { SwPosition aPos( *pCNd ); if( GetBodyTextNode( m_rDoc, aPos, *pFrame ) ) - FieldsToCalc(*pCalc, SetGetExpField(aPos.nNode), - pLayout); + { + FieldsToCalc(*pCalc, SetGetExpField(aPos.nNode, + nullptr, nullptr, pFrame->GetPhyPageNum()), + pLayout); + } else pFrame = nullptr; } @@ -808,7 +818,10 @@ void DocumentFieldsManager::UpdateTableFields( SfxPoolItem* pHt ) { // create index to determine the TextNode SwNodeIndex aIdx( *pTableNd ); - FieldsToCalc(*pCalc, SetGetExpField(aIdx), pLayout); + SwFrame const*const pFrame2 = ::sw::FindNeighbourFrameForNode(*pTableNd); + FieldsToCalc(*pCalc, SetGetExpField(aIdx, nullptr, nullptr, + pFrame2 ? pFrame2->GetPhyPageNum() : 0), + pLayout); } SwTableCalcPara aPara(*pCalc, pTableNd->GetTable(), pLayout); |