User: kz Date: 05/01/21 09:11:21 Modified: /dba/dbaccess/source/ui/dlg/ ConnectionHelper.cxx
Log: INTEGRATION: CWS dba22 (1.2.24); FILE MERGED 2005/01/13 09:44:00 oj 1.2.24.5: #i39326# now even template documents are shown 2005/01/07 07:55:24 oj 1.2.24.4: RESYNC: (1.2-1.3); FILE MERGED 2005/01/06 15:57:39 oj 1.2.24.3: #i39326# use file open dialog for calc with installed filters 2004/12/20 15:27:44 fs 1.2.24.2: #i39187# renamed and moved STR_CALCDOC_DOESNOTEXIST 2004/12/20 15:12:25 fs 1.2.24.1: #i39187# renamed a string resource for re-usage 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.3&r2=1.4 Delta lines: +24 -20 --------------------- --- ConnectionHelper.cxx 26 Nov 2004 18:18:52 -0000 1.3 +++ ConnectionHelper.cxx 21 Jan 2005 17:11:18 -0000 1.4 @@ -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 @@ -320,17 +329,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: @@ -901,7 +913,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); @@ -942,25 +954,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]
