2019-07-25 19:43:46 +03:00
|
|
|
// Copyright 2017 FoxyUtils ehf. All rights reserved.
|
2017-09-11 18:31:29 -05:00
|
|
|
//
|
|
|
|
// 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
|
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-21 02:21:00 +03:00
|
|
|
// commercial license can be purchased on https://unidoc.io.
|
2017-09-11 18:31:29 -05:00
|
|
|
|
|
|
|
package spreadsheet
|
|
|
|
|
|
|
|
import (
|
2019-05-04 11:18:06 +03:00
|
|
|
"github.com/unidoc/unioffice"
|
|
|
|
"github.com/unidoc/unioffice/measurement"
|
|
|
|
sd "github.com/unidoc/unioffice/schema/soo/dml/spreadsheetDrawing"
|
2017-09-11 18:31:29 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
// 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) {
|
2019-05-04 13:54:29 +00:00
|
|
|
a.x.Pos.XAttr.ST_CoordinateUnqualified = unioffice.Int64(int64(m / measurement.EMU))
|
2017-09-11 18:31:29 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetRowOffset sets the row offset of the top-left of the image in fixed units.
|
|
|
|
func (a AbsoluteAnchor) SetRowOffset(m measurement.Distance) {
|
2019-05-04 13:54:29 +00:00
|
|
|
a.x.Pos.YAttr.ST_CoordinateUnqualified = unioffice.Int64(int64(m / measurement.EMU))
|
2017-09-11 18:31:29 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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
|
|
|
|
}
|