summaryrefslogtreecommitdiff
path: root/sw/source/ui/lingu/olmenu.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui/lingu/olmenu.cxx')
-rw-r--r--sw/source/ui/lingu/olmenu.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx
index a3f2b67b69b6..9ebfd8c8cf36 100644
--- a/sw/source/ui/lingu/olmenu.cxx
+++ b/sw/source/ui/lingu/olmenu.cxx
@@ -307,6 +307,9 @@ USHORT SwSpellPopup::fillLangPopupMenu(
}
}
+ bool bMultipleLanguages = (nLangTable != 0) || (curLang.compareToAscii( "*" ) == 0);
+ bool bNothingSelected = true;
+ MenuItemBits nMenuItemStyle = !bMultipleLanguages ? MIB_RADIOCHECK : 0;
for (std::map< rtl::OUString, rtl::OUString >::const_iterator it = LangItems.begin(); it != LangItems.end(); ++it)
{
rtl::OUString aEntryTxt( it->first );
@@ -322,22 +325,25 @@ USHORT SwSpellPopup::fillLangPopupMenu(
else if (nLangTable == 2) // language for document
aLangTable_Document[nItemId] = aEntryTxt;
- pPopupMenu->InsertItem( nItemId, aEntryTxt, MIB_RADIOCHECK );
- if (aEntryTxt == curLang)
+ pPopupMenu->InsertItem( nItemId, aEntryTxt, nMenuItemStyle );
+ if ((nLangTable == 0) && (aEntryTxt == curLang))
{
//make a check mark for the current language
pPopupMenu->CheckItem( nItemId, TRUE );
+ bNothingSelected = false;
}
}
}
//7--none
nItemId++;
- pPopupMenu->InsertItem( nItemId, String(SW_RES( STR_LANGSTATUS_NONE )), MIB_RADIOCHECK );
+ pPopupMenu->InsertItem( nItemId, String(SW_RES( STR_LANGSTATUS_NONE )), nMenuItemStyle );
+ if (bNothingSelected && !bMultipleLanguages)
+ pPopupMenu->CheckItem( nItemId, TRUE );
//More...
nItemId++;
- pPopupMenu->InsertItem( nItemId, String(SW_RES( STR_LANGSTATUS_MORE )), MIB_RADIOCHECK );
+ pPopupMenu->InsertItem( nItemId, String(SW_RES( STR_LANGSTATUS_MORE )) );
return nItemId - Lang_Start; // return number of inserted entries
}