Merge branch 'dev-1.5' into development

This commit is contained in:
anhefti 2023-05-16 13:35:31 +02:00
commit 9ef49a8560
2 changed files with 5 additions and 10 deletions

View file

@ -18,6 +18,7 @@ import java.util.function.BooleanSupplier;
import java.util.function.Consumer; import java.util.function.Consumer;
import java.util.function.Function; import java.util.function.Function;
import org.apache.commons.text.StringEscapeUtils;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
@ -151,7 +152,9 @@ public class MonitoringRunningExam implements TemplateComposer {
final Composite content = this.pageService.getWidgetFactory().defaultPageLayout( final Composite content = this.pageService.getWidgetFactory().defaultPageLayout(
pageContext.getParent(), pageContext.getParent(),
new LocTextKey("sebserver.monitoring.exam", exam.name)); new LocTextKey(
"sebserver.monitoring.exam",
StringEscapeUtils.escapeHtml4(exam.name)));
final Composite tablePane = new Composite(content, SWT.NONE); final Composite tablePane = new Composite(content, SWT.NONE);
tablePane.setLayout(new GridLayout()); tablePane.setLayout(new GridLayout());

View file

@ -11,9 +11,7 @@ package ch.ethz.seb.sebserver.gui.service.i18n.impl;
import java.util.Locale; import java.util.Locale;
import java.util.function.Consumer; import java.util.function.Consumer;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.text.StringEscapeUtils;
import org.eclipse.rap.rwt.RWT; import org.eclipse.rap.rwt.RWT;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Button;
@ -279,14 +277,8 @@ public final class PolyglotPageServiceImpl implements PolyglotPageService {
final I18nSupport i18nSupport) { final I18nSupport i18nSupport) {
return label -> { return label -> {
if (locTextKey != null) { if (locTextKey != null) {
final String text = i18nSupport.getText(locTextKey); label.setText(i18nSupport.getText(locTextKey));
if (BooleanUtils.toBoolean((Boolean) label.getData(RWT.MARKUP_ENABLED))) {
label.setText(StringEscapeUtils.escapeHtml4(text));
} else {
label.setText(text);
}
} }
if (i18nSupport.hasText(locToolTipKey)) { if (i18nSupport.hasText(locToolTipKey)) {
label.setToolTipText(Utils.formatLineBreaks(i18nSupport.getText(locToolTipKey))); label.setToolTipText(Utils.formatLineBreaks(i18nSupport.getText(locToolTipKey)));