Repository: nvaccess/nvda

Issue:
nvda is not announcing the opening of the aplications menu and the existence of submenus in the office

### Steps to reproduce:
Open Outlook.
On a message in your box press the applycation  button.
Now go up with the arrow keys until the move option.
### Actual behavior:
when pressing the application key the nvda does not announce the opening of the menu.
When placing the focus on the move option the nvda does not announce that there is a submenu.
### Expected behavior:
When using the nvda alpha 16530 when pressing the application key the nvda announces panel which is an indication that something has been displayed.
When placing the focus on the option move the nvda alpha 16530 announces submenu that warns us that when pressing the right arrow or enter we will open new options in case the submenu move is displayed folders to move the message.
I also tested in word, where nvda announced the focused option when opening the application menu, unlike the outlook where nvda is getting mute.
In Word, nvda also does not advertise the existence of submenus.
### System configuration
#### NVDA installed/portable/running from source:
install
#### NVDA version:
alfa 16557
#### Windows version:
10 17763.253
#### Name and version of other software in use when reproducing the issue:
office 16.0.11126.20266
#### Other information about your system:

### Other questions
#### Does the issue still occur after restarting your PC?
yes
#### Have you tried any other versions of NVDA?
I tested the alpha 16530 where everything works correctly.
log:
[office.txt](https://github.com/nvaccess/nvda/files/2773267/office.txt)



Discussion:
I can also reproduce it. Looks like another regression from using UIA by default cc @michaelDCurran 

Resolving patch:
diff --git a/source/NVDAObjects/UIA/__init__.py b/source/NVDAObjects/UIA/__init__.py
--- a/source/NVDAObjects/UIA/__init__.py
+++ b/source/NVDAObjects/UIA/__init__.py
@@ -765,7 +765,10 @@ def _prefetchUIACacheForPropertyIDs(self,IDs):
 	def findOverlayClasses(self,clsList):
 		UIAControlType=self.UIAElement.cachedControlType
 		UIAClassName=self.UIAElement.cachedClassName
-		if UIAClassName=="WpfTextView":
+		if UIAClassName=="NetUITWMenuItem" and UIAControlType==UIAHandler.UIA_MenuItemControlTypeId and not self.name and not self.previous:
+			# Bounces focus from a netUI dead placeholder menu item when no item is selected up to the menu itself.
+			clsList.append(PlaceholderNetUITWMenuItem)
+		elif UIAClassName=="WpfTextView":
 			clsList.append(WpfTextView)
 		elif UIAClassName=="NetUIDropdownAnchor":
 			clsList.append(NetUIDropdownAnchor)
@@ -1659,3 +1662,18 @@ def _get_name(self):
 		if not name and self.previous and self.previous.role==controlTypes.ROLE_STATICTEXT:
 			name=self.previous.name
 		return name
+
+class PlaceholderNetUITWMenuItem(UIA):
+	""" Bounces focus from a netUI dead placeholder menu item when no item is selected up to the menu itself."""
+
+	shouldAllowUIAFocusEvent=True
+
+	def _get_focusRedirect(self):
+		# Locate the containing menu and focus that instead.
+		parent=self.parent
+		for count in xrange(4):
+			if not parent:
+				return
+			if parent.role==controlTypes.ROLE_POPUPMENU:
+				return parent
+			parent=parent.parent
diff --git a/source/controlTypes.py b/source/controlTypes.py
--- a/source/controlTypes.py
+++ b/source/controlTypes.py
@@ -698,8 +698,8 @@ def processPositiveStates(role, states, reason, positiveStates=None):
 		positiveStates.discard(STATE_READONLY)
 	if role == ROLE_CHECKBOX:
 		positiveStates.discard(STATE_PRESSED)
-	if role == ROLE_MENUITEM:
-		# The user doesn't usually care if a menu item is expanded or collapsed.
+	if role == ROLE_MENUITEM and STATE_HASPOPUP in positiveStates:
+		# The user doesn't usually care if a submenu is expanded or collapsed.
 		positiveStates.discard(STATE_COLLAPSED)
 		positiveStates.discard(STATE_EXPANDED)
 	if STATE_FOCUSABLE not in states:


Test patch: