From 5de7e1b9c1b272ff21a6216568b6b7d42aed75c7 Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Fri, 21 Jan 2005 16:11:18 +0000 Subject: 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 --- dbaccess/source/ui/dlg/ConnectionHelper.cxx | 46 ++++++++++++++++------------- 1 file changed, 25 insertions(+), 21 deletions(-) (limited to 'dbaccess/source/ui/dlg/ConnectionHelper.cxx') diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index 5f04cbdd51c9..1ecc49a9e17a 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ConnectionHelper.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: rt $ $Date: 2004-11-26 18:18:52 $ + * last change: $Author: kz $ $Date: 2005-01-21 17:11:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -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 #endif +#ifndef INCLUDED_SVTOOLS_MODULEOPTIONS_HXX +#include +#endif +#ifndef _SFX_FCONTNR_HXX +#include +#endif #ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX #include #endif @@ -320,17 +329,20 @@ namespace dbaui 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 @@ namespace dbaui { // #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 @@ namespace dbaui 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(); } -- cgit