diff options
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/view/cellsh.cxx | 13 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh1.cxx | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index 7157d112f766..cae223dd5cde 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -1185,6 +1185,19 @@ void ScCellShell::GetState(SfxItemSet &rSet) } break; + case FID_DEFINE_CURRENT_NAME: + { + ScAddress aCurrentAddress = ScAddress( nPosX, nPosY, nTab ); + + if ( pDoc && + !pDoc->IsAddressInRangeName( RangeNameScope::GLOBAL, aCurrentAddress ) && + !pDoc->IsAddressInRangeName( RangeNameScope::SHEET, aCurrentAddress )) + { + rSet.DisableItem( nWhich ); + } + } + break; + case SID_SPELL_DIALOG: { if ( pDoc && pData && pDoc->IsTabProtected( pData->GetTabNo() ) ) diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 4f075c981999..9a1e7dc8a3cf 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1883,6 +1883,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) break; case FID_DEFINE_NAME: + case FID_DEFINE_CURRENT_NAME: if ( pReqArgs ) { const SfxPoolItem* pItem; |