summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx26
1 files changed, 20 insertions, 6 deletions
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 1afaea285b94..cb5c1e130269 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -854,6 +854,8 @@ void SwTxtNode::Update(
{
if ( bNegative )
{
+ std::vector<SwTxtInputFld*> aTxtInputFlds;
+
const sal_Int32 nChangeEnd = nChangePos + nChangeLen;
for ( size_t n = 0; n < m_pSwpHints->Count(); ++n )
{
@@ -896,12 +898,17 @@ void SwTxtNode::Update(
{
SwTxtInputFld* pTxtInputFld = dynamic_cast<SwTxtInputFld*>(pHint);
if ( pTxtInputFld )
- {
- pTxtInputFld->UpdateFieldContent();
- }
+ aTxtInputFlds.push_back(pTxtInputFld);
}
}
+ //wait until all the attribute positions are correct
+ //before updating the field contents
+ for (SwTxtInputFld* pTxtInputFld : aTxtInputFlds)
+ {
+ pTxtInputFld->UpdateFieldContent();
+ }
+
m_pSwpHints->MergePortions( *this );
}
else
@@ -910,6 +917,7 @@ void SwTxtNode::Update(
bool bResort = false;
bool bMergePortionsNeeded = false;
const int coArrSz = RES_TXTATR_WITHEND_END - RES_CHRATR_BEGIN;
+ std::vector<SwTxtInputFld*> aTxtInputFlds;
bool aDontExp[ coArrSz ];
memset( &aDontExp, 0, coArrSz * sizeof(bool) );
@@ -1001,11 +1009,17 @@ void SwTxtNode::Update(
{
SwTxtInputFld* pTxtInputFld = dynamic_cast<SwTxtInputFld*>(pHint);
if ( pTxtInputFld )
- {
- pTxtInputFld->UpdateFieldContent();
- }
+ aTxtInputFlds.push_back(pTxtInputFld);
}
}
+
+ //wait until all the attribute positions are correct
+ //before updating the field contents
+ for (SwTxtInputFld* pTxtInputFld : aTxtInputFlds)
+ {
+ pTxtInputFld->UpdateFieldContent();
+ }
+
if (bMergePortionsNeeded)
{
m_pSwpHints->MergePortions(*this); // does Resort too