Kaydet (Commit) 3a0c25d6 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Only call getChartType when the return value is actually used

Change-Id: I687ef0ce7013bce08caa25e1e6035507b814e20a
üst d1b3a33d
......@@ -311,8 +311,6 @@ OUString ChartController::GetContextName()
return OUString("Chart");
ObjectType eObjectID = ObjectIdentifier::getObjectType(aCID);
css::uno::Reference<css::chart2::XChartType> xChartType = getChartType(css::uno::Reference<css::chart2::XChartDocument>(getModel(), uno::UNO_QUERY));
switch (eObjectID)
{
case OBJECTTYPE_DATA_SERIES:
......@@ -327,9 +325,12 @@ OUString ChartController::GetContextName()
case OBJECTTYPE_GRID:
return OUString("Grid");
case OBJECTTYPE_DIAGRAM:
if (xChartType.is() && xChartType->getChartType() == "com.sun.star.chart2.PieChartType")
return OUString("ChartElements");
break;
{
css::uno::Reference<css::chart2::XChartType> xChartType = getChartType(css::uno::Reference<css::chart2::XChartDocument>(getModel(), uno::UNO_QUERY));
if (xChartType.is() && xChartType->getChartType() == "com.sun.star.chart2.PieChartType")
return OUString("ChartElements");
break;
}
case OBJECTTYPE_DATA_CURVE:
case OBJECTTYPE_DATA_AVERAGE_LINE:
return OUString("Trendline");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment