115 // --------------------------------------------------------------------------- |
115 // --------------------------------------------------------------------------- |
116 CSvgFontFaceElementImpl::~CSvgFontFaceElementImpl() |
116 CSvgFontFaceElementImpl::~CSvgFontFaceElementImpl() |
117 { |
117 { |
118 //AJD this whole thing needs to be replaced with some sort of external resource registry area.... |
118 //AJD this whole thing needs to be replaced with some sort of external resource registry area.... |
119 //for images, fonts, other svg files |
119 //for images, fonts, other svg files |
120 if ( ((CSvgDocumentImpl*)iOwnerDocument)->Engine() && ((CSvgDocumentImpl*)iOwnerDocument)->Engine()->iFontHashMap) |
120 CSvgDocumentImpl * ownerDoc = (CSvgDocumentImpl*)iOwnerDocument; |
121 { |
121 if ( ownerDoc ) |
122 TRAPD(err, ((CSvgDocumentImpl*)iOwnerDocument)->Engine()->iFontHashMap->RemoveReferenceFromFontL(iFontFamily->Des())); |
122 { |
123 if (err) |
123 if ( ownerDoc->Engine() && ownerDoc->Engine()->iFontHashMap) |
124 { |
124 { |
125 #ifdef _DEBUG |
125 TRAPD(err, ownerDoc->Engine()->iFontHashMap->RemoveReferenceFromFontL(iFontFamily->Des())); |
126 RDebug::Printf("CSvgFontFaceElementImpl::~CSvgFontFaceElementImpl: Error trapped=%d", err); |
126 if (err) |
127 #endif |
127 { |
128 } |
128 #ifdef _DEBUG |
129 } |
129 RDebug::Printf("CSvgFontFaceElementImpl::~CSvgFontFaceElementImpl: Error trapped=%d", err); |
130 |
130 #endif |
131 if ( (CSvgDocumentImpl*)iOwnerDocument && ((CSvgDocumentImpl*)iOwnerDocument)->iFontHashMap) |
131 } |
132 { |
132 } |
133 TRAPD(err, ((CSvgDocumentImpl*)iOwnerDocument)->iFontHashMap->RemoveReferenceFromFontL(iFontFamily->Des())); |
133 |
134 if (err) |
134 if ( ownerDoc->iFontHashMap) |
135 { |
135 { |
136 #ifdef _DEBUG |
136 TRAPD(err, ownerDoc->iFontHashMap->RemoveReferenceFromFontL(iFontFamily->Des())); |
137 RDebug::Printf("CSvgFontFaceElementImpl::~CSvgFontFaceElementImpl: Error trapped=%d", err); |
137 if (err) |
138 #endif |
138 { |
139 } |
139 #ifdef _DEBUG |
140 } |
140 RDebug::Printf("CSvgFontFaceElementImpl::~CSvgFontFaceElementImpl: Error trapped=%d", err); |
141 |
141 #endif |
|
142 } |
|
143 } |
|
144 } |
142 if ( iFontFamily ) |
145 if ( iFontFamily ) |
143 { |
146 { |
144 delete iFontFamily; |
147 delete iFontFamily; |
145 iFontFamily = NULL; |
148 iFontFamily = NULL; |
146 } |
149 } |