Kaydet (Commit) 619027af authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SfxCmisVersionsDialog

Change-Id: Ib2ad8550fa452478066039d79a75f75cb5605460
Reviewed-on: https://gerrit.libreoffice.org/53870Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 063ac5c3
......@@ -544,7 +544,7 @@ SfxCmisVersionsDialog::~SfxCmisVersionsDialog()
void SfxCmisVersionsDialog::dispose()
{
delete m_pTable;
m_pTable.reset();
m_pVersionBox.disposeAndClear();
m_pOpenButton.clear();
m_pViewButton.clear();
......@@ -557,20 +557,17 @@ void SfxCmisVersionsDialog::LoadVersions()
{
SfxObjectShell *pObjShell = pViewFrame->GetObjectShell();
uno::Sequence < document::CmisVersion > aVersions = pObjShell->GetCmisVersions( );
delete m_pTable;
m_pTable = new SfxVersionTableDtor( aVersions );
m_pTable.reset(new SfxVersionTableDtor( aVersions ));
for ( size_t n = 0; n < m_pTable->size(); ++n )
{
for ( size_t n = 0; n < m_pTable->size(); ++n )
{
SfxVersionInfo *pInfo = m_pTable->at( n );
OUString aEntry = formatTime(pInfo->aCreationDate, Application::GetSettings().GetLocaleDataWrapper());
aEntry += "\t";
aEntry += pInfo->aAuthor;
aEntry += "\t";
aEntry += ConvertWhiteSpaces_Impl( pInfo->aComment );
SvTreeListEntry *pEntry = m_pVersionBox->InsertEntry( aEntry );
pEntry->SetUserData( pInfo );
}
SfxVersionInfo *pInfo = m_pTable->at( n );
OUString aEntry = formatTime(pInfo->aCreationDate, Application::GetSettings().GetLocaleDataWrapper());
aEntry += "\t";
aEntry += pInfo->aAuthor;
aEntry += "\t";
aEntry += ConvertWhiteSpaces_Impl( pInfo->aComment );
SvTreeListEntry *pEntry = m_pVersionBox->InsertEntry( aEntry );
pEntry->SetUserData( pInfo );
}
}
......
......@@ -97,7 +97,7 @@ class SfxCmisVersionsDialog : public SfxModalDialog
VclPtr<PushButton> m_pDeleteButton;
VclPtr<PushButton> m_pCompareButton;
SfxViewFrame* pViewFrame;
SfxVersionTableDtor* m_pTable;
std::unique_ptr<SfxVersionTableDtor> m_pTable;
void LoadVersions();
......
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