mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 10:47:02 -07:00
Added aspect-ratio lock for Word, as "requested" in Bug #1443
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2450 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
da09193b99
commit
e30939093a
3 changed files with 13 additions and 0 deletions
|
@ -40,5 +40,7 @@ namespace GreenshotOfficePlugin {
|
|||
public string EmailBCC;
|
||||
[IniProperty("OutlookAllowExportInMeetings", Description = "Allow export in meeting items", DefaultValue = "False")]
|
||||
public bool OutlookAllowExportInMeetings;
|
||||
[IniProperty("WordLockAspectRatio", Description = "For Word: Lock the aspect ratio of the image", DefaultValue = "True")]
|
||||
public bool WordLockAspectRatio;
|
||||
}
|
||||
}
|
|
@ -23,11 +23,14 @@ using System.Collections.Generic;
|
|||
using System.Text;
|
||||
|
||||
using Greenshot.Interop;
|
||||
using GreenshotOfficePlugin;
|
||||
using Greenshot.IniFile;
|
||||
|
||||
namespace Greenshot.Interop.Office {
|
||||
public class WordExporter {
|
||||
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(WordExporter));
|
||||
private static string version = null;
|
||||
private static OfficeConfiguration config = IniConfig.GetIniSection<OfficeConfiguration>();
|
||||
|
||||
public static bool isAfter2003() {
|
||||
if (version != null) {
|
||||
|
@ -106,6 +109,10 @@ namespace Greenshot.Interop.Office {
|
|||
|
||||
private static IInlineShape AddPictureToSelection(ISelection selection, string tmpFile) {
|
||||
IInlineShape shape = selection.InlineShapes.AddPicture(tmpFile, false, true, Type.Missing);
|
||||
// Lock aspect ratio
|
||||
if (config.WordLockAspectRatio) {
|
||||
shape.LockAspectRatio = MsoTriState.msoTrue;
|
||||
}
|
||||
selection.InsertAfter("\r\n");
|
||||
return shape;
|
||||
}
|
||||
|
|
|
@ -101,6 +101,10 @@ namespace Greenshot.Interop.Office {
|
|||
/// </summary>
|
||||
public interface IInlineShape : Common {
|
||||
IHyperlink Hyperlink { get; }
|
||||
MsoTriState LockAspectRatio {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue