When "rFonts" is set in docDefaults:
<w:styles>
<w:docDefaults>
<w:rPrDefault>
<w:rPr>
<w:rFonts w:ascii="Verdana" w:eastAsia="Times New Roman" w:hAnsi="Verdana" w:cs="Verdana"/>
...
</w:rPr>
</w:rPrDefault>
and partially in the local run properties:
<w:r>
<w:rPr>
<w:rFonts w:cs="Times New Roman"/>
...
</w:rPr>
<w:t>Text</w:t>
</w:r>
A wrong font is applied.
Expected: Verdana
Actual: Times New Roman
NullReferenceException when changing themes, the RichTextBox has TrackChanges enabled, and the current user is set.
Workaround: set empty user like this:
private void RadRichTextBox_ProtectionStateChanged(object sender, EventArgs e)
{
if (this.radRichTextBox.CurrentUser == null)
{
this.radRichTextBox.CurrentUser = new Telerik.Windows.Documents.Model.UserInfo(string.Empty, string.Empty, string.Empty, string.Empty);
}
}
Hi,
This issue was referenced all the way back in 2017 in this post for Win Forms, but it appears it was never actually resolved; only a workaround was provided. I don't think this workaround will work for me, however, because I am binding to the RtfDataProvider in xaml and therefore it makes the changes to the document string before I am able to do a manual replacement of "rtf1" where it only had "rtf" for the version tag before. While changing the tag after the fact will fix the issue of it not being recognized in the other software we use, it still causes bloat because of the fact that it most cases it over triples the amount of raw text in the returned string when the textbox does not properly apply the rtf version tag.
Below is an example of the greatly enlarged amount of data before and after this error occurs:
"S11111^A^1^","{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Arial; } }\viewkind4\uc1 \f0\fs20 Measurements: \par \tab Neck to Fundus \tab \tab 1.5 cm \par \tab Diameter at Fundus \tab \tab 3.0 cm \par \tab Color \tab \tab \tab \tab Green-Tan \par \tab Wall Thickness \tab \tab 1.0 cm \par \tab Mucosa \tab \tab \tab Velvety \par \par No Cholesterolosis Is Identified \par \par No Bile Identified \par \par No Gallstones Are Identified \par \par Summary of Sections: \par \tab Received in Bag and Formalin. The cystic duct margin and representative sections of gallbladder fundus and body are submitted in 1 cassette. \par \par KG/sjh }"^""$$$"
"S11111^A^1^","{\rtf\ansi\ansicpg1252\uc1\deff0\deflang1033{\fonttbl{\f0 Verdana;}{\f1 Arial;}}{\colortbl\red0\green0\blue0 ;}{\*\defchp\ltrch\f0\fs20\i0\b0\strike0\cf0\ulc0\ulnone}{\*\defpap\sl276\slmult1\ql\sa180\ltrpar}{\stylesheet{\s0\sqformat\spriority0\ltrch\f0\fs20\i0\b0\strike0\cf0\ulc0\ulnone\sl276\slmult1\ql\sa180\ltrpar Normal;}{\*\ts2\tsrowd\spriority59\trbrdrt\brdrnone\trbrdrb\brdrnone\trbrdrl\brdrnone\trbrdrr\brdrnone\trbrdrh\brdrnone\trbrdrv\brdrnone\trgaph0\trpaddl75\trpaddr75\trpaddt0\trpaddb0\clpadft3\clpadt0\clpadfr3\clpadr0\clpadfl3\clpadl0\clpadfb3\clpadb0\tsvertalt\ltrch\f0\fs20\i0\b0\strike0\cf0\ulc0\ulnone\sl276\slmult1\ql\sa180\ltrpar Table Normal;}}\nouicompat\viewkind4\paperw12240\paperh15840\margl1425\margr1425\margt1425\margb1425\deftab720\sectd\pgwsxn12240\pghsxn15840\marglsxn1425\margrsxn1425\margtsxn1425\margbsxn1425\headery720\footery720\pard\sl240\slmult1\ql\ltrpar{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone Measurements: }{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone\par}\pard\sl240\slmult1\ql\ltrpar{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone \tab Neck to Fundus \tab \tab 1.6 cm }{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone\par}\pard\sl240\slmult1\ql\ltrpar{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone \tab Diameter at Fundus \tab \tab 3.0 cm }{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone\par}\pard\sl240\slmult1\ql\ltrpar{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone \tab Color \tab \tab \tab \tab Green-Tan }{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone\par}\pard\sl240\slmult1\ql\ltrpar{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone \tab Wall Thickness \tab \tab 1.0 cm }{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone\par}\pard\sl240\slmult1\ql\ltrpar{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone \tab Mucosa \tab \tab \tab Velvety }{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone\par}\pard\sl240\slmult1\ql\ltrpar{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone }{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone\par}\pard\sl240\slmult1\ql\ltrpar{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone No Cholesterolosis Is Identified }{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone\par}\pard\sl240\slmult1\ql\ltrpar{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone\par}\pard\sl240\slmult1\ql\ltrpar{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone No Bile Identified }{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone\par}\pard\sl240\slmult1\ql\ltrpar{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone\par}\pard\sl240\slmult1\ql\ltrpar{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone No Gallstones Are Identified }{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone\par}\pard\sl240\slmult1\ql\ltrpar{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone\par}\pard\sl240\slmult1\ql\ltrpar{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone Summary of Sections: }{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone\par}\pard\sl240\slmult1\ql\ltrpar{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone \tab Received in Bag and Formalin. The cystic duct margin and representative sections of gallbladder fundus and body are submitted in 1 cassette. }{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone\par}\pard\sl240\slmult1\ql\ltrpar{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone\par}\pard\sl240\slmult1\ql\ltrpar{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone KG/sjh }{\ltrch\f1\fs20\i0\b0\strike0\cf0\ulc0\ulnone\par}}"^""$$$"
If there is a way that I can use the workaround in that post to prevent this bloating of the data while still using my current setup with bindings, I would be happy to do so, but as it is I don't think that's the case. It seems like this is clearly a bug and something that should have a real fix on the control and not a workaround after all this time, but if that's not the case and it was left as is for a reason, I'd be happy to hear that reason.
Thanks in advance for the help.
In the Track Change mode, try to insert several images using standard InsertPictureCommand (or even Editor.InsertImage()) double enter and then again. Or insert text between already inserted images.
The error could be also observed when accepting all changes.
The CSS styling for the "p" selector is not imported as a "NormalWeb" style. For example the following: <style type="text/css">p {margin-top:0; margin-bottom:0;}</style> should be imported as SpacingBefore and SpacingAfter set to 0 in Normal (Web) style.