From b4d723ae766351bebd9e38c1d4ba6ac20f077436 Mon Sep 17 00:00:00 2001 From: jfa Date: Thu, 4 Oct 2007 12:43:45 +0000 Subject: [PATCH] NPAL17002: EDF578: Problem when trying to import some ACIS and IGES files. Correct order of import/export patterns. --- src/GEOMToolsGUI/GEOMToolsGUI.cxx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.cxx b/src/GEOMToolsGUI/GEOMToolsGUI.cxx index baacd7c27..b5dbedc5e 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(); @@ -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 -- 2.39.2