summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-11-09 16:40:12 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2018-11-15 15:10:07 +0100
commitac41b860be6f865732b6abafd59259b8c937f8cc (patch)
tree33b8abd3e81b7d874d3378fa517ada466ff023b8 /sw
parentcb55e37c32cef758f7bbe358a3766198e76991ac (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')
-rw-r--r--sw/inc/expfld.hxx6
-rw-r--r--sw/source/core/doc/DocumentFieldsManager.cxx11
-rw-r--r--sw/source/core/fields/expfld.cxx1
3 files changed, 6 insertions, 12 deletions
diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx
index acf7818a05b3..94240200e998 100644
--- a/sw/inc/expfld.hxx
+++ b/sw/inc/expfld.hxx
@@ -139,7 +139,6 @@ class SwSetExpField;
class SW_DLLPUBLIC SwSetExpFieldType : public SwValueFieldType
{
OUString const m_sName;
- const SwNode* m_pOutlChgNd;
OUString m_sDelim;
sal_uInt16 m_nType;
sal_uInt8 m_nLevel;
@@ -177,11 +176,6 @@ public:
void SetOutlineLvl( sal_uInt8 n ) { m_nLevel = n; }
void SetChapter( SwSetExpField& rField, const SwNode& rNd );
- /** Member only for SwDoc::UpdateExpField.
- It is needed only at runtime of sequence field types! */
- const SwNode* GetOutlineChgNd() const { return m_pOutlChgNd; }
- void SetOutlineChgNd( const SwNode* p ) { m_pOutlChgNd = p; }
-
virtual void QueryValue( css::uno::Any& rVal, sal_uInt16 nWhich ) const override;
virtual void PutValue( const css::uno::Any& rVal, sal_uInt16 nWhich ) override;
};
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 )