summaryrefslogtreecommitdiff
path: root/sc/source/ui/vba/vbavalidation.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/vba/vbavalidation.cxx')
-rw-r--r--sc/source/ui/vba/vbavalidation.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/sc/source/ui/vba/vbavalidation.cxx b/sc/source/ui/vba/vbavalidation.cxx
index e2a768549e11..36662c87c598 100644
--- a/sc/source/ui/vba/vbavalidation.cxx
+++ b/sc/source/ui/vba/vbavalidation.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -25,6 +26,7 @@
*
************************************************************************/
#include "vbavalidation.hxx"
+#include "vbaformatcondition.hxx"
#include <com/sun/star/sheet/XSheetCondition.hpp>
#include <com/sun/star/sheet/ValidationType.hpp>
#include <com/sun/star/sheet/ValidationAlertStyle.hpp>
@@ -225,8 +227,10 @@ ScVbaValidation::Delete( ) throw (uno::RuntimeException)
lcl_setValidationProps( m_xRange, xProps );
}
+
+// Fix the defect that validatation cannot work when the input should be limited between a lower bound and an upper bound
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 );
@@ -291,6 +295,13 @@ ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const un
xProps->setPropertyValue( ALERTSTYLE, uno::makeAny( eStyle ) );
+ //2009-11-11 fix the defect that validatation 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 );
+ }
+ //2009-11-11
if ( sFormula1.getLength() )
xCond->setFormula1( sFormula1 );
if ( sFormula2.getLength() )
@@ -331,3 +342,5 @@ ScVbaValidation::getServiceNames()
}
return aServiceNames;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */