Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
5 : : * This Source Code Form is subject to the terms of the Mozilla Public
6 : : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : :
20 : : #include "QTableConnection.hxx"
21 : : #include <osl/diagnose.h>
22 : : #include "QueryTableView.hxx"
23 : : #include "ConnectionLine.hxx"
24 : : using namespace dbaui;
25 : : //========================================================================
26 : : // class OQueryTableConnection
27 : : //========================================================================
28 : : DBG_NAME(OQueryTableConnection)
29 : :
30 : : //------------------------------------------------------------------------
31 : 0 : OQueryTableConnection::OQueryTableConnection(OQueryTableView* pContainer, const TTableConnectionData::value_type& pTabConnData)
32 : : :OTableConnection(pContainer, pTabConnData)
33 : 0 : ,m_bVisited(sal_False)
34 : : {
35 : : DBG_CTOR(OQueryTableConnection,NULL);
36 : 0 : }
37 : :
38 : : //------------------------------------------------------------------------
39 : 0 : OQueryTableConnection::OQueryTableConnection(const OQueryTableConnection& rConn)
40 : 0 : :OTableConnection( rConn )
41 : : {
42 : : DBG_CTOR(OQueryTableConnection,NULL);
43 : : // keine eigenen Members, also reicht die Basisklassenfunktionalitaet
44 : 0 : }
45 : : //------------------------------------------------------------------------
46 : 0 : OQueryTableConnection::~OQueryTableConnection()
47 : : {
48 : : DBG_DTOR(OQueryTableConnection,NULL);
49 [ # # ]: 0 : }
50 : :
51 : : //------------------------------------------------------------------------
52 : 0 : OQueryTableConnection& OQueryTableConnection::operator=(const OQueryTableConnection& rConn)
53 : : {
54 [ # # ]: 0 : if (&rConn == this)
55 : 0 : return *this;
56 : :
57 : 0 : OTableConnection::operator=(rConn);
58 : : // keine eigenen Members ...
59 : 0 : return *this;
60 : : }
61 : :
62 : : //------------------------------------------------------------------------
63 : 0 : sal_Bool OQueryTableConnection::operator==(const OQueryTableConnection& rCompare)
64 : : {
65 : : OSL_ENSURE(GetData() && rCompare.GetData(), "OQueryTableConnection::operator== : einer der beiden Teilnehmer hat keine Daten !");
66 : :
67 : : // allzuviel brauche ich nicht vergleichen (schon gar nicht alle Member) : lediglich die Fenster, an denen wir haengen, und
68 : : // die Indizies in der entsprechenden Tabelle muessen uebereinstimmen
69 : 0 : OQueryTableConnectionData* pMyData = static_cast<OQueryTableConnectionData*>(GetData().get());
70 : 0 : OQueryTableConnectionData* pCompData = static_cast<OQueryTableConnectionData*>(rCompare.GetData().get());
71 : :
72 : : // Connections werden als gleich angesehen, wenn sie in Source-/Dest-Fenstername und Source-/Dest-FieldIndex uebereinstimmen ...
73 [ # # ][ # # ]: 0 : return ( ( (pMyData->getReferencedTable() == pCompData->getReferencedTable()) &&
[ # # ][ # # ]
[ # # ]
[ # # # # ]
[ # # ]
74 [ # # ][ # # ]: 0 : (pMyData->getReferencingTable() == pCompData->getReferencingTable()) &&
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
[ # # # # ]
75 : 0 : (pMyData->GetFieldIndex(JTCS_TO) == pCompData->GetFieldIndex(JTCS_TO)) &&
76 : 0 : (pMyData->GetFieldIndex(JTCS_FROM) == pCompData->GetFieldIndex(JTCS_FROM))
77 : : )
78 : : || // ... oder diese Uebereinstimmung ueber Kreuz besteht
79 [ # # ][ # # ]: 0 : ( (pMyData->getReferencingTable() == pCompData->getReferencedTable()) &&
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
[ # # # # ]
80 [ # # ][ # # ]: 0 : (pMyData->getReferencedTable() == pCompData->getReferencingTable()) &&
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
[ # # # # ]
81 : 0 : (pMyData->GetFieldIndex(JTCS_TO) == pCompData->GetFieldIndex(JTCS_FROM)) &&
82 : 0 : (pMyData->GetFieldIndex(JTCS_FROM) == pCompData->GetFieldIndex(JTCS_TO))
83 : : )
84 [ # # ][ # # : 0 : );
# # # # ]
[ # # ][ # #
# # # # ]
85 : : }
86 : : // -----------------------------------------------------------------------------
87 : :
88 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|