User: hr      
Date: 05/04/06 02:47:43

Modified:
 /dba/dbaccess/source/ui/app/
  AppController.cxx

Log:
 INTEGRATION: CWS dba29 (1.18.6); FILE MERGED
 2005/03/31 13:19:53 fs 1.18.6.2: #i46396# suspend: do not remember the 
suspended state if suspension was not successful
 2005/03/30 10:20:30 fs 1.18.6.1: #i45908# renaming a query doesn't need a 
connection

File Changes:

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

File [changed]: AppController.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppController.cxx?r1=1.18&r2=1.19
Delta lines:  +21 -15
---------------------
--- AppController.cxx   18 Mar 2005 10:07:07 -0000      1.18
+++ AppController.cxx   6 Apr 2005 09:47:41 -0000       1.19
@@ -578,17 +578,18 @@
 {
     ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
     ::osl::MutexGuard aGuard(m_aMutex);
-    sal_Bool bCheck = sal_True;
+    sal_Bool bCanSuspend = sal_True;
+
     if ( m_bSuspended != bSuspend )
     {
-           m_bSuspended = bSuspend;
            if ( bSuspend && !suspendDocuments( bSuspend ))
                    return sal_False;
            
            Reference<XModifiable> xModi(m_xModel,UNO_QUERY);
         Reference<XStorable> xStor(getModel(),UNO_QUERY);
         
-           if  (   xStor.is()
+           if  (   bSuspend
+            &&  xStor.is()
             &&  !xStor->isReadonly()
             &&  (   m_bCurrentlyModified
                 ||  (   xModi.is()
@@ -601,17 +602,21 @@
                    {
                            case RET_YES:
                                    
Execute(ID_BROWSER_SAVEDOC,Sequence<PropertyValue>());
-                                   bCheck = !xModi->isModified(); // when we 
save the table this must be false else some press cancel
+                                   bCanSuspend = !xModi->isModified();
+                    // when we save the document this must be false else some 
press cancel
                                    break;
                            case RET_CANCEL:
-                                   bCheck = sal_False;
+                                   bCanSuspend = sal_False;
                            default:
                                    break;
                    }
            }
     }
 
-       return bCheck;
+    if ( bCanSuspend )
+           m_bSuspended = bSuspend;
+
+       return bCanSuspend;
 }
 // 
-----------------------------------------------------------------------------
 FeatureState OApplicationController::GetState(sal_uInt16 _nId) const
@@ -1935,18 +1940,19 @@
                                                }
                                        }
                                        break;
-                               case E_QUERY:
-                                       if ( 
xContainer->hasByName(*aList.begin()) )
-                                       {
-                                               
xRename.set(xContainer->getByName(*aList.begin()),UNO_QUERY);
-                                               aDlg.reset( new 
OSaveAsDlg(getView(),CommandType::QUERY,xContainer,xConnection->getMetaData(),xConnection,*aList.begin(),SAD_TITLE_RENAME)
 );
-                                       }
-                                       break;
                                case E_TABLE:
+                    if ( !ensureConnection( xConnection, sal_True ) )
+                        break;
+                    // NO break
+                               case E_QUERY:
                                        if ( 
xContainer->hasByName(*aList.begin()) )
                                        {
                                                
xRename.set(xContainer->getByName(*aList.begin()),UNO_QUERY);
-                                               aDlg.reset( new 
OSaveAsDlg(getView(),CommandType::TABLE,xContainer,xConnection->getMetaData(),xConnection,*aList.begin(),SAD_TITLE_RENAME)
 );
+                        sal_Int32 nCommandType = eType == E_QUERY ? 
CommandType::QUERY : CommandType::TABLE;
+                                           aDlg.reset( new OSaveAsDlg(
+                            getView(), nCommandType, xContainer,
+                            xConnection.is() ? xConnection->getMetaData() : 
Reference< XDatabaseMetaData >(),
+                            xConnection, *aList.begin(), SAD_TITLE_RENAME) );
                                        }
                                        break;
                        }




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

Reply via email to