diff options
author | Eike Rathke <erack@redhat.com> | 2020-09-27 14:51:50 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2020-09-27 16:06:13 +0200 |
commit | d3a8fdf3cad0e71ff5e13bb229fed6e52206c6b9 (patch) | |
tree | f17a641b9f3d7a0fc73807911cba7412d58da46d | |
parent | 11fdde23f6dc2dce4bc7c4513e70780487150761 (diff) |
Resolves: tdf#67007 display sheet-local range name in Name Box for selection
Change-Id: Ia9980b13ed5c93cc72231ead532e3916e6234f56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103509
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
-rw-r--r-- | sc/source/core/data/documen3.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 727eff32345c..7ffd181ac502 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -238,6 +238,20 @@ bool ScDocument::InsertNewRangeName( SCTAB nTab, const OUString& rName, const Sc const ScRangeData* ScDocument::GetRangeAtBlock( const ScRange& rBlock, OUString* pName ) const { const ScRangeData* pData = nullptr; + if (rBlock.aStart.Tab() == rBlock.aEnd.Tab()) + { + const ScRangeName* pLocalNames = GetRangeName(rBlock.aStart.Tab()); + if (pLocalNames) + { + pData = pLocalNames->findByRange( rBlock ); + if (pData) + { + if (pName) + *pName = pData->GetName(); + return pData; + } + } + } if ( pRangeName ) { pData = pRangeName->findByRange( rBlock ); |