summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorPedro Giffuni <pfg@apache.org>2012-02-10 15:49:53 +0000
committerPedro Giffuni <pfg@apache.org>2012-02-10 15:49:53 +0000
commite63ec5073cc575f1b78f8aa20f194326eaa4eaa5 (patch)
treeced52b49ba7ed496551c93162d4ea911dd90bd5c /sc
parenta1d39bb1c9d8be03d3d2e496ce4cb6c86fd2d4d6 (diff)
i108860 - Fix range validation. Patch by lihuiibm.
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/vba/vbavalidation.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/sc/source/ui/vba/vbavalidation.cxx b/sc/source/ui/vba/vbavalidation.cxx
index 44eb28baf6e1..93f9c3cfb212 100644
--- a/sc/source/ui/vba/vbavalidation.cxx
+++ b/sc/source/ui/vba/vbavalidation.cxx
@@ -21,6 +21,7 @@
#include "vbavalidation.hxx"
+#include "vbaformatcondition.hxx" //#i108860
#include <com/sun/star/sheet/XSheetCondition.hpp>
#include <com/sun/star/sheet/ValidationType.hpp>
#include <com/sun/star/sheet/ValidationAlertStyle.hpp>
@@ -222,7 +223,7 @@ ScVbaValidation::Delete( ) throw (uno::RuntimeException)
lcl_setValidationProps( m_xRange, xProps );
}
void SAL_CALL
-ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const uno::Any& /*Operator*/, const uno::Any& Formula1, const uno::Any& Formula2 ) throw (uno::RuntimeException)
+ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const uno::Any& Operator, const uno::Any& Formula1, const uno::Any& Formula2 ) throw (uno::RuntimeException)
{
uno::Reference< beans::XPropertySet > xProps( lcl_getValidationProps( m_xRange ) );
uno::Reference< sheet::XSheetCondition > xCond( xProps, uno::UNO_QUERY_THROW );
@@ -287,6 +288,13 @@ ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const un
xProps->setPropertyValue( ALERTSTYLE, uno::makeAny( eStyle ) );
+ //#i108860: fix the defect that validation cannot work when the input should be limited between a lower bound and an upper bound
+ if ( Operator.hasValue() )
+ {
+ css::sheet::ConditionOperator conOperator = ScVbaFormatCondition::retrieveAPIOperator( Operator );
+ xCond->setOperator( conOperator );
+ } //#ii108860
+
if ( sFormula1.getLength() )
xCond->setFormula1( sFormula1 );
if ( sFormula2.getLength() )