summaryrefslogtreecommitdiff
path: root/framework/source
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2003-04-04 16:18:13 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2003-04-04 16:18:13 +0000
commite629707dc121a18b9a01c414588e4795257d5eba (patch)
treee526860c48ea03c09d89d4eea449acac015e0965 /framework/source
parent2259eaf341dd74718dd090a7e26c43585467e818 (diff)
INTEGRATION: CWS fwk01 (1.7.28.1.14); FILE MERGED
2003/03/19 13:11:02 cd 1.7.28.1.14.1: #107568# Support Add-On help menu items directly in the Office help menu
Diffstat (limited to 'framework/source')
-rw-r--r--framework/source/services/menudocumenthandler.cxx32
1 files changed, 24 insertions, 8 deletions
diff --git a/framework/source/services/menudocumenthandler.cxx b/framework/source/services/menudocumenthandler.cxx
index 826603b7fe34..4ba8b818e52d 100644
--- a/framework/source/services/menudocumenthandler.cxx
+++ b/framework/source/services/menudocumenthandler.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: menudocumenthandler.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: hr $ $Date: 2003-03-25 18:21:53 $
+ * last change: $Author: hr $ $Date: 2003-04-04 17:18:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -69,6 +69,10 @@
#include <classes/menuconfiguration.hxx>
#endif
+#ifndef __FRAMEWORK_CLASSES_ADDONMENU_HXX_
+#include <classes/addonmenu.hxx>
+#endif
+
#ifndef __FRAMEWORK_SERVICES_ATTRIBUTELIST_HXX_
#include <services/attributelist.hxx>
#endif
@@ -755,7 +759,8 @@ throw ( SAXException, RuntimeException )
void OWriteMenuDocumentHandler::WriteMenu( Menu* pMenu )
throw ( SAXException, RuntimeException )
{
- USHORT nItemCount = pMenu->GetItemCount();
+ USHORT nItemCount = pMenu->GetItemCount();
+ BOOL bSeparator = FALSE;
for ( USHORT nItemPos = 0; nItemPos < nItemCount; nItemPos++ )
{
@@ -771,6 +776,7 @@ throw ( SAXException, RuntimeException )
{
// special popup menus (filled during runtime) must be saved as a menuitem!!!
WriteMenuItem( pMenu, nItemId );
+ bSeparator = FALSE;
}
else if ( nItemId == SID_FORMATMENU )
{
@@ -802,8 +808,9 @@ throw ( SAXException, RuntimeException )
m_xWriteDocumentHandler->ignorableWhitespace( OUString() );
m_xWriteDocumentHandler->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENU )) );
m_xWriteDocumentHandler->ignorableWhitespace( OUString() );
+ bSeparator = FALSE;
}
- else
+ else if ( !AddonPopupMenu::IsCommandURLPrefix ( aItemCommand ))
{
AttributeListImpl* pListMenu = new AttributeListImpl;
Reference< XAttributeList > xListMenu( (XAttributeList *)pListMenu , UNO_QUERY );
@@ -837,19 +844,28 @@ throw ( SAXException, RuntimeException )
m_xWriteDocumentHandler->ignorableWhitespace( OUString() );
m_xWriteDocumentHandler->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENU )) );
m_xWriteDocumentHandler->ignorableWhitespace( OUString() );
+ bSeparator = FALSE;
}
}
else
{
if ( pMenu->GetItemType( nItemPos ) != MENUITEM_SEPARATOR )
{
- // don't save special menu items for (window list and pickup list)
- if ( nItemId < START_ITEMID_PICKLIST ||
- nItemId > END_ITEMID_WINDOWLIST )
+ // don't save special menu items for (window list and pickup list, add-ons )
+ if ( !MenuConfiguration::IsPickListItemId( nItemId ) &&
+ !MenuConfiguration::IsWindowListItemId( nItemId ) &&
+ !AddonMenuManager::IsAddonMenuId( nItemId ))
+ {
+ bSeparator = FALSE;
WriteMenuItem( pMenu, nItemId );
+ }
}
- else
+ else if ( !bSeparator )
+ {
+ // Don't write two separators together
WriteMenuSeparator();
+ bSeparator = TRUE;
+ }
}
}
}