Browse Source
Merge in CORE/base-third from ~HUGH.C/base-third:feature/10.0 to feature/10.0 * commit 'e9065db9555dc28aa65ec35998b4abf92398644d': 无jira任务,反向合代码引起的错误(堵塞打包)research/11.0
Hugh.C
5 years ago
3 changed files with 50 additions and 53 deletions
@ -1,48 +1,48 @@ |
|||||||
package com.fr.third.v2.lowagie.text.html.Utils; |
package com.fr.third.v2.lowagie.text.html.utils; |
||||||
|
|
||||||
import com.fr.third.v2.lowagie.text.html.CSSUtils; |
import com.fr.third.v2.lowagie.text.html.CSSUtils; |
||||||
import com.fr.third.v2.lowagie.text.html.simpleparser.ChainedProperties; |
import com.fr.third.v2.lowagie.text.html.simpleparser.ChainedProperties; |
||||||
import java.util.HashMap; |
import java.util.HashMap; |
||||||
import java.util.Map; |
import java.util.Map; |
||||||
|
|
||||||
/** |
/** |
||||||
* @author Hugh.C |
* @author Hugh.C |
||||||
* @version 1.0 |
* @version 1.0 |
||||||
* Created by Hugh.C on 2020/2/26 |
* Created by Hugh.C on 2020/2/26 |
||||||
*/ |
*/ |
||||||
public class BackgroundUtil { |
public class BackgroundUtil { |
||||||
|
|
||||||
public static Map<String, String> parse2RulesMap(ChainedProperties props) { |
public static Map<String, String> parse2RulesMap(ChainedProperties props) { |
||||||
Map<String, String> backgroundRules = new HashMap<String, String>(); |
Map<String, String> backgroundRules = new HashMap<String, String>(); |
||||||
String value = props.getProperty("bgcolor"); |
String value = props.getProperty("bgcolor"); |
||||||
if (value != null) { |
if (value != null) { |
||||||
backgroundRules.put("background-color", value); |
backgroundRules.put("background-color", value); |
||||||
} |
} |
||||||
value = props.getLastChainProperty("background-size"); |
value = props.getLastChainProperty("background-size"); |
||||||
if (value != null) { |
if (value != null) { |
||||||
backgroundRules.put("background-size", value); |
backgroundRules.put("background-size", value); |
||||||
} |
} |
||||||
value = props.getLastChainProperty("background"); |
value = props.getLastChainProperty("background"); |
||||||
if (value != null) { |
if (value != null) { |
||||||
Map<String, String> backgroundStyles = CSSUtils.processBackground(value); |
Map<String, String> backgroundStyles = CSSUtils.processBackground(value); |
||||||
backgroundRules.putAll(backgroundStyles); |
backgroundRules.putAll(backgroundStyles); |
||||||
} |
} |
||||||
value = props.getLastChainProperty("background-color"); |
value = props.getLastChainProperty("background-color"); |
||||||
if (value != null) { |
if (value != null) { |
||||||
backgroundRules.put("background-color", value); |
backgroundRules.put("background-color", value); |
||||||
} |
} |
||||||
value = props.getLastChainProperty("background-position"); |
value = props.getLastChainProperty("background-position"); |
||||||
if (value != null) { |
if (value != null) { |
||||||
backgroundRules.put("background-position", value); |
backgroundRules.put("background-position", value); |
||||||
} |
} |
||||||
value = props.getLastChainProperty("background-repeat"); |
value = props.getLastChainProperty("background-repeat"); |
||||||
if (value != null) { |
if (value != null) { |
||||||
backgroundRules.put("background-repeat", value); |
backgroundRules.put("background-repeat", value); |
||||||
} |
} |
||||||
value = props.getLastChainProperty("background-image"); |
value = props.getLastChainProperty("background-image"); |
||||||
if (value != null) { |
if (value != null) { |
||||||
backgroundRules.put("background-image", value); |
backgroundRules.put("background-image", value); |
||||||
} |
} |
||||||
return backgroundRules; |
return backgroundRules; |
||||||
} |
} |
||||||
} |
} |
Loading…
Reference in new issue