Bugfix: Throw the correct exception if the source is not an ODF document + give explanation in command line application

git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@158 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
henrikjust 2014-08-06 06:08:23 +00:00
parent d3bd2a10d5
commit c639066861
4 changed files with 16 additions and 12 deletions

View file

@ -2,10 +2,13 @@ Changelog for Writer2LaTeX version 1.2 -> 1.4
---------- version 1.3.1 alpha ----------
[w2x] The option ignore_table_dimensions has been replace by a new option table_size with values none (do not export table
[all] The command line application now gives an explanation if the source file is not in ODF format
[all] Bugfix: Fixed typo that caused writer2latex.office.MIMETypes.getMagicMIMEType() to fail in some cases
[w2x] The option ignore_table_dimensions has been replaced by a new option table_size with values none (do not export table
dimensions), relative (always use relative width) and auto (use the formatting of the source document):
If set to true, all tables are exported with relative width, even
if they have an absolute width in the source document
If set to true, all tables are exported with relative width, even if they have an absolute width in the source document
[w2x] Display equations are now recognized by the same means as in the LaTeX export: A single equation in a paragraph with no
text content except whitespace and an optional sequence number in brackets is considered a display equation. In that case

View file

@ -16,11 +16,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Copyright: 2002-2012 by Henrik Just
* Copyright: 2002-2014 by Henrik Just
*
* All Rights Reserved.
*
* Version 1.4 (2012-03-30)
* Version 1.4 (2014-08-05)
*
*/
@ -286,6 +286,7 @@ public final class Application {
catch (IOException e) {
System.out.println("--> Failed to convert the file "+source.getPath()+"!");
System.out.println(" "+e.getMessage());
System.out.println(" Please make sure the file is in OpenDocument format");
System.exit(1);
}

View file

@ -16,11 +16,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Copyright: 2002-2012 by Henrik Just
* Copyright: 2002-2014 by Henrik Just
*
* All Rights Reserved.
*
* Version 1.4 (2012-04-12)
* Version 1.4 (2012-08-05)
*
*/
@ -33,7 +33,7 @@ public class ConverterFactory {
// Version information
private static final String VERSION = "1.3.1";
private static final String DATE = "2012-04-12";
private static final String DATE = "2014-08-05";
/** Return the Writer2LaTeX version in the form
* (major version).(minor version).(patch level)<br/>

View file

@ -16,11 +16,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Copyright: 2002-2012 by Henrik Just
* Copyright: 2002-2014 by Henrik Just
*
* All Rights Reserved.
*
* Version 1.4 (2012-04-01)
* Version 1.4 (2014-08-05)
*
*/
@ -92,9 +92,9 @@ public final class MIMETypes extends writer2latex.api.MIMETypes {
private static final boolean isSVG(byte[] blob) {
// Look for <svg within the first 250 bytes
int m = Math.max(blob.length, 250);
int m = Math.min(blob.length, 250);
int n = SVG_SIG.length;
for (int j=0; j<m; j++) {
for (int j=0; j<m-n; j++) {
boolean bFound = true;
for (int i=0; i<n; i++) {
if (blob[j+i]!=SVG_SIG[i]) {