Commit 6a8cc949 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '929-change-in-backgroungcolor-term-on' into 'master'

Resolve "change in BackgroungColor term = on :"

Closes #929

See merge request !919
parents f95fe237 94dcb11b
Pipeline #13319 canceled with stage
in 1 minute and 47 seconds
......@@ -15,6 +15,8 @@ minerva (14.0.0~beta.0) unstable; urgency=low
* Small improvement: user role introduced in edit user dialog (#924)
* Small improvement: tab with list of glyps is available when adding project
with glyphs (#925)
* Small improvement: BackgroundColor parameter should be assigned using ":"
character (#929)
* Bug fix: work on FF Private Window mode could cause logout or raise an
error on when opening new tab with minerva (#892)
* Bug fix: fetching list of miRnas resulted sometimes in "Internal Server
......
......@@ -526,7 +526,7 @@ public class LayerXmlParser {
String lines[] = notes.split("[\n\r]+");
StringBuilder result = new StringBuilder("");
for (String line : lines) {
if (!line.startsWith("BackgroundColor=")) {
if (!line.startsWith("BackgroundColor=") && !line.startsWith("BackgroundColor:")) {
result.append(line + "\n");
}
}
......@@ -536,8 +536,8 @@ public class LayerXmlParser {
Color extractBackgroundColor(String notes) {
String lines[] = notes.split("[\n\r]+");
for (String line : lines) {
if (line.startsWith("BackgroundColor=")) {
String colorString = line.replace("BackgroundColor=", "");
if (line.startsWith("BackgroundColor=") ||line.startsWith("BackgroundColor:")) {
String colorString = line.replace("BackgroundColor=", "").replace("BackgroundColor:", "");
return new ColorParser().parse(colorString);
}
}
......@@ -560,7 +560,7 @@ public class LayerXmlParser {
notes = "";
}
if (!layer.getBackgroundColor().equals(Color.LIGHT_GRAY)) {
notes += "\nBackgroundColor=" + new ColorParser().colorToHtml(layer.getBackgroundColor());
notes += "\nBackgroundColor:" + new ColorParser().colorToHtml(layer.getBackgroundColor());
}
result.append(notes);
result.append("\n</celldesigner:layerNotes>");
......
......@@ -285,6 +285,12 @@ public class LayerXmlParserTest extends CellDesignerTestFunctions {
assertNotNull(color);
}
@Test
public void testExtractBackgroundColorWithColon() throws Exception {
Color color = parser.extractBackgroundColor("dcxvxcvxcvx\nBackgroundColor:#ccffcc");
assertNotNull(color);
}
@Test
public void testExtractNonExistingBackgroundColor() throws Exception {
Color color = parser.extractBackgroundColor("dcxvxcvxcvx\nBackgroundCffcc");
......@@ -297,6 +303,12 @@ public class LayerXmlParserTest extends CellDesignerTestFunctions {
assertFalse(notes.contains("BackgroundColor"));
}
@Test
public void testRemoveBackgroundColorWithColon() throws Exception {
String notes = parser.removeBackgroundColor("dcxvxcvxcvx\nBackgroundColor:#ccffcc");
assertFalse(notes.contains("BackgroundColor"));
}
@Test
public void testRemoveNonExistingBackgroundColor() throws Exception {
String notes = parser.removeBackgroundColor("dcxvxcvxcvx\nBckgroundColor=#ccffcc");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment