Skip to content

Commit

Permalink
Merge branch 'release-7.2.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
bovender committed Dec 22, 2016
2 parents 7527299 + 3556c57 commit fda7f40
Show file tree
Hide file tree
Showing 24 changed files with 459 additions and 385 deletions.
4 changes: 2 additions & 2 deletions Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("7.2.5.0")]
[assembly: AssemblyFileVersion("7.2.5.0")]
[assembly: AssemblyVersion("7.2.6.0")]
[assembly: AssemblyFileVersion("7.2.6.0")]
8 changes: 4 additions & 4 deletions Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@
</ProjectReference>
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'Debug %28Bovender via NuGet%29'">
<Reference Include="Bovender, Version=0.15.1.0, Culture=neutral, PublicKeyToken=df1c15557d8b6df8, processorArchitecture=MSIL">
<Reference Include="Bovender, Version=0.16.0.0, Culture=neutral, PublicKeyToken=df1c15557d8b6df8, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Bovender.0.15.1.0\lib\net40\Bovender.dll</HintPath>
<HintPath>..\packages\Bovender.0.16.0.0\lib\net40\Bovender.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'Release'">
<Reference Include="Bovender, Version=0.15.1.0, Culture=neutral, PublicKeyToken=df1c15557d8b6df8, processorArchitecture=MSIL">
<Reference Include="Bovender, Version=0.16.0.0, Culture=neutral, PublicKeyToken=df1c15557d8b6df8, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Bovender.0.15.1.0\lib\net40\Bovender.dll</HintPath>
<HintPath>..\packages\Bovender.0.16.0.0\lib\net40\Bovender.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Tests/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
limitations under the License.
-->
<packages>
<package id="Bovender" version="0.15.1.0" targetFramework="net40" />
<package id="Bovender" version="0.16.0.0" targetFramework="net40" />
<package id="Expression.Blend.Sdk" version="1.0.2" targetFramework="net40" />
<package id="NLog" version="4.3.7" targetFramework="net40" />
<package id="NUnitTestAdapter" version="2.0.0" targetFramework="net40" />
Expand Down
4 changes: 2 additions & 2 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
7.2.5
7.2.5.0
7.2.6
7.2.6.0
16 changes: 9 additions & 7 deletions XLToolbox/Csv/CsvExportViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,15 @@ private CsvExporter CsvExporter
private void DoChooseFileName()
{
Logger.Info("DoChooseFileName: Retrieving previous settings");
WorkbookStorage.Store store = new WorkbookStorage.Store();
string defaultPath = UserSettings.UserSettings.Default.CsvPath;
Logger.Info("DoChooseFileName: Sending ChooseExportFileNameMessage");
ChooseExportFileNameMessage.Send(
new FileNameMessageContent(store.Get("csv_path", defaultPath),
"CSV files|*.csv;*.txt;*.dat|All files|*.*"),
ConfirmChooseFileName);
using (WorkbookStorage.Store store = new WorkbookStorage.Store())
{
string defaultPath = UserSettings.UserSettings.Default.CsvPath;
Logger.Info("DoChooseFileName: Sending ChooseExportFileNameMessage");
ChooseExportFileNameMessage.Send(
new FileNameMessageContent(store.Get("csv_path", defaultPath),
"CSV files|*.csv;*.txt;*.dat|All files|*.*"),
ConfirmChooseFileName);
}
}

private void ConfirmChooseFileName(FileNameMessageContent messageContent)
Expand Down
2 changes: 1 addition & 1 deletion XLToolbox/Dispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ static void Properties()
static void JumpToTarget()
{
Xl.Range r = Instance.Default.Application.Selection as Xl.Range;
string value = Convert.ToString(r.Value2);
string value = (r == null) ? String.Empty : Convert.ToString(r.Value2);
Jumper j = new Jumper(value);
if (!j.Jump())
{
Expand Down
5 changes: 3 additions & 2 deletions XLToolbox/Excel/ViewModels/Instance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,9 @@ private void ConfirmQuitSavingChanges()
i, Workbooks.Count);
w.Save();
}
if (!w.Saved)
bool saved = w.Saved;
Bovender.ComHelpers.ReleaseComObject(w);
if (!saved)
{
Logger.Warn("ConfirmQuitSavingChanges: Workbook #{0} of {1} not saved: not quitting",
i, Workbooks.Count);
Expand All @@ -823,7 +825,6 @@ private void ConfirmQuitSavingChanges()
Logger.Info("ConfirmQuitSavingChanges: Proceeding to shutdown");
CloseAllWorkbooksThenShutdown();
}
Bovender.ComHelpers.ReleaseComObject(w);
}

private bool CanQuitSavingChanges()
Expand Down
30 changes: 16 additions & 14 deletions XLToolbox/Export/Models/BatchExportSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,23 @@ public static BatchExportSettings FromLastUsed()
/// if no such object exists.</returns>
public static BatchExportSettings FromLastUsed(Workbook workbookContext)
{
Store store = new Store(workbookContext);
BatchExportSettings settings = store.Get<BatchExportSettings>(
typeof(BatchExportSettings).ToString()
);
if (settings != null && settings.Preset != null)
{
// Replace the Preset object in the settings with the equivalent
// one from the PresetsRepository, or add
// it to the repository if no Preset with the same checksum hash exists.
settings.Preset = PresetsRepository.Default.FindOrAdd(settings.Preset);
return settings;
}
else
using (Store store = new Store(workbookContext))
{
return BatchExportSettings.FromLastUsed();
BatchExportSettings settings = store.Get<BatchExportSettings>(
typeof(BatchExportSettings).ToString()
);
if (settings != null && settings.Preset != null)
{
// Replace the Preset object in the settings with the equivalent
// one from the PresetsRepository, or add
// it to the repository if no Preset with the same checksum hash exists.
settings.Preset = PresetsRepository.Default.FindOrAdd(settings.Preset);
return settings;
}
else
{
return BatchExportSettings.FromLastUsed();
}
}
}

Expand Down
28 changes: 15 additions & 13 deletions XLToolbox/Export/Models/Preset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,22 @@ public static Preset FromLastUsed()
/// <returns>Preset object or null.</returns>
public static Preset FromLastUsed(Workbook workbookContext)
{
Store store = new Store(workbookContext);
Preset preset = store.Get<Preset>(Properties.StoreNames.Default.ExportPreset);

if (preset != null)
{
// Return the equivalent Preset object from the current collection, or
// add the preset retrieved from the workbook to the current collection.
return PresetsRepository.Default.FindOrAdd(preset);
}
else
using (Store store = new Store(workbookContext))
{
// Did not get a Preset from the workbook's Store, so let's try
// and offer the last used Preset from the UserSettings.
return FromLastUsed();
Preset preset = store.Get<Preset>(Properties.StoreNames.Default.ExportPreset);

if (preset != null)
{
// Return the equivalent Preset object from the current collection, or
// add the preset retrieved from the workbook to the current collection.
return PresetsRepository.Default.FindOrAdd(preset);
}
else
{
// Did not get a Preset from the workbook's Store, so let's try
// and offer the last used Preset from the UserSettings.
return FromLastUsed();
}
}
}

Expand Down
18 changes: 10 additions & 8 deletions XLToolbox/Export/ViewModels/ScreenshotExporterViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,16 @@ private void DoChooseFileName()
if (CanExportSelection())
{
string defaultPath = UserSettings.UserSettings.Default.ExportPath;
WorkbookStorage.Store store = new WorkbookStorage.Store();
string path = store.Get(
Properties.StoreNames.Default.ExportPath, defaultPath);
ChooseFileNameMessage.Send(
new FileNameMessageContent(
path,
FileType.Png.ToFileFilter()),
DoExportSelection);
using (WorkbookStorage.Store store = new WorkbookStorage.Store())
{
string path = store.Get(
Properties.StoreNames.Default.ExportPath, defaultPath);
ChooseFileNameMessage.Send(
new FileNameMessageContent(
path,
FileType.Png.ToFileFilter()),
DoExportSelection);
}
}
}

Expand Down
22 changes: 12 additions & 10 deletions XLToolbox/Export/ViewModels/SettingsViewModelBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,20 +171,22 @@ protected string LoadExportPath()
{
Logger.Info("LoadExportPath");
Workbook wb = Excel.ViewModels.Instance.Default.ActiveWorkbook;
Store store = new Store(wb);
string defaultPath = UserSettings.UserSettings.Default.ExportPath;
if (String.IsNullOrEmpty(defaultPath))
using (Store store = new Store(wb))
{
if (wb != null && !String.IsNullOrEmpty(wb.Path))
{
defaultPath = System.IO.Path.GetDirectoryName(wb.Path);
}
else
string defaultPath = UserSettings.UserSettings.Default.ExportPath;
if (String.IsNullOrEmpty(defaultPath))
{
defaultPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
if (wb != null && !String.IsNullOrEmpty(wb.Path))
{
defaultPath = System.IO.Path.GetDirectoryName(wb.Path);
}
else
{
defaultPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
}
}
return store.Get(Properties.StoreNames.Default.ExportPath, defaultPath);
}
return store.Get(Properties.StoreNames.Default.ExportPath, defaultPath);
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions XLToolbox/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("7.2.5.0")]
[assembly: AssemblyFileVersion("7.2.5.0")]
[assembly: AssemblyVersion("7.2.6.0")]
[assembly: AssemblyFileVersion("7.2.6.0")]
4 changes: 2 additions & 2 deletions XLToolbox/SheetManager/TaskPaneManager.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.Office.Tools;
/* SheetManagerPane.cs
/* SheetManagerPane.cs
* part of Daniel's XL Toolbox NG
*
* Copyright 2014-2016 Daniel Kraus
Expand All @@ -20,6 +19,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Tools;
using XLToolbox.Excel.ViewModels;

namespace XLToolbox.SheetManager
Expand Down
9 changes: 9 additions & 0 deletions XLToolbox/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fda7f40

Please sign in to comment.