summaryrefslogtreecommitdiff
path: root/framework/source/uielement/menubarmanager.cxx
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2007-11-01 16:49:38 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2007-11-01 16:49:38 +0000
commit6e7cd671fd983c7dc49f7c66d89df937100fef63 (patch)
tree33ef22d376320895b49c29c90aec408664c587e0 /framework/source/uielement/menubarmanager.cxx
parentaaa1f598a52b97579c86c26afc3b0fad88b58a12 (diff)
INTEGRATION: CWS fwk76_SRC680 (1.48.40); FILE MERGED
2007/10/16 11:39:24 cd 1.48.40.2: #i82479# Don't disable popup menu when there is no menu dispatcher 2007/10/12 10:02:00 cd 1.48.40.1: #i82479# Add-on menu must check for popup menu controller association and create empty popup for setPopupMenu function
Diffstat (limited to 'framework/source/uielement/menubarmanager.cxx')
-rw-r--r--framework/source/uielement/menubarmanager.cxx19
1 files changed, 16 insertions, 3 deletions
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 9e0039a179..7fa6d6c676 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: menubarmanager.cxx,v $
*
- * $Revision: 1.48 $
+ * $Revision: 1.49 $
*
- * last change: $Author: ihi $ $Date: 2007-07-10 15:12:18 $
+ * last change: $Author: hr $ $Date: 2007-11-01 17:49:38 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -485,6 +485,19 @@ MenuBarManager::MenuBarManager(
}
pMenuItemHandler->aMenuItemURL = aItemCommand;
+
+ // Check if we have to create a popup menu for a uno based popup menu controller.
+ // We have to set an empty popup menu into our menu structure so the controller also
+ // works with inplace OLE.
+ if ( m_xPopupMenuControllerRegistration.is() &&
+ m_xPopupMenuControllerRegistration->hasController( aItemCommand, rtl::OUString() ))
+ {
+ VCLXPopupMenu* pVCLXPopupMenu = new VCLXPopupMenu;
+ PopupMenu* pCtlPopupMenu = (PopupMenu *)pVCLXPopupMenu->GetMenu();
+ pAddonPopupMenu->SetPopupMenu( pMenuItemHandler->nItemId, pCtlPopupMenu );
+ pMenuItemHandler->xPopupMenu = Reference< com::sun::star::awt::XPopupMenu >( (OWeakObject *)pVCLXPopupMenu, UNO_QUERY );
+
+ }
m_aMenuItemHandlerVector.push_back( pMenuItemHandler );
}
}
@@ -1330,7 +1343,7 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu )
xMenuItemDispatch->removeStatusListener( static_cast< XStatusListener* >( this ), aTargetURL );
}
}
- else
+ else if ( !bPopupMenu )
pMenu->EnableItem( pMenuItemHandler->nItemId, sal_False );
}
}