Use SetAttributeOrRemoveIf for margins.
This commit is contained in:
parent
53ed34c226
commit
45256ebdd9
|
@ -169,10 +169,10 @@ void VPLayoutFileWriter::WritePiece(VPPiece *piece)
|
||||||
void VPLayoutFileWriter::WriteMargins(const QMarginsF &margins)
|
void VPLayoutFileWriter::WriteMargins(const QMarginsF &margins)
|
||||||
{
|
{
|
||||||
writeStartElement(ML::TagMargin);
|
writeStartElement(ML::TagMargin);
|
||||||
SetAttribute(ML::AttrLeft, margins.left());
|
SetAttributeOrRemoveIf<qreal>(ML::AttrLeft, margins.left(), [](qreal margin){return margin <= 0;});
|
||||||
SetAttribute(ML::AttrTop, margins.top());
|
SetAttributeOrRemoveIf<qreal>(ML::AttrTop, margins.top(), [](qreal margin){return margin <= 0;});
|
||||||
SetAttribute(ML::AttrRight, margins.right());
|
SetAttributeOrRemoveIf<qreal>(ML::AttrRight, margins.right(), [](qreal margin){return margin <= 0;});
|
||||||
SetAttribute(ML::AttrBottom, margins.bottom());
|
SetAttributeOrRemoveIf<qreal>(ML::AttrBottom, margins.bottom(), [](qreal margin){return margin <= 0;});
|
||||||
writeEndElement(); // margin
|
writeEndElement(); // margin
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user