From 3ac020c61c0bd93de61a703e0798a525dc4ff846 Mon Sep 17 00:00:00 2001 From: stv Date: Tue, 17 Jan 2006 11:50:03 +0000 Subject: [PATCH] Attribute 'required' taken into account --- src/QDS/QDS_Datum.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/QDS/QDS_Datum.cxx b/src/QDS/QDS_Datum.cxx index 3b6eb58e4..f2a4919ba 100644 --- a/src/QDS/QDS_Datum.cxx +++ b/src/QDS/QDS_Datum.cxx @@ -548,10 +548,15 @@ bool QDS_Datum::isValid( const bool msgBox, const QString& extMsg, const QString if ( type() == DDS_DicItem::String && isDoubleFormat( format() ) ) return true; + QString req; + if ( !dicItem().IsNull() ) + req = toQString( dicItem()->GetRequired() ); + bool aState = true; QString aStr = getString(); + if ( aStr.isEmpty() ) - aState = false; + aState = !( req == QString( "yes" ) || req == QString( "true" ) || req.toInt() ); else aState = validate( aStr ); @@ -611,7 +616,7 @@ bool QDS_Datum::isValid( const bool msgBox, const QString& extMsg, const QString info = QString( "

%1

" ).arg( msg ); QMessageBox::critical( controlWidget() ? controlWidget()->topLevelWidget() : 0, - tr( "DATA_ERR_TITLE" ), info, tr( "BUT_OK" ) ); + tr( "DATA_ERR_TITLE" ), info, tr( "OK" ) ); if ( controlWidget() ) controlWidget()->setFocus(); } -- 2.39.2