sc/source/core/data/documen3.cxx |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit d3a8fdf3cad0e71ff5e13bb229fed6e52206c6b9
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Sun Sep 27 14:51:50 2020 +0200
Commit:     Eike Rathke <er...@redhat.com>
CommitDate: Sun Sep 27 16:06:13 2020 +0200

    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 <er...@redhat.com>
    Tested-by: Jenkins

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 );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to