From: jfa Date: Wed, 24 Oct 2007 06:40:41 +0000 (+0000) Subject: NPAL17002: merge from 3.2.X. X-Git-Tag: V4_1_0a3~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8d6ca361a141308435fd736d4b58be65034a0df5;p=modules%2Fgeom.git NPAL17002: merge from 3.2.X. --- diff --git a/src/GEOMImpl/GEOMImpl_ExportDriver.cxx b/src/GEOMImpl/GEOMImpl_ExportDriver.cxx index 559908207..5ea854b96 100644 --- a/src/GEOMImpl/GEOMImpl_ExportDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ExportDriver.cxx @@ -28,9 +28,7 @@ #include #include -#include - -#include +#include #ifdef WNT #include @@ -106,8 +104,11 @@ Standard_Integer GEOMImpl_ExportDriver::Execute(TFunction_Logbook& log) const if ( anExportLib ) fp = (funcPoint)GetProc( anExportLib, "Export" ); - if ( !fp ) - return 0; + if ( !fp ) { + TCollection_AsciiString aMsg = aFormatName; + aMsg += " plugin was not installed"; + Standard_Failure::Raise(aMsg.ToCString()); + } // perform the export int res = fp( aShape, aFileName, aFormatName ); diff --git a/src/GEOMImpl/GEOMImpl_ImportDriver.cxx b/src/GEOMImpl/GEOMImpl_ImportDriver.cxx index b2ff8fe6b..3249a485e 100644 --- a/src/GEOMImpl/GEOMImpl_ImportDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ImportDriver.cxx @@ -29,11 +29,9 @@ #include -#include +#include #include -#include - #ifdef WNT #include #else @@ -94,14 +92,17 @@ Standard_Integer GEOMImpl_ImportDriver::Execute(TFunction_Logbook& log) const if (aFileName.IsEmpty() || aFormatName.IsEmpty() || aLibName.IsEmpty()) return 0; - // load plugin library + // load plugin library LibHandle anImportLib = LoadLib( aLibName.ToCString() ); //This is workaround of BUG OCC13051 funcPoint fp = 0; if ( anImportLib ) fp = (funcPoint)GetProc( anImportLib, "Import" ); - if ( !fp ) - return 0; + if ( !fp ) { + TCollection_AsciiString aMsg = aFormatName; + aMsg += " plugin was not installed"; + Standard_Failure::Raise(aMsg.ToCString()); + } // perform the import TCollection_AsciiString anError; diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.cxx b/src/GEOMToolsGUI/GEOMToolsGUI.cxx index 2527b21cd..39a6cd31b 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI.cxx @@ -72,15 +72,16 @@ typedef QMap FilterMap; static QString getFileName( QWidget* parent, const QString& initial, const FilterMap& filterMap, + const QStringList filters, const QString& caption, bool open, QString& format ) { static QString lastUsedFilter; - QStringList filters; + //QStringList filters; QString aBrepFilter; for ( FilterMap::const_iterator it = filterMap.begin(); it != filterMap.end(); ++it ) { - filters.push_back( it.key() ); + //filters.push_back( it.key() ); if (it.key().contains("BREP", false)) { aBrepFilter = it.key(); @@ -301,7 +302,7 @@ void GEOMToolsGUI::OnEditDelete() // VSR 17/11/04: check if all objects selected belong to GEOM component --> start // modifications of ASV 01.06.05 QString parentComp = getParentComponent( aStudy, selected ); - CORBA::String_var geomIOR = app->orb()->object_to_string( GeometryGUI::GetGeomGen() ); + CORBA::String_var geomIOR = app->orb()->object_to_string( GeometryGUI::GetGeomGen() ); QString geomComp = getParentComponent( aStudy->FindObjectIOR( geomIOR.in() ) ); if ( parentComp != geomComp ) { @@ -474,15 +475,18 @@ bool GEOMToolsGUI::Import() // Obtain a list of available import formats FilterMap aMap; + QStringList filters; GEOM::string_array_var aFormats, aPatterns; aInsOp->ImportTranslators( aFormats, aPatterns ); - for ( int i = 0, n = aFormats->length(); i < n; i++ ) + for ( int i = 0, n = aFormats->length(); i < n; i++ ) { aMap.insert( (char*)aPatterns[i], (char*)aFormats[i] ); + filters.push_back( (char*)aPatterns[i] ); + } QString fileType; - QString fileName = getFileName(app->desktop(), "", aMap, + QString fileName = getFileName(app->desktop(), "", aMap, filters, tr("GEOM_MEN_IMPORT"), true, fileType); if (fileType.isEmpty() ) @@ -579,10 +583,13 @@ bool GEOMToolsGUI::Export() // Obtain a list of available export formats FilterMap aMap; + QStringList filters; GEOM::string_array_var aFormats, aPatterns; aInsOp->ExportTranslators( aFormats, aPatterns ); - for ( int i = 0, n = aFormats->length(); i < n; i++ ) + for ( int i = 0, n = aFormats->length(); i < n; i++ ) { aMap.insert( (char*)aPatterns[i], (char*)aFormats[i] ); + filters.push_back( (char*)aPatterns[i] ); + } // Get selected objects LightApp_SelectionMgr* sm = app->selectionMgr(); @@ -602,7 +609,7 @@ bool GEOMToolsGUI::Export() continue; QString fileType; - QString file = getFileName(app->desktop(), QString( IObject->getName() ), aMap, + QString file = getFileName(app->desktop(), QString( IObject->getName() ), aMap, filters, tr("GEOM_MEN_EXPORT"), false, fileType); // User has pressed "Cancel" --> stop the operation