Kaydet (Commit) 9a2f5100 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in TableControl_Impl

Change-Id: Ida89f2a72395e0a07d57100fda10fa0f739d9eef
Reviewed-on: https://gerrit.libreoffice.org/53602Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst d72a1152
...@@ -230,14 +230,13 @@ namespace svt { namespace table ...@@ -230,14 +230,13 @@ namespace svt { namespace table
,m_pVScroll ( nullptr ) ,m_pVScroll ( nullptr )
,m_pHScroll ( nullptr ) ,m_pHScroll ( nullptr )
,m_pScrollCorner ( nullptr ) ,m_pScrollCorner ( nullptr )
,m_pSelEngine ( )
,m_aSelectedRows ( ) ,m_aSelectedRows ( )
,m_pTableFunctionSet ( new TableFunctionSet( this ) ) ,m_pTableFunctionSet ( new TableFunctionSet( this ) )
,m_nAnchor ( -1 ) ,m_nAnchor ( -1 )
,m_bUpdatingColWidths ( false ) ,m_bUpdatingColWidths ( false )
,m_pAccessibleTable ( nullptr ) ,m_pAccessibleTable ( nullptr )
{ {
m_pSelEngine = new SelectionEngine( m_pDataWindow.get(), m_pTableFunctionSet ); m_pSelEngine.reset( new SelectionEngine( m_pDataWindow.get(), m_pTableFunctionSet.get() ) );
m_pSelEngine->SetSelectionMode(SelectionMode::Single); m_pSelEngine->SetSelectionMode(SelectionMode::Single);
m_pDataWindow->SetPosPixel( Point( 0, 0 ) ); m_pDataWindow->SetPosPixel( Point( 0, 0 ) );
m_pDataWindow->Show(); m_pDataWindow->Show();
...@@ -249,8 +248,8 @@ namespace svt { namespace table ...@@ -249,8 +248,8 @@ namespace svt { namespace table
m_pHScroll.disposeAndClear(); m_pHScroll.disposeAndClear();
m_pScrollCorner.disposeAndClear(); m_pScrollCorner.disposeAndClear();
m_pDataWindow.disposeAndClear(); m_pDataWindow.disposeAndClear();
DELETEZ( m_pTableFunctionSet ); m_pTableFunctionSet.reset();
DELETEZ( m_pSelEngine ); m_pSelEngine.reset();
} }
void TableControl_Impl::setModel( const PTableModel& _pModel ) void TableControl_Impl::setModel( const PTableModel& _pModel )
...@@ -2147,7 +2146,7 @@ namespace svt { namespace table ...@@ -2147,7 +2146,7 @@ namespace svt { namespace table
SelectionEngine* TableControl_Impl::getSelEngine() SelectionEngine* TableControl_Impl::getSelEngine()
{ {
return m_pSelEngine; return m_pSelEngine.get();
} }
bool TableControl_Impl::isRowSelected( RowPos i_row ) const bool TableControl_Impl::isRowSelected( RowPos i_row ) const
......
...@@ -121,11 +121,11 @@ namespace svt { namespace table ...@@ -121,11 +121,11 @@ namespace svt { namespace table
VclPtr<ScrollBar> m_pHScroll; VclPtr<ScrollBar> m_pHScroll;
VclPtr<ScrollBarBox> m_pScrollCorner; VclPtr<ScrollBarBox> m_pScrollCorner;
//selection engine - for determining selection range, e.g. single, multiple //selection engine - for determining selection range, e.g. single, multiple
SelectionEngine* m_pSelEngine; std::unique_ptr<SelectionEngine> m_pSelEngine;
//vector which contains the selected rows //vector which contains the selected rows
std::vector<RowPos> m_aSelectedRows; std::vector<RowPos> m_aSelectedRows;
//part of selection engine //part of selection engine
TableFunctionSet* m_pTableFunctionSet; std::unique_ptr<TableFunctionSet> m_pTableFunctionSet;
//part of selection engine //part of selection engine
RowPos m_nAnchor; RowPos m_nAnchor;
bool m_bUpdatingColWidths; bool m_bUpdatingColWidths;
......
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