Copy to in sheet

This commit is contained in:
Mauricio Baeza 2020-11-08 22:27:04 -06:00
parent 56360bb10d
commit fede099f4b
1 changed files with 13 additions and 0 deletions

View File

@ -1459,6 +1459,19 @@ class LOCalcSheet(object):
self.doc._sheets.copyByName(self.name, new_name, index)
return LOCalcSheet(self.doc._sheets[new_name])
def copy_to(self, doc, target='', pos=-1):
index = pos
if pos < 0:
index = len(doc)
name = self.name
if not target:
new_name = name
doc._sheets.importSheet(self.doc.obj, name, index)
sheet = doc[name]
sheet.name = new_name
return sheet
def get_cursor(self, cell=None):
if cell is None:
cursor = self.obj.createCursor()