Kaydet (Commit) 8cfe6315 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in FmSearchDialog

Change-Id: Icf2a8f2b334b1a0b9a7028fb1718710dd67c7a81
Reviewed-on: https://gerrit.libreoffice.org/55533Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 9dce48ad
...@@ -142,8 +142,8 @@ FmSearchDialog::FmSearchDialog(vcl::Window* pParent, const OUString& sInitialTex ...@@ -142,8 +142,8 @@ FmSearchDialog::FmSearchDialog(vcl::Window* pParent, const OUString& sInitialTex
m_plbForm->Hide(); m_plbForm->Hide();
} }
m_pSearchEngine = new FmSearchEngine( m_pSearchEngine.reset( new FmSearchEngine(
::comphelper::getProcessComponentContext(), fmscInitial.xCursor, fmscInitial.strUsedFields, fmscInitial.arrFields ); ::comphelper::getProcessComponentContext(), fmscInitial.xCursor, fmscInitial.strUsedFields, fmscInitial.arrFields ) );
initCommon( fmscInitial.xCursor ); initCommon( fmscInitial.xCursor );
if ( !fmscInitial.sFieldDisplayNames.isEmpty() ) if ( !fmscInitial.sFieldDisplayNames.isEmpty() )
...@@ -168,11 +168,9 @@ void FmSearchDialog::dispose() ...@@ -168,11 +168,9 @@ void FmSearchDialog::dispose()
SaveParams(); SaveParams();
delete m_pConfig; m_pConfig.reset();
m_pConfig = nullptr;
delete m_pSearchEngine; m_pSearchEngine.reset();
m_pSearchEngine = nullptr;
m_prbSearchForText.clear(); m_prbSearchForText.clear();
m_prbSearchForNull.clear(); m_prbSearchForNull.clear();
...@@ -258,7 +256,7 @@ void FmSearchDialog::Init(const OUString& strVisibleFields, const OUString& sIni ...@@ -258,7 +256,7 @@ void FmSearchDialog::Init(const OUString& strVisibleFields, const OUString& sIni
} }
m_pConfig = new FmSearchConfigItem; m_pConfig.reset( new FmSearchConfigItem );
LoadParams(); LoadParams();
m_pcmbSearchText->SetText(sInitialText); m_pcmbSearchText->SetText(sInitialText);
......
...@@ -85,12 +85,12 @@ class FmSearchDialog final : public ModalDialog ...@@ -85,12 +85,12 @@ class FmSearchDialog final : public ModalDialog
/// memorize the currently selected field for every context /// memorize the currently selected field for every context
std::vector<OUString> m_arrContextFields; std::vector<OUString> m_arrContextFields;
FmSearchEngine* m_pSearchEngine; std::unique_ptr<FmSearchEngine> m_pSearchEngine;
Timer m_aDelayedPaint; Timer m_aDelayedPaint;
// see EnableSearchUI // see EnableSearchUI
::svxform::FmSearchConfigItem* m_pConfig; std::unique_ptr<::svxform::FmSearchConfigItem> m_pConfig;
public: public:
/** This can search in different sets of fields. There is a number of contexts; their names are in strContexts (separated /** This can search in different sets of fields. There is a number of contexts; their names are in strContexts (separated
by ';'), the user can choose one of them. by ';'), the user can choose one of them.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment