Commit 94dcb11b authored by Piotr Gawron's avatar Piotr Gawron
Browse files

BackgroundColor should be followed by ":"

parent eac90770
Pipeline #13317 passed with stage
in 12 minutes and 5 seconds
...@@ -15,6 +15,8 @@ minerva (14.0.0~beta.0) unstable; urgency=low ...@@ -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: user role introduced in edit user dialog (#924)
* Small improvement: tab with list of glyps is available when adding project * Small improvement: tab with list of glyps is available when adding project
with glyphs (#925) 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 * Bug fix: work on FF Private Window mode could cause logout or raise an
error on when opening new tab with minerva (#892) error on when opening new tab with minerva (#892)
* Bug fix: fetching list of miRnas resulted sometimes in "Internal Server * Bug fix: fetching list of miRnas resulted sometimes in "Internal Server
......
...@@ -526,7 +526,7 @@ public class LayerXmlParser { ...@@ -526,7 +526,7 @@ public class LayerXmlParser {
String lines[] = notes.split("[\n\r]+"); String lines[] = notes.split("[\n\r]+");
StringBuilder result = new StringBuilder(""); StringBuilder result = new StringBuilder("");
for (String line : lines) { for (String line : lines) {
if (!line.startsWith("BackgroundColor=")) { if (!line.startsWith("BackgroundColor=") && !line.startsWith("BackgroundColor:")) {
result.append(line + "\n"); result.append(line + "\n");
} }
} }
...@@ -536,8 +536,8 @@ public class LayerXmlParser { ...@@ -536,8 +536,8 @@ public class LayerXmlParser {
Color extractBackgroundColor(String notes) { Color extractBackgroundColor(String notes) {
String lines[] = notes.split("[\n\r]+"); String lines[] = notes.split("[\n\r]+");
for (String line : lines) { for (String line : lines) {
if (line.startsWith("BackgroundColor=")) { if (line.startsWith("BackgroundColor=") ||line.startsWith("BackgroundColor:")) {
String colorString = line.replace("BackgroundColor=", ""); String colorString = line.replace("BackgroundColor=", "").replace("BackgroundColor:", "");
return new ColorParser().parse(colorString); return new ColorParser().parse(colorString);
} }
} }
...@@ -560,7 +560,7 @@ public class LayerXmlParser { ...@@ -560,7 +560,7 @@ public class LayerXmlParser {
notes = ""; notes = "";
} }
if (!layer.getBackgroundColor().equals(Color.LIGHT_GRAY)) { 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(notes);
result.append("\n</celldesigner:layerNotes>"); result.append("\n</celldesigner:layerNotes>");
......
...@@ -285,6 +285,12 @@ public class LayerXmlParserTest extends CellDesignerTestFunctions { ...@@ -285,6 +285,12 @@ public class LayerXmlParserTest extends CellDesignerTestFunctions {
assertNotNull(color); assertNotNull(color);
} }
@Test
public void testExtractBackgroundColorWithColon() throws Exception {
Color color = parser.extractBackgroundColor("dcxvxcvxcvx\nBackgroundColor:#ccffcc");
assertNotNull(color);
}
@Test @Test
public void testExtractNonExistingBackgroundColor() throws Exception { public void testExtractNonExistingBackgroundColor() throws Exception {
Color color = parser.extractBackgroundColor("dcxvxcvxcvx\nBackgroundCffcc"); Color color = parser.extractBackgroundColor("dcxvxcvxcvx\nBackgroundCffcc");
...@@ -297,6 +303,12 @@ public class LayerXmlParserTest extends CellDesignerTestFunctions { ...@@ -297,6 +303,12 @@ public class LayerXmlParserTest extends CellDesignerTestFunctions {
assertFalse(notes.contains("BackgroundColor")); assertFalse(notes.contains("BackgroundColor"));
} }
@Test
public void testRemoveBackgroundColorWithColon() throws Exception {
String notes = parser.removeBackgroundColor("dcxvxcvxcvx\nBackgroundColor:#ccffcc");
assertFalse(notes.contains("BackgroundColor"));
}
@Test @Test
public void testRemoveNonExistingBackgroundColor() throws Exception { public void testRemoveNonExistingBackgroundColor() throws Exception {
String notes = parser.removeBackgroundColor("dcxvxcvxcvx\nBckgroundColor=#ccffcc"); 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