aboutsummaryrefslogtreecommitdiff
path: root/Histacom2.Engine
diff options
context:
space:
mode:
authorAdmAlexus <[email protected]>2017-10-28 16:00:30 +0500
committerAdmAlexus <[email protected]>2017-10-28 16:00:30 +0500
commitc4acd5e5bdc18c86c417880e01685d7cf28902aa (patch)
tree7a0de8d41039babbed1d93d71ab7b932b8c6dd21 /Histacom2.Engine
parentc07a9ded1361f4af75f7a81faa7f800c755766e1 (diff)
downloadhistacom2-c4acd5e5bdc18c86c417880e01685d7cf28902aa.tar.gz
histacom2-c4acd5e5bdc18c86c417880e01685d7cf28902aa.tar.bz2
histacom2-c4acd5e5bdc18c86c417880e01685d7cf28902aa.zip
Fix V3029 warnings from PVS-Studio Static Analyzer
Hi! I'm a member of the Pinguem.ru competition on finding errors in open source projects. A bug, found using PVS-Studio. Warnings with low priority:
Diffstat (limited to 'Histacom2.Engine')
-rw-r--r--Histacom2.Engine/Template/WinClassic.cs65
1 files changed, 47 insertions, 18 deletions
diff --git a/Histacom2.Engine/Template/WinClassic.cs b/Histacom2.Engine/Template/WinClassic.cs
index 25cbfaa..39c7468 100644
--- a/Histacom2.Engine/Template/WinClassic.cs
+++ b/Histacom2.Engine/Template/WinClassic.cs
@@ -88,8 +88,11 @@ namespace Histacom2.Engine.Template
{
var toDraw = resizer.ToDraw;
if (resizable) {
- if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X);
- if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.X = Cursor.Position.X;
+ if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8)
+ {
+ toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X);
+ toDraw.X = Cursor.Position.X;
+ }
}
resizer.ToDraw = toDraw;
}
@@ -100,8 +103,11 @@ namespace Histacom2.Engine.Template
if (e.Button == MouseButtons.Left)
{
var toDraw = resizer.ToDraw;
- if (resizable) toDraw.Y = this.Location.Y;
- if (resizable) toDraw.Height = MousePosition.Y - this.Location.Y;
+ if (resizable)
+ {
+ toDraw.Y = this.Location.Y;
+ toDraw.Height = MousePosition.Y - this.Location.Y;
+ }
resizer.ToDraw = toDraw;
}
}
@@ -111,8 +117,13 @@ namespace Histacom2.Engine.Template
if (e.Button == MouseButtons.Left)
{
var toDraw = resizer.ToDraw;
- if (resizable) if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) toDraw.Width = MousePosition.X - this.Location.X;
- if (resizable) toDraw.Height = MousePosition.Y - this.Location.Y;
+ if (resizable)
+ {
+ if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8)
+ toDraw.Width = MousePosition.X - this.Location.X;
+ toDraw.Height = MousePosition.Y - this.Location.Y;
+ }
+
resizer.ToDraw = toDraw;
}
}
@@ -122,9 +133,15 @@ namespace Histacom2.Engine.Template
if (e.Button == MouseButtons.Left)
{
var toDraw = resizer.ToDraw;
- if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.Width = ((toDraw.Width + toDraw.Location.X) - Cursor.Position.X);
- if (resizable) toDraw.Height = Cursor.Position.Y - this.Location.Y;
- if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.X = Cursor.Position.X;
+ if (resizable)
+ {
+ if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8)
+ {
+ toDraw.Width = ((toDraw.Width + toDraw.Location.X) - Cursor.Position.X);
+ toDraw.X = Cursor.Position.X;
+ }
+ toDraw.Height = Cursor.Position.Y - this.Location.Y;
+ }
resizer.ToDraw = toDraw;
}
}
@@ -134,10 +151,16 @@ namespace Histacom2.Engine.Template
if (e.Button == MouseButtons.Left)
{
var toDraw = resizer.ToDraw;
- if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X);
- if (resizable) if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8) toDraw.X = Cursor.Position.X;
- if (resizable) toDraw.Height = ((this.Height + this.Location.Y) - Cursor.Position.Y);
- if (resizable) toDraw.Y = Cursor.Position.Y;
+ if (resizable)
+ {
+ if (((this.Width + this.Location.X) - Cursor.Position.X) > progContent.MinimumSize.Width + 8)
+ {
+ toDraw.Width = ((this.Width + this.Location.X) - Cursor.Position.X);
+ toDraw.X = Cursor.Position.X;
+ }
+ toDraw.Height = ((this.Height + this.Location.Y) - Cursor.Position.Y);
+ toDraw.Y = Cursor.Position.Y;
+ }
resizer.ToDraw = toDraw;
}
}
@@ -147,8 +170,11 @@ namespace Histacom2.Engine.Template
if(e.Button == MouseButtons.Left)
{
var toDraw = resizer.ToDraw;
- if (resizable) toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y);
- if (resizable) toDraw.Y = Cursor.Position.Y;
+ if (resizable)
+ {
+ toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y);
+ toDraw.Y = Cursor.Position.Y;
+ }
resizer.ToDraw = toDraw;
}
}
@@ -158,9 +184,12 @@ namespace Histacom2.Engine.Template
if (e.Button == MouseButtons.Left)
{
var toDraw = resizer.ToDraw;
- if (resizable) if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) toDraw.Width = MousePosition.X - this.Location.X;
- if (resizable) toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y);
- if (resizable) toDraw.Y = Cursor.Position.Y;
+ if (resizable)
+ {
+ if (MousePosition.X - this.Location.X > progContent.MinimumSize.Width + 8) toDraw.Width = MousePosition.X - this.Location.X;
+ toDraw.Height = ((toDraw.Height + toDraw.Top) - Cursor.Position.Y);
+ toDraw.Y = Cursor.Position.Y;
+ }
resizer.ToDraw = toDraw;
}
}