Issue 120865 - Part of EditAttrib objects are not released after removing from Character attributes list
Summary: Part of EditAttrib objects are not released after removing from Character att...
Status: CLOSED FIXED
Alias: None
Product: performance
Classification: Code
Component: code (show other issues)
Version: AOO 3.4.1
Hardware: All All
: P3 Normal (vote)
Target Milestone: 4.0.0
Assignee: zhang jianfang
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 120975
  Show dependency treegraph
 
Reported: 2012-09-10 05:17 UTC by zhang jianfang
Modified: 2013-07-12 10:54 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
editdoc.cxx.patch (531 bytes, patch)
2012-09-10 05:25 UTC, zhang jianfang
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description zhang jianfang 2012-09-10 05:17:53 UTC
In api EditDoc::InsertAttrib(), some of EditCharAttrib objects are not freed after removing from CharAttribs(),

void EditDoc::InsertAttrib( ContentNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem )
{
	if ( nStart != nEnd )
	{
		InsertAttribInSelection( pNode, nStart, nEnd, rPoolItem );
	}
	else
	{
		// Pruefen, ob schon ein neues Attribut mit der WhichId an der Stelle:
		EditCharAttrib* pAttr = pNode->GetCharAttribs().FindEmptyAttrib( rPoolItem.Which(), nStart );
		if ( pAttr )
		{
			// Attribut entfernen....
			pNode->GetCharAttribs().GetAttribs().Remove(
				pNode->GetCharAttribs().GetAttribs().GetPos( pAttr ) );
			// pAttr <--- need free here
		}
 ...
 
}
Comment 1 zhang jianfang 2012-09-10 05:25:40 UTC
Created attachment 79368 [details]
editdoc.cxx.patch

Need to free the EditAttrib object explictly after removing it from CharAttribList.
Comment 2 SVN Robot 2012-09-10 05:34:34 UTC
"zhangjf" committed SVN revision 1382643 into trunk:
#i120865#, Need to free the EditAttrib object explictly after removing it fro...
Comment 3 zhang jianfang 2012-09-10 05:35:09 UTC
Change to resolved state.