amend
This commit is contained in:
parent
bd0bb96234
commit
ee8f40814e
|
@ -82,11 +82,20 @@ func NewStyles() *Styles {
|
||||||
return l
|
return l
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Styles) HasStyle(name string) bool {
|
||||||
|
var done bool = false
|
||||||
|
for key := range s.List {
|
||||||
|
if done = key == name; done {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return done
|
||||||
|
}
|
||||||
|
|
||||||
func (s *Styles) Get(name string) *Style {
|
func (s *Styles) Get(name string) *Style {
|
||||||
var style *Style
|
style := defStyle
|
||||||
var ok bool = false
|
if s.HasStyle(name) {
|
||||||
if style, ok = s.List[name]; !ok {
|
style = s.List[name]
|
||||||
style = defStyle
|
|
||||||
}
|
}
|
||||||
return style
|
return style
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user