mirror of
https://github.com/storytold/wordcraft.git
synced 2026-12-04 11:46:53 -06:00
Merge pull request #8728
This commit is contained in:
@@ -952,11 +952,9 @@ impl Scan {
|
||||
self.x += w;
|
||||
}
|
||||
_ => {
|
||||
// A right tab's room grows from nothing with its text (a tab moved on from the
|
||||
// line before may still hold the width it had there).
|
||||
if stop.align == TabAlign::Right
|
||||
&& let Some(c) = pl.clusters.get_mut(j)
|
||||
{
|
||||
// Its room grows from nothing with its text (a tab moved on from the line before
|
||||
// may still hold the width it had there).
|
||||
if let Some(c) = pl.clusters.get_mut(j) {
|
||||
c.adv = 0.0;
|
||||
}
|
||||
self.pending_tab = Some((j, stop, self.x));
|
||||
|
||||
@@ -2058,6 +2058,29 @@ fn right_tab_past_the_right_indent_takes_its_number_up_to_the_stop() {
|
||||
assert!(close > 0, "no entry whose text ends within a digit of the indent");
|
||||
}
|
||||
|
||||
/// A centre tab moved onto the next line with its text starts with no room there, as a right
|
||||
/// tab does: it doesn't keep the width it had on the line before, so the text is centred on the
|
||||
/// stop (#8683).
|
||||
#[test]
|
||||
fn a_centre_tab_moved_to_the_next_line_centres_its_text_on_the_stop() {
|
||||
use wordcraft_doc::props::{TabAlign, TabLeader, TabStop};
|
||||
crate::test_fonts();
|
||||
for n in 74..=83 {
|
||||
let text = format!("{}\tWXYZWXWXYZ1.5", "x".repeat(n));
|
||||
let len = text.chars().count();
|
||||
let mut d = Document::from_text(&text);
|
||||
d.format_paragraphs(&Pos::body(0, 0), &Pos::body(0, 0), &|p| {
|
||||
p.tabs = Some(vec![TabStop { pos: 460.0, align: TabAlign::Center, leader: TabLeader::None }]);
|
||||
})
|
||||
.unwrap();
|
||||
let l = lay(&d);
|
||||
let start = l.caret(&Pos::body(0, n + 1)).unwrap().x;
|
||||
let end = l.caret(&Pos::body(0, len)).unwrap().x;
|
||||
let mid = (start + end) / 2.0;
|
||||
assert!((mid - (72.0 + 460.0)).abs() < 0.5, "n={n}: text after the centre tab is centred at {mid}, expected {}", 72.0 + 460.0);
|
||||
}
|
||||
}
|
||||
|
||||
/// A left tab whose only stop is past the right indent wraps; on the next line it still can't
|
||||
/// reach that stop, so it takes no room there and its text starts at the indent instead of
|
||||
/// going to a line of its own.
|
||||
|
||||
@@ -439,6 +439,7 @@ The front-of-text opt-out is retained from the earlier implementation; this patc
|
||||
| 2026-10-27 | trivial | 2026-10-27 · #4533 review: numeric REF updates lazily index body bookmarks once per update, retaining the first body bookmark for duplicate names. Unsupported switches and ordinary REF/PAGEREF behavior are unchanged; a synthetic 64-reference regression covers repeated updates and duplicate names. Estimates unchanged. |
|
||||
| 2026-10-27 | trivial | 2026-10-27 · #4533: numeric REF fields use paragraph list numbers for no/full/relative context, reusing bounded numbering. Shared context already embedded in a level label is removed; merged-away cells do not count. Unsupported separator/text/position switches and ambiguous contexts or delimiter-free joins retain cached results. Synthetic OOXML regressions; no native Word or real-document validation, estimates unchanged. |
|
||||
| 2026-10-27 | trivial | A right or decimal tab past the right indent (a TOC entry's page number at the margin) keeps its text on the line while it ends before the stop, also when the text before the tab ends less than a digit short of the indent; measured in Word for Mac 16.93. `layout::tests::right_tab_past_the_right_indent_takes_its_number_up_to_the_stop` |
|
||||
| 2026-12-03 | trivial | A centre tab moved on to the next line with its text starts with no room, as a right tab does, instead of keeping the width it had on the line before, so its text is centred on the stop (#8683). `layout::tests::a_centre_tab_moved_to_the_next_line_centres_its_text_on_the_stop` |
|
||||
| 2026-10-20 | trivial | A click below a floating table, outside its cells, goes to the paragraph beside or after it instead of a cell of its last row, as checked in Word (#2038) |
|
||||
| 2026-10-19 | trivial | A right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, starts the next line with its text instead of ending the line (a TOC entry's page number keeps its leader); a left tab still past the right indent there takes no room (#1840) |
|
||||
| 2026-10-19 | trivial | Justified lines (compatibility mode 15) shrink their spaces to fit one more word by at most a quarter of the spaces' width (was a fifth) and by at most 0.355 of that word's own width with the space before it. Measured in Word for Mac with synthetic justified paragraphs: words of 2.7 to 80 pt, spaces of 3.3 and 6.7 pt, only justified text, last lines included, never in modes 12 and 14. A real paper's justified abstract now breaks like Word on all 23 lines (3 before); on 180 real-world papers, page counts matching Word went from 139 to 142, none further |
|
||||
|
||||
Reference in New Issue
Block a user