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

loplugin:useuniqueptr in OQueryController

Change-Id: I13ca3ea6c27d4572274b70b0481a8479852b569a
Reviewed-on: https://gerrit.libreoffice.org/54857Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst dc8e6378
...@@ -61,9 +61,9 @@ namespace dbaui ...@@ -61,9 +61,9 @@ namespace dbaui
css::uno::Sequence< css::beans::PropertyValue > m_aFieldInformation; css::uno::Sequence< css::beans::PropertyValue > m_aFieldInformation;
::svxform::OSystemParseContext* m_pParseContext; std::unique_ptr<::svxform::OSystemParseContext> m_pParseContext;
::connectivity::OSQLParser m_aSqlParser; ::connectivity::OSQLParser m_aSqlParser;
::connectivity::OSQLParseTreeIterator* m_pSqlIterator; std::unique_ptr<::connectivity::OSQLParseTreeIterator> m_pSqlIterator;
css::uno::Reference< css::sdb::XSQLQueryComposer > m_xComposer; css::uno::Reference< css::sdb::XSQLQueryComposer > m_xComposer;
/// if we're editing an existing view, this is non-NULL /// if we're editing an existing view, this is non-NULL
......
...@@ -239,8 +239,7 @@ OQueryController::OQueryController(const Reference< XComponentContext >& _rM) ...@@ -239,8 +239,7 @@ OQueryController::OQueryController(const Reference< XComponentContext >& _rM)
:OJoinController(_rM) :OJoinController(_rM)
,OQueryController_PBase( getBroadcastHelper() ) ,OQueryController_PBase( getBroadcastHelper() )
,m_pParseContext( new svxform::OSystemParseContext ) ,m_pParseContext( new svxform::OSystemParseContext )
,m_aSqlParser( _rM, m_pParseContext ) ,m_aSqlParser( _rM, m_pParseContext.get() )
,m_pSqlIterator(nullptr)
,m_nLimit(-1) ,m_nLimit(-1)
,m_nVisibleRows(0x400) ,m_nVisibleRows(0x400)
,m_nSplitPos(-1) ,m_nSplitPos(-1)
...@@ -343,8 +342,7 @@ void OQueryController::deleteIterator() ...@@ -343,8 +342,7 @@ void OQueryController::deleteIterator()
{ {
delete m_pSqlIterator->getParseTree(); delete m_pSqlIterator->getParseTree();
m_pSqlIterator->dispose(); m_pSqlIterator->dispose();
delete m_pSqlIterator; m_pSqlIterator.reset();
m_pSqlIterator = nullptr;
} }
} }
...@@ -354,7 +352,7 @@ void OQueryController::disposing() ...@@ -354,7 +352,7 @@ void OQueryController::disposing()
deleteIterator(); deleteIterator();
delete m_pParseContext; m_pParseContext.reset();
clearFields(); clearFields();
OTableFields().swap(m_vUnUsedFieldsDesc); OTableFields().swap(m_vUnUsedFieldsDesc);
...@@ -942,7 +940,7 @@ void OQueryController::setQueryComposer() ...@@ -942,7 +940,7 @@ void OQueryController::setQueryComposer()
OSL_ENSURE(m_xComposer.is(),"No querycomposer available!"); OSL_ENSURE(m_xComposer.is(),"No querycomposer available!");
Reference<XTablesSupplier> xTablesSup(getConnection(), UNO_QUERY); Reference<XTablesSupplier> xTablesSup(getConnection(), UNO_QUERY);
deleteIterator(); deleteIterator();
m_pSqlIterator = new ::connectivity::OSQLParseTreeIterator( getConnection(), xTablesSup->getTables(), m_aSqlParser ); m_pSqlIterator.reset(new ::connectivity::OSQLParseTreeIterator( getConnection(), xTablesSup->getTables(), m_aSqlParser ));
} }
} }
} }
......
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