Tag: cws_src680_mozab05
User: windly  
Date: 05/01/31 00:14:49

Modified:
 /dba/dbaccess/source/ui/dlg/
  ConnectionHelper.cxx

Log:
 RESYNC: (1.3-1.4); FILE MERGED

File Changes:

Directory: /dba/dbaccess/source/ui/dlg/
=======================================

File [changed]: ConnectionHelper.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/dlg/ConnectionHelper.cxx?r1=1.2.30.2&r2=1.2.30.3
Delta lines:  +24 -20
---------------------
--- ConnectionHelper.cxx        17 Jan 2005 07:54:04 -0000      1.2.30.2
+++ ConnectionHelper.cxx        31 Jan 2005 08:14:46 -0000      1.2.30.3
@@ -71,9 +71,18 @@
 #ifndef _DBU_DLG_HRC_
 #include "dbu_dlg.hrc"
 #endif
+#ifndef _DBU_MISC_HRC_
+#include "dbu_misc.hrc"
+#endif
 #ifndef _SFXITEMSET_HXX 
 #include <svtools/itemset.hxx>
 #endif
+#ifndef INCLUDED_SVTOOLS_MODULEOPTIONS_HXX
+#include <svtools/moduleoptions.hxx>
+#endif
+#ifndef _SFX_FCONTNR_HXX
+#include <sfx2/fcontnr.hxx>
+#endif
 #ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX 
 #include <svtools/pathoptions.hxx>
 #endif
@@ -326,17 +335,20 @@
                        break;
                        case DST_CALC:
                        {
-                               static const String s_sCalcType = 
String::CreateFromAscii("StarOffice XML (Calc)");
-                               const SfxFilter* pFilter = 
SfxFilter::GetFilterByName( s_sCalcType);
-                               OSL_ENSURE(pFilter,"Filter: StarOffice XML 
(Calc) could not be found!"); 
-                               
askForFileName(pFilter->GetUIName(),pFilter->GetDefaultExtension());
+                               ::sfx2::FileDialogHelper aFileDlg(WB_3DLOOK | 
WB_STDMODAL | WB_OPEN
+                                                                               
                
,SvtModuleOptions().GetFactoryEmptyDocumentURL(SvtModuleOptions::E_CALC)
+                                                                               
                ,SFX_FILTER_IMPORT);
+                               askForFileName(aFileDlg);
                        }
                        break;
                        case DST_MSACCESS:
                        {
                                ::rtl::OUString 
sExt(RTL_CONSTASCII_USTRINGPARAM("*.mdb"));
                                String sFilterName(ModuleRes 
(STR_MSACCESS_FILTERNAME));
-                               askForFileName(sFilterName,sExt);
+                               ::sfx2::FileDialogHelper aFileDlg(WB_3DLOOK | 
WB_STDMODAL | WB_OPEN);           
+                               aFileDlg.AddFilter(sFilterName,sExt);
+                               aFileDlg.SetCurrentFilter(sFilterName);
+                               askForFileName(aFileDlg);
                        }
                        break;
                        case DST_ADABAS:
@@ -951,7 +963,7 @@
                                { // #106016# --------------------------
                                        if( pathExists(sURL, sal_True) == 
PATH_NOT_EXIST )
                                        {
-                                               String sFile = 
String(ModuleRes(STR_CALCDOC_DOESNOTEXIST));
+                                               String sFile = String( 
ModuleRes( STR_FILE_DOES_NOT_EXIST ) );
                                                
sFile.SearchAndReplaceAscii("$file$", 
aTransformer.get(OFileNotation::N_SYSTEM));
                                                
OSQLMessageBox(this,String(ModuleRes(STR_STAT_WARNING)),sFile).Execute();
                                                setURLNoPrefix(sOldPath);
@@ -992,25 +1004,17 @@
                m_aET_Connection.SaveValueNoPrefix();
                return sal_True;
        }
-
-       
-    
     //-------------------------------------------------------------------------
-    void OConnectionHelper::askForFileName(const ::rtl::OUString& 
_sFilterName, const ::rtl::OUString& _sExtension)
+    void OConnectionHelper::askForFileName(::sfx2::FileDialogHelper& 
_aFileOpen)
        {
-        ::sfx2::FileDialogHelper aFileDlg(WB_3DLOOK | WB_STDMODAL | WB_OPEN);
-               
-        aFileDlg.AddFilter(_sFilterName,_sExtension);
-               aFileDlg.SetCurrentFilter(_sFilterName);
-
                String sOldPath = getURLNoPrefix();
                if ( sOldPath.Len() )
-                       aFileDlg.SetDisplayDirectory(sOldPath);
+                       _aFileOpen.SetDisplayDirectory(sOldPath);
                else
-                       aFileDlg.SetDisplayDirectory( 
SvtPathOptions().GetWorkPath() );
-               if (0 == aFileDlg.Execute())
+                       _aFileOpen.SetDisplayDirectory( 
SvtPathOptions().GetWorkPath() );
+               if (0 == _aFileOpen.Execute())
                {
-                   setURLNoPrefix(aFileDlg.GetPath());
+                   setURLNoPrefix(_aFileOpen.GetPath());
             SetRoadmapStateValue(checkTestConnection());
                        callModifiedHdl();
                }




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to