From af31e3551288b8a49b4c3c4d1bdabc0e62f216a3 Mon Sep 17 00:00:00 2001 From: VioletGiraffe Date: Tue, 19 Mar 2019 19:42:43 +0200 Subject: [PATCH] Code formatting, v. 1.3.6 --- CPPCheckPlugin/MainToolWindowUI.xaml.cs | 196 +++++++++---------- CPPCheckPlugin/app.config | 78 ++++---- CPPCheckPlugin/source.extension.vsixmanifest | 2 +- 3 files changed, 138 insertions(+), 138 deletions(-) diff --git a/CPPCheckPlugin/MainToolWindowUI.xaml.cs b/CPPCheckPlugin/MainToolWindowUI.xaml.cs index 5060025..de2cbcd 100644 --- a/CPPCheckPlugin/MainToolWindowUI.xaml.cs +++ b/CPPCheckPlugin/MainToolWindowUI.xaml.cs @@ -38,8 +38,8 @@ public class OpenProblemInEditorEventArgs : EventArgs private static int iconSize = 20; - private GridViewColumnHeader listViewSortCol = null; - private SortAdorner listViewSortAdorner = null; + private GridViewColumnHeader listViewSortCol = null; + private SortAdorner listViewSortAdorner = null; public MainToolWindowUI() { @@ -127,54 +127,54 @@ public static TParent FindVisualParent(DependencyObject obj) wh return obj as TParent; } - private void problemColumnHeader_Click(object sender, RoutedEventArgs e) - { - GridViewColumnHeader column = (sender as GridViewColumnHeader); - string sortBy = column.Tag.ToString(); - - ClearSorting(); - - ListSortDirection newDir = ListSortDirection.Ascending; - if (listViewSortCol == column && listViewSortAdorner.Direction == newDir) - { - newDir = ListSortDirection.Descending; - } - - listViewSortCol = column; - listViewSortAdorner = new SortAdorner(listViewSortCol, newDir); - AdornerLayer.GetAdornerLayer(listViewSortCol).Add(listViewSortAdorner); - - if (sortBy == "Severity") - { - listView.Items.SortDescriptions.Add(new SortDescription(sortBy, newDir)); - listView.Items.SortDescriptions.Add(new SortDescription("FileName", ListSortDirection.Ascending)); - listView.Items.SortDescriptions.Add(new SortDescription("Line", ListSortDirection.Ascending)); - } - else if (sortBy == "FileName") - { - listView.Items.SortDescriptions.Add(new SortDescription(sortBy, newDir)); - listView.Items.SortDescriptions.Add(new SortDescription("Line", ListSortDirection.Ascending)); - } - else if (sortBy == "Message") - { - listView.Items.SortDescriptions.Add(new SortDescription(sortBy, newDir)); - listView.Items.SortDescriptions.Add(new SortDescription("FileName", ListSortDirection.Ascending)); - listView.Items.SortDescriptions.Add(new SortDescription("Line", ListSortDirection.Ascending)); - } - else - { - listView.Items.SortDescriptions.Add(new SortDescription(sortBy, newDir)); - } - } - - public void ClearSorting() - { - if(listViewSortCol != null) - { - AdornerLayer.GetAdornerLayer(listViewSortCol).Remove(listViewSortAdorner); - listView.Items.SortDescriptions.Clear(); - } - } + private void problemColumnHeader_Click(object sender, RoutedEventArgs e) + { + GridViewColumnHeader column = (sender as GridViewColumnHeader); + string sortBy = column.Tag.ToString(); + + ClearSorting(); + + ListSortDirection newDir = ListSortDirection.Ascending; + if (listViewSortCol == column && listViewSortAdorner.Direction == newDir) + { + newDir = ListSortDirection.Descending; + } + + listViewSortCol = column; + listViewSortAdorner = new SortAdorner(listViewSortCol, newDir); + AdornerLayer.GetAdornerLayer(listViewSortCol).Add(listViewSortAdorner); + + if (sortBy == "Severity") + { + listView.Items.SortDescriptions.Add(new SortDescription(sortBy, newDir)); + listView.Items.SortDescriptions.Add(new SortDescription("FileName", ListSortDirection.Ascending)); + listView.Items.SortDescriptions.Add(new SortDescription("Line", ListSortDirection.Ascending)); + } + else if (sortBy == "FileName") + { + listView.Items.SortDescriptions.Add(new SortDescription(sortBy, newDir)); + listView.Items.SortDescriptions.Add(new SortDescription("Line", ListSortDirection.Ascending)); + } + else if (sortBy == "Message") + { + listView.Items.SortDescriptions.Add(new SortDescription(sortBy, newDir)); + listView.Items.SortDescriptions.Add(new SortDescription("FileName", ListSortDirection.Ascending)); + listView.Items.SortDescriptions.Add(new SortDescription("Line", ListSortDirection.Ascending)); + } + else + { + listView.Items.SortDescriptions.Add(new SortDescription(sortBy, newDir)); + } + } + + public void ClearSorting() + { + if (listViewSortCol != null) + { + AdornerLayer.GetAdornerLayer(listViewSortCol).Remove(listViewSortAdorner); + listView.Items.SortDescriptions.Clear(); + } + } public class ProblemsListItem { @@ -199,10 +199,10 @@ public int Line get { return _problem.Line; } } - public Problem.SeverityLevel Severity - { - get { return _problem.Severity; } - } + public Problem.SeverityLevel Severity + { + get { return _problem.Severity; } + } public ImageSource Icon { @@ -259,15 +259,15 @@ public Problem Problem Problem _problem; } - private void ListView_SelectionChanged() - { - } - private void ListView_SelectionChanged_1(object sender, SelectionChangedEventArgs e) - { - } - private void ListView_SelectionChanged_2(object sender, SelectionChangedEventArgs e) - { - } + private void ListView_SelectionChanged() + { + } + private void ListView_SelectionChanged_1(object sender, SelectionChangedEventArgs e) + { + } + private void ListView_SelectionChanged_2(object sender, SelectionChangedEventArgs e) + { + } } public class DeleteObjectInvoker @@ -276,39 +276,39 @@ public class DeleteObjectInvoker public static extern bool DeleteObject(IntPtr hObject); } - public class SortAdorner : Adorner - { - private static Geometry ascGeometry = Geometry.Parse("M 0 4 L 3.5 0 L 7 4 Z"); - private static Geometry descGeometry = Geometry.Parse("M 0 0 L 3.5 4 L 7 0 Z"); - - public ListSortDirection Direction { get; private set; } - - public SortAdorner(UIElement element, ListSortDirection dir) - : base(element) - { - this.Direction = dir; - } - - protected override void OnRender(DrawingContext drawingContext) - { - base.OnRender(drawingContext); - - if (AdornedElement.RenderSize.Width < 20) - { - return; - } - - TranslateTransform transform = new TranslateTransform(AdornedElement.RenderSize.Width - 15, (AdornedElement.RenderSize.Height - 5) / 2); - drawingContext.PushTransform(transform); - - Geometry geometry = ascGeometry; - if (this.Direction == ListSortDirection.Descending) - { - geometry = descGeometry; - } - drawingContext.DrawGeometry(System.Windows.Media.Brushes.Black, null, geometry); - - drawingContext.Pop(); - } - } + public class SortAdorner : Adorner + { + private static Geometry ascGeometry = Geometry.Parse("M 0 4 L 3.5 0 L 7 4 Z"); + private static Geometry descGeometry = Geometry.Parse("M 0 0 L 3.5 4 L 7 0 Z"); + + public ListSortDirection Direction { get; private set; } + + public SortAdorner(UIElement element, ListSortDirection dir) + : base(element) + { + this.Direction = dir; + } + + protected override void OnRender(DrawingContext drawingContext) + { + base.OnRender(drawingContext); + + if (AdornedElement.RenderSize.Width < 20) + { + return; + } + + TranslateTransform transform = new TranslateTransform(AdornedElement.RenderSize.Width - 15, (AdornedElement.RenderSize.Height - 5) / 2); + drawingContext.PushTransform(transform); + + Geometry geometry = ascGeometry; + if (this.Direction == ListSortDirection.Descending) + { + geometry = descGeometry; + } + drawingContext.DrawGeometry(System.Windows.Media.Brushes.Black, null, geometry); + + drawingContext.Pop(); + } + } } diff --git a/CPPCheckPlugin/app.config b/CPPCheckPlugin/app.config index 0170c2d..07440f5 100644 --- a/CPPCheckPlugin/app.config +++ b/CPPCheckPlugin/app.config @@ -1,41 +1,41 @@ - - -
- - - - - - - - C:\Program Files (x86)\Cppcheck\cppcheck.exe - C:\Program Files\Cppcheck\cppcheck.exe - - - - - False - - - - - - False - - - True - - - style,information,warning,performance,portability - - - unmatchedSuppression - - - False - - - - + + +
+ + + + + + + + C:\Program Files (x86)\Cppcheck\cppcheck.exe + C:\Program Files\Cppcheck\cppcheck.exe + + + + + False + + + + + + False + + + True + + + style,information,warning,performance,portability + + + unmatchedSuppression + + + False + + + + diff --git a/CPPCheckPlugin/source.extension.vsixmanifest b/CPPCheckPlugin/source.extension.vsixmanifest index a1880ad..5dcbe5c 100644 --- a/CPPCheckPlugin/source.extension.vsixmanifest +++ b/CPPCheckPlugin/source.extension.vsixmanifest @@ -1,7 +1,7 @@  - + cppcheck add-in Integration for cppcheck - C/C++ code static analysis tool PackageInstallerLicense.txt