Fix V3002, V3114 warnings from PVS-Studio Static Analyzer

This commit is contained in:
AdmAlexus 2017-10-27 19:56:42 +05:00
parent e99433e193
commit f4996ae106

View file

@ -57,21 +57,24 @@ protected override void OnPaint(PaintEventArgs e)
if (BackgroundImageLayout == ImageLayout.Stretch) e.Graphics.DrawImage(BackgroundImage, new Rectangle(0, 0, Width, Height + 9));
}
if (Selected)
int imgWidth = 0;
if (Image != null)
{
if (Selected)
{
if (SaveSystem.currentTheme != null && DoBackColorAdapt) e.Graphics.FillRectangle(new SolidBrush(SaveSystem.currentTheme.selectedBackColor), new Rectangle(0, 0, Width, Image.Height));
else e.Graphics.FillRectangle(Brushes.Navy, new Rectangle(0, 0, Width, Image.Height));
}
e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
e.Graphics.DrawImage(Image, 0 + Padding.Left - Padding.Right, 0); imgWidth = Image.Width;
}
//if (Image != null) if (Height != Image.Height) if (layout == ClassicStartMenuItemLayout.CloseTitleWithLightSubtitle && Height != Image.Height + 8) { Height = Image.Height; }
StringFormat sf = new StringFormat();
sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show;
int imgWidth = 0;
if (Image != null) { e.Graphics.DrawImage(Image, 0 + Padding.Left - Padding.Right, 0); imgWidth = Image.Width; }
//if (Image != null) if (Height != Image.Height) if (layout == ClassicStartMenuItemLayout.CloseTitleWithLightSubtitle && Height != Image.Height + 8) { Height = Image.Height; }
if (!Selected) {
switch (layout) {
case ClassicStartMenuItemLayout.DistancedTitle:
@ -133,7 +136,7 @@ public enum ClassicStartMenuItemLayout
{
DistancedTitle,
CloseTitle,
CloseTitleWithTwoLines,
//CloseTitleWithTwoLines,
CloseTitleWithLightSubtitle
}
}