diff options
author | Pierre <prrvchr@gmail.com> | 2024-04-13 19:19:50 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2024-05-03 15:14:27 +0200 |
commit | 548fc442f56d9b456e48246caaffe13d996c841f (patch) | |
tree | 5ffb5f7791334b3a11859ccc2c04267cd0b93b15 /dbaccess | |
parent | 1425cbc50a9183477a12e413a0519867c0a589fa (diff) |
tdf#160375 Base displays and gives the full name of the table
Change-Id: Icc8c6d85cc5a88461b7bd02487513e0e864bacef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166057
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/relationdesign/RTableConnectionData.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/relationdesign/RelationTableView.cxx | 11 |
2 files changed, 11 insertions, 6 deletions
diff --git a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx index 7cb7bb577c0a..c679e462c630 100644 --- a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx +++ b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx @@ -38,6 +38,7 @@ using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; +using namespace ::com::sun::star::lang; ORelationTableConnectionData::ORelationTableConnectionData() :m_nUpdateRules(KeyRule::NO_ACTION) @@ -253,7 +254,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())); } @@ -298,7 +300,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 87a769ce83b3..da82719b7a23 100644 --- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx +++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx @@ -51,6 +51,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::com::sun::star::accessibility; @@ -107,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; @@ -131,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) @@ -289,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 |