diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-23 15:35:42 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-24 10:48:08 +0200 |
commit | 8a592a5c6a0fbfb831569a7c03ac75b91ce013c4 (patch) | |
tree | 6c735f8cb55e4c6322e454dff5e42eb6c8d4dd9e /reportdesign | |
parent | 65379d43e1f590274775449c8fb381ceb3bc0537 (diff) |
loplugin:useuniqueptr in rptui::Condition
Change-Id: I1197be1f7ea8b621dedef41fdd0a664cb6d90374
Reviewed-on: https://gerrit.libreoffice.org/57879
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/ui/dlg/Condition.cxx | 20 | ||||
-rw-r--r-- | reportdesign/source/ui/dlg/Condition.hxx | 8 |
2 files changed, 14 insertions, 14 deletions
diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx index 8d4e76ba23b2..5aa87cd98d03 100644 --- a/reportdesign/source/ui/dlg/Condition.cxx +++ b/reportdesign/source/ui/dlg/Condition.cxx @@ -118,9 +118,9 @@ Condition::Condition( vcl::Window* _pParent, IConditionalFormatAction& _rAction, get(m_pHeader, "headerLabel"); get(m_pConditionType, "typeCombobox"); get(m_pOperationList, "opCombobox"); - m_pCondLHS = new ConditionField(this, get<Edit>("lhsEntry"), get<PushButton>("lhsButton")); + m_pCondLHS.reset( new ConditionField(this, get<Edit>("lhsEntry"), get<PushButton>("lhsButton")) ); get(m_pOperandGlue, "andLabel"); - m_pCondRHS = new ConditionField(this, get<Edit>("rhsEntry"), get<PushButton>("rhsButton")); + m_pCondRHS.reset( new ConditionField(this, get<Edit>("rhsEntry"), get<PushButton>("rhsButton")) ); get(m_pActions, "formatToolbox"); get(m_pPreview, "previewDrawingarea"); get(m_pMoveUp, "upButton"); @@ -162,10 +162,10 @@ Condition::Condition( vcl::Window* _pParent, IConditionalFormatAction& _rAction, m_nFontColorId = m_pActions->GetItemId(".uno:FontColor"); m_nFontDialogId = m_pActions->GetItemId(".uno:FontDialog"); - m_pBtnUpdaterBackgroundColor = new svx::ToolboxButtonColorUpdater( - SID_BACKGROUND_COLOR, m_nBackgroundColorId, m_pActions ); - m_pBtnUpdaterFontColor = new svx::ToolboxButtonColorUpdater( - SID_ATTR_CHAR_COLOR2, m_nFontColorId, m_pActions ); + m_pBtnUpdaterBackgroundColor.reset( new svx::ToolboxButtonColorUpdater( + SID_BACKGROUND_COLOR, m_nBackgroundColorId, m_pActions ) ); + m_pBtnUpdaterFontColor.reset( new svx::ToolboxButtonColorUpdater( + SID_ATTR_CHAR_COLOR2, m_nFontColorId, m_pActions ) ); Show(); @@ -198,10 +198,10 @@ void Condition::dispose() { m_bInDestruction = true; - delete m_pBtnUpdaterFontColor; - delete m_pCondLHS; - delete m_pCondRHS; - delete m_pBtnUpdaterBackgroundColor; + m_pBtnUpdaterFontColor.reset(); + m_pCondLHS.reset(); + m_pCondRHS.reset(); + m_pBtnUpdaterBackgroundColor.reset(); m_pHeader.clear(); m_pConditionType.clear(); m_pOperationList.clear(); diff --git a/reportdesign/source/ui/dlg/Condition.hxx b/reportdesign/source/ui/dlg/Condition.hxx index f770928ee7e5..04e228707b22 100644 --- a/reportdesign/source/ui/dlg/Condition.hxx +++ b/reportdesign/source/ui/dlg/Condition.hxx @@ -96,9 +96,9 @@ namespace rptui VclPtr<FixedText> m_pHeader; VclPtr<ListBox> m_pConditionType; VclPtr<ListBox> m_pOperationList; - ConditionField* m_pCondLHS; + std::unique_ptr<ConditionField> m_pCondLHS; VclPtr<FixedText> m_pOperandGlue; - ConditionField* m_pCondRHS; + std::unique_ptr<ConditionField> m_pCondRHS; VclPtr<ToolBox> m_pActions; VclPtr<SvxFontPrevWindow> m_pPreview; VclPtr<PushButton> m_pMoveUp; @@ -107,8 +107,8 @@ namespace rptui VclPtr<PushButton> m_pRemoveCondition; VclPtr<SvxColorWindow> m_pColorFloat; - svx::ToolboxButtonColorUpdater* m_pBtnUpdaterFontColor; // updates the color below the toolbar icon - svx::ToolboxButtonColorUpdater* m_pBtnUpdaterBackgroundColor; + std::unique_ptr<svx::ToolboxButtonColorUpdater> m_pBtnUpdaterFontColor; // updates the color below the toolbar icon + std::unique_ptr<svx::ToolboxButtonColorUpdater> m_pBtnUpdaterBackgroundColor; size_t m_nCondIndex; |