From 13ba150deb58f7777e087e8875642708a03112ff Mon Sep 17 00:00:00 2001 From: Robin Date: Thu, 26 Jan 2017 09:07:30 +0100 Subject: [PATCH] BUG-2125: Fixed OneNote export, COM interaction needs a default value for out arguments. --- GreenshotOfficePlugin/OfficeExport/OneNoteExporter.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/GreenshotOfficePlugin/OfficeExport/OneNoteExporter.cs b/GreenshotOfficePlugin/OfficeExport/OneNoteExporter.cs index 68619db38..98ee9f834 100644 --- a/GreenshotOfficePlugin/OfficeExport/OneNoteExporter.cs +++ b/GreenshotOfficePlugin/OfficeExport/OneNoteExporter.cs @@ -106,10 +106,12 @@ namespace Greenshot.Interop.Office { if(oneNoteApplication == null) { return null; } - string unfiledNotesPath; + // ReSharper disable once RedundantAssignment + string unfiledNotesPath = ""; oneNoteApplication.GetSpecialLocation(specialLocation, out unfiledNotesPath); - string notebookXml; + // ReSharper disable once RedundantAssignment + string notebookXml = ""; oneNoteApplication.GetHierarchy("", HierarchyScope.hsPages, out notebookXml, XMLSchema.xs2010); if(!string.IsNullOrEmpty(notebookXml)) { Log.Debug(notebookXml); @@ -144,7 +146,8 @@ namespace Greenshot.Interop.Office { try { using (IOneNoteApplication oneNoteApplication = COMWrapper.GetOrCreateInstance()) { if (oneNoteApplication != null) { - string notebookXml; + // ReSharper disable once RedundantAssignment + string notebookXml = ""; oneNoteApplication.GetHierarchy("", HierarchyScope.hsPages, out notebookXml, XMLSchema.xs2010); if (!string.IsNullOrEmpty(notebookXml)) { Log.Debug(notebookXml); @@ -215,7 +218,7 @@ namespace Greenshot.Interop.Office { if(p1.IsCurrentlyViewed || p2.IsCurrentlyViewed) { return p2.IsCurrentlyViewed.CompareTo(p1.IsCurrentlyViewed); } - return String.Compare(p1.DisplayName, p2.DisplayName, StringComparison.Ordinal); + return string.Compare(p1.DisplayName, p2.DisplayName, StringComparison.Ordinal); }); return pages; }