From 52e235e49177c74c4ab9dca640b88068ce7730d1 Mon Sep 17 00:00:00 2001
From: srosse <stephane.rosse@frentix.com>
Date: Tue, 23 Jun 2020 13:42:31 +0200
Subject: [PATCH] OO-4755: remove the immutable flag of the image component in
 ceditor

---
 .../ceditor/ui/HTMLRawEditorController.java        |  4 ++--
 .../modules/ceditor/ui/ImageRunController.java     |  4 +---
 .../modules/forms/ui/RubricEditorController.java   | 14 +++++++-------
 3 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/src/main/java/org/olat/modules/ceditor/ui/HTMLRawEditorController.java b/src/main/java/org/olat/modules/ceditor/ui/HTMLRawEditorController.java
index a89d0c49ec3..30aa40be3eb 100644
--- a/src/main/java/org/olat/modules/ceditor/ui/HTMLRawEditorController.java
+++ b/src/main/java/org/olat/modules/ceditor/ui/HTMLRawEditorController.java
@@ -107,7 +107,7 @@ public class HTMLRawEditorController extends FormBasicController implements Page
 
 	@Override
 	public List<Link> getOptionLinks() {
-		List<Link> links = new ArrayList<>(2);
+		List<Link> links = new ArrayList<>(5);
 		links.add(column4Link);
 		links.add(column3Link);
 		links.add(column2Link);
@@ -131,7 +131,7 @@ public class HTMLRawEditorController extends FormBasicController implements Page
 		htmlItem.getEditorConfiguration().setAutoResizeEnabled(true, -1, 40, 0);
 
 		String formattedContent = Formatter.formatLatexFormulas(content);
-		staticItem = uifactory.addStaticTextElement(cmpId + "_static", formattedContent, formLayout);
+		staticItem = uifactory.addStaticTextElement(cmpId + "_static", null, formattedContent, formLayout);
 		staticItem.setDomWrapperElement(DomWrapperElement.div); // content contains multiple P elements
 		
 		((FormLayoutContainer)formLayout).contextPut("htmlCmpId", cmpId);
diff --git a/src/main/java/org/olat/modules/ceditor/ui/ImageRunController.java b/src/main/java/org/olat/modules/ceditor/ui/ImageRunController.java
index dd8414ca466..257560519ef 100644
--- a/src/main/java/org/olat/modules/ceditor/ui/ImageRunController.java
+++ b/src/main/java/org/olat/modules/ceditor/ui/ImageRunController.java
@@ -26,7 +26,6 @@ import org.olat.core.commons.services.image.Size;
 import org.olat.core.gui.UserRequest;
 import org.olat.core.gui.components.Component;
 import org.olat.core.gui.components.image.ImageComponent;
-import org.olat.core.gui.components.panel.StackedPanel;
 import org.olat.core.gui.components.velocity.VelocityContainer;
 import org.olat.core.gui.control.Event;
 import org.olat.core.gui.control.WindowControl;
@@ -104,8 +103,7 @@ public class ImageRunController extends BasicController implements PageRunElemen
 		}
 		
 		mainVC.setDomReplacementWrapperRequired(false);
-		StackedPanel mainPanel = putInitialPanel(mainVC);
-		mainPanel.setDomReplaceable(false);
+		putInitialPanel(mainVC);
 	}
 	
 	public void updateImageSettings(ImageSettings settings, DublinCoreMetadata meta) {
diff --git a/src/main/java/org/olat/modules/forms/ui/RubricEditorController.java b/src/main/java/org/olat/modules/forms/ui/RubricEditorController.java
index d333eabcdae..8deaafaa705 100644
--- a/src/main/java/org/olat/modules/forms/ui/RubricEditorController.java
+++ b/src/main/java/org/olat/modules/forms/ui/RubricEditorController.java
@@ -238,14 +238,14 @@ public class RubricEditorController extends FormBasicController implements PageE
 		String insufficientLowerBound = rubric.getLowerBoundInsufficient() != null
 				? String.valueOf(rubric.getLowerBoundInsufficient())
 				: null;
-		lowerBoundInsufficientEl = uifactory.addTextElement("rubric.lower.bound.insufficient", 4,
+		lowerBoundInsufficientEl = uifactory.addTextElement("rubric.lower.bound.insufficient", null, 4,
 				insufficientLowerBound, insufficientCont);
 		lowerBoundInsufficientEl.setDomReplacementWrapperRequired(false);
 		lowerBoundInsufficientEl.setDisplaySize(4);
 		String insufficientUpperBound = rubric.getUpperBoundInsufficient() != null
 				? String.valueOf(rubric.getUpperBoundInsufficient())
 				: null;
-		upperBoundInsufficientEl = uifactory.addTextElement("rubric.upper.bound.insufficient", 4,
+		upperBoundInsufficientEl = uifactory.addTextElement("rubric.upper.bound.insufficient", null, 4,
 				insufficientUpperBound, insufficientCont);
 		upperBoundInsufficientEl.setDomReplacementWrapperRequired(false);
 		upperBoundInsufficientEl.setDisplaySize(4);
@@ -260,12 +260,12 @@ public class RubricEditorController extends FormBasicController implements PageE
 		neutralCont.setHelpTextKey("rubric.rating.help", new String[] { translate("rubric.neutral")} );
 		String neutralLowerBound = rubric.getLowerBoundNeutral() != null ? String.valueOf(rubric.getLowerBoundNeutral())
 				: null;
-		lowerBoundNeutralEl = uifactory.addTextElement("rubric.lower.bound.neutral", 4, neutralLowerBound, neutralCont);
+		lowerBoundNeutralEl = uifactory.addTextElement("rubric.lower.bound.neutral", null, 4, neutralLowerBound, neutralCont);
 		lowerBoundNeutralEl.setDomReplacementWrapperRequired(false);
 		lowerBoundNeutralEl.setDisplaySize(4);
 		String neutralUpperBound = rubric.getUpperBoundNeutral() != null ? String.valueOf(rubric.getUpperBoundNeutral())
 				: null;
-		upperBoundNeutralEl = uifactory.addTextElement("rubric.upper.bound.neutral", 4, neutralUpperBound, neutralCont);
+		upperBoundNeutralEl = uifactory.addTextElement("rubric.upper.bound.neutral", null, 4, neutralUpperBound, neutralCont);
 		upperBoundNeutralEl.setDomReplacementWrapperRequired(false);
 		upperBoundNeutralEl.setDisplaySize(4);
 
@@ -280,14 +280,14 @@ public class RubricEditorController extends FormBasicController implements PageE
 		String sufficientLowerBound = rubric.getLowerBoundSufficient() != null
 				? String.valueOf(rubric.getLowerBoundSufficient())
 				: null;
-		lowerBoundSufficientEl = uifactory.addTextElement("rubric.lower.bound.sufficient", 4, sufficientLowerBound,
+		lowerBoundSufficientEl = uifactory.addTextElement("rubric.lower.bound.sufficient", null, 4, sufficientLowerBound,
 				sufficientCont);
 		lowerBoundSufficientEl.setDomReplacementWrapperRequired(false);
 		lowerBoundSufficientEl.setDisplaySize(4);
 		String sufficientUpperBound = rubric.getUpperBoundSufficient() != null
 				? String.valueOf(rubric.getUpperBoundSufficient())
 				: null;
-		upperBoundSufficientEl = uifactory.addTextElement("rubric.upper.bound.sufficient", 4, sufficientUpperBound,
+		upperBoundSufficientEl = uifactory.addTextElement("rubric.upper.bound.sufficient", null, 4, sufficientUpperBound,
 				sufficientCont);
 		upperBoundSufficientEl.setDomReplacementWrapperRequired(false);
 		upperBoundSufficientEl.setDisplaySize(4);
@@ -490,7 +490,7 @@ public class RubricEditorController extends FormBasicController implements PageE
 		
 		// weight
 		String weight = slider.getWeight() != null? slider.getWeight().toString(): "";
-		TextElement weightEl = uifactory.addTextElement("weight" + count.incrementAndGet(), 4, weight, flc);
+		TextElement weightEl = uifactory.addTextElement("weight" + count.incrementAndGet(), null, 4, weight, flc);
 		weightEl.setElementCssClass("o_slider_weight");
 		weightEl.setExampleKey("slider.weight", null);
 		weightEl.setEnabled(!restrictedEditWeight);
-- 
GitLab