]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Search item referenced list in the component. If not found then list searched in...
authorstv <stv@opencascade.com>
Tue, 10 Jan 2006 14:10:18 +0000 (14:10 +0000)
committerstv <stv@opencascade.com>
Tue, 10 Jan 2006 14:10:18 +0000 (14:10 +0000)
src/DDS/DDS_DicGroup.cxx
src/DDS/DDS_DicItem.cxx
src/DDS/DDS_DicItem.h

index 40f42a3176901afa42e20c0b9d40508b7c02265d..ac7f4ad6bdf9038b407f1a5f3180cc710d3133a3 100644 (file)
@@ -110,7 +110,7 @@ void DDS_DicGroup::FillDataMap( const LDOM_Element& theComponentData, const LDOM
     Handle(DDS_DicItem) aDicItem = new DDS_DicItem();
 
     aDicItem->myComponent = this;
-    aDicItem->FillDataMap( anID, aQuantity, theDocElement, unitSystems );
+    aDicItem->FillDataMap( anID, aQuantity, theComponentData, theDocElement, unitSystems );
     myDataMap.Add( anID, aDicItem );
   }
 }
index 68e19dfd259ecb4c2cd7c40fffee42e56a6d32c8..fd59f3cd683a039dbc8493f9bff9508d5a2d0b3b 100644 (file)
@@ -309,7 +309,8 @@ Standard_Real DDS_DicItem::FromSI( const Standard_Real theVal, const UnitSystem&
   Parse record in XML file and retrieve information relevant for this data dic item
 */
 void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element& theDatum,
-                               const LDOM_Element& theDocElement, const TColStd_SequenceOfAsciiString& theSystems )
+                               const LDOM_Element& theCompElement, const LDOM_Element& theDocElement,
+                               const TColStd_SequenceOfAsciiString& theSystems )
 {
   TCollection_AsciiString aLabel    = theDatum.getAttribute( DDS_Dictionary::KeyWord( "DATUM_LABEL" ) );
   TCollection_AsciiString aFormat   = theDatum.getAttribute( DDS_Dictionary::KeyWord( "DATUM_FORMAT" ) );
@@ -462,32 +463,43 @@ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element
         LDOMString aListId = aListRef.getAttribute( DDS_Dictionary::KeyWord( "VLR_LIST" ) );
         aDefV = aListRef.getAttribute( DDS_Dictionary::KeyWord( "VD_DEFV" ) );
         aDefV.RemoveAll( ' ' );
-        for ( LDOM_Element aListItem = theDocElement.GetChildByTagName( DDS_Dictionary::KeyWord( "VALUE_LIST" ) );
-              aListItem != NULL; aListItem = aListItem.GetSiblingByTagName() )
+        LDOM_Element foundListItem;
+        for ( LDOM_Element aListItem = theCompElement.GetChildByTagName( DDS_Dictionary::KeyWord( "VALUE_LIST" ) );
+              aListItem != NULL && foundListItem == NULL; aListItem = aListItem.GetSiblingByTagName() )
         {
           if ( aListItem.getAttribute( DDS_Dictionary::KeyWord( "VALUE_LIST_ID" ) ).equals( aListId ) )
+            foundListItem = aListItem;
+
+        }
+        for ( LDOM_Element aLstItem = theDocElement.GetChildByTagName( DDS_Dictionary::KeyWord( "VALUE_LIST" ) );
+              aLstItem != NULL && foundListItem == NULL; aLstItem = aLstItem.GetSiblingByTagName() )
+        {
+          if ( aLstItem.getAttribute( DDS_Dictionary::KeyWord( "VALUE_LIST_ID" ) ).equals( aListId ) )
+            foundListItem = aLstItem;
+        }
+
+        if ( foundListItem != NULL )
+        {
+          //  The appropriate list of values is found: store the list name
+          aListName = foundListItem.getAttribute( DDS_Dictionary::KeyWord( "VALUE_LIST_NAME" ) );
+          //  Iteration through the list of values
+          LDOM_Element aListItemValue = foundListItem.GetChildByTagName( DDS_Dictionary::KeyWord( "VALUE_LIST_VALUE" ) );
+          while ( aListItemValue != NULL )
           {
-            //  The appropriate list of values is found: store the list name
-            aListName = aListItem.getAttribute( DDS_Dictionary::KeyWord( "VALUE_LIST_NAME" ) );
-            //  Iteration through the list of values
-            LDOM_Element aListItemValue = aListItem.GetChildByTagName( DDS_Dictionary::KeyWord( "VALUE_LIST_VALUE" ) );
-            while ( aListItemValue != NULL )
+            // read value ID
+            TCollection_AsciiString aListValueID = aListItemValue.getAttribute( DDS_Dictionary::KeyWord( "VALUE_LIST_VALUEID" ) );
+            if ( aListValueID.IsIntegerValue() )
             {
-              // read value ID
-              TCollection_AsciiString aListValueID = aListItemValue.getAttribute( DDS_Dictionary::KeyWord( "VALUE_LIST_VALUEID" ) );
-              if ( aListValueID.IsIntegerValue() )
+              //  Read the text in the element "value"
+              LDOM_Text aListItemTxt = (const LDOM_Text&)aListItemValue.getFirstChild();
+              if ( !aListItemTxt.isNull() )
               {
-                //  Read the text in the element "value"
-                LDOM_Text aListItemTxt = (const LDOM_Text&)aListItemValue.getFirstChild();
-                if ( !aListItemTxt.isNull() )
-                {
-                  // adding ID and text value to sequence
-                  aSeqOfValueID.Append( aListValueID.IntegerValue() );
-                  aSeqOfValue.Append( aListItemTxt.getData() );
-                  // adding icon file name (optional) to sequence
-                  TCollection_ExtendedString aListValueIcon = aListItemValue.getAttribute( DDS_Dictionary::KeyWord( "VALUE_LIST_VALUEICON" ) );
-                  aSeqOfValueIconName.Append( aListValueIcon );
-                }
+                // adding ID and text value to sequence
+                aSeqOfValueID.Append( aListValueID.IntegerValue() );
+                aSeqOfValue.Append( aListItemTxt.getData() );
+                // adding icon file name (optional) to sequence
+                TCollection_ExtendedString aListValueIcon = aListItemValue.getAttribute( DDS_Dictionary::KeyWord( "VALUE_LIST_VALUEICON" ) );
+                aSeqOfValueIconName.Append( aListValueIcon );
               }
               aListItemValue = aListItemValue.GetSiblingByTagName();
             }
index d57eaf068150e2ca2e60facb419339c26e4c6bfb..871149407e34cb3a8b1f8a8b4b32c1cab43704bf 100644 (file)
@@ -141,8 +141,8 @@ private:
   void                                       operator=( const DDS_DicItem& );
   // Assignment operator
 
-  void                                       FillDataMap( TCollection_AsciiString,
-                                                          const LDOM_Element&,const LDOM_Element&,
+  void                                       FillDataMap( TCollection_AsciiString, const LDOM_Element&,
+                                                          const LDOM_Element&, const LDOM_Element&,
                                                           const TColStd_SequenceOfAsciiString& );
   // prepares formants for each unit systems