diff options
author | Ocke Janssen <oj@openoffice.org> | 2001-07-23 12:15:04 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2001-07-23 12:15:04 +0000 |
commit | f00563553eba950a6a1bb280b137a9431cd542e6 (patch) | |
tree | 0022d52bc55df28b82ca46c531c3e4e880af829a /dbaccess | |
parent | f7dfc70a6cc368fcb1cd530a1bbd477ada7e2d1a (diff) |
#90074# check if calc doc exists
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/dlg/dbadmin.src | 12 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/generalpage.cxx | 73 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/generalpage.hxx | 8 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/dbu_resource.hrc | 8 |
4 files changed, 77 insertions, 24 deletions
diff --git a/dbaccess/source/ui/dlg/dbadmin.src b/dbaccess/source/ui/dlg/dbadmin.src index ac5341a82208..c591bf0368d3 100644 --- a/dbaccess/source/ui/dlg/dbadmin.src +++ b/dbaccess/source/ui/dlg/dbadmin.src @@ -2,9 +2,9 @@ * * $RCSfile: dbadmin.src,v $ * - * $Revision: 1.64 $ + * $Revision: 1.65 $ * - * last change: $Author: oj $ $Date: 2001-07-19 09:22:58 $ + * last change: $Author: oj $ $Date: 2001-07-23 13:13:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -3256,10 +3256,18 @@ String STR_ADDRESSBOOK_LDAP Text[ arabic ] = "LDAP addressbook"; Text[ catalan ] = "LDAP addressbook"; }; +String STR_CALCDOC_DOESNOTEXIST +{ + Text = "Die Datei \"$file$\" existiert nicht."; + Text [ english ] = "The file \"$file$\" does not exist."; +}; /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.64 2001/07/19 09:22:58 oj + * #89594# insert mnemonics + * * Revision 1.63 2001/07/17 20:28:54 kz * Merge SRC638: 17.07.01 - 22:31:16 * diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index c6eb2cd55b5d..1329fa764110 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -2,9 +2,9 @@ * * $RCSfile: generalpage.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: oj $ $Date: 2001-07-17 07:35:00 $ + * last change: $Author: oj $ $Date: 2001-07-23 13:13:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -132,7 +132,9 @@ #ifndef _DBAUI_DETAILPAGES_HXX_ #include "detailpages.hxx" #endif - +#ifndef _DBAUI_SQLMESSAGE_HXX_ +#include "sqlmessage.hxx" +#endif #ifndef _COM_SUN_STAR_UI_DIALOGS_XFOLDERPICKER_HPP_ #include <com/sun/star/ui/dialogs/XFolderPicker.hpp> #endif @@ -715,6 +717,19 @@ namespace dbaui catch(const Exception&) { } return bExists; } + //------------------------------------------------------------------------- + sal_Bool OGeneralPage::fileExists(const ::rtl::OUString& _rURL) const + { + ::ucb::Content aCheckExistence; + sal_Bool bExists = sal_False; + try + { + aCheckExistence = ::ucb::Content(_rURL, Reference< XCommandEnvironment >()); + bExists = aCheckExistence.isDocument(); + } + catch(const Exception&) { } + return bExists; + } //------------------------------------------------------------------------- sal_Int32 OGeneralPage::checkPathExistence(const String& _rURL) @@ -771,7 +786,7 @@ namespace dbaui //------------------------------------------------------------------------- sal_Bool OGeneralPage::commitURL() { - if ((DST_DBASE == m_eCurrentSelection) || (DST_TEXT == m_eCurrentSelection)) + if ((DST_DBASE == m_eCurrentSelection) || (DST_TEXT == m_eCurrentSelection) || (DST_CALC == m_eCurrentSelection)) { String sOldPath = m_aConnection.GetSavedValueNoPrefix(); String sURL = m_aConnection.GetTextNoPrefix(); @@ -782,23 +797,42 @@ namespace dbaui OFileNotation aTransformer(sURL, OFileNotation::N_DETECT); sURL = aTransformer.get(OFileNotation::N_URL); - switch (checkPathExistence(sURL)) + if(DST_CALC == m_eCurrentSelection) { - case RET_RETRY: - m_bUserGrabFocus = sal_False; - m_aConnection.GrabFocus(); - m_bUserGrabFocus = sal_True; - return sal_False; - - case RET_CANCEL: - m_aConnection.SetText(sOldPath); + if(!fileExists(sURL)) + { + String sFile = String(ModuleRes(STR_CALCDOC_DOESNOTEXIST)); + sFile.SearchAndReplaceAscii("$file$", aTransformer.get(OFileNotation::N_SYSTEM)); + OSQLMessageBox(this,String(ModuleRes(STR_STAT_WARNING)),sFile).Execute(); + m_aConnection.SetTextNoPrefix(sOldPath); return sal_False; - - default: - // accept the input + } + else + { m_aConnection.SetTextNoPrefix(sURL); m_aConnection.SaveValueNoPrefix(); - break; + } + } + else + { + switch (checkPathExistence(sURL)) + { + case RET_RETRY: + m_bUserGrabFocus = sal_False; + m_aConnection.GrabFocus(); + m_bUserGrabFocus = sal_True; + return sal_False; + + case RET_CANCEL: + m_aConnection.SetTextNoPrefix(sOldPath); + return sal_False; + + default: + // accept the input + m_aConnection.SetTextNoPrefix(sURL); + m_aConnection.SaveValueNoPrefix(); + break; + } } } } @@ -809,7 +843,7 @@ namespace dbaui //------------------------------------------------------------------------- long OGeneralPage::PreNotify( NotifyEvent& _rNEvt ) { - if ((DST_DBASE == m_eCurrentSelection) || (DST_TEXT == m_eCurrentSelection)) + if ((DST_DBASE == m_eCurrentSelection) || (DST_TEXT == m_eCurrentSelection) || (DST_CALC == m_eCurrentSelection)) switch (_rNEvt.GetType()) { case EVENT_GETFOCUS: @@ -1177,6 +1211,9 @@ namespace dbaui /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.15 2001/07/17 07:35:00 oj + * #89533# GetMainURL changed + * * Revision 1.14 2001/07/16 07:48:40 oj * #89578# removed : after address url * diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx index 066787a9441c..e81fa7ba75b3 100644 --- a/dbaccess/source/ui/dlg/generalpage.hxx +++ b/dbaccess/source/ui/dlg/generalpage.hxx @@ -2,9 +2,9 @@ * * $RCSfile: generalpage.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: oj $ $Date: 2001-05-29 13:33:12 $ + * last change: $Author: oj $ $Date: 2001-07-23 13:13:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -170,6 +170,7 @@ namespace dbaui sal_Bool commitURL(); sal_Bool createDirectoryDeep(const String& _rPathNormalized); sal_Bool directoryExists(const ::rtl::OUString& _rURL) const; + sal_Bool fileExists(const ::rtl::OUString& _rURL) const; void checkCreateDatabase(DATASOURCE_TYPE _eType); sal_Bool isBrowseable(DATASOURCE_TYPE _eType) const; @@ -190,6 +191,9 @@ namespace dbaui /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.2 2001/05/29 13:33:12 oj + * #87149# addressbook ui impl + * * Revision 1.1 2001/05/29 09:59:32 fs * initial checkin - outsourced the class from commonpages * diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc index 252ae3ab0614..0f9b94874dbb 100644 --- a/dbaccess/source/ui/inc/dbu_resource.hrc +++ b/dbaccess/source/ui/inc/dbu_resource.hrc @@ -2,9 +2,9 @@ * * $RCSfile: dbu_resource.hrc,v $ * - * $Revision: 1.57 $ + * $Revision: 1.58 $ * - * last change: $Author: oj $ $Date: 2001-07-18 08:51:09 $ + * last change: $Author: oj $ $Date: 2001-07-23 13:15:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -446,6 +446,7 @@ #define STR_ERROR_PASSWORDS_NOT_IDENTICAL RID_STRING_START + 184 #define STR_TABLEDESIGN_DATASOURCE_DELETED RID_STRING_START + 185 #define STR_DATASOURCE_DELETED RID_STRING_START + 186 +#define STR_CALCDOC_DOESNOTEXIST RID_STRING_START + 187 //======================================================================== // untyped resources @@ -460,6 +461,9 @@ /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.57 2001/07/18 08:51:09 oj + * #89772# set new configurationnode when datasource was renamed + * * Revision 1.56 2001/07/16 13:42:36 oj * #89650# check if table was created for html/rtf format * |