[Libreoffice-commits] core.git: sw/inc sw/source
Oliver-Rainer Wittmann
orw at apache.org
Fri Jun 13 11:36:47 PDT 2014
sw/inc/txtfld.hxx | 7 +------
sw/source/core/doc/docfld.cxx | 2 +-
sw/source/core/txtnode/atrfld.cxx | 9 ++++++---
3 files changed, 8 insertions(+), 10 deletions(-)
New commits:
commit cd94a84b89c476760ad74bf088a5d6f8ba4ce209
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date: Fri Jun 13 14:08:22 2014 +0000
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
diff --git a/sw/inc/txtfld.hxx b/sw/inc/txtfld.hxx
index 3f4d41f..44c5c5e 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 b345568..2c03271 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 faf2b81..e533eb5 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();
More information about the Libreoffice-commits
mailing list