diff --git a/CHANGELOG.md b/CHANGELOG.md index 272faa3..758b519 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,35 @@ Rules: `Unreleased`. - Add the date and the compare link once the version tag exists. +## Unreleased + +### Added + +- Text, spreadsheet, presentation and PDF files show their own icons in the + file browser, and OpenDocument files no longer show as zip archives. +- Legacy Word (.doc) documents show their page size and margins, and their + paragraph styles, alignment, indents and spacing. +- A spreadsheet's grid goes on past its content, and editing reaches the empty + cells there. +- While editing a slide, its text boxes show their outline, and an empty one + says "Tap to add text". + +### Fixed + +- Picking a keyboard suggestion while editing puts the word in instead of + deleting the one being typed. +- Printing a PDF no longer adds a blank sheet after each page. +- Deleting a spreadsheet column shrinks the sheet by the column's width. +- Word tables with a fixed layout keep their column widths, and Word text uses + the document's theme fonts. +- Excel cell borders show their weight and pattern. +- PowerPoint placeholders take their position, size and font from their slide + layout. + +### Changed + +- The engine is odrcore 7.10.0, up from 7.8.0. + ## [1.52] ### Added @@ -440,7 +469,11 @@ submitted. - An incorrect password is now reported as such instead of a generic failure. - Page handling and decryption fixes when opening protected documents. -[Unreleased]: https://github.com/opendocument-app/OpenDocument.ios/compare/v1.48...HEAD +[Unreleased]: https://github.com/opendocument-app/OpenDocument.ios/compare/v1.52...HEAD +[1.52]: https://github.com/opendocument-app/OpenDocument.ios/compare/v1.51...v1.52 +[1.51]: https://github.com/opendocument-app/OpenDocument.ios/compare/v1.50...v1.51 +[1.50]: https://github.com/opendocument-app/OpenDocument.ios/compare/v1.49...v1.50 +[1.49]: https://github.com/opendocument-app/OpenDocument.ios/compare/v1.48...v1.49 [1.48]: https://github.com/opendocument-app/OpenDocument.ios/compare/v1.47...v1.48 [1.47]: https://github.com/opendocument-app/OpenDocument.ios/compare/v1.46...v1.47 [1.46]: https://github.com/opendocument-app/OpenDocument.ios/compare/v1.45...v1.46 diff --git a/OpenDocumentReader.xcodeproj/project.pbxproj b/OpenDocumentReader.xcodeproj/project.pbxproj index 94399dd..438daf5 100644 --- a/OpenDocumentReader.xcodeproj/project.pbxproj +++ b/OpenDocumentReader.xcodeproj/project.pbxproj @@ -830,7 +830,7 @@ repositoryURL = "https://github.com/opendocument-app/OpenDocument.core.git"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 7.8.0; + minimumVersion = 7.10.0; }; }; AD584FCD41577C8CDEE974AA /* XCRemoteSwiftPackageReference "swift-package-manager-google-mobile-ads" */ = { diff --git a/OpenDocumentReader.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/OpenDocumentReader.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 995689d..cf88c8e 100644 --- a/OpenDocumentReader.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/OpenDocumentReader.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/opendocument-app/OpenDocument.core.git", "state" : { - "revision" : "b39f358b4ea25fc5b7254268010d6ea51808b73b", - "version" : "7.8.0" + "revision" : "776a023b2c902271726c24aaed851078f3709911", + "version" : "7.10.0" } }, { diff --git a/OpenDocumentReader/DocumentViewController.swift b/OpenDocumentReader/DocumentViewController.swift index 1af88fc..a42d90d 100644 --- a/OpenDocumentReader/DocumentViewController.swift +++ b/OpenDocumentReader/DocumentViewController.swift @@ -823,6 +823,21 @@ class DocumentViewController: UIViewController, DocumentDelegate, UISearchBarDel let isPlainText = document?.isPlainText == true + // an empty text box on a slide says what it is for in the reader's + // language, not the page's English one + webview.callAsyncJavaScript( + """ + if (typeof odr === 'object' && odr.editing && typeof odr.editing.setFramePrompt === 'function') { + odr.editing.setFramePrompt(prompt); + } + """, + arguments: ["prompt": NSLocalizedString("edit_frame_prompt", comment: "")], in: nil, in: .page + ) { result in + if case .failure(let error) = result { + CrashManager.shared.log(error) + } + } + let script = """ odr.editing.enable(); if (typeof odr.sheet === 'object' && typeof odr.editing.loadFormulas === 'function') { diff --git a/OpenDocumentReader/ca.lproj/Localizable.strings b/OpenDocumentReader/ca.lproj/Localizable.strings index 57333cf..e5bfcc6 100644 --- a/OpenDocumentReader/ca.lproj/Localizable.strings +++ b/OpenDocumentReader/ca.lproj/Localizable.strings @@ -131,6 +131,7 @@ "edit_delete_columns" = "Suprimeix la columna"; "edit_undo" = "Desfés"; "edit_redo" = "Refés"; +"edit_frame_prompt" = "Toca per afegir text"; /* The marks a PDF takes */ "mark_pdf" = "Marca aquest PDF"; diff --git a/OpenDocumentReader/cs.lproj/Localizable.strings b/OpenDocumentReader/cs.lproj/Localizable.strings index 0654b59..820798a 100644 --- a/OpenDocumentReader/cs.lproj/Localizable.strings +++ b/OpenDocumentReader/cs.lproj/Localizable.strings @@ -131,6 +131,7 @@ "edit_delete_columns" = "Odstranit sloupec"; "edit_undo" = "Zpět"; "edit_redo" = "Znovu"; +"edit_frame_prompt" = "Klepnutím přidáte text"; /* The marks a PDF takes */ "mark_pdf" = "Označit tento PDF"; diff --git a/OpenDocumentReader/da.lproj/Localizable.strings b/OpenDocumentReader/da.lproj/Localizable.strings index ab46a0c..0c0a7d5 100644 --- a/OpenDocumentReader/da.lproj/Localizable.strings +++ b/OpenDocumentReader/da.lproj/Localizable.strings @@ -131,6 +131,7 @@ "edit_delete_columns" = "Slet kolonne"; "edit_undo" = "Fortryd"; "edit_redo" = "Gentag"; +"edit_frame_prompt" = "Tryk for at tilføje tekst"; /* The marks a PDF takes */ "mark_pdf" = "Markér denne PDF"; diff --git a/OpenDocumentReader/de.lproj/Localizable.strings b/OpenDocumentReader/de.lproj/Localizable.strings index 0a6cd9b..2f80ea6 100644 --- a/OpenDocumentReader/de.lproj/Localizable.strings +++ b/OpenDocumentReader/de.lproj/Localizable.strings @@ -131,6 +131,7 @@ "edit_delete_columns" = "Spalte löschen"; "edit_undo" = "Rückgängig"; "edit_redo" = "Wiederholen"; +"edit_frame_prompt" = "Tippen, um Text hinzuzufügen"; /* The marks a PDF takes */ "mark_pdf" = "Dieses PDF markieren"; diff --git a/OpenDocumentReader/en.lproj/Localizable.strings b/OpenDocumentReader/en.lproj/Localizable.strings index 8a6ed05..02fef94 100644 --- a/OpenDocumentReader/en.lproj/Localizable.strings +++ b/OpenDocumentReader/en.lproj/Localizable.strings @@ -131,6 +131,8 @@ "edit_delete_columns" = "Delete column"; "edit_undo" = "Undo"; "edit_redo" = "Redo"; +/* What an empty text box on a slide shows while editing */ +"edit_frame_prompt" = "Tap to add text"; /* The marks a PDF takes */ "mark_pdf" = "Mark up this PDF"; diff --git a/OpenDocumentReader/es.lproj/Localizable.strings b/OpenDocumentReader/es.lproj/Localizable.strings index 136efb4..80d04a7 100644 --- a/OpenDocumentReader/es.lproj/Localizable.strings +++ b/OpenDocumentReader/es.lproj/Localizable.strings @@ -131,6 +131,7 @@ "edit_delete_columns" = "Eliminar columna"; "edit_undo" = "Deshacer"; "edit_redo" = "Rehacer"; +"edit_frame_prompt" = "Toca para añadir texto"; /* The marks a PDF takes */ "mark_pdf" = "Marcar este PDF"; diff --git a/OpenDocumentReader/fr.lproj/Localizable.strings b/OpenDocumentReader/fr.lproj/Localizable.strings index 89457ec..dc2af20 100644 --- a/OpenDocumentReader/fr.lproj/Localizable.strings +++ b/OpenDocumentReader/fr.lproj/Localizable.strings @@ -131,6 +131,7 @@ "edit_delete_columns" = "Supprimer la colonne"; "edit_undo" = "Annuler"; "edit_redo" = "Rétablir"; +"edit_frame_prompt" = "Touchez pour ajouter du texte"; /* The marks a PDF takes */ "mark_pdf" = "Annoter ce PDF"; diff --git a/OpenDocumentReader/ga.lproj/Localizable.strings b/OpenDocumentReader/ga.lproj/Localizable.strings index 7516e22..c6abb91 100644 --- a/OpenDocumentReader/ga.lproj/Localizable.strings +++ b/OpenDocumentReader/ga.lproj/Localizable.strings @@ -131,6 +131,7 @@ "edit_delete_columns" = "Scrios an colún"; "edit_undo" = "Cealaigh"; "edit_redo" = "Athdhéan"; +"edit_frame_prompt" = "Tapáil chun téacs a chur leis"; /* The marks a PDF takes */ "mark_pdf" = "Marcáil an PDF seo"; diff --git a/OpenDocumentReader/it.lproj/Localizable.strings b/OpenDocumentReader/it.lproj/Localizable.strings index 1d587ac..3fda288 100644 --- a/OpenDocumentReader/it.lproj/Localizable.strings +++ b/OpenDocumentReader/it.lproj/Localizable.strings @@ -131,6 +131,7 @@ "edit_delete_columns" = "Elimina colonna"; "edit_undo" = "Annulla"; "edit_redo" = "Ripeti"; +"edit_frame_prompt" = "Tocca per aggiungere testo"; /* The marks a PDF takes */ "mark_pdf" = "Annota questo PDF"; diff --git a/OpenDocumentReader/ja.lproj/Localizable.strings b/OpenDocumentReader/ja.lproj/Localizable.strings index bf5b5c5..9eb4f26 100644 --- a/OpenDocumentReader/ja.lproj/Localizable.strings +++ b/OpenDocumentReader/ja.lproj/Localizable.strings @@ -131,6 +131,7 @@ "edit_delete_columns" = "列を削除"; "edit_undo" = "元に戻す"; "edit_redo" = "やり直す"; +"edit_frame_prompt" = "タップしてテキストを追加"; /* The marks a PDF takes */ "mark_pdf" = "このPDFにマークを付ける"; diff --git a/OpenDocumentReader/pl.lproj/Localizable.strings b/OpenDocumentReader/pl.lproj/Localizable.strings index 08a46dc..961a704 100644 --- a/OpenDocumentReader/pl.lproj/Localizable.strings +++ b/OpenDocumentReader/pl.lproj/Localizable.strings @@ -131,6 +131,7 @@ "edit_delete_columns" = "Usuń kolumnę"; "edit_undo" = "Cofnij"; "edit_redo" = "Ponów"; +"edit_frame_prompt" = "Stuknij, aby dodać tekst"; /* The marks a PDF takes */ "mark_pdf" = "Oznacz ten PDF"; diff --git a/OpenDocumentReader/pt-BR.lproj/Localizable.strings b/OpenDocumentReader/pt-BR.lproj/Localizable.strings index f219d0d..9c166bd 100644 --- a/OpenDocumentReader/pt-BR.lproj/Localizable.strings +++ b/OpenDocumentReader/pt-BR.lproj/Localizable.strings @@ -131,6 +131,7 @@ "edit_delete_columns" = "Excluir coluna"; "edit_undo" = "Desfazer"; "edit_redo" = "Refazer"; +"edit_frame_prompt" = "Toque para adicionar texto"; /* The marks a PDF takes */ "mark_pdf" = "Marcar este PDF"; diff --git a/OpenDocumentReader/ru.lproj/Localizable.strings b/OpenDocumentReader/ru.lproj/Localizable.strings index 1cf2801..2eda103 100644 --- a/OpenDocumentReader/ru.lproj/Localizable.strings +++ b/OpenDocumentReader/ru.lproj/Localizable.strings @@ -131,6 +131,7 @@ "edit_delete_columns" = "Удалить столбец"; "edit_undo" = "Отменить"; "edit_redo" = "Повторить"; +"edit_frame_prompt" = "Коснитесь, чтобы добавить текст"; /* The marks a PDF takes */ "mark_pdf" = "Разметить этот PDF"; diff --git a/OpenDocumentReader/sl.lproj/Localizable.strings b/OpenDocumentReader/sl.lproj/Localizable.strings index 83662ce..8f67381 100644 --- a/OpenDocumentReader/sl.lproj/Localizable.strings +++ b/OpenDocumentReader/sl.lproj/Localizable.strings @@ -131,6 +131,7 @@ "edit_delete_columns" = "Izbriši stolpec"; "edit_undo" = "Razveljavi"; "edit_redo" = "Ponovi"; +"edit_frame_prompt" = "Tapnite za dodajanje besedila"; /* The marks a PDF takes */ "mark_pdf" = "Označi ta PDF"; diff --git a/OpenDocumentReader/tr.lproj/Localizable.strings b/OpenDocumentReader/tr.lproj/Localizable.strings index 27a232d..a9dc2ef 100644 --- a/OpenDocumentReader/tr.lproj/Localizable.strings +++ b/OpenDocumentReader/tr.lproj/Localizable.strings @@ -131,6 +131,7 @@ "edit_delete_columns" = "Sütunu sil"; "edit_undo" = "Geri al"; "edit_redo" = "Yinele"; +"edit_frame_prompt" = "Metin eklemek için dokunun"; /* The marks a PDF takes */ "mark_pdf" = "Bu PDF’i işaretle"; diff --git a/OpenDocumentReader/zh-Hans.lproj/Localizable.strings b/OpenDocumentReader/zh-Hans.lproj/Localizable.strings index bb40028..0724111 100644 --- a/OpenDocumentReader/zh-Hans.lproj/Localizable.strings +++ b/OpenDocumentReader/zh-Hans.lproj/Localizable.strings @@ -131,6 +131,7 @@ "edit_delete_columns" = "删除列"; "edit_undo" = "撤销"; "edit_redo" = "重做"; +"edit_frame_prompt" = "轻点以添加文本"; /* The marks a PDF takes */ "mark_pdf" = "标注此 PDF"; diff --git a/OpenDocumentReaderTests/EditWorkflowTests.swift b/OpenDocumentReaderTests/EditWorkflowTests.swift index f8f22e9..c269329 100644 --- a/OpenDocumentReaderTests/EditWorkflowTests.swift +++ b/OpenDocumentReaderTests/EditWorkflowTests.swift @@ -246,7 +246,8 @@ class EditWorkflowTests: XCTestCase { openDocument(where: "document.querySelectorAll('td').length > 0") XCTAssertTrue(controller.document?.isEditable ?? false) - XCTAssertTrue(barContains(controller.editButton)) + // the pencil comes with the page's load, a moment after its first cells + waitUntil { self.barContains(self.controller.editButton) } controller.toggleEdit(controller.editButton) waitForTools() @@ -340,6 +341,27 @@ class EditWorkflowTests: XCTestCase { XCTAssertTrue(barContains(controller.saveButton)) } + /// A slide's text boxes are outlined while editing, and an empty one asks + /// for text in the reader's language. + func testASlideOutlinesItsTextBoxesAndPromptsInTheReadersLanguage() throws { + documentURL = try copyFixture(ofType: "odp") + try present(documentURL) + openDocument() + + controller.toggleEdit(controller.editButton) + waitForEditablePage() + waitForTools() + + let prompt = NSLocalizedString("edit_frame_prompt", comment: "") + XCTAssertNotEqual(prompt, "edit_frame_prompt") + waitForPage(where: "document.querySelectorAll('.odr-text-frame').length > 0") + let property = "getComputedStyle(document.body).getPropertyValue('--odr-frame-prompt').trim()" + waitForPage(where: "\(property) !== ''") + // the page holds the text as a quoted css string + let shown = evaluate("JSON.parse(\(property))") as? String + XCTAssertEqual(shown, prompt) + } + // MARK: - formulas /// A3 is the sum of A1 and A2, and computes again as they change.