diff --git a/source/distro/changelog.txt b/source/distro/changelog.txt index 4242b9c..27382d8 100644 --- a/source/distro/changelog.txt +++ b/source/distro/changelog.txt @@ -2,6 +2,8 @@ Changelog for Writer2LaTeX version 1.0 -> 1.2 ---------- version 1.1.8 ---------- +[all] Added support for images in EMF format (Enhanced Windows Meta Files) + [w2l] Bugfix: No longer decodes URLs in links (hyperref.sty has no problem with sequences like %E4) [w2x] EPUB bugfix: The meta data editor now shows the correct default creator (not the original creator) diff --git a/source/java/org/openoffice/da/comp/w2lcommon/filter/GraphicConverterImpl1.java b/source/java/org/openoffice/da/comp/w2lcommon/filter/GraphicConverterImpl1.java index a53eb35..b678bd7 100644 --- a/source/java/org/openoffice/da/comp/w2lcommon/filter/GraphicConverterImpl1.java +++ b/source/java/org/openoffice/da/comp/w2lcommon/filter/GraphicConverterImpl1.java @@ -16,11 +16,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * - * Copyright: 2002-2010 by Henrik Just + * Copyright: 2002-2011 by Henrik Just * * All Rights Reserved. * - * Version 1.2 (2010-10-27) + * Version 1.2 (2011-07-22) */ @@ -77,7 +77,8 @@ public class GraphicConverterImpl1 implements GraphicConverter { if (bCrop || bResize) { return false; } // We can convert vector formats to eps: - if (MIMETypes.EPS.equals(sTargetMime) && (MIMETypes.WMF.equals(sSourceMime) || MIMETypes.SVM.equals(sSourceMime))) { + if (MIMETypes.EPS.equals(sTargetMime) && + (MIMETypes.EMF.equals(sSourceMime) || MIMETypes.WMF.equals(sSourceMime) || MIMETypes.SVM.equals(sSourceMime))) { return true; } @@ -85,8 +86,8 @@ public class GraphicConverterImpl1 implements GraphicConverter { boolean bSupportsSource = MIMETypes.PNG.equals(sSourceMime) || MIMETypes.JPEG.equals(sSourceMime) || MIMETypes.GIF.equals(sSourceMime) || MIMETypes.TIFF.equals(sSourceMime) || - MIMETypes.BMP.equals(sSourceMime) || MIMETypes.WMF.equals(sSourceMime) || - MIMETypes.SVM.equals(sSourceMime); + MIMETypes.BMP.equals(sSourceMime) || MIMETypes.EMF.equals(sSourceMime) || + MIMETypes.WMF.equals(sSourceMime) || MIMETypes.SVM.equals(sSourceMime); boolean bSupportsTarget = MIMETypes.PNG.equals(sTargetMime) || MIMETypes.JPEG.equals(sTargetMime) || MIMETypes.GIF.equals(sTargetMime) || MIMETypes.TIFF.equals(sTargetMime) || @@ -99,7 +100,7 @@ public class GraphicConverterImpl1 implements GraphicConverter { // It seems that the GraphicProvider can only create proper eps if // the source is a vector format, hence if (MIMETypes.EPS.equals(sTargetMime)) { - if (!MIMETypes.WMF.equals(sSourceMime) && !MIMETypes.SVM.equals(sSourceMime)) { + if (!MIMETypes.EMF.equals(sSourceMime) && !MIMETypes.WMF.equals(sSourceMime) && !MIMETypes.SVM.equals(sSourceMime)) { return null; } } diff --git a/source/java/writer2latex/api/ConverterFactory.java b/source/java/writer2latex/api/ConverterFactory.java index 685cbe4..6db8c60 100644 --- a/source/java/writer2latex/api/ConverterFactory.java +++ b/source/java/writer2latex/api/ConverterFactory.java @@ -20,7 +20,7 @@ * * All Rights Reserved. * - * Version 1.2 (2011-07-20) + * Version 1.2 (2011-07-22) * */ @@ -33,7 +33,7 @@ public class ConverterFactory { // Version information private static final String VERSION = "1.1.8"; - private static final String DATE = "2011-07-20"; + private static final String DATE = "2011-07-22"; /** Return the Writer2LaTeX version in the form * (major version).(minor version).(patch level)
diff --git a/source/java/writer2latex/api/MIMETypes.java b/source/java/writer2latex/api/MIMETypes.java index 97c9bd2..2b459be 100644 --- a/source/java/writer2latex/api/MIMETypes.java +++ b/source/java/writer2latex/api/MIMETypes.java @@ -16,11 +16,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * - * Copyright: 2002-2010 by Henrik Just + * Copyright: 2002-2011 by Henrik Just * * All Rights Reserved. * - * Version 1.2 (2010-03-29) + * Version 1.2 (2011-07-22) * */ @@ -37,6 +37,7 @@ public class MIMETypes { public static final String GIF="image/gif"; public static final String TIFF="image/tiff"; public static final String BMP="image/bmp"; + public static final String EMF="image/x-emf"; public static final String WMF="image/x-wmf"; public static final String EPS="image/x-eps"; // MIME type for SVM has changed diff --git a/source/java/writer2latex/office/MIMETypes.java b/source/java/writer2latex/office/MIMETypes.java index 3ae462e..4c5433d 100644 --- a/source/java/writer2latex/office/MIMETypes.java +++ b/source/java/writer2latex/office/MIMETypes.java @@ -16,11 +16,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * - * Copyright: 2002-2008 by Henrik Just + * Copyright: 2002-2011 by Henrik Just * * All Rights Reserved. * - * Version 1.0 (2008-11-24) + * Version 1.2 (2011-07-22) * */ @@ -54,6 +54,7 @@ public final class MIMETypes extends writer2latex.api.MIMETypes { public static final byte[] GIF89_SIG = { 0x47, 0x49, 0x46, 0x38, 0x39, 0x61 }; // GIF89a public static final byte[] TIFF_SIG = { 0x49, 0x49, 0x2A }; // II* public static final byte[] BMP_SIG = { 0x42, 0x4d }; // BM + public static final byte[] EMF_SIG = { 1, 0, 0, 0 }; public static final byte[] WMF_SIG = { (byte) 0xd7, (byte) 0xcd, (byte) 0xc6, (byte) 0x9a }; public static final byte[] WMF30_SIG = { 1, 0, 9, 0 }; // Old WMF format, not reliable - see below public static final byte[] EPS_SIG = { 0x25, 0x21 }; // %! @@ -72,6 +73,7 @@ public final class MIMETypes extends writer2latex.api.MIMETypes { public static final String GIF_EXT = ".gif"; public static final String TIFF_EXT = ".tif"; public static final String BMP_EXT = ".bmp"; + public static final String EMF_EXT = ".emf"; public static final String WMF_EXT = ".wmf"; public static final String EPS_EXT = ".eps"; public static final String SVM_EXT = ".svm"; @@ -92,6 +94,7 @@ public final class MIMETypes extends writer2latex.api.MIMETypes { if (isType(blob,GIF89_SIG)) { return GIF; } if (isType(blob,TIFF_SIG)) { return TIFF; } if (isType(blob,BMP_SIG)) { return BMP; } + if (isType(blob,EMF_SIG)) { return EMF; } if (isType(blob,WMF_SIG)) { return WMF; } if (isType(blob,WMF30_SIG)) { return WMF; } // do not trust this.. if (isType(blob,EPS_SIG)) { return EPS; } @@ -106,6 +109,7 @@ public final class MIMETypes extends writer2latex.api.MIMETypes { if (GIF.equals(sMIME)) { return GIF_EXT; } if (TIFF.equals(sMIME)) { return TIFF_EXT; } if (BMP.equals(sMIME)) { return BMP_EXT; } + if (EMF.equals(sMIME)) { return EMF_EXT; } if (WMF.equals(sMIME)) { return WMF_EXT; } if (EPS.equals(sMIME)) { return EPS_EXT; } if (SVM.equals(sMIME)) { return SVM_EXT; } @@ -119,7 +123,7 @@ public final class MIMETypes extends writer2latex.api.MIMETypes { } public static boolean isVectorFormat(String sMIME) { - return WMF.equals(sMIME) || EPS.equals(sMIME) || SVM.equals(sMIME) || PDF.equals(sMIME); + return EMF.equals(sMIME) || WMF.equals(sMIME) || EPS.equals(sMIME) || SVM.equals(sMIME) || PDF.equals(sMIME); }