Add remove validations
This commit is contained in:
parent
ff43f85594
commit
d81ccd943a
|
@ -180,16 +180,14 @@ class Border(IntEnum):
|
||||||
class ValidationType():
|
class ValidationType():
|
||||||
from com.sun.star.sheet.ValidationType \
|
from com.sun.star.sheet.ValidationType \
|
||||||
import ANY, WHOLE, DECIMAL, DATE, TIME, TEXT_LEN, LIST, CUSTOM
|
import ANY, WHOLE, DECIMAL, DATE, TIME, TEXT_LEN, LIST, CUSTOM
|
||||||
class VT(ValidationType):
|
VT = ValidationType
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
# ~ https://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1star_1_1sheet.html#aecf58149730f4c8c5c18c70f3c7c5db7
|
# ~ https://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1star_1_1sheet.html#aecf58149730f4c8c5c18c70f3c7c5db7
|
||||||
class ValidationAlertStyle():
|
class ValidationAlertStyle():
|
||||||
from com.sun.star.sheet.ValidationAlertStyle \
|
from com.sun.star.sheet.ValidationAlertStyle \
|
||||||
import STOP, WARNING, INFO, MACRO
|
import STOP, WARNING, INFO, MACRO
|
||||||
class VAS(ValidationAlertStyle):
|
VAS = ValidationAlertStyle
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
# ~ https://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1star_1_1sheet_1_1ConditionOperator2.html
|
# ~ https://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1star_1_1sheet_1_1ConditionOperator2.html
|
||||||
|
@ -197,8 +195,7 @@ class ConditionOperator():
|
||||||
from com.sun.star.sheet.ConditionOperator2 \
|
from com.sun.star.sheet.ConditionOperator2 \
|
||||||
import NONE, EQUAL, NOT_EQUAL, GREATER, GREATER_EQUAL, LESS, \
|
import NONE, EQUAL, NOT_EQUAL, GREATER, GREATER_EQUAL, LESS, \
|
||||||
LESS_EQUAL, BETWEEN, NOT_BETWEEN, FORMULA, DUPLICATE, NOT_DUPLICATE
|
LESS_EQUAL, BETWEEN, NOT_BETWEEN, FORMULA, DUPLICATE, NOT_DUPLICATE
|
||||||
class CO(ConditionOperator):
|
CO = ConditionOperator
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
OS = platform.system()
|
OS = platform.system()
|
||||||
|
@ -2432,15 +2429,19 @@ class LOCalcRange(object):
|
||||||
return self.obj.Validation
|
return self.obj.Validation
|
||||||
@validation.setter
|
@validation.setter
|
||||||
def validation(self, values):
|
def validation(self, values):
|
||||||
is_list = False
|
|
||||||
current = self.validation
|
current = self.validation
|
||||||
for k, v in values.items():
|
if not values:
|
||||||
if k == 'Type' and v == 6:
|
current.Type = ValidationType.ANY
|
||||||
is_list = True
|
current.ShowInputMessage = False
|
||||||
if k == 'Formula1' and is_list:
|
else:
|
||||||
if isinstance(v, (tuple, list)):
|
is_list = False
|
||||||
v = ';'.join(['"{}"'.format(i) for i in v])
|
for k, v in values.items():
|
||||||
setattr(current, k, v)
|
if k == 'Type' and v == VT.LIST:
|
||||||
|
is_list = True
|
||||||
|
if k == 'Formula1' and is_list:
|
||||||
|
if isinstance(v, (tuple, list)):
|
||||||
|
v = ';'.join(['"{}"'.format(i) for i in v])
|
||||||
|
setattr(current, k, v)
|
||||||
self.obj.Validation = current
|
self.obj.Validation = current
|
||||||
|
|
||||||
def select(self):
|
def select(self):
|
||||||
|
|
Loading…
Reference in New Issue