Skip to content

Commit 774494a

Browse files
authored
Merge pull request #437 from opendocument-app/add-password-protected-tests
Fix DOC
2 parents 1b5d616 + c70a0a6 commit 774494a

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools"
44
android:installLocation="auto"
5-
android:versionCode="195"
6-
android:versionName="3.40"
5+
android:versionCode="196"
6+
android:versionName="4.0"
77
tools:ignore="GoogleAppIndexingWarning">
88

99
<uses-permission android:name="android.permission.INTERNET" />

app/src/main/cpp/core_wrapper.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ Java_at_tomtasche_reader_background_CoreWrapper_parseNative(JNIEnv *env, jclass
185185
}
186186
}
187187

188-
if (file.is_document_file()) {
188+
// .doc-files are not real documents in core
189+
if (file.is_document_file() && fileType != odr::FileType::legacy_word_document) {
189190
// TODO this will cause a second load
190191
s_document = file.as_document_file().document();
191192
}
@@ -399,7 +400,11 @@ Java_at_tomtasche_reader_background_CoreWrapper_hostFileNative(JNIEnv *env, jcla
399400
}
400401
}
401402

402-
if (file.is_document_file()) {
403+
__android_log_print(ANDROID_LOG_INFO, "smn", "type=%s",
404+
file_type_to_string(file.file_type()).c_str());
405+
406+
// .doc-files are not real documents in core
407+
if (file.is_document_file() && file.file_type() != odr::FileType::legacy_word_document) {
403408
// TODO this will cause a second load
404409
s_document = file.as_document_file().document();
405410
}

app/src/main/java/at/tomtasche/reader/background/CoreLoader.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public boolean isSupported(Options options) {
6060
return options.fileType.startsWith("application/vnd.oasis.opendocument") ||
6161
options.fileType.startsWith("application/x-vnd.oasis.opendocument") ||
6262
options.fileType.startsWith("application/vnd.oasis.opendocument.text-master") ||
63+
options.fileType.startsWith("application/msword") ||
6364
(this.doOoxml && (
6465
options.fileType.startsWith("application/vnd.openxmlformats-officedocument.wordprocessingml.document")
6566
// TODO: enable xlsx and pptx too

0 commit comments

Comments
 (0)