[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sc/source

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Mon May 25 18:28:04 UTC 2020


 sc/source/core/data/dpshttab.cxx |   28 +---------------------------
 sc/source/ui/view/cellsh1.cxx    |   30 +++++-------------------------
 2 files changed, 6 insertions(+), 52 deletions(-)

New commits:
commit 6f1ca3db3a228fa0513536a82079637e6e025a15
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Sun May 24 10:47:28 2020 +0200
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Mon May 25 20:27:29 2020 +0200

    Revert "tdf#37268: use also sheet local range in Pivot"
    
    This reverts commit 73af06a6a7fcb2d92d36a45bbe54395bcba8dfb0.
    
    The patch is wrong according to:
    https://bugs.documentfoundation.org/show_bug.cgi?id=37268#c24
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94748
    Tested-by: Julien Nabet <serval2412 at yahoo.fr>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
    (cherry picked from commit 818af4717bd7d4fbb6f622128c99259efb0714c9)
    
    Change-Id: I63dd69afa3fc324930cd16ccc3458372d7745531
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94684
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins

diff --git a/sc/source/core/data/dpshttab.cxx b/sc/source/core/data/dpshttab.cxx
index 673a1301cac1..67ff3a1d1e69 100644
--- a/sc/source/core/data/dpshttab.cxx
+++ b/sc/source/core/data/dpshttab.cxx
@@ -232,39 +232,13 @@ const ScRange& ScSheetSourceDesc::GetSourceRange() const
     {
         // Obtain the source range from the range name first.
         maSourceRange = ScRange();
-
-        // Range names referring a sheet contain a .
-        // See comment of ScCellShell::ExecuteDataPilotDialog
-        // paragraph "Populate named ranges"
-        sal_Int32 nAfterSheetName = ScGlobal::FindUnquoted( maRangeName, '.');
-
-        // let's consider the range name is global to the doc by default
         ScRangeName* pRangeName = mpDoc->GetRangeName();
-        OUString searchRangeName(maRangeName);
-
-        // the range name concerns a specificsheet
-        if (nAfterSheetName != -1)
-        {
-            OUString sheetName = maRangeName.copy(0, nAfterSheetName);
-            ScGlobal::EraseQuotes( sheetName, '\'', false);
-            searchRangeName = maRangeName.copy(nAfterSheetName+1);
-
-            SCTAB nTab = 0;
-            if (!mpDoc->GetTable(sheetName, nTab))
-            {
-                // the sheetname should exist
-                assert(false);
-                return maSourceRange;
-            }
-            pRangeName = mpDoc->GetRangeName(nTab);
-        }
-
         do
         {
             if (!pRangeName)
                 break;
 
-            OUString aUpper = ScGlobal::pCharClass->uppercase(searchRangeName);
+            OUString aUpper = ScGlobal::pCharClass->uppercase(maRangeName);
             const ScRangeData* pData = pRangeName->findByUpperName(aUpper);
             if (!pData)
                 break;
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 44ef3d49c330..5873272f1dfe 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <globalnames.hxx>
 #include <config_features.h>
 
 #include <com/sun/star/i18n/TextConversionOption.hpp>
@@ -2808,31 +2807,12 @@ void ScCellShell::ExecuteDataPilotDialog()
                 pTabViewShell->GetFrameWeld(), bEnableExt));
 
         // Populate named ranges (if any).
-        // We must take into account 2 types of scope : global doc and sheets
-        // for global doc: <name of the range>
-        // for sheets: <sheetname>.<name of the range>
-        std::map<OUString, ScRangeName*> aRangeMap;
-        pDoc->GetRangeNameMap(aRangeMap);
-        for (auto const& elemRangeMap : aRangeMap)
+        ScRangeName* pRangeName = pDoc->GetRangeName();
+        if (pRangeName)
         {
-            ScRangeName* pRangeName = elemRangeMap.second;
-            if (pRangeName)
-            {
-                if (elemRangeMap.first == STR_GLOBAL_RANGE_NAME)
-                {
-                    for (auto const& elem : *pRangeName)
-                        pTypeDlg->AppendNamedRange(elem.second->GetName());
-                }
-                else
-                {
-                    OUString aScope(elemRangeMap.first);
-                    ScGlobal::AddQuotes(aScope, '\'');
-                    for (auto const& elem : *pRangeName)
-                    {
-                        pTypeDlg->AppendNamedRange(aScope + "." + elem.second->GetName());
-                    }
-                }
-            }
+            ScRangeName::const_iterator itr = pRangeName->begin(), itrEnd = pRangeName->end();
+            for (; itr != itrEnd; ++itr)
+                pTypeDlg->AppendNamedRange(itr->second->GetName());
         }
 
         if ( pTypeDlg->Execute() == RET_OK )


More information about the Libreoffice-commits mailing list