Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs/class
diff options
context:
space:
mode:
authorKarl <karl@scowencomputers.co.nz>2018-06-09 08:06:41 +0300
committerKarl <contact@scowencomputers.co.nz>2020-01-13 07:54:00 +0300
commit0b6dd983ddb8256c6ba60fd87565b4f96a84cf2b (patch)
tree328cc25d337ad63d14126838cc87c69e162811a3 /mcs/class
parentdf3b5a26b426eaaed17e898dd5e189f9d460a717 (diff)
Later RTF para overrides earlier. Emit \nosupersub.
RTF paragraph controls override earlier instructions, rather than keeping the maximum. Emit \nosupersub between superscript and subscript text. Missing it out technically gives a superscript (or subscript) of the subscript (or superscript), which is not what we want. rather than keeping the maximum.
Diffstat (limited to 'mcs/class')
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBox.cs14
1 files changed, 8 insertions, 6 deletions
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBox.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBox.cs
index 282b1e93281..cf96c9652c0 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBox.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBox.cs
@@ -2133,12 +2133,12 @@ namespace System.Windows.Forms {
line.ending = LineEnding.Rich;
}
- line.indent = Math.Max (left_indent, line.indent);
- line.HangingIndent = Math.Max (hanging_indent, line.hanging_indent);
- line.right_indent = Math.Max (rtf_style.rtf_par_line_right_indent, line.right_indent);
- line.spacing_after = Math.Max (rtf_style.rtf_par_spacing_after, line.spacing_after);
- line.spacing_before = Math.Max (rtf_style.rtf_par_spacing_before, line.spacing_before);
- line.line_spacing = Math.Max (rtf_style.rtf_par_line_spacing, line.line_spacing);
+ line.indent = left_indent;
+ line.HangingIndent = hanging_indent;
+ line.right_indent = rtf_style.rtf_par_line_right_indent;
+ line.spacing_after = rtf_style.rtf_par_spacing_after;
+ line.spacing_before = rtf_style.rtf_par_spacing_before;
+ line.line_spacing = rtf_style.rtf_par_line_spacing;
line.line_spacing_multiple = rtf_style.rtf_par_line_spacing_multiple;
line.alignment = rtf_style.rtf_par_align;
@@ -2804,6 +2804,8 @@ namespace System.Windows.Forms {
}
if (tag.TextPosition != text_position) {
+ if (text_position != TextPositioning.Normal && tag.TextPosition != TextPositioning.Normal)
+ sb.Append("\\nosupersub"); // Technically it is possible to have subscripts in superscript and vise versa. But that's not what we've got.
text_position = tag.TextPosition;
switch (tag.TextPosition) {
case TextPositioning.Normal: