summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2001-10-08 06:26:32 +0000
committerOcke Janssen <oj@openoffice.org>2001-10-08 06:26:32 +0000
commitfcb06c683baa5c61107d22c5630f847d1b1db9ed (patch)
tree74e7dfa4b2ac3f23b26f11652e9713f97f72deb8
parent570b699ee41b77c88c12b4f30c30ae4a610c3205 (diff)
#92786# refcount implemented for connectiondata and sqlexception catched
-rw-r--r--dbaccess/source/core/api/RowSet.cxx14
-rw-r--r--dbaccess/source/core/api/tablecontainer.cxx15
-rw-r--r--dbaccess/source/core/api/viewcontainer.cxx15
-rw-r--r--dbaccess/source/core/inc/tablecontainer.hxx5
-rw-r--r--dbaccess/source/core/inc/viewcontainer.hxx5
-rw-r--r--dbaccess/source/ui/browser/dsbrowserDnD.cxx9
-rw-r--r--dbaccess/source/ui/dlg/RelationDlg.cxx119
-rw-r--r--dbaccess/source/ui/inc/ConnectionLine.hxx10
-rw-r--r--dbaccess/source/ui/inc/ConnectionLineData.hxx23
-rw-r--r--dbaccess/source/ui/inc/QueryDesignView.hxx10
-rw-r--r--dbaccess/source/ui/inc/RTableConnectionData.hxx8
-rw-r--r--dbaccess/source/ui/inc/RelationDlg.hxx5
-rw-r--r--dbaccess/source/ui/inc/TableConnectionData.hxx12
-rw-r--r--dbaccess/source/ui/querydesign/ConnectionLine.cxx8
-rw-r--r--dbaccess/source/ui/querydesign/ConnectionLineData.cxx6
15 files changed, 161 insertions, 103 deletions
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index 8e9057e4f..38ab910d9 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: RowSet.cxx,v $
*
- * $Revision: 1.93 $
+ * $Revision: 1.94 $
*
- * last change: $Author: oj $ $Date: 2001-09-27 09:48:57 $
+ * last change: $Author: oj $ $Date: 2001-10-08 07:26:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1837,7 +1837,15 @@ rtl::OUString ORowSet::getCommand(sal_Bool& bEscapeProcessing,::com::sun::star::
{
if(!m_xActiveConnection.is())
throw SQLException(DBACORE_RESSTRING(RID_STR_CONNECTION_INVALID),*this,SQLSTATE_GENERAL,1000,Any() );
- m_pTables = new OTableContainer(OConfigurationNode(),OConfigurationTreeRoot(),*this,m_aMutex,m_xActiveConnection);
+ sal_Bool bCase = sal_True;
+ try
+ {
+ bCase = m_xActiveConnection->getMetaData()->storesMixedCaseQuotedIdentifiers();
+ }
+ catch(SQLException&)
+ {
+ }
+ m_pTables = new OTableContainer(OConfigurationNode(),OConfigurationTreeRoot(),*this,m_aMutex,m_xActiveConnection,bCase);
_rxRetTables = m_pTables;
Sequence< ::rtl::OUString> aTableFilter(1);
aTableFilter[0] = ::rtl::OUString::createFromAscii("%");
diff --git a/dbaccess/source/core/api/tablecontainer.cxx b/dbaccess/source/core/api/tablecontainer.cxx
index 1c2260d31..26f0e3c63 100644
--- a/dbaccess/source/core/api/tablecontainer.cxx
+++ b/dbaccess/source/core/api/tablecontainer.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: tablecontainer.cxx,v $
*
- * $Revision: 1.37 $
+ * $Revision: 1.38 $
*
- * last change: $Author: oj $ $Date: 2001-09-25 13:28:23 $
+ * last change: $Author: oj $ $Date: 2001-10-08 07:26:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -156,17 +156,24 @@ OTableContainer::OTableContainer(const OConfigurationNode& _rTablesConfig,
::cppu::OWeakObject& _rParent,
::osl::Mutex& _rMutex,
const Reference< XConnection >& _xCon,
+ sal_Bool _bCase,
IWarningsContainer* _pWarningsContainer)
- :OCollection(_rParent,_xCon->getMetaData()->storesMixedCaseQuotedIdentifiers(),_rMutex,::std::vector< ::rtl::OUString>())
+ :OCollection(_rParent,_bCase,_rMutex,::std::vector< ::rtl::OUString>())
,m_bConstructed(sal_False)
,m_xConnection(_xCon)
- ,m_xMetaData(_xCon->getMetaData())
,m_aCommitLocation(_rCommitLocation)
,m_aTablesConfig(_rTablesConfig)
,m_pWarningsContainer(_pWarningsContainer)
{
DBG_CTOR(OTableContainer, NULL);
m_aTablesConfig.setEscape(m_aTablesConfig.isSetNode());
+ try
+ {
+ m_xMetaData = _xCon->getMetaData();
+ }
+ catch(SQLException&)
+ {
+ }
}
//------------------------------------------------------------------------------
diff --git a/dbaccess/source/core/api/viewcontainer.cxx b/dbaccess/source/core/api/viewcontainer.cxx
index c17caedc6..d3d243844 100644
--- a/dbaccess/source/core/api/viewcontainer.cxx
+++ b/dbaccess/source/core/api/viewcontainer.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: viewcontainer.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: oj $ $Date: 2001-09-19 09:59:08 $
+ * last change: $Author: oj $ $Date: 2001-10-08 07:26:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -146,14 +146,21 @@ DBG_NAME(OViewContainer)
OViewContainer::OViewContainer(::cppu::OWeakObject& _rParent,
::osl::Mutex& _rMutex,
const Reference< XConnection >& _xCon,
+ sal_Bool _bCase,
IWarningsContainer* _pWarningsContainer)
- :OCollection(_rParent,_xCon->getMetaData()->storesMixedCaseQuotedIdentifiers(),_rMutex,::std::vector< ::rtl::OUString>())
+ :OCollection(_rParent,_bCase,_rMutex,::std::vector< ::rtl::OUString>())
,m_bConstructed(sal_False)
,m_xConnection(_xCon)
- ,m_xMetaData(_xCon->getMetaData())
,m_pWarningsContainer(_pWarningsContainer)
{
DBG_CTOR(OViewContainer, NULL);
+ try
+ {
+ m_xMetaData = _xCon->getMetaData();
+ }
+ catch(SQLException&)
+ {
+ }
}
//------------------------------------------------------------------------------
diff --git a/dbaccess/source/core/inc/tablecontainer.hxx b/dbaccess/source/core/inc/tablecontainer.hxx
index 2aa6d7259..ef134af4a 100644
--- a/dbaccess/source/core/inc/tablecontainer.hxx
+++ b/dbaccess/source/core/inc/tablecontainer.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: tablecontainer.hxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: fs $ $Date: 2001-08-24 13:13:02 $
+ * last change: $Author: oj $ $Date: 2001-10-08 07:26:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -164,6 +164,7 @@ namespace dbaccess
::cppu::OWeakObject& _rParent,
::osl::Mutex& _rMutex,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xCon,
+ sal_Bool _bCase,
IWarningsContainer* _pWarningsContainer = NULL
);
~OTableContainer();
diff --git a/dbaccess/source/core/inc/viewcontainer.hxx b/dbaccess/source/core/inc/viewcontainer.hxx
index 543bc26aa..25a04a547 100644
--- a/dbaccess/source/core/inc/viewcontainer.hxx
+++ b/dbaccess/source/core/inc/viewcontainer.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: viewcontainer.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: oj $ $Date: 2001-07-19 10:01:27 $
+ * last change: $Author: oj $ $Date: 2001-10-08 07:26:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -162,6 +162,7 @@ namespace dbaccess
OViewContainer( ::cppu::OWeakObject& _rParent,
::osl::Mutex& _rMutex,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xCon,
+ sal_Bool _bCase,
IWarningsContainer* _pWarningsContainer = NULL
);
~OViewContainer();
diff --git a/dbaccess/source/ui/browser/dsbrowserDnD.cxx b/dbaccess/source/ui/browser/dsbrowserDnD.cxx
index 0e9212594..f3be7c484 100644
--- a/dbaccess/source/ui/browser/dsbrowserDnD.cxx
+++ b/dbaccess/source/ui/browser/dsbrowserDnD.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dsbrowserDnD.cxx,v $
*
- * $Revision: 1.29 $
+ * $Revision: 1.30 $
*
- * last change: $Author: oj $ $Date: 2001-09-25 13:24:38 $
+ * last change: $Author: oj $ $Date: 2001-10-08 07:26:29 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -969,8 +969,6 @@ namespace dbaui
OSL_ENSURE(0,"Exception catched!");
}
break;
- default:
- OSL_ENSURE(0,"Try to rename wrong entry!");
}
return nRet;
}
@@ -1188,6 +1186,9 @@ namespace dbaui
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.29 2001/09/25 13:24:38 oj
+ * #91719# implementing the XRename handling
+ *
* Revision 1.28 2001/09/20 12:56:17 oj
* #92232# fixes for BIGINT type and new property HELPTEXT
*
diff --git a/dbaccess/source/ui/dlg/RelationDlg.cxx b/dbaccess/source/ui/dlg/RelationDlg.cxx
index 25f04b52a..15ba09ced 100644
--- a/dbaccess/source/ui/dlg/RelationDlg.cxx
+++ b/dbaccess/source/ui/dlg/RelationDlg.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: RelationDlg.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: oj $ $Date: 2001-08-27 06:57:23 $
+ * last change: $Author: oj $ $Date: 2001-10-08 07:26:29 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -171,12 +171,19 @@ void ORelationControl::Init(ORelationTableConnectionData* _pConnData)
if (bFirstCall)
{
//////////////////////////////////////////////////////////////////////
- // Spalten einfuegen
+ // insert columns
::rtl::OUString sSrcComposedName,sDestComposedName;
- if(m_xSourceDef.is())
- ::dbaui::composeTableName(static_cast<ORelationDialog*>(GetParent())->getConnection()->getMetaData(),m_xSourceDef,sSrcComposedName,sal_False);
- if(m_xDestDef.is())
- ::dbaui::composeTableName(static_cast<ORelationDialog*>(GetParent())->getConnection()->getMetaData(),m_xDestDef,sDestComposedName,sal_False);
+ try
+ {
+ if(m_xSourceDef.is())
+ ::dbaui::composeTableName(static_cast<ORelationDialog*>(GetParent())->getConnection()->getMetaData(),m_xSourceDef,sSrcComposedName,sal_False);
+ if(m_xDestDef.is())
+ ::dbaui::composeTableName(static_cast<ORelationDialog*>(GetParent())->getConnection()->getMetaData(),m_xDestDef,sDestComposedName,sal_False);
+ }
+ catch(SQLException&)
+ {
+ OSL_ASSERT(!"SQLException catched while compose table name!");
+ }
InsertDataColumn( 1, sSrcComposedName, 100);
InsertDataColumn( 2, sDestComposedName, 100);
// wenn es die Defs noch nicht gibt, dann muessen sie noch mit SetSource-/-DestDef gesetzt werden !
@@ -266,7 +273,7 @@ BOOL ORelationControl::SaveModified()
{
DBG_CHKTHIS(ORelationControl,NULL);
OSL_ENSURE((sal_Int32)m_pConnData->GetConnLineDataList()->size() > GetCurRow(),"Invalid Index!");
- OConnectionLineData* pConnLineData = (*m_pConnData->GetConnLineDataList())[GetCurRow()];
+ OConnectionLineDataRef pConnLineData = (*m_pConnData->GetConnLineDataList())[GetCurRow()];
switch( GetCurColumnId() )
{
case SOURCE_COLUMN:
@@ -286,9 +293,9 @@ String ORelationControl::GetCellText( long nRow, USHORT nColId )
{
DBG_CHKTHIS(ORelationControl,NULL);
OSL_ENSURE((sal_Int32)m_pConnData->GetConnLineDataList()->size() > nRow,"Invalid Index!");
- OConnectionLineData* pConnLineData = (*m_pConnData->GetConnLineDataList())[nRow];
+ OConnectionLineDataRef pConnLineData = (*m_pConnData->GetConnLineDataList())[nRow];
- if( !pConnLineData )
+ if( !pConnLineData.isValid() )
return String();
switch( nColId )
@@ -313,19 +320,7 @@ void ORelationControl::InitController( CellControllerRef& rController, long nRow
case SOURCE_COLUMN:
//////////////////////////////////////////////////////////////
// Auffuellen der ComboBox
- m_pListCell->Clear();
- if( m_xSourceDef.is() )
- {
- Reference<XColumnsSupplier> xSup(m_xSourceDef,UNO_QUERY);
- Reference<XNameAccess> xColumns = xSup->getColumns();
- Sequence< ::rtl::OUString> aNames = xColumns->getElementNames();
- const ::rtl::OUString* pBegin = aNames.getConstArray();
- const ::rtl::OUString* pEnd = pBegin + aNames.getLength();
- for(;pBegin != pEnd;++pBegin)
- m_pListCell->InsertEntry( *pBegin );
- m_pListCell->InsertEntry(String(), 0);
- }
-
+ fillListBox(m_xSourceDef);
//////////////////////////////////////////////////////////////
// Setzen des Edits
aText = GetCellText( nRow, nColumnId );
@@ -338,18 +333,7 @@ void ORelationControl::InitController( CellControllerRef& rController, long nRow
case DEST_COLUMN:
//////////////////////////////////////////////////////////////
// Auffuellen der ComboBox
- m_pListCell->Clear();
- if( m_xDestDef.is() )
- {
- Reference<XColumnsSupplier> xSup(m_xDestDef,UNO_QUERY);
- Reference<XNameAccess> xColumns = xSup->getColumns();
- Sequence< ::rtl::OUString> aNames = xColumns->getElementNames();
- const ::rtl::OUString* pBegin = aNames.getConstArray();
- const ::rtl::OUString* pEnd = pBegin + aNames.getLength();
- for(;pBegin != pEnd;++pBegin)
- m_pListCell->InsertEntry( *pBegin );
- m_pListCell->InsertEntry(String(), 0);
- }
+ fillListBox(m_xDestDef);
//////////////////////////////////////////////////////////////
// Setzen des Edits
@@ -397,9 +381,29 @@ void ORelationControl::PaintCell( OutputDevice& rDev, const Rectangle& rRect, US
if( rDev.IsClipRegion() )
rDev.SetClipRegion();
}
-
-
-
+// -----------------------------------------------------------------------------
+void ORelationControl::fillListBox(const Reference< XPropertySet>& _xDest)
+{
+ m_pListCell->Clear();
+ try
+ {
+ if( _xDest.is() )
+ {
+ Reference<XColumnsSupplier> xSup(_xDest,UNO_QUERY);
+ Reference<XNameAccess> xColumns = xSup->getColumns();
+ Sequence< ::rtl::OUString> aNames = xColumns->getElementNames();
+ const ::rtl::OUString* pBegin = aNames.getConstArray();
+ const ::rtl::OUString* pEnd = pBegin + aNames.getLength();
+ for(;pBegin != pEnd;++pBegin)
+ m_pListCell->InsertEntry( *pBegin );
+ m_pListCell->InsertEntry(String(), 0);
+ }
+ }
+ catch(SQLException&)
+ {
+ OSL_ASSERT(!"Exception catched while compse tablename!");
+ }
+}
//------------------------------------------------------------------------
void ORelationControl::SetSourceDef(const Reference< XPropertySet>& xNewSource)
{
@@ -417,18 +421,29 @@ void ORelationControl::SetDef(const Reference< XPropertySet>& xDest,sal_Int32 _n
// Spaltenname setzen
::rtl::OUString sComposedName;
- if(xDest.is())
- ::dbaui::composeTableName(static_cast<ORelationDialog*>(GetParent())->getConnection()->getMetaData(),xDest,sComposedName,sal_False);
+ try
+ {
+ if(xDest.is())
+ ::dbaui::composeTableName(static_cast<ORelationDialog*>(GetParent())->getConnection()->getMetaData(),xDest,sComposedName,sal_False);
- SetColumnTitle((USHORT)_nPos, sComposedName);
+ SetColumnTitle((USHORT)_nPos, sComposedName);
+ }
+ catch(SQLException&)
+ {
+ OSL_ASSERT(!"Exception catched while compse tablename!");
+ }
// beide (!) Spalten loeschen
- ::std::vector<OConnectionLineData*>* pLines = m_pConnData->GetConnLineDataList();
- if(_nPos == 1)
- ::std::for_each(pLines->begin(),pLines->end(),::std::mem_fun(&OConnectionLineData::clearSourceFieldName));
- else
- ::std::for_each(pLines->begin(),pLines->end(),::std::mem_fun(&OConnectionLineData::clearDestFieldName));
-
+ OConnectionLineDataVec* pLines = m_pConnData->GetConnLineDataList();
+ ::std::for_each(pLines->begin(),pLines->end(),
+ OUnaryRefFunctor<OConnectionLineData>(
+ _nPos == 1
+ ?
+ ::std::mem_fun(&OConnectionLineData::clearSourceFieldName)
+ :
+ ::std::mem_fun(&OConnectionLineData::clearDestFieldName)
+ )
+ );
// neu zeichnen
Invalidate();
@@ -625,8 +640,8 @@ void ORelationDialog::NotifyCellChange()
// den Ok-Button en- oder disablen, je nachdem, ob ich eine gueltige Situation habe
BOOL bValid = TRUE;
USHORT nEmptyRows = 0;
- ::std::vector<OConnectionLineData*>* pLines = m_pConnData->GetConnLineDataList();
- ::std::vector<OConnectionLineData*>::iterator aIter = pLines->begin();
+ OConnectionLineDataVec* pLines = m_pConnData->GetConnLineDataList();
+ OConnectionLineDataVec::iterator aIter = pLines->begin();
for(;aIter != pLines->end();++aIter)
{
if (((*aIter)->GetDestFieldName().getLength() != 0) != ((*aIter)->GetSourceFieldName().getLength() != 0))
@@ -687,13 +702,13 @@ IMPL_LINK( ORelationDialog, OKClickHdl, Button*, pButton )
m_pConnData->SetDestWinName(m_lmbRightTable.GetSelectEntry());
// noch ein wenig Normalisierung auf den LineDatas : leere Lines vom Anfang an das Ende verschieben
- ::std::vector<OConnectionLineData*>* pLines = m_pConnData->GetConnLineDataList();
+ OConnectionLineDataVec* pLines = m_pConnData->GetConnLineDataList();
sal_Int32 nCount = pLines->size();
for(sal_Int32 i=0;i<nCount;)
{
if(!(*pLines)[i]->GetSourceFieldName().getLength() && !(*pLines)[i]->GetDestFieldName().getLength())
{
- OConnectionLineData* pData = (*pLines)[i];
+ OConnectionLineDataRef pData = (*pLines)[i];
pLines->erase(pLines->begin()+i);
pLines->push_back(pData);
--nCount;
@@ -817,5 +832,3 @@ short ORelationDialog::Execute()
// -----------------------------------------------------------------------------
-
-
diff --git a/dbaccess/source/ui/inc/ConnectionLine.hxx b/dbaccess/source/ui/inc/ConnectionLine.hxx
index 5e3bd878c..32f0f8576 100644
--- a/dbaccess/source/ui/inc/ConnectionLine.hxx
+++ b/dbaccess/source/ui/inc/ConnectionLine.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ConnectionLine.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: oj $ $Date: 2001-08-09 09:59:51 $
+ * last change: $Author: oj $ $Date: 2001-10-08 07:26:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -95,7 +95,7 @@ namespace dbaui
class OConnectionLine
{
OTableConnection* m_pTabConn;
- OConnectionLineData* m_pData;
+ OConnectionLineDataRef m_pData;
SvLBoxEntry* m_pSourceEntry;
SvLBoxEntry* m_pDestEntry;
@@ -108,7 +108,7 @@ namespace dbaui
public:
OConnectionLine( OTableConnection* pConn, const String& rSourceFieldName = String(),
const String& rDestFieldName = String() );
- OConnectionLine( OTableConnection* pConn, OConnectionLineData* pLineData );
+ OConnectionLine( OTableConnection* pConn, OConnectionLineDataRef pLineData );
OConnectionLine( const OConnectionLine& rLine );
virtual ~OConnectionLine();
@@ -129,7 +129,7 @@ namespace dbaui
Rectangle GetSourceTextPos() const;
Rectangle GetDestTextPos() const;
- OConnectionLineData* GetData() const { return m_pData; }
+ OConnectionLineDataRef GetData() const { return m_pData; }
};
/// unary_function Functor object for class OConnectionLine returntype is void
/// draws a connectionline object on outputdevice
diff --git a/dbaccess/source/ui/inc/ConnectionLineData.hxx b/dbaccess/source/ui/inc/ConnectionLineData.hxx
index bb40bad48..489a4a779 100644
--- a/dbaccess/source/ui/inc/ConnectionLineData.hxx
+++ b/dbaccess/source/ui/inc/ConnectionLineData.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ConnectionLineData.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: oj $ $Date: 2001-08-27 06:57:23 $
+ * last change: $Author: oj $ $Date: 2001-10-08 07:26:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -67,6 +67,16 @@
#ifndef DBAUI_ENUMTYPES_HXX
#include "QEnumTypes.hxx"
#endif
+#ifndef _VOS_REF_HXX_
+#include <vos/ref.hxx>
+#endif
+#ifndef INCLUDED_VECTOR
+#define INCLUDED_VECTOR
+#include <vector>
+#endif
+#ifndef DBAUI_REFFUNCTOR_HXX
+#include "RefFunctor.hxx"
+#endif
namespace dbaui
{
@@ -84,16 +94,18 @@ namespace dbaui
the class OConnectionLineData contains the data of a connection
e.g. the source and the destanation field
**/
- class OConnectionLineData
+ class OConnectionLineData : public ::vos::OReference
{
::rtl::OUString m_aSourceFieldName;
::rtl::OUString m_aDestFieldName;
+ protected:
+ virtual ~OConnectionLineData();
public:
OConnectionLineData();
OConnectionLineData( const ::rtl::OUString& rSourceFieldName, const ::rtl::OUString& rDestFieldName );
OConnectionLineData( const OConnectionLineData& rConnLineData );
- virtual ~OConnectionLineData();
+
// eine Kopie der eigenen Instanz liefern (das ist mir irgendwie angenehmer als ein virtueller Zuweisungsoperator)
virtual void CopyFrom(const OConnectionLineData& rSource);
@@ -122,6 +134,9 @@ namespace dbaui
virtual OConnectionLineData& operator=( const OConnectionLineData& rConnLineData );
};
+ //------------------------------------------------------------------
+ typedef ::vos::ORef< OConnectionLineData > OConnectionLineDataRef;
+ typedef ::std::vector< OConnectionLineDataRef > OConnectionLineDataVec;
}
#endif // DBAUI_CONNECTIONLINEDATA_HXX
diff --git a/dbaccess/source/ui/inc/QueryDesignView.hxx b/dbaccess/source/ui/inc/QueryDesignView.hxx
index 415e7989a..f72af6a5b 100644
--- a/dbaccess/source/ui/inc/QueryDesignView.hxx
+++ b/dbaccess/source/ui/inc/QueryDesignView.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: QueryDesignView.hxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: oj $ $Date: 2001-10-05 06:49:21 $
+ * last change: $Author: oj $ $Date: 2001-10-08 07:26:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -82,6 +82,9 @@
#ifndef DBAUI_QUERYCONTROLLER_HXX
#include "querycontroller.hxx"
#endif
+#ifndef DBAUI_CONNECTIONLINEDATA_HXX
+#include "ConnectionLineData.hxx"
+#endif
namespace connectivity
{
@@ -97,7 +100,6 @@ namespace dbaui
class OSelectionBrowseBox;
class OTableConnection;
class OQueryTableConnectionData;
- class OConnectionLineData;
class OQueryContainerWindow;
class OQueryDesignView : public OQueryView
@@ -163,7 +165,7 @@ namespace dbaui
::rtl::OUString BuildJoin(OQueryTableWindow* pLh, const ::rtl::OUString &rRh, OQueryTableConnectionData* pData);
::rtl::OUString BuildJoin(const ::rtl::OUString& rLh, const ::rtl::OUString& rRh, OQueryTableConnectionData* pData);
- ::rtl::OUString BuildJoinCriteria(::std::vector<OConnectionLineData*>* pLineDataList,OQueryTableConnectionData* pData);
+ ::rtl::OUString BuildJoinCriteria(OConnectionLineDataVec* pLineDataList,OQueryTableConnectionData* pData);
void GetNextJoin(OQueryTableConnection* pEntryConn,::rtl::OUString &aJoin,OQueryTableWindow* pEntryTabTo);
void JoinCycle(OQueryTableConnection* pEntryConn,::rtl::OUString &rJoin,OQueryTableWindow* pEntryTabTo);
diff --git a/dbaccess/source/ui/inc/RTableConnectionData.hxx b/dbaccess/source/ui/inc/RTableConnectionData.hxx
index 35d2b2934..f69f1ef92 100644
--- a/dbaccess/source/ui/inc/RTableConnectionData.hxx
+++ b/dbaccess/source/ui/inc/RTableConnectionData.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: RTableConnectionData.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: oj $ $Date: 2001-06-28 14:26:45 $
+ * last change: $Author: oj $ $Date: 2001-10-08 07:26:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -107,8 +107,8 @@ namespace dbaui
void removeListening(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _rxComponent);
protected:
- virtual OConnectionLineData* CreateLineDataObj();
- virtual OConnectionLineData* CreateLineDataObj( const OConnectionLineData& rConnLineData );
+ virtual OConnectionLineDataRef CreateLineDataObj();
+ virtual OConnectionLineDataRef CreateLineDataObj( const OConnectionLineData& rConnLineData );
public:
ORelationTableConnectionData();
diff --git a/dbaccess/source/ui/inc/RelationDlg.hxx b/dbaccess/source/ui/inc/RelationDlg.hxx
index 77d2d469b..6da8cf3c2 100644
--- a/dbaccess/source/ui/inc/RelationDlg.hxx
+++ b/dbaccess/source/ui/inc/RelationDlg.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: RelationDlg.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: fs $ $Date: 2001-06-29 08:35:24 $
+ * last change: $Author: oj $ $Date: 2001-10-08 07:26:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -113,6 +113,7 @@ namespace dbaui
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xDestDef;
void SetDef(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& xDest,sal_Int32 _nPos);
+ void fillListBox(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xDest);
public:
ORelationControl( ORelationDialog* pParent );
virtual ~ORelationControl();
diff --git a/dbaccess/source/ui/inc/TableConnectionData.hxx b/dbaccess/source/ui/inc/TableConnectionData.hxx
index 0bef1d16a..f6604de69 100644
--- a/dbaccess/source/ui/inc/TableConnectionData.hxx
+++ b/dbaccess/source/ui/inc/TableConnectionData.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: TableConnectionData.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: oj $ $Date: 2001-02-28 10:05:37 $
+ * last change: $Author: oj $ $Date: 2001-10-08 07:26:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -93,15 +93,15 @@ namespace dbaui
String m_aDestWinName;
String m_aConnName;
- ::std::vector<OConnectionLineData*> m_vConnLineData;
+ OConnectionLineDataVec m_vConnLineData;
void Init();
void Init(const String& rSourceWinName, const String& rDestWinName, const String& rConnName = String() );
// Das erste Init baut darauf, dass die 3 String-Members schon korrekt gesetzt sind und aConnLineDataList leer ist.
// Das zweite stellt genau diesen Zustand her
- virtual OConnectionLineData* CreateLineDataObj();
- virtual OConnectionLineData* CreateLineDataObj( const OConnectionLineData& rConnLineData );
+ virtual OConnectionLineDataRef CreateLineDataObj();
+ virtual OConnectionLineDataRef CreateLineDataObj( const OConnectionLineData& rConnLineData );
public:
TYPEINFO();
@@ -124,7 +124,7 @@ namespace dbaui
void ResetConnLines( BOOL bUseDefaults = TRUE );
// loescht die Liste der ConnLines, bei bUseDefaults == TRUE werden danach MAX_CONN_COUNT neue Dummy-Linien eingefuegt
- ::std::vector<OConnectionLineData*>* GetConnLineDataList(){ return &m_vConnLineData; }
+ OConnectionLineDataVec* GetConnLineDataList(){ return &m_vConnLineData; }
String GetSourceWinName() const { return m_aSourceWinName; }
String GetDestWinName() const { return m_aDestWinName; }
diff --git a/dbaccess/source/ui/querydesign/ConnectionLine.cxx b/dbaccess/source/ui/querydesign/ConnectionLine.cxx
index 84f5d099d..8fd3808bd 100644
--- a/dbaccess/source/ui/querydesign/ConnectionLine.cxx
+++ b/dbaccess/source/ui/querydesign/ConnectionLine.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ConnectionLine.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: oj $ $Date: 2001-08-09 09:59:51 $
+ * last change: $Author: oj $ $Date: 2001-10-08 07:26:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -92,7 +92,7 @@ const long HIT_SENSITIVE_RADIUS = 5;
//========================================================================
DBG_NAME(OConnectionLine);
//------------------------------------------------------------------------
-OConnectionLine::OConnectionLine( OTableConnection* _pConn, OConnectionLineData* _pLineData )
+OConnectionLine::OConnectionLine( OTableConnection* _pConn, OConnectionLineDataRef _pLineData )
: m_pTabConn( _pConn )
,m_pData( _pLineData )
,m_pSourceEntry( NULL )
@@ -446,7 +446,7 @@ void OConnectionLine::Draw( OutputDevice* pOutDev )
//------------------------------------------------------------------------
BOOL OConnectionLine::IsValid()
{
- return m_pData && m_pData->IsValid();
+ return m_pData.isValid() && m_pData->IsValid();
}
//------------------------------------------------------------------------
double dist_Euklid(const Point &p1, const Point& p2,const Point& pM, Point& q)
diff --git a/dbaccess/source/ui/querydesign/ConnectionLineData.cxx b/dbaccess/source/ui/querydesign/ConnectionLineData.cxx
index ac3c24b5b..d43f57088 100644
--- a/dbaccess/source/ui/querydesign/ConnectionLineData.cxx
+++ b/dbaccess/source/ui/querydesign/ConnectionLineData.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ConnectionLineData.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: oj $ $Date: 2001-02-28 10:18:26 $
+ * last change: $Author: oj $ $Date: 2001-10-08 07:26:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -128,4 +128,6 @@ void OConnectionLineData::Reset()
{
m_aDestFieldName = m_aSourceFieldName = ::rtl::OUString();
}
+// -----------------------------------------------------------------------------
+