<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[24845] S60/branches/3.1m</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/24845">24845</a></dd>
<dt>Author</dt> <dd>zbujtas</dd>
<dt>Date</dt> <dd>2007-08-03 10:18:47 -0700 (Fri, 03 Aug 2007)</dd>
</dl>

<h3>Log Message</h3>
<pre>2007-08-02  yadavall  &lt;sriram.yadavalli@nokia.com&gt;

        Reviewed by Zalan Bujtas (zbujtas@gmail.com).
        DESC: Widget Cascade menu not in FIFO order
        http://bugs.webkit.org/show_bug.cgi?id=14866</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#S60branches31mWebCoreChangeLog">S60/branches/3.1m/WebCore/ChangeLog</a></li>
<li><a href="#S60branches31mWebKitBrowserViewincWidgetExtensionh">S60/branches/3.1m/WebKit/BrowserView/inc/WidgetExtension.h</a></li>
<li><a href="#S60branches31mWebKitBrowserViewsrcWidgetExtensioncpp">S60/branches/3.1m/WebKit/BrowserView/src/WidgetExtension.cpp</a></li>
<li><a href="#S60branches31mWebKitChangeLog">S60/branches/3.1m/WebKit/ChangeLog</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="S60branches31mWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: S60/branches/3.1m/WebCore/ChangeLog (24844 => 24845)</h4>
<pre class="diff"><span>
<span class="info">--- S60/branches/3.1m/WebCore/ChangeLog        2007-08-03 16:31:24 UTC (rev 24844)
+++ S60/branches/3.1m/WebCore/ChangeLog        2007-08-03 17:18:47 UTC (rev 24845)
</span><span class="lines">@@ -11,7 +11,7 @@
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Zalan Bujtas (zbujtas@gmail.com).
</span><span class="cx">         DESC: Fixes for Menu API
</span><del>-        http://bugs.webkit.org/show_bug.cgi?id=
</del><ins>+        http://bugs.webkit.org/show_bug.cgi?id=14763
</ins><span class="cx"> 
</span><span class="cx">         WARNING: NO TEST CASES ADDED OR CHANGED
</span><span class="cx"> 
</span></span></pre></div>
<a id="S60branches31mWebKitBrowserViewincWidgetExtensionh"></a>
<div class="modfile"><h4>Modified: S60/branches/3.1m/WebKit/BrowserView/inc/WidgetExtension.h (24844 => 24845)</h4>
<pre class="diff"><span>
<span class="info">--- S60/branches/3.1m/WebKit/BrowserView/inc/WidgetExtension.h        2007-08-03 16:31:24 UTC (rev 24844)
+++ S60/branches/3.1m/WebKit/BrowserView/inc/WidgetExtension.h        2007-08-03 17:18:47 UTC (rev 24845)
</span><span class="lines">@@ -196,7 +196,7 @@
</span><span class="cx">         /**
</span><span class="cx">         * Method SetRightSoftKeyLabel
</span><span class="cx">         * @since 3.2
</span><del>-        * @param text buffer to be set as right soft key label 
</del><ins>+        * @param text buffer to be set as right soft key label
</ins><span class="cx">         * @return none
</span><span class="cx">         */
</span><span class="cx">         void SetRightSoftKeyLabel( const TDesC&amp; aText );
</span><span class="lines">@@ -208,7 +208,7 @@
</span><span class="cx">         * @return none
</span><span class="cx">         */
</span><span class="cx">         void DeleteMenuItem( TInt aCmdId );
</span><del>-        
</del><ins>+
</ins><span class="cx">         /**
</span><span class="cx">         * Method ClearMenuItems
</span><span class="cx">         * @since 3.2
</span><span class="lines">@@ -226,7 +226,7 @@
</span><span class="cx">         * @param dimmed status
</span><span class="cx">         * @return Error code
</span><span class="cx">         */
</span><del>-        TInt ReplaceMenuItem( TInt oldCmdId, const TDesC&amp; newText, 
</del><ins>+        TInt ReplaceMenuItem( TInt oldCmdId, const TDesC&amp; newText,
</ins><span class="cx">             TInt newCmdId, TInt newDimmed );
</span><span class="cx"> 
</span><span class="cx">         /**
</span><span class="lines">@@ -255,7 +255,7 @@
</span><span class="cx">         * @param callback function
</span><span class="cx">         * @return none
</span><span class="cx">         */
</span><del>-        void SetMenuItemObserver( 
</del><ins>+        void SetMenuItemObserver(
</ins><span class="cx">             TInt aCmdId, WidgetEventHandler* aOnSelectCallback );
</span><span class="cx"> 
</span><span class="cx">         /**
</span><span class="lines">@@ -277,7 +277,7 @@
</span><span class="cx">         /**
</span><span class="cx">         * Method GetMenuObserver
</span><span class="cx">         * @since 3.2
</span><del>-        * @param 
</del><ins>+        * @param
</ins><span class="cx">         * @return callback function
</span><span class="cx">         */
</span><span class="cx">         WidgetEventHandler* MenuObserver();
</span><span class="lines">@@ -289,11 +289,11 @@
</span><span class="cx">         * @return none
</span><span class="cx">         */
</span><span class="cx">         void SetRightKeyObserver( WidgetEventHandler* aMenuCallback );
</span><del>-        
</del><ins>+
</ins><span class="cx">         /**
</span><span class="cx">         * Method GetMenuObserver
</span><span class="cx">         * @since 3.2
</span><del>-        * @param 
</del><ins>+        * @param
</ins><span class="cx">         * @return callback function
</span><span class="cx">         */
</span><span class="cx">         WidgetEventHandler* RightKeyObserver();
</span><span class="lines">@@ -345,7 +345,7 @@
</span><span class="cx">         * @return void
</span><span class="cx">         */
</span><span class="cx">         void SetOnShowListener( WidgetEventHandler* aCallback );
</span><del>-        
</del><ins>+
</ins><span class="cx">         /**
</span><span class="cx">         * Method GetFromMenuItemCollection
</span><span class="cx">         * @since 3.2
</span><span class="lines">@@ -353,7 +353,7 @@
</span><span class="cx">         * @return void*
</span><span class="cx">         */
</span><span class="cx">         void* GetFromMenuItemCollection( const TDesC&amp; textVal );
</span><del>-        
</del><ins>+
</ins><span class="cx">         /**
</span><span class="cx">         * Method GetFromMenuItemCollection
</span><span class="cx">         * @since 3.2
</span><span class="lines">@@ -404,7 +404,7 @@
</span><span class="cx">         * @since 3.2
</span><span class="cx">         * @return widget engine bridge
</span><span class="cx">         */
</span><del>-        MWidgetEngineBridge&amp; WidgetEngineBridge() const { 
</del><ins>+        MWidgetEngineBridge&amp; WidgetEngineBridge() const {
</ins><span class="cx">             return *iWidgetEngineBridge; }
</span><span class="cx"> 
</span><span class="cx">         /**
</span><span class="lines">@@ -444,7 +444,7 @@
</span><span class="cx">         * @param The value for the paramater
</span><span class="cx">         * @return void
</span><span class="cx">         */
</span><del>-        void SetParamL( 
</del><ins>+        void SetParamL(
</ins><span class="cx">             TBrCtlDefs::TBrCtlWidgetParams aParam, const TDesC&amp; aValue );
</span><span class="cx"> 
</span><span class="cx">         /**
</span><span class="lines">@@ -495,7 +495,7 @@
</span><span class="cx">         * @return void
</span><span class="cx">         */
</span><span class="cx">         void LoadWidgetEngineDllL();
</span><del>-        
</del><ins>+
</ins><span class="cx">         /*
</span><span class="cx">         * Method LaunchApplicationL
</span><span class="cx">         * @since 3.2
</span><span class="lines">@@ -526,7 +526,7 @@
</span><span class="cx">     private:
</span><span class="cx">         CWebKitView*            iWebKitView;//not owned
</span><span class="cx">         CWidgetPreferences*     iPreferences;
</span><del>-        TWidgetRenderer*        iWidgetRenderer;       
</del><ins>+        TWidgetRenderer*        iWidgetRenderer;
</ins><span class="cx">         TInt                    iWidgetId;
</span><span class="cx">         TBool                   iNavigationEnabled;
</span><span class="cx">         TBool                   iPageScalerWasEnabled;
</span><span class="lines">@@ -556,7 +556,7 @@
</span><span class="cx">         * @param menu item to be added
</span><span class="cx">         * @return void
</span><span class="cx">         */
</span><del>-        void AddMenuItem( CEikMenuPane&amp; aMenuPane, CMenuItem* aNode );
</del><ins>+        void AddMenuItem( CEikMenuPane&amp; aMenuPane, CMenuItem* aNode , TInt aIsRootMenuPane = EFalse);
</ins><span class="cx"> 
</span><span class="cx">         /*
</span><span class="cx">         * Method Append
</span><span class="lines">@@ -580,7 +580,7 @@
</span><span class="cx">         * Method FindNodeById
</span><span class="cx">         * @since 3.2
</span><span class="cx">         * @param root of the tree
</span><del>-        * @param command id of the menu item 
</del><ins>+        * @param command id of the menu item
</ins><span class="cx">         * @return CMenuItem*
</span><span class="cx">         */
</span><span class="cx">         CMenuItem* FindNodeById( CMenuItem* node, TInt aCmdId );
</span><span class="lines">@@ -589,7 +589,7 @@
</span><span class="cx">         * Method FindNodeByText
</span><span class="cx">         * @since 3.2
</span><span class="cx">         * @param root of the tree
</span><del>-        * @param text of the menu item 
</del><ins>+        * @param text of the menu item
</ins><span class="cx">         * @return CMenuItem*
</span><span class="cx">         */
</span><span class="cx">         CMenuItem* FindNodeByText( CMenuItem* node, const TDesC&amp; aText );
</span><span class="lines">@@ -598,10 +598,10 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> class CMenuItem : public CBase
</span><del>-    {    
</del><ins>+    {
</ins><span class="cx">     public:
</span><span class="cx">         /**
</span><del>-        * Constructor       
</del><ins>+        * Constructor
</ins><span class="cx">         */
</span><span class="cx">         static CMenuItem* NewL( const TDesC16&amp; aText, TInt aCmdId, TBool aDimmed = EFalse,
</span><span class="cx">             CMenuItem* aParent = NULL, void* aObj = NULL );
</span><span class="lines">@@ -621,7 +621,7 @@
</span><span class="cx">         * C++ constructor.
</span><span class="cx">         */
</span><span class="cx">         CMenuItem( const TDesC16&amp; aText, TInt aCmdId, TBool aDimmed, CMenuItem* aParent = NULL,
</span><del>-            void* aObj = NULL );       
</del><ins>+            void* aObj = NULL );
</ins><span class="cx"> 
</span><span class="cx">     public:
</span><span class="cx"> 
</span><span class="lines">@@ -631,8 +631,8 @@
</span><span class="cx">         * @param none
</span><span class="cx">         * @return text of menu item
</span><span class="cx">         */
</span><del>-        const TDesC&amp; Text() 
-            { 
</del><ins>+        const TDesC&amp; Text()
+            {
</ins><span class="cx">             if ( iText ) return *iText;
</span><span class="cx">             else return KNullDesC();
</span><span class="cx">             }
</span><span class="lines">@@ -660,7 +660,7 @@
</span><span class="cx">         * @return next sibling of menu item
</span><span class="cx">         */
</span><span class="cx">         CMenuItem* NextSibling() { return iNextSibling; }
</span><del>-        
</del><ins>+
</ins><span class="cx">         /*
</span><span class="cx">         * Method Dimmed()
</span><span class="cx">         * @since 3.2
</span><span class="lines">@@ -699,12 +699,12 @@
</span><span class="cx">         * @param text of menu item
</span><span class="cx">         * @return none
</span><span class="cx">         */
</span><del>-        void SetText( const TDesC&amp; aText ) 
-            { 
</del><ins>+        void SetText( const TDesC&amp; aText )
+            {
</ins><span class="cx">             HBufC* tmpText = HBufC::NewL( aText.Length() );
</span><span class="cx">             tmpText-&gt;Des().Append( aText );
</span><span class="cx">             delete iText;
</span><del>-            iText = tmpText;    
</del><ins>+            iText = tmpText;
</ins><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">         /*
</span><span class="lines">@@ -722,7 +722,7 @@
</span><span class="cx">         * @return none
</span><span class="cx">         */
</span><span class="cx">         void SetFirstChild( CMenuItem* aFirstChild ) { iFirstChild = aFirstChild; }
</span><del>-        
</del><ins>+
</ins><span class="cx">         /*
</span><span class="cx">         * Method SetNextSibling()
</span><span class="cx">         * @since 3.2
</span><span class="lines">@@ -730,7 +730,7 @@
</span><span class="cx">         * @return none
</span><span class="cx">         */
</span><span class="cx">         void SetNextSibling( CMenuItem* aNextSibling ) { iNextSibling = aNextSibling; }
</span><del>-        
</del><ins>+
</ins><span class="cx">         /*
</span><span class="cx">         * Method SetDimmed()
</span><span class="cx">         * @since 3.2
</span><span class="lines">@@ -761,7 +761,7 @@
</span><span class="cx">         CMenuItem*              iParent;//data
</span><span class="cx">         CMenuItem*              iFirstChild;//left node
</span><span class="cx">         CMenuItem*              iNextSibling;//right node
</span><del>-        TBool                   iDimmed;//ETrue to dim this menu item. EFalse to un-dim this menu item. 
</del><ins>+        TBool                   iDimmed;//ETrue to dim this menu item. EFalse to un-dim this menu item.
</ins><span class="cx">         WidgetEventHandler*     iCallback;
</span><span class="cx">         void*                   iObj;
</span><span class="cx">     };
</span></span></pre></div>
<a id="S60branches31mWebKitBrowserViewsrcWidgetExtensioncpp"></a>
<div class="modfile"><h4>Modified: S60/branches/3.1m/WebKit/BrowserView/src/WidgetExtension.cpp (24844 => 24845)</h4>
<pre class="diff"><span>
<span class="info">--- S60/branches/3.1m/WebKit/BrowserView/src/WidgetExtension.cpp        2007-08-03 16:31:24 UTC (rev 24844)
+++ S60/branches/3.1m/WebKit/BrowserView/src/WidgetExtension.cpp        2007-08-03 17:18:47 UTC (rev 24845)
</span><span class="lines">@@ -434,13 +434,13 @@
</span><span class="cx">     if ( node )
</span><span class="cx">         {
</span><span class="cx">         //add first child
</span><del>-        AddMenuItem( aMenuPane, node );
</del><ins>+        AddMenuItem( aMenuPane, node, parentCmdId == -1 );
</ins><span class="cx"> 
</span><span class="cx">         //add all other children (siblings of first child)
</span><span class="cx">         CMenuItem* sibling = node-&gt;NextSibling();
</span><span class="cx">         while( sibling )
</span><span class="cx">             {
</span><del>-            AddMenuItem( aMenuPane, sibling );
</del><ins>+            AddMenuItem( aMenuPane, sibling, parentCmdId == -1 );
</ins><span class="cx">             sibling = sibling-&gt;NextSibling();
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -454,7 +454,7 @@
</span><span class="cx"> //
</span><span class="cx"> // ----------------------------------------------------------------------------
</span><span class="cx"> //
</span><del>-void CWidgetExtension::AddMenuItem( CEikMenuPane&amp; aMenuPane, CMenuItem* aNode )
</del><ins>+void CWidgetExtension::AddMenuItem( CEikMenuPane&amp; aMenuPane, CMenuItem* aNode , TBool aIsRootMenuPane)
</ins><span class="cx">     {
</span><span class="cx">     CEikMenuPaneItem::SData menuData;
</span><span class="cx">     menuData.iCommandId = aNode-&gt;CmdId() + KMenuItemCommandIdBase;
</span><span class="lines">@@ -463,17 +463,17 @@
</span><span class="cx">         {
</span><span class="cx">         if ( iResourceId &gt; R_CASCADE_MENU_1 + KMaxOptionsMenu )
</span><span class="cx">             {
</span><del>-            menuData.iCascadeId = 0;
</del><ins>+            return; //Dont add any menu item any more
</ins><span class="cx">             }
</span><span class="cx">         else
</span><span class="cx">             {
</span><span class="cx">             menuData.iCascadeId = iResourceId;
</span><del>-            }            
</del><ins>+            }
</ins><span class="cx">         }
</span><span class="cx">     else
</span><span class="cx">         {
</span><span class="cx">         menuData.iCascadeId = 0;
</span><del>-        }        
</del><ins>+        }
</ins><span class="cx"> 
</span><span class="cx">     menuData.iFlags = 0;
</span><span class="cx">     menuData.iText = aNode-&gt;Text();
</span><span class="lines">@@ -483,7 +483,10 @@
</span><span class="cx">     entry.parentCmdId = aNode-&gt;CmdId();
</span><span class="cx">     iCascadeArr.Append( entry );
</span><span class="cx"> 
</span><del>-    aMenuPane.InsertMenuItemL( menuData, Max(aMenuPane.NumberOfItemsInPane()-1,0) );
</del><ins>+    //Since root menu pane has &quot;Exit&quot; at the botton, menu items must be added at last - 1
+    //else items will get appended below &quot;Exit&quot;
+    TInt index = aIsRootMenuPane ? aMenuPane.NumberOfItemsInPane() - 1 : aMenuPane.NumberOfItemsInPane();
+    aMenuPane.InsertMenuItemL( menuData, index );
</ins><span class="cx">     aMenuPane.SetItemDimmed( aNode-&gt;CmdId()+KMenuItemCommandIdBase, aNode-&gt;Dimmed() );
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -499,8 +502,6 @@
</span><span class="cx">         {
</span><span class="cx">         iWidgetEngineBridge-&gt;MenuItemSelected( aCmdId - KMenuItemCommandIdBase );
</span><span class="cx">         }
</span><del>-
-    OnShowSelected();
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> // ----------------------------------------------------------------------------
</span><span class="lines">@@ -662,14 +663,14 @@
</span><span class="cx"> //
</span><span class="cx"> // -----------------------------------------------------------------------------
</span><span class="cx"> //
</span><del>-TInt CWidgetExtension::AddOptionsMenuItem( 
</del><ins>+TInt CWidgetExtension::AddOptionsMenuItem(
</ins><span class="cx">     const TDesC&amp; aText, TInt aCmdId, TBool aDimmed, TInt aParentId, void* aObj )
</span><del>-    {   
-    if ( !iMenuRoot ) 
-        { 
</del><ins>+    {
+    if ( !iMenuRoot )
+        {
</ins><span class="cx">         iMenuRoot = CMenuItem::NewL( _L(&quot;&quot;), -1 );
</span><del>-        }    
-        
</del><ins>+        }
+
</ins><span class="cx">     if ( aText.Length() &gt; 0 )
</span><span class="cx">         {
</span><span class="cx">         CMenuItem* parent = FindNodeById( iMenuRoot, aParentId );
</span><span class="lines">@@ -677,25 +678,25 @@
</span><span class="cx">             {
</span><span class="cx">             return KErrGeneral;
</span><span class="cx">             }
</span><del>-        
</del><ins>+
</ins><span class="cx">         CMenuItem* item = NULL;
</span><del>-        item = FindNodeById( iMenuRoot, aCmdId );        
</del><ins>+        item = FindNodeById( iMenuRoot, aCmdId );
</ins><span class="cx">         if ( item )
</span><span class="cx">             {
</span><span class="cx">             return KErrAlreadyExists;
</span><span class="cx">             }
</span><del>-                    
</del><ins>+
</ins><span class="cx">         item = FindNodeByText( iMenuRoot, aText );
</span><span class="cx">         if ( item )
</span><span class="cx">             {
</span><span class="cx">             return KErrAlreadyExists;
</span><span class="cx">             }
</span><del>-                    
</del><ins>+
</ins><span class="cx">         item = CMenuItem::NewL( aText, aCmdId, aDimmed, parent, aObj );
</span><del>-        return Append( parent, item );    
</del><ins>+        return Append( parent, item );
</ins><span class="cx">         }
</span><del>-        
-    return KErrGeneral;                
</del><ins>+
+    return KErrGeneral;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> // -----------------------------------------------------------------------------
</span><span class="lines">@@ -721,9 +722,9 @@
</span><span class="cx"> //
</span><span class="cx"> // -----------------------------------------------------------------------------
</span><span class="cx"> //
</span><del>-TInt CWidgetExtension::Append( 
</del><ins>+TInt CWidgetExtension::Append(
</ins><span class="cx">     CMenuItem* aParent, CMenuItem* aItem )
</span><del>-    {  
</del><ins>+    {
</ins><span class="cx">     if ( !aParent )
</span><span class="cx">         {
</span><span class="cx">         return KErrGeneral;
</span><span class="lines">@@ -737,8 +738,8 @@
</span><span class="cx">         {
</span><span class="cx">         AppendSibling( aParent-&gt;FirstChild(), aItem );
</span><span class="cx">         }
</span><del>-    return KErrNone;            
-    } 
</del><ins>+    return KErrNone;
+    }
</ins><span class="cx"> 
</span><span class="cx"> // -----------------------------------------------------------------------------
</span><span class="cx"> // CWidgetExtension::AppendSibling
</span><span class="lines">@@ -798,7 +799,7 @@
</span><span class="cx">                 {
</span><span class="cx">                 item = prev-&gt;NextSibling();
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">             while( item )
</span><span class="cx">                 {
</span><span class="cx">                 if ( item-&gt;CmdId() == aCmdId )
</span><span class="lines">@@ -834,41 +835,41 @@
</span><span class="cx"> //
</span><span class="cx"> // ----------------------------------------------------------------------------
</span><span class="cx"> //
</span><del>-TInt CWidgetExtension::ReplaceMenuItem( 
-    TInt oldItemCmdId, 
-    const TDesC&amp; newItemText, 
-    TInt newItemCmdId, 
</del><ins>+TInt CWidgetExtension::ReplaceMenuItem(
+    TInt oldItemCmdId,
+    const TDesC&amp; newItemText,
+    TInt newItemCmdId,
</ins><span class="cx">     TInt newItemDimmed )
</span><span class="cx">     {
</span><span class="cx">     CMenuItem* newItem = NULL;
</span><span class="cx">     CMenuItem* oldItem = NULL;
</span><del>-    
-    // check if there is another node in the tree with the same Id as that of 
</del><ins>+
+    // check if there is another node in the tree with the same Id as that of
</ins><span class="cx">     // newItem but allow a replace of oldItem with the same Id as the newItem
</span><del>-    newItem = FindNodeById( iMenuRoot, newItemCmdId );    
</del><ins>+    newItem = FindNodeById( iMenuRoot, newItemCmdId );
</ins><span class="cx">     if ( newItem &amp;&amp; newItem-&gt;CmdId() != oldItemCmdId )
</span><span class="cx">         {
</span><span class="cx">         return KErrAlreadyExists;
</span><span class="cx">         }
</span><del>-    
-    // check if there is another node in the tree with the same text as that of 
</del><ins>+
+    // check if there is another node in the tree with the same text as that of
</ins><span class="cx">     // newItem but allow a replace of oldItem with the same text as the newItem
</span><span class="cx">     newItem = FindNodeByText( iMenuRoot, newItemText );
</span><del>-    oldItem = FindNodeById( iMenuRoot, oldItemCmdId );  
</del><ins>+    oldItem = FindNodeById( iMenuRoot, oldItemCmdId );
</ins><span class="cx">     if ( newItem &amp;&amp; oldItem &amp;&amp; newItem-&gt;Text().Compare(oldItem-&gt;Text()) != 0 )
</span><span class="cx">         {
</span><span class="cx">         return KErrAlreadyExists;
</span><span class="cx">         }
</span><del>-      
</del><ins>+
</ins><span class="cx">     if ( oldItem )
</span><span class="cx">         {
</span><del>-        oldItem-&gt;SetText( newItemText );    
-        oldItem-&gt;SetCmdId( newItemCmdId );   
</del><ins>+        oldItem-&gt;SetText( newItemText );
+        oldItem-&gt;SetCmdId( newItemCmdId );
</ins><span class="cx">         oldItem-&gt;SetDimmed( newItemDimmed );
</span><span class="cx">         return KErrNone;
</span><span class="cx">         }
</span><del>-        
-    return KErrGeneral;        
</del><ins>+
+    return KErrGeneral;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> // ----------------------------------------------------------------------------
</span><span class="lines">@@ -918,7 +919,7 @@
</span><span class="cx">     else
</span><span class="cx">         {
</span><span class="cx">         return NULL;
</span><del>-        }        
</del><ins>+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> // ----------------------------------------------------------------------------
</span><span class="lines">@@ -933,7 +934,7 @@
</span><span class="cx">     CMenuItem* node = NULL;
</span><span class="cx"> 
</span><span class="cx">     node = FindNodeById( iMenuRoot, cmdId );
</span><del>-    
</del><ins>+
</ins><span class="cx">     if ( node )
</span><span class="cx">         {
</span><span class="cx">         return node-&gt;Obj();
</span><span class="lines">@@ -941,7 +942,7 @@
</span><span class="cx">     else
</span><span class="cx">         {
</span><span class="cx">         return NULL;
</span><del>-        }        
</del><ins>+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> // ----------------------------------------------------------------------------
</span><span class="lines">@@ -955,7 +956,7 @@
</span><span class="cx">     {
</span><span class="cx">     CMenuItem* node = NULL;
</span><span class="cx">     node = FindNodeById( iMenuRoot, aCmdId );
</span><del>-    
</del><ins>+
</ins><span class="cx">     if ( node )
</span><span class="cx">         {
</span><span class="cx">         node-&gt;SetDimmed( aValue );
</span><span class="lines">@@ -974,7 +975,7 @@
</span><span class="cx">     {
</span><span class="cx">     CMenuItem* node = NULL;
</span><span class="cx">     node = FindNodeById( iMenuRoot, aCmdId );
</span><del>-    
</del><ins>+
</ins><span class="cx">     if ( node )
</span><span class="cx">         {
</span><span class="cx">         node-&gt;SetCallback( aOnSelectCallback );
</span><span class="lines">@@ -992,7 +993,7 @@
</span><span class="cx">     {
</span><span class="cx">     CMenuItem* node = NULL;
</span><span class="cx">     node = FindNodeById( iMenuRoot, aCmdId );
</span><del>-    
</del><ins>+
</ins><span class="cx">     if ( node )
</span><span class="cx">         {
</span><span class="cx">         return node-&gt;Callback();
</span><span class="lines">@@ -1000,7 +1001,7 @@
</span><span class="cx">     else
</span><span class="cx">         {
</span><span class="cx">         return NULL;
</span><del>-        }        
</del><ins>+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -1152,7 +1153,7 @@
</span><span class="cx">     {
</span><span class="cx">     iWidgetCallback-&gt;SetSoftkeysVisible(EFalse);
</span><span class="cx">     }
</span><del>-    
</del><ins>+
</ins><span class="cx"> // -----------------------------------------------------------------------------
</span><span class="cx"> // CWidgetExtension::ShowSoftkeys
</span><span class="cx"> //
</span></span></pre></div>
<a id="S60branches31mWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: S60/branches/3.1m/WebKit/ChangeLog (24844 => 24845)</h4>
<pre class="diff"><span>
<span class="info">--- S60/branches/3.1m/WebKit/ChangeLog        2007-08-03 16:31:24 UTC (rev 24844)
+++ S60/branches/3.1m/WebKit/ChangeLog        2007-08-03 17:18:47 UTC (rev 24845)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2007-08-02  yadavall  &lt;sriram.yadavalli@nokia.com&gt;
+
+        Reviewed by Zalan Bujtas (zbujtas@gmail.com).
+        DESC: Widget Cascade menu not in FIFO order
+        http://bugs.webkit.org/show_bug.cgi?id=14866
+
+        * BrowserView/inc/WidgetExtension.h:
+        (CMenuItem::Text):
+        (CMenuItem::SetText):
+        * BrowserView/src/WidgetExtension.cpp:
+        (CWidgetExtension::AddOptionMenuItemsL):
+        (CWidgetExtension::AddMenuItem):
+        (CWidgetExtension::MenuItemSelected):
+        (CWidgetExtension::AddOptionsMenuItem):
+        (CWidgetExtension::Append):
+        (CWidgetExtension::DeleteMenuItem):
+        (CWidgetExtension::ReplaceMenuItem):
+        (CWidgetExtension::GetFromMenuItemCollection):
+        (CWidgetExtension::SetDimmed):
+        (CWidgetExtension::SetMenuItemObserver):
+        (CWidgetExtension::MenuItemObserver):
+
</ins><span class="cx"> 2007-07-31  yadavall  &lt;sriram.yadavalli@nokia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Zalan Bujtas (zbujtas@gmail.com).
</span></span></pre>
</div>
</div>

</body>
</html>