Skip to content

Commit f81dd86

Browse files
authored
Merge branch 'next' into ninjectMemoryLeaks
2 parents 4ccf9cc + 9340a52 commit f81dd86

File tree

6 files changed

+49
-38
lines changed

6 files changed

+49
-38
lines changed

RetailCoder.VBE/Inspections/InspectionsUI.fr.resx

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<root>
33
<!--
44
Microsoft ResX Schema
@@ -59,7 +59,7 @@
5959
: using a System.ComponentModel.TypeConverter
6060
: and then encoded with base64 encoding.
6161
-->
62-
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
62+
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
6363
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
6464
<xsd:element name="root" msdata:IsDataSet="true">
6565
<xsd:complexType>
@@ -303,9 +303,6 @@
303303
<data name="UnassignedVariableUsageInspectionName" xml:space="preserve">
304304
<value>La variable est utilisée, mais non assignée</value>
305305
</data>
306-
<data name="UntypedFunctionUsageInspectionMeta" xml:space="preserve">
307-
<value>Une fonction équivalente existe, qui retourne une valeur 'String' et pourrait éviter une conversion implicite de type.</value>
308-
</data>
309306
<data name="UntypedFunctionUsageInspectionName" xml:space="preserve">
310307
<value>Utilisation d'une fonction retournant une 'String' dans une variable 'Variant'</value>
311308
</data>
@@ -494,64 +491,67 @@
494491
<data name="DisableThisInspection" xml:space="preserve">
495492
<value>Désactiver cette inspection</value>
496493
</data>
497-
<data name="InvalidContextTypeInspectionFix">
494+
<data name="InvalidContextTypeInspectionFix" xml:space="preserve">
498495
<value>Le type de contexte '{0}' est invalide pour {1}.</value>
499496
</data>
500-
<data name="SetObjectVariableQuickFix">
497+
<data name="SetObjectVariableQuickFix" xml:space="preserve">
501498
<value>Utiliser le mot-clé 'Set'</value>
502499
</data>
503-
<data name="QualifiedSelectionInspection">
500+
<data name="QualifiedSelectionInspection" xml:space="preserve">
504501
<value>{0}: {1} - {2} {3}.{4}, ligne {5}</value>
505502
</data>
506-
<data name="ObjectVariableNotSetInspectionName">
503+
<data name="ObjectVariableNotSetInspectionName" xml:space="preserve">
507504
<value>L'assignation d'une référence d'objet requiert le mot-clé 'Set'</value>
508505
</data>
509-
<data name="EmptyStringLiteralInspectionResultFormat">
506+
<data name="EmptyStringLiteralInspectionResultFormat" xml:space="preserve">
510507
<value>Préférez 'vbNullString' à une chaîne de caractères vide</value>
511508
</data>
512-
<data name="ObjectVariableNotSetInspectionResultFormat">
509+
<data name="ObjectVariableNotSetInspectionResultFormat" xml:space="preserve">
513510
<value>La variable '{0}' est assignée dans le mot-clé 'Set'</value>
514511
</data>
515-
<data name="ObjectVariableNotSetInspectionMeta">
512+
<data name="ObjectVariableNotSetInspectionMeta" xml:space="preserve">
516513
<value>Rubberduck voit cette variable comme étant une référence à un objet, assignée sans le mot-clé 'Set'. Ceci cause une erreur d'exécution (#91 'Object or With block variable not set').</value>
517514
</data>
518-
<data name="ImplicitActiveWorkbookReferenceInspectionResultFormat">
515+
<data name="ImplicitActiveWorkbookReferenceInspectionResultFormat" xml:space="preserve">
519516
<value>Le membre '{0}' réfère implicitement au classeur actif</value>
520517
</data>
521-
<data name="MultipleDeclarationsInspectionResultFormat">
518+
<data name="MultipleDeclarationsInspectionResultFormat" xml:space="preserve">
522519
<value>L'instruction comporte plusieurs déclarations</value>
523520
</data>
524-
<data name="Inspections_Usage">
521+
<data name="Inspections_Usage" xml:space="preserve">
525522
<value>Utilisation</value>
526523
</data>
527-
<data name="Inspections_Declaration">
524+
<data name="Inspections_Declaration" xml:space="preserve">
528525
<value>Déclaration</value>
529526
</data>
530-
<data name="VariableTypeNotDeclaredInspectionResultFormat">
527+
<data name="VariableTypeNotDeclaredInspectionResultFormat" xml:space="preserve">
531528
<value>{0} '{1}' est implicitement de type 'Variant'</value>
532529
</data>
533-
<data name="DefaultProjectNameInspectionResultFormat">
530+
<data name="DefaultProjectNameInspectionResultFormat" xml:space="preserve">
534531
<value>Le projet '{0}' n'est pas nommé</value>
535532
</data>
536-
<data name="ObsoleteCallStatementInspectionResultFormat">
533+
<data name="ObsoleteCallStatementInspectionResultFormat" xml:space="preserve">
537534
<value>L'assignation utilise le mot-clé obsolète 'Call'</value>
538535
</data>
539-
<data name="ObsoleteLetStatementInspectionResultFormat">
536+
<data name="ObsoleteLetStatementInspectionResultFormat" xml:space="preserve">
540537
<value>L'assignation utilise le mot-clé obsolète 'Let'</value>
541538
</data>
542-
<data name="OptionBaseInspectionResultFormat">
539+
<data name="OptionBaseInspectionResultFormat" xml:space="preserve">
543540
<value>Le module '{0}' utilise 'Option Base 1'</value>
544541
</data>
545-
<data name="ObsoleteCommentSyntaxInspectionResultFormat">
542+
<data name="ObsoleteCommentSyntaxInspectionResultFormat" xml:space="preserve">
546543
<value>Le commentaire utilise la forme obsolète 'Rem'</value>
547544
</data>
548-
<data name="ObsoleteTypeHintInspectionResultFormat">
545+
<data name="ObsoleteTypeHintInspectionResultFormat" xml:space="preserve">
549546
<value>{0} de {1} '{2}' utilise un indicateur de type</value>
550547
</data>
551-
<data name="ImplicitActiveSheetReferenceInspectionResultFormat">
548+
<data name="ImplicitActiveSheetReferenceInspectionResultFormat" xml:space="preserve">
552549
<value>Le membre '{0}' réfère implicitement à la feuille active</value>
553550
</data>
554-
<data name="UntypedFunctionUsageInspectionResultFormat">
551+
<data name="UntypedFunctionUsageInspectionResultFormat" xml:space="preserve">
555552
<value>Remplacer la fonction '{0}' par la fonction typée équivalente</value>
556553
</data>
557-
</root>
554+
<data name="UntypedFunctionUsageInspectionMeta" xml:space="preserve">
555+
<value />
556+
</data>
557+
</root>

RetailCoder.VBE/UI/Settings/InspectionSettings.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@
340340
<ToolBar Style="{DynamicResource ToolBarWithOverflowOnlyShowingWhenNeededStyle}"
341341
Background="Transparent">
342342
<Button ToolTip="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=Add}"
343-
Command="{Binding AddWhitelistedNameCommand}"
343+
Click="AddNewItem"
344344
BorderThickness="0"
345345
Background="Transparent">
346346
<StackPanel Orientation="Horizontal">

RetailCoder.VBE/UI/Settings/InspectionSettings.xaml.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ private void GroupingGrid_CellEditEnding(object sender, DataGridCellEditEndingEv
3131
var selectedSeverityName = ((ComboBox) e.EditingElement).SelectedItem.ToString();
3232

3333
var severities = Enum.GetValues(typeof(CodeInspectionSeverity)).Cast<CodeInspectionSeverity>();
34-
var selectedSeverity = severities.Single(s => RubberduckUI.ResourceManager.GetString("CodeInspectionSeverity_" + s, UI.Settings.Settings.Culture) == selectedSeverityName);
34+
var selectedSeverity = severities.Single(s => RubberduckUI.ResourceManager.GetString("CodeInspectionSeverity_" + s, Settings.Culture) == selectedSeverityName);
3535

3636
((InspectionSettingsViewModel) ViewModel).UpdateCollection(selectedSeverity);
3737
}
@@ -48,5 +48,12 @@ private void WhitelistedIdentifierGrid_CellEditEnding(object sender, DataGridCel
4848

4949
((InspectionSettingsViewModel)ViewModel).WhitelistedIdentifierSettings = new ObservableCollection<WhitelistedIdentifierSetting>(identifiers);
5050
}
51+
52+
private void AddNewItem(object sender, System.Windows.RoutedEventArgs e)
53+
{
54+
WhitelistedIdentifiersGrid.CommitEdit();
55+
((InspectionSettingsViewModel) ViewModel).AddWhitelistedNameCommand.Execute(null);
56+
e.Handled = true;
57+
}
5158
}
5259
}

RetailCoder.VBE/UI/Settings/TodoSettings.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@
266266
<ToolBar Style="{DynamicResource ToolBarWithOverflowOnlyShowingWhenNeededStyle}"
267267
Background="Transparent">
268268
<Button ToolTip="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=Add}"
269-
Command="{Binding AddTodoCommand}"
269+
Click="AddNewTodoMarker"
270270
BorderThickness="0"
271271
Background="Transparent">
272272
<StackPanel Orientation="Horizontal">

RetailCoder.VBE/UI/Settings/TodoSettings.xaml.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,12 @@ private void TodoMarkerGrid_CellEditEnding(object sender, DataGridCellEditEnding
3535

3636
((TodoSettingsViewModel)ViewModel).TodoSettings = new ObservableCollection<ToDoMarker>(markers);
3737
}
38+
39+
private void AddNewTodoMarker(object sender, System.Windows.RoutedEventArgs e)
40+
{
41+
TodoMarkerGrid.CommitEdit();
42+
((TodoSettingsViewModel) ViewModel).AddTodoCommand.Execute(null);
43+
e.Handled = true;
44+
}
3845
}
3946
}

Rubberduck.Parsing/VBA/RubberduckParserState.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,6 @@ private void ClearStateCache(string projectId, bool notifyStateChanged = false)
637637
{
638638
try
639639
{
640-
var qualifiedModuleName = new QualifiedModuleName();
641-
642640
foreach (var moduleState in _moduleStates)
643641
{
644642
if (moduleState.Key.ProjectId == projectId && moduleState.Key.Component != null)
@@ -651,15 +649,14 @@ private void ClearStateCache(string projectId, bool notifyStateChanged = false)
651649
else if (moduleState.Key.ProjectId == projectId && moduleState.Key.Component == null)
652650
{
653651
// store project module name
654-
qualifiedModuleName = moduleState.Key;
652+
var qualifiedModuleName = moduleState.Key;
653+
ModuleState state;
654+
if (_moduleStates.TryRemove(qualifiedModuleName, out state))
655+
{
656+
state.Dispose();
657+
}
655658
}
656659
}
657-
658-
ModuleState state;
659-
if (_moduleStates.TryRemove(qualifiedModuleName, out state))
660-
{
661-
state.Dispose();
662-
}
663660
}
664661
catch (COMException)
665662
{

0 commit comments

Comments
 (0)