webengine/osswebengine/WebKit/s60/webview/WebCursor.cpp
branchRCL_3
changeset 47 e1bea15f9a39
parent 36 c711bdda59f4
child 48 79859ed3eea9
--- a/webengine/osswebengine/WebKit/s60/webview/WebCursor.cpp	Thu Jul 15 19:53:20 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebCursor.cpp	Thu Aug 19 10:58:56 2010 +0300
@@ -136,21 +136,27 @@
 // -----------------------------------------------------------------------------
 // WebCursor::setCurrentView
 // -----------------------------------------------------------------------------
-void WebCursor::setCurrentView(WebView& view)
-    {
-    if (!m_view)
+void WebCursor::setCurrentView(WebView* view)
     {
-        m_view = &view;
-        TRAP_IGNORE( constructSpriteL() );
-    }
+    
+    if( !view )
+        {
+        m_view = view;
+        m_sprite->Hide();
+        m_sprite->SetParent(NULL);
+        return ;  
+        }
     //switching between diffrent webviews, set current webview as the parent to m_sprite
-    if( m_sprite->Parent() != &view)
-    {
-        m_view = &view;
-        CCoeControl* parent = static_cast<CCoeControl*>(m_view);
+    if( (m_sprite && m_sprite->Parent() != view) || !m_sprite)
+        {
+        m_view = view;
+        if( !m_sprite )
+            constructSpriteL();
+        CCoeControl* parent = static_cast<CCoeControl*>(view);
         m_sprite->SetParent(parent);
-    }
-    m_view = &view;
+        m_sprite->Show(); 
+        }
+    m_view = view;
     setOpaqueUntil(KTransparencyTime);
     m_transcount = 0;
     }
@@ -190,9 +196,10 @@
     CleanupStack::PopAndDestroy();
     /////////////////////////////////
  
+    TPoint pos = TPoint(KInitialOffset,KInitialOffset);
     CCoeControl* parent = static_cast<CCoeControl*>(m_view);
-    TPoint pos = TPoint(KInitialOffset,KInitialOffset);
-    m_sprite = CWebSprite::NewL(parent, pos, m_arrow.m_img, m_arrow.m_msk, ETrue);
+    m_sprite = CWebSprite::NewL(parent,pos, m_arrow.m_img, m_arrow.m_msk, ETrue);
+    m_sprite->Hide();
     }
 
 // -----------------------------------------------------------------------------