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

fix: don't add tooltip item if it's empty + fix encoding #179

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/rccore/rc_convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,15 @@ static Widget convertPushButton(const Data &data, const QString &dialogId, Data:
const auto &values = it->values.value(control.id);
if (values.count() == 1) {
pugi::xml_document document;
const pugi::xml_parse_result result = document.load_string(values.constFirst().toLatin1().constData(),
const pugi::xml_parse_result result = document.load_string(values.constFirst().toLocal8Bit().constData(),
Copy link
Member

Choose a reason for hiding this comment

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

How does this fix the encoding? toLocal8Bit is very strange to me, and I'm not sure if it supports accent and other things.
But I may be wrong, please explain (in any case, it should have a comment in the code).

pugi::parse_default | pugi::parse_declaration);
if (result) {
const auto node = document.select_node("MFCButton_Tooltip");
if (!node.node().empty()) {
widget.properties["toolTip"] = node.node().text().as_string();
const QString toolTip = QString::fromLatin1(node.node().text().as_string());
if (!toolTip.isEmpty()) {
widget.properties["toolTip"] = toolTip;
}
}
}
}
Expand Down
Loading