소스 검색

Fixed build warnings and ensured tests run

Charlie Kindel 4 년 전
부모
커밋
9c0a8529a6
5개의 변경된 파일7개의 추가작업 그리고 7개의 파일을 삭제
  1. 1 1
      Terminal.Gui/Core/Toplevel.cs
  2. 2 2
      Terminal.Gui/Core/View.cs
  3. 1 1
      Terminal.Gui/Core/Window.cs
  4. 1 1
      Terminal.Gui/Views/FrameView.cs
  5. 2 2
      UnitTests/UnitTests.csproj

+ 1 - 1
Terminal.Gui/Core/Toplevel.cs

@@ -386,7 +386,7 @@ namespace Terminal.Gui {
 			Application.CurrentView = this;
 
 			if (IsCurrentTop || this == Application.Top) {
-				if (NeedDisplay != null && !NeedDisplay.IsEmpty) {
+				if (!NeedDisplay.IsEmpty) {
 					Driver.SetAttribute (Colors.TopLevel.Normal);
 
 					// This is the Application.Top. Clear just the region we're being asked to redraw 

+ 2 - 2
Terminal.Gui/Core/View.cs

@@ -672,7 +672,7 @@ namespace Terminal.Gui {
 		/// <param name="region">The view-relative region that must be flagged for repaint.</param>
 		public void SetNeedsDisplay (Rect region)
 		{
-			if (NeedDisplay == null || NeedDisplay.IsEmpty)
+			if (NeedDisplay.IsEmpty)
 				NeedDisplay = region;
 			else {
 				var x = Math.Min (NeedDisplay.X, region.X);
@@ -1290,7 +1290,7 @@ namespace Terminal.Gui {
 
 			if (subviews != null) {
 				foreach (var view in subviews) {
-					if (view.NeedDisplay != null && (!view.NeedDisplay.IsEmpty || view.childNeedsDisplay)) {
+					if (!view.NeedDisplay.IsEmpty || view.childNeedsDisplay) {
 						if (view.Frame.IntersectsWith (clipRect) && (view.Frame.IntersectsWith (bounds) || bounds.X < 0 || bounds.Y < 0)) {
 							if (view.layoutNeeded)
 								view.LayoutSubviews ();

+ 1 - 1
Terminal.Gui/Core/Window.cs

@@ -173,7 +173,7 @@ namespace Terminal.Gui {
 			var scrRect = ViewToScreen (new Rect (0, 0, Frame.Width, Frame.Height));
 
 			// BUGBUG: Why do we draw the frame twice? This call is here to clear the content area, I think. Why not just clear that area?
-			if (NeedDisplay != null && !NeedDisplay.IsEmpty) {
+			if (!NeedDisplay.IsEmpty) {
 				Driver.SetAttribute (ColorScheme.Normal);
 				Driver.DrawWindowFrame (scrRect, padding + 1, padding + 1, padding + 1, padding + 1, border: true, fill: true);
 			}

+ 1 - 1
Terminal.Gui/Views/FrameView.cs

@@ -150,7 +150,7 @@ namespace Terminal.Gui {
 			Application.CurrentView = this;
 			var scrRect = ViewToScreen (new Rect (0, 0, Frame.Width, Frame.Height));
 
-			if (NeedDisplay != null && !NeedDisplay.IsEmpty) {
+			if (!NeedDisplay.IsEmpty) {
 				Driver.SetAttribute (ColorScheme.Normal);
 				Driver.DrawWindowFrame (scrRect, padding + 1, padding + 1, padding + 1, padding + 1, border: true, fill: true);
 			}

+ 2 - 2
UnitTests/UnitTests.csproj

@@ -14,10 +14,10 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
     <PackageReference Include="System.Collections" Version="4.3.0" />
     <PackageReference Include="xunit" Version="2.4.1" />
-    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
+    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>