summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/querydesign/QueryTableView.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/ui/querydesign/QueryTableView.cxx')
-rw-r--r--dbaccess/source/ui/querydesign/QueryTableView.cxx95
1 files changed, 15 insertions, 80 deletions
diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx
index 2d38373ed1ab..4fe07e5331e8 100644
--- a/dbaccess/source/ui/querydesign/QueryTableView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,100 +29,38 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_dbui.hxx"
-#ifndef DBAUI_QUERYTABLEVIEW_HXX
#include "QueryTableView.hxx"
-#endif
-#ifndef DBAUI_TABLEFIELDINFO_HXX
#include "TableFieldInfo.hxx"
-#endif
-#ifndef DBAUI_TABLEFIELDDESC_HXX
#include "TableFieldDescription.hxx"
-#endif
-#ifndef _TOOLS_DEBUG_HXX
-#include <tools/debug.hxx>
-#endif
-#ifndef TOOLS_DIAGNOSE_EX_H
#include <tools/diagnose_ex.h>
-#endif
-#ifndef _DBA_DBACCESS_HELPID_HRC_
+#include <osl/diagnose.h>
#include "dbaccess_helpid.hrc"
-#endif
-#ifndef DBAUI_QUERY_TABLEWINDOW_HXX
#include "QTableWindow.hxx"
-#endif
-#ifndef DBAUI_QUERYTABLECONNECTION_HXX
#include "QTableConnection.hxx"
-#endif
-#ifndef DBAUI_QTABLECONNECTIONDATA_HXX
#include "QTableConnectionData.hxx"
-#endif
-#ifndef DBAUI_QUERYDESIGNVIEW_HXX
#include "QueryDesignView.hxx"
-#endif
-#ifndef DBAUI_QUERYCONTROLLER_HXX
#include "querycontroller.hxx"
-#endif
-#ifndef DBAUI_QUERYADDTABCONNUNDOACTION_HXX
#include "QueryAddTabConnUndoAction.hxx"
-#endif
-#ifndef DBAUI_QUERYTABWINSHOWUNDOACT_HXX
#include "QueryTabWinShowUndoAct.hxx"
-#endif
-#ifndef DBACCESS_UI_BROWSER_ID_HXX
#include "browserids.hxx"
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XTABLESSUPPLIER_HPP_
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_
#include <com/sun/star/sdbc/XConnection.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XKEYSSUPPLIER_HPP_
#include <com/sun/star/sdbcx/XKeysSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#endif
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
-#ifndef DBACCESS_JACCESS_HXX
#include "JAccess.hxx"
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_KEYTYPE_HPP_
#include <com/sun/star/sdbcx/KeyType.hpp>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XINDEXACCESS_HPP_
#include <com/sun/star/container/XIndexAccess.hpp>
-#endif
-#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
#include <com/sun/star/beans/XPropertySet.hpp>
-#endif
-#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
#include "dbustrings.hrc"
-#endif
-#ifndef _CONNECTIVITY_DBTOOLS_HXX_
#include <connectivity/dbtools.hxx>
-#endif
-#ifndef _COMPHELPER_SEQUENCE_HXX_
#include <comphelper/sequence.hxx>
-#endif
-#ifndef DBAUI_QUERYDLG_HXX
#include "querydlg.hxx"
-#endif
-#ifndef DBAUI_JOINEXCHANGE_HXX
#include "JoinExchange.hxx"
-#endif
-#ifndef _COMPHELPER_EXTRACT_HXX_
#include <comphelper/extract.hxx>
-#endif
-#ifndef DBAUI_QUERYDESIGNVIEW_HXX
#include "QueryDesignView.hxx"
-#endif
-#ifndef _DBU_QRY_HRC_
#include "dbu_qry.hrc"
-#endif
-#ifndef _SV_MSGBOX_HXX
#include <vcl/msgbox.hxx>
-#endif
using namespace dbaui;
using namespace ::com::sun::star::uno;
@@ -259,7 +198,7 @@ namespace
Reference<XPropertySet> xColumn;
if ( !( _rxSourceForeignKeyColumns->getByName(*pIter) >>= xColumn ) )
{
- OSL_ENSURE( false, "addConnections: invalid foreign key column!" );
+ OSL_FAIL( "addConnections: invalid foreign key column!" );
continue;
}
@@ -273,7 +212,7 @@ namespace
if(aFind.getLength())
pNewConnData->SetFieldIndex(JTCS_FROM,aFind[0]+1);
else
- OSL_ENSURE(0,"Column not found!");
+ OSL_FAIL("Column not found!");
}
// get the position inside the tabe
Reference<XNameAccess> xRefColumns = _rDest.GetOriginalColumns();
@@ -283,7 +222,7 @@ namespace
if(aFind.getLength())
pNewConnData->SetFieldIndex(JTCS_TO,aFind[0]+1);
else
- OSL_ENSURE(0,"Column not found!");
+ OSL_FAIL("Column not found!");
}
pNewConnData->AppendConnLine(*pIter,sRelatedColumn);
@@ -297,7 +236,6 @@ namespace
// automatically remove all connections adjacent to the win.
// (Because of this automatism we would have an ownerhsip ambiguity for
// the connection data if we would insert the conn-Undo-Action)
- // FS - 21.10.99 - 69183
}
}
}
@@ -345,7 +283,7 @@ void OQueryTableView::ReSync()
{
DBG_CHKTHIS(OQueryTableView,NULL);
TTableWindowData* pTabWinDataList = m_pView->getController().getTableWindowData();
- DBG_ASSERT((getTableConnections()->size()==0) && (GetTabWinMap()->size()==0),
+ OSL_ENSURE((getTableConnections()->size()==0) && (GetTabWinMap()->size()==0),
"vor OQueryTableView::ReSync() bitte ClearAll aufrufen !");
// ich brauche eine Sammlung aller Fensternamen, deren Anlegen schief geht, damit ich die entsprechenden Connections
@@ -501,7 +439,7 @@ void OQueryTableView::AddTabWin(const ::rtl::OUString& _rTableName, const ::rtl:
}
catch(SQLException&)
{
- OSL_ASSERT(!"qualifiedNameComponents");
+ OSL_FAIL("qualifiedNameComponents");
}
}
// -----------------------------------------------------------------------------
@@ -538,7 +476,7 @@ Reference<XPropertySet> getKeyReferencedTo(const Reference<XIndexAccess>& _rxKey
void OQueryTableView::AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& _rTableName, const ::rtl::OUString& strAlias, sal_Bool bNewTable)
{
DBG_CHKTHIS(OQueryTableView,NULL);
- DBG_ASSERT(_rTableName.getLength() || strAlias.getLength(), "OQueryTableView::AddTabWin : kein Tabellen- und kein Aliasname !");
+ OSL_ENSURE(_rTableName.getLength() || strAlias.getLength(), "OQueryTableView::AddTabWin : kein Tabellen- und kein Aliasname !");
// wenn der Tabellenname nicht gesetzt ist, steht das fuer ein Dummy-Fenster, das braucht aber wenigstens einen Alias-Namen
// neue Datenstruktur erzeugen
@@ -814,7 +752,7 @@ void OQueryTableView::KeyInput( const KeyEvent& rEvt )
OQueryTableWindow* OQueryTableView::FindTable(const String& rAliasName)
{
DBG_CHKTHIS(OQueryTableView,NULL);
- DBG_ASSERT(rAliasName.Len(), "OQueryTableView::FindTable : der AliasName sollte nicht leer sein !");
+ OSL_ENSURE(rAliasName.Len(), "OQueryTableView::FindTable : der AliasName sollte nicht leer sein !");
// (nicht dass es schadet, aber es ist sinnlos und weist vielleicht auf Fehler beim Aufrufer hin)
OTableWindowMap::const_iterator aIter = GetTabWinMap()->find(rAliasName);
if(aIter != GetTabWinMap()->end())
@@ -842,7 +780,7 @@ sal_Bool OQueryTableView::FindTableFromField(const String& rFieldName, OTableFie
void OQueryTableView::RemoveTabWin(OTableWindow* pTabWin)
{
DBG_CHKTHIS(OQueryTableView,NULL);
- DBG_ASSERT(pTabWin != NULL, "OQueryTableView::RemoveTabWin : Fenster sollte ungleich NULL sein !");
+ OSL_ENSURE(pTabWin != NULL, "OQueryTableView::RemoveTabWin : Fenster sollte ungleich NULL sein !");
// mein Parent brauche ich, da es vom Loeschen erfahren soll
OQueryDesignView* pParent = static_cast<OQueryDesignView*>(getDesignView());
@@ -893,8 +831,6 @@ void OQueryTableView::GetConnection(OQueryTableConnection* pConn)
// bei mir und dem Dokument einfuegen
addConnection( pConn );
- // invalidieren (damit es neu gezeichnet wird)
- // pConn->Invalidate();
}
//------------------------------------------------------------------------
@@ -911,7 +847,7 @@ void OQueryTableView::HideTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAc
{
DBG_CHKTHIS(OQueryTableView,NULL);
OTableWindowMap* pTabWins = GetTabWinMap();
- DBG_ASSERT(pTabWins != NULL, "OQueryTableView::HideTabWin : habe keine TabWins !");
+ OSL_ENSURE(pTabWins != NULL, "OQueryTableView::HideTabWin : habe keine TabWins !");
if (pTabWin)
{
@@ -992,7 +928,7 @@ sal_Bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUn
if (pTabWin->Init())
{
TTableWindowData::value_type pData = pTabWin->GetData();
- DBG_ASSERT(pData != NULL, "OQueryTableView::ShowTabWin : TabWin hat keine Daten !");
+ OSL_ENSURE(pData != NULL, "OQueryTableView::ShowTabWin : TabWin hat keine Daten !");
// Wenn die Daten schon PosSize haben, diese benutzen
if (pData->HasPosition() && pData->HasSize())
{
@@ -1024,9 +960,6 @@ sal_Bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUn
for(;aIter != aEnd;++aIter)
addConnection(*aIter); // add all connections from the undo action
- // each connection should invalidated inside addConnection so we don't need this here any longer
-// if ( !pOwnList->empty() )
-// InvalidateConnections();
pTableCon->clear();
// und die Daten des Fensters ebenfalls in Liste (des Docs)
@@ -1062,7 +995,7 @@ sal_Bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUn
void OQueryTableView::InsertField(const OTableFieldDescRef& rInfo)
{
DBG_CHKTHIS(OQueryTableView,NULL);
- DBG_ASSERT(getDesignView() != NULL, "OQueryTableView::InsertField : habe kein Parent !");
+ OSL_ENSURE(getDesignView() != NULL, "OQueryTableView::InsertField : habe kein Parent !");
static_cast<OQueryDesignView*>(getDesignView())->InsertField(rInfo);
}
//------------------------------------------------------------------------------
@@ -1098,3 +1031,5 @@ bool OQueryTableView::supressCrossNaturalJoin(const TTableConnectionData::value_
return pQueryData && (pQueryData->GetJoinType() == CROSS_JOIN);
}
// -----------------------------------------------------------------------------
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */