summaryrefslogtreecommitdiff
path: root/sc/source/ui/vba/vbavalidation.cxx
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2013-04-05 09:45:38 +0100
committerNoel Power <noel.power@suse.com>2013-04-05 17:15:01 +0100
commit3ffd86188b470fa7ebd9e6d10678279a1f63a81c (patch)
tree90e65f9c15873c0bddf54509f5f0f1444000556d /sc/source/ui/vba/vbavalidation.cxx
parent6f814b5f4ceca2f50edffd8b9023c613fffb9cdf (diff)
Added and fixed various vba API
Added OLEObject.LinkedCell Added ComboBox.LinkedCell Added Validation.Type Change-Id: I5ffc2212e689870d58ca99d1fbdfd7d101f8b50f
Diffstat (limited to 'sc/source/ui/vba/vbavalidation.cxx')
-rw-r--r--sc/source/ui/vba/vbavalidation.cxx40
1 files changed, 40 insertions, 0 deletions
diff --git a/sc/source/ui/vba/vbavalidation.cxx b/sc/source/ui/vba/vbavalidation.cxx
index 41189f859edd..0a9e30820f9c 100644
--- a/sc/source/ui/vba/vbavalidation.cxx
+++ b/sc/source/ui/vba/vbavalidation.cxx
@@ -334,6 +334,46 @@ ScVbaValidation::getFormula2() throw (uno::RuntimeException)
return xCond->getFormula2();
}
+sal_Int32 SAL_CALL
+ScVbaValidation::getType() throw (uno::RuntimeException)
+{
+ uno::Reference< beans::XPropertySet > xProps( lcl_getValidationProps( m_xRange ) );
+ sheet::ValidationType nValType = sheet::ValidationType_ANY;
+ xProps->getPropertyValue( STYPE ) >>= nValType;
+ sal_Int32 nExcelType = excel::XlDVType::xlValidateList; // pick a default
+ if ( xProps.is() )
+ {
+ switch ( nValType )
+ {
+ case sheet::ValidationType_LIST:
+ nExcelType = excel::XlDVType::xlValidateList;
+ break;
+ case sheet::ValidationType_ANY: // not ANY not really a great match for anything I fear:-(
+ nExcelType = excel::XlDVType::xlValidateInputOnly;
+ break;
+ case sheet::ValidationType_CUSTOM:
+ nExcelType = excel::XlDVType::xlValidateCustom;
+ break;
+ case sheet::ValidationType_WHOLE:
+ nExcelType = excel::XlDVType::xlValidateWholeNumber;
+ break;
+ case sheet::ValidationType_DECIMAL:
+ nExcelType = excel::XlDVType::xlValidateDecimal;
+ break;
+ case sheet::ValidationType_DATE:
+ nExcelType = excel::XlDVType::xlValidateDate;
+ break;
+ case sheet::ValidationType_TIME:
+ nExcelType = excel::XlDVType::xlValidateTime;
+ break;
+ case sheet::ValidationType_TEXT_LEN:
+ nExcelType = excel::XlDVType::xlValidateTextLength;
+ break;
+ };
+ }
+ return nExcelType;
+}
+
rtl::OUString
ScVbaValidation::getServiceImplName()
{