Tag: cws_src680_dba24
User: oj      
Date: 05/02/03 05:52:22

Modified:
 /dba/dbaccess/source/ui/browser/
  genericcontroller.cxx, dbloader.cxx
 /dba/dbaccess/source/ui/inc/
  genericcontroller.hxx
 /dba/dbaccess/source/ui/misc/
  singledoccontroller.cxx
 /dba/dbaccess/source/ui/relationdesign/
  RelationController.cxx

Log:
 #i41913# release view if exception occured while loading

File Changes:

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

File [changed]: genericcontroller.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/genericcontroller.cxx?r1=1.59.4.1&r2=1.59.4.2
Delta lines:  +29 -20
---------------------
--- genericcontroller.cxx       3 Feb 2005 08:10:29 -0000       1.59.4.1
+++ genericcontroller.cxx       3 Feb 2005 13:52:12 -0000       1.59.4.2
@@ -284,6 +284,8 @@
                        aValue.Value >>= m_bPreview;
                }
        }
+       try
+       {
        if ( xFrame.is() )
        {
                xParent = xFrame->getContainerWindow();
@@ -304,6 +306,14 @@
        if ( (m_bReadOnly || m_bPreview) && pView )
                pView->EnableInput(FALSE);
        impl_initialize(aArguments);
+       }
+       catch(Exception& e)
+       {
+               // no one clears my view if I won't
+               ::std::auto_ptr<Window> aTemp(m_pView);
+               m_pView = NULL;
+               throw e;
+       }
        if ( xFrame.is() )
                xFrame->setComponent(getComponentWindow(), this);
 }
@@ -517,7 +527,7 @@
 }
 
 
//------------------------------------------------------------------------------
-sal_Bool OGenericUnoController::IsFeatureSupported( sal_Int32 _nId )
+sal_Bool OGenericUnoController::isFeatureSupported( sal_Int32 _nId )
 {
        SupportedFeatures::iterator aFeaturePos = ::std::find_if(
                m_aSupportedFeatures.begin(),
@@ -525,7 +535,7 @@
                ::std::bind2nd( SupportedFeaturesEqualId(), _nId )
        );
 
-    return ( m_aSupportedFeatures.end() != aFeaturePos );
+    return ( m_aSupportedFeatures.end() != aFeaturePos && 
aFeaturePos->first.getLength());
 }
 
 // -----------------------------------------------------------------------
@@ -871,7 +881,6 @@
 
        return aReturn;
 }
-
 
//------------------------------------------------------------------------------
 URL OGenericUnoController::getURLForId(sal_Int32 _nId) const
 {

File [changed]: dbloader.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/dbloader.cxx?r1=1.20&r2=1.20.22.1
Delta lines:  +11 -2
--------------------
--- dbloader.cxx        13 Dec 2004 12:23:06 -0000      1.20
+++ dbloader.cxx        3 Feb 2005 13:52:13 -0000       1.20.22.1
@@ -269,9 +269,9 @@
        
        if(bSuccess = xController.is())
        {
+               Reference<XModel> xModel;
                if ( bAttachModel )
                {
-                       Reference<XModel> xModel;
                        PropertyValue aValue;
                        const PropertyValue* pIter      = 
m_aArgs.getConstArray();
                        const PropertyValue* pEnd               = pIter + 
m_aArgs.getLength();
@@ -350,6 +350,15 @@
                        catch(Exception&)
                        {
                                bSuccess = sal_False;
+                               try
+                {
+                                   xController->attachModel(NULL);
+                                   xModel->disconnectController( xController );
+                }
+                catch( const Exception& )
+                {
+                    OSL_ENSURE( sal_False, "DBContentLoader::load: caught an 
exception!" );
+                }
                        }
                }
 

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

File [changed]: genericcontroller.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/inc/genericcontroller.hxx?r1=1.32.20.1&r2=1.32.20.2
Delta lines:  +9 -5
-------------------
--- genericcontroller.hxx       3 Feb 2005 08:11:07 -0000       1.32.20.1
+++ genericcontroller.hxx       3 Feb 2005 13:52:13 -0000       1.32.20.2
@@ -325,6 +325,12 @@
                     sal_Int16 _nCommandGroup = 
::com::sun::star::frame::CommandGroup::INTERNAL
                 );
 
+               /** returns <TRUE/> if the feature is supported, otherwise 
<FALSE/>
+                       @param  _nId
+                               The ID of the feature.
+               */
+               sal_Bool isFeatureSupported( sal_Int32 _nId );
+
         // gets the URL which the given id is assigned to
                ::com::sun::star::util::URL getURLForId(sal_Int32 _nId) const;
 
@@ -396,8 +402,6 @@
                void showError(const ::dbtools::SQLExceptionInfo& _rInfo);
                // temp
                virtual ::com::sun::star::uno::Reference< 
::com::sun::star::awt::XWindow > getComponentWindow() const;
-
-        sal_Bool    IsFeatureSupported( sal_Int32 _nId );
 
                // if xListener is NULL the change will be forwarded to all 
listeners to the given ::com::sun::star::util::URL
                // if _bForceBroadcast is sal_True, the current feature state 
is broadcasted no matter if it is the same as the cached state

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

File [changed]: singledoccontroller.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/singledoccontroller.cxx?r1=1.13.70.1&r2=1.13.70.2
Delta lines:  +6 -5
-------------------
--- singledoccontroller.cxx     3 Feb 2005 08:10:54 -0000       1.13.70.1
+++ singledoccontroller.cxx     3 Feb 2005 13:52:14 -0000       1.13.70.2
@@ -308,7 +308,7 @@
                sal_Bool bReConnect = sal_True;
                if ( _bUI )
                {
-                       QueryBox aQuery( getView(), 
ModuleRes(TABLE_QUERY_CONNECTION_LOST) );
+                       QueryBox aQuery( getView(), 
ModuleRes(QUERY_CONNECTION_LOST) );
                        bReConnect = ( RET_YES == aQuery.Execute() );
                }
 
@@ -541,7 +541,8 @@
        {
                m_bModified = _bModified;
                InvalidateFeature(ID_BROWSER_SAVEDOC);
-        if ( IsFeatureSupported( ID_BROWSER_SAVEASDOC ) )
+
+        if ( isFeatureSupported( ID_BROWSER_SAVEASDOC ) )
                    InvalidateFeature(ID_BROWSER_SAVEASDOC);
        }
        // 
-----------------------------------------------------------------------------

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

File [changed]: RelationController.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/relationdesign/RelationController.cxx?r1=1.37&r2=1.37.28.1
Delta lines:  +2 -1
-------------------
--- RelationController.cxx      16 Nov 2004 14:33:02 -0000      1.37
+++ RelationController.cxx      3 Feb 2005 13:52:14 -0000       1.37.28.1
@@ -357,9 +357,10 @@
                {
                        String sTitle(ModuleRes(STR_RELATIONDESIGN));
                        sTitle.Erase(0,3);
-                       OSQLMessageBox 
aDlg(getView(),sTitle,ModuleRes(STR_RELATIONDESIGN_NOT_AVAILABLE));
+                       OSQLMessageBox 
aDlg(NULL,sTitle,ModuleRes(STR_RELATIONDESIGN_NOT_AVAILABLE));
                        aDlg.Execute();
                }
+               disconnect();
                throw SQLException();
        }
 




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

Reply via email to