Tag: cws_dev300_dba31c
User: fs      
Date: 2008-09-11 07:09:53+0000
Modified:
   dba/dbaccess/source/ui/app/AppController.cxx
   dba/dbaccess/source/ui/app/AppController.hxx
   dba/dbaccess/source/ui/app/AppControllerDnD.cxx
   dba/dbaccess/source/ui/app/AppControllerGen.cxx

Log:
 #i93737# don't cache the database name, instead retrieve it when needed (else 
it is wrong after a 'Save As')

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.65.2.3&r2=1.65.2.4
Delta lines:  +2 -7
-------------------
--- AppController.cxx   2008-09-06 20:35:08+0000        1.65.2.3
+++ AppController.cxx   2008-09-11 07:09:49+0000        1.65.2.4
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: AppController.cxx,v $
- * $Revision: 1.65.2.3 $
+ * $Revision: 1.65.2.4 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -1290,7 +1290,6 @@
                         lcl_handleException_nothrow( m_xModel, 
::cppu::getCaughtException() );
                     }
 
-                    m_sDatabaseName = ::rtl::OUString();
                                        /*updateTitle();*/
                                        m_bCurrentlyModified = sal_False;
                                        InvalidateFeature(ID_BROWSER_SAVEDOC);
@@ -2775,14 +2774,10 @@
     }
 
     m_xDataSource.set(xOfficeDoc.is() ? xOfficeDoc->getDataSource() : 
Reference<XDataSource>(),UNO_QUERY);
-       if ( !m_xDataSource.is() )
-        m_sDatabaseName = ::rtl::OUString();
-    else
+       if ( m_xDataSource.is() )
        {
                try
                {
-                       m_xDataSource->getPropertyValue(PROPERTY_NAME) >>= 
m_sDatabaseName;
-
                        m_xDataSource->addPropertyChangeListener(PROPERTY_INFO, 
this);
                        m_xDataSource->addPropertyChangeListener(PROPERTY_URL, 
this);
                        
m_xDataSource->addPropertyChangeListener(PROPERTY_ISPASSWORDREQUIRED, this);

File [changed]: AppController.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppController.hxx?r1=1.32.2.2&r2=1.32.2.3
Delta lines:  +2 -3
-------------------
--- AppController.hxx   2008-09-06 20:35:08+0000        1.32.2.2
+++ AppController.hxx   2008-09-11 07:09:50+0000        1.32.2.3
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: AppController.hxx,v $
- * $Revision: 1.32.2.2 $
+ * $Revision: 1.32.2.3 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -132,7 +132,6 @@
         OTableCopyHelper        m_aTableCopyHelper;
                TransferableClipboardListener*
                                                                
m_pClipbordNotifier;            // notifier for changes in the clipboard
-               mutable ::rtl::OUString m_sDatabaseName;
                ULONG                                   m_nAsyncDrop;
         OAsyncronousLink        m_aControllerConnectedEvent;
         OAsyncronousLink        m_aSelectContainerEvent;
@@ -155,7 +154,7 @@
                        @return
                                the database name
                */
-               inline ::rtl::OUString getDatabaseName() const { return 
m_sDatabaseName; }
+        ::rtl::OUString getDatabaseName() const;
 
                /** returns the stripped database name.
                        @return

File [changed]: AppControllerDnD.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppControllerDnD.cxx?r1=1.29.2.1&r2=1.29.2.2
Delta lines:  +2 -2
-------------------
--- AppControllerDnD.cxx        2008-09-06 20:35:09+0000        1.29.2.1
+++ AppControllerDnD.cxx        2008-09-11 07:09:50+0000        1.29.2.2
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: AppControllerDnD.cxx,v $
- * $Revision: 1.29.2.1 $
+ * $Revision: 1.29.2.2 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -640,7 +640,7 @@
                                if ( xElements.is() && !aList.empty() )
                                {
                                        Reference< XContent> 
xContent(xElements->getByHierarchicalName(*aList.begin()),UNO_QUERY);
-                                       pData = new 
OComponentTransferable(m_sDatabaseName,xContent);
+                                       pData = new OComponentTransferable( 
getDatabaseName(), xContent );
                                }
                        }
                        break;

File [changed]: AppControllerGen.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppControllerGen.cxx?r1=1.37.38.1&r2=1.37.38.2
Delta lines:  +21 -2
--------------------
--- AppControllerGen.cxx        2008-09-06 20:35:09+0000        1.37.38.1
+++ AppControllerGen.cxx        2008-09-11 07:09:50+0000        1.37.38.2
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: AppControllerGen.cxx,v $
- * $Revision: 1.37.38.1 $
+ * $Revision: 1.37.38.2 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -578,9 +578,28 @@
 }
 
 // 
-----------------------------------------------------------------------------
+::rtl::OUString OApplicationController::getDatabaseName() const
+{
+    ::rtl::OUString sDatabaseName;
+    try
+    {
+        if ( m_xDataSource.is() )
+        {
+            OSL_VERIFY( m_xDataSource->getPropertyValue( PROPERTY_NAME ) >>= 
sDatabaseName );
+        }
+    }
+    catch ( const Exception& )
+    {
+        DBG_UNHANDLED_EXCEPTION();
+    }
+    return sDatabaseName;
+}
+
+// 
-----------------------------------------------------------------------------
 ::rtl::OUString OApplicationController::getStrippedDatabaseName() const
 {
-       return ::dbaui::getStrippedDatabaseName(m_xDataSource,m_sDatabaseName);
+    ::rtl::OUString sDatabaseName;
+       return ::dbaui::getStrippedDatabaseName( m_xDataSource, sDatabaseName );
 }
 
 // 
-----------------------------------------------------------------------------




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

Reply via email to