B2021-052 allow for table cell text font size change when the text ends in a setpoint or transition link

This commit is contained in:
2021-04-22 14:13:30 +00:00
parent 814d26f713
commit 6d9a3f5f4e
2 changed files with 46 additions and 9 deletions

View File

@@ -2628,14 +2628,16 @@ namespace Volian.Controls.Library
// C2021-005 set the selected cell(s) or cell text to the passed in font size
public void SetFontSize(float newSize)
{
if (SelectedText == null || SelectedText == "") // table cell selected
if (SelectedText == null || SelectedText == "") // empty table cell selected
Rtf = SetFontSizeReplace(Rtf, newSize);
else
{
// table cell text selected
int selst = SelectionStart;
int selln = SelectionLength;
SelectedRtf = SetFontSizeReplace(SelectedRtf, newSize); // set font size of seleted text
string newrtf = SelectedRtf; //B2021-052 use a temporary variable to allow easy debugging
newrtf = SetFontSizeReplace(newrtf, newSize); // changes the /fs## command in the rtf string
SelectedRtf = newrtf;// replace the selected portion with the updated font size version of the rtf
Select(selst, selln); // re-select the cell text
}
}
@@ -2823,7 +2825,7 @@ namespace Volian.Controls.Library
{
// is this an allowable symbol/character:
for (int j = 0; j < sl.Count; j++)
{
{
if (sym == allowableSymbols[j])
{
sb = sb.Append((char)(Convert.ToInt32(allowableSymbols[j])));
@@ -2835,12 +2837,14 @@ namespace Volian.Controls.Library
if (!didCharReplace)
{
sb = sb.Append("?");
didCharReplace = true;
didCharReplace = true;
hasBadChar = true;
}
}
if (!didCharReplace)
sb = sb.Append(ptext[i]);
}
if (!didCharReplace)
sb = sb.Append(ptext[i]);
}
ptext = sb.ToString();
ptext = ptext.Replace("\u2013", "-"); // Replace EN Dash with hyphen