mirror of
https://github.com/Kopano-dev/kopano-ol-extension.git
synced 2023-10-10 13:37:40 +02:00
[KOE-94] Fixed rendering of & in tree nodes for shared folders. Fixed encoding of strings in SOAP requests, which caused shared folders with special characters to fail.
This commit is contained in:
parent
4b0df802c4
commit
99c93d8d1f
@ -29,6 +29,8 @@ namespace Acacia.Controls
|
|||||||
{
|
{
|
||||||
internal abstract class KTreeRenderer
|
internal abstract class KTreeRenderer
|
||||||
{
|
{
|
||||||
|
protected const TextFormatFlags TEXT_FLAGS = TextFormatFlags.Left | TextFormatFlags.VerticalCenter | TextFormatFlags.NoPrefix;
|
||||||
|
|
||||||
private Rectangle _clientRect;
|
private Rectangle _clientRect;
|
||||||
private Rectangle _totalRect;
|
private Rectangle _totalRect;
|
||||||
protected KTree _tree;
|
protected KTree _tree;
|
||||||
@ -79,7 +81,7 @@ namespace Acacia.Controls
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Text size
|
// Text size
|
||||||
dimension[KTreeNodeMeasurements.Part.Text] = TextRenderer.MeasureText(graphics, node.Text, _tree.Font);
|
dimension[KTreeNodeMeasurements.Part.Text] = TextRenderer.MeasureText(graphics, node.Text, _tree.Font, Size.Empty, TEXT_FLAGS);
|
||||||
|
|
||||||
// Control
|
// Control
|
||||||
if (node.Control != null)
|
if (node.Control != null)
|
||||||
|
@ -68,8 +68,7 @@ namespace Acacia.Controls
|
|||||||
|
|
||||||
protected override void RenderNodeText(Graphics graphics, KTreeNode node, Rectangle rect, KTreeNodeMeasurements.Part? highlight)
|
protected override void RenderNodeText(Graphics graphics, KTreeNode node, Rectangle rect, KTreeNodeMeasurements.Part? highlight)
|
||||||
{
|
{
|
||||||
TextRenderer.DrawText(graphics, node.Text, _tree.Font, rect, GetColor(node, highlight),
|
TextRenderer.DrawText(graphics, node.Text, _tree.Font, rect, GetColor(node, highlight), Color.Transparent, TEXT_FLAGS);
|
||||||
Color.Transparent, TextFormatFlags.Left | TextFormatFlags.VerticalCenter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Color GetColor(KTreeNode node, KTreeNodeMeasurements.Part? highlight)
|
private Color GetColor(KTreeNode node, KTreeNodeMeasurements.Part? highlight)
|
||||||
|
@ -143,8 +143,7 @@ namespace Acacia.Controls
|
|||||||
{
|
{
|
||||||
Color foreColor = GetStyle(node, highlight).GetColor(ColorProperty.TextColor);
|
Color foreColor = GetStyle(node, highlight).GetColor(ColorProperty.TextColor);
|
||||||
|
|
||||||
TextRenderer.DrawText(graphics, node.Text, _tree.Font, rect, foreColor, Color.Transparent,
|
TextRenderer.DrawText(graphics, node.Text, _tree.Font, rect, foreColor, Color.Transparent, TEXT_FLAGS);
|
||||||
TextFormatFlags.Left | TextFormatFlags.VerticalCenter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void RenderControlBorder(Graphics graphics, Rectangle rect)
|
public override void RenderControlBorder(Graphics graphics, Rectangle rect)
|
||||||
|
@ -202,8 +202,7 @@ namespace Acacia.ZPush.Connect.Soap
|
|||||||
|
|
||||||
public override void Serialize(string name, object value, StringBuilder s)
|
public override void Serialize(string name, object value, StringBuilder s)
|
||||||
{
|
{
|
||||||
// TODO: this needs escaping
|
s.Append(string.Format("<{0} xsi:type=\"xsd:string\">{1}</{0}>", name, value.ToString().EncodeXML()));
|
||||||
s.Append(string.Format("<{0} xsi:type=\"xsd:string\">{1}</{0}>", name, value));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override object DeserializeContents(XmlNode node, Type expectedType)
|
protected override object DeserializeContents(XmlNode node, Type expectedType)
|
||||||
|
Loading…
Reference in New Issue
Block a user