Creating a branch 1.1 where I will try to make the 1.1.7 build available, this means I need to merge some changes from 2.0 to here.

This commit is contained in:
RKrom 2013-12-04 17:46:02 +01:00
commit a03bc31aef
247 changed files with 6986 additions and 8233 deletions

View file

@ -28,6 +28,7 @@ using GreenshotPlugin.Core;
using Greenshot.Plugin;
using Greenshot.Interop.Office;
using Greenshot.IniFile;
using System.Text.RegularExpressions;
namespace GreenshotOfficePlugin {
/// <summary>
@ -109,17 +110,23 @@ namespace GreenshotOfficePlugin {
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
ExportInformation exportInformation = new ExportInformation(this.Designation, this.Description);
string tmpFile = captureDetails.Filename;
if (tmpFile == null || surface.Modified) {
tmpFile = ImageOutput.SaveNamedTmpFile(surface, captureDetails, new SurfaceOutputSettings(OutputFormat.png));
bool createdFile = false;
string imageFile = captureDetails.Filename;
if (imageFile == null || surface.Modified || !Regex.IsMatch(imageFile, @".*(\.png|\.gif|\.jpg|\.jpeg|\.tiff|\.bmp)$")) {
imageFile = ImageOutput.SaveNamedTmpFile(surface, captureDetails, new SurfaceOutputSettings().PreventGreenshotFormat());
createdFile = true;
}
if (workbookName != null) {
ExcelExporter.InsertIntoExistingWorkbook(workbookName, tmpFile);
ExcelExporter.InsertIntoExistingWorkbook(workbookName, imageFile, surface.Image.Size);
} else {
ExcelExporter.InsertIntoNewWorkbook(tmpFile);
ExcelExporter.InsertIntoNewWorkbook(imageFile, surface.Image.Size);
}
exportInformation.ExportMade = true;
ProcessExport(exportInformation, surface);
// Cleanup imageFile if we created it here, so less tmp-files are generated and left
if (createdFile && File.Exists(imageFile)) {
File.Delete(imageFile);
}
return exportInformation;
}
}