mirror of
https://github.com/ONLYOFFICE/sdkjs-forms.git
synced 2026-02-10 18:05:42 +08:00
[oform] Fix write/read color in userMaster
This commit is contained in:
@ -122,17 +122,18 @@
|
|||||||
else if (this.Color && !user.Color)
|
else if (this.Color && !user.Color)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (color.r < otherColor.r)
|
|
||||||
|
if (this.Color.r < user.Color.r)
|
||||||
return -1;
|
return -1;
|
||||||
else if (color.r > otherColor.r)
|
else if (this.Color.r > user.Color.r)
|
||||||
return 1;
|
return 1;
|
||||||
else if (color.g < otherColor.g)
|
else if (this.Color.g < user.Color.g)
|
||||||
return -1;
|
return -1;
|
||||||
else if (color.g > otherColor.g)
|
else if (this.Color.g > user.Color.g)
|
||||||
return 1;
|
return 1;
|
||||||
else if (color.b < otherColor.b)
|
else if (this.Color.b < user.Color.b)
|
||||||
return -1;
|
return -1;
|
||||||
else if (color.b > otherColor.b)
|
else if (this.Color.b > user.Color.b)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -186,8 +187,9 @@
|
|||||||
|
|
||||||
if (this.Color)
|
if (this.Color)
|
||||||
{
|
{
|
||||||
writer.WriteXmlNodeWithText
|
writer.WriteXmlNodeStart("color");
|
||||||
// TODO: fix me
|
writer.WriteXmlNullableAttributeStringEncode("val", this.Color.ToHexColor());
|
||||||
|
writer.WriteXmlAttributesEnd(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
writer.WriteXmlNodeEnd("userMaster");
|
writer.WriteXmlNodeEnd("userMaster");
|
||||||
@ -215,7 +217,16 @@
|
|||||||
um.setRole(reader.GetTextDecodeXml());
|
um.setRole(reader.GetTextDecodeXml());
|
||||||
break;
|
break;
|
||||||
case "color":
|
case "color":
|
||||||
|
while (reader.MoveToNextAttribute())
|
||||||
|
{
|
||||||
|
if ("val" === reader.GetNameNoNS())
|
||||||
|
{
|
||||||
|
let color = new AscWord.CDocumentColor();
|
||||||
|
color.SetFromHexColor(reader.GetValueDecodeXml());
|
||||||
|
um.setColor(color.r, color.g, color.b);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reader.ReadTillEnd();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user