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

loplugin:useuniqueptr inSwDocShell

Change-Id: I9b834406b391695a18c9fdcdad9a6dd13be34c9e
Reviewed-on: https://gerrit.libreoffice.org/57867
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 14377b33
......@@ -67,7 +67,7 @@ class SW_DLLPUBLIC SwDocShell
{
rtl::Reference< SwDoc > m_xDoc; ///< Document.
rtl::Reference< SfxStyleSheetBasePool > m_xBasePool; ///< Passing through for formats.
FontList* m_pFontList; ///< Current Fontlist.
std::unique_ptr<FontList> m_pFontList; ///< Current Fontlist.
bool m_IsInUpdateFontList; ///< prevent nested calls of UpdateFontList
std::unique_ptr<sfx2::StyleManager> m_pStyleManager;
......@@ -80,7 +80,7 @@ class SW_DLLPUBLIC SwDocShell
SwView* m_pView;
SwWrtShell* m_pWrtShell;
comphelper::EmbeddedObjectContainer* m_pOLEChildList;
std::unique_ptr<comphelper::EmbeddedObjectContainer> m_pOLEChildList;
sal_Int16 m_nUpdateDocMode; ///< contains the css::document::UpdateDocMode
bool m_IsATemplate; ///< prevent nested calls of UpdateFontList
......
......@@ -827,7 +827,7 @@ bool SwDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xStor
}
}
DELETEZ(m_pOLEChildList);
m_pOLEChildList.reset();
if( bResetModified )
EnableSetModified();
}
......@@ -1080,7 +1080,7 @@ void SwDocShell::GetState(SfxItemSet& rSet)
break;
case SID_ATTR_CHAR_FONTLIST:
{
rSet.Put( SvxFontListItem(m_pFontList, SID_ATTR_CHAR_FONTLIST) );
rSet.Put( SvxFontListItem(m_pFontList.get(), SID_ATTR_CHAR_FONTLIST) );
}
break;
case SID_MAIL_PREPAREEXPORT:
......@@ -1235,7 +1235,7 @@ void SwDocShell::RemoveOLEObjects()
pOLENd->IsInGlobalDocSection() ) )
{
if (!m_pOLEChildList)
m_pOLEChildList = new comphelper::EmbeddedObjectContainer;
m_pOLEChildList.reset( new comphelper::EmbeddedObjectContainer );
OUString aObjName = pOLENd->GetOLEObj().GetCurrentPersistName();
GetEmbeddedObjectContainer().MoveEmbeddedObject( aObjName, *m_pOLEChildList );
......
......@@ -391,13 +391,13 @@ SwDocShell::~SwDocShell()
}
RemoveLink();
delete m_pFontList;
m_pFontList.reset();
// we, as BroadCaster also become our own Listener
// (for DocInfo/FileNames/....)
EndListening( *this );
delete m_pOLEChildList;
m_pOLEChildList.reset();
}
void SwDocShell::Init_Impl()
......@@ -441,9 +441,8 @@ void SwDocShell::UpdateFontList()
OSL_ENSURE(m_xDoc.get(), "No Doc no FontList");
if (m_xDoc.get())
{
delete m_pFontList;
m_pFontList = new FontList( m_xDoc->getIDocumentDeviceAccess().getReferenceDevice(true) );
PutItem( SvxFontListItem( m_pFontList, SID_ATTR_CHAR_FONTLIST ) );
m_pFontList.reset( new FontList( m_xDoc->getIDocumentDeviceAccess().getReferenceDevice(true) ) );
PutItem( SvxFontListItem( m_pFontList.get(), SID_ATTR_CHAR_FONTLIST ) );
}
m_IsInUpdateFontList = false;
}
......
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