MCPcopy Create free account
hub / github.com/openclaw/gogcli / EffectiveCopyDestination

Function EffectiveCopyDestination

internal/sheetsvalidation/copy.go:751–772  ·  view source on GitHub ↗
(source, destination *sheets.GridRange, transpose bool)

Source from the content-addressed store, hash-verified

749}
750
751func EffectiveCopyDestination(source, destination *sheets.GridRange, transpose bool) *sheets.GridRange {
752 if source == nil || destination == nil {
753 return destination
754 }
755 minHeight := source.EndRowIndex - source.StartRowIndex
756
757 minWidth := source.EndColumnIndex - source.StartColumnIndex
758 if transpose {
759 minHeight, minWidth = minWidth, minHeight
760 }
761 effective := *destination
762 effective.EndRowIndex = effective.StartRowIndex + effectivePasteLength(
763 minHeight,
764 effective.EndRowIndex-effective.StartRowIndex,
765 )
766 effective.EndColumnIndex = effective.StartColumnIndex + effectivePasteLength(
767 minWidth,
768 effective.EndColumnIndex-effective.StartColumnIndex,
769 )
770
771 return &effective
772}
773
774func effectivePasteLength(sourceLength, destinationLength int64) int64 {
775 if destinationLength >= sourceLength && destinationLength%sourceLength == 0 {

Callers 3

BuildCopyRequestsFunction · 0.85

Calls 1

effectivePasteLengthFunction · 0.85

Tested by 1