From: vsr Date: Thu, 18 Dec 2014 11:16:52 +0000 (+0300) Subject: Unicode support X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1f08af47cc24ad9c5a2415e75f53b4bff5905b9b;p=modules%2Fgeom.git Unicode support --- diff --git a/src/EntityGUI/EntityGUI_FieldDlg.cxx b/src/EntityGUI/EntityGUI_FieldDlg.cxx index c53905dee..963faff70 100644 --- a/src/EntityGUI/EntityGUI_FieldDlg.cxx +++ b/src/EntityGUI/EntityGUI_FieldDlg.cxx @@ -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 { diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index f9c14313c..aa9b942b9 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -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() ); } } diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 4cad485d9..59b554693 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -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(); diff --git a/src/GEOM_I/GEOM_Field_i.cc b/src/GEOM_I/GEOM_Field_i.cc index c2469dc00..ecac771af 100644 --- a/src/GEOM_I/GEOM_Field_i.cc +++ b/src/GEOM_I/GEOM_Field_i.cc @@ -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(); diff --git a/src/XAOPlugin/XAOPlugin_ExportDlg.cxx b/src/XAOPlugin/XAOPlugin_ExportDlg.cxx index 01e570f64..434da3820 100644 --- a/src/XAOPlugin/XAOPlugin_ExportDlg.cxx +++ b/src/XAOPlugin/XAOPlugin_ExportDlg.cxx @@ -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; }