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

@ -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]) {