svgtopt/SVG/SVGImpl/src/SVGFontFaceElementImpl.cpp
branchRCL_3
changeset 18 1902ade171ab
parent 17 db5c883ad1c5
equal deleted inserted replaced
17:db5c883ad1c5 18:1902ade171ab
   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     CSvgDocumentImpl * ownerDoc = (CSvgDocumentImpl*)iOwnerDocument;
   120     if ( ((CSvgDocumentImpl*)iOwnerDocument)->Engine() && ((CSvgDocumentImpl*)iOwnerDocument)->Engine()->iFontHashMap)
   121     if ( ownerDoc )
   121 	{
   122         {
   122     TRAPD(err, ((CSvgDocumentImpl*)iOwnerDocument)->Engine()->iFontHashMap->RemoveReferenceFromFontL(iFontFamily->Des()));
   123         if ( ownerDoc->Engine() && ownerDoc->Engine()->iFontHashMap)
   123     if (err)
   124             {
   124         {
   125             TRAPD(err, ownerDoc->Engine()->iFontHashMap->RemoveReferenceFromFontL(iFontFamily->Des()));
   125         #ifdef _DEBUG
   126             if (err)
   126         RDebug::Printf("CSvgFontFaceElementImpl::~CSvgFontFaceElementImpl: Error trapped=%d", err);
   127                 {
   127         #endif
   128                 #ifdef _DEBUG
   128         }
   129                 RDebug::Printf("CSvgFontFaceElementImpl::~CSvgFontFaceElementImpl: Error trapped=%d", err);
   129 	}
   130                 #endif
   130 
   131                 }
   131 	if ( (CSvgDocumentImpl*)iOwnerDocument && ((CSvgDocumentImpl*)iOwnerDocument)->iFontHashMap)
   132             }
   132 	{
   133         
   133 	TRAPD(err, ((CSvgDocumentImpl*)iOwnerDocument)->iFontHashMap->RemoveReferenceFromFontL(iFontFamily->Des()));
   134         if ( ownerDoc->iFontHashMap)
   134     if (err)
   135             {
   135         {
   136             TRAPD(err, ownerDoc->iFontHashMap->RemoveReferenceFromFontL(iFontFamily->Des()));
   136         #ifdef _DEBUG
   137             if (err)
   137         RDebug::Printf("CSvgFontFaceElementImpl::~CSvgFontFaceElementImpl: Error trapped=%d", err);
   138                 {
   138         #endif
   139                 #ifdef _DEBUG
   139         }
   140                 RDebug::Printf("CSvgFontFaceElementImpl::~CSvgFontFaceElementImpl: Error trapped=%d", err);
   140 	}
   141                 #endif
   141 
   142                 }
       
   143             }
       
   144         }
       
   145     if ( iFontFamily )
   142     if ( iFontFamily )
   146         {
   143         {
   147         delete iFontFamily;
   144         delete iFontFamily;
   148         iFontFamily = NULL;
   145         iFontFamily = NULL;
   149         }
   146         }