Minor refactoring.
--HG-- branch : develop
This commit is contained in:
parent
7d1c4bc3ba
commit
61173f75c4
|
@ -768,11 +768,14 @@ VPieceNode VAbstractPattern::ParseSANode(const QDomElement &domElement)
|
||||||
const QString t = VDomDocument::GetParametrString(domElement, AttrType, VAbstractPattern::NodePoint);
|
const QString t = VDomDocument::GetParametrString(domElement, AttrType, VAbstractPattern::NodePoint);
|
||||||
Tool tool;
|
Tool tool;
|
||||||
|
|
||||||
const QStringList types = QStringList() << VAbstractPattern::NodePoint
|
const QStringList types
|
||||||
<< VAbstractPattern::NodeArc
|
{
|
||||||
<< VAbstractPattern::NodeSpline
|
VAbstractPattern::NodePoint,
|
||||||
<< VAbstractPattern::NodeSplinePath
|
VAbstractPattern::NodeArc,
|
||||||
<< VAbstractPattern::NodeElArc;
|
VAbstractPattern::NodeSpline,
|
||||||
|
VAbstractPattern::NodeSplinePath,
|
||||||
|
VAbstractPattern::NodeElArc
|
||||||
|
};
|
||||||
|
|
||||||
switch (types.indexOf(t))
|
switch (types.indexOf(t))
|
||||||
{
|
{
|
||||||
|
|
|
@ -462,14 +462,7 @@ bool VMeasurements::IsReadOnly() const
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VMeasurements::SetReadOnly(bool ro)
|
void VMeasurements::SetReadOnly(bool ro)
|
||||||
{
|
{
|
||||||
if (ro)
|
setTagText(TagReadOnly, ro ? trueStr : falseStr);
|
||||||
{
|
|
||||||
setTagText(TagReadOnly, trueStr);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
setTagText(TagReadOnly, falseStr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -1428,7 +1428,7 @@ void VToolSeamAllowance::ShowOptions()
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolSeamAllowance::ToggleInLayout(bool checked)
|
void VToolSeamAllowance::ToggleInLayout(bool checked)
|
||||||
{
|
{
|
||||||
TogglePieceInLayout *togglePrint = new TogglePieceInLayout(m_id, checked, &(VAbstractTool::data), doc);
|
auto togglePrint = new TogglePieceInLayout(m_id, checked, &(VAbstractTool::data), doc);
|
||||||
connect(togglePrint, &TogglePieceInLayout::Toggled, doc, &VAbstractPattern::CheckInLayoutList);
|
connect(togglePrint, &TogglePieceInLayout::Toggled, doc, &VAbstractPattern::CheckInLayoutList);
|
||||||
qApp->getUndoStack()->push(togglePrint);
|
qApp->getUndoStack()->push(togglePrint);
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,19 +115,10 @@ bool SavePlaceLabelOptions::mergeWith(const QUndoCommand *command)
|
||||||
const SavePlaceLabelOptions *saveCommand = static_cast<const SavePlaceLabelOptions *>(command);
|
const SavePlaceLabelOptions *saveCommand = static_cast<const SavePlaceLabelOptions *>(command);
|
||||||
SCASSERT(saveCommand != nullptr);
|
SCASSERT(saveCommand != nullptr);
|
||||||
|
|
||||||
if (saveCommand->LabelId() != nodeId)
|
if (saveCommand->LabelId() != nodeId || m_newLabel.GetCenterPoint() != saveCommand->NewLabel().GetCenterPoint())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
const VPlaceLabelItem candidate = saveCommand->NewLabel();
|
|
||||||
|
|
||||||
if (m_newLabel.GetCenterPoint() != candidate.GetCenterPoint())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_newLabel = saveCommand->NewLabel();
|
m_newLabel = saveCommand->NewLabel();
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -43,7 +43,9 @@
|
||||||
|
|
||||||
Q_DECLARE_LOGGING_CATEGORY(vUndo)
|
Q_DECLARE_LOGGING_CATEGORY(vUndo)
|
||||||
|
|
||||||
enum class UndoCommand: char { AddPatternPiece,
|
enum class UndoCommand: char
|
||||||
|
{
|
||||||
|
AddPatternPiece,
|
||||||
AddToCalc,
|
AddToCalc,
|
||||||
MoveSpline,
|
MoveSpline,
|
||||||
MoveSplinePath,
|
MoveSplinePath,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user