Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Truncate descriptions for ribbon tooltips if they exceed 1024 characters #215

Merged
merged 1 commit into from
Mar 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Excel_UI/UI/Templates/SelectorMenu_RibbonXml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down