[Libreoffice-bugs] [Bug 112722] Issue on setting up Relationship

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Sun Oct 22 19:30:58 UTC 2017


https://bugs.documentfoundation.org/show_bug.cgi?id=112722

--- Comment #5 from Julien Nabet <serval2412 at yahoo.fr> ---
I added traces to compare the 2 ways of adding relationship:
1) From non primary->primary (which works)
ORelationTableView::AddConnection
ORelationTableConnectionData::SetCardinality begin
checkPrimaryKey m_vConnLineData.size()=0
checkPrimaryKey m_vConnLineData.size()=0
ORelationTableConnectionData::Update
checkPrimaryKey m_vConnLineData.size()=1
checkPrimaryKey m_vConnLineData.size()=1
ORelationTableConnectionData::SetCardinality begin
checkPrimaryKey m_vConnLineData.size()=1
checkPrimaryKey m_vConnLineData.size()=1
checkPrimaryKey m_vConnLineData.size()=1
ORelationTableConnectionData::SetCardinality Cardinality::ManyOne
ORelationTableView::AddConnection call addConnection


2) From primary->non primary (which doesn't work)
with:
@@ -61,8 +61,7 @@ ORelationTableConnectionData::ORelationTableConnectionData(
const TTableWindowDa
 {
     m_aConnName = rConnName;

-    if ( !m_aConnName.isEmpty() )
-        SetCardinality();
+    SetCardinality();
 }

ORelationTableView::AddConnection
ORelationTableConnectionData::SetCardinality debut
checkPrimaryKey m_vConnLineData.size()=0
checkPrimaryKey m_vConnLineData.size()=0

So in this last case:
no call to Update -> m_vConnLineData has a size of 0 -> checkPrimaryKey returns
always false -> SetCardinality lets m_nCardinality to Cardinality::Undefined

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20171022/73f335d9/attachment.html>


More information about the Libreoffice-bugs mailing list