Fix for SVG images in LO 4.0/AOO 4.1

git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@220 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
henrikjust 2014-11-18 14:13:53 +00:00
parent de9f9e9aa6
commit cdca675509
2 changed files with 11 additions and 6 deletions

View file

@ -33,7 +33,7 @@ public class ConverterFactory {
// Version information
private static final String VERSION = "1.5.2";
private static final String DATE = "2014-11-09";
private static final String DATE = "2014-11-18";
/** Return the Writer2LaTeX version in the form
* (major version).(minor version).(patch level)<br/>

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.6 (2014-10-27)
* Version 1.6 (2014-11-18)
*
*/
@ -170,16 +170,21 @@ public final class ImageConverter {
public BinaryGraphicsDocument getImage(Element node) {
String sName = sSubDirName+sBaseFileName+formatter.format(++nImageCount);
BinaryGraphicsDocument bgd = getImage(node,sName);
if (bgd!=null) {
if (!bgd.isAcceptedFormat()) { // We may have better luck with an alternative image
if (bgd!=null) {
if (!bgd.isAcceptedFormat() || (sDefaultVectorFormat!=null && !sDefaultVectorFormat.equals(bgd.getMIMEType()))) {
// We may have better luck with an alternative image
Element sibling = getAlternativeImage(node);
if (sibling!=null) {
BinaryGraphicsDocument altBgd = getImage(sibling,sName);
if (altBgd!=null && altBgd.isAcceptedFormat()) {
bgd = altBgd;
if (!bgd.isAcceptedFormat() ||
(sDefaultVectorFormat!=null && !sDefaultVectorFormat.equals(bgd.getMIMEType()) &&
sDefaultVectorFormat.equals(altBgd.getMIMEType()))) {
bgd = altBgd;
}
}
}
}
}
}
if (bgd==null || bgd.isLinked() || bgd.isRecycled()) {
// The file name was not used