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);
|
||||
Tool tool;
|
||||
|
||||
const QStringList types = QStringList() << VAbstractPattern::NodePoint
|
||||
<< VAbstractPattern::NodeArc
|
||||
<< VAbstractPattern::NodeSpline
|
||||
<< VAbstractPattern::NodeSplinePath
|
||||
<< VAbstractPattern::NodeElArc;
|
||||
const QStringList types
|
||||
{
|
||||
VAbstractPattern::NodePoint,
|
||||
VAbstractPattern::NodeArc,
|
||||
VAbstractPattern::NodeSpline,
|
||||
VAbstractPattern::NodeSplinePath,
|
||||
VAbstractPattern::NodeElArc
|
||||
};
|
||||
|
||||
switch (types.indexOf(t))
|
||||
{
|
||||
|
|
|
@ -462,14 +462,7 @@ bool VMeasurements::IsReadOnly() const
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VMeasurements::SetReadOnly(bool ro)
|
||||
{
|
||||
if (ro)
|
||||
{
|
||||
setTagText(TagReadOnly, trueStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
setTagText(TagReadOnly, falseStr);
|
||||
}
|
||||
setTagText(TagReadOnly, ro ? trueStr : falseStr);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -1428,7 +1428,7 @@ void VToolSeamAllowance::ShowOptions()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
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);
|
||||
qApp->getUndoStack()->push(togglePrint);
|
||||
}
|
||||
|
|
|
@ -115,19 +115,10 @@ bool SavePlaceLabelOptions::mergeWith(const QUndoCommand *command)
|
|||
const SavePlaceLabelOptions *saveCommand = static_cast<const SavePlaceLabelOptions *>(command);
|
||||
SCASSERT(saveCommand != nullptr);
|
||||
|
||||
if (saveCommand->LabelId() != nodeId)
|
||||
if (saveCommand->LabelId() != nodeId || m_newLabel.GetCenterPoint() != saveCommand->NewLabel().GetCenterPoint())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
const VPlaceLabelItem candidate = saveCommand->NewLabel();
|
||||
|
||||
if (m_newLabel.GetCenterPoint() != candidate.GetCenterPoint())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
m_newLabel = saveCommand->NewLabel();
|
||||
return true;
|
||||
|
|
|
@ -43,24 +43,26 @@
|
|||
|
||||
Q_DECLARE_LOGGING_CATEGORY(vUndo)
|
||||
|
||||
enum class UndoCommand: char { AddPatternPiece,
|
||||
AddToCalc,
|
||||
MoveSpline,
|
||||
MoveSplinePath,
|
||||
MoveSPoint,
|
||||
SaveToolOptions,
|
||||
SaveDetailOptions,
|
||||
SavePieceOptions,
|
||||
SavePiecePathOptions,
|
||||
SavePlaceLabelOptions,
|
||||
MovePiece,
|
||||
DeleteTool,
|
||||
DeletePatternPiece,
|
||||
RenamePP,
|
||||
MoveLabel,
|
||||
MoveDoubleLabel,
|
||||
RotationMoveLabel
|
||||
};
|
||||
enum class UndoCommand: char
|
||||
{
|
||||
AddPatternPiece,
|
||||
AddToCalc,
|
||||
MoveSpline,
|
||||
MoveSplinePath,
|
||||
MoveSPoint,
|
||||
SaveToolOptions,
|
||||
SaveDetailOptions,
|
||||
SavePieceOptions,
|
||||
SavePiecePathOptions,
|
||||
SavePlaceLabelOptions,
|
||||
MovePiece,
|
||||
DeleteTool,
|
||||
DeletePatternPiece,
|
||||
RenamePP,
|
||||
MoveLabel,
|
||||
MoveDoubleLabel,
|
||||
RotationMoveLabel
|
||||
};
|
||||
|
||||
class VPattern;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user