-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pagenumbers CleanupAction #273
Conversation
2e6dc56
to
3e28246
Compare
3e28246
to
80a071f
Compare
…ave action now" This reverts commit 99bfb77.
// replace | ||
String newValue = matcher.replaceFirst(replace); | ||
// replacement? | ||
if(!newValue.equals(cleanValue)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just return the new value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to return the initial value and not the cleaned value if page numbers regex does not match?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok. then leave this untouched.
// new value | ||
String newValue = entry.getField("pages"); | ||
// undo action | ||
ce.addEdit(new UndoableFieldChange(entry, "pages", oldValue, newValue)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should only create the undo action if anything was actually changed (oldValue != newValue).
Replace pages field by num--num or keep existing field if Regex is not matching.
Pages field should only allow page range, i.e.
num--num
or page set1,23,35
.Algorithm: