summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/relationdesign
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2009-10-14 18:48:09 +0000
committerKurt Zenker <kz@openoffice.org>2009-10-14 18:48:09 +0000
commit8bd768c01084fbf44c14fbdd40d7ccc4f0d6905a (patch)
tree43e8d98e7668979f40a385b8984a5e3c8b7f02b5 /dbaccess/source/ui/relationdesign
parentba511045377026a241d7fadd7c6f0cfb843490e7 (diff)
CWS-TOOLING: integrate CWS dba32h
2009-10-12 12:21:44 +0200 msc r276827 : remove warning for issue 102712 because the issue is fixed 2009-10-05 07:14:20 +0200 oj r276658 : #105585# add missing dependency for OOO_UI 2009-10-02 12:50:19 +0200 fs r276632 : #i105505# If a model is created, and is a revenant of a previous incarnation, then ensure it is properly initialized. In particular, in its ctor, set the state to "Initializing", not "Initialized", and then let the ModelImpl call attachResource. This ensures that the model is initialized completely, including firing the necessary events. 2009-10-02 12:46:12 +0200 fs r276631 : #i105505# always do an attachResource at the newly loaded model, even if it (internally) was not really loaded, but only a revenant of a previous incarnation of this document 2009-10-01 13:09:07 +0200 fs r276596 : do not rely on the name 'Standard' for the one and only form in a document 2009-10-01 12:35:56 +0200 fs r276589 : #i105509# don't rely on default form component names, use indexes 2009-10-01 11:19:18 +0200 fs r276584 : copying the fix for #i105082# into this CWS 2009-10-01 11:13:22 +0200 fs r276583 : improved logs 2009-10-01 11:10:44 +0200 fs r276581 : #i105505# 2009-10-01 08:07:57 +0200 fs r276575 : manual merge of trunk, to allow cwslocalize to run 2009-09-30 22:48:30 +0200 fs r276574 : removed that strange ONLOAD definition 2009-09-30 12:58:18 +0200 fs r276553 : copy fix for #i105387# into this CWS, as the issue prevents us from finalizing the CWS 2009-09-30 12:56:45 +0200 fs r276552 : copy fix for #i105387# into this CWS, as the issue prevents us from finalizing the CWS 2009-09-30 11:47:45 +0200 fs r276549 : #i105235# 2009-09-29 12:27:40 +0200 fs r276521 : #i105367# 2009-09-28 12:08:17 +0200 oj r276485 : #i105371# export version in manifest.xml as well 2009-09-28 12:07:02 +0200 oj r276484 : #i105371# export version in manifest.xml as well 2009-09-28 09:48:01 +0200 oj r276481 : #i105366# init drivers when not empty 2009-09-25 14:31:27 +0200 fs r276466 : CWS-TOOLING: rebase CWS dba32h to trunk@276429 (milestone: DEV300:m60) 2009-09-24 13:52:54 +0200 fs r276422 : #i105234# do not zoom the control when they view information is still uninitialized (happens at least in Writer when opening a form document) 2009-09-24 11:42:03 +0200 fs r276413 : #i105234# proper zoom handling for the nav bar 2009-09-24 11:41:40 +0200 fs r276412 : #i105234# setZoom: care for precision errors caused by implicit conversion float->double 2009-09-23 12:21:22 +0200 oj r276377 : remove dos lineends 2009-09-23 11:44:52 +0200 oj r276376 : #i105216# load config on demand 2009-09-23 11:44:19 +0200 oj r276375 : #i105216# load config on demand 2009-09-23 11:43:35 +0200 oj r276374 : #i105216# load config on demand 2009-09-21 09:13:03 +0200 oj r276307 : #i105158# use Thread support 2009-09-18 13:06:50 +0200 fs r276277 : #i105147# 2009-09-18 11:48:23 +0200 oj r276271 : #i105158# new method for thread safety 2009-09-18 10:42:56 +0200 fs r276266 : CWS-TOOLING: rebase CWS dba32h to trunk@276192 (milestone: DEV300:m59) 2009-09-18 08:30:03 +0200 oj r276263 : #i105016# load correct ldap so 2009-09-17 13:42:31 +0200 oj r276240 : change count of check boxes 2009-09-17 13:32:59 +0200 oj r276239 : revert false to true for currency 2009-09-17 09:14:46 +0200 oj r276220 : #i104901# add patch for every issue 2009-09-17 09:10:29 +0200 oj r276219 : #i104901# add patch for every issue 2009-09-11 13:47:49 +0200 oj r276060 : #i104901# fix for indentity 2009-09-11 12:14:14 +0200 fs r276056 : #i104594# allow to render controls without an SdrPageView 2009-09-11 11:49:31 +0200 fs r276055 : CWS-TOOLING: rebase CWS dba32h to trunk@276043 (milestone: DEV300:m58) 2009-09-10 08:41:40 +0200 oj r276021 : #i104911# export variable-set not for repeating sections
Diffstat (limited to 'dbaccess/source/ui/relationdesign')
-rw-r--r--dbaccess/source/ui/relationdesign/RTableConnectionData.cxx4
-rw-r--r--dbaccess/source/ui/relationdesign/RelationController.cxx135
2 files changed, 34 insertions, 105 deletions
diff --git a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
index ad0bc1a26ea5..00478a064ced 100644
--- a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
+++ b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
@@ -364,7 +364,7 @@ BOOL ORelationTableConnectionData::Update()
// get the name of foreign key // search for columns
m_aConnName = ::rtl::OUString();
- xKey = NULL;
+xKey.clear();
bool bDropRelation = false;
for(sal_Int32 i=0;i<xKeys->getCount();++i)
{
@@ -422,7 +422,7 @@ BOOL ORelationTableConnectionData::Update()
}
}
}
- xKey = NULL;
+ xKey.clear();
} // for(sal_Int32 i=0;i<xKeys->getCount();++i)
if ( bDropRelation )
{
diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx
index 14653343bd4d..3bd2aa12a8ae 100644
--- a/dbaccess/source/ui/relationdesign/RelationController.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationController.cxx
@@ -30,133 +30,50 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_dbaccess.hxx"
-#ifndef _DBAU_REGHELPER_HXX_
#include "dbu_reghelper.hxx"
-#endif
-#ifndef _SFXSIDS_HRC
#include <sfx2/sfxsids.hrc>
-#endif
-#ifndef _DBU_REL_HRC_
#include "dbu_rel.hrc"
-#endif
-#ifndef _SV_SVAPP_HXX
#include <vcl/svapp.hxx>
-#endif
-#ifndef DBACCESS_UI_BROWSER_ID_HXX
#include "browserids.hxx"
-#endif
-#ifndef _COMPHELPER_TYPES_HXX_
#include <comphelper/types.hxx>
-#endif
-#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
#include "dbustrings.hrc"
-#endif
-#ifndef _CONNECTIVITY_DBTOOLS_HXX_
#include <connectivity/dbtools.hxx>
-#endif
-#ifndef _COM_SUN_STAR_FRAME_FRAMESEARCHFLAG_HPP_
#include <com/sun/star/frame/FrameSearchFlag.hpp>
-#endif
-#ifndef _COMPHELPER_EXTRACT_HXX_
#include <comphelper/extract.hxx>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XCHILD_HPP_
#include <com/sun/star/container/XChild.hpp>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
#include <com/sun/star/container/XNameContainer.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XDATADESCRIPTORFACTORY_HPP_
#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XTABLESSUPPLIER_HPP_
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_KEYTYPE_HPP_
#include <com/sun/star/sdbcx/KeyType.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XDROP_HPP_
#include <com/sun/star/sdbcx/XDrop.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XALTERTABLE_HPP_
#include <com/sun/star/sdbcx/XAlterTable.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBCX_XAPPEND_HPP_
#include <com/sun/star/sdbcx/XAppend.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
-#ifndef _COM_SUN_STAR_SDB_SQLCONTEXT_HPP_
#include <com/sun/star/sdb/SQLContext.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBC_SQLWARNING_HPP_
#include <com/sun/star/sdbc/SQLWarning.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBC_COLUMNVALUE_HPP_
#include <com/sun/star/sdbc/ColumnValue.hpp>
-#endif
-#ifndef _COM_SUN_STAR_SDBC_XROW_HPP_
#include <com/sun/star/sdbc/XRow.hpp>
-#endif
-#ifndef _DBHELPER_DBEXCEPTION_HXX_
#include <connectivity/dbexception.hxx>
-#endif
-#ifndef _COM_SUN_STAR_UI_DIALOGS_XEXECUTABLEDIALOG_HPP_
+#include <connectivity/dbmetadata.hxx>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
-#endif
-#ifndef _COMPHELPER_STREAMSECTION_HXX_
#include <comphelper/streamsection.hxx>
-#endif
-#ifndef _COMPHELPER_BASIC_IO_HXX_
#include <comphelper/basicio.hxx>
-#endif
-#ifndef _COMPHELPER_SEQSTREAM_HXX
#include <comphelper/seqstream.hxx>
-#endif
-#ifndef _COM_SUN_STAR_IO_XACTIVEDATASOURCE_HPP_
#include <com/sun/star/io/XActiveDataSource.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XACTIVEDATASINK_HPP_
#include <com/sun/star/io/XActiveDataSink.hpp>
-#endif
-#ifndef _DBAUI_SQLMESSAGE_HXX_
#include "sqlmessage.hxx"
-#endif
-#ifndef DBAUI_RELATIONCONTROLLER_HXX
#include "RelationController.hxx"
-#endif
-#ifndef _SV_MSGBOX_HXX
#include <vcl/msgbox.hxx>
-#endif
#include "TableWindowData.hxx"
-#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
#include "dbustrings.hrc"
-#endif
-#ifndef DBAUI_TOOLS_HXX
#include "UITools.hxx"
-#endif
-#ifndef DBAUI_RTABLECONNECTIONDATA_HXX
#include "RTableConnectionData.hxx"
-#endif
-#ifndef DBAUI_RELATION_TABLEVIEW_HXX
#include "RelationTableView.hxx"
-#endif
-#ifndef DBAUI_RELATIONDESIGNVIEW_HXX
#include "RelationDesignView.hxx"
-#endif
-#ifndef _TOOLS_DEBUG_HXX
#include <tools/debug.hxx>
-#endif
-#ifndef TOOLS_DIAGNOSE_EX_H
#include <tools/diagnose_ex.h>
-#endif
-#ifndef _SV_WAITOBJ_HXX
#include <vcl/waitobj.hxx>
-#endif
#include <osl/thread.hxx>
#include <vos/mutex.hxx>
@@ -402,12 +319,12 @@ namespace
{
}
- protected:
- virtual ~RelationLoader(){}
-
/// Working method which should be overridden.
virtual void SAL_CALL run();
virtual void SAL_CALL onTerminated();
+ protected:
+ virtual ~RelationLoader(){}
+
void loadTableData(const Any& _aTable);
};
@@ -565,9 +482,12 @@ void ORelationController::mergeData(const TTableConnectionData& _aConnectionData
m_vTableData.push_back((*aConnDataIter)->getReferencedTable());
}
} // for(;aConnDataIter != aConnDataEnd;++aConnDataIter)
- --m_nThreadEvent;
- if ( !m_nThreadEvent )
- Application::PostUserEvent(LINK(this, ORelationController, OnThreadFinished));
+ if ( m_nThreadEvent )
+ {
+ --m_nThreadEvent;
+ if ( !m_nThreadEvent )
+ Application::PostUserEvent(LINK(this, ORelationController, OnThreadFinished));
+ }
}
// -----------------------------------------------------------------------------
IMPL_LINK( ORelationController, OnThreadFinished, void*, /*NOTINTERESTEDIN*/ )
@@ -599,24 +519,33 @@ void ORelationController::loadData()
{
if ( !m_xTables.is() )
return;
+ DatabaseMetaData aMeta(getConnection());
// this may take some time
const Reference< XDatabaseMetaData> xMetaData = getConnection()->getMetaData();
const Sequence< ::rtl::OUString> aNames = m_xTables->getElementNames();
const sal_Int32 nCount = aNames.getLength();
- const sal_Int32 nMaxElements = (nCount / MAX_THREADS) +1;
-
- sal_Int32 nStart = 0,nEnd = ::std::min(nMaxElements,nCount);
- while(nStart != nEnd)
+ if ( aMeta.supportsThreads() )
{
- ++m_nThreadEvent;
- RelationLoader* pThread = new RelationLoader(this,xMetaData,m_xTables,aNames,nStart,nEnd);
- pThread->createSuspended();
- pThread->setPriority(osl_Thread_PriorityBelowNormal);
- pThread->resume();
- nStart = nEnd;
- nEnd += nMaxElements;
- nEnd = ::std::min(nEnd,nCount);
- } // for(;pIter != pEnd;++pIter)
+ const sal_Int32 nMaxElements = (nCount / MAX_THREADS) +1;
+ sal_Int32 nStart = 0,nEnd = ::std::min(nMaxElements,nCount);
+ while(nStart != nEnd)
+ {
+ ++m_nThreadEvent;
+ RelationLoader* pThread = new RelationLoader(this,xMetaData,m_xTables,aNames,nStart,nEnd);
+ pThread->createSuspended();
+ pThread->setPriority(osl_Thread_PriorityBelowNormal);
+ pThread->resume();
+ nStart = nEnd;
+ nEnd += nMaxElements;
+ nEnd = ::std::min(nEnd,nCount);
+ } // for(;pIter != pEnd;++pIter)
+ } // if ( aMeta.supportsThreads() )
+ else
+ {
+ RelationLoader* pThread = new RelationLoader(this,xMetaData,m_xTables,aNames,0,nCount);
+ pThread->run();
+ pThread->onTerminated();
+ }
}
catch(SQLException& e)
{