summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2019-12-27 14:55:11 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-02-20 23:09:38 +0100
commitd4effff359cc4d01e761565e1dc3194e67a6dd8f (patch)
tree8eb4eb4884784a9e33ecb2cbb90ac62580243b02
parentc97ea6346dcb69b092a0e1cf734545ef8dbcad04 (diff)
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). Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86391 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Conflicts: chart2/source/controller/main/ControllerCommandDispatch.cxx Change-Id: If92b0aad8a6099250effdb68022addb277ef4371 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89148 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--chart2/source/controller/main/ControllerCommandDispatch.cxx14
1 files changed, 5 insertions, 9 deletions
diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx
index 2e655741eac5..93ec82bb0936 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.get());
- 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