diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-11-09 16:40:12 +0100 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-11-15 15:10:07 +0100 |
commit | ac41b860be6f865732b6abafd59259b8c937f8cc (patch) | |
tree | 33b8abd3e81b7d874d3378fa517ada466ff023b8 /sw/source | |
parent | cb55e37c32cef758f7bbe358a3766198e76991ac (diff) |
sw: remove the SwSetExpFieldType::m_pOutlChgNd member
It's only used in one function, just use a local map.
Change-Id: I3a79876acf8b31c1a8a14e9f65ada2153e7c773a
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/doc/DocumentFieldsManager.cxx | 11 | ||||
-rw-r--r-- | sw/source/core/fields/expfld.cxx | 1 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx index 0ce2a53fd7b4..efb42e357632 100644 --- a/sw/source/core/doc/DocumentFieldsManager.cxx +++ b/sw/source/core/doc/DocumentFieldsManager.cxx @@ -890,9 +890,6 @@ void DocumentFieldsManager::UpdateExpFields( SwTextField* pUpdateField, bool bUp aHashStrTable[nPos].release() ) ); } break; - case SwFieldIds::SetExp: - const_cast<SwSetExpFieldType*>(static_cast<const SwSetExpFieldType*>(pFieldType))->SetOutlineChgNd( nullptr ); - break; default: break; } } @@ -928,6 +925,8 @@ void DocumentFieldsManager::UpdateExpFields( SwTextField* pUpdateField, bool bUp } } + std::unordered_map<SwSetExpFieldType const*, SwTextNode const*> SetExpOutlineNodeMap; + for( SetGetExpFields::const_iterator it = mpUpdateFields->GetSortLst()->begin(); it != mpUpdateFields->GetSortLst()->end(); ++it ) { SwSection* pSect = const_cast<SwSection*>((*it)->GetSection()); @@ -1131,9 +1130,11 @@ void DocumentFieldsManager::UpdateExpFields( SwTextField* pUpdateField, bool bUp const SwTextNode* pOutlNd = pSeqNd-> FindOutlineNodeOfLevel( nLvl ); - if( pSFieldTyp->GetOutlineChgNd() != pOutlNd ) + auto const iter(SetExpOutlineNodeMap.find(pSFieldTyp)); + if (iter == SetExpOutlineNodeMap.end() + || iter->second != pOutlNd) { - pSFieldTyp->SetOutlineChgNd( pOutlNd ); + SetExpOutlineNodeMap[pSFieldTyp] = pOutlNd; aCalc.VarChange( aNew, 0 ); } } diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx index cbaecd6e838b..bb461c1bd49e 100644 --- a/sw/source/core/fields/expfld.cxx +++ b/sw/source/core/fields/expfld.cxx @@ -490,7 +490,6 @@ bool SwGetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) SwSetExpFieldType::SwSetExpFieldType( SwDoc* pDc, const OUString& rName, sal_uInt16 nTyp ) : SwValueFieldType( pDc, SwFieldIds::SetExp ), m_sName( rName ), - m_pOutlChgNd( nullptr ), m_sDelim( "." ), m_nType(nTyp), m_nLevel( UCHAR_MAX ), m_bDeleted( false ) |