Kaydet (Commit) 7edc6b9a authored tarafından Caolán McNamara's avatar Caolán McNamara

fix leak

Change-Id: Id6171fbaffda1f0a20d33e9137d68e14c59e6aac
üst 696f5cfe
......@@ -163,7 +163,6 @@ private:
LwpDocOptions m_DocOptions;
LwpDocInfo m_DocInfo;
LwpDocControl m_DocControl;
// static std::map<sal_uInt16,LwpEditorAttr*> m_EditorAttrMap;
private:
LtTm m_nCreationTime;
LtTm m_nLastRevisionTime;
......
......@@ -95,12 +95,6 @@ LwpGlobalMgr::~LwpGlobalMgr()
delete m_pXFStyleManager;
m_pXFStyleManager = nullptr;
}
std::map<sal_uInt16,LwpEditorAttr*>::iterator iter;
for (iter =m_EditorAttrMap.begin();iter != m_EditorAttrMap.end(); ++iter)
{
delete iter->second;
iter->second = nullptr;
}
m_EditorAttrMap.clear();
}
......@@ -134,13 +128,12 @@ void LwpGlobalMgr::DeleteInstance()
void LwpGlobalMgr::SetEditorAttrMap(sal_uInt16 nID, LwpEditorAttr* pAttr)
{
m_EditorAttrMap[nID] = pAttr;
m_EditorAttrMap[nID].reset(pAttr);
}
OUString LwpGlobalMgr::GetEditorName(sal_uInt8 nID)
{
std::map<sal_uInt16,LwpEditorAttr*>::iterator iter;
iter = m_EditorAttrMap.find(nID);
auto iter = m_EditorAttrMap.find(nID);
if (iter != m_EditorAttrMap.end())
return iter->second->cName.str();
return OUString("");
......@@ -148,9 +141,7 @@ OUString LwpGlobalMgr::GetEditorName(sal_uInt8 nID)
XFColor LwpGlobalMgr::GetHighlightColor(sal_uInt8 nID)
{
std::map<sal_uInt16,LwpEditorAttr*>::iterator iter;
iter = m_EditorAttrMap.find(nID);
auto iter = m_EditorAttrMap.find(nID);
if (iter != m_EditorAttrMap.end())
{
LwpColor aLwpColor = iter->second->cHiLiteColor;
......
......@@ -95,7 +95,7 @@ private:
LwpChangeMgr* m_pChangeMgr;
XFFontFactory* m_pXFFontFactory;
XFStyleManager* m_pXFStyleManager;
std::map< sal_uInt16,LwpEditorAttr* > m_EditorAttrMap;
std::map<sal_uInt16, std::unique_ptr<LwpEditorAttr>> m_EditorAttrMap;
};
#endif
......
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