dbaccess/source/ui/relationdesign/RTableConnectionData.cxx |    5 +++--
 dbaccess/source/ui/relationdesign/RelationTableView.cxx    |   10 ++++++----
 2 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit eb045cc529f0e7b17e7e3bc913f2ab1748247966
Author:     Pierre <prrv...@gmail.com>
AuthorDate: Sat Apr 13 19:19:50 2024 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon May 6 10:23:20 2024 +0200

    tdf#160375 Base displays and gives the full name of the table
    
    Change-Id: Icc8c6d85cc5a88461b7bd02487513e0e864bacef
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166093
    Reviewed-by: Pierre Vacher <prrv...@gmail.com>
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx 
b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
index 2fb7c0b8213c..9651a89c9f09 100644
--- a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
+++ b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
@@ -256,7 +256,8 @@ bool ORelationTableConnectionData::Update()
 
         xKey->setPropertyValue(PROPERTY_NAME,Any(sKeyName));
         xKey->setPropertyValue(PROPERTY_TYPE,Any(KeyType::FOREIGN));
-        
xKey->setPropertyValue(PROPERTY_REFERENCEDTABLE,Any(getReferencedTable()->GetTableName()));
+        // get the full name of the tables to ensure uniqueness across 
catalogs and schema
+        
xKey->setPropertyValue(PROPERTY_REFERENCEDTABLE,Any(getReferencedTable()->GetComposedName()));
         xKey->setPropertyValue(PROPERTY_UPDATERULE, Any(GetUpdateRules()));
         xKey->setPropertyValue(PROPERTY_DELETERULE, Any(GetDeleteRules()));
     }
@@ -301,7 +302,7 @@ bool ORelationTableConnectionData::Update()
         {
             OUString sReferencedTable;
             xKey->getPropertyValue(PROPERTY_REFERENCEDTABLE) >>= 
sReferencedTable;
-            if ( sReferencedTable == getReferencedTable()->GetTableName() )
+            if ( sReferencedTable == getReferencedTable()->GetComposedName() )
             {
                 xColSup.set(xKey,UNO_QUERY_THROW);
                 try
diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx 
b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
index 6c96d3952047..da82719b7a23 100644
--- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
@@ -108,7 +108,8 @@ void ORelationTableView::ReSync()
             // it should be cleaned up, including its data in the document
             pTabWin->clearListBox();
             pTabWin.disposeAndClear();
-            arrInvalidTables.push_back(pData->GetTableName());
+            // get the full name of the tables to ensure uniqueness across 
catalogs and schema
+            arrInvalidTables.push_back(pData->GetComposedName());
 
             std::erase(rTabWinDataList, *aIter);
             continue;
@@ -132,9 +133,9 @@ void ORelationTableView::ReSync()
         if ( !arrInvalidTables.empty() )
         {
             // do the tables to the  connection exist?
-            OUString strTabExistenceTest = 
pTabConnData->getReferencingTable()->GetTableName();
+            OUString strTabExistenceTest = 
pTabConnData->getReferencingTable()->GetComposedName();
             bool bInvalid = 
std::find(arrInvalidTables.begin(),arrInvalidTables.end(),strTabExistenceTest) 
!= arrInvalidTables.end();
-            strTabExistenceTest = 
pTabConnData->getReferencedTable()->GetTableName();
+            strTabExistenceTest = 
pTabConnData->getReferencedTable()->GetComposedName();
             bInvalid = bInvalid || 
std::find(arrInvalidTables.begin(),arrInvalidTables.end(),strTabExistenceTest) 
!= arrInvalidTables.end();
 
             if (bInvalid)
@@ -290,7 +291,8 @@ void ORelationTableView::AddTabWin(const OUString& 
_rComposedName, const OUStrin
     }
 
     // enter the new data structure into DocShell
-    TTableWindowData::value_type pNewTabWinData(createTableWindowData( 
_rComposedName, rWinName,rWinName ));
+    // show the table's full name as window name to ensure uniqueness across 
catalogs and schema
+    TTableWindowData::value_type pNewTabWinData(createTableWindowData( 
_rComposedName, rWinName, _rComposedName ));
     pNewTabWinData->ShowAll(false);
 
     // link new window into the window list

Reply via email to