mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-26 19:19:10 -06:00
M12: the XFA notice bar starts its first layout note as a sentence
Layout notes are lowercase clauses joined with semicolons, and the bar
put the first right after the layout's own sentence ('11 fields. the
form's usage rights...'). The first note now starts with a capital.
This commit is contained in:
@@ -4494,8 +4494,12 @@ fn notices(
|
||||
let mut text =
|
||||
crate::i18n::fmt(tl!("Dynamic XFA form laid out from its template: {pages}, {fields}."), &[("pages", &pages), ("fields", &fields)]);
|
||||
if !x.warnings.is_empty() {
|
||||
// The notes are clauses ("a picture is left out"); the first starts a sentence here.
|
||||
let notes = x.warnings.join("; ");
|
||||
let mut chars = notes.chars();
|
||||
text.push(' ');
|
||||
text.push_str(&x.warnings.join("; "));
|
||||
text.extend(chars.next().into_iter().flat_map(char::to_uppercase));
|
||||
text.push_str(chars.as_str());
|
||||
text.push('.');
|
||||
}
|
||||
Some(("text-cursor-input", text, true))
|
||||
|
||||
@@ -66,8 +66,8 @@ fn a_dynamic_xfa_form_is_laid_out_and_filled() {
|
||||
fn a_dynamic_xfa_form_says_when_laying_it_out_took_its_usage_rights_off() {
|
||||
let xdp = pdfcraft_xfa::fixtures::template(2);
|
||||
let h = open(pdfcraft_xfa::fixtures::usage_rights_shell(&xdp, "", false));
|
||||
h.get_by_label_contains("laid out from its template: 2 pages, 11 fields");
|
||||
h.get_by_label_contains("usage rights were removed");
|
||||
// The note starts its own sentence after the layout's.
|
||||
h.get_by_label_contains("laid out from its template: 2 pages, 11 fields. The form's usage rights were removed");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user