1 Star 0 Fork 0

墙外行人/gooxml

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
cellmarker.go 1.99 KB
一键复制 编辑 原始数据 按行查看 历史
墙外行人 提交于 2025-09-23 22:17 +08:00 . 替换
// 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 spreadsheet
import (
"gitee.com/qwxren/gooxml"
"gitee.com/qwxren/gooxml/measurement"
sd "gitee.com/qwxren/gooxml/schema/soo/dml/spreadsheetDrawing"
)
// CellMarker represents a cell position
type CellMarker struct {
x *sd.CT_Marker
}
// X returns the inner wrapped XML type.
func (c CellMarker) X() *sd.CT_Marker {
return c.x
}
// Col returns the column of the cell marker.
func (c CellMarker) Col() int32 {
return c.x.Col
}
// SetCol set the column of the cell marker.
func (c CellMarker) SetCol(col int32) {
c.x.Col = col
}
// Row returns the row of the cell marker.
func (c CellMarker) Row() int32 {
return c.x.Row
}
// SetRow set the row of the cell marker.
func (c CellMarker) SetRow(row int32) {
c.x.Row = row
}
// SetColOffset sets a column offset in absolute distance.
func (c CellMarker) SetColOffset(m measurement.Distance) {
c.x.ColOff.ST_CoordinateUnqualified = gooxml.Int64(int64(m / measurement.EMU))
}
// ColOffset returns the offset from the row cell.
func (c CellMarker) ColOffset() measurement.Distance {
if c.x.RowOff.ST_CoordinateUnqualified == nil {
return 0
}
return measurement.Distance(float64(*c.x.ColOff.ST_CoordinateUnqualified) * measurement.EMU)
}
// SetRowOffset sets a column offset in absolute distance.
func (c CellMarker) SetRowOffset(m measurement.Distance) {
c.x.RowOff.ST_CoordinateUnqualified = gooxml.Int64(int64(m / measurement.EMU))
}
// RowOffset returns the offset from the row cell.
func (c CellMarker) RowOffset() measurement.Distance {
if c.x.RowOff.ST_CoordinateUnqualified == nil {
return 0
}
return measurement.Distance(float64(*c.x.RowOff.ST_CoordinateUnqualified) * measurement.EMU)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/qwxren/gooxml.git
git@gitee.com:qwxren/gooxml.git
qwxren
gooxml
gooxml
v1.0.17-alpha

搜索帮助