[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/source

Eike Rathke (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 8 14:15:46 UTC 2021


 sc/source/core/data/documen5.cxx |    4 ++--
 sc/source/ui/docshell/docsh4.cxx |    4 ++--
 sc/source/ui/unoobj/chartuno.cxx |    6 ++++--
 sc/source/ui/view/gridwin.cxx    |    3 ++-
 4 files changed, 10 insertions(+), 7 deletions(-)

New commits:
commit cf4dbb7c1287d5b3fe7870fc0aaa172a5d444515
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Wed Oct 6 18:57:36 2021 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Fri Oct 8 16:15:11 2021 +0200

    Resolves: tdf#144970 Chart CellRangeRepresentation expects UI representation
    
     This is a combination of 3 commits.
    
    Resolves: tdf#144970 Chart CellRangeRepresentation expects UI representation
    
    sc/source/ui/unoobj/chart2uno.cxx
    ScChart2DataProvider::createDataSource() calls
    ScRefTokenHelper::compileRangeRepresentation() with the
    CellRangeRepresentation property's string value and the document's
    grammar (and also other places calling
    ScRefTokenHelper::compileRangeRepresentation() in Chart context do, like
    ScChart2DataProvider::detectArguments()), so let
    ScChartsObj::addNewByName() generate that from the
    Sequence<table::CellRangeAddress>.
    
    Also let ScChartObj::GetData_Impl() parse a CellRangeRepresentation
    value with the current address convention.
    
    This is congruent with
    offapi/com/sun/star/chart2/data/TabularDataProviderArguments.idl that
    for CellRangeRepresentation says "The representation string is of a form
    that may be used in the user interface.  Example for OOo Calc:
    "$Sheet1.$A$1:$D$7"", which is Calc A1 but agnostic about Excel A1 and
    R1C1 address syntax. TabularDataProviderArguments is mentioned in
    offapi/com/sun/star/chart2/data/XDataProvider.idl at createDataSource().
    
    -Id: Ie89d9aa3d5bc3eda9a65932a445ee8a1b4b266f9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123188
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit 34b01c95d4cab81cb614b67c47b004ac86d266f1)
    
    Related: tdf#144970 == ScRefFlags::ZERO is not a replacement for != 0 ...
    
    It still worked by chance because if (!bValid) the string is
    parsed with ScRangeList, which does deliver a result.
    That will have to be adapted to the then expected UI
    representation though in which case it wouldn't work.
    
    Fallout from
    
        commit 51d0b4037b36a4a74c9181b95edb18017542ab79
        CommitDate: Sat Mar 12 00:21:29 2016 +0000
    
            tdf#84938 Change defines to typed_flags
    
    -Id: I9612b34829c12e59d4b390c6aa035aca84e87c73
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123194
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit 14f81ca6ad289bf86781f642aa129b33151247cf)
    
    Related: tdf#144970 Make Drag&Drop of Chart range work with UI representation
    
    Drag&Drop of cell range onto an existing Chart worked with Calc A1
    but not Excel A1 or R1C1 address syntax conventions.
    
    -Id: I1cd1a134f284ef5b28237589c544f93cb4aca841
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123197
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit 852292feee08b4d256f8255926e1f84b4c6fd4b6)
    
    Change-Id: Ie89d9aa3d5bc3eda9a65932a445ee8a1b4b266f9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123211
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx
index 1933601aa7db..d19fed5a8075 100644
--- a/sc/source/core/data/documen5.cxx
+++ b/sc/source/core/data/documen5.cxx
@@ -229,7 +229,7 @@ void ScDocument::GetOldChartParameters( std::u16string_view rName,
                     OUString aRangesStr;
                     lcl_GetChartParameters( xChartDoc, aRangesStr, eDataRowSource, bHasCategories, bFirstCellAsLabel );
 
-                    rRanges.Parse( aRangesStr, *this );
+                    rRanges.Parse( aRangesStr, *this, GetAddressConvention());
                     if ( eDataRowSource == chart::ChartDataRowSource_COLUMNS )
                     {
                         rRowHeaders = bHasCategories;
@@ -285,7 +285,7 @@ void ScDocument::UpdateChartArea( const OUString& rChartName,
                         // append to old ranges, keep other settings
 
                         aNewRanges = new ScRangeList;
-                        aNewRanges->Parse( aRangesStr, *this );
+                        aNewRanges->Parse( aRangesStr, *this, GetAddressConvention());
 
                         for ( size_t nAdd = 0, nAddCount = rNewList->size(); nAdd < nAddCount; ++nAdd )
                             aNewRanges->push_back( (*rNewList)[nAdd] );
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 85ee0a42ff2d..432776b6a7ee 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -380,11 +380,11 @@ void ScDocShell::Execute( SfxRequest& rReq )
                 }
 
                 ScAddress::Details aDetails(rDoc.GetAddressConvention(), 0, 0);
-                bool bValid = (aSingleRange.ParseAny(aRangeName, rDoc, aDetails) & ScRefFlags::VALID) == ScRefFlags::ZERO;
+                bool bValid = (aSingleRange.ParseAny(aRangeName, rDoc, aDetails) & ScRefFlags::VALID) != ScRefFlags::ZERO;
                 if (!bValid)
                 {
                     aRangeListRef = new ScRangeList;
-                    aRangeListRef->Parse( aRangeName, rDoc );
+                    aRangeListRef->Parse( aRangeName, rDoc, rDoc.GetAddressConvention());
                     if ( !aRangeListRef->empty() )
                     {
                         bMultiRange = true;
diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx
index 60e3d2aa4536..c41e37a31020 100644
--- a/sc/source/ui/unoobj/chartuno.cxx
+++ b/sc/source/ui/unoobj/chartuno.cxx
@@ -209,8 +209,9 @@ void SAL_CALL ScChartsObj::addNewByName( const OUString& rName,
         xReceiver.set( xObj->getComponent(), uno::UNO_QUERY );
     if( xReceiver.is())
     {
+        // Range in UI representation.
         OUString sRangeStr;
-        xNewRanges->Format(sRangeStr, ScRefFlags::RANGE_ABS_3D, rDoc);
+        xNewRanges->Format(sRangeStr, ScRefFlags::RANGE_ABS_3D, rDoc, rDoc.GetAddressConvention());
 
         // connect
         if( !sRangeStr.isEmpty() )
@@ -478,7 +479,8 @@ void ScChartObj::GetData_Impl( ScRangeListRef& rRanges, bool& rColHeaders, bool&
                     rColHeaders=bHasCategories;
                     rRowHeaders=bFirstCellAsLabel;
                 }
-                rRanges->Parse( aRanges, rDoc);
+                // Range in UI representation.
+                rRanges->Parse( aRanges, rDoc, rDoc.GetAddressConvention());
             }
             bFound = true;
         }
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index a0f854a6394f..7e08369f8c43 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -4224,7 +4224,8 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos
             OUString aChartName;
             if (rThisDoc.HasChartAtPoint( nThisTab, rLogicPos, aChartName ))
             {
-                OUString aRangeName(aSource.Format(rThisDoc, ScRefFlags::RANGE_ABS_3D));
+                OUString aRangeName(aSource.Format(rThisDoc, ScRefFlags::RANGE_ABS_3D,
+                            rThisDoc.GetAddressConvention()));
                 SfxStringItem aNameItem( SID_CHART_NAME, aChartName );
                 SfxStringItem aRangeItem( SID_CHART_SOURCE, aRangeName );
                 sal_uInt16 nId = bIsMove ? SID_CHART_SOURCE : SID_CHART_ADDSOURCE;


More information about the Libreoffice-commits mailing list