summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver-Rainer Wittmann <orw@apache.org>2014-06-13 14:08:22 +0000
committerMichael Stahl <mstahl@redhat.com>2014-06-13 20:32:14 +0200
commitcd94a84b89c476760ad74bf088a5d6f8ba4ce209 (patch)
tree8093be7a73ad668d1ee014aa4d0122504e215555
parentb8bee05dbf85bc4f5834520aa5d64e9ae18aba4e (diff)
125044: - use field's content cache on <SwTxtFld> construction only
... for clipboard documents - assure invalidation and updates on code to update fields (cherry picked from commit 3d4d98d4d98bc62474ec295cdc4d070a01dcac13) The substantial bug was already fixed years ago by commit 9519deda120b73b72e75d89c3b2ae3d66220ec2d Conflicts: sw/inc/txtannotationfld.hxx sw/inc/txtfld.hxx sw/source/core/crsr/crstrvl.cxx sw/source/core/txtnode/atrfld.cxx sw/source/core/txtnode/thints.cxx Change-Id: Ib4965c5d443b60bab11bad1a9249fc6547976a3c
-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();