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

@ -550,7 +550,7 @@ void RimPlotCurve::showLegend(bool show)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::setZOrder(double z)
{
@ -561,24 +561,11 @@ 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)
{
@ -587,11 +574,12 @@ void RimPlotCurve::updateLegendEntryVisibilityAndPlotLegend()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::updateLegendEntryVisibilityNoPlotUpdate()
{
if (m_showLegend()) {
if (m_showLegend())
{
if (m_curveName().isEmpty())
{
m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, false);
@ -605,4 +593,4 @@ void RimPlotCurve::updateLegendEntryVisibilityNoPlotUpdate()
{
m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, false);
}
}
}