]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Unicode support vsr/PAL22825
authorvsr <vsr@opencascade.com>
Thu, 18 Dec 2014 11:16:52 +0000 (14:16 +0300)
committervsr <vsr@opencascade.com>
Thu, 18 Dec 2014 11:16:52 +0000 (14:16 +0300)
src/EntityGUI/EntityGUI_FieldDlg.cxx
src/GEOMGUI/GEOM_Displayer.cxx
src/GEOMGUI/GeometryGUI.cxx
src/GEOM_I/GEOM_Field_i.cc
src/XAOPlugin/XAOPlugin_ExportDlg.cxx

index c53905dee6687a50aa9e0f0d31dbbb94be048737..963faff70d7f348da799f156c251c697e7ceffa5 100644 (file)
@@ -435,7 +435,7 @@ EntityGUI_FieldDlg::StepTable::StepTable (int stepID, int dataType,
       if ( vals->length() == nbRows * nbComps )
         for ( int iV = 0, iR = 0; iR < nbRows; ++iR )
           for ( int iC = 1; iC < nbColumns; ++iC )
-            setItem( iR, iC, new QTableWidgetItem( vals[ iV++ ].in() ));
+            setItem( iR, iC, new QTableWidgetItem( QString::fromUtf8( vals[ iV++ ].in() ) ) );
     }
     break;
   }
@@ -1012,13 +1012,13 @@ void EntityGUI_FieldDlg::Init()
     myIsCreation = false;
 
     CORBA::String_var fName = myField->GetName();
-    myMainFrame->ResultName->setText( fName.in() );
+    myMainFrame->ResultName->setText( QString::fromUtf8( fName.in() ) );
 
     myShape = myField->GetShape();
     CORBA::String_var sName;
     if ( !myShape->_is_nil() )
       sName = myShape->GetName();
-    myShapeName->setText( sName.in() ? sName.in() : "");
+    myShapeName->setText( QString::fromUtf8( sName.in() ? sName.in() : "" ) );
 
     myTypeCombo->setCurrentIndex( myField->GetDataType() );
 
@@ -1414,7 +1414,7 @@ void EntityGUI_FieldDlg::showCurStep()
       {
         GEOM::string_array_var compNames = myField->GetComponents();
         for ( int iC = 0; iC < compNames->length(); ++iC )
-          headers << compNames[ iC ].in();
+          headers << QString::fromUtf8( compNames[ iC ].in() );
       }
       else
       {
index f9c14313c67474e0f07b1009da6a93b081752e6f..aa9b942b90f90f176c9d0d118fb765b7cb511551 100644 (file)
@@ -2751,7 +2751,7 @@ void GEOM_Displayer::readFieldStepInfo( GEOM::GEOM_FieldStep_var theGeomFieldSte
     {
       GEOM::string_array_var aValues = aGeomStringFieldStep->GetValues();
       for( size_t i = 0, n = aValues->length(); i < n; i++ )
-        aFieldStepData << QString( aValues[i] );
+        aFieldStepData << QString::fromUtf8( aValues[i].in() );
     }
   }
 
index 4cad485d92536d2cfc28877e235199e7936f590e..59b5546936b17e21d867f3b0536280d9c8e2b675 100644 (file)
@@ -1996,8 +1996,8 @@ void GeometryGUI::updateCreationInfo()
          
          QString plugin_name;
           for ( size_t i = 0; i < info->params.length(); ++i ) {
-            myCreationInfoWdg->addParam( info->params[i].name.in(),
-                                         info->params[i].value.in() );
+            myCreationInfoWdg->addParam( QString::fromUtf8( info->params[i].name.in() ),
+                                         QString::fromUtf8( info->params[i].value.in() ) );
             QString value = info->params[i].name.in();
            if( value == PLUGIN_NAME ) {
              plugin_name = info->params[i].value.in();
index c2469dc008c1f273bb2ceb2e248451a1974c0db8..ecac771af21c00bf42e47f8e6e4f56b853912c51 100644 (file)
@@ -112,15 +112,11 @@ GEOM::string_array* GEOM_Field_i::GetComponents()
   if ( !comps.IsNull() )
   {
     compArr->length( comps->Length() );
-    std::string entry;
     int i, i0, nb; 
     for ( i = i0 = comps->Lower(), nb = comps->Upper(); i <= nb; ++i )
     {
       const TCollection_ExtendedString& anEntry = comps->Value( i );
-      entry.resize( anEntry.LengthOfCString() );
-      char* pstr = &entry[0];
-      anEntry.ToUTF8CString( pstr );
-      compArr[ i-i0 ] = CORBA::string_dup( entry.c_str() );
+      compArr[ i-i0 ] = CORBA::string_dup( TCollection_AsciiString( anEntry ).ToCString() );
     }
   }
   return compArr._retn();
@@ -494,15 +490,11 @@ GEOM::string_array* GEOM_StringFieldStep_i::GetValues()
   if ( !values.IsNull() )
   {
     resArray->length( values->Length() );
-    std::string entry;
     int i, i0, nb; 
     for ( i = i0 = values->Lower(), nb = values->Upper(); i <= nb; ++i )
     {
       const TCollection_ExtendedString& anEntry = values->Value( i );
-      entry.resize( anEntry.LengthOfCString() );
-      char* pstr = &entry[0];
-      anEntry.ToUTF8CString( pstr );
-      resArray[ i-i0 ] = CORBA::string_dup( entry.c_str() );
+      resArray[ i-i0 ] = CORBA::string_dup( TCollection_AsciiString( anEntry ).ToCString() );
     }
   }
   return resArray._retn();
index 01e570f6460b89a0d15ea196c56871aa2357eb62..434da382004bd6184730dca7db82ec5f147fb167 100644 (file)
@@ -241,7 +241,7 @@ void XAOPlugin_ExportDlg::processObject()
     {
       QListWidgetItem* item = new QListWidgetItem();
       item->setData(Qt::UserRole, QVariant(i));
-      item->setText(fields[i]->GetName());
+      item->setText(QString::fromUtf8(fields[i]->GetName()));
       item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
       item->setCheckState(Qt::Checked);
       lstFields->addItem(item);
@@ -450,7 +450,7 @@ bool XAOPlugin_ExportDlg::execute()
   // call engine function
   GEOM::IXAOOperations_var aXAOOp = GEOM::IXAOOperations::_narrow( getOperation() );
   res = aXAOOp->ExportXAO(m_mainObj, groups, fields,
-                          author.toStdString().c_str(),
-                          fileName.toStdString().c_str());
+                          author.toUtf8().data(),
+                          fileName.toUtf8().data());
   return res;
 }