It turns out that it makes a difference whether you call the
importer's version of this versus the exporter's version.
For instance, .abw and .abt are classed as the same for importing
but different for exporting.  Calling the wrong function was causing
the OpenSaveAs dialog to default to the wrong filetype at least on
Windows.

Andrew Dunbar.

-- 
http://linguaphile.sourceforge.net
Index: src/wp/ap/xp/ap_Convert.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/xp/ap_Convert.cpp,v
retrieving revision 1.2
diff -u -r1.2 ap_Convert.cpp
--- src/wp/ap/xp/ap_Convert.cpp 2001/03/25 07:46:36     1.2
+++ src/wp/ap/xp/ap_Convert.cpp 2001/06/18 13:08:31
@@ -22,6 +22,7 @@
 
 #include "ap_Convert.h"
 #include "ie_exp.h"
+#include "ie_imp.h"
 #include "ut_types.h"
 
 class XAP_App;
@@ -128,7 +129,7 @@
        strncat(ext, szTargetSuffix, 255);
        strncat(sourceExt, szSourceSuffix, 255);
        ieft = IE_Exp::fileTypeForSuffix(ext);
-       sourceIeft = IE_Exp::fileTypeForSuffix(sourceExt);
+       sourceIeft = IE_Imp::fileTypeForSuffix(sourceExt);
        strncpy(file, szFilename, 255);
 
        tmp = strrchr(file, '.');
Index: src/wp/ap/xp/ap_EditMethods.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/xp/ap_EditMethods.cpp,v
retrieving revision 1.348
diff -u -r1.348 ap_EditMethods.cpp
--- src/wp/ap/xp/ap_EditMethods.cpp     2001/06/13 21:23:45     1.348
+++ src/wp/ap/xp/ap_EditMethods.cpp     2001/06/18 13:08:58
@@ -1200,8 +1212,10 @@
 
        if (*ieft != IEFT_Bogus)
                dflFileType = *ieft;
-       else
+       else if (bSaveAs)
                dflFileType = IE_Exp::fileTypeForSuffix (".abw");
+       else
+               dflFileType = IE_Imp::fileTypeForSuffix (".abw");
 
        pDialog->setDefaultFileType(dflFileType);
                
@@ -5888,12 +6100,14 @@
        pView->setStyle(style);
        return true;
 }
-
 
+// TODO Dialog is not released?!
 static bool s_doStylesDlg(FV_View * pView)
 {
        XAP_Frame * pFrame = (XAP_Frame *) pView->getParentData();

Reply via email to