logic: fixed crash when specifying an unknown text encoding in appsettings
* also: updated jar dependencies
This commit is contained in:
@@ -49,14 +49,22 @@ QtCodeField::QtCodeField(
|
||||
}
|
||||
|
||||
QTextCodec* codec = QTextCodec::codecForName(ApplicationSettings::getInstance()->getTextEncoding().c_str());
|
||||
QString convertedDisplayCode(codec->toUnicode(displayCode.c_str()));
|
||||
setPlainText(convertedDisplayCode);
|
||||
createLineLengthCache();
|
||||
if (displayCode.size() != convertedDisplayCode.length())
|
||||
if (codec)
|
||||
{
|
||||
LOG_INFO("Converting displayed code to " + codec->name().toStdString() + " resulted in offset of source locations. Correcting this now.");
|
||||
createMultibyteCharacterLocationCache();
|
||||
QString convertedDisplayCode(codec->toUnicode(displayCode.c_str()));
|
||||
setPlainText(convertedDisplayCode);
|
||||
if (displayCode.size() != convertedDisplayCode.length())
|
||||
{
|
||||
LOG_INFO("Converting displayed code to " + codec->name().toStdString() + " resulted in offset of source locations. Correcting this now.");
|
||||
createMultibyteCharacterLocationCache();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setPlainText(displayCode.c_str());
|
||||
}
|
||||
|
||||
createLineLengthCache();
|
||||
|
||||
this->setMouseTracking(true);
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace utility
|
||||
"org.eclipse.core.contenttype-3.6.0.jar",
|
||||
"org.eclipse.core.expressions-3.6.0.jar",
|
||||
"org.eclipse.core.filesystem-1.7.0.jar",
|
||||
"org.eclipse.core.jobs-3.9.0.jar",
|
||||
"org.eclipse.core.jobs-3.9.1.jar",
|
||||
"org.eclipse.core.resources-3.12.0.jar",
|
||||
"org.eclipse.core.runtime-3.13.0.jar",
|
||||
"org.eclipse.equinox.app-1.3.400.jar",
|
||||
@@ -24,7 +24,7 @@ namespace utility
|
||||
"org.eclipse.equinox.preferences-3.7.0.jar",
|
||||
"org.eclipse.equinox.registry-3.7.0.jar",
|
||||
"org.eclipse.jdt.core-3.13.0.jar",
|
||||
"org.eclipse.osgi-3.12.0.jar",
|
||||
"org.eclipse.osgi-3.12.50.jar",
|
||||
"org.eclipse.text-3.6.100.jar",
|
||||
"slf4j-api-1.7.10.jar",
|
||||
"slf4j-simple-1.7.10.jar"
|
||||
|
||||
Reference in New Issue
Block a user