diff options
Diffstat (limited to 'vcl/source/window/menu.cxx')
-rw-r--r-- | vcl/source/window/menu.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 284a54a0a3a7..b33219c82c8d 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -579,6 +579,24 @@ sal_uInt16 Menu::GetItemCount() const return static_cast<sal_uInt16>(pItemList->size()); } +bool Menu::HasValidEntries(bool bCheckPopups) const +{ + bool bValidEntries = false; + sal_uInt16 nCount = GetItemCount(); + for (sal_uInt16 n = 0; !bValidEntries && (n < nCount); n++) + { + MenuItemData* pItem = pItemList->GetDataFromPos(n); + if (pItem->bEnabled && (pItem->eType != MenuItemType::SEPARATOR)) + { + if (bCheckPopups && pItem->pSubMenu) + bValidEntries = pItem->pSubMenu->HasValidEntries(true); + else + bValidEntries = true; + } + } + return bValidEntries; +} + sal_uInt16 Menu::ImplGetVisibleItemCount() const { sal_uInt16 nItems = 0; |