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

(-)sfx2/source/doc/objcont.cxx (-1 / +6 lines)
Lines 764-771 Link Here
764
			sal_uInt16 nStyles = pIter->Count();
764
			sal_uInt16 nStyles = pIter->Count();
765
			SfxStyleSheetBase *pStyle = pIter->First();
765
			SfxStyleSheetBase *pStyle = pIter->First();
766
			if ( !pStyle )
766
			if ( !pStyle )
767
				return sal_True;
767
            {
768
                // memory leak #i120077#
769
                delete pIter;
768
770
771
                return sal_True;
772
            }
773
769
            // pepare adaptor for old style StartPage/EndPage printing
774
            // pepare adaptor for old style StartPage/EndPage printing
770
            boost::shared_ptr< Printer > pPrinter( new Printer( rPrt.GetJobSetup() ) );
775
            boost::shared_ptr< Printer > pPrinter( new Printer( rPrt.GetJobSetup() ) );
771
            vcl::OldStylePrintAdaptor* pAdaptor = new vcl::OldStylePrintAdaptor( pPrinter );
776
            vcl::OldStylePrintAdaptor* pAdaptor = new vcl::OldStylePrintAdaptor( pPrinter );
(-)sc/source/filter/xml/xmlfonte.cxx (-6 / +25 lines)
Lines 45-55 Link Here
45
45
46
class ScXMLFontAutoStylePool_Impl: public XMLFontAutoStylePool
46
class ScXMLFontAutoStylePool_Impl: public XMLFontAutoStylePool
47
{
47
{
48
	void AddFontItems(sal_uInt16* pWhichIds, sal_uInt8 nIdCount, const SfxItemPool* pItemPool, const sal_Bool bExportDefaults);
48
private:
49
	public:
49
    // #i120077# remember owned pool
50
	SfxItemPool*    mpEditEnginePool;
50
51
52
    void AddFontItems(sal_uInt16* pWhichIds, sal_uInt8 nIdCount, const SfxItemPool* pItemPool, const sal_Bool bExportDefaults);
53
public:
51
	ScXMLFontAutoStylePool_Impl( ScXMLExport& rExport );
54
	ScXMLFontAutoStylePool_Impl( ScXMLExport& rExport );
52
55
	virtual ~ScXMLFontAutoStylePool_Impl();
53
};
56
};
54
57
55
void ScXMLFontAutoStylePool_Impl::AddFontItems(sal_uInt16* pWhichIds, sal_uInt8 nIdCount, const SfxItemPool* pItemPool, const sal_Bool bExportDefaults)
58
void ScXMLFontAutoStylePool_Impl::AddFontItems(sal_uInt16* pWhichIds, sal_uInt8 nIdCount, const SfxItemPool* pItemPool, const sal_Bool bExportDefaults)
Lines 83-89 Link Here
83
86
84
ScXMLFontAutoStylePool_Impl::ScXMLFontAutoStylePool_Impl(
87
ScXMLFontAutoStylePool_Impl::ScXMLFontAutoStylePool_Impl(
85
	ScXMLExport& rExportP ) :
88
	ScXMLExport& rExportP ) :
86
	XMLFontAutoStylePool( rExportP )
89
	XMLFontAutoStylePool( rExportP ),
90
    mpEditEnginePool(0)
87
{
91
{
88
	sal_uInt16 aWhichIds[3] = { ATTR_FONT, ATTR_CJK_FONT,
92
	sal_uInt16 aWhichIds[3] = { ATTR_FONT, ATTR_CJK_FONT,
89
								ATTR_CTL_FONT };
93
								ATTR_CTL_FONT };
Lines 101-109 Link Here
101
	if(pItr)
105
	if(pItr)
102
	{
106
	{
103
		SfxStyleSheetBase* pStyle(pItr->First());
107
		SfxStyleSheetBase* pStyle(pItr->First());
104
		SfxItemPool* pPageEditPool(EditEngine::CreatePool());
108
		
109
        // #i120077# init pool and use it
110
		mpEditEnginePool = EditEngine::CreatePool();  // memory leak #i120077#, to save the SfxItemPool obj into member data for releasing
111
		SfxItemPool* pPageEditPool( mpEditEnginePool );
105
		EditEngine aEditEngine(pPageEditPool);
112
		EditEngine aEditEngine(pPageEditPool);
106
		while (pStyle)
113
		
114
        while (pStyle)
107
		{
115
		{
108
			const SfxItemPool& rPagePool(pStyle->GetPool().GetPool());
116
			const SfxItemPool& rPagePool(pStyle->GetPool().GetPool());
109
			for (sal_uInt8 j = 0; j < 4; ++j)
117
			for (sal_uInt8 j = 0; j < 4; ++j)
Lines 138-146 Link Here
138
			}
146
			}
139
			pStyle = pItr->Next();
147
			pStyle = pItr->Next();
140
		}
148
		}
149
150
        // memory leak #i120077#
151
		delete pItr;  
141
	}
152
	}
142
}
153
}
143
154
155
ScXMLFontAutoStylePool_Impl::~ScXMLFontAutoStylePool_Impl()
156
{
157
	if(mpEditEnginePool)
158
	{
159
        // memory leak #i120077#
160
		SfxItemPool::Free(mpEditEnginePool);  
161
	}
162
}
144
163
145
XMLFontAutoStylePool* ScXMLExport::CreateFontAutoStylePool()
164
XMLFontAutoStylePool* ScXMLExport::CreateFontAutoStylePool()
146
{
165
{
(-)sc/source/core/data/patattr.cxx (+3 lines)
Lines 1197-1202 Link Here
1197
			SfxStyleSheetIterator* pIter = pDoc->GetStyleSheetPool()->CreateIterator(
1197
			SfxStyleSheetIterator* pIter = pDoc->GetStyleSheetPool()->CreateIterator(
1198
													SFX_STYLE_FAMILY_PARA, SFXSTYLEBIT_ALL );
1198
													SFX_STYLE_FAMILY_PARA, SFXSTYLEBIT_ALL );
1199
			pStyle = (ScStyleSheet*)pIter->First();
1199
			pStyle = (ScStyleSheet*)pIter->First();
1200
1201
            // memory leak #i120077#
1202
            delete pIter;
1200
		}
1203
		}
1201
1204
1202
		if (pStyle)
1205
		if (pStyle)
(-)sc/source/core/data/stlsheet.cxx (+3 lines)
Lines 123-128 Link Here
123
		pStyle = pIter->First();
123
		pStyle = pIter->First();
124
		if (pStyle)
124
		if (pStyle)
125
			aEffName = pStyle->GetName();
125
			aEffName = pStyle->GetName();
126
127
        // memory leak #i120077#
128
        delete pIter;
126
	}
129
	}
127
130
128
	if ( pStyle && aEffName != GetName() )
131
	if ( pStyle && aEffName != GetName() )

Return to issue 120077