Menu

#179 BaseRenderer.CalculateTextWidth does not handle ArgumentException from MeasureText

C#_v2.7
open
nobody
None
1
2018-12-12
2018-12-12
Thracx
No

TextRenderer.MeasureText can throw an (undocumented) ArgumentException in certain conditions.

Adding a try..catch to BaseRenderer.CalculateTextWidth in Renderers .cs should fix the issue.

Exception StackTrace:
ArgumentException: Parameter is not valid.
at System.Drawing.Graphics.GetHdc
at System.Windows.Forms.WindowsGraphicsWrapper..ctor
at Systm.Windows.Forms.TextRenderer.MeasureText
at BrightIdeasSoftware.BaseRenderer.CalculateTextWidth
at BrightIdeasSoftware.BaseRenderer.StandardHitTest
at BrightIdeasSoftware.TreeListView.TreeRenderer.HandleHitTest
at BrightIdeasSoftware.BaseRenderer.HitTest
at BrightIdeasSoftware.ObjectListView.OlvHitTest
at BrightIdeasSoftware....<logs truncated="">...</logs>

Discussion


Log in to post a comment.

MongoDB Logo MongoDB