[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - chart2/source

Vasily Melenchuk (via logerrit) logerrit at kemper.freedesktop.org
Wed Jan 15 22:55:57 UTC 2020


 chart2/source/controller/main/ControllerCommandDispatch.cxx |   14 ++++--------
 1 file changed, 5 insertions(+), 9 deletions(-)

New commits:
commit 6b9fefa671bb53d4555c8cf68071fc1d78e9246d
Author:     Vasily Melenchuk <vasily.melenchuk at cib.de>
AuthorDate: Fri Dec 27 14:55:11 2019 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Wed Jan 15 23:55:29 2020 +0100

    tdf#121458: chart: change "Data Ranges" button enabled condition.
    
    "Data Ranges" button right now enabled if chart has no own table
    (as it was before 0074951704022d173a5fdb9df933f47be1dcbb91)
    or own table exists and it is possible to create data provider
    (LibreOffice will warn later about destroying data table).
    
    Change-Id: If92b0aad8a6099250effdb68022addb277ef4371
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86391
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit 985b76d237b26b428771bfc03d1ef74cdb5d77f0)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86402
    (cherry picked from commit 46ac8dd2305cea9c618a5a37940a616df265a53f)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86540

diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx
index 031c4e4cf1cf..d60cf7dc4977 100644
--- a/chart2/source/controller/main/ControllerCommandDispatch.cxx
+++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx
@@ -552,13 +552,8 @@ void ControllerCommandDispatch::updateCommandAvailability()
         if ( xChartDoc.is() )
         {
             ChartModel& rModel = dynamic_cast<ChartModel&>(*xChartDoc);
-            Reference< lang::XServiceInfo > xParentServiceInfo(rModel.getParent(), uno::UNO_QUERY);
-            OSL_ENSURE(xParentServiceInfo.is(), "Invalid XServiceInfo");
-            if ( xParentServiceInfo.is() )
-            {
-                css::uno::Reference< com::sun::star::chart2::XDataProviderAccess > xCreatorDoc(rModel.getParent(), uno::UNO_QUERY);
-                bCanCreateDataProvider = xCreatorDoc.is();
-            }
+            css::uno::Reference< com::sun::star::chart2::XDataProviderAccess > xCreatorDoc(rModel.getParent(), uno::UNO_QUERY);
+            bCanCreateDataProvider = xCreatorDoc.is();
         }
     }
 
@@ -631,8 +626,9 @@ void ControllerCommandDispatch::updateCommandAvailability()
     m_aCommandAvailability[ ".uno:FormatChartArea" ] = m_aCommandAvailability[ ".uno:DiagramArea" ];
     m_aCommandAvailability[ ".uno:FormatLegend" ] = m_aCommandAvailability[ ".uno:Legend" ];
 
-    // depending on own data
-    m_aCommandAvailability[".uno:DataRanges"] = bIsWritable && bModelStateIsValid && !m_apModelState->bHasDataFromPivotTable && bCanCreateDataProvider;
+    // depending on own data and ability to create new data provider
+    m_aCommandAvailability[".uno:DataRanges"] = bIsWritable && bModelStateIsValid && !m_apModelState->bHasDataFromPivotTable
+        && ((m_apModelState->bHasOwnData && bCanCreateDataProvider) || !m_apModelState->bHasOwnData);
     m_aCommandAvailability[ ".uno:DiagramData" ] = bIsWritable && bModelStateIsValid &&  m_apModelState->bHasOwnData && bEnableDataTableDialog;
 
     // titles


More information about the Libreoffice-commits mailing list