Skip to content

Commit e50dec8

Browse files
committed
Merge pull request #628 from Hosch250/next
Fix #602 for Office 2013 x64
2 parents 5959f0a + c2f2b96 commit e50dec8

File tree

7 files changed

+15
-14
lines changed

7 files changed

+15
-14
lines changed

RetailCoder.VBE/UI/CodeExplorer/CodeExplorerDockablePresenter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ private void NavigateExplorerTreeNode(object sender, TreeNodeNavigateCodeEventAr
241241
var declaration = e.Declaration;
242242
if (declaration != null)
243243
{
244-
VBE.SetSelection(declaration.QualifiedSelection);
244+
VBE.SetSelection(declaration.QualifiedName.QualifiedModuleName.Project, declaration.Selection, declaration.QualifiedName.QualifiedModuleName.Component.Name);
245245
}
246246
}
247247

RetailCoder.VBE/UI/CodeInspections/CodeInspectionsDockablePresenter.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,8 @@ private async void Refresh()
187187
{
188188
Control.SetIssuesStatus(_issues, true);
189189
Control.EnableRefresh();
190+
Control.Cursor = Cursors.Default;
190191
}
191-
192-
Control.Cursor = Cursors.Default;
193192
}
194193

195194
private async Task RefreshAsync(CancellationToken token)

RetailCoder.VBE/UI/IdentifierReferences/IdentifierReferencesListDockablePresenter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ private void BindTarget(Declaration target)
2525

2626
public static void OnNavigateIdentifierReference(VBE vbe, IdentifierReference reference)
2727
{
28-
vbe.SetSelection(new QualifiedSelection(reference.QualifiedModuleName, reference.Selection));
28+
vbe.SetSelection(reference.QualifiedModuleName.Project, reference.Selection, reference.QualifiedModuleName.Component.Name);
2929
}
3030

3131
private void ControlNavigate(object sender, ListItemActionEventArgs e)

RetailCoder.VBE/UI/IdentifierReferences/ImplementationsListDockablePresenter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ private void BindTarget(IEnumerable<Declaration> implementations)
2626

2727
public static void OnNavigateImplementation(VBE vbe, Declaration implementation)
2828
{
29-
vbe.SetSelection(new QualifiedSelection(implementation.QualifiedName.QualifiedModuleName, implementation.Selection));
29+
vbe.SetSelection(implementation.QualifiedName.QualifiedModuleName.Project, implementation.Selection, implementation.QualifiedName.QualifiedModuleName.Component.Name);
3030
}
3131

3232
private void ControlNavigate(object sender, ListItemActionEventArgs e)

RetailCoder.VBE/UI/ToDoItems/ToDoExplorerDockablePresenter.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ public async void Refresh()
4949
Cursor.Current = Cursors.WaitCursor;
5050
_view.TodoItems = await GetItems();
5151
}
52-
//wtf? why are we catching everything without even so much as leaving a comment as to why?
53-
catch { }
54-
55-
Cursor.Current = Cursors.Default;
52+
finally
53+
{
54+
Cursor.Current = Cursors.Default;
55+
}
5656
}
5757

5858
private void RefreshToDoList(object sender, EventArgs e)

Rubberduck.SourceControl/SourceControlProviderBase.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.IO;
44
using System.Linq;
55
using Microsoft.Vbe.Interop;
6+
using Rubberduck.VBEditor;
67
using Rubberduck.VBEditor.Extensions;
78

89
namespace Rubberduck.SourceControl
@@ -119,11 +120,12 @@ private void Refresh()
119120
//Because refreshing removes all components, we need to store the current selection,
120121
// so we can correctly reset it once the files are imported from the repository.
121122
var selection = Project.VBE.ActiveCodePane.GetSelection();
123+
var name = selection.QualifiedName.Component.Name;
122124

123125
Project.RemoveAllComponents();
124126
Project.ImportSourceFiles(CurrentRepository.LocalLocation);
125127

126-
Project.VBE.SetSelection(selection);
128+
Project.VBE.SetSelection(selection.QualifiedName.Project, selection.Selection, name);
127129
}
128130
}
129131
}

Rubberduck.VBEEditor/Extensions/VbeExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@ namespace Rubberduck.VBEditor.Extensions
66
{
77
public static class VbeExtensions
88
{
9-
public static void SetSelection(this VBE vbe, QualifiedSelection selection)
9+
public static void SetSelection(this VBE vbe, VBProject vbProject, Selection selection, string name)
1010
{
1111
var project = vbe.VBProjects.Cast<VBProject>()
1212
.SingleOrDefault(p => p.Protection != vbext_ProjectProtection.vbext_pp_locked
13-
&& ReferenceEquals(p, selection.QualifiedName.Project));
13+
&& ReferenceEquals(p, vbProject));
1414

1515
VBComponent component = null;
1616
if (project != null)
1717
{
1818
component = project.VBComponents.Cast<VBComponent>()
19-
.SingleOrDefault(c => c.Name == selection.QualifiedName.Component.Name);
19+
.SingleOrDefault(c => c.Name == name);
2020
}
2121

2222
if (component == null)
2323
{
2424
return;
2525
}
2626

27-
component.CodeModule.CodePane.SetSelection(selection.Selection);
27+
component.CodeModule.CodePane.SetSelection(selection);
2828
}
2929

3030
public static CodeModuleSelection FindInstruction(this VBE vbe, QualifiedModuleName qualifiedModuleName, Selection selection)

0 commit comments

Comments
 (0)