svgtopt/SVG/SVGImpl/src/SVGFontFaceElementImpl.cpp
branchRCL_3
changeset 17 db5c883ad1c5
parent 0 d46562c3d99d
child 18 1902ade171ab
--- a/svgtopt/SVG/SVGImpl/src/SVGFontFaceElementImpl.cpp	Tue May 11 17:02:26 2010 +0300
+++ b/svgtopt/SVG/SVGImpl/src/SVGFontFaceElementImpl.cpp	Tue Aug 31 16:06:58 2010 +0300
@@ -117,28 +117,31 @@
     {
     //AJD this whole thing needs to be replaced with some sort of external resource registry area....
     //for images, fonts, other svg files
-    if ( ((CSvgDocumentImpl*)iOwnerDocument)->Engine() && ((CSvgDocumentImpl*)iOwnerDocument)->Engine()->iFontHashMap)
-	{
-    TRAPD(err, ((CSvgDocumentImpl*)iOwnerDocument)->Engine()->iFontHashMap->RemoveReferenceFromFontL(iFontFamily->Des()));
-    if (err)
+    CSvgDocumentImpl * ownerDoc = (CSvgDocumentImpl*)iOwnerDocument;
+    if ( ownerDoc )
         {
-        #ifdef _DEBUG
-        RDebug::Printf("CSvgFontFaceElementImpl::~CSvgFontFaceElementImpl: Error trapped=%d", err);
-        #endif
+        if ( ownerDoc->Engine() && ownerDoc->Engine()->iFontHashMap)
+            {
+            TRAPD(err, ownerDoc->Engine()->iFontHashMap->RemoveReferenceFromFontL(iFontFamily->Des()));
+            if (err)
+                {
+                #ifdef _DEBUG
+                RDebug::Printf("CSvgFontFaceElementImpl::~CSvgFontFaceElementImpl: Error trapped=%d", err);
+                #endif
+                }
+            }
+        
+        if ( ownerDoc->iFontHashMap)
+            {
+            TRAPD(err, ownerDoc->iFontHashMap->RemoveReferenceFromFontL(iFontFamily->Des()));
+            if (err)
+                {
+                #ifdef _DEBUG
+                RDebug::Printf("CSvgFontFaceElementImpl::~CSvgFontFaceElementImpl: Error trapped=%d", err);
+                #endif
+                }
+            }
         }
-	}
-
-	if ( (CSvgDocumentImpl*)iOwnerDocument && ((CSvgDocumentImpl*)iOwnerDocument)->iFontHashMap)
-	{
-	TRAPD(err, ((CSvgDocumentImpl*)iOwnerDocument)->iFontHashMap->RemoveReferenceFromFontL(iFontFamily->Des()));
-    if (err)
-        {
-        #ifdef _DEBUG
-        RDebug::Printf("CSvgFontFaceElementImpl::~CSvgFontFaceElementImpl: Error trapped=%d", err);
-        #endif
-        }
-	}
-
     if ( iFontFamily )
         {
         delete iFontFamily;