Tag: cws_src680_dba24a User: oj Date: 2007-09-25 11:24:10+0000 Modified: dba/dbaccess/source/ui/control/RelationControl.cxx dba/dbaccess/source/ui/dlg/RelationDlg.cxx dba/dbaccess/source/ui/inc/ConnectionLineData.hxx dba/dbaccess/source/ui/inc/RTableConnectionData.hxx dba/dbaccess/source/ui/querydesign/ConnectionLineData.cxx dba/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx dba/dbaccess/source/ui/relationdesign/RelationController.cxx
Log: #i81922# new method to compare relation data File Changes: Directory: /dba/dbaccess/source/ui/control/ =========================================== File [changed]: RelationControl.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/control/RelationControl.cxx?r1=1.20&r2=1.20.18.1 Delta lines: +11 -12 --------------------- --- RelationControl.cxx 2007-07-06 08:06:17+0000 1.20 +++ RelationControl.cxx 2007-09-25 11:24:06+0000 1.20.18.1 @@ -4,9 +4,9 @@ * * $RCSfile: RelationControl.cxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.20.18.1 $ * - * last change: $Author: rt $ $Date: 2007/07/06 08:06:17 $ + * last change: $Author: oj $ $Date: 2007/09/25 11:24:06 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -369,7 +369,11 @@ fillListBox(xDef,nRow,nColumnId); String sName = GetCellText( nRow, nColumnId ); m_pListCell->SelectEntry( sName ); - OSL_ENSURE(m_pListCell->GetSelectEntry() == sName,"Name was not selected!"); + if ( m_pListCell->GetSelectEntry() != sName ) + { + m_pListCell->InsertEntry( sName ); + m_pListCell->SelectEntry( sName ); + } m_pListCell->SetHelpId(nHelpId); } @@ -409,14 +413,14 @@ rDev.SetClipRegion(); } // ----------------------------------------------------------------------------- - void ORelationControl::fillListBox(const Reference< XPropertySet>& _xDest,long _nRow,USHORT nColumnId) + void ORelationControl::fillListBox(const Reference< XPropertySet>& _xDest,long /*_nRow*/,USHORT /*nColumnId*/) { m_pListCell->Clear(); try { if ( _xDest.is() ) { - sal_Int32 nRows = GetRowCount(); + //sal_Int32 nRows = GetRowCount(); Reference<XColumnsSupplier> xSup(_xDest,UNO_QUERY); Reference<XNameAccess> xColumns = xSup->getColumns(); Sequence< ::rtl::OUString> aNames = xColumns->getElementNames(); @@ -425,11 +429,6 @@ for(;pBegin != pEnd;++pBegin) { String sName = *pBegin; - sal_Int32 i = 0; - for (; i < nRows; ++i) - if(i != _nRow && GetCellText(i,nColumnId) == sName) - break; - if ( i == nRows ) m_pListCell->InsertEntry( *pBegin ); } m_pListCell->InsertEntry(String(), 0); Directory: /dba/dbaccess/source/ui/dlg/ ======================================= File [changed]: RelationDlg.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/dlg/RelationDlg.cxx?r1=1.24&r2=1.24.18.1 Delta lines: +4 -4 ------------------- --- RelationDlg.cxx 2007-07-06 08:12:09+0000 1.24 +++ RelationDlg.cxx 2007-09-25 11:24:07+0000 1.24.18.1 @@ -4,9 +4,9 @@ * * $RCSfile: RelationDlg.cxx,v $ * - * $Revision: 1.24 $ + * $Revision: 1.24.18.1 $ * - * last change: $Author: rt $ $Date: 2007/07/06 08:12:09 $ + * last change: $Author: oj $ $Date: 2007/09/25 11:24:07 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -247,7 +247,7 @@ // try to create the relation try { - if (m_pConnData->Update()) + if (*m_pConnData != *m_pOrigConnData || m_pConnData->Update()) { m_pOrigConnData->CopyFrom( *m_pConnData ); EndDialog( RET_OK ); Directory: /dba/dbaccess/source/ui/inc/ ======================================= File [changed]: ConnectionLineData.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/inc/ConnectionLineData.hxx?r1=1.5&r2=1.5.298.1 Delta lines: +6 -3 ------------------- --- ConnectionLineData.hxx 2005-09-08 15:16:14+0000 1.5 +++ ConnectionLineData.hxx 2007-09-25 11:24:07+0000 1.5.298.1 @@ -4,9 +4,9 @@ * * $RCSfile: ConnectionLineData.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.5.298.1 $ * - * last change: $Author: rt $ $Date: 2005/09/08 15:16:14 $ + * last change: $Author: oj $ $Date: 2007/09/25 11:24:07 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -75,6 +75,8 @@ ::rtl::OUString m_aSourceFieldName; ::rtl::OUString m_aDestFieldName; + friend bool operator==(const OConnectionLineData& lhs, const OConnectionLineData& rhs); + friend bool operator!=(const OConnectionLineData& lhs, const OConnectionLineData& rhs) { return !(lhs == rhs); } protected: virtual ~OConnectionLineData(); public: @@ -109,6 +111,7 @@ OConnectionLineData& operator=( const OConnectionLineData& rConnLineData ); }; + //------------------------------------------------------------------------- //------------------------------------------------------------------ typedef ::vos::ORef< OConnectionLineData > OConnectionLineDataRef; typedef ::std::vector< OConnectionLineDataRef > OConnectionLineDataVec; File [changed]: RTableConnectionData.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/inc/RTableConnectionData.hxx?r1=1.5&r2=1.5.298.1 Delta lines: +6 -3 ------------------- --- RTableConnectionData.hxx 2005-09-08 15:31:28+0000 1.5 +++ RTableConnectionData.hxx 2007-09-25 11:24:07+0000 1.5.298.1 @@ -4,9 +4,9 @@ * * $RCSfile: RTableConnectionData.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.5.298.1 $ * - * last change: $Author: rt $ $Date: 2005/09/08 15:31:28 $ + * last change: $Author: oj $ $Date: 2007/09/25 11:24:07 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -63,6 +63,9 @@ class ORelationTableConnectionData : public OTableConnectionData, public ::utl::OEventListenerAdapter { + friend bool operator==(const ORelationTableConnectionData& lhs, const ORelationTableConnectionData& rhs); + friend bool operator!=(const ORelationTableConnectionData& lhs, const ORelationTableConnectionData& rhs) { return !(lhs == rhs); } + ::osl::Mutex m_aMutex; ::rtl::OUString m_sDatabaseName; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xTables; Directory: /dba/dbaccess/source/ui/querydesign/ =============================================== File [changed]: ConnectionLineData.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/ConnectionLineData.cxx?r1=1.7&r2=1.7.120.1 Delta lines: +12 -4 -------------------- --- ConnectionLineData.cxx 2006-09-17 07:19:49+0000 1.7 +++ ConnectionLineData.cxx 2007-09-25 11:24:07+0000 1.7.120.1 @@ -4,9 +4,9 @@ * * $RCSfile: ConnectionLineData.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.7.120.1 $ * - * last change: $Author: obo $ $Date: 2006/09/17 07:19:49 $ + * last change: $Author: oj $ $Date: 2007/09/25 11:24:07 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -108,5 +108,13 @@ return true; } // ----------------------------------------------------------------------------- - +namespace dbaui +{ +//------------------------------------------------------------------------- +bool operator==(const OConnectionLineData& lhs, const OConnectionLineData& rhs) +{ + return (lhs.m_aSourceFieldName == rhs.m_aSourceFieldName) + && (lhs.m_aDestFieldName == rhs.m_aDestFieldName); +} +} Directory: /dba/dbaccess/source/ui/relationdesign/ ================================================== File [changed]: RTableConnectionData.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx?r1=1.12&r2=1.12.120.1 Delta lines: +30 -4 -------------------- --- RTableConnectionData.cxx 2006-09-17 07:27:51+0000 1.12 +++ RTableConnectionData.cxx 2007-09-25 11:24:07+0000 1.12.120.1 @@ -4,9 +4,9 @@ * * $RCSfile: RTableConnectionData.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.12.120.1 $ * - * last change: $Author: obo $ $Date: 2006/09/17 07:27:51 $ + * last change: $Author: oj $ $Date: 2007/09/25 11:24:07 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -382,7 +382,33 @@ return *this; } - +namespace dbaui +{ +//------------------------------------------------------------------------- +bool operator==(const ORelationTableConnectionData& lhs, const ORelationTableConnectionData& rhs) +{ + bool bEqual = (lhs.m_nUpdateRules == rhs.m_nUpdateRules) + && (lhs.m_nDeleteRules == rhs.m_nDeleteRules) + && (lhs.m_nCardinality == rhs.m_nCardinality) + && (lhs.m_aSourceWinName == rhs.m_aSourceWinName) + && (lhs.m_aDestWinName == rhs.m_aDestWinName) + && (lhs.m_aConnName == rhs.m_aConnName) + && (lhs.m_vConnLineData.size() == rhs.m_vConnLineData.size()); + + if ( bEqual ) + { + std::vector< OConnectionLineDataRef >::const_iterator aIter = lhs.m_vConnLineData.begin(); + std::vector< OConnectionLineDataRef >::const_iterator aEnd = lhs.m_vConnLineData.end(); + for (sal_Int32 i = 0; aIter != aEnd; ++aIter,++i) + { + if ( *(rhs.m_vConnLineData[i]) != **aIter ) + break; + } + bEqual = aIter == aEnd; + } + return bEqual; +} +} //------------------------------------------------------------------------ BOOL ORelationTableConnectionData::Update() { File [changed]: RelationController.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/relationdesign/RelationController.cxx?r1=1.47.18.1&r2=1.47.18.2 Delta lines: +7 -4 ------------------- --- RelationController.cxx 2007-08-28 07:01:02+0000 1.47.18.1 +++ RelationController.cxx 2007-09-25 11:24:08+0000 1.47.18.2 @@ -4,9 +4,9 @@ * * $RCSfile: RelationController.cxx,v $ * - * $Revision: 1.47.18.1 $ + * $Revision: 1.47.18.2 $ * - * last change: $Author: oj $ $Date: 2007/08/28 07:01:02 $ + * last change: $Author: oj $ $Date: 2007/09/25 11:24:08 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -495,8 +495,11 @@ Reference<XPropertySet> xPropSet; xColumns->getByName(*pIter) >>= xPropSet; OSL_ENSURE(xPropSet.is(),"Invalid column found in KeyColumns!"); + if ( xPropSet.is() ) + { xPropSet->getPropertyValue(PROPERTY_NAME) >>= sColumnName; xPropSet->getPropertyValue(PROPERTY_RELATEDCOLUMN) >>= sRelatedName; + } pTabConnData->SetConnLine( j, sColumnName, sRelatedName ); } ////////////////////////////////////////////////////////////////////// --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
