summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorAntonio Fernandez <antonio.fernandez@aentos.es>2012-08-13 22:19:30 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2012-11-14 13:52:41 +0100
commita881d31f81d2195ae475d8c26ecff295d29c54de (patch)
treebe8c4fb7a213052f0ddbfe8287da672d1117a4ac /vcl/source
parent2b91cea7a2887d53a742c2f52dbcebd79fc0bd3c (diff)
All menu labels are now displayed. There are some issues with repeated labels.
Change-Id: I1b92b91f34003f20aaa56558c1c0e231d1de6f94
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/window/menu.cxx68
1 files changed, 9 insertions, 59 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 1dd0743f2eb5..10bcdf66da3f 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -3233,6 +3233,15 @@ void Menu::HighlightItem( sal_uInt16 nItemPos )
}
}
+void Menu::Freeze() {
+ SalMenu *pSalMenu = ImplGetSalMenu();
+
+ if ( pSalMenu ) {
+ pSalMenu->Freeze();
+ }
+}
+
+
// -----------
// - MenuBar -
// -----------
@@ -6045,63 +6054,4 @@ ImplMenuDelData::~ImplMenuDelData()
const_cast< Menu* >( mpMenu )->ImplRemoveDel( *this );
}
-#include <iostream>
-
-using namespace std;
-
-void printMenu( AbstractMenu* pMenu ) {
- if ( pMenu ) {
- sal_uInt16 itemCount = pMenu->GetItemCount();
- MenuItemList *items = ((Menu*)pMenu)->GetItemList();
-
- for (int i=0; i < itemCount; i++) {
- MenuItemData *itemData = items->GetDataFromPos(i);
- sal_uInt16 itemId = pMenu->GetItemId(i);
-
- if (itemData->eType == MENUITEM_SEPARATOR) {
- cout << "---------------" << endl;
- } else {
- rtl::OUString itemText = itemData->aText;
- rtl::OUString cmdString = itemData->aCommandStr;
- cout << "Item ID: " << itemId << " Text: " << itemText << " CMD: " << cmdString << endl;
-
- if (itemData->pSubMenu) {
- cout << ">> SUBMENU <<" << endl;
- //FIXME: This callback would introduce some noise in accessibility software.
- itemData->pSubMenu->Activate();
- printMenu( itemData->pSubMenu );
- }
- }
- }
- }
-}
-
-void generateMenuHierarchy( AbstractMenu* pMenu ) {
- if ( pMenu ) {
- sal_uInt16 itemCount = pMenu->GetItemCount();
- MenuItemList *items = ((Menu*)pMenu)->GetItemList();
-
- for (int i=0; i < itemCount; i++) {
- MenuItemData *itemData = items->GetDataFromPos(i);
-
- if (itemData->pSubMenu) {
- itemData->pSubMenu->Activate();
- generateMenuHierarchy( itemData->pSubMenu );
- }
- }
- }
-}
-
-void Menu::Freeze() {
-// printMenu( this );
- generateMenuHierarchy( this );
-// cout << "============================================================" << endl;
-
- SalMenu *pSalMenu = ImplGetSalMenu();
-
- if ( pSalMenu ) {
- pSalMenu->Freeze();
- }
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */