Skip to content

android: replace untitled.odt template with one generated by current LO#15739

Closed
SUGE2016 wants to merge 1 commit intoCollaboraOnline:mainfrom
SUGE2016:fix/android-untitled-odt-template
Closed

android: replace untitled.odt template with one generated by current LO#15739
SUGE2016 wants to merge 1 commit intoCollaboraOnline:mainfrom
SUGE2016:fix/android-untitled-odt-template

Conversation

@SUGE2016
Copy link
Copy Markdown

@SUGE2016 SUGE2016 commented May 8, 2026

Summary

The bundled `android/templates/untitled.odt` (used by the Android "New Document" flow) was hand-crafted in 2020 and has been unchanged for 5 years. Current versions of lo-core no longer accept it as a valid ODT — opening it triggers the "Document is corrupted, do you want to repair it?" dialog, and after either choice the editor shows a blank screen.

This PR regenerates the template using the current LibreOffice.

How to reproduce (before this PR)

  1. Build/install the Collabora Office Android app from current main.
  2. Tap New Document → Writer (ODT).
  3. Result: corruption dialog → blank screen.

ODS / ODP "New Document" flows still work because their templates aren't tripped by the same regression.

Why nobody noticed

  • Desktop / web Collabora never creates an empty ODT from a template — documents always come from storage.
  • Only Android (and iOS) "New Document" uses these bundled templates.
  • Android user base is small; this path isn't covered by automated tests.

The fix

Replace `android/templates/untitled.odt` with a fresh empty document produced by:

```sh
touch empty.txt
soffice --headless --convert-to odt empty.txt
```

Old vs new:

old new
size 1268 bytes 7853 bytes
entries 5 15
mimetype offset not 0 0 (spec-compliant)
content.xml 227 bytes, hand-written 3461 bytes, generated by current LO

`untitled.ods` and `untitled.odp` are intentionally left untouched — they still load fine. They can be regenerated the same way if a future core regression hits them.

Test plan

  • Verified on Android (OnePlus 13T, arm64-v8a): "New ODT" now opens straight into a blank editable document.
  • ODS / ODP "New Document" flows still work.

Related

A complementary defensive fix in `kit/KitHelper.hpp` (#15738) prevents `documentStatus()` from silently dropping the status reply when LOK returns empty JSON, which is what makes this template bug present as a blank screen instead of a clearer error.

Made with Cursor

The original android/templates/untitled.odt (added in 2020,
unchanged for 5 years) is a hand-crafted minimal ODF file:

  5 entries, 1268 bytes, content.xml is just 227 bytes,
  mimetype is not the first ZIP entry (offset != 0).

Recent versions of the lo-core no longer accept this file as a valid
ODT. Loading it via LibreOfficeKit triggers the "Document is corrupted,
do you want to repair it?" dialog, and after either choice the editor
shows a blank screen.

Replace it with a fresh empty document produced by:

    touch empty.txt
    soffice --headless --convert-to odt empty.txt

This yields a 7.8 KB, 15-entry, fully spec-compliant ODT that current
LO opens without complaint.

This bug went unnoticed because:
- desktop / web Collabora never creates a new empty ODT — documents
  always come from storage
- only the Android (and iOS) "New Document" flow uses these template
  files, and the user base is small

Verified on Android (OnePlus 13T, arm64-v8a): "New ODT" now opens
straight into a blank editable document.

untitled.ods and untitled.odp are left untouched (still load fine);
they can be regenerated the same way if a future core regression hits
them.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

Thank you for your contribution! However, the main branch on GitHub is not used for this project. Please submit patches to the main branch of the online repo at https://gerrit.collaboraoffice.com.

See CONTRIBUTING.md for details. This PR has been automatically closed.

@github-actions github-actions Bot closed this May 8, 2026
@github-project-automation github-project-automation Bot moved this from To Review to Done in Collabora Online May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant