CefMenuModel::InsertItemAt fails if no items ?

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CefMenuModel::InsertItemAt fails if no items ?

Postby ndesktop » Fri Oct 06, 2023 8:03 am

I have a custom menu model which removes all items (such as Inspect, Save link etc.) for an item with type CM_TYPEFLAG_LINK.
Calling
Code: Select all
if(model->InsertItemAt(0, kIDOpenLinkInNewTab, L"Open link in new tab")) {
  LOG(INFO) << "InsertItemAt succeeded";
  model->InsertSeparatorAt(1);
}

fails for some reason (debugging into cpptoc/ctocpp does not show much).

But calling
Code: Select all
if(model->AddItem(kIDOpenLinkInNewTab, L"Open link in new tab")) {
  model->InsertSeparatorAt(1);
}

succeeds.

I suspect I'm either using InsertItemAt incorrectly, or I hit some obscure bug in menu_model_impl.cc.
Did someone else experienced this?
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am

Return to Support Forum

Who is online

Users browsing this forum: finder2, Google [Bot] and 217 guests