diff options
author | Frank Schönheit <fs@openoffice.org> | 2001-07-25 12:44:28 +0000 |
---|---|---|
committer | Frank Schönheit <fs@openoffice.org> | 2001-07-25 12:44:28 +0000 |
commit | cda0112a32df4cc5a49853b72211bfcc7cb0b272 (patch) | |
tree | 28460d4313c55c3be38ab644ccb9d9c94a4169e3 /svx/source | |
parent | 9beb7934d7cbcfb8a1b4fbe48bfeabc14ccbd1cb (diff) |
#88927# use DBTOOLS with load-on-demand
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/form/fmctrler.cxx | 66 | ||||
-rw-r--r-- | svx/source/form/fmexpl.cxx | 25 | ||||
-rw-r--r-- | svx/source/form/fmpgeimp.cxx | 6 | ||||
-rw-r--r-- | svx/source/form/fmshell.cxx | 22 | ||||
-rw-r--r-- | svx/source/form/fmview.cxx | 23 | ||||
-rw-r--r-- | svx/source/form/fmvwimp.cxx | 15 | ||||
-rw-r--r-- | svx/source/form/makefile.mk | 10 | ||||
-rw-r--r-- | svx/source/form/tabwin.cxx | 15 | ||||
-rw-r--r-- | svx/source/inc/filtnav.hxx | 9 | ||||
-rw-r--r-- | svx/source/inc/fmctrler.hxx | 9 | ||||
-rw-r--r-- | svx/source/inc/fmshimp.hxx | 12 | ||||
-rw-r--r-- | svx/source/inc/fmtools.hxx | 46 | ||||
-rw-r--r-- | svx/source/inc/gridcell.hxx | 21 |
13 files changed, 160 insertions, 119 deletions
diff --git a/svx/source/form/fmctrler.cxx b/svx/source/form/fmctrler.cxx index d46c908a723e..18c3eeae3d89 100644 --- a/svx/source/form/fmctrler.cxx +++ b/svx/source/form/fmctrler.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fmctrler.cxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: fs $ $Date: 2001-06-15 11:11:14 $ + * last change: $Author: fs $ $Date: 2001-07-25 13:43:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,6 +77,9 @@ #ifndef _SVX_FMSHELL_HXX #include "fmshell.hxx" #endif +#ifndef SVX_FORM_CONFIRMDELETE_HXX +#include "confirmdelete.hxx" +#endif #ifndef _COM_SUN_STAR_SDB_ROWCHANGEACTION_HPP_ #include <com/sun/star/sdb/RowChangeAction.hpp> @@ -148,10 +151,6 @@ #include "fmfilter.hxx" #endif -#ifndef _SVX_DBERRBOX_HXX -#include "dbmsgbox.hxx" -#endif - #ifndef _SV_MSGBOX_HXX //autogen wg. RET_YES #include <vcl/msgbox.hxx> #endif @@ -246,8 +245,9 @@ using namespace ::com::sun::star::frame; using namespace ::com::sun::star::beans; using namespace ::comphelper; using namespace ::dbtools; -using namespace ::svxform; using namespace ::connectivity; +using namespace ::svxform; +using namespace ::connectivity::simple; extern sal_uInt16 AutoSlotMap[]; @@ -365,6 +365,7 @@ FmXFormController::FmXFormController(const Reference< ::com::sun::star::lang::XM FmFormView* _pView, Window* _pWindow, const UniString& _sDispatchPrefix) :FmXFormController_BASE1(m_aMutex) ,OPropertySetHelper(FmXFormController_BASE1::rBHelper) + ,OSQLParserClient(_rxORB) ,m_xORB(_rxORB) ,m_aActivateListeners(m_aMutex) ,m_aModifyListeners(m_aMutex) @@ -392,7 +393,6 @@ FmXFormController::FmXFormController(const Reference< ::com::sun::star::lang::XM ,m_sDispatchPrefix(_sDispatchPrefix) ,m_nUpdateDispatcherEvent(0) ,m_nToggleEvent(0) - ,m_aParser(_rxORB) { ::comphelper::increment(m_refCount); { @@ -593,11 +593,11 @@ void FmXFormController::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) c case FM_ATTR_FILTER_CRITERIA: { ::rtl::OUString aFilter; - Reference< ::com::sun::star::sdbc::XConnection> xConnection(::dbtools::getConnection(Reference< ::com::sun::star::sdbc::XRowSet>(m_xModelAsIndex, UNO_QUERY))); + Reference<XConnection> xConnection(getRowsetConnection(Reference< XRowSet>(m_xModelAsIndex, UNO_QUERY))); if (xConnection.is()) { Reference< ::com::sun::star::sdbc::XDatabaseMetaData> xMetaData(xConnection->getMetaData()); - Reference< ::com::sun::star::util::XNumberFormatsSupplier> xFormatSupplier( ::dbtools::getNumberFormats(xConnection, sal_True)); + Reference< ::com::sun::star::util::XNumberFormatsSupplier> xFormatSupplier( OStaticDataAccessTools().getNumberFormats(xConnection, sal_True)); Reference< ::com::sun::star::util::XNumberFormatter> xFormatter(m_xORB ->createInstance(::rtl::OUString::createFromAscii("com.sun.star.util.NumberFormatter")), UNO_QUERY); xFormatter->attachNumberFormatsSupplier(xFormatSupplier); @@ -630,12 +630,11 @@ void FmXFormController::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) c aTest = (const sal_Unicode*)(*j).second; aErrorMsg = ::rtl::OUString(); - OSQLParseNode* pParseNode = const_cast<OSQLParser*>(&m_aParser)->predicateTree(aErrorMsg, aTest, xFormatter, xField); - - if (pParseNode) + ::rtl::Reference< ISQLParseNode > xParseNode = predicateTree(aErrorMsg, aTest, xFormatter, xField); + if (xParseNode.is()) { aCriteria = ::rtl::OUString(); - pParseNode->parseNodeToStr(aCriteria,xMetaData); + xParseNode->parseNodeToStr(aCriteria, xMetaData); aFilter += aCriteria; } } @@ -1952,7 +1951,7 @@ void FmXFormController::loaded(const ::com::sun::star::lang::EventObject& rEvent ::osl::MutexGuard aGuard( m_aMutex ); Reference< ::com::sun::star::sdbc::XRowSet > xForm(rEvent.Source, UNO_QUERY); // do we have a connected data source - if (xForm.is() && ::dbtools::getConnection(xForm).is()) + if (xForm.is() && getRowsetConnection(xForm).is()) { Reference< XPropertySet > xSet(xForm, UNO_QUERY); if (xSet.is()) @@ -1961,8 +1960,8 @@ void FmXFormController::loaded(const ::com::sun::star::lang::EventObject& rEvent sal_Int32 aVal2; ::cppu::enum2int(aVal2,aVal); m_bCycle = !aVal.hasValue() || aVal2 == ::com::sun::star::form::TabulatorCycle_RECORDS; - m_bCanUpdate = ::dbtools::canUpdate(xSet); - m_bCanInsert = ::dbtools::canInsert(xSet); + m_bCanUpdate = canUpdateRecords(xSet); + m_bCanInsert = canInsertRecords(xSet); m_bCurrentRecordModified = ::comphelper::getBOOL(xSet->getPropertyValue(FM_PROP_ISMODIFIED)); m_bCurrentRecordNew = ::comphelper::getBOOL(xSet->getPropertyValue(FM_PROP_ISNEW)); if (m_bCanInsert || m_bCanUpdate) // modificationen sind moeglich @@ -2286,8 +2285,8 @@ void FmXFormController::setFilter(vector<FmFieldInfo>& rFieldInfos) { OSL_ENSURE(!FmXFormController_BASE1::rBHelper.bDisposed,"FmXFormController: Object already disposed!"); // create the composer - Reference< ::com::sun::star::sdbc::XRowSet > xForm(m_xModelAsIndex, UNO_QUERY); - Reference< ::com::sun::star::sdbc::XConnection > xConnection(::dbtools::getConnection(xForm)); + Reference< XRowSet > xForm(m_xModelAsIndex, UNO_QUERY); + Reference< XConnection > xConnection(getRowsetConnection(xForm)); if (xForm.is()) { Reference< ::com::sun::star::sdb::XSQLQueryComposerFactory > xFactory(xConnection, UNO_QUERY); @@ -2386,7 +2385,7 @@ void FmXFormController::setFilter(vector<FmFieldInfo>& rFieldInfos) if (!xField.is()) continue; } - catch (...) + catch (const Exception&) { continue; } @@ -2403,7 +2402,7 @@ void FmXFormController::setFilter(vector<FmFieldInfo>& rFieldInfos) { ::rtl::OUString aCompText = aRow[(*iter).xText]; aCompText += ::rtl::OUString::createFromAscii(" "); - ::rtl::OString aVal = m_aParser.getContext().getIntlKeywordAscii(OParseContext::KEY_AND); + ::rtl::OString aVal = m_xParser->getContext().getIntlKeywordAscii(OParseContext::KEY_AND); aCompText += ::rtl::OUString(aVal.getStr(),aVal.getLength(),RTL_TEXTENCODING_ASCII_US); aCompText += ::rtl::OUString::createFromAscii(" "); aCompText += ::comphelper::getString(pRefValues[j].Value); @@ -2461,9 +2460,9 @@ void FmXFormController::startFiltering() // the control we have to activate after replacement Reference< ::com::sun::star::awt::XControl > xNewActiveControl; - Reference< ::com::sun::star::sdbc::XConnection > xConnection(::dbtools::getConnection(Reference< ::com::sun::star::sdbc::XRowSet > (m_xModelAsIndex, UNO_QUERY))); + Reference< ::com::sun::star::sdbc::XConnection > xConnection(getRowsetConnection(Reference< ::com::sun::star::sdbc::XRowSet > (m_xModelAsIndex, UNO_QUERY))); Reference< ::com::sun::star::sdbc::XDatabaseMetaData > xMetaData(xConnection->getMetaData()); - Reference< ::com::sun::star::util::XNumberFormatsSupplier > xFormatSupplier = ::dbtools::getNumberFormats(xConnection, sal_True); + Reference< ::com::sun::star::util::XNumberFormatsSupplier > xFormatSupplier = OStaticDataAccessTools().getNumberFormats(xConnection, sal_True); Reference< ::com::sun::star::util::XNumberFormatter > xFormatter(m_xORB ->createInstance(::rtl::OUString::createFromAscii("com.sun.star.util.NumberFormatter")), UNO_QUERY); xFormatter->attachNumberFormatsSupplier(xFormatSupplier); @@ -2888,15 +2887,14 @@ sal_Bool SAL_CALL FmXFormController::approveRowChange(const ::com::sun::star::sd } } - ::vos::OGuard aGuard(Application::GetSolarMutex()); - - UniString aTitle(SVX_RES(RID_STR_WRITEERROR)); - UniString aMsg(SVX_RES(RID_ERR_FIELDREQUIRED)); + String aMsg(SVX_RES(RID_ERR_FIELDREQUIRED)); aMsg.SearchAndReplace('#', aFieldName.getStr()); - SvxDBMsgBox aDlg(getDialogParentWindow(), aTitle, aMsg, WB_OK | WB_DEF_OK, - SvxDBMsgBox::Info); - aDlg.Execute(); + SQLContext aError; + aError.Message = String(SVX_RES(RID_STR_WRITEERROR)); + aError.Details = aMsg; + displayException(aError, getDialogParentWindow()); + if ( i < nLength) { Reference< ::com::sun::star::awt::XWindow > xWindow(pControls[i], UNO_QUERY); @@ -3041,7 +3039,7 @@ sal_Bool SAL_CALL FmXFormController::approveParameter(const ::com::sun::star::fo // the request ParametersRequest aRequest; aRequest.Parameters = aEvent.Parameters; - aRequest.Connection = getConnection(Reference< XRowSet >(aEvent.Source, UNO_QUERY)); + aRequest.Connection = getRowsetConnection(Reference< XRowSet >(aEvent.Source, UNO_QUERY)); OInteractionRequest* pParamRequest = new OInteractionRequest(makeAny(aRequest)); Reference< XInteractionRequest > xParamRequest(pParamRequest); // some knittings @@ -3143,10 +3141,8 @@ sal_Bool SAL_CALL FmXFormController::confirmDelete(const ::com::sun::star::sdb:: else aTitle = SVX_RES(RID_STR_DELETECONFIRM_RECORD); - SvxDBMsgBox aDlg(getDialogParentWindow(), aTitle, - SVX_RES(RID_STR_DELETECONFIRM), WB_YES_NO | WB_DEF_NO, SvxDBMsgBox::Warning); - - return aDlg.Execute() == RET_YES; + ConfirmDeleteDialog aDlg(getDialogParentWindow(), aTitle); + return RET_YES == aDlg.Execute(); } } diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx index 5a75291ec557..f67faa3af3c0 100644 --- a/svx/source/form/fmexpl.cxx +++ b/svx/source/form/fmexpl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fmexpl.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: oj $ $Date: 2001-07-05 10:15:13 $ + * last change: $Author: fs $ $Date: 2001-07-25 13:44:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -100,10 +100,6 @@ #include "taborder.hxx" #endif -#ifndef _SVX_DBERRBOX_HXX -#include "dbmsgbox.hxx" -#endif - #ifndef _SVX_FMMODEL_HXX #include "fmmodel.hxx" #endif @@ -254,6 +250,8 @@ using namespace ::svxform; using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::sdb; //======================================================================== @@ -1563,9 +1561,12 @@ sal_Bool FmExplorerModel::CheckEntry( FmEntryData* pEntryData ) && (pEntryData!=pChildData) ) { - SvxDBMsgBox aErrorBox( GetpApp()->GetAppWindow(), SVX_RES(RID_ERR_CONTEXT_ADDFORM), - SVX_RES(RID_ERR_DUPLICATE_NAME), WB_OK | WB_DEF_OK, SvxDBMsgBox::Error ); - aErrorBox.Execute(); + + + SQLContext aError; + aError.Message = String(SVX_RES(RID_ERR_CONTEXT_ADDFORM)); + aError.Details = String(SVX_RES(RID_ERR_DUPLICATE_NAME)); + displayException(aError); return sal_False; } @@ -1806,7 +1807,7 @@ void FmExplorer::StartDrag( sal_Int8 nAction, const Point& rPosPixel ) return; for (sal_Int32 i=0; i<m_arrCurrentSelection.Count(); ++i) - m_aControlExchange->addSelectedEntry(m_arrCurrentSelection[i]); + m_aControlExchange->addSelectedEntry(m_arrCurrentSelection[(sal_uInt16)i]); m_aControlExchange->setShellAndPage( GetExplModel()->GetFormShell(), GetExplModel()->GetFormPage() ); m_aControlExchange->buildPathFormat(this, m_pRootEntry); @@ -1816,7 +1817,7 @@ void FmExplorer::StartDrag( sal_Int8 nAction, const Point& rPosPixel ) sal_Bool bHasNonHidden = sal_False; for (i=0; i<m_arrCurrentSelection.Count(); i++) { - FmEntryData* pCurrent = (FmEntryData*)(m_arrCurrentSelection[i]->GetUserData()); + FmEntryData* pCurrent = (FmEntryData*)(m_arrCurrentSelection[(sal_uInt16)i]->GetUserData()); if (IsHiddenControl(pCurrent)) continue; bHasNonHidden = sal_True; @@ -1828,7 +1829,7 @@ void FmExplorer::StartDrag( sal_Int8 nAction, const Point& rPosPixel ) ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > > seqIFaces(m_arrCurrentSelection.Count()); ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > * pArray = seqIFaces.getArray(); for (i=0; i<m_arrCurrentSelection.Count(); i++) - pArray[i] = ((FmEntryData*)(m_arrCurrentSelection[i]->GetUserData()))->GetElement(); + pArray[i] = ((FmEntryData*)(m_arrCurrentSelection[(sal_uInt16)i]->GetUserData()))->GetElement(); // und das neue Format m_aControlExchange->addHiddenControlsFormat(seqIFaces); diff --git a/svx/source/form/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx index 54a4bf6efcd9..d7f9aa45cd19 100644 --- a/svx/source/form/fmpgeimp.cxx +++ b/svx/source/form/fmpgeimp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fmpgeimp.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: fs $ $Date: 2001-06-05 10:48:53 $ + * last change: $Author: fs $ $Date: 2001-07-25 13:43:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -469,7 +469,7 @@ Reference< XForm > FmFormPageImpl::FindForm( if (0 == sFormDataSourceName.getLength()) { // check if it has an active connection - Reference< XConnection > xFormConnection = dbtools::getConnection(xDBForm); + Reference< XConnection > xFormConnection = getRowsetConnection(xDBForm); if (xFormConnection.is()) { OSL_ENSURE(sal_False, "FmFormPageImpl::FindForm: a connection without data source name?"); diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx index 438652409165..3a51b78c5625 100644 --- a/svx/source/form/fmshell.cxx +++ b/svx/source/form/fmshell.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fmshell.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: thb $ $Date: 2001-06-27 08:23:47 $ + * last change: $Author: fs $ $Date: 2001-07-25 13:43:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -280,7 +280,7 @@ catch(::com::sun::star::sdbc::SQLException& e) \ { \ ::com::sun::star::sdb::SQLContext eExtendedInfo = \ - ::dbtools::prependContextInfo(e, Reference< XInterface > (), context); \ + GetImpl()->prependContextInfo(e, Reference< XInterface > (), context, ::rtl::OUString()); \ displayException(eExtendedInfo); \ } \ catch(Exception&) \ @@ -627,7 +627,7 @@ sal_uInt16 FmFormShell::PrepareClose(sal_Bool bUI, sal_Bool bForBrowsing) } if (bModified) - nResult = (sal_uInt16)FmXFormShell::SaveModified(xController, sal_False); + nResult = (sal_Bool)FmXFormShell::SaveModified(xController, sal_False); } } } @@ -1084,7 +1084,7 @@ void FmFormShell::Execute(SfxRequest &rReq) xCursor->relative(bRight ? 1 : -1); else { - sal_Bool bCanInsert = ::dbtools::canInsert(xSet); + sal_Bool bCanInsert = canInsertRecords(xSet); // kann noch ein Datensatz eingefuegt weden try { @@ -1133,7 +1133,7 @@ void FmFormShell::Execute(SfxRequest &rReq) sal_Bool bFinal = ::comphelper::getBOOL(xSet->getPropertyValue(FM_PROP_ROWCOUNTFINAL)); sal_Int32 nRecordCount= ::comphelper::getINT32(xSet->getPropertyValue(FM_PROP_ROWCOUNT)); - if (bFinal && (sal_uInt32)nRecord >= nRecordCount) + if (bFinal && (sal_Int32)nRecord >= nRecordCount) { Sound::Beep(); rReq.Done(); @@ -1760,11 +1760,11 @@ void FmFormShell::GetFormState(SfxItemSet &rSet, sal_uInt16 nWhich) case SID_FM_RECORD_NEW: { Reference< ::com::sun::star::beans::XPropertySet > xActiveSet(GetImpl()->getActiveForm(), UNO_QUERY); - bEnable = ::dbtools::canInsert(xActiveSet); + bEnable = canInsertRecords(xActiveSet); // if we are inserting we can move to the next row if the current record is modified bEnable = ::comphelper::getBOOL(xActiveSet->getPropertyValue(FM_PROP_ISNEW)) ? GetImpl()->isActiveModified() || ::comphelper::getBOOL(xActiveSet->getPropertyValue(FM_PROP_ISMODIFIED)) - : ::dbtools::canInsert(xActiveSet); + : canInsertRecords(xActiveSet); } break; case SID_FM_RECORD_DELETE: { @@ -1775,7 +1775,7 @@ void FmFormShell::GetFormState(SfxItemSet &rSet, sal_uInt16 nWhich) { Reference< ::com::sun::star::beans::XPropertySet > xActiveSet(xCursor, UNO_QUERY); // allowed to delete the row ? - bEnable = !::comphelper::getBOOL(xActiveSet->getPropertyValue(FM_PROP_ISNEW)) && ::dbtools::canDelete(xActiveSet); + bEnable = !::comphelper::getBOOL(xActiveSet->getPropertyValue(FM_PROP_ISNEW)) && canDeleteRecords(xActiveSet); } else bEnable = sal_False; @@ -1797,7 +1797,7 @@ void FmFormShell::GetFormState(SfxItemSet &rSet, sal_uInt16 nWhich) { // Sonderfall, es koennen keine Datensaetze eingefuegt werden // und es gibt keinen Datensatz -> dann - if (nCount == 0 && !::dbtools::canInsert(xNavSet)) + if (nCount == 0 && !canInsertRecords(xNavSet)) { bEnable = sal_False; } @@ -1882,7 +1882,7 @@ void FmFormShell::GetFormState(SfxItemSet &rSet, sal_uInt16 nWhich) { Reference< ::com::sun::star::sdbc::XRowSet > xRowSet(GetImpl()->getActiveForm(), UNO_QUERY); Reference< ::com::sun::star::beans::XPropertySet > xSet(GetImpl()->getActiveForm(), UNO_QUERY); - bEnable = ::dbtools::getConnection(xRowSet).is() && ::comphelper::getString(xSet->getPropertyValue(FM_PROP_ACTIVECOMMAND)).getLength(); + bEnable = getRowsetConnection(xRowSet).is() && ::comphelper::getString(xSet->getPropertyValue(FM_PROP_ACTIVECOMMAND)).getLength(); } break; case SID_FM_FORM_FILTERED: { diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx index edd8a1eebcae..ddd8c1ae6dc2 100644 --- a/svx/source/form/fmview.cxx +++ b/svx/source/form/fmview.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fmview.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: fs $ $Date: 2001-06-15 09:46:49 $ + * last change: $Author: fs $ $Date: 2001-07-25 13:43:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -830,19 +830,18 @@ SdrObject* FmFormView::CreateFieldControl(const UniString& rFieldDesc) const ::rtl::OUString sDatabaseName = aDatabaseName; - SQLExceptionInfo aInfo; + SQLErrorEvent aError; try { - xDataSource = ::dbtools::getDataSource(sDatabaseName,pImpl->getORB()); - ::rtl::OUString sEmpty; - xConnection = ::dbtools::getConnection_withFeedback(sDatabaseName, sEmpty, sEmpty, pImpl->getORB()); + xDataSource = getDatasourceObject(sDatabaseName, pImpl->getORB()); + xConnection = getDatasourceConnection(sDatabaseName, pImpl->getORB()); } - catch(const SQLContext& e) { aInfo = e; } - catch(const SQLWarning& e) { aInfo = e; } - catch(const SQLException& e) { aInfo = e; } - if (aInfo.isValid()) + catch(const SQLContext& e) { aError.Reason <<= e; } + catch(const SQLWarning& e) { aError.Reason <<= e; } + catch(const SQLException& e) { aError.Reason <<= e; } + if (aError.Reason.hasValue()) { - showError(aInfo, Reference< ::com::sun::star::awt::XWindow >(), pImpl->getORB()); + displayException(aError); return NULL; } @@ -891,7 +890,7 @@ SdrObject* FmFormView::CreateFieldControl(const UniString& rFieldDesc) const if (xFields.is() && xFields->hasByName(aFieldName)) xFields->getByName(aFieldName) >>= xField; - Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier = ::dbtools::getNumberFormats(xConnection, sal_False); + Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier = OStaticDataAccessTools().getNumberFormats(xConnection, sal_False); if (!xSupplier.is() || !xField.is()) return NULL; diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index 879802f912cd..c237fccec794 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fmvwimp.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: th $ $Date: 2001-05-11 16:04:52 $ + * last change: $Author: fs $ $Date: 2001-07-25 13:43:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -146,6 +146,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::container; using namespace ::com::sun::star::form; using namespace ::com::sun::star::awt; @@ -600,17 +601,17 @@ IMPL_LINK(FmXFormView, OnActivate, void*, EMPTYTAG) if (pFmRec) { - for (vector< ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormController > >::const_iterator i = pFmRec->GetList().begin(); + for (vector< Reference< XFormController > >::const_iterator i = pFmRec->GetList().begin(); i != pFmRec->GetList().end(); i++) { - const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormController > & xController = *i; + const Reference< XFormController > & xController = *i; if (xController.is()) { // Nur bei Datenbankformularen erfolgt eine aktivierung - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > xForm(xController->getModel(), ::com::sun::star::uno::UNO_QUERY); - if (xForm.is() && ::dbtools::getConnection(xForm).is()) + Reference< XRowSet > xForm(xController->getModel(), UNO_QUERY); + if (xForm.is() && getRowsetConnection(xForm).is()) { - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xFormSet(xForm, ::com::sun::star::uno::UNO_QUERY); + Reference< XPropertySet > xFormSet(xForm, UNO_QUERY); if (xFormSet.is()) { // wenn es eine Datenquelle gibt, dann als aktive ::com::sun::star::form setzen diff --git a/svx/source/form/makefile.mk b/svx/source/form/makefile.mk index 5b3937d5909e..e1f0f9576052 100644 --- a/svx/source/form/makefile.mk +++ b/svx/source/form/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.6 $ +# $Revision: 1.7 $ # -# last change: $Author: fs $ $Date: 2001-05-11 10:12:17 $ +# last change: $Author: fs $ $Date: 2001-07-25 13:44:28 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -81,7 +81,6 @@ BMP_IN=$(PRJ)$/win$/res SRS1NAME=form SRC1FILES= \ - dbmsgbox.src \ fmexpl.src \ filtnav.src \ taborder.src \ @@ -91,6 +90,10 @@ SRC1FILES= \ SLOFILES = \ + $(SLO)$/typeconversionclient.obj \ + $(SLO)$/confirmdelete.obj \ + $(SLO)$/dbtoolsclient.obj \ + $(SLO)$/sqlparserclient.obj \ $(SLO)$/dataaccessdescriptor.obj \ $(SLO)$/fmpage.obj \ $(SLO)$/fmPropBrw.obj \ @@ -120,7 +123,6 @@ SLOFILES = \ $(SLO)$/fmimplids.obj \ $(SLO)$/fmtools.obj \ $(SLO)$/fmshimp.obj \ - $(SLO)$/dbmsgbox.obj \ $(SLO)$/fmshell.obj \ $(SLO)$/fmsearch.obj \ $(SLO)$/fmsrcimp.obj \ diff --git a/svx/source/form/tabwin.cxx b/svx/source/form/tabwin.cxx index 21380e0a1955..f018f50905b6 100644 --- a/svx/source/form/tabwin.cxx +++ b/svx/source/form/tabwin.cxx @@ -2,9 +2,9 @@ * * $RCSfile: tabwin.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: oj $ $Date: 2001-07-05 10:15:13 $ + * last change: $Author: fs $ $Date: 2001-07-25 13:43:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -112,9 +112,9 @@ #include "fmshell.hxx" #endif -//#ifndef _SVX_FMEXCH_HXX -//#include "fmexch.hxx" -//#endif +#ifndef SVX_DBTOOLSCLIENT_HXX +#include "dbtoolsclient.hxx" +#endif #ifndef _SVX_FMPAGE_HXX #include "fmpage.hxx" @@ -393,7 +393,10 @@ sal_Bool FmFieldWin::Update(const ::com::sun::star::uno::Reference< ::com::sun:: ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xField; try { - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > xConnection = ::dbtools::calcConnection(::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > (xForm, ::com::sun::star::uno::UNO_QUERY),::comphelper::getProcessServiceFactory()); + // get the connection of the form + Reference< XConnection > xConnection; + OStaticDataAccessTools().calcConnection(Reference< XRowSet >(xForm, UNO_QUERY), ::comphelper::getProcessServiceFactory()); + if (!xConnection.is()) return sal_True; diff --git a/svx/source/inc/filtnav.hxx b/svx/source/inc/filtnav.hxx index 02ffca891637..c7908cd097ab 100644 --- a/svx/source/inc/filtnav.hxx +++ b/svx/source/inc/filtnav.hxx @@ -2,9 +2,9 @@ * * $RCSfile: filtnav.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: oj $ $Date: 2001-07-05 10:12:39 $ + * last change: $Author: fs $ $Date: 2001-07-25 13:38:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -136,6 +136,9 @@ #ifndef _SVX_FMEXCH_HXX #include "fmexch.hxx" #endif +#ifndef SVX_SQLPARSERCLIENT_HXX +#include "sqlparserclient.hxx" +#endif class FmFormShell; @@ -247,10 +250,10 @@ public: //======================================================================== class FmFilterModel : public FmParentData ,public SfxBroadcaster + ,public ::svxform::OSQLParserClient { friend class FmFilterAdapter; - connectivity::OSQLParser m_aParser; ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > m_xControllers; ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormController > m_xController; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xORB; diff --git a/svx/source/inc/fmctrler.hxx b/svx/source/inc/fmctrler.hxx index 8e9dc47f158c..41b3127949f9 100644 --- a/svx/source/inc/fmctrler.hxx +++ b/svx/source/inc/fmctrler.hxx @@ -2,9 +2,9 @@ * * $RCSfile: fmctrler.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: fs $ $Date: 2001-06-15 11:11:04 $ + * last change: $Author: fs $ $Date: 2001-07-25 13:38:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -223,6 +223,9 @@ #ifndef _SVX_FMTOOLS_HXX #include "fmtools.hxx" #endif +#ifndef SVX_SQLPARSERCLIENT_HXX +#include "sqlparserclient.hxx" +#endif #ifndef _CPPUHELPER_IMPLBASE1_HXX_ #include <cppuhelper/implbase2.hxx> @@ -309,6 +312,7 @@ class FmXFormController : public ::comphelper::OBaseMutex ,public ::cppu::OPropertySetHelper ,public FmDispatchInterceptor ,public ::comphelper::OAggregationArrayUsageHelper< FmXFormController> + ,public ::svxform::OSQLParserClient { friend class FmXPageViewWinRec; @@ -337,7 +341,6 @@ class FmXFormController : public ::comphelper::OBaseMutex ::form::OImplementationIdsRef m_aHoldImplIdHelper; Timer m_aInsertTimer; - connectivity::OSQLParser m_aParser; FmFormView* m_pView; Window* m_pWindow; diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx index 0fa03c227294..0a4539b258d0 100644 --- a/svx/source/inc/fmshimp.hxx +++ b/svx/source/inc/fmshimp.hxx @@ -2,9 +2,9 @@ * * $RCSfile: fmshimp.hxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: vg $ $Date: 2001-05-22 13:36:47 $ + * last change: $Author: fs $ $Date: 2001-07-25 13:38:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -139,7 +139,9 @@ #ifndef _SVARRAY_HXX //autogen #include <svtools/svarray.hxx> #endif - +#ifndef SVX_DBTOOLSCLIENT_HXX +#include "dbtoolsclient.hxx" +#endif #ifndef _SFXLSTNER_HXX //autogen #include <svtools/lstner.hxx> #endif @@ -193,6 +195,9 @@ #ifndef _UTL_CONFIGITEM_HXX_ #include <unotools/configitem.hxx> #endif +#ifndef SVX_DBTOOLSCLIENT_HXX +#include "dbtoolsclient.hxx" +#endif SV_DECL_PTRARR(SdrObjArray, SdrObject*, 32, 16); // SV_DECL_OBJARR(FmFormArray, ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm>, 32, 16); @@ -294,6 +299,7 @@ typedef ::utl::ConfigItem FmXFormShell_CFGBASE; class FmXFormShell :public FmXFormShell_BASE ,public FmXFormShell_CFGBASE ,public FmDispatchInterceptor + ,public ::svxform::OStaticDataAccessTools { friend class FmFormShell; friend class FmFormView; diff --git a/svx/source/inc/fmtools.hxx b/svx/source/inc/fmtools.hxx index 07aea2b5b400..70bcdf3bb11c 100644 --- a/svx/source/inc/fmtools.hxx +++ b/svx/source/inc/fmtools.hxx @@ -2,9 +2,9 @@ * * $RCSfile: fmtools.hxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: fs $ $Date: 2001-07-23 10:42:27 $ + * last change: $Author: fs $ $Date: 2001-07-25 13:40:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -103,7 +103,9 @@ #ifndef _COM_SUN_STAR_SDBCX_XROWLOCATE_HPP_ #include <com/sun/star/sdbcx/XRowLocate.hpp> #endif - +#ifndef _COM_SUN_STAR_SDBC_XDATASOURCE_HPP_ +#include <com/sun/star/sdbc/XDataSource.hpp> +#endif #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include <com/sun/star/beans/XPropertySet.hpp> #endif @@ -205,6 +207,9 @@ #ifndef _SVX_FMPROP_HRC #include "fmprop.hrc" #endif +#ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_ +#include <com/sun/star/sdbc/XConnection.hpp> +#endif #ifndef _COM_SUN_STAR_IO_XOBJECTINPUTSTREAM_HPP_ #include <com/sun/star/io/XObjectInputStream.hpp> #endif @@ -257,29 +262,46 @@ #endif +class Window; + //================================================================== // allgemeine Typen //================================================================== // displaying a database exception for the user // display info about a simple ::com::sun::star::sdbc::SQLException -void displayException(const ::com::sun::star::sdbc::SQLException&, WinBits nStyle = WB_OK | WB_DEF_OK); +void displayException(const ::com::sun::star::sdbc::SQLException&, Window* _pParent = NULL); +void displayException(const ::com::sun::star::sdbc::SQLWarning&, Window* _pParent = NULL); +void displayException(const ::com::sun::star::sdb::SQLContext&, Window* _pParent = NULL); // display info about chained SQLExceptions -void displayException(const ::com::sun::star::sdb::SQLErrorEvent&, WinBits nStyle = WB_OK | WB_DEF_OK); - +void displayException(const ::com::sun::star::sdb::SQLErrorEvent&, Window* _pParent = NULL); // StringConversion -#define U(x) \ - ::rtl::OStringToOUString( x, RTL_TEXTENCODING_ASCII_US ) -#define S(aUniCode) \ - ::rtl::OUStringToOString(aUniCode, RTL_TEXTENCODING_ASCII_US) - namespace svxform { - // modes for the XModeSelector DECLARE_CONSTASCII_USTRING(DATA_MODE); DECLARE_CONSTASCII_USTRING(FILTER_MODE); + //------------------------------------------------------------------------------ + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > getRowsetConnection(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxRowSet) throw (::com::sun::star::uno::RuntimeException); + + //------------------------------------------------------------------------------ + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > getDatasourceConnection( + const ::rtl::OUString& _rDatasourceName, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB); + + //------------------------------------------------------------------------------ + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource > getDatasourceObject( + const ::rtl::OUString& _rDatasourceName, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB); + + //------------------------------------------------------------------------------ + sal_Bool canInsertRecords(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet); + + //------------------------------------------------------------------------------ + sal_Bool canUpdateRecords(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet); + + //------------------------------------------------------------------------------ + sal_Bool canDeleteRecords(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet); + } // namespace svxform diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx index c237e3e6df3b..90323a10fd0a 100644 --- a/svx/source/inc/gridcell.hxx +++ b/svx/source/inc/gridcell.hxx @@ -2,9 +2,9 @@ * * $RCSfile: gridcell.hxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: fs $ $Date: 2001-06-29 08:29:56 $ + * last change: $Author: fs $ $Date: 2001-07-25 13:38:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -104,12 +104,14 @@ #ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_ #include <com/sun/star/lang/XUnoTunnel.hpp> #endif - #ifndef _COMPHELPER_PROPERTY_MULTIPLEX_HXX_ #include <comphelper/propmultiplex.hxx> #endif -#ifndef _CONNECTIVITY_SQLPARSE_HXX -#include <connectivity/sqlparse.hxx> +#ifndef SVX_SQLPARSERCLIENT_HXX +#include "sqlparserclient.hxx" +#endif +#ifndef SVX_TYPECONVERSION_CLIENT_HXX +#include "typeconversionclient.hxx" #endif class DbCellControl; @@ -260,6 +262,8 @@ public: // benoetigt //================================================================== class DbCellControl + :public ::svxform::OTypeConversionClient + ,public ::svxform::OStaticDataAccessTools { protected: DbGridColumn& m_rColumn; @@ -476,10 +480,11 @@ public: }; //================================================================== -class DbFilterField : public DbCellControl +class DbFilterField + :public DbCellControl + ,public ::svxform::OSQLParserClient { - ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aValueList; - connectivity::OSQLParser m_aParser; + ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aValueList; XubString m_aText; Link m_aCommitLink; sal_Int16 m_nControlClass; |