Commit 18cded57 authored by Ralf Habacker's avatar Ralf Habacker

Move code related to 'getStartMove' to the AssociationWidgetRole class

CCBUG:53369
parent 8e90c658
......@@ -2713,17 +2713,9 @@ void AssociationWidget::constrainTextPos(qreal &textX, qreal &textY,
void AssociationWidget::setTextPosition(Uml::TextRole::Enum role)
{
bool startMove = false;
if (m_role[RoleType::A].multiplicityWidget && m_role[RoleType::A].multiplicityWidget->getStartMove())
if (m_role[RoleType::A].getStartMove())
startMove = true;
else if (m_role[RoleType::B].multiplicityWidget && m_role[RoleType::B].multiplicityWidget->getStartMove())
startMove = true;
else if (m_role[RoleType::A].changeabilityWidget && m_role[RoleType::A].changeabilityWidget->getStartMove())
startMove = true;
else if (m_role[RoleType::B].changeabilityWidget && m_role[RoleType::B].changeabilityWidget->getStartMove())
startMove = true;
else if (m_role[RoleType::A].roleWidget && m_role[RoleType::A].roleWidget->getStartMove())
startMove = true;
else if (m_role[RoleType::B].roleWidget && m_role[RoleType::B].roleWidget->getStartMove())
else if (m_role[RoleType::B].getStartMove())
startMove = true;
else if (m_nameWidget && m_nameWidget->getStartMove())
startMove = true;
......@@ -2745,17 +2737,9 @@ void AssociationWidget::setTextPosition(Uml::TextRole::Enum role)
void AssociationWidget::setTextPositionRelatively(Uml::TextRole::Enum role, const QPointF &oldPosition)
{
bool startMove = false;
if (m_role[RoleType::A].multiplicityWidget && m_role[RoleType::A].multiplicityWidget->getStartMove())
startMove = true;
else if (m_role[RoleType::B].multiplicityWidget && m_role[RoleType::B].multiplicityWidget->getStartMove())
startMove = true;
else if (m_role[RoleType::A].changeabilityWidget && m_role[RoleType::A].changeabilityWidget->getStartMove())
startMove = true;
else if (m_role[RoleType::B].changeabilityWidget && m_role[RoleType::B].changeabilityWidget->getStartMove())
startMove = true;
else if (m_role[RoleType::A].roleWidget && m_role[RoleType::A].roleWidget->getStartMove())
if (m_role[RoleType::A].getStartMove())
startMove = true;
else if (m_role[RoleType::B].roleWidget && m_role[RoleType::B].roleWidget->getStartMove())
else if (m_role[RoleType::B].getStartMove())
startMove = true;
else if (m_nameWidget && m_nameWidget->getStartMove())
startMove = true;
......
......@@ -126,3 +126,13 @@ bool AssociationWidgetRole::loadFromXMI1(QDomElement &qElement, const QString &s
// for remaining see AssociationWidget::loadFromXMI
return true;
}
bool AssociationWidgetRole::getStartMove()
{
if (multiplicityWidget && multiplicityWidget->getStartMove())
return true;
else if (changeabilityWidget && changeabilityWidget->getStartMove())
return true;
else if (roleWidget && roleWidget->getStartMove())
return true;
return false;
}
......@@ -59,6 +59,8 @@ public:
void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement, const QString &suffix);
bool loadFromXMI1(QDomElement &qElement, const QString &suffix);
bool getStartMove();
private:
AssociationWidget *m_q;
};
......
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