Skip to content
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

Add removeEscapeCharFromText() function to 'base::string' #88

Closed
wants to merge 1 commit into from

Conversation

Gasparoken
Copy link
Member

This addition is needed in the PR: aseprite/aseprite#4453 to solve issue: aseprite/aseprite#4387 (Duplicate shortcut key configuration items in Keyboard shortcuts)

Copy link
Collaborator

@aseprite-bot aseprite-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

while (int chr = decode.next()) {
if (chr == escapeChar) {
chr = decode.next();
if (!chr)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: implicit conversion 'int' -> bool [readability-implicit-bool-conversion]

Suggested change
if (!chr)
if (chr == 0)

@@ -20,7 +20,9 @@ namespace base {

std::string string_to_lower(const std::string& original);
std::string string_to_upper(const std::string& original);

std::string removeEscapeCharFromText(const std::string& original,
const int escapeChar);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: parameter 'escapeChar' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]

Suggested change
const int escapeChar);
int escapeChar);

@dacap
Copy link
Member

dacap commented May 22, 2024

This function is too Aseprite-specific (mainly from the ui-lib). You can just add a function to ui (probably ui/intern.h).

@dacap dacap closed this May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants