diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-10 14:40:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-12 08:58:50 +0200 |
commit | 9ac209a67f06599a1f6fd8ea6fa6243e8cf1843b (patch) | |
tree | 1709fa6cbb6dfa70c5698886d8afdb685b36a16c | |
parent | 61d6047727d2d6f80054094160d630bfed31ab03 (diff) |
loplugin:useuniqueptr in DocumentFieldsManager
Change-Id: If7e72eb54608b29233884ede230dcd574c7b9e81
Reviewed-on: https://gerrit.libreoffice.org/60346
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sw/source/core/doc/DocumentFieldsManager.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx index 6834616865fa..c683895e9543 100644 --- a/sw/source/core/doc/DocumentFieldsManager.cxx +++ b/sw/source/core/doc/DocumentFieldsManager.cxx @@ -670,7 +670,7 @@ void DocumentFieldsManager::UpdateTableFields( SfxPoolItem* pHt ) TBL_CALC != static_cast<SwTableFormulaUpdate*>(pHt)->m_eFlags )) return ; - SwCalc* pCalc = nullptr; + std::unique_ptr<SwCalc> pCalc; if( pFieldType ) { @@ -704,7 +704,7 @@ void DocumentFieldsManager::UpdateTableFields( SfxPoolItem* pHt ) continue; if( !pCalc ) - pCalc = new SwCalc( m_rDoc ); + pCalc.reset(new SwCalc( m_rDoc )); // get the values of all SetExpression fields that are valid // until the table @@ -769,7 +769,7 @@ void DocumentFieldsManager::UpdateTableFields( SfxPoolItem* pHt ) { double nValue; if( !pCalc ) - pCalc = new SwCalc( m_rDoc ); + pCalc.reset(new SwCalc( m_rDoc )); // get the values of all SetExpression fields that are valid // until the table @@ -829,8 +829,6 @@ void DocumentFieldsManager::UpdateTableFields( SfxPoolItem* pHt ) } } } - - delete pCalc; } void DocumentFieldsManager::UpdateExpFields( SwTextField* pUpdateField, bool bUpdRefFields ) |