Kaydet (Commit) 063ac5c3 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SfxVersionDialog

Change-Id: I6adb8baff9792c65e3474c10e6ffdac56fe2e5ff
Reviewed-on: https://gerrit.libreoffice.org/53869Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 8ffd83de
......@@ -270,20 +270,17 @@ void SfxVersionDialog::Init_Impl()
SfxObjectShell *pObjShell = pViewFrame->GetObjectShell();
SfxMedium* pMedium = pObjShell->GetMedium();
uno::Sequence < util::RevisionTag > aVersions = pMedium->GetVersionList( true );
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 );
}
m_pSaveCheckBox->Check( m_bIsSaveVersionOnClose );
......@@ -312,7 +309,7 @@ SfxVersionDialog::~SfxVersionDialog()
void SfxVersionDialog::dispose()
{
delete m_pTable;
m_pTable.reset();
m_pVersionBox.disposeAndClear();
m_pSaveButton.clear();
m_pSaveCheckBox.clear();
......
......@@ -55,7 +55,7 @@ class SfxVersionDialog : public SfxModalDialog
VclPtr<PushButton> m_pCompareButton;
VclPtr<PushButton> m_pCmisButton;
SfxViewFrame* pViewFrame;
SfxVersionTableDtor* m_pTable;
std::unique_ptr<SfxVersionTableDtor> m_pTable;
bool m_bIsSaveVersionOnClose;
DECL_LINK( DClickHdl_Impl, SvTreeListBox*, bool);
......
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