Fix potential crash with too big shift for a label.
This commit is contained in:
parent
99985d43e0
commit
e5a9092e25
|
@ -94,8 +94,6 @@ DestinationItem VAbstractFlipping::CreateItem(quint32 idTool, const SourceItem &
|
|||
}
|
||||
|
||||
DestinationItem item;
|
||||
item.mx = INT_MAX;
|
||||
item.my = INT_MAX;
|
||||
item.id = data->AddGObject(new Item(rotated));
|
||||
return item;
|
||||
}
|
||||
|
|
|
@ -252,8 +252,8 @@ QVector<DestinationItem> VAbstractOperation::ExtractDestinationData(const QDomEl
|
|||
{
|
||||
DestinationItem d;
|
||||
d.id = VDomDocument::GetParametrUInt(element, AttrIdObject, NULL_ID_STR);
|
||||
d.mx = qApp->toPixel(VDomDocument::GetParametrDouble(element, AttrMx, QString::number(INT_MAX)));
|
||||
d.my = qApp->toPixel(VDomDocument::GetParametrDouble(element, AttrMy, QString::number(INT_MAX)));
|
||||
d.mx = qApp->toPixel(VDomDocument::GetParametrDouble(element, AttrMx, QChar('1')));
|
||||
d.my = qApp->toPixel(VDomDocument::GetParametrDouble(element, AttrMy, QChar('1')));
|
||||
d.showLabel = VDomDocument::GetParametrBool(element, AttrShowLabel, trueStr);
|
||||
destination.append(d);
|
||||
}
|
||||
|
@ -754,7 +754,7 @@ void VAbstractOperation::SaveSourceDestination(QDomElement &tag)
|
|||
QDomElement item = doc->createElement(TagItem);
|
||||
doc->SetAttribute(item, AttrIdObject, dItem.id);
|
||||
|
||||
VAbstractSimple *obj = operatedObjects.value(dItem.id);
|
||||
VAbstractSimple *obj = operatedObjects.value(dItem.id, nullptr);
|
||||
|
||||
doc->SetAttributeOrRemoveIf(item, AttrMx, qApp->fromPixel(dItem.mx),
|
||||
obj && obj->GetType() != GOType::Point);
|
||||
|
|
|
@ -45,10 +45,10 @@
|
|||
|
||||
struct DestinationItem
|
||||
{
|
||||
quint32 id;
|
||||
qreal mx;
|
||||
qreal my;
|
||||
bool showLabel;
|
||||
quint32 id{NULL_ID};
|
||||
qreal mx{1};
|
||||
qreal my{1};
|
||||
bool showLabel{true};
|
||||
};
|
||||
|
||||
struct VAbstractOperationInitData : VDrawToolInitData
|
||||
|
|
|
@ -629,8 +629,6 @@ DestinationItem VToolMove::CreateItem(quint32 idTool, const SourceItem &sItem, q
|
|||
}
|
||||
|
||||
DestinationItem item;
|
||||
item.mx = INT_MAX;
|
||||
item.my = INT_MAX;
|
||||
item.id = data->AddGObject(new Item(moved));
|
||||
return item;
|
||||
}
|
||||
|
|
|
@ -440,8 +440,6 @@ DestinationItem VToolRotation::CreateItem(quint32 idTool, const SourceItem &sIte
|
|||
}
|
||||
|
||||
DestinationItem item;
|
||||
item.mx = INT_MAX;
|
||||
item.my = INT_MAX;
|
||||
item.id = data->AddGObject(new Item(rotated));
|
||||
return item;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user