Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:installLocation="auto"
android:versionCode="185"
android:versionName="3.31"
android:versionCode="186"
android:versionName="3.32"
tools:ignore="GoogleAppIndexingWarning">

<uses-permission android:name="android.permission.INTERNET" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,20 @@ public static class CoreResult {
public String extension;
}

public class CoreCouldNotOpenException extends RuntimeException {}
public static class CoreCouldNotOpenException extends RuntimeException {}

public class CoreEncryptedException extends RuntimeException {}
public static class CoreEncryptedException extends RuntimeException {}

public class CoreCouldNotTranslateException extends RuntimeException {}
public static class CoreCouldNotTranslateException extends RuntimeException {}

public class CoreUnexpectedFormatException extends RuntimeException {}
public static class CoreUnexpectedFormatException extends RuntimeException {}

public class CoreUnexpectedErrorCodeException extends RuntimeException {}
public static class CoreUnexpectedErrorCodeException extends RuntimeException {}

public class CoreUnknownErrorException extends RuntimeException {}
public static class CoreUnknownErrorException extends RuntimeException {}

public class CoreCouldNotEditException extends RuntimeException {}
public static class CoreCouldNotEditException extends RuntimeException {}

public class CoreCouldNotSaveException extends RuntimeException {}
public static class CoreCouldNotSaveException extends RuntimeException {}

}
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,12 @@ private void translate(Options options, Result result) throws Exception {
CoreWrapper.CoreResult coreResult = lastCore.parse(coreOptions);

String coreExtension = coreResult.extension;
// "unnamed" refers to default of Meta::typeToString
if (coreExtension != null && !coreExtension.equals("unnamed")) {
if (coreResult.exception == null && "pdf".equals(coreExtension)) {
// some PDFs do not cause an error in the core
// https://github.com/opendocument-app/OpenDocument.droid/issues/348#issuecomment-2446888981
throw new CoreWrapper.CoreCouldNotTranslateException();
} else if (!"unnamed".equals(coreExtension)) {
// "unnamed" refers to default of Meta::typeToString
options.fileExtension = coreExtension;

String fileType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(coreExtension);
Expand Down