Insert new form
This commit is contained in:
parent
361e4d3597
commit
301af065c7
|
@ -125,34 +125,9 @@ class LOForm(ObjectBase):
|
|||
|
||||
class LOForms(ObjectBase):
|
||||
|
||||
def __init__(self, obj, doc):
|
||||
self._doc = doc
|
||||
super().__init__(obj)
|
||||
|
||||
def __getitem__(self, index):
|
||||
form = super().__getitem__(index)
|
||||
return LOForm(form)
|
||||
|
||||
@property
|
||||
def doc(self):
|
||||
return self._doc
|
||||
|
||||
@property
|
||||
def count(self):
|
||||
return self.obj.getCount()
|
||||
|
||||
@property
|
||||
def names(self):
|
||||
return self.obj.getElementNames()
|
||||
|
||||
def exists(self, name):
|
||||
return name in self.names
|
||||
|
||||
def insert(self, name):
|
||||
form = self.doc.create_instance('com.sun.star.form.component.Form')
|
||||
self.obj.insertByName(name, form)
|
||||
return self[name]
|
||||
|
||||
def remove(self, index):
|
||||
if isinstance(index, int):
|
||||
self.obj.removeByIndex(index)
|
||||
|
|
|
@ -1556,6 +1556,23 @@ class LOSheetForms(object):
|
|||
def obj(self):
|
||||
return self._obj
|
||||
|
||||
@property
|
||||
def doc(self):
|
||||
return self.obj.Parent
|
||||
|
||||
@property
|
||||
def count(self):
|
||||
return len(self)
|
||||
|
||||
@property
|
||||
def names(self):
|
||||
return self.obj.ElementNames
|
||||
|
||||
def insert(self, name):
|
||||
form = self.doc.createInstance('com.sun.star.form.component.Form')
|
||||
self.obj.insertByName(name, form)
|
||||
return LOForm(form)
|
||||
|
||||
|
||||
# ~ IsFiltered,
|
||||
# ~ IsManualPageBreak,
|
||||
|
|
Loading…
Reference in New Issue