Kaydet (Commit) 0a6e0840 authored tarafından rbuj's avatar rbuj Kaydeden (comit) Noel Grandin

xmerge: Use J2SE 5.0 String.{replace|contains}

Replace "String.indexOf(String str)!=-1" with String.contains(String str)
Use J2SE 5.0 String String.replace(CharSequence target, CharSequence replacement).
Format code in needsMask function.

Change-Id: I787a61c4c090f95fb3862390cc1198f7209163a3
Reviewed-on: https://gerrit.libreoffice.org/10659Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 981e2dcd
......@@ -301,20 +301,19 @@ public class XMergeBridge {
}
public String needsMask(String origString){
if (origString.indexOf("&")!=-1){
origString=replace(origString,"&","&amp;");
if (origString.contains("&")) {
origString = origString.replace("&","&amp;");
}
if (origString.indexOf("\"")!=-1){
origString=replace(origString,"\"","&quot;");
if (origString.contains("\"")) {
origString = origString.replace("\"","&quot;");
}
if (origString.indexOf("<")!=-1){
origString=replace(origString,"<","&lt;");
if (origString.contains("<")) {
origString = origString.replace("<","&lt;");
}
if (origString.indexOf(">")!=-1){
origString=replace(origString,">","&gt;");
if (origString.contains(">")) {
origString = origString.replace(">","&gt;");
}
return origString;
}
......@@ -545,7 +544,7 @@ public class XMergeBridge {
private String getPath(URI uri){
String path = uri.getPath();
String opSys=System.getProperty("os.name");
if(opSys.indexOf("Windows")!=-1){
if(opSys.contains("Windows")){
path= path.replace('/','\\');
path = path.substring(1);
}
......
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