Skip to content

Commit 7c85805

Browse files
committed
Fix logic in writeProperty()
as `sStyled()` has been asked for already and lead to leaving this methig, asking it again doesn't make any sense. Reinstating a comment from 3.x reveals that this method is supposed to be working differently, so now it does.
1 parent 30060da commit 7c85805

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/engraving/rw/write/twrite.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,14 @@ void TWrite::writeItems(const ElementList& items, XmlWriter& xml, WriteContext&
379379
}
380380
}
381381

382+
//-----------------------------------------------------------------------------
383+
// writeProperty
384+
//
385+
// - styled properties are never written
386+
// - unstyled properties are always written regardless of value or if forced,
387+
// - properties without style are written if different from default value
388+
//-----------------------------------------------------------------------------
389+
382390
void TWrite::writeProperty(const EngravingItem* item, XmlWriter& xml, Pid pid, bool force)
383391
{
384392
if (item->isStyled(pid)) {
@@ -390,7 +398,7 @@ void TWrite::writeProperty(const EngravingItem* item, XmlWriter& xml, Pid pid, b
390398
return;
391399
}
392400
PropertyFlags f = item->propertyFlags(pid);
393-
PropertyValue d = !force && (f != PropertyFlags::STYLED) ? item->propertyDefault(pid) : PropertyValue();
401+
PropertyValue d = !force && (f != PropertyFlags::NOSTYLE) ? item->propertyDefault(pid) : PropertyValue();
394402

395403
if (pid == Pid::FONT_STYLE) {
396404
FontStyle ds = FontStyle(d.isValid() ? d.toInt() : 0);

0 commit comments

Comments
 (0)