View | Details | Raw Unified | Return to issue 120077
Collapse All | Expand All

(-)sc/source/filter/xml/xmlfonte.cxx (-1 / +18 lines)
Lines 49-55 Link Here
49
	public:
49
	public:
50
50
51
	ScXMLFontAutoStylePool_Impl( ScXMLExport& rExport );
51
	ScXMLFontAutoStylePool_Impl( ScXMLExport& rExport );
52
	virtual ~ScXMLFontAutoStylePool_Impl();
52
53
54
	private:
55
		SfxItemPool *pEditEnginePool;
56
53
};
57
};
54
58
55
void ScXMLFontAutoStylePool_Impl::AddFontItems(sal_uInt16* pWhichIds, sal_uInt8 nIdCount, const SfxItemPool* pItemPool, const sal_Bool bExportDefaults)
59
void ScXMLFontAutoStylePool_Impl::AddFontItems(sal_uInt16* pWhichIds, sal_uInt8 nIdCount, const SfxItemPool* pItemPool, const sal_Bool bExportDefaults)
Lines 96-107 Link Here
96
	AddFontItems(aWhichIds, 3, pItemPool, sal_True);
100
	AddFontItems(aWhichIds, 3, pItemPool, sal_True);
97
	const SfxItemPool* pEditPool(rExportP.GetDocument()->GetEditPool());
101
	const SfxItemPool* pEditPool(rExportP.GetDocument()->GetEditPool());
98
	AddFontItems(aEditWhichIds, 3, pEditPool, sal_False);
102
	AddFontItems(aEditWhichIds, 3, pEditPool, sal_False);
103
	pEditEnginePool = NULL;
99
104
100
	SfxStyleSheetIterator* pItr(rExportP.GetDocument() ? rExportP.GetDocument()->GetStyleSheetPool()->CreateIterator(SFX_STYLE_FAMILY_PAGE, 0xFFFF) : NULL);
105
	SfxStyleSheetIterator* pItr(rExportP.GetDocument() ? rExportP.GetDocument()->GetStyleSheetPool()->CreateIterator(SFX_STYLE_FAMILY_PAGE, 0xFFFF) : NULL);
101
	if(pItr)
106
	if(pItr)
102
	{
107
	{
103
		SfxStyleSheetBase* pStyle(pItr->First());
108
		SfxStyleSheetBase* pStyle(pItr->First());
104
		SfxItemPool* pPageEditPool(EditEngine::CreatePool());
109
		
110
		pEditEnginePool = EditEngine::CreatePool();  // memory leak #i120077#, to save the SfxItemPool obj into member data for releasing
111
		SfxItemPool* pPageEditPool( pEditEnginePool );
105
		EditEngine aEditEngine(pPageEditPool);
112
		EditEngine aEditEngine(pPageEditPool);
106
		while (pStyle)
113
		while (pStyle)
107
		{
114
		{
Lines 138-147 Link Here
138
			}
145
			}
139
			pStyle = pItr->Next();
146
			pStyle = pItr->Next();
140
		}
147
		}
148
149
		delete pItr;  // memory leak #i120077#
141
	}
150
	}
142
}
151
}
143
152
153
ScXMLFontAutoStylePool_Impl::~ScXMLFontAutoStylePool_Impl()
154
{
155
	if (pEditEnginePool != NULL)
156
	{
157
		SfxItemPool::Free( pEditEnginePool );  // memory leak #i120077#
158
	}
144
159
160
}
161
145
XMLFontAutoStylePool* ScXMLExport::CreateFontAutoStylePool()
162
XMLFontAutoStylePool* ScXMLExport::CreateFontAutoStylePool()
146
{
163
{
147
	return new ScXMLFontAutoStylePool_Impl( *this );
164
	return new ScXMLFontAutoStylePool_Impl( *this );

Return to issue 120077