1 Star 2 Fork 1

wx-fork/unioffice

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
numberinglevel.go 1.74 KB
一键复制 编辑 原始数据 按行查看 历史
// Copyright 2017 Baliance. All rights reserved.
//
// Use of this source code is governed by the terms of the Affero GNU General
// Public License version 3.0 as published by the Free Software Foundation and
// appearing in the file LICENSE included in the packaging of this file. A
// commercial license can be purchased by contacting sales@baliance.com.
package document
import (
"baliance.com/gooxml"
"baliance.com/gooxml/schema/soo/wml"
)
// NumberingLevel is the definition for numbering for a particular level within
// a NumberingDefinition.
type NumberingLevel struct {
x *wml.CT_Lvl
}
// X returns the inner wrapped XML type.
func (n NumberingLevel) X() *wml.CT_Lvl {
return n.x
}
// SetFormat sets the numbering format.
func (n NumberingLevel) SetFormat(f wml.ST_NumberFormat) {
if n.x.NumFmt == nil {
n.x.NumFmt = wml.NewCT_NumFmt()
}
n.x.NumFmt.ValAttr = f
}
// SetText sets the text to be used in bullet mode.
func (n NumberingLevel) SetText(t string) {
if t == "" {
n.x.LvlText = nil
} else {
n.x.LvlText = wml.NewCT_LevelText()
n.x.LvlText.ValAttr = gooxml.String(t)
}
}
// Properties returns the numbering level paragraph properties.
func (n NumberingLevel) Properties() ParagraphStyleProperties {
if n.x.PPr == nil {
n.x.PPr = wml.NewCT_PPrGeneral()
}
return ParagraphStyleProperties{n.x.PPr}
}
// SetAlignment sets the paragraph alignment
func (n NumberingLevel) SetAlignment(j wml.ST_Jc) {
if j == wml.ST_JcUnset {
n.x.LvlJc = nil
} else {
n.x.LvlJc = wml.NewCT_Jc()
n.x.LvlJc.ValAttr = j
}
}
// RunProperties returns the RunProperties controlling numbering level font, etc.
func (n NumberingLevel) RunProperties() RunProperties {
if n.x.RPr == nil {
n.x.RPr = wml.NewCT_RPr()
}
return RunProperties{n.x.RPr}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wx-fork/unioffice.git
git@gitee.com:wx-fork/unioffice.git
wx-fork
unioffice
unioffice
v0.7.1

搜索帮助