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
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,34 @@ version code per locale under `fastlane/metadata/android/<locale>/changelogs/`,
written by `scripts/store-copy.py` before the release and uploaded by it. Play
takes 500 characters, so not everything here reaches the store.

## Unreleased

- Charts in OpenDocument files are drawn from the chart itself - bar, line,
area, scatter, pie and ring, with their titles, legends, axes and colours -
rather than from the flat picture saved beside it.
- Shapes in OpenDocument drawings and presentations appear as the shapes they
are, and where the file puts them. Arrows, stars, callouts, curves,
connectors, ellipses and measures used to come out as plain rectangles or not
at all, and a rotated or mirrored one sat square.
- Pictures and charts stored as Windows metafiles draw: their lines, curves,
gradients, bitmaps and labels, each in the encoding the file names. Such an
image used to be an empty frame, or a table's rules a row of floating numbers.
- A floating picture in a Word document floats where it was anchored, with the
text wrapping around it, instead of sitting in the line.
- A Word table's own borders are drawn, and at the thickness the file asks for
rather than four times it. A table cell's content starts at the top of the
cell, as Word and OpenDocument show it.
- A manual page break starts a new page, on screen and in print.
- Lines in a PDF are drawn at the width the file sets. A PDF from Canva had
every stroke at the same weight, whatever it was meant to be.
- Spreadsheets open in about half the memory, and two more of them open at all:
a sheet whose repeated cells claimed billions of positions, and one with a
merged range naming more cells than the sheet has.
- Pictures in a document load side by side rather than one after another: two
parts of the same file can be read at once now.
- A password-protected document opens read-only. Saving it wrote the content
back out without the protection its author asked for, and said nothing.

## 4.18.0

- A spreadsheet shows ten times as many rows: the cap rises from 10,000 to
Expand Down
22 changes: 22 additions & 0 deletions app/src/androidTest/java/app/opendocument/droid/test/CoreTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,28 @@ class CoreTest {
Assert.assertFalse("the decrypted document should produce a view", views.isEmpty())
}

/**
* A document only held decrypted is read only, so no Edit button appears over it. The same odt
* without a password is editable - see [testEditableFormats] - and saving this one would have
* written the content back out without the protection its author asked for.
*/
@Test
fun testDecryptedDocumentIsNotEditable() {
coreLoader.host(
prefix = "password-test-editable",
inputPath = passwordTestFile.absolutePath,
cachePath = File(cacheDir(), "password_editable").path,
password = "passwort",
editable = true,
keepDocument = true,
)

Assert.assertFalse(
"a decrypted document should not be editable",
coreLoader.isDocumentEditable,
)
}

/**
* An encrypted `.doc` says so rather than failing as a parse error, and odrcore has no way into
* it, so [CoreLoader.host] refuses it instead of raising a prompt no password can close.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,15 @@ class CoreLoader(private val context: Context) {
/**
* What the document is *called*. Not [IdentifiedFile.mimeType]: `FileIdentifier` takes that
* from `Odr.mimetype` wherever it answered, so it would be the same reading again.
*
* Only a name the core has a decoder for: html is named by the table and not opened by it, so
* calling a file `.html` answers nothing [openAs] could act on.
*/
private fun declaredType(file: IdentifiedFile): FileType? {
val extension = MimeTypeResolver.parseExtension(file.filename)?.lowercase() ?: return null
val type = Odr.fileTypeByFileExtension(extension) ?: return null

return type.takeIf { it != FileType.UNKNOWN }
return type.takeIf { it != FileType.UNKNOWN && Odr.capabilitiesByFileType(it).open }
}

/**
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ googleJavaFormat = "1.35.0"
ktfmt = "0.64"

# odrcore's JNI bindings, java and native in one AAR, published from OpenDocument.core
odrCore = "6.11.0"
odrCore = "6.13.0"

androidxAnnotation = "1.10.0"
androidxAppcompat = "1.8.0"
Expand Down
2 changes: 1 addition & 1 deletion tools/render-sweep/render-sweep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ INSTALL=0
# because the tables live in libodr_jni and reading them needs a device - the
# same reason SupportedDocumentTypesTest is an instrumented test. A format added
# upstream and missing here just means this sweep skips it.
CLAIMED='csv|doc|docm|docx|dot|dotm|dotx|fodg|fodp|fods|fodt|key|numbers|odg|odm|odp|ods|odt|otg|otm|otp|ots|ott|pages|pdf|pot|potm|potx|pps|ppsm|ppsx|ppt|pptm|pptx|rtf|text|txt|xlm|xls|xlsm|xlsx|xlt|xltm|xltx|zip'
CLAIMED='csv|doc|docm|docx|dot|dotm|dotx|fodg|fodp|fods|fodt|key|markdown|md|numbers|odg|odm|odp|ods|odt|otg|otm|otp|ots|ott|pages|pdf|pot|potm|potx|pps|ppsm|ppsx|ppt|pptm|pptx|rtf|text|txt|xlm|xls|xlsm|xlsx|xlt|xltm|xltx|zip'

usage() {
cat <<'EOF'
Expand Down
Loading