Tag: cws_src680_dba24
User: oj      
Date: 05/02/21 05:08:38

Modified:
 /dba/dbaccess/source/core/dataaccess/
  databasecontext.cxx

Log:
 RESYNC: (1.26-1.28); FILE MERGED

File Changes:

Directory: /dba/dbaccess/source/core/dataaccess/
================================================

File [changed]: databasecontext.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasecontext.cxx?r1=1.26.2.3&r2=1.26.2.4
Delta lines:  +26 -16
---------------------
--- databasecontext.cxx 18 Feb 2005 12:25:26 -0000      1.26.2.3
+++ databasecontext.cxx 21 Feb 2005 13:08:35 -0000      1.26.2.4
@@ -171,6 +171,8 @@
 using ::com::sun::star::task::InteractionClassification_ERROR;
 using ::com::sun::star::ucb::IOErrorCode_NO_FILE;
 using ::com::sun::star::ucb::InteractiveIOException;
+using ::com::sun::star::ucb::IOErrorCode_NOT_EXISTING;
+using ::com::sun::star::ucb::IOErrorCode_NOT_EXISTING_PATH;
 
 //==========================================================================
 
@@ -206,9 +208,6 @@
                        static ::rtl::OUString s_sNodeName = 
::rtl::OUString::createFromAscii("Location");
                        return s_sNodeName;
                }
-       }
-
-//============================================================
 //= ODatabaseContext
 //==========================================================================
 DBG_NAME(ODatabaseContext)
@@ -303,10 +302,6 @@
        }
        if ( !xExistent.is() )
                xExistent = createInstance();
-
-       return xExistent;
-}
-
 // DatabaseAccessContext_Base
 
//------------------------------------------------------------------------------
 void ODatabaseContext::disposing()
@@ -387,7 +382,22 @@
        }
        catch(InteractiveIOException e)
        {
-               throw WrappedTargetException( _sURL, 
Reference<XNamingService>(this), makeAny( e ) );
+        if  (   ( e.Code == IOErrorCode_NO_FILE )
+            ||  ( e.Code == IOErrorCode_NOT_EXISTING )
+            ||  ( e.Code == IOErrorCode_NOT_EXISTING_PATH )
+            )
+        {
+            // #i40463# #i39187#
+            String sErrorMessage( DBACORE_RESSTRING( 
RID_STR_FILE_DOES_NOT_EXIST ) );
+            ::svt::OFileNotation aTransformer( _sURL );
+                   sErrorMessage.SearchAndReplaceAscii( "$file$", 
aTransformer.get( ::svt::OFileNotation::N_SYSTEM ) );
+
+            SQLException aError;
+            aError.Message = sErrorMessage;
+
+            throw WrappedTargetException( _sURL, Reference< XNamingService >( 
this ), makeAny( aError ) );
+        }
+               throw WrappedTargetException( _sURL, Reference< XNamingService 
>( this ), makeAny( e ) );
        }
        catch(Exception e)
        {
@@ -434,8 +444,6 @@
 
                        for (sal_Int32 i=0; 
i<rSessionPersistentProps.getLength(); ++i, ++pSessionPersistentProps)
                        {
-                               try
-                               {
                                        
xDSProps->setPropertyValue(pSessionPersistentProps->Name, 
pSessionPersistentProps->Value);
                                }
                                catch(Exception&)
@@ -443,6 +451,8 @@
                                        
DBG_ERROR("ODatabaseContext::setTransientProperties: could not set a 
session-persistent property on the data source!");
                                }
                        }
+                       else
+                               
DBG_ERROR("ODatabaseContext::getRegisteredObject: missing an interface!");
                }
                else
                        DBG_ERROR("ODatabaseContext::setTransientProperties: 
missing an interface!");




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

Reply via email to