diff --git a/common/Drawings/Metafile.js b/common/Drawings/Metafile.js index 2d76919f12..5d8a81c2c8 100644 --- a/common/Drawings/Metafile.js +++ b/common/Drawings/Metafile.js @@ -3475,10 +3475,36 @@ if (props) { this.Memory.WriteByte(CommandType.ctDocInfo); - this.Memory.WriteString(props.asc_getTitle()); - this.Memory.WriteString(props.asc_getCreator()); - this.Memory.WriteString(props.asc_getSubject()); - this.Memory.WriteString(props.asc_getKeywords()); + + var nFlagPos = this.Memory.GetCurPosition(); + this.Memory.Skip(4); + var nFlag = 0; + + if (props.asc_getTitle()) + { + nFlag |= 1; + this.Memory.WriteString(props.asc_getTitle()); + } + if (props.asc_getCreator()) + { + nFlag |= (1 << 1); + this.Memory.WriteString(props.asc_getCreator()); + } + if (props.asc_getSubject()) + { + nFlag |= (1 << 2); + this.Memory.WriteString(props.asc_getSubject()); + } + if (props.asc_getKeywords()) + { + nFlag |= (1 << 3); + this.Memory.WriteString(props.asc_getKeywords()); + } + + var nEndPos = this.Memory.GetCurPosition(); + this.Memory.Seek(nFlagPos); + this.Memory.WriteLong(nFlag); + this.Memory.Seek(nEndPos); } } };