Author: dquintana
Date: Mon Mar 3 17:55:43 2014
New Revision: 62416
URL: http://svn.reactos.org/svn/reactos?rev=62416&view=rev
Log:
[RSHELL]
* I was telling AddButton that all the items were the last, except the last. Now the submenus display properly. Some of them at least. Others get an exception, it seems.
CORE-7881
Modified:
branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Mon Mar 3 17:55:43 2014
@@ -791,6 +791,7 @@
int i;
int ic = GetMenuItemCount(m_hmenu);
+ int count = 0;
for (i = 0; i < ic; i++)
{
BOOL last = i + 1 == ic;
@@ -807,6 +808,8 @@
continue;
}
+ count++;
+
DbgPrint("Found item with fType=%x, cmdId=%d\n", info.fType, info.wID);
if (info.fType & MFT_SEPARATOR)
@@ -835,6 +838,8 @@
HeapFree(GetProcessHeap(), 0, info.dwTypeData);
}
}
+
+ DbgPrint("Created toolbar with %d buttons.\n", count);
return S_OK;
}
@@ -937,7 +942,7 @@
// Fetch next item already, so we know if the current one is the last
hr = eidl->Next(1, &item, &fetched);
- AddButton(++i, MenuString, attrs & SFGAO_FOLDER, index, dwData, SUCCEEDED(hr) && fetched > 0);
+ AddButton(++i, MenuString, attrs & SFGAO_FOLDER, index, dwData, FAILED(hr) || fetched == 0);
CoTaskMemFree(MenuString);
}
@@ -946,8 +951,12 @@
// If no items were added, show the "empty" placeholder
if (i == 0)
{
+ DbgPrint("The toolbar is empty, adding placeholder.\n");
+
return AddPlaceholder();
}
+
+ DbgPrint("Created toolbar with %d buttons.\n", i);
return hr;
}