1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_dbaccess.hxx"
30 #ifndef DBAUI_CONNECTIONLINEDATA_HXX
31 #include "ConnectionLineData.hxx"
32 #endif
33 #ifndef _TOOLS_DEBUG_HXX
34 #include <tools/debug.hxx>
35 #endif
36 
37 
38 using namespace dbaui;
39 DBG_NAME(OConnectionLineData)
40 //==================================================================
41 //class OConnectionLineData
42 //==================================================================
43 //------------------------------------------------------------------------
44 OConnectionLineData::OConnectionLineData()
45 {
46 	DBG_CTOR(OConnectionLineData,NULL);
47 }
48 
49 //------------------------------------------------------------------------
50 OConnectionLineData::OConnectionLineData( const ::rtl::OUString& rSourceFieldName, const ::rtl::OUString& rDestFieldName )
51 	:m_aSourceFieldName( rSourceFieldName )
52 	,m_aDestFieldName( rDestFieldName )
53 {
54 	DBG_CTOR(OConnectionLineData,NULL);
55 }
56 
57 //------------------------------------------------------------------------
58 OConnectionLineData::OConnectionLineData( const OConnectionLineData& rConnLineData )
59     : ::vos::OReference()
60 {
61 	DBG_CTOR(OConnectionLineData,NULL);
62 	*this = rConnLineData;
63 }
64 
65 //------------------------------------------------------------------------
66 OConnectionLineData::~OConnectionLineData()
67 {
68 	DBG_DTOR(OConnectionLineData,NULL);
69 }
70 
71 //------------------------------------------------------------------------
72 void OConnectionLineData::CopyFrom(const OConnectionLineData& rSource)
73 {
74 	*this = rSource;
75 	// hier ziehe ich mich auf das (nicht-virtuelle) operator= zurueck, das nur meine Members kopiert
76 }
77 
78 //------------------------------------------------------------------------
79 OConnectionLineData& OConnectionLineData::operator=( const OConnectionLineData& rConnLineData )
80 {
81 	if (&rConnLineData == this)
82 		return *this;
83 
84 	m_aSourceFieldName = rConnLineData.GetSourceFieldName();
85 	m_aDestFieldName = rConnLineData.GetDestFieldName();
86 
87 	return *this;
88 }
89 
90 //------------------------------------------------------------------------
91 bool OConnectionLineData::Reset()
92 {
93 	m_aDestFieldName = m_aSourceFieldName = ::rtl::OUString();
94 	return true;
95 }
96 // -----------------------------------------------------------------------------
97 namespace dbaui
98 {
99 //-------------------------------------------------------------------------
100 bool operator==(const OConnectionLineData& lhs, const OConnectionLineData& rhs)
101 {
102 	return (lhs.m_aSourceFieldName == rhs.m_aSourceFieldName)
103         && (lhs.m_aDestFieldName == rhs.m_aDestFieldName);
104 }
105 }
106 
107