Skip to content

Commit

Permalink
fix substring condition
Browse files Browse the repository at this point in the history
  • Loading branch information
rcktrncn committed Aug 3, 2021
1 parent a281e2b commit 3d70d10
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions taskt/UI/CustomControls/CommandControls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ public static ComboBox AddVariableNames(this ComboBox cbo, UI.Forms.frmCommandEd
return cbo;
}

public static string GetDataGridViewRowInfoText(Core.Automation.Attributes.PropertyAttributes.PropertyDataGridViewRowInfo rowInfo)
public static string GetDataGridViewRowInfoText(Core.Automation.Attributes.PropertyAttributes.PropertyAddtionalParameterInfo rowInfo)
{
if (rowInfo == null)
{
Expand Down Expand Up @@ -1241,14 +1241,24 @@ private static string getTextMDFormat(this string targetString)
idxTable = targetString.IndexOf("\\|");
if (idxAster >= 0 || idxTable >= 0)
{
if (idxAster < idxTable)
if ((idxAster >= 0) && (idxTable < 0))
{
ret += targetString.Substring(0, idxAster).removeMDFormat() + "*";
targetString = targetString.Substring(idxAster + 1);
}
else
else if ((idxTable >= 0) && (idxAster < 0))
{
ret += targetString.Substring(0, idxTable).removeMDFormat() + "|";
targetString = targetString.Substring(idxTable + 1);
}
else if (idxAster < idxTable)
{
ret += targetString.Substring(0, idxAster).removeMDFormat() + "*";
targetString = targetString.Substring(idxAster + 1);
}
else if (idxTable < idxAster)
{
ret += targetString.Substring(0, idxTable).removeMDFormat() + "*";
ret += targetString.Substring(0, idxTable).removeMDFormat() + "|";
targetString = targetString.Substring(idxTable + 1);
}
}
Expand Down

0 comments on commit 3d70d10

Please sign in to comment.