mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-26 04:58:07 +00:00
pipe comments-1: fixes for comments (10 tests)
This commit is contained in:
@@ -186,6 +186,9 @@ impl PdfCraftApp {
|
||||
}
|
||||
return;
|
||||
}
|
||||
// An explicit empty paste can fall back to the app's copied comments, after object and
|
||||
// image precedence has been resolved using the actual clipboard contents.
|
||||
let text = pasted.and_then(|c| c.text.as_deref()).filter(|t| t.is_empty()).map(str::to_owned).or(text);
|
||||
if let Some(text) = text {
|
||||
if !text.is_empty() {
|
||||
self.last_copied_image = None;
|
||||
|
||||
@@ -5133,7 +5133,7 @@ fn comment_menu_rows_follow_permissions_and_run_their_action() {
|
||||
assert_eq!(h.state().views[0].session.comments.selection(), vec![(0, 0)], "{what}: the click selected the comment");
|
||||
}
|
||||
right_click_pt(&mut h, point);
|
||||
let disabled = h.get_by_label(label).accesskit_node().is_disabled();
|
||||
let disabled = h.get_by_role_and_label(Role::MenuItem, label).accesskit_node().is_disabled();
|
||||
assert_eq!(disabled, matches!(does, Does::Disabled), "{what}: the row is greyed out only where the rights forbid it");
|
||||
if disabled {
|
||||
h.key_press(egui::Key::Escape);
|
||||
@@ -5143,7 +5143,7 @@ fn comment_menu_rows_follow_permissions_and_run_their_action() {
|
||||
assert_eq!(h.state().session.get(id).unwrap().can_undo(), None, "{what}: no edit was made");
|
||||
continue;
|
||||
}
|
||||
h.get_by_label(label).click();
|
||||
h.get_by_role_and_label(Role::MenuItem, label).click();
|
||||
h.run_steps(4);
|
||||
match does {
|
||||
Does::Marks => assert!(comments(&h).iter().any(|a| a.state.as_deref() == Some("Marked")), "{what}"),
|
||||
|
||||
Reference in New Issue
Block a user