summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/inc/txtfld.hxx7
-rw-r--r--sw/source/core/doc/docfld.cxx2
-rw-r--r--sw/source/core/txtnode/atrfld.cxx9
3 files changed, 8 insertions, 10 deletions
diff --git a/sw/inc/txtfld.hxx b/sw/inc/txtfld.hxx
index 3f4d41f13de7..44c5c5e3f901 100644
--- a/sw/inc/txtfld.hxx
+++ b/sw/inc/txtfld.hxx
@@ -39,12 +39,7 @@ public:
void CopyTxtFld( SwTxtFld *pDest ) const;
- void ExpandTxtFld() const;
- void ExpandAlways()
- {
- m_aExpand += " "; // changing current value to assure that <ExpandTxtFld()> changes the value.
- ExpandTxtFld();
- }
+ void ExpandTxtFld( const bool bForceNotify = false ) const;
// get and set TxtNode pointer
SwTxtNode* GetpTxtNode() const
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index b34556801691..2c032717935a 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -1975,7 +1975,7 @@ void SwDoc::ChangeDBFields( const std::vector<OUString>& rOldNames,
}
if (bExpand)
- pTxtFld->ExpandAlways();
+ pTxtFld->ExpandTxtFld( true );
}
SetModified();
#endif
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index faf2b81581b5..e533eb54e8cd 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -269,7 +269,9 @@ void SwFmtFld::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
pType->GetValue( aCalc );
}
}
- mpTxtFld->ExpandTxtFld();
+
+ const bool bForceNotify = (pOld == NULL) && (pNew == NULL);
+ mpTxtFld->ExpandTxtFld( bForceNotify );
}
bool SwFmtFld::GetInfo( SfxPoolItem& rInfo ) const
@@ -326,14 +328,15 @@ bool SwTxtFld::IsFldInDoc() const
&& GetpTxtNode()->GetNodes().IsDocNodes();
}
-void SwTxtFld::ExpandTxtFld() const
+void SwTxtFld::ExpandTxtFld(const bool bForceNotify) const
{
OSL_ENSURE( m_pTxtNode, "SwTxtFld: where is my TxtNode?" );
const SwField* pFld = GetFmtFld().GetField();
const OUString aNewExpand( pFld->ExpandField(m_pTxtNode->GetDoc()->IsClipBoard()) );
- if( aNewExpand == m_aExpand )
+ if (!bForceNotify &&
+ aNewExpand == m_aExpand)
{
// Bei Seitennummernfeldern
const sal_uInt16 nWhich = pFld->GetTyp()->Which();