Skip to content

Commit a3e88e8

Browse files
committed
Merge with main
2 parents ae44722 + 5a9bfd8 commit a3e88e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+25828
-1510
lines changed

Installer Build Script.iss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#define BuildDir SourcePath + "RetailCoder.VBE\bin\release"
1+
#define BuildDir SourcePath + "RetailCoder.VBE\bin\Release"
22
#define AppName "Rubberduck"
33
#define AddinDLL "Rubberduck.dll"
44
#define InspectionsDLL "Rubberduck.Inspections.dll"
5-
#define AppVersion GetFileVersion(SourcePath + "RetailCoder.VBE\bin\release\Rubberduck.dll")
5+
#define AppVersion GetFileVersion(SourcePath + "RetailCoder.VBE\bin\Release\Rubberduck.dll")
66
#define AppPublisher "Rubberduck"
77
#define AppURL "http://rubberduckvba.com"
88
#define License SourcePath + "\License.rtf"
@@ -37,9 +37,9 @@ ArchitecturesInstallIn64BitMode=x64
3737
Name: "English"; MessagesFile: "compiler:Default.isl"
3838

3939
[Files]
40-
; Install the correct bitness binaries.
41-
Source: "libs\NativeBinaries\amd64\*"; DestDir: "{app}"; Flags: ignoreversion; Excludes: "{#AddinDLL}"; Check: Is64BitOfficeInstalled
42-
Source: "libs\NativeBinaries\x86\*"; DestDir: "{app}"; Flags: ignoreversion; Excludes: "{#AddinDLL}"; Check: Is32BitOfficeInstalled
40+
; Install the correct bitness binaries.
41+
Source: "{#BuildDir}\lib\win32\x64\*"; DestDir: "{app}"; Flags: ignoreversion; Excludes: "{#AddinDLL}"; Check: Is64BitOfficeInstalled
42+
Source: "{#BuildDir}\lib\win32\x86\*"; DestDir: "{app}"; Flags: ignoreversion; Excludes: "{#AddinDLL}"; Check: Is32BitOfficeInstalled
4343

4444
Source: "{#BuildDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Excludes: "{#AddinDLL},\NativeBinaries"
4545
Source: "{#BuildDir}\{#InspectionsDLL}"; DestDir: "{app}"; Flags: ignoreversion

RetailCoder.VBE/NLog.xsd

Lines changed: 770 additions & 146 deletions
Large diffs are not rendered by default.

RetailCoder.VBE/Rubberduck.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@
252252
<HintPath>..\packages\HtmlAgilityPack.1.4.9.5\lib\Net45\HtmlAgilityPack.dll</HintPath>
253253
<Private>True</Private>
254254
</Reference>
255-
<Reference Include="ICSharpCode.AvalonEdit">
256-
<HintPath>..\packages\AvalonEdit.5.0.3\lib\Net40\ICSharpCode.AvalonEdit.dll</HintPath>
255+
<Reference Include="ICSharpCode.AvalonEdit, Version=5.0.3.0, Culture=neutral, PublicKeyToken=9cc39be672370310, processorArchitecture=MSIL">
256+
<HintPath>..\packages\AvalonEdit.5.0.4\lib\Net40\ICSharpCode.AvalonEdit.dll</HintPath>
257257
</Reference>
258258
<Reference Include="Infralution.Localization.Wpf">
259259
<HintPath>..\libs\Infralution.Localization.Wpf.dll</HintPath>
@@ -275,6 +275,9 @@
275275
<HintPath>..\libs\Microsoft.Vbe.Interop.Forms.dll</HintPath>
276276
<Private>True</Private>
277277
</Reference>
278+
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
279+
<HintPath>..\packages\NLog.4.4.12\lib\net45\NLog.dll</HintPath>
280+
</Reference>
278281
<Reference Include="PresentationCore" />
279282
<Reference Include="PresentationFramework" />
280283
<Reference Include="PresentationFramework.Aero" />
@@ -308,9 +311,6 @@
308311
<Reference Include="office">
309312
<HintPath>..\libs\Office.dll</HintPath>
310313
</Reference>
311-
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c">
312-
<HintPath>..\packages\NLog.4.0.1\lib\net45\NLog.dll</HintPath>
313-
</Reference>
314314
</ItemGroup>
315315
<ItemGroup>
316316
<Compile Include="API\VBA\Accessibility.cs" />

RetailCoder.VBE/UI/Command/MenuItems/CommandBars/AppCommandBarBase.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,13 @@ public void RemoveCommandBar()
173173
Logger.Debug("Removing commandbar.");
174174
RemoveChildren();
175175
Item?.Delete();
176+
Item?.Release();
176177
Item = null;
177178
Parent = null;
178179
}
179180
catch (COMException exception)
180181
{
181-
Logger.Error(exception, "COM exception while trying to delee the commandbar");
182+
Logger.Error(exception, "COM exception while trying to delete the commandbar");
182183
}
183184
}
184185

@@ -198,6 +199,7 @@ private void RemoveChildren()
198199
button.Click -= child_Click;
199200
}
200201
button.Delete();
202+
button.Release();
201203
}
202204
}
203205
catch (COMException exception)

RetailCoder.VBE/UI/Command/MenuItems/ParentMenus/ParentMenuItemBase.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Diagnostics;
43
using System.Globalization;
54
using System.Linq;
65
using Rubberduck.Parsing.VBA;
@@ -93,6 +92,7 @@ public void RemoveMenu()
9392
Logger.Debug($"Removing menu {_key}.");
9493
RemoveChildren();
9594
Item?.Delete();
95+
Item?.Release();
9696
Item = null;
9797
}
9898

@@ -106,6 +106,7 @@ private void RemoveChildren()
106106
{
107107
child.Click -= child_Click;
108108
child.Delete();
109+
child.Release();
109110
}
110111
}
111112

RetailCoder.VBE/UI/DockableWindowHost.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,16 @@ protected override void DefWndProc(ref Message m)
145145
if (m.Msg == (int) WM.DESTROY)
146146
{
147147
Debug.WriteLine("DockableWindowHost received WM.DESTROY.");
148+
try
149+
{
150+
_subClassingWindow.CallBackEvent -= OnCallBackEvent;
151+
}
152+
catch(Exception)
153+
{
154+
Debug.WriteLine("Failed to unsubscribe event handler from the parent subclassing window of a DockableWindowHost on WM_DESTROY. It might have been unsubscribed already.");
155+
//We cannot really do anything here. This is only a safeguard to guarantee that the event gets unsubscribed. If it does not work, it might be gone already.
156+
}
157+
148158
_thisHandle.Free();
149159
}
150160
base.DefWndProc(ref m);
@@ -200,6 +210,7 @@ public override int SubClassProc(IntPtr hWnd, IntPtr msg, IntPtr wParam, IntPtr
200210
case (uint)WM.KILLFOCUS:
201211
if (!_closing) User32.SendMessage(_vbeHwnd, WM.RUBBERDUCK_CHILD_FOCUS, Hwnd, IntPtr.Zero);
202212
break;
213+
case (uint)WM.DESTROY:
203214
case (uint)WM.RUBBERDUCK_SINKING:
204215
OnCallBackEvent(new SubClassingWindowEventArgs(lParam) { Closing = true });
205216
_closing = true;

RetailCoder.VBE/UI/RegexSearchReplace/RegexSearchReplaceDialog.cs

Lines changed: 0 additions & 94 deletions
This file was deleted.

RetailCoder.VBE/UI/Settings/InspectionSettings.xaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,12 @@
293293
Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=SettingsCaption_ExportSettings}"/>
294294
</Grid>
295295
</StackPanel>
296-
<StackPanel Orientation="Horizontal" DockPanel.Dock="Right"/>
297-
</DockPanel>
296+
<StackPanel Orientation="Horizontal" DockPanel.Dock="Right">
297+
<Label Content="Description Filter"/>
298+
<TextBox MinWidth="75"
299+
Text="{Binding InspectionSettingsFilter, UpdateSourceTrigger=PropertyChanged}"/>
300+
</StackPanel>
301+
</DockPanel>
298302
</Label>
299303
<Border BorderBrush="DarkGray" BorderThickness="1" CornerRadius="2">
300304
<controls:GroupingGrid ItemsSource="{Binding InspectionSettings}"

RetailCoder.VBE/UI/Settings/InspectionSettingsViewModel.cs

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ public class InspectionSettingsViewModel : SettingsViewModelBase, ISettingsViewM
1515
public InspectionSettingsViewModel(Configuration config)
1616
{
1717
InspectionSettings = new ListCollectionView(
18-
config.UserSettings.CodeInspectionSettings.CodeInspections.ToList());
18+
config.UserSettings.CodeInspectionSettings.CodeInspections
19+
.OrderBy(inspection => inspection.TypeLabel)
20+
.ThenBy(inspection => inspection.Description)
21+
.ToList());
1922

2023
WhitelistedIdentifierSettings = new ObservableCollection<WhitelistedIdentifierSetting>(
2124
config.UserSettings.CodeInspectionSettings.WhitelistedIdentifiers.OrderBy(o => o.Identifier).Distinct());
@@ -39,10 +42,36 @@ public void UpdateCollection(CodeInspectionSeverity severity)
3942
InspectionSettings.CommitEdit();
4043
}
4144

45+
private string _inspectionSettingsFilter;
46+
public string InspectionSettingsFilter
47+
{
48+
get => _inspectionSettingsFilter;
49+
set
50+
{
51+
if (_inspectionSettingsFilter != value)
52+
{
53+
_inspectionSettingsFilter = value;
54+
OnPropertyChanged(nameof(InspectionSettings));
55+
}
56+
}
57+
}
58+
4259
private ListCollectionView _inspectionSettings;
4360
public ListCollectionView InspectionSettings
4461
{
45-
get => _inspectionSettings;
62+
get
63+
{
64+
if (string.IsNullOrEmpty(_inspectionSettingsFilter))
65+
{
66+
_inspectionSettings.Filter = null;
67+
}
68+
else
69+
{
70+
_inspectionSettings.Filter = filter => FilterInspectionSettings(filter);
71+
}
72+
return _inspectionSettings;
73+
}
74+
4675
set
4776
{
4877
if (_inspectionSettings != value)
@@ -53,6 +82,12 @@ public ListCollectionView InspectionSettings
5382
}
5483
}
5584

85+
private bool FilterInspectionSettings(object filter)
86+
{
87+
var cis = filter as CodeInspectionSetting;
88+
return cis.Description.ToUpper().Contains(_inspectionSettingsFilter.ToUpper());
89+
}
90+
5691
private bool _runInspectionsOnSuccessfulParse;
5792
public bool RunInspectionsOnSuccessfulParse
5893
{

RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ private void InitRepo()
663663

664664
private void SetChildPresenterSourceControlProviders(ISourceControlProvider provider)
665665
{
666-
if (Provider.CurrentBranch == null)
666+
if (Provider?.CurrentBranch == null)
667667
{
668668
HandleViewModelError(null,
669669
new ErrorEventArgs(RubberduckUI.SourceControl_NoBranchesTitle, RubberduckUI.SourceControl_NoBranchesMessage, NotificationType.Error));

0 commit comments

Comments
 (0)