From 282f829c207d1e7af43fa1860e563b2c92627a47 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 12 Dec 2014 18:27:05 +0300 Subject: [PATCH] Implement support of UTF-8 --- src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx | 3 +- src/EntityGUI/EntityGUI_FieldDlg.cxx | 24 +++++------ src/GEOMBase/GEOMBase.cxx | 8 ++-- src/GEOMBase/GEOMBase_Helper.cxx | 40 +++++++++---------- src/GEOMGUI/GEOM_Displayer.cxx | 2 +- src/GEOMGUI/GeometryGUI.cxx | 8 ++-- src/GEOMToolsGUI/GEOMToolsGUI_1.cxx | 6 +-- .../GEOMToolsGUI_LineWidthDlg.cxx | 2 +- src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx | 2 +- src/GEOM_I/GEOM_Field_i.cc | 12 +----- src/GroupGUI/GroupGUI_GroupDlg.cxx | 2 +- src/OBJECT/GEOM_AISShape.cxx | 2 +- src/RepairGUI/RepairGUI_GlueDlg.cxx | 2 +- src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx | 2 +- src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx | 2 +- src/XAOPlugin/XAOPlugin_ExportDlg.cxx | 2 +- src/XAOPlugin/XAOPlugin_ImportDlg.cxx | 2 +- 17 files changed, 57 insertions(+), 64 deletions(-) diff --git a/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx b/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx index ee07a99cd..0b22871f5 100644 --- a/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx +++ b/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx @@ -1236,7 +1236,8 @@ void AdvancedGUI_PipeTShapeDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, ObjectList::iterator it = pipeTShapeGroupObjects.begin(); for (int i = 0; it != pipeTShapeGroupObjects.end(); it++, i++) { - getGeomEngine()->AddInStudy(theStudy, (*it), tr((*it)->GetName()).toStdString().c_str(), theFather); + CORBA::String_var sname = (*it)->GetName(); + getGeomEngine()->AddInStudy(theStudy, (*it), sname.in(), theFather); } } diff --git a/src/EntityGUI/EntityGUI_FieldDlg.cxx b/src/EntityGUI/EntityGUI_FieldDlg.cxx index d940f5040..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; } @@ -753,7 +753,7 @@ void EntityGUI_FieldDlg::StepTable::setValues(GEOM::GEOM_FieldStep_var& step) vals->length( nbRows * nbComps ); for ( int iV = 0, iR = 0; iR < nbRows; ++iR ) for ( int iC = 1; iC < nbColumns; ++iC ) - vals[ iV++ ] = item( iR, iC )->text().toLatin1().constData(); + vals[ iV++ ] = item( iR, iC )->text().toUtf8().constData(); ss->SetValues( vals ); } } @@ -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 { @@ -1870,11 +1870,11 @@ bool EntityGUI_FieldDlg::execute() GEOM::string_array_var compNames = new GEOM::string_array(); compNames->length( nbComps ); for ( int iC = 0; iC < nbComps; ++iC ) - compNames[ iC ] = columnNames[ iC+1 ].toLatin1().constData(); + compNames[ iC ] = columnNames[ iC+1 ].toUtf8().constData(); GEOM::GEOM_IFieldOperations_var anOper = GEOM::GEOM_IFieldOperations::_narrow(getOperation()); myField = anOper->CreateField( myShape, - aName.toLatin1().constData(), + aName.toUtf8().constData(), GEOM::field_data_type( getDataType() ), CORBA::Short( getDim() ), compNames ); @@ -1882,7 +1882,7 @@ bool EntityGUI_FieldDlg::execute() return false; SALOMEDS::SObject_wrap aSO = - getGeomEngine()->AddInStudy( aStudyDS, myField, aName.toLatin1().constData(), myShape ); + getGeomEngine()->AddInStudy( aStudyDS, myField, aName.toUtf8().constData(), myShape ); if ( !aSO->_is_nil() ) { myField->UnRegister(); CORBA::String_var entry = aSO->GetID(); @@ -1891,13 +1891,13 @@ bool EntityGUI_FieldDlg::execute() } else // update field name { - myField->SetName( aName.toLatin1().constData() ); + myField->SetName( aName.toUtf8().constData() ); CORBA::String_var entry = myField->GetStudyEntry(); if ( entry.in() ) { SALOMEDS::SObject_wrap SO = aStudyDS->FindObjectID( entry.in() ); if ( !SO->_is_nil() ) { - aBuilder->SetName(SO, aName.toLatin1().constData()); + aBuilder->SetName(SO, aName.toUtf8().constData()); } } } @@ -1918,7 +1918,7 @@ bool EntityGUI_FieldDlg::execute() step = myField->AddStep( tbl->getStepID(), tbl->getStamp() ); SALOMEDS::SObject_wrap aSO = - getGeomEngine()->AddInStudy( aStudyDS, step, stepName.toLatin1().constData(), myField ); + getGeomEngine()->AddInStudy( aStudyDS, step, stepName.toUtf8().constData(), myField ); if ( /*!myIsCreation &&*/ !aSO->_is_nil() ) { step->UnRegister(); CORBA::String_var entry = aSO->GetID(); @@ -1933,7 +1933,7 @@ bool EntityGUI_FieldDlg::execute() if ( entry.in() ) { SALOMEDS::SObject_wrap SO = aStudyDS->FindObjectID( entry.in() ); if ( !SO->_is_nil() ) - aBuilder->SetName( SO, stepName.toLatin1().constData() ); + aBuilder->SetName( SO, stepName.toUtf8().constData() ); } } diff --git a/src/GEOMBase/GEOMBase.cxx b/src/GEOMBase/GEOMBase.cxx index 58c8ee0d0..87b2c58e6 100644 --- a/src/GEOMBase/GEOMBase.cxx +++ b/src/GEOMBase/GEOMBase.cxx @@ -144,7 +144,7 @@ int GEOMBase::GetNameOfSelectedIObjects( const SALOME_ListIO& IObjects, _PTR(GenericAttribute) anAttr; if ( obj && obj->FindAttribute( anAttr, "AttributeName" ) ) { _PTR(AttributeName) aNameAttr ( anAttr ); - name = aNameAttr->Value().c_str(); + name = QString::fromUtf8( aNameAttr->Value().c_str() ); } } } @@ -626,7 +626,7 @@ bool GEOMBase::SelectionByNameInDialogs( QWidget* widget, const QString& objectU /* Create a SALOME_InteractiveObject with a SALOME::SObject */ Handle(SALOME_InteractiveObject) IO = new SALOME_InteractiveObject( listSO[0]->GetID().c_str(), "GEOM", - objectUserName.toLatin1().constData() ); + objectUserName.toUtf8().constData() ); /* Add as a selected object */ /* Clear any previous selection : */ @@ -769,7 +769,7 @@ QString GEOMBase::GetName( GEOM::GEOM_Object_ptr object ) _PTR(GenericAttribute) anAttr; if ( aSObj && aSObj->FindAttribute( anAttr, "AttributeName") ) { _PTR(AttributeName) aNameAttr( anAttr ); - name = aNameAttr->Value().c_str(); + name = QString::fromUtf8( aNameAttr->Value().c_str() ); } } @@ -870,7 +870,7 @@ void GEOMBase::PublishSubObject( GEOM::GEOM_Object_ptr object ) if ( entry.isEmpty() && !CORBA::is_nil( father ) && !fatherEntry.isEmpty() ) { QString name = GetName( object ); GeometryGUI::GetGeomGen()->AddInStudy( GeometryGUI::ClientStudyToStudy( studyDS ), - object, name.toLatin1().data(), father.in() ); + object, name.toUtf8().data(), father.in() ); } } } diff --git a/src/GEOMBase/GEOMBase_Helper.cxx b/src/GEOMBase/GEOMBase_Helper.cxx index 326b9fb28..556fe588c 100755 --- a/src/GEOMBase/GEOMBase_Helper.cxx +++ b/src/GEOMBase/GEOMBase_Helper.cxx @@ -181,7 +181,7 @@ void GEOMBase_Helper::erase( GEOM::GEOM_Object_ptr object, const bool updateView QString entry = getEntry( object ); getDisplayer()->Erase( new SALOME_InteractiveObject( entry.toLatin1().constData(), - "GEOM", strdup( GEOMBase::GetName( object ).toLatin1().constData() ) ), true, updateView ); + "GEOM", strdup( GEOMBase::GetName( object ).toUtf8().constData() ) ), true, updateView ); } } @@ -220,7 +220,7 @@ void GEOMBase_Helper::redisplay( GEOM::GEOM_Object_ptr object, QString entry = getEntry( object ); getDisplayer()->Redisplay(new SALOME_InteractiveObject - (entry.toLatin1().constData(), "GEOM", strdup(GEOMBase::GetName(object).toLatin1().constData())), false); + (entry.toLatin1().constData(), "GEOM", strdup(GEOMBase::GetName(object).toUtf8().constData())), false); } if ( withChildren ) { @@ -238,7 +238,7 @@ void GEOMBase_Helper::redisplay( GEOM::GEOM_Object_ptr object, if ( !aChild->_is_nil() ) { QString entry = getEntry( aChild ); getDisplayer()->Redisplay( new SALOME_InteractiveObject( - entry.toLatin1().constData(), "GEOM", strdup( GEOMBase::GetName( aChild ).toLatin1().constData() ) ), false ); + entry.toLatin1().constData(), "GEOM", strdup( GEOMBase::GetName( aChild ).toUtf8().constData() ) ), false ); } } } @@ -479,7 +479,7 @@ void GEOMBase_Helper::localSelection( const ObjectList& theObjs, const std::list QString anEntry = getEntry( anObj ); if ( anEntry != "" ) aListOfIO.Append( new SALOME_InteractiveObject( - anEntry.toLatin1().constData(), "GEOM", strdup( GEOMBase::GetName( anObj ).toLatin1().constData() ) ) ); + anEntry.toLatin1().constData(), "GEOM", strdup( GEOMBase::GetName( anObj ).toUtf8().constData() ) ) ); } getDisplayer()->LocalSelection( aListOfIO, modes ); @@ -869,23 +869,23 @@ bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction, b QString aName = getObjectName(obj); if (aName.isEmpty()) { aName = getNewObjectName(currObj); - if ( nbObjs > 1 ) { - if (aName.isEmpty()) - aName = getPrefix(obj); - if (nbObjs <= 30) { - // Try to find a unique name - aName = GEOMBase::GetDefaultName(aName, extractPrefix()); - } else { - // Don't check name uniqueness in case of numerous objects - aName = aName + "_" + QString::number(aNumber++); - } - } else { - // PAL6521: use a prefix, if some dialog box doesn't reimplement getNewObjectName() - if ( aName.isEmpty() ) - aName = GEOMBase::GetDefaultName( getPrefix( obj ) ); - } + if ( nbObjs > 1 ) { + if (aName.isEmpty()) + aName = getPrefix(obj); + if (nbObjs <= 30) { + // Try to find a unique name + aName = GEOMBase::GetDefaultName(aName, extractPrefix()); + } else { + // Don't check name uniqueness in case of numerous objects + aName = aName + "_" + QString::number(aNumber++); + } + } else { + // PAL6521: use a prefix, if some dialog box doesn't reimplement getNewObjectName() + if ( aName.isEmpty() ) + aName = GEOMBase::GetDefaultName( getPrefix( obj ) ); + } } - anEntryList << addInStudy( obj, aName.toLatin1().constData() ); + anEntryList << addInStudy( obj, aName.toUtf8().constData() ); // updateView=false if( isDisplayResult() ) display( obj, false ); diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index 91e935cef..bbda6c347 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -2780,7 +2780,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 567ecb356..0ade3a708 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -2014,8 +2014,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(); @@ -3220,10 +3220,10 @@ bool GeometryGUI::renameObject( const QString& entry, const QString& name) if ( obj->FindAttribute(anAttr, "AttributeName") ) { _PTR(AttributeName) aName (anAttr); - aName->SetValue( name.toLatin1().data() ); // rename the SObject + aName->SetValue( name.toUtf8().data() ); // rename the SObject GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(obj)); if (!CORBA::is_nil(anObj)) { - anObj->SetName( name.toLatin1().data() ); // Rename the corresponding GEOM_Object + anObj->SetName( name.toUtf8().data() ); // Rename the corresponding GEOM_Object emit SignalDependencyTreeRenameObject( anObj->GetEntry() ); } result = true; diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx index 9a5ce23ea..e73062716 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx @@ -668,7 +668,7 @@ void GEOMToolsGUI::OnEdgeWidth() int aMgrId = dynamic_cast< SUIT_ViewModel* >( window )->getViewManager()->getGlobalId(); GEOMToolsGUI_LineWidthDlg* Dlg = - new GEOMToolsGUI_LineWidthDlg( SUIT_Session::session()->activeApplication()->desktop(), "EDGE_WIDTH_TLT" ); + new GEOMToolsGUI_LineWidthDlg( SUIT_Session::session()->activeApplication()->desktop(), tr("EDGE_WIDTH_TLT") ); QVariant v = appStudy->getObjectProperty( aMgrId, selected.First()->getEntry(), GEOM::propertyName( GEOM::LineWidth ), QVariant() ); int aWidth = v.isValid() ? v.toInt() : SUIT_Session::session()->resourceMgr()->integerValue( "Geometry", "edge_width", 1 ); @@ -711,7 +711,7 @@ void GEOMToolsGUI::OnIsosWidth() { int aMgrId = dynamic_cast< SUIT_ViewModel* >( window )->getViewManager()->getGlobalId(); GEOMToolsGUI_LineWidthDlg* Dlg = - new GEOMToolsGUI_LineWidthDlg( SUIT_Session::session()->activeApplication()->desktop(), "ISOS_WIDTH_TLT" ); + new GEOMToolsGUI_LineWidthDlg( SUIT_Session::session()->activeApplication()->desktop(), tr("ISOS_WIDTH_TLT") ); QVariant v = appStudy->getObjectProperty( aMgrId, selected.First()->getEntry(), GEOM::propertyName( GEOM::IsosWidth ), QVariant() ); int aWidth = v.isValid() ? v.toInt() : SUIT_Session::session()->resourceMgr()->integerValue( "Geometry", "isolines_width", 1 ); @@ -851,7 +851,7 @@ void GEOMToolsGUI::OnCreateFolder() _PTR(SObject) aFatherSO(aStudy->FindObjectID(anIObject->getEntry())); if ( !aFatherSO ) return; - GeometryGUI::GetGeomGen()->CreateFolder( tr("NEW_FOLDER_NAME").toLatin1().constData(), + GeometryGUI::GetGeomGen()->CreateFolder( tr("NEW_FOLDER_NAME").toUtf8().constData(), _CAST(SObject, aFatherSO)->GetSObject() ); app->updateObjectBrowser( false ); } diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_LineWidthDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_LineWidthDlg.cxx index d8748d41b..9beb27f65 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_LineWidthDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_LineWidthDlg.cxx @@ -53,7 +53,7 @@ GEOMToolsGUI_LineWidthDlg::GEOMToolsGUI_LineWidthDlg (QWidget* parent, const QSt setObjectName("GEOMToolsGUI_LineWidthDlg"); setModal(true); - setWindowTitle(tr(title.toLatin1().constData())); + setWindowTitle(title); setSizeGripEnabled(TRUE); QGridLayout* MyDialogLayout = new QGridLayout(this); MyDialogLayout->setSpacing(6); diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx index 3d8686c7d..88150a261 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx @@ -375,7 +375,7 @@ void GEOMToolsGUI_MarkerDlg::browse() filters << tr( "Texture files (*.dat)" ) << tr( "All files (*)" ); QString aFileName = SUIT_Session::session()->activeApplication()->getFileName( true, QString(), filters.join( ";;" ), tr( "LOAD_TEXTURE_TLT" ), this ); if ( !aFileName.isEmpty() ) { - addTexture( myOperation->LoadTexture( aFileName.toLatin1().constData() ), true ); + addTexture( myOperation->LoadTexture( aFileName.toUtf8().constData() ), true ); } } 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/GroupGUI/GroupGUI_GroupDlg.cxx b/src/GroupGUI/GroupGUI_GroupDlg.cxx index d314f09d2..de4a079a1 100644 --- a/src/GroupGUI/GroupGUI_GroupDlg.cxx +++ b/src/GroupGUI/GroupGUI_GroupDlg.cxx @@ -1342,7 +1342,7 @@ bool GroupGUI_GroupDlg::execute(ObjectList& objects) _PTR(SObject) SO (study->studyDS()->FindObjectIOR(objIOR.toLatin1().constData())); if (SO) { _PTR(StudyBuilder) aBuilder (study->studyDS()->NewBuilder()); - aBuilder->SetName(SO, getNewObjectName().toLatin1().constData()); + aBuilder->SetName(SO, getNewObjectName().toUtf8().constData()); } } } diff --git a/src/OBJECT/GEOM_AISShape.cxx b/src/OBJECT/GEOM_AISShape.cxx index a41490235..59a5c9fa2 100644 --- a/src/OBJECT/GEOM_AISShape.cxx +++ b/src/OBJECT/GEOM_AISShape.cxx @@ -562,7 +562,7 @@ void GEOM_AISShape::drawField( const Handle(Prs3d_Presentation)& thePrs, anAspectText3d->SetStyle( Aspect_TOST_ANNOTATION ); aGroup->SetPrimitivesAspect( anAspectText3d ); - aGroup->Text( aString.toLatin1().constData(), aVertex, 14 ); + aGroup->Text( aString.toUtf8().constData(), aVertex, 14 ); } } else diff --git a/src/RepairGUI/RepairGUI_GlueDlg.cxx b/src/RepairGUI/RepairGUI_GlueDlg.cxx index 3dcadf2a5..a45310f13 100644 --- a/src/RepairGUI/RepairGUI_GlueDlg.cxx +++ b/src/RepairGUI/RepairGUI_GlueDlg.cxx @@ -642,7 +642,7 @@ bool RepairGUI_GlueDlg::onAcceptLocal() if (aName.isEmpty()) aName = GEOMBase::GetDefaultName(getPrefix(*it)); } - addInStudy(*it, aName.toLatin1().data()); + addInStudy(*it, aName.toUtf8().data()); display(*it, false); } diff --git a/src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx b/src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx index dc5e3fa09..8dc0b6167 100644 --- a/src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx +++ b/src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx @@ -363,7 +363,7 @@ bool RepairGUI_LimitToleranceDlg::onAcceptLocal() if (aName.isEmpty()) aName = GEOMBase::GetDefaultName(getPrefix(*it)); } - addInStudy(*it, aName.toLatin1().data()); + addInStudy(*it, aName.toUtf8().data()); display(*it, false); } diff --git a/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx b/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx index 6d9f4dcc0..ff893d22f 100755 --- a/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx +++ b/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx @@ -711,7 +711,7 @@ bool RepairGUI_ShapeProcessDlg::execute( ObjectList& objects ) } if ( !anErrorObjNames.empty() ) - MESSAGE( "ERRORS occured while processing the following objects: " << anErrorObjNames.join( " " ).toLatin1().data() ); + MESSAGE( "ERRORS occured while processing the following objects: " << anErrorObjNames.join( " " ).toUtf8().data() ); return anErrorObjNames.size() < myObjects->length(); // true if at least one object was OK, false if ALL objects were nil after Healing. } diff --git a/src/XAOPlugin/XAOPlugin_ExportDlg.cxx b/src/XAOPlugin/XAOPlugin_ExportDlg.cxx index a4a88ee03..55a5a1ace 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); diff --git a/src/XAOPlugin/XAOPlugin_ImportDlg.cxx b/src/XAOPlugin/XAOPlugin_ImportDlg.cxx index 6acce2f5e..d41331ea9 100644 --- a/src/XAOPlugin/XAOPlugin_ImportDlg.cxx +++ b/src/XAOPlugin/XAOPlugin_ImportDlg.cxx @@ -330,7 +330,7 @@ QString XAOPlugin_ImportDlg::addFieldInStudy( GEOM::GEOM_Field_ptr theField, GEO GEOM::GEOM_FieldStep_ptr step = theField->GetStep(steps[i]); QString stepName = (tr("XAOPLUGIN_STEP") + " %1 %2").arg( step->GetID() ).arg( step->GetStamp() ); SALOMEDS::SObject_wrap aSOField = - getGeomEngine()->AddInStudy( aStudyDS, step, stepName.toLatin1().constData(), theField ); + getGeomEngine()->AddInStudy( aStudyDS, step, stepName.toUtf8().constData(), theField ); } aSO->UnRegister();