Skip to content

Commit

Permalink
Truncate descriptions for ribbon tooltips if they exceed 1024 characters
Browse files Browse the repository at this point in the history
Andrew Wakeman committed Mar 26, 2020
1 parent 9f01413 commit 6da2f77
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Excel_UI/UI/Templates/SelectorMenu_RibbonXml.cs
Original file line number Diff line number Diff line change
@@ -98,7 +98,12 @@ private void AppendMenuTree(Tree<T> tree, XmlElement menu)
element.SetAttribute("onAction", "FillFormula");
string description = method.IDescription();
if(description.Length > 0)
{
// Ribbon XML schema has a hard limit of 1024 characters, truncate if we exceed it
if (description.Length > 1024)
description = description.Substring(0, 1024);
element.SetAttribute("supertip", description);
}
m_ItemLinks[id] = method;
}
element.SetAttribute("label", tree.Name);

0 comments on commit 6da2f77

Please sign in to comment.