PlotCurve : Remove duplicate code

This commit is contained in:
Magne Sjaastad 2018-04-27 11:58:22 +02:00
parent ae3cc0010d
commit f1fbe4d8ac

View File

@ -565,20 +565,7 @@ void RimPlotCurve::setZOrder(double z)
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::updateLegendEntryVisibilityAndPlotLegend()
{
if (m_showLegend()) {
if (m_curveName().isEmpty())
{
m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, false);
}
else
{
m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, true);
}
}
else
{
m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, false);
}
updateLegendEntryVisibilityNoPlotUpdate();
if (m_parentQwtPlot != nullptr)
{
@ -591,7 +578,8 @@ void RimPlotCurve::updateLegendEntryVisibilityAndPlotLegend()
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::updateLegendEntryVisibilityNoPlotUpdate()
{
if (m_showLegend()) {
if (m_showLegend())
{
if (m_curveName().isEmpty())
{
m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, false);