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:
parent
de9f9e9aa6
commit
cdca675509
2 changed files with 11 additions and 6 deletions
|
@ -33,7 +33,7 @@ public class ConverterFactory {
|
||||||
|
|
||||||
// Version information
|
// Version information
|
||||||
private static final String VERSION = "1.5.2";
|
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
|
/** Return the Writer2LaTeX version in the form
|
||||||
* (major version).(minor version).(patch level)<br/>
|
* (major version).(minor version).(patch level)<br/>
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
*
|
*
|
||||||
* All Rights Reserved.
|
* 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) {
|
public BinaryGraphicsDocument getImage(Element node) {
|
||||||
String sName = sSubDirName+sBaseFileName+formatter.format(++nImageCount);
|
String sName = sSubDirName+sBaseFileName+formatter.format(++nImageCount);
|
||||||
BinaryGraphicsDocument bgd = getImage(node,sName);
|
BinaryGraphicsDocument bgd = getImage(node,sName);
|
||||||
if (bgd!=null) {
|
if (bgd!=null) {
|
||||||
if (!bgd.isAcceptedFormat()) { // We may have better luck with an alternative image
|
if (!bgd.isAcceptedFormat() || (sDefaultVectorFormat!=null && !sDefaultVectorFormat.equals(bgd.getMIMEType()))) {
|
||||||
|
// We may have better luck with an alternative image
|
||||||
Element sibling = getAlternativeImage(node);
|
Element sibling = getAlternativeImage(node);
|
||||||
if (sibling!=null) {
|
if (sibling!=null) {
|
||||||
BinaryGraphicsDocument altBgd = getImage(sibling,sName);
|
BinaryGraphicsDocument altBgd = getImage(sibling,sName);
|
||||||
if (altBgd!=null && altBgd.isAcceptedFormat()) {
|
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()) {
|
if (bgd==null || bgd.isLinked() || bgd.isRecycled()) {
|
||||||
// The file name was not used
|
// The file name was not used
|
||||||
|
|
Loading…
Add table
Reference in a new issue