mirror of
https://github.com/unidoc/unioffice.git
synced 2025-05-08 19:29:25 +08:00
document: rename RunStyle to RunStyleProperties
This commit is contained in:
parent
1651f31e02
commit
0bbb5d2ba5
@ -13,18 +13,18 @@ import (
|
||||
wml "baliance.com/gooxml/schema/schemas.openxmlformats.org/wordprocessingml"
|
||||
)
|
||||
|
||||
// RunStyle controls run styling properties
|
||||
type RunStyle struct {
|
||||
// RunStyleProperties controls run styling properties
|
||||
type RunStyleProperties struct {
|
||||
x *wml.CT_RPr
|
||||
}
|
||||
|
||||
// X returns the inner wrapped XML type.
|
||||
func (r RunStyle) X() *wml.CT_RPr {
|
||||
func (r RunStyleProperties) X() *wml.CT_RPr {
|
||||
return r.x
|
||||
}
|
||||
|
||||
// SetSize sets the font size for a run.
|
||||
func (r RunStyle) SetSize(size measurement.Distance) {
|
||||
func (r RunStyleProperties) SetSize(size measurement.Distance) {
|
||||
var sz *wml.CT_HpsMeasure
|
||||
var szCs *wml.CT_HpsMeasure
|
||||
|
@ -119,10 +119,10 @@ func (s Style) ParagraphStyleProperties() ParagraphStyleProperties {
|
||||
return ParagraphStyleProperties{s.x.PPr}
|
||||
}
|
||||
|
||||
// RunStyle returns the run style.
|
||||
func (s Style) RunStyle() RunStyle {
|
||||
// RunProperties returns the run style.
|
||||
func (s Style) RunProperties() RunStyleProperties {
|
||||
if s.x.RPr == nil {
|
||||
s.x.RPr = wml.NewCT_RPr()
|
||||
}
|
||||
return RunStyle{s.x.RPr}
|
||||
return RunStyleProperties{s.x.RPr}
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ func (s Styles) InitializeDefault() {
|
||||
hdngChar.SetBasedOn(dpf.StyleID())
|
||||
hdngChar.SetLinkedStyle(id)
|
||||
hdngChar.SetUISortOrder(9 + i)
|
||||
hdngChar.RunStyle().SetSize(fontSizes[i] * measurement.Point)
|
||||
hdngChar.RunProperties().SetSize(fontSizes[i] * measurement.Point)
|
||||
|
||||
hdng := s.AddStyle(id, wml.ST_StyleTypeParagraph, false)
|
||||
hdng.SetName(fmt.Sprintf("heading %d", i+1))
|
||||
@ -162,9 +162,8 @@ func (s Styles) InitializeDefault() {
|
||||
hdng.ParagraphStyleProperties().SetKeepNext(true)
|
||||
hdng.ParagraphStyleProperties().SetSpacing(spacing[i]*measurement.Twips, 0)
|
||||
hdng.ParagraphStyleProperties().SetOutlineLevel(i)
|
||||
hdng.RunStyle().SetSize(fontSizes[i] * measurement.Point)
|
||||
hdng.RunProperties().SetSize(fontSizes[i] * measurement.Point)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (s Styles) initializeDocDefaults() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user