unioffice/spreadsheet/absoluteanchor.go
Vyacheslav Zgordan dd7713e1e3 Functions2 (#348)
* MATCH, IFS, MAXA, MINA
* OFFSET fixed
* ISBLANK, ISERR, ISERROR, ISEVEN ,ISFORMULA, ISNONTEXT, ISNUMBER, ISODD, ISTEXT
* ISLEAPYEAR, ISLOGICAL, ISNA, ISREF
* FIND, FINDB
* SEARCH, SEARCHB
* CONCAT, CONCATENATE
* YEAR, YEARFRAC
* CONCAT is fixed, now TRUE and FALSE are concatenated instead of 1 and 0 in case of boolean results
* NOW, TODAY, TIME, TIMEVALUE
* DATE
* DATEDIF
2019-11-20 23:21:00 +00:00

68 lines
2.0 KiB
Go

// Copyright 2017 FoxyUtils ehf. 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 on https://unidoc.io.
package spreadsheet
import (
"github.com/unidoc/unioffice"
"github.com/unidoc/unioffice/measurement"
sd "github.com/unidoc/unioffice/schema/soo/dml/spreadsheetDrawing"
)
// AbsoluteAnchor has a fixed top-left corner in distance units as well as a
// fixed height/width.
type AbsoluteAnchor struct {
x *sd.CT_AbsoluteAnchor
}
// SetColOffset sets the column offset of the top-left of the image in fixed units.
func (a AbsoluteAnchor) SetColOffset(m measurement.Distance) {
a.x.Pos.XAttr.ST_CoordinateUnqualified = unioffice.Int64(int64(m / measurement.EMU))
}
// SetRowOffset sets the row offset of the top-left of the image in fixed units.
func (a AbsoluteAnchor) SetRowOffset(m measurement.Distance) {
a.x.Pos.YAttr.ST_CoordinateUnqualified = unioffice.Int64(int64(m / measurement.EMU))
}
// SetHeight sets the height of the anchored object.
func (a AbsoluteAnchor) SetHeight(h measurement.Distance) {
a.x.Ext.CyAttr = int64(h / measurement.EMU)
}
// SetWidth sets the width of the anchored object.
func (a AbsoluteAnchor) SetWidth(w measurement.Distance) {
a.x.Ext.CxAttr = int64(w / measurement.EMU)
}
// SetHeightCells is a no-op.
func (a AbsoluteAnchor) SetHeightCells(int32) {
}
// TopLeft is a no-op.
func (a AbsoluteAnchor) TopLeft() CellMarker {
return CellMarker{}
}
// BottomRight is a no-op.
func (a AbsoluteAnchor) BottomRight() CellMarker {
return CellMarker{}
}
// MoveTo is a no-op.
func (a AbsoluteAnchor) MoveTo(x, y int32) {
}
// SetWidthCells is a no-op.
func (a AbsoluteAnchor) SetWidthCells(int32) {
}
// Type returns the type of anchor
func (a AbsoluteAnchor) Type() AnchorType {
return AnchorTypeAbsolute
}