incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r1242846 - /incubator/ooo/trunk/main/sc/source/ui/vba/vbavalidation.cxx
Date Fri, 10 Feb 2012 16:49:53 GMT
Author: pfg
Date: Fri Feb 10 16:49:53 2012
New Revision: 1242846

URL: http://svn.apache.org/viewvc?rev=1242846&view=rev
Log:
i108860 - Fix range validation. Patch by lihuiibm.

Modified:
    incubator/ooo/trunk/main/sc/source/ui/vba/vbavalidation.cxx

Modified: incubator/ooo/trunk/main/sc/source/ui/vba/vbavalidation.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/ui/vba/vbavalidation.cxx?rev=1242846&r1=1242845&r2=1242846&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/ui/vba/vbavalidation.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/ui/vba/vbavalidation.cxx Fri Feb 10 16:49:53 2012
@@ -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::
 	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& Ty
 
 	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() )



Mime
View raw message