[Libreoffice-commits] core.git: 2 commits - editeng/source framework/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Sep 6 06:32:56 UTC 2018
editeng/source/editeng/impedit4.cxx | 6 +++---
editeng/source/items/textitem.cxx | 3 +--
framework/source/services/frame.cxx | 8 ++++----
3 files changed, 8 insertions(+), 9 deletions(-)
New commits:
commit 37d93222377d7b1df05bbcbc5f56fdc0732f1413
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Sep 5 15:21:18 2018 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Sep 6 08:32:41 2018 +0200
loplugin:useuniqueptr in framework::Frame
Change-Id: Ic1350d5bff80d4a88d3949a412ee9bf02ad969ba
Reviewed-on: https://gerrit.libreoffice.org/60050
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index a7f60298aeb9..be0f828cdf5d 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -418,7 +418,7 @@ private:
css::uno::Reference< css::frame::XDispatchInformationProvider > m_xDispatchInfoHelper;
css::uno::Reference< css::frame::XTitle > m_xTitleHelper;
- WindowCommandDispatch* m_pWindowCommandDispatch;
+ std::unique_ptr<WindowCommandDispatch> m_pWindowCommandDispatch;
typedef std::unordered_map<OUString, css::beans::Property> TPropInfoHash;
TPropInfoHash m_lProps;
@@ -810,7 +810,7 @@ void SAL_CALL Frame::initialize( const css::uno::Reference< css::awt::XWindow >&
// So superfluous messages are filtered to NULL :-)
implts_startWindowListening();
- m_pWindowCommandDispatch = new WindowCommandDispatch(m_xContext, this);
+ m_pWindowCommandDispatch.reset(new WindowCommandDispatch(m_xContext, this));
// Initialize title functionality
TitleHelper* pTitleHelper = new TitleHelper( m_xContext );
@@ -2084,12 +2084,12 @@ void SAL_CALL Frame::disposing()
disableLayoutManager(layoutMgr);
}
- WindowCommandDispatch * disp = nullptr;
+ std::unique_ptr<WindowCommandDispatch> disp;
{
SolarMutexGuard g;
std::swap(disp, m_pWindowCommandDispatch);
}
- delete disp;
+ disp.reset();
// Send message to all listener and forget her references.
css::lang::EventObject aEvent( xThis );
commit 7c94581151c6427d143bb63fe51fa4b229e0b7e7
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Sep 5 15:20:50 2018 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Sep 6 08:32:32 2018 +0200
loplugin:useuniqueptr in editeng
Change-Id: I6190098e7e3f4df415d6aef46d152324cbc3dd60
Reviewed-on: https://gerrit.libreoffice.org/60049
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 471301196295..31b3cd6c4e3d 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -1458,10 +1458,10 @@ EESpellState ImpEditEngine::Spell( EditView* pEditView, bool bMultipleDoc )
else if ( CreateEPaM( aEditDoc.GetStartPaM() ) == pSpellInfo->aSpellStart )
bIsStart = true;
- EditSpellWrapper* pWrp = new EditSpellWrapper( Application::GetDefDialogParent(),
- bIsStart, pEditView );
+ std::unique_ptr<EditSpellWrapper> pWrp(new EditSpellWrapper( Application::GetDefDialogParent(),
+ bIsStart, pEditView ));
pWrp->SpellDocument();
- delete pWrp;
+ pWrp.reset();
if ( !bMultipleDoc )
{
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index 9f6a0f22ba74..e995a7ba5796 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -2881,7 +2881,7 @@ void SvxScriptSetItem::PutItemForScriptType( SvtScriptType nScriptType,
sal_uInt16 nLatin, nAsian, nComplex;
GetWhichIds( nLatin, nAsian, nComplex );
- SfxPoolItem* pCpy = rItem.Clone();
+ std::unique_ptr<SfxPoolItem> pCpy(rItem.Clone());
if( SvtScriptType::LATIN & nScriptType )
{
pCpy->SetWhich( nLatin );
@@ -2897,7 +2897,6 @@ void SvxScriptSetItem::PutItemForScriptType( SvtScriptType nScriptType,
pCpy->SetWhich( nComplex );
GetItemSet().Put( *pCpy );
}
- delete pCpy;
}
void SvxScriptSetItem::GetWhichIds( sal_uInt16 nSlotId, const SfxItemSet& rSet, sal_uInt16& rLatin, sal_uInt16& rAsian, sal_uInt16& rComplex )
More information about the Libreoffice-commits
mailing list