diff options
Diffstat (limited to 'dbaccess/source/ui')
106 files changed, 1597 insertions, 1775 deletions
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index b87b7706d87f..20671471d863 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -80,159 +80,70 @@ #include <com/sun/star/document/XDocumentEventBroadcaster.hpp> /** === end UNO includes === **/ -#ifndef _TOOLS_DEBUG_HXX #include <tools/debug.hxx> -#endif -#ifndef TOOLS_DIAGNOSE_EX_H #include <tools/diagnose_ex.h> -#endif -#ifndef SVTOOLS_URIHELPER_HXX -#include <svtools/urihelper.hxx> -#endif -#ifndef _COMPHELPER_TYPES_HXX_ +#include <tools/string.hxx> + +#include <svl/urihelper.hxx> +#include <svl/filenotation.hxx> + +#include <svtools/svtreebx.hxx> +#include <svtools/transfer.hxx> +#include <svtools/cliplistener.hxx> +#include <svtools/svlbitm.hxx> +#include <svtools/insdlg.hxx> + +#include <comphelper/sequence.hxx> +#include <comphelper/uno3.hxx> +#include <comphelper/string.hxx> #include <comphelper/types.hxx> -#endif -#ifndef _COMPHELPER_INTERACTION_HXX_ #include <comphelper/interaction.hxx> -#endif -#ifndef COMPHELPER_COMPONENTCONTEXT_HXX #include <comphelper/componentcontext.hxx> -#endif -#ifndef _SV_MSGBOX_HXX + #include <vcl/msgbox.hxx> -#endif -#ifndef _VCL_STDTEXT_HXX #include <vcl/stdtext.hxx> -#endif -#ifndef _FILEDLGHELPER_HXX +#include <vcl/svapp.hxx> +#include <vcl/menu.hxx> +#include <vcl/lstbox.hxx> + +#include <unotools/pathoptions.hxx> +#include <unotools/tempfile.hxx> +#include <unotools/internaloptions.hxx> +#include <unotools/moduleoptions.hxx> +#include <unotools/historyoptions.hxx> + +#include <sfx2/mailmodelapi.hxx> #include <sfx2/filedlghelper.hxx> -#endif -#ifndef _CPPUHELPER_TYPEPROVIDER_HXX_ +#include <sfx2/docfilt.hxx> +#include <sfx2/QuerySaveDocument.hxx> + #include <cppuhelper/typeprovider.hxx> -#endif -#ifndef _CPPUHELPER_EXC_HLP_HXX_ #include <cppuhelper/exc_hlp.hxx> -#endif -#ifndef _CONNECTIVITY_DBTOOLS_HXX_ + #include <connectivity/dbtools.hxx> -#endif -#ifndef DBAUI_APPVIEW_HXX +#include <connectivity/dbexception.hxx> + +#include <svx/dbaexchange.hxx> +#include <svx/dbaobjectex.hxx> +#include <svx/svxdlg.hxx> + +#include <vos/mutex.hxx> + #include "AppView.hxx" -#endif -#ifndef DBACCESS_UI_BROWSER_ID_HXX #include "browserids.hxx" -#endif -#ifndef _DBAU_REGHELPER_HXX_ #include "dbu_reghelper.hxx" -#endif -#ifndef _DBU_APP_HRC_ #include "dbu_app.hrc" -#endif -#ifndef DBACCESS_SOURCE_UI_MISC_DEFAULTOBJECTNAMECHECK_HXX #include "defaultobjectnamecheck.hxx" -#endif -#ifndef _SV_MENU_HXX -#include <vcl/menu.hxx> -#endif -#ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX -#include <svtools/pathoptions.hxx> -#endif -#ifndef INCLUDED_SVTOOLS_INTERNALOPTIONS_HXX -#include <svtools/internaloptions.hxx> -#endif -#ifndef _COMPHELPER_UNO3_HXX_ -#include <comphelper/uno3.hxx> -#endif -#ifndef DBACCESS_DATABASE_OBJECT_VIEW_HXX #include "databaseobjectview.hxx" -#endif -#ifndef _SV_SVAPP_HXX //autogen -#include <vcl/svapp.hxx> -#endif -#ifndef _SVLBOXITM_HXX -#include <svtools/svlbitm.hxx> -#endif -#ifndef _DBAUI_LISTVIEWITEMS_HXX_ #include "listviewitems.hxx" -#endif - -#ifndef DBAUI_APPDETAILVIEW_HXX #include "AppDetailView.hxx" -#endif -#ifndef _DBAUI_LINKEDDOCUMENTS_HXX_ #include "linkeddocuments.hxx" -#endif -#ifndef _SV_LSTBOX_HXX -#include <vcl/lstbox.hxx> -#endif -#ifndef _DBHELPER_DBEXCEPTION_HXX_ -#include <connectivity/dbexception.hxx> -#endif -#ifndef _DBAUI_SQLMESSAGE_HXX_ #include "sqlmessage.hxx" -#endif -#ifndef _STRING_HXX -#include <tools/string.hxx> -#endif -#ifndef INCLUDED_SFX_MAILMODELAPI_HXX -#include <sfx2/mailmodelapi.hxx> -#endif -#ifndef INCLUDED_SVTOOLS_MODULEOPTIONS_HXX -#include <svtools/moduleoptions.hxx> -#endif -#ifndef _SVTREEBOX_HXX -#include <svtools/svtreebx.hxx> -#endif -#ifndef _TRANSFER_HXX -#include <svtools/transfer.hxx> -#endif -#ifndef _CLIPLISTENER_HXX -#include <svtools/cliplistener.hxx> -#endif -#ifndef _SVX_DBAEXCHANGE_HXX_ -#include <svx/dbaexchange.hxx> -#endif -#ifndef SVX_DBAOBJECTEX_HXX -#include <svx/dbaobjectex.hxx> -#endif -#ifndef DBAUI_TOOLS_HXX #include "UITools.hxx" -#endif -#ifndef _DBAUI_DSNTYPES_HXX_ #include "dsntypes.hxx" -#endif -#include <svx/svxdlg.hxx> -#include <svtools/insdlg.hxx> -#ifndef _UNOTOOLS_TEMPFILE_HXX -#include <unotools/tempfile.hxx> -#endif -#ifndef _DBA_DBACCESS_HELPID_HRC_ #include "dbaccess_helpid.hrc" -#endif -#ifndef DBAUI_DLGSAVE_HXX #include "dlgsave.hxx" -#endif -#ifndef _SFX_DOCFILT_HACK_HXX -#include <sfx2/docfilt.hxx> -#endif -#ifndef SFX_QUERYSAVEDOCUMENT_HXX -#include <sfx2/QuerySaveDocument.hxx> -#endif -#ifndef INCLUDED_SVTOOLS_HISTORYOPTIONS_HXX -#include <svtools/historyoptions.hxx> -#endif -#ifndef SVTOOLS_FILENOTATION_HXX_ -#include <svtools/filenotation.hxx> -#endif -#ifndef _COMPHELPER_SEQUENCE_HXX_ -#include <comphelper/sequence.hxx> -#endif -#ifndef _VOS_MUTEX_HXX_ -#include <vos/mutex.hxx> -#endif -#ifndef _DBACCESS_SLOTID_HRC_ #include "dbaccess_slotid.hrc" -#endif #include <algorithm> #include <functional> @@ -2955,8 +2866,7 @@ void SAL_CALL OApplicationController::removeSelectionChangeListener( const Refer case DatabaseObjectContainer::REPORTS: if ( eSelectedCategory != E_NONE ) throw IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "You cannot select different categories." ) ), - // TODO: resource + String(ModuleRes(RID_STR_NO_DIFF_CAT)), *this, sal_Int16( pObject - aSelectedObjects.getConstArray() ) ); eSelectedCategory = ( pObject->Type == DatabaseObjectContainer::TABLES ) ? E_TABLE @@ -2969,13 +2879,9 @@ void SAL_CALL OApplicationController::removeSelectionChangeListener( const Refer default: case DatabaseObjectContainer::DATA_SOURCE: { - ::rtl::OUStringBuffer aMessage; - aMessage.appendAscii( "Unsupported object type found (" ); - aMessage.append ( sal_Int32( pObject->Type ) ); - aMessage.appendAscii( ")." ); - // TODO: resource - throw IllegalArgumentException( - aMessage.makeStringAndClear(), *this, sal_Int16( pObject - aSelectedObjects.getConstArray() ) ); + ::rtl::OUString sMessage = String(ModuleRes( RID_STR_UNSUPPORTED_OBJECT_TYPE )); + ::comphelper::string::searchAndReplaceAsciiI( sMessage, "$type$", ::rtl::OUString::valueOf(sal_Int32( pObject->Type )) ); + throw IllegalArgumentException(sMessage, *this, sal_Int16( pObject - aSelectedObjects.getConstArray() )); } } } diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx index 2d39783cdb87..ed8c5a15dd89 100644 --- a/dbaccess/source/ui/app/AppControllerDnD.cxx +++ b/dbaccess/source/ui/app/AppControllerDnD.cxx @@ -204,7 +204,7 @@ #include <sfx2/filedlghelper.hxx> #endif #ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #endif #ifndef _SFX_DOCFILT_HACK_HXX #include <sfx2/docfilt.hxx> diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx index 0b1be1189bd4..a0f61642dbf0 100644 --- a/dbaccess/source/ui/app/AppControllerGen.cxx +++ b/dbaccess/source/ui/app/AppControllerGen.cxx @@ -545,7 +545,7 @@ void OApplicationController::previewChanged( sal_Int32 _nMode ) // // String sTitle = String(ModuleRes(STR_APP_TITLE)); // sName = sName + sTitle; -//#ifndef PRODUCT +//#ifdef DBG_UTIL // ::rtl::OUString aDefault; // sName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" [")); // sName += utl::Bootstrap::getBuildIdData( aDefault ); diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 50e357b687b8..fbc5b8d0c359 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -93,9 +93,6 @@ #ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include <toolkit/helper/vclunohelper.hxx> #endif -#ifndef _COM_SUN_STAR_UCB_XCONTENTCREATOR_HPP_ -#include <com/sun/star/ucb/XContentCreator.hpp> -#endif #ifndef _COM_SUN_STAR_UCB_XCOMMANDENVIRONMENT_HPP_ #include <com/sun/star/ucb/XCommandEnvironment.hpp> #endif @@ -256,7 +253,7 @@ namespace EnableInput(FALSE); return 0L; } - // ----------------------------------------------------------------------------- + // ----------------------------------------------------------------------------- void OTablePreviewWindow::DataChanged( const DataChangedEvent& rDCEvt ) { Window::DataChanged( rDCEvt ); @@ -268,7 +265,7 @@ namespace Invalidate(); } } - // ----------------------------------------------------------------------------- + // ----------------------------------------------------------------------------- void OTablePreviewWindow::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); @@ -634,13 +631,13 @@ sal_Bool OAppDetailPageHelper::isCutAllowed() // ----------------------------------------------------------------------------- sal_Bool OAppDetailPageHelper::isCopyAllowed() { - // int nPos = getVisibleControlIndex(); + //int nPos = getVisibleControlIndex(); return sal_True; } // ----------------------------------------------------------------------------- sal_Bool OAppDetailPageHelper::isPasteAllowed() { - // int nPos = getVisibleControlIndex(); + //int nPos = getVisibleControlIndex(); return sal_True; } // ----------------------------------------------------------------------------- @@ -658,6 +655,8 @@ void OAppDetailPageHelper::paste() // ----------------------------------------------------------------------------- bool OAppDetailPageHelper::isLeaf(SvLBoxEntry* _pEntry) const { + if ( !_pEntry ) + return false; sal_Int32 nEntryType = reinterpret_cast< sal_IntPtr >( _pEntry->GetUserData() ); if ( ( nEntryType == DatabaseObjectContainer::TABLES ) || ( nEntryType == DatabaseObjectContainer::CATALOG ) @@ -1099,8 +1098,8 @@ void OAppDetailPageHelper::Resize() ////////////////////////////////////////////////////////////////////// // Abmessungen parent window Size aOutputSize( GetOutputSize() ); - long nOutputWidth = aOutputSize.Width(); - long nOutputHeight = aOutputSize.Height(); + long nOutputWidth = aOutputSize.Width(); + long nOutputHeight = aOutputSize.Height(); Window* pWindow = getCurrentView(); if ( pWindow ) @@ -1115,12 +1114,12 @@ void OAppDetailPageHelper::Resize() String sText = m_aTBPreview.GetItemText(SID_DB_APP_DISABLE_PREVIEW); Size aTBSize = m_aTBPreview.CalcWindowSizePixel(); - m_aTBPreview.SetPosSizePixel( Point(nOutputWidth - aTBSize.getWidth(), 0 ), - aTBSize ); + m_aTBPreview.SetPosSizePixel(Point(nOutputWidth - aTBSize.getWidth(), 0 ), + aTBSize ); - m_aBorder.SetPosSizePixel( Point(nHalfOutputWidth + aFLSize.Width() + n6PPT, aTBSize.getHeight() + n6PPT ), - Size(nHalfOutputWidth - aFLSize.Width() - n6PPT, nOutputHeight - 2*n6PPT - aTBSize.getHeight()) ); - m_aPreview.SetPosSizePixel( Point(0,0),m_aBorder.GetSizePixel() ); + m_aBorder.SetPosSizePixel(Point(nHalfOutputWidth + aFLSize.Width() + n6PPT, aTBSize.getHeight() + n6PPT ), + Size(nHalfOutputWidth - aFLSize.Width() - n6PPT, nOutputHeight - 2*n6PPT - aTBSize.getHeight()) ); + m_aPreview.SetPosSizePixel(Point(0,0),m_aBorder.GetSizePixel() ); m_aDocumentInfo.SetPosSizePixel(Point(0,0),m_aBorder.GetSizePixel() ); m_pTablePreview->SetPosSizePixel(Point(0,0),m_aBorder.GetSizePixel() ); } @@ -1237,9 +1236,9 @@ void OAppDetailPageHelper::showPreview(const Reference< XContent >& _xContent) // Why the below code? It might have side effects, as the tree view needs to know // its current selection for other purposes than the preview, too. -// DBTreeListBox* pTreeView = getCurrentView(); -// if ( pTreeView ) -// pTreeView->clearCurrentSelection(); +// DBTreeListBox* pTreeView = getCurrentView(); +// if ( pTreeView ) +// pTreeView->clearCurrentSelection(); } } catch( const Exception& ) @@ -1386,7 +1385,7 @@ void OAppDetailPageHelper::DataChanged( const DataChangedEvent& rDCEvt ) { Window::DataChanged( rDCEvt ); - if ( (rDCEvt.GetType() == DATACHANGED_FONTS) || + if ( (rDCEvt.GetType() == DATACHANGED_FONTS) || (rDCEvt.GetType() == DATACHANGED_DISPLAY) || (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) || ((rDCEvt.GetType() == DATACHANGED_SETTINGS) && @@ -1445,9 +1444,9 @@ OPreviewWindow::OPreviewWindow(Window* _pParent) // ----------------------------------------------------------------------------- BOOL OPreviewWindow::ImplGetGraphicCenterRect( const Graphic& rGraphic, Rectangle& rResultRect ) const { - const Size aWinSize( GetOutputSizePixel() ); - Size aNewSize( LogicToPixel( rGraphic.GetPrefSize(), rGraphic.GetPrefMapMode() ) ); - BOOL bRet = FALSE; + const Size aWinSize( GetOutputSizePixel() ); + Size aNewSize( LogicToPixel( rGraphic.GetPrefSize(), rGraphic.GetPrefMapMode() ) ); + BOOL bRet = FALSE; if( aNewSize.Width() && aNewSize.Height() ) { @@ -1505,7 +1504,7 @@ void OPreviewWindow::DataChanged( const DataChangedEvent& rDCEvt ) Invalidate(); } } -// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- void OPreviewWindow::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.hxx b/dbaccess/source/ui/app/AppDetailPageHelper.hxx index 2481c8744913..6538de3a8e96 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.hxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.hxx @@ -66,7 +66,7 @@ #include <vcl/graph.hxx> #endif #ifndef _GRFMGR_HXX -#include <goodies/grfmgr.hxx> +#include <svtools/grfmgr.hxx> #endif #include "callbacks.hxx" #include <memory> diff --git a/dbaccess/source/ui/app/AppView.cxx b/dbaccess/source/ui/app/AppView.cxx index 1f9288bf489a..e8076eba2907 100644 --- a/dbaccess/source/ui/app/AppView.cxx +++ b/dbaccess/source/ui/app/AppView.cxx @@ -70,7 +70,7 @@ #include <com/sun/star/sdb/XQueriesSupplier.hpp> #endif #ifndef INCLUDED_SVTOOLS_SYSLOCALE_HXX -#include <svtools/syslocale.hxx> +#include <unotools/syslocale.hxx> #endif #ifndef DBAUI_TOOLS_HXX #include "UITools.hxx" @@ -106,7 +106,7 @@ #include "browserids.hxx" #endif #ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #endif #include "IApplicationController.hxx" diff --git a/dbaccess/source/ui/app/app.src b/dbaccess/source/ui/app/app.src index c913d16ebd2d..9aff7f73d992 100644 --- a/dbaccess/source/ui/app/app.src +++ b/dbaccess/source/ui/app/app.src @@ -469,3 +469,11 @@ String RID_STR_EMBEDDED_DATABASE { Text [ en-US ] = "Embedded database"; }; +String RID_STR_NO_DIFF_CAT +{ + Text [ en-US ] = "You cannot select different categories."; +}; +String RID_STR_UNSUPPORTED_OBJECT_TYPE +{ + Text [ en-US ] = "Unsupported object type found ($type$)."; +}; diff --git a/dbaccess/source/ui/app/dbu_app.hrc b/dbaccess/source/ui/app/dbu_app.hrc index 63aa923ce30f..5b4aee52304e 100644 --- a/dbaccess/source/ui/app/dbu_app.hrc +++ b/dbaccess/source/ui/app/dbu_app.hrc @@ -68,11 +68,12 @@ #define RID_STR_FORMS_HELP_TEXT_WIZARD RID_STR_APP_START + 29 #define RID_STR_REPORT_HELP_TEXT RID_STR_APP_START + 30 #define RID_STR_EMBEDDED_DATABASE RID_STR_APP_START + 31 - +#define RID_STR_NO_DIFF_CAT RID_STR_APP_START + 32 +#define RID_STR_UNSUPPORTED_OBJECT_TYPE RID_STR_APP_START + 33 // please adjust checking before insert new strings -#if RID_STR_EMBEDDED_DATABASE > RID_STR_APP_END +#if RID_STR_UNSUPPORTED_OBJECT_TYPE > RID_STR_APP_END #error Resource-Id Ueberlauf in #file, #line #endif diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index fdf79750aeb5..d20a518752db 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -32,187 +32,72 @@ #include "precompiled_dbaccess.hxx" -#ifndef _SBA_BWRCTRLR_HXX + +#include "browserids.hxx" #include "brwctrlr.hxx" -#endif -#ifndef _SBX_BRWVIEW_HXX #include "brwview.hxx" -#endif -#ifndef _OSL_MUTEX_HXX_ //autogen wg. MutexGuard -#include <osl/mutex.hxx> -#endif -#ifndef _SFXAPP_HXX //autogen wg. SFX_APP -#include <sfx2/app.hxx> -#endif -#ifndef _COM_SUN_STAR_UNO_TYPECLASS_HPP_ -#include <com/sun/star/uno/TypeClass.hpp> -#endif -#ifndef _DBAUI_SQLMESSAGE_HXX_ +#include "dbu_brw.hrc" +#include "dbustrings.hrc" +#include "queryfilter.hxx" +#include "queryorder.hxx" #include "sqlmessage.hxx" -#endif -#ifndef _COM_SUN_STAR_FORM_XFORMCONTROLLER_HPP_ -#include <com/sun/star/form/XFormController.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_COMMANDTYPE_HPP_ -#include <com/sun/star/sdb/CommandType.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBC_XROWSETLISTENER_HPP_ -#include <com/sun/star/sdbc/XRowSetListener.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_ -#include <com/sun/star/sdbc/XConnection.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBCX_XROWLOCATE_HPP_ -#include <com/sun/star/sdbcx/XRowLocate.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBC_XRESULTSETUPDATE_HPP_ -#include <com/sun/star/sdbc/XResultSetUpdate.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_XSQLERRORBROADCASTER_HPP_ -#include <com/sun/star/sdb/XSQLErrorBroadcaster.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_XSINGLESELECTQUERYCOMPOSER_HPP_ -#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XLOADABLE_HPP_ -#include <com/sun/star/form/XLoadable.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_SQLCONTEXT_HPP_ -#include <com/sun/star/sdb/SQLContext.hpp> -#endif -#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ + +/** === begin UNO includes === **/ #include <com/sun/star/beans/PropertyAttribute.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_FORMBUTTONTYPE_HPP_ +#include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/container/XNamed.hpp> #include <com/sun/star/form/FormButtonType.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XCHANGELISTENER_HPP_ -#include <com/sun/star/form/XChangeListener.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_FORMSUBMITENCODING_HPP_ #include <com/sun/star/form/FormSubmitEncoding.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_FORMSUBMITMETHOD_HPP_ #include <com/sun/star/form/FormSubmitMethod.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XSUBMITLISTENER_HPP_ -#include <com/sun/star/form/XSubmitListener.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XRESET_HPP_ -#include <com/sun/star/form/XReset.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XSUBMIT_HPP_ -#include <com/sun/star/form/XSubmit.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XAPPROVEACTIONBROADCASTER_HPP_ #include <com/sun/star/form/XApproveActionBroadcaster.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XCHANGEBROADCASTER_HPP_ +#include <com/sun/star/form/XBoundControl.hpp> #include <com/sun/star/form/XChangeBroadcaster.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XRESETLISTENER_HPP_ -#include <com/sun/star/form/XResetListener.hpp> -#endif -#ifndef _COM_SUN_STAR_UTIL_XCANCELLABLE_HPP_ -#include <com/sun/star/util/XCancellable.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XDATABASEPARAMETERBROADCASTER_HPP_ +#include <com/sun/star/form/XChangeListener.hpp> #include <com/sun/star/form/XDatabaseParameterBroadcaster.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XBOUNDCONTROL_HPP_ -#include <com/sun/star/form/XBoundControl.hpp> -#endif -#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_ -#include <com/sun/star/container/XNameContainer.hpp> -#endif -#ifndef _COM_SUN_STAR_CONTAINER_XNAMED_HPP_ -#include <com/sun/star/container/XNamed.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBCX_PRIVILEGE_HPP_ +#include <com/sun/star/form/XLoadable.hpp> +#include <com/sun/star/form/XReset.hpp> +#include <com/sun/star/form/XResetListener.hpp> +#include <com/sun/star/form/XSubmit.hpp> +#include <com/sun/star/form/XSubmitListener.hpp> +#include <com/sun/star/form/runtime/XFormController.hpp> +#include <com/sun/star/sdb/CommandType.hpp> +#include <com/sun/star/sdb/ErrorCondition.hpp> +#include <com/sun/star/sdb/ParametersRequest.hpp> +#include <com/sun/star/sdb/SQLContext.hpp> +#include <com/sun/star/sdb/XInteractionSupplyParameters.hpp> +#include <com/sun/star/sdb/XSQLErrorBroadcaster.hpp> +#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp> +#include <com/sun/star/sdbc/XConnection.hpp> +#include <com/sun/star/sdbc/XResultSetUpdate.hpp> +#include <com/sun/star/sdbc/XRowSetListener.hpp> +#include <com/sun/star/sdbc/XWarningsSupplier.hpp> #include <com/sun/star/sdbcx/Privilege.hpp> -#endif -#ifndef _CPPUHELPER_TYPEPROVIDER_HXX_ -#include <cppuhelper/typeprovider.hxx> -#endif -#ifndef _CPPUHELPER_EXC_HLP_HXX_ -#include <cppuhelper/exc_hlp.hxx> -#endif -#ifndef _SV_MSGBOX_HXX //autogen -#include <vcl/msgbox.hxx> -#endif -#ifndef _FMSEARCH_HXX -#include <svx/fmsearch.hxx> -#endif -#ifndef _SV_WAITOBJ_HXX -#include <vcl/waitobj.hxx> -#endif -#ifndef _TOOLS_COLOR_HXX -#include <tools/color.hxx> -#endif -#ifndef TOOLS_DIAGNOSE_EX_H -#include <tools/diagnose_ex.h> -#endif -#ifndef _COMPHELPER_SEQUENCE_HXX_ -#include <comphelper/sequence.hxx> -#endif -#ifndef _CONNECTIVITY_DBTOOLS_HXX_ -#include <connectivity/dbtools.hxx> -#endif -#ifndef _DBHELPER_DBEXCEPTION_HXX_ -#include <connectivity/dbexception.hxx> -#endif -#ifndef _CPPUHELPER_IMPLBASE2_HXX_ -#include <cppuhelper/implbase2.hxx> -#endif -#ifndef _DBU_BRW_HRC_ -#include "dbu_brw.hrc" -#endif -#ifndef _SFX_HRC -#include <sfx2/sfx.hrc> -#endif -#ifndef DBACCESS_UI_BROWSER_ID_HXX -#include "browserids.hxx" -#endif -#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC -#include "dbustrings.hrc" -#endif -#ifndef _COMPHELPER_INTERACTION_HXX_ +#include <com/sun/star/sdbcx/XRowLocate.hpp> +#include <com/sun/star/task/XInteractionHandler.hpp> +#include <com/sun/star/uno/TypeClass.hpp> +#include <com/sun/star/util/XCancellable.hpp> +/** === end UNO includes === **/ + +#include <comphelper/enumhelper.hxx> +#include <comphelper/extract.hxx> #include <comphelper/interaction.hxx> -#endif -#ifndef _DBHELPER_DBEXCEPTION_HXX_ +#include <comphelper/sequence.hxx> #include <connectivity/dbexception.hxx> -#endif -#ifndef CONNECTIVITY_SQLERROR_HXX +#include <connectivity/dbtools.hxx> #include <connectivity/sqlerror.hxx> -#endif -#ifndef _COMPHELPER_EXTRACT_HXX_ -#include <comphelper/extract.hxx> -#endif -#ifndef _COM_SUN_STAR_SDB_XINTERACTIONSUPPLYPARAMETERS_HPP_ -#include <com/sun/star/sdb/XInteractionSupplyParameters.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_PARAMETERSREQUEST_HPP_ -#include <com/sun/star/sdb/ParametersRequest.hpp> -#endif -#ifndef _COM_SUN_STAR_TASK_XINTERACTIONHANDLER_HPP_ -#include <com/sun/star/task/XInteractionHandler.hpp> -#endif -#ifndef INCLUDED_COM_SUN_STAR_SDBC_XWARNINGSSUPPLIER_HPP -#include <com/sun/star/sdbc/XWarningsSupplier.hpp> -#endif -#ifndef INCLUDED_COM_SUN_STAR_SDB_ERRORCONDITION_HPP -#include <com/sun/star/sdb/ErrorCondition.hpp> -#endif -#ifndef DBAUI_QUERYFILTER_HXX -#include "queryfilter.hxx" -#endif -#ifndef DBAUI_QUERYORDER_HXX -#include "queryorder.hxx" -#endif +#include <cppuhelper/exc_hlp.hxx> +#include <cppuhelper/implbase2.hxx> +#include <cppuhelper/typeprovider.hxx> +#include <osl/mutex.hxx> #include <rtl/logfile.hxx> - -#include <svx/svxdlg.hxx> //CHINA001 -//#include <svx/fmresids.hrc> //CHINA001 +#include <sfx2/app.hxx> +#include <sfx2/sfx.hrc> +#include <svx/fmsearch.hxx> +#include <svx/svxdlg.hxx> +#include <tools/color.hxx> +#include <tools/diagnose_ex.h> +#include <vcl/msgbox.hxx> +#include <vcl/waitobj.hxx> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::awt; @@ -280,12 +165,12 @@ void SAL_CALL OParameterContinuation::setParameters( const Sequence< PropertyVal //============================================================================== -// a helper class implementing a ::com::sun::star::form::XFormController, will be aggregated by SbaXDataBrowserController -// (we can't derive from ::com::sun::star::form::XFormController as it's base class is ::com::sun::star::awt::XTabController and the ::com::sun::star::awt::XTabController::getModel collides -// with the ::com::sun::star::frame::XController::getModel implemented in our base class SbaXDataBrowserController) +// a helper class implementing a runtime::XFormController, will be aggregated by SbaXDataBrowserController +// (we can't derive from XFormController as it's base class is XTabController and the XTabController::getModel collides +// with the XController::getModel implemented in our base class SbaXDataBrowserController) class SbaXDataBrowserController::FormControllerImpl - : public ::cppu::WeakAggImplHelper2< ::com::sun::star::form::XFormController, - ::com::sun::star::frame::XFrameActionListener> + : public ::cppu::WeakAggImplHelper2< ::com::sun::star::form::runtime::XFormController, + ::com::sun::star::frame::XFrameActionListener > { friend class SbaXDataBrowserController; ::cppu::OInterfaceContainerHelper m_aActivateListeners; @@ -294,12 +179,68 @@ class SbaXDataBrowserController::FormControllerImpl public: FormControllerImpl(SbaXDataBrowserController* pOwner); - // ::com::sun::star::form::XFormController + // XFormController + virtual ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormOperations > SAL_CALL getFormOperations() throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > SAL_CALL getCurrentControl(void) throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL addActivateListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormControllerListener > & l) throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL removeActivateListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormControllerListener > & l) throw( ::com::sun::star::uno::RuntimeException ); - - // ::com::sun::star::awt::XTabController + virtual void SAL_CALL addChildController( const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController >& _ChildController ) throw( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormControllerContext > SAL_CALL getContext() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setContext( const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormControllerContext >& _context ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler > SAL_CALL getInteractionHandler() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setInteractionHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _interactionHandler ) throw (::com::sun::star::uno::RuntimeException); + + // XChild, base of XFormController + virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); + + // XComponent, base of XFormController + virtual void SAL_CALL dispose( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + + // XIndexAccess, base of XFormController + virtual ::sal_Int32 SAL_CALL getCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + // XElementAccess, base of XIndexAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException); + + // XEnumerationAccess, base of XElementAccess + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration( ) throw (::com::sun::star::uno::RuntimeException); + + // XModifyBroadcaster, base of XFormController + virtual void SAL_CALL addModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + + // XConfirmDeleteBroadcaster, base of XFormController + virtual void SAL_CALL addConfirmDeleteListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XConfirmDeleteListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeConfirmDeleteListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XConfirmDeleteListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + + // XSQLErrorBroadcaster, base of XFormController + virtual void SAL_CALL addSQLErrorListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLErrorListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeSQLErrorListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLErrorListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); + + // XRowSetApproveBroadcaster, base of XFormController + virtual void SAL_CALL addRowSetApproveListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XRowSetApproveListener >& listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeRowSetApproveListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XRowSetApproveListener >& listener ) throw (::com::sun::star::uno::RuntimeException); + + // XDatabaseParameterBroadcaster2, base of XFormController + virtual void SAL_CALL addDatabaseParameterListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XDatabaseParameterListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeDatabaseParameterListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XDatabaseParameterListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + + // XDatabaseParameterBroadcaster, base of XDatabaseParameterBroadcaster2 + virtual void SAL_CALL addParameterListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XDatabaseParameterListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeParameterListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XDatabaseParameterListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + + // XModeSelector, base of XFormController + virtual void SAL_CALL setMode( const ::rtl::OUString& aMode ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getMode( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedModes( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL supportsMode( const ::rtl::OUString& aMode ) throw (::com::sun::star::uno::RuntimeException); + + // XTabController, base of XFormController virtual void SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabControllerModel > & Model) throw( ::com::sun::star::uno::RuntimeException ); virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabControllerModel > SAL_CALL getModel(void) throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL setContainer(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > & _Container) throw( ::com::sun::star::uno::RuntimeException ); @@ -310,10 +251,10 @@ public: virtual void SAL_CALL activateFirst(void) throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL activateLast(void) throw( ::com::sun::star::uno::RuntimeException ); - // ::com::sun::star::frame::XFrameActionListener + // XFrameActionListener virtual void SAL_CALL frameAction(const ::com::sun::star::frame::FrameActionEvent& aEvent) throw( ::com::sun::star::uno::RuntimeException ); - // ::com::sun::star::lang::XEventListener + // XEventListener virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException ); protected: @@ -340,6 +281,13 @@ SbaXDataBrowserController::FormControllerImpl::~FormControllerImpl() } //------------------------------------------------------------------ +Reference< runtime::XFormOperations > SAL_CALL SbaXDataBrowserController::FormControllerImpl::getFormOperations() throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::getFormOperations: not supported!" ); + return NULL; +} + +//------------------------------------------------------------------ Reference< ::com::sun::star::awt::XControl > SbaXDataBrowserController::FormControllerImpl::getCurrentControl(void) throw( RuntimeException ) { return m_pOwner->getBrowserView() ? m_pOwner->getBrowserView()->getGridControl() : Reference< ::com::sun::star::awt::XControl > (); @@ -358,6 +306,202 @@ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeActivateListe } //------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addChildController( const Reference< runtime::XFormController >& /*_ChildController*/ ) throw( RuntimeException, IllegalArgumentException ) +{ + // not supported + throw IllegalArgumentException( ::rtl::OUString(), *this, 1 ); +} + +//------------------------------------------------------------------ +Reference< runtime::XFormControllerContext > SAL_CALL SbaXDataBrowserController::FormControllerImpl::getContext() throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::getContext: no support!!" ); + return NULL; +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setContext( const Reference< runtime::XFormControllerContext >& /*_context*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::setContext: no support!!" ); +} + +//------------------------------------------------------------------ +Reference< XInteractionHandler > SAL_CALL SbaXDataBrowserController::FormControllerImpl::getInteractionHandler() throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::getInteractionHandler: no support!!" ); + return NULL; +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setInteractionHandler( const Reference< XInteractionHandler >& /*_interactionHandler*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::setInteractionHandler: no support!!" ); +} + +//------------------------------------------------------------------ +Reference< XInterface > SAL_CALL SbaXDataBrowserController::FormControllerImpl::getParent( ) throw (RuntimeException) +{ + // don't have any parent form controllers + return NULL; +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setParent( const Reference< XInterface >& /*Parent*/ ) throw (NoSupportException, RuntimeException) +{ + throw NoSupportException( ::rtl::OUString(), *this ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::dispose( ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::dispose: no, you do *not* want to do this!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addEventListener( const Reference< XEventListener >& /*xListener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addEventListener: no support!!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeEventListener( const Reference< XEventListener >& /*aListener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::removeEventListener: no support!!" ); +} + +//------------------------------------------------------------------ +::sal_Int32 SAL_CALL SbaXDataBrowserController::FormControllerImpl::getCount( ) throw (RuntimeException) +{ + // no sub controllers, never + return 0; +} + +//------------------------------------------------------------------ +Any SAL_CALL SbaXDataBrowserController::FormControllerImpl::getByIndex( ::sal_Int32 /*Index*/ ) throw (IndexOutOfBoundsException, WrappedTargetException, RuntimeException) +{ + // no sub controllers, never + throw IndexOutOfBoundsException( ::rtl::OUString(), *this ); +} + +//------------------------------------------------------------------ +Type SAL_CALL SbaXDataBrowserController::FormControllerImpl::getElementType( ) throw (RuntimeException) +{ + return ::cppu::UnoType< runtime::XFormController >::get(); +} + +//------------------------------------------------------------------ +::sal_Bool SAL_CALL SbaXDataBrowserController::FormControllerImpl::hasElements( ) throw (RuntimeException) +{ + // no sub controllers, never + return false; +} + +//------------------------------------------------------------------ +Reference< XEnumeration > SAL_CALL SbaXDataBrowserController::FormControllerImpl::createEnumeration( ) throw (RuntimeException) +{ + return new ::comphelper::OEnumerationByIndex( this ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addModifyListener( const Reference< XModifyListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addModifyListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeModifyListener( const Reference< XModifyListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::removeModifyListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addConfirmDeleteListener( const Reference< XConfirmDeleteListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addConfirmDeleteListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeConfirmDeleteListener( const Reference< XConfirmDeleteListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::removeConfirmDeleteListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addSQLErrorListener( const Reference< XSQLErrorListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addSQLErrorListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeSQLErrorListener( const Reference< XSQLErrorListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::removeSQLErrorListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addRowSetApproveListener( const Reference< XRowSetApproveListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addRowSetApproveListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeRowSetApproveListener( const Reference< XRowSetApproveListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::removeRowSetApproveListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addDatabaseParameterListener( const Reference< XDatabaseParameterListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addDatabaseParameterListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeDatabaseParameterListener( const Reference< XDatabaseParameterListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::removeDatabaseParameterListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addParameterListener( const Reference< XDatabaseParameterListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addParameterListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeParameterListener( const Reference< XDatabaseParameterListener >& /*_Listener*/ ) throw (RuntimeException) +{ + OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::removeParameterListener: no support!" ); +} + +//------------------------------------------------------------------ +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setMode( const ::rtl::OUString& _rMode ) throw (NoSupportException, RuntimeException) +{ + if ( !supportsMode( _rMode ) ) + throw NoSupportException(); +} + +//------------------------------------------------------------------ +::rtl::OUString SAL_CALL SbaXDataBrowserController::FormControllerImpl::getMode( ) throw (RuntimeException) +{ + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataMode" ) ); +} + +//------------------------------------------------------------------ +Sequence< ::rtl::OUString > SAL_CALL SbaXDataBrowserController::FormControllerImpl::getSupportedModes( ) throw (RuntimeException) +{ + Sequence< ::rtl::OUString > aModes(1); + aModes[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DataMode" ) ); + return aModes; +} + +//------------------------------------------------------------------ +::sal_Bool SAL_CALL SbaXDataBrowserController::FormControllerImpl::supportsMode( const ::rtl::OUString& aMode ) throw (RuntimeException) +{ + return aMode.compareToAscii( "DataMode" ) == 0; +} + +//------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setModel(const Reference< ::com::sun::star::awt::XTabControllerModel > & /*Model*/) throw( RuntimeException ) { OSL_ENSURE(sal_False, "SbaXDataBrowserController::FormControllerImpl::setModel : invalid call, can't change my model !"); @@ -465,19 +609,12 @@ Sequence< sal_Int8 > SAL_CALL SbaXDataBrowserController::getImplementationId( ) //------------------------------------------------------------------ Any SAL_CALL SbaXDataBrowserController::queryInterface(const Type& _rType) throw (RuntimeException) { - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::queryInterface" ); // check for our additional interfaces Any aRet = SbaXDataBrowserController_Base::queryInterface(_rType); - // check for the base controllers interfaces + // check for our aggregate (implementing the XFormController) if (!aRet.hasValue()) - { - // check for our aggregate (implementing the XFormController) - if (!aRet.hasValue()) - { - aRet = m_xFormControllerImpl->queryAggregation(_rType); - } - } + aRet = m_xFormControllerImpl->queryAggregation(_rType); // no more to offer return aRet; @@ -1207,16 +1344,6 @@ sal_Bool SbaXDataBrowserController::suspend(sal_Bool /*bSuspend*/) throw( Runtim // ----------------------------------------------------------------------- void SbaXDataBrowserController::disposing() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::disposing" ); - // and dispose the aggregate - if (m_xFormControllerImpl.is()) - { - Reference< XComponent > xAggComp; - m_xFormControllerImpl->queryAggregation(::getCppuType(&xAggComp)) >>= xAggComp; - if (xAggComp.is()) - xAggComp->dispose(); - } - // the base class SbaXDataBrowserController_Base::OGenericUnoController::disposing(); diff --git a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx index 16859283c9b7..51121b022e88 100644 --- a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx +++ b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx @@ -166,7 +166,7 @@ void SbaTableQueryBrowser::SelectionChanged() InvalidateFeature(ID_BROWSER_INSERTCONTENT); InvalidateFeature(ID_BROWSER_FORMLETTER); } // if ( !m_bShowMenu ) - InvalidateFeature(ID_BROWSER_COPY);
+ InvalidateFeature(ID_BROWSER_COPY); InvalidateFeature(ID_BROWSER_CUT); } //------------------------------------------------------------------------------ diff --git a/dbaccess/source/ui/browser/exsrcbrw.cxx b/dbaccess/source/ui/browser/exsrcbrw.cxx index 01475f549a14..da1b0968f2e9 100644 --- a/dbaccess/source/ui/browser/exsrcbrw.cxx +++ b/dbaccess/source/ui/browser/exsrcbrw.cxx @@ -43,9 +43,6 @@ #ifndef _COM_SUN_STAR_FORM_XGRIDCOLUMNFACTORY_HPP_ #include <com/sun/star/form/XGridColumnFactory.hpp> #endif -#ifndef _COM_SUN_STAR_FORM_XFORMCONTROLLER_HPP_ -#include <com/sun/star/form/XFormController.hpp> -#endif #ifndef _COM_SUN_STAR_FORM_XLOADABLE_HPP_ #include <com/sun/star/form/XLoadable.hpp> #endif diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index 9d81d9c47c86..dc2734a0414a 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -105,13 +105,13 @@ #include <tools/urlobj.hxx> #endif #ifndef SVTOOLS_URIHELPER_HXX -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #endif #ifndef _DBAUI_DATASOURCECONNECTOR_HXX_ #include "datasourceconnector.hxx" #endif #ifndef INCLUDED_SVTOOLS_MODULEOPTIONS_HXX -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> #endif #ifndef _COM_SUN_STAR_FRAME_FRAMESEARCHFLAG_HPP_ #include <com/sun/star/frame/FrameSearchFlag.hpp> diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 1ca1a737dfd2..46f6c576c022 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -121,7 +121,7 @@ #endif #ifndef _SFXINTITEM_HXX -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #endif #ifndef _SVX_ALGITEM_HXX //autogen @@ -137,19 +137,19 @@ #endif #ifndef _NUMUNO_HXX -#include <svtools/numuno.hxx> +#include <svl/numuno.hxx> #endif #ifndef _SFXITEMPOOL_HXX //autogen wg. SfxItemInfo -#include <svtools/itempool.hxx> +#include <svl/itempool.hxx> #endif #ifndef _SFXITEMSET_HXX //autogen wg. SfxItemSet -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #endif #ifndef _SFXRNGITEM_HXX -#include <svtools/rngitem.hxx> +#include <svl/rngitem.hxx> #endif #ifndef _SV_WAITOBJ_HXX @@ -160,7 +160,7 @@ #endif #ifndef _ZFORLIST_HXX -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #endif #ifndef _CPPUHELPER_QUERYINTERFACE_HXX_ #include <cppuhelper/queryinterface.hxx> @@ -985,13 +985,13 @@ void SbaGridControl::PreExecuteRowContextMenu(sal_uInt16 nRow, PopupMenu& rMenu) rMenu.SetHelpId(ID_BROWSER_ROWHEIGHT, aNewItems.GetHelpId(ID_BROWSER_ROWHEIGHT)); rMenu.InsertSeparator(nPos++); } // if (!IsReadOnlyDB()) -
- if ( GetSelectRowCount() > 0 )
- {
- rMenu.InsertItem(ID_BROWSER_COPY, aNewItems.GetItemText(SID_COPY), 0, nPos++);
- rMenu.SetHelpId(ID_BROWSER_COPY, aNewItems.GetHelpId(SID_COPY));
-
- rMenu.InsertSeparator(nPos++);
+ + if ( GetSelectRowCount() > 0 ) + { + rMenu.InsertItem(ID_BROWSER_COPY, aNewItems.GetItemText(SID_COPY), 0, nPos++); + rMenu.SetHelpId(ID_BROWSER_COPY, aNewItems.GetHelpId(SID_COPY)); + + rMenu.InsertSeparator(nPos++); } } @@ -1428,20 +1428,20 @@ void SbaGridControl::DoColumnDrag(sal_uInt16 nColumnPos) } // ----------------------------------------------------------------------- -void SbaGridControl::CopySelectedRowsToClipboard()
-{
- DBG_ASSERT( GetSelectRowCount() > 0, "SbaGridControl::CopySelectedRowsToClipboard: invalid call!" );
- implTransferSelectedRows( (sal_Int16)FirstSelectedRow(), true );
-}
-
-// -----------------------------------------------------------------------
-void SbaGridControl::DoRowDrag( sal_Int16 nRowPos )
-{
- implTransferSelectedRows( nRowPos, false );
-}
-
-// -----------------------------------------------------------------------
-void SbaGridControl::implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfClipboardFalseIfDrag )
+void SbaGridControl::CopySelectedRowsToClipboard() +{ + DBG_ASSERT( GetSelectRowCount() > 0, "SbaGridControl::CopySelectedRowsToClipboard: invalid call!" ); + implTransferSelectedRows( (sal_Int16)FirstSelectedRow(), true ); +} + +// ----------------------------------------------------------------------- +void SbaGridControl::DoRowDrag( sal_Int16 nRowPos ) +{ + implTransferSelectedRows( nRowPos, false ); +} + +// ----------------------------------------------------------------------- +void SbaGridControl::implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfClipboardFalseIfDrag ) { Reference< XPropertySet > xDataSource(getDataSource(), UNO_QUERY); DBG_ASSERT(xDataSource.is(), "SbaGridControl::implTransferSelectedRows : invalid data source !"); @@ -1478,8 +1478,8 @@ void SbaGridControl::implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfC ODataClipboard* pTransfer = new ODataClipboard(xDataSource, aSelectedRows,xRowSetClone, getServiceManager()); Reference< XTransferable > xEnsureDelete = pTransfer; - if ( _bTrueIfClipboardFalseIfDrag )
- pTransfer->CopyToClipboard( this );
+ if ( _bTrueIfClipboardFalseIfDrag ) + pTransfer->CopyToClipboard( this ); else pTransfer->StartDrag(this, DND_ACTION_COPY | DND_ACTION_LINK); } diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index aad25f1cd7ab..b63383e47c0e 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -77,6 +77,7 @@ #include <com/sun/star/sdb/SQLContext.hpp> #include <com/sun/star/sdb/XBookmarksSupplier.hpp> #include <com/sun/star/sdb/XCompletedConnection.hpp> +#include <com/sun/star/sdb/XDatabaseRegistrations.hpp> #include <com/sun/star/sdb/XDocumentDataSource.hpp> #include <com/sun/star/sdb/XParametersSupplier.hpp> #include <com/sun/star/sdb/XQueriesSupplier.hpp> @@ -109,14 +110,15 @@ #include <comphelper/sequence.hxx> #include <comphelper/types.hxx> #include <connectivity/dbexception.hxx> +#include <cppuhelper/exc_hlp.hxx> #include <cppuhelper/implbase2.hxx> #include <cppuhelper/typeprovider.hxx> #include <sfx2/app.hxx> #include <sfx2/dispatch.hxx> #include <sot/storage.hxx> -#include <svtools/filenotation.hxx> -#include <svtools/intitem.hxx> -#include <svtools/moduleoptions.hxx> +#include <svl/filenotation.hxx> +#include <svl/intitem.hxx> +#include <unotools/moduleoptions.hxx> #include <svtools/svlbitm.hxx> #include <svtools/svtreebx.hxx> #include <svx/algitem.hxx> @@ -197,25 +199,21 @@ void SafeRemovePropertyListener(const Reference< XPropertySet > & xSet, const :: //------------------------------------------------------------------------- ::rtl::OUString SAL_CALL SbaTableQueryBrowser::getImplementationName() throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getImplementationName" ); return getImplementationName_Static(); } //------------------------------------------------------------------------- ::comphelper::StringSequence SAL_CALL SbaTableQueryBrowser::getSupportedServiceNames() throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getSupportedServiceNames" ); return getSupportedServiceNames_Static(); } // ------------------------------------------------------------------------- ::rtl::OUString SbaTableQueryBrowser::getImplementationName_Static() throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getImplementationName_Static" ); return ::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.ODatasourceBrowser"); } //------------------------------------------------------------------------- ::comphelper::StringSequence SbaTableQueryBrowser::getSupportedServiceNames_Static() throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getSupportedServiceNames_Static" ); ::comphelper::StringSequence aSupported(1); aSupported.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdb.DataSourceBrowser"); return aSupported; @@ -223,7 +221,6 @@ void SafeRemovePropertyListener(const Reference< XPropertySet > & xSet, const :: //------------------------------------------------------------------------- Reference< XInterface > SAL_CALL SbaTableQueryBrowser::Create(const Reference<XMultiServiceFactory >& _rxFactory) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::Create" ); ::vos::OGuard aGuard(Application::GetSolarMutex()); return *(new SbaTableQueryBrowser(_rxFactory)); } @@ -246,7 +243,6 @@ SbaTableQueryBrowser::SbaTableQueryBrowser(const Reference< XMultiServiceFactory ,m_bInSuspend(sal_False) ,m_bEnableBrowser(sal_True) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::SbaTableQueryBrowser" ); DBG_CTOR(SbaTableQueryBrowser,NULL); } @@ -266,7 +262,6 @@ SbaTableQueryBrowser::~SbaTableQueryBrowser() //------------------------------------------------------------------------------ Any SAL_CALL SbaTableQueryBrowser::queryInterface(const Type& _rType) throw (RuntimeException) { - //RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::queryInterface" ); if ( _rType.equals( XScriptInvocationContext::static_type() ) ) { OSL_PRECOND( !!m_aDocScriptSupport, "SbaTableQueryBrowser::queryInterface: did not initialize this, yet!" ); @@ -284,7 +279,6 @@ Any SAL_CALL SbaTableQueryBrowser::queryInterface(const Type& _rType) throw (Run //------------------------------------------------------------------------------ Sequence< Type > SAL_CALL SbaTableQueryBrowser::getTypes( ) throw (RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getTypes" ); Sequence< Type > aTypes( ::comphelper::concatSequences( SbaXDataBrowserController::getTypes(), SbaTableQueryBrowser_Base::getTypes() @@ -308,7 +302,6 @@ Sequence< Type > SAL_CALL SbaTableQueryBrowser::getTypes( ) throw (RuntimeExcep //------------------------------------------------------------------------------ Sequence< sal_Int8 > SAL_CALL SbaTableQueryBrowser::getImplementationId( ) throw (RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getImplementationId" ); static ::cppu::OImplementationId * pId = 0; if (! pId) { @@ -325,7 +318,6 @@ Sequence< sal_Int8 > SAL_CALL SbaTableQueryBrowser::getImplementationId( ) thro //------------------------------------------------------------------------------ void SAL_CALL SbaTableQueryBrowser::disposing() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::disposing" ); ::vos::OGuard aGuard(Application::GetSolarMutex()); // doin' a lot of VCL stuff here -> lock the SolarMutex @@ -350,9 +342,15 @@ void SAL_CALL SbaTableQueryBrowser::disposing() implRemoveStatusListeners(); // remove the container listener from the database context - Reference< XContainer > xDatasourceContainer(m_xDatabaseContext, UNO_QUERY); - if (xDatasourceContainer.is()) - xDatasourceContainer->removeContainerListener(this); + try + { + Reference< XDatabaseRegistrations > xDatabaseRegistrations( m_xDatabaseContext, UNO_QUERY_THROW ); + xDatabaseRegistrations->removeDatabaseRegistrationsListener( this ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } // check out from all the objects we are listening // the frame @@ -364,23 +362,17 @@ void SAL_CALL SbaTableQueryBrowser::disposing() //------------------------------------------------------------------------------ sal_Bool SbaTableQueryBrowser::Construct(Window* pParent) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::Construct" ); - if (!SbaXDataBrowserController::Construct(pParent)) + if ( !SbaXDataBrowserController::Construct( pParent ) ) return sal_False; try { - Reference< XContainer > xDatasourceContainer(m_xDatabaseContext, UNO_QUERY); - if (xDatasourceContainer.is()) - xDatasourceContainer->addContainerListener(this); - else { - DBG_ERROR("SbaTableQueryBrowser::Construct: the DatabaseContext should allow us to be a listener!"); - } + Reference< XDatabaseRegistrations > xDatabaseRegistrations( m_xDatabaseContext, UNO_QUERY_THROW ); + xDatabaseRegistrations->addDatabaseRegistrationsListener( this ); // the collator for the string compares - m_xCollator = Reference< XCollator >(getORB()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.i18n.Collator")), UNO_QUERY); - if (m_xCollator.is()) - m_xCollator->loadDefaultCollator(Application::GetSettings().GetLocale(), 0); + m_xCollator = Reference< XCollator >( getORB()->createInstance(::rtl::OUString::createFromAscii( "com.sun.star.i18n.Collator" ) ), UNO_QUERY_THROW ); + m_xCollator->loadDefaultCollator( Application::GetSettings().GetLocale(), 0 ); } catch(Exception&) { @@ -433,7 +425,6 @@ sal_Bool SbaTableQueryBrowser::Construct(Window* pParent) // ------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::InitializeForm(const Reference< ::com::sun::star::sdbc::XRowSet > & _rxForm) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::InitializeForm" ); if(!m_pCurrentlyDisplayed) return sal_True; @@ -490,7 +481,6 @@ sal_Bool SbaTableQueryBrowser::InitializeForm(const Reference< ::com::sun::star: //------------------------------------------------------------------------------ void SbaTableQueryBrowser::initializePreviewMode() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::initializePreviewMode" ); if ( getBrowserView() && getBrowserView()->getVclControl() ) { getBrowserView()->getVclControl()->AlwaysEnableInput( FALSE ); @@ -509,7 +499,6 @@ void SbaTableQueryBrowser::initializePreviewMode() //------------------------------------------------------------------------------ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun::star::form::XFormComponent > & xGrid) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::InitializeGridModel" ); try { Reference< ::com::sun::star::form::XGridColumnFactory > xColFactory(xGrid, UNO_QUERY); @@ -633,6 +622,7 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun:: break; case DataType::LONGVARCHAR: + case DataType::CLOB: aInitialValues.push_back( NamedValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiLine" ) ), makeAny( (sal_Bool)sal_True ) ) ); // NO break! case DataType::BINARY: @@ -750,7 +740,6 @@ Reference<XPropertySet> getColumnHelper(SvLBoxEntry* _pCurrentlyDisplayed,const // ----------------------------------------------------------------------- void SbaTableQueryBrowser::transferChangedControlProperty(const ::rtl::OUString& _rProperty, const Any& _rNewValue) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::transferChangedControlProperty" ); if(m_pCurrentlyDisplayed) { DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(m_pCurrentlyDisplayed->GetUserData()); @@ -764,7 +753,6 @@ void SbaTableQueryBrowser::transferChangedControlProperty(const ::rtl::OUString& // ----------------------------------------------------------------------- void SbaTableQueryBrowser::propertyChange(const PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::propertyChange" ); SbaXDataBrowserController::propertyChange(evt); try @@ -873,7 +861,6 @@ void SbaTableQueryBrowser::propertyChange(const PropertyChangeEvent& evt) throw( // ----------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::suspend(sal_Bool bSuspend) throw( RuntimeException ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::suspend" ); vos::OGuard aSolarGuard( Application::GetSolarMutex() ); ::osl::MutexGuard aGuard( getMutex() ); if ( getView() && getView()->IsInModalMode() ) @@ -898,7 +885,6 @@ sal_Bool SbaTableQueryBrowser::suspend(sal_Bool bSuspend) throw( RuntimeExceptio // ------------------------------------------------------------------------- void SAL_CALL SbaTableQueryBrowser::statusChanged( const FeatureStateEvent& _rEvent ) throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::statusChanged" ); // search the external dispatcher causing this call Reference< XDispatch > xSource(_rEvent.Source, UNO_QUERY); ExternalFeaturesMap::iterator aLoop; @@ -953,7 +939,6 @@ void SAL_CALL SbaTableQueryBrowser::statusChanged( const FeatureStateEvent& _rEv // ------------------------------------------------------------------------- void SbaTableQueryBrowser::checkDocumentDataSource() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::checkDocumentDataSource" ); SvLBoxEntry* pDataSourceEntry = NULL; SvLBoxEntry* pContainerEntry = NULL; SvLBoxEntry* pObjectEntry = getObjectEntry( m_aDocumentDataSource, &pDataSourceEntry, &pContainerEntry, sal_False ); @@ -991,7 +976,6 @@ void SbaTableQueryBrowser::checkDocumentDataSource() // ------------------------------------------------------------------------- void SbaTableQueryBrowser::extractDescriptorProps(const ::svx::ODataAccessDescriptor& _rDescriptor, ::rtl::OUString& _rDataSource, ::rtl::OUString& _rCommand, sal_Int32& _rCommandType, sal_Bool& _rEscapeProcessing) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::extractDescriptorProps" ); _rDataSource = _rDescriptor.getDataSource(); if ( _rDescriptor.has(daCommand) ) _rDescriptor[daCommand] >>= _rCommand; @@ -1043,7 +1027,6 @@ namespace // ------------------------------------------------------------------------- String SbaTableQueryBrowser::getDataSourceAcessor( SvLBoxEntry* _pDataSourceEntry ) const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getDataSourceAcessor" ); DBG_ASSERT( _pDataSourceEntry, "SbaTableQueryBrowser::getDataSourceAcessor: invalid entry!" ); DBTreeListUserData* pData = static_cast< DBTreeListUserData* >( _pDataSourceEntry->GetUserData() ); @@ -1057,7 +1040,6 @@ SvLBoxEntry* SbaTableQueryBrowser::getObjectEntry(const ::rtl::OUString& _rDataS SvLBoxEntry** _ppDataSourceEntry, SvLBoxEntry** _ppContainerEntry, sal_Bool _bExpandAncestors, const SharedConnection& _rxConnection ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getObjectEntry" ); if (_ppDataSourceEntry) *_ppDataSourceEntry = NULL; if (_ppContainerEntry) @@ -1080,9 +1062,7 @@ SvLBoxEntry* SbaTableQueryBrowser::getObjectEntry(const ::rtl::OUString& _rDataS { // special case, the data source is a URL // add new entries to the list box model - Image a, b, c; // not interested in reusing them - String e, f; - implAddDatasource( _rDataSource, a, e, b, f, c, _rxConnection ); + implAddDatasource( _rDataSource, _rxConnection ); pDataSource = m_pTreeView->getListBox().GetEntryPosByName( sDisplayName, NULL, &aFilter ); DBG_ASSERT( pDataSource, "SbaTableQueryBrowser::getObjectEntry: hmm - did not find it again!" ); } @@ -1132,7 +1112,6 @@ SvLBoxEntry* SbaTableQueryBrowser::getObjectEntry(const ::svx::ODataAccessDescri SvLBoxEntry** _ppDataSourceEntry, SvLBoxEntry** _ppContainerEntry, sal_Bool _bExpandAncestors) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getObjectEntry" ); // extract the props from the descriptor ::rtl::OUString sDataSource; ::rtl::OUString sCommand; @@ -1146,7 +1125,6 @@ SvLBoxEntry* SbaTableQueryBrowser::getObjectEntry(const ::svx::ODataAccessDescri // ------------------------------------------------------------------------- void SbaTableQueryBrowser::connectExternalDispatches() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::connectExternalDispatches" ); Reference< XDispatchProvider > xProvider( getFrame(), UNO_QUERY ); DBG_ASSERT(xProvider.is(), "SbaTableQueryBrowser::connectExternalDispatches: no DispatchProvider !"); if (xProvider.is()) @@ -1213,7 +1191,6 @@ void SbaTableQueryBrowser::connectExternalDispatches() // ------------------------------------------------------------------------- void SbaTableQueryBrowser::implCheckExternalSlot( sal_uInt16 _nId ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::implCheckExternalSlot" ); if ( !m_xMainToolbar.is() ) return; @@ -1236,7 +1213,6 @@ void SbaTableQueryBrowser::implCheckExternalSlot( sal_uInt16 _nId ) // ------------------------------------------------------------------------- void SAL_CALL SbaTableQueryBrowser::disposing( const EventObject& _rSource ) throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::disposing" ); // our frame ? Reference< ::com::sun::star::frame::XFrame > xSourceFrame(_rSource.Source, UNO_QUERY); if (m_xCurrentFrameParent.is() && (xSourceFrame == m_xCurrentFrameParent)) @@ -1299,7 +1275,6 @@ void SAL_CALL SbaTableQueryBrowser::disposing( const EventObject& _rSource ) thr // ------------------------------------------------------------------------- void SbaTableQueryBrowser::implRemoveStatusListeners() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::implRemoveStatusListeners" ); // clear all old dispatches for ( ExternalFeaturesMap::const_iterator aLoop = m_aExternalFeatures.begin(); aLoop != m_aExternalFeatures.end(); @@ -1324,7 +1299,6 @@ void SbaTableQueryBrowser::implRemoveStatusListeners() // ------------------------------------------------------------------------- sal_Bool SAL_CALL SbaTableQueryBrowser::select( const Any& _rSelection ) throw (IllegalArgumentException, RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::select" ); ::vos::OGuard aGuard(Application::GetSolarMutex()); // doin' a lot of VCL stuff here -> lock the SolarMutex @@ -1354,7 +1328,6 @@ sal_Bool SAL_CALL SbaTableQueryBrowser::select( const Any& _rSelection ) throw ( // ------------------------------------------------------------------------- Any SAL_CALL SbaTableQueryBrowser::getSelection( ) throw (RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getSelection" ); Any aReturn; try @@ -1382,21 +1355,18 @@ Any SAL_CALL SbaTableQueryBrowser::getSelection( ) throw (RuntimeException) // ------------------------------------------------------------------------- void SAL_CALL SbaTableQueryBrowser::addSelectionChangeListener( const Reference< XSelectionChangeListener >& _rxListener ) throw (RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::addSelectionChangeListener" ); m_aSelectionListeners.addInterface(_rxListener); } // ------------------------------------------------------------------------- void SAL_CALL SbaTableQueryBrowser::removeSelectionChangeListener( const Reference< XSelectionChangeListener >& _rxListener ) throw (RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::removeSelectionChangeListener" ); m_aSelectionListeners.removeInterface(_rxListener); } // ------------------------------------------------------------------------- void SbaTableQueryBrowser::attachFrame(const Reference< ::com::sun::star::frame::XFrame > & _xFrame) throw( RuntimeException ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::attachFrame" ); implRemoveStatusListeners(); if (m_xCurrentFrameParent.is()) @@ -1441,7 +1411,6 @@ void SbaTableQueryBrowser::attachFrame(const Reference< ::com::sun::star::frame: // ------------------------------------------------------------------------- void SbaTableQueryBrowser::addModelListeners(const Reference< ::com::sun::star::awt::XControlModel > & _xGridControlModel) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::addModelListeners" ); SbaXDataBrowserController::addModelListeners(_xGridControlModel); Reference< XPropertySet > xSourceSet(_xGridControlModel, UNO_QUERY); if (xSourceSet.is()) @@ -1459,7 +1428,6 @@ void SbaTableQueryBrowser::addModelListeners(const Reference< ::com::sun::star:: // ------------------------------------------------------------------------- void SbaTableQueryBrowser::removeModelListeners(const Reference< ::com::sun::star::awt::XControlModel > & _xGridControlModel) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::removeModelListeners" ); SbaXDataBrowserController::removeModelListeners(_xGridControlModel); Reference< XPropertySet > xSourceSet(_xGridControlModel, UNO_QUERY); if (xSourceSet.is()) @@ -1475,7 +1443,6 @@ void SbaTableQueryBrowser::removeModelListeners(const Reference< ::com::sun::sta // ------------------------------------------------------------------------- void SbaTableQueryBrowser::RowChanged() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::RowChanged" ); if(getBrowserView()) { SbaGridControl* pControl = getBrowserView()->getVclControl(); @@ -1488,7 +1455,6 @@ void SbaTableQueryBrowser::RowChanged() // ------------------------------------------------------------------------- void SbaTableQueryBrowser::ColumnChanged() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::ColumnChanged" ); if(getBrowserView()) { SbaGridControl* pControl = getBrowserView()->getVclControl(); @@ -1500,7 +1466,6 @@ void SbaTableQueryBrowser::ColumnChanged() //------------------------------------------------------------------------------ void SbaTableQueryBrowser::AddColumnListener(const Reference< XPropertySet > & xCol) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::AddColumnListener" ); SbaXDataBrowserController::AddColumnListener(xCol); SafeAddPropertyListener(xCol, PROPERTY_WIDTH, static_cast<XPropertyChangeListener*>(this)); SafeAddPropertyListener(xCol, PROPERTY_HIDDEN, static_cast<XPropertyChangeListener*>(this)); @@ -1511,7 +1476,6 @@ void SbaTableQueryBrowser::AddColumnListener(const Reference< XPropertySet > & x //------------------------------------------------------------------------------ void SbaTableQueryBrowser::RemoveColumnListener(const Reference< XPropertySet > & xCol) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::RemoveColumnListener" ); SbaXDataBrowserController::RemoveColumnListener(xCol); SafeRemovePropertyListener(xCol, PROPERTY_WIDTH, static_cast<XPropertyChangeListener*>(this)); SafeRemovePropertyListener(xCol, PROPERTY_HIDDEN, static_cast<XPropertyChangeListener*>(this)); @@ -1522,7 +1486,6 @@ void SbaTableQueryBrowser::RemoveColumnListener(const Reference< XPropertySet > //------------------------------------------------------------------------------ void SbaTableQueryBrowser::criticalFail() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::criticalFail" ); SbaXDataBrowserController::criticalFail(); unloadAndCleanup( sal_False ); } @@ -1530,7 +1493,6 @@ void SbaTableQueryBrowser::criticalFail() //------------------------------------------------------------------------------ void SbaTableQueryBrowser::LoadFinished(sal_Bool _bWasSynch) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::LoadFinished" ); SbaXDataBrowserController::LoadFinished(_bWasSynch); m_sQueryCommand = ::rtl::OUString(); @@ -1552,7 +1514,6 @@ void SbaTableQueryBrowser::LoadFinished(sal_Bool _bWasSynch) //------------------------------------------------------------------------------ sal_Bool SbaTableQueryBrowser::getExternalSlotState( sal_uInt16 _nId ) const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getExternalSlotState" ); sal_Bool bEnabled = sal_False; ExternalFeaturesMap::const_iterator aPos = m_aExternalFeatures.find( _nId ); if ( ( m_aExternalFeatures.end() != aPos ) && aPos->second.xDispatcher.is() ) @@ -1563,7 +1524,6 @@ sal_Bool SbaTableQueryBrowser::getExternalSlotState( sal_uInt16 _nId ) const //------------------------------------------------------------------------------ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::GetState" ); FeatureState aReturn; // (disabled automatically) @@ -1765,7 +1725,6 @@ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const //------------------------------------------------------------------------------ void SbaTableQueryBrowser::Execute(sal_uInt16 nId, const Sequence< PropertyValue >& aArgs) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::Execute" ); switch (nId) { default: @@ -1951,12 +1910,20 @@ void SbaTableQueryBrowser::Execute(sal_uInt16 nId, const Sequence< PropertyValue break; } } + +// ------------------------------------------------------------------------- +void SbaTableQueryBrowser::implAddDatasource( const String& _rDataSourceName, const SharedConnection& _rxConnection ) +{ + Image a, b, c; + String d, e; + implAddDatasource( _rDataSourceName, a, d, b, e, c, _rxConnection ); +} + // ------------------------------------------------------------------------- void SbaTableQueryBrowser::implAddDatasource(const String& _rDbName, Image& _rDbImage, String& _rQueryName, Image& _rQueryImage, String& _rTableName, Image& _rTableImage, const SharedConnection& _rxConnection) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::implAddDatasource" ); vos::OGuard aGuard( Application::GetSolarMutex() ); // initialize the names/images if necessary if (!_rQueryName.Len()) @@ -2010,7 +1977,6 @@ void SbaTableQueryBrowser::implAddDatasource(const String& _rDbName, Image& _rDb // ------------------------------------------------------------------------- void SbaTableQueryBrowser::initializeTreeModel() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::initializeTreeModel" ); if (m_xDatabaseContext.is()) { Image aDBImage, aQueriesImage, aTablesImage; @@ -2029,7 +1995,6 @@ sal_Bool SbaTableQueryBrowser::populateTree(const Reference<XNameAccess>& _xName SvLBoxEntry* _pParent, EntryType _eEntryType) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::populateTree" ); DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(_pParent->GetUserData()); if(pData) // don't ask if the nameaccess is already set see OnExpandEntry views and tables pData->xContainer = _xNameAccess; @@ -2060,7 +2025,6 @@ sal_Bool SbaTableQueryBrowser::populateTree(const Reference<XNameAccess>& _xName //------------------------------------------------------------------------------ void SbaTableQueryBrowser::implAppendEntry( SvLBoxEntry* _pParent, const String& _rName, void* _pUserData, EntryType _eEntryType ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::implAppendEntry" ); ::std::auto_ptr< ImageProvider > pImageProvider( getImageProviderFor( _pParent ) ); Image aImage, aImageHC; @@ -2077,7 +2041,6 @@ void SbaTableQueryBrowser::implAppendEntry( SvLBoxEntry* _pParent, const String& //------------------------------------------------------------------------------ IMPL_LINK(SbaTableQueryBrowser, OnExpandEntry, SvLBoxEntry*, _pParent) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::OnExpandEntry" ); if (_pParent->HasChilds()) // nothing to to ... return 1L; @@ -2180,7 +2143,6 @@ IMPL_LINK(SbaTableQueryBrowser, OnExpandEntry, SvLBoxEntry*, _pParent) //------------------------------------------------------------------------------ sal_Bool SbaTableQueryBrowser::ensureEntryObject( SvLBoxEntry* _pEntry ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::ensureEntryObject" ); DBG_ASSERT(_pEntry, "SbaTableQueryBrowser::ensureEntryObject: invalid argument!"); if (!_pEntry) return sal_False; @@ -2240,7 +2202,6 @@ sal_Bool SbaTableQueryBrowser::ensureEntryObject( SvLBoxEntry* _pEntry ) //------------------------------------------------------------------------------ sal_Bool SbaTableQueryBrowser::implSelect(const ::svx::ODataAccessDescriptor& _rDescriptor,sal_Bool _bSelectDirect) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::implSelect(_rDescriptor,_bSelectDirect)" ); // extract the props ::rtl::OUString sDataSource; ::rtl::OUString sCommand; @@ -2256,7 +2217,6 @@ sal_Bool SbaTableQueryBrowser::implSelect(const ::svx::ODataAccessDescriptor& _r sal_Bool SbaTableQueryBrowser::implLoadAnything(const ::rtl::OUString& _rDataSourceName, const ::rtl::OUString& _rCommand, const sal_Int32 _nCommandType, const sal_Bool _bEscapeProcessing, const SharedConnection& _rxConnection) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::implLoadAnything" ); Reference<XPropertySet> xProp(getRowSet(),UNO_QUERY); if(xProp.is()) { @@ -2274,8 +2234,6 @@ sal_Bool SbaTableQueryBrowser::implLoadAnything(const ::rtl::OUString& _rDataSou xProp->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, ::cppu::bool2any(_bEscapeProcessing)); if ( m_bPreview ) { - // this be undone by the grid control in DbGridControl::RecalcRows - // xProp->setPropertyValue(PROPERTY_FETCHSIZE, makeAny(sal_Int32(20))); xProp->setPropertyValue(PROPERTY_FETCHDIRECTION, makeAny(FetchDirection::FORWARD)); } @@ -2310,21 +2268,24 @@ sal_Bool SbaTableQueryBrowser::implLoadAnything(const ::rtl::OUString& _rDataSou InvalidateAll(); return bSuccess; } - catch(SQLException& e) + catch( const SQLException& e ) { - showError(SQLExceptionInfo(e)); + Any aException( ::cppu::getCaughtException() ); + showError( SQLExceptionInfo( aException ) ); } - catch(WrappedTargetException& e) + catch( const WrappedTargetException& e ) { SQLException aSql; - if(e.TargetException >>= aSql) - showError(SQLExceptionInfo(aSql)); + if ( e.TargetException.isExtractableTo( ::cppu::UnoType< SQLException >::get() ) ) + showError( SQLExceptionInfo( e.TargetException ) ); else - OSL_ENSURE(sal_False, "SbaTableQueryBrowser::implLoadAnything: something strange happended!"); + { + DBG_UNHANDLED_EXCEPTION(); + } } catch(Exception&) { - OSL_ENSURE(sal_False, "SbaTableQueryBrowser::implLoadAnything: something strange happended!"); + DBG_UNHANDLED_EXCEPTION(); } } @@ -2338,7 +2299,6 @@ sal_Bool SbaTableQueryBrowser::implSelect(const ::rtl::OUString& _rDataSourceNam const SharedConnection& _rxConnection ,sal_Bool _bSelectDirect) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::implSelect(_rDataSourceName,_rCommand,...)" ); if (_rDataSourceName.getLength() && _rCommand.getLength() && (-1 != _nCommandType)) { SvLBoxEntry* pDataSource = NULL; @@ -2387,7 +2347,6 @@ IMPL_LINK(SbaTableQueryBrowser, OnSelectionChange, void*, /*NOINTERESTEDIN*/) //------------------------------------------------------------------------------ bool SbaTableQueryBrowser::implSelect( SvLBoxEntry* _pEntry ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::implSelect(_pEntry)" ); if ( !_pEntry ) return false; @@ -2581,7 +2540,6 @@ bool SbaTableQueryBrowser::implSelect( SvLBoxEntry* _pEntry ) // ----------------------------------------------------------------------------- SvLBoxEntry* SbaTableQueryBrowser::getEntryFromContainer(const Reference<XNameAccess>& _rxNameAccess) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getEntryFromContainer" ); DBTreeListBox& rListBox = m_pTreeView->getListBox(); SvLBoxEntry* pContainer = NULL; SvLBoxEntry* pDSLoop = rListBox.FirstChild(NULL); @@ -2606,7 +2564,6 @@ SvLBoxEntry* SbaTableQueryBrowser::getEntryFromContainer(const Reference<XNameAc // ------------------------------------------------------------------------- void SAL_CALL SbaTableQueryBrowser::elementInserted( const ContainerEvent& _rEvent ) throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::elementInserted" ); vos::OGuard aSolarGuard( Application::GetSolarMutex() ); Reference< XNameAccess > xNames(_rEvent.Source, UNO_QUERY); @@ -2638,24 +2595,12 @@ void SAL_CALL SbaTableQueryBrowser::elementInserted( const ContainerEvent& _rEve } implAppendEntry( pEntry, ::comphelper::getString( _rEvent.Accessor ), pNewData, pNewData->eType ); } - else if (xNames.get() == m_xDatabaseContext.get()) - { // a new datasource has been added to the context - // the name of the new ds - ::rtl::OUString sNewDS; - _rEvent.Accessor >>= sNewDS; - - // add new entries to the list box model - Image a, b, c; // not interested in reusing them - String e, f; - implAddDatasource( sNewDS, a, e, b, f, c, SharedConnection() ); - } else SbaXDataBrowserController::elementInserted(_rEvent); } // ------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::isCurrentlyDisplayedChanged(const String& _sName,SvLBoxEntry* _pContainer) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::isCurrentlyDisplayedChanged" ); return m_pCurrentlyDisplayed && getEntryType(m_pCurrentlyDisplayed) == getChildType(_pContainer) && m_pTreeView->getListBox().GetParent(m_pCurrentlyDisplayed) == _pContainer @@ -2664,7 +2609,6 @@ sal_Bool SbaTableQueryBrowser::isCurrentlyDisplayedChanged(const String& _sName, // ------------------------------------------------------------------------- void SAL_CALL SbaTableQueryBrowser::elementRemoved( const ContainerEvent& _rEvent ) throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::elementRemoved" ); ::vos::OGuard aSolarGuard(Application::GetSolarMutex()); Reference< XNameAccess > xNames(_rEvent.Source, UNO_QUERY); @@ -2711,62 +2655,6 @@ void SAL_CALL SbaTableQueryBrowser::elementRemoved( const ContainerEvent& _rEven // maybe the object which is part of the document data source has been removed checkDocumentDataSource(); } - else if (xNames.get() == m_xDatabaseContext.get()) - { // a datasource has been removed from the context - - // the name - ::rtl::OUString sNewDS; - _rEvent.Accessor >>= sNewDS; - String sNewDatasource = sNewDS; - - // get the top-level representing the removed data source - SvLBoxEntry* pDSLoop = m_pTreeView->getListBox().FirstChild(NULL); - while (pDSLoop) - { - if (m_pTreeView->getListBox().GetEntryText(pDSLoop) == sNewDatasource) - break; - - pDSLoop = m_pTreeView->getListBox().NextSibling(pDSLoop); - } - - if (pDSLoop) - { - if (isSelected(pDSLoop)) - { // a table or query belonging to the deleted data source is currently beeing displayed. - OSL_ENSURE(m_pTreeView->getListBox().GetRootLevelParent(m_pCurrentlyDisplayed) == pDSLoop, "SbaTableQueryBrowser::elementRemoved: inconsistence (1)!"); - unloadAndCleanup( sal_True ); - } - else - OSL_ENSURE( - (NULL == m_pCurrentlyDisplayed) - || (m_pTreeView->getListBox().GetRootLevelParent(m_pCurrentlyDisplayed) != pDSLoop), "SbaTableQueryBrowser::elementRemoved: inconsistence (2)!"); - - // look for user data to delete - SvTreeEntryList* pList = m_pTreeModel->GetChildList(pDSLoop); - if(pList) - { - SvLBoxEntry* pEntryLoop = static_cast<SvLBoxEntry*>(pList->First()); - while (pEntryLoop) - { - DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(pEntryLoop->GetUserData()); - pEntryLoop->SetUserData(NULL); - delete pData; - pEntryLoop = static_cast<SvLBoxEntry*>(pList->Next()); - } - } - // remove the entry. This should remove all children, too. - DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(pDSLoop->GetUserData()); - pDSLoop->SetUserData(NULL); - delete pData; - m_pTreeModel->Remove(pDSLoop); - } - else { - DBG_ERROR("SbaTableQueryBrowser::elementRemoved: unknown datasource name!"); - } - - // maybe the object which is part of the document data source has been removed - checkDocumentDataSource(); - } else SbaXDataBrowserController::elementRemoved(_rEvent); } @@ -2774,7 +2662,6 @@ void SAL_CALL SbaTableQueryBrowser::elementRemoved( const ContainerEvent& _rEven // ------------------------------------------------------------------------- void SAL_CALL SbaTableQueryBrowser::elementReplaced( const ContainerEvent& _rEvent ) throw(RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::elementReplaced" ); ::vos::OGuard aSolarGuard(Application::GetSolarMutex()); Reference< XNameAccess > xNames(_rEvent.Source, UNO_QUERY); @@ -2847,7 +2734,6 @@ void SAL_CALL SbaTableQueryBrowser::elementReplaced( const ContainerEvent& _rEve // ------------------------------------------------------------------------- void SbaTableQueryBrowser::impl_releaseConnection( SharedConnection& _rxConnection ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::impl_releaseConnection" ); // remove as event listener Reference< XComponent > xComponent( _rxConnection, UNO_QUERY ); if ( xComponent.is() ) @@ -2876,7 +2762,6 @@ void SbaTableQueryBrowser::impl_releaseConnection( SharedConnection& _rxConnecti // ------------------------------------------------------------------------- void SbaTableQueryBrowser::disposeConnection( SvLBoxEntry* _pDSEntry ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::disposeConnection" ); DBG_ASSERT( _pDSEntry, "SbaTableQueryBrowser::disposeConnection: invalid entry (NULL)!" ); DBG_ASSERT( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::disposeConnection: invalid entry (not top-level)!" ); @@ -2891,7 +2776,6 @@ void SbaTableQueryBrowser::disposeConnection( SvLBoxEntry* _pDSEntry ) // ------------------------------------------------------------------------- void SbaTableQueryBrowser::closeConnection(SvLBoxEntry* _pDSEntry,sal_Bool _bDisposeConnection) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::closeConnection" ); DBG_ASSERT(_pDSEntry, "SbaTableQueryBrowser::closeConnection: invalid entry (NULL)!"); DBG_ASSERT( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::closeConnection: invalid entry (not top-level)!"); @@ -2928,7 +2812,6 @@ void SbaTableQueryBrowser::closeConnection(SvLBoxEntry* _pDSEntry,sal_Bool _bDis // ------------------------------------------------------------------------- void SbaTableQueryBrowser::unloadAndCleanup( sal_Bool _bDisposeConnection ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::unloadAndCleanup" ); if (!m_pCurrentlyDisplayed) // nothing to do return; @@ -3016,7 +2899,6 @@ namespace // ------------------------------------------------------------------------- void SbaTableQueryBrowser::impl_initialize() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::impl_initialize" ); ::vos::OGuard aGuard(Application::GetSolarMutex()); // doin' a lot of VCL stuff here -> lock the SolarMutex @@ -3150,12 +3032,7 @@ void SbaTableQueryBrowser::impl_initialize() } } - Image aDBImage, aQueriesImage, aTablesImage; - String sQueriesName, sTablesName; - - implAddDatasource( sInitialDataSourceName, - aDBImage, sQueriesName, aQueriesImage, sTablesName, aTablesImage, xConnection - ); + implAddDatasource( sInitialDataSourceName, xConnection ); m_pTreeView->getListBox().Expand( m_pTreeView->getListBox().First() ); } else @@ -3196,14 +3073,12 @@ void SbaTableQueryBrowser::impl_initialize() // ------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::haveExplorer() const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::haveExplorer" ); return m_pTreeView && m_pTreeView->IsVisible(); } // ------------------------------------------------------------------------- void SbaTableQueryBrowser::hideExplorer() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::hideExplorer" ); if (!haveExplorer()) return; if (!getBrowserView()) @@ -3219,7 +3094,6 @@ void SbaTableQueryBrowser::hideExplorer() // ------------------------------------------------------------------------- void SbaTableQueryBrowser::showExplorer() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::showExplorer" ); if (haveExplorer()) return; @@ -3236,7 +3110,6 @@ void SbaTableQueryBrowser::showExplorer() // ----------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::ensureConnection(SvLBoxEntry* _pAnyEntry, SharedConnection& _rConnection) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::ensureConnection" ); SvLBoxEntry* pDSEntry = m_pTreeView->getListBox().GetRootLevelParent(_pAnyEntry); DBTreeListUserData* pDSData = pDSEntry @@ -3249,7 +3122,6 @@ sal_Bool SbaTableQueryBrowser::ensureConnection(SvLBoxEntry* _pAnyEntry, SharedC // ----------------------------------------------------------------------------- ::std::auto_ptr< ImageProvider > SbaTableQueryBrowser::getImageProviderFor( SvLBoxEntry* _pAnyEntry ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getImageProviderFor" ); ::std::auto_ptr< ImageProvider > pImageProvider( new ImageProvider ); SharedConnection xConnection; if ( getExistentConnectionFor( _pAnyEntry, xConnection ) ) @@ -3260,7 +3132,6 @@ sal_Bool SbaTableQueryBrowser::ensureConnection(SvLBoxEntry* _pAnyEntry, SharedC // ----------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::getExistentConnectionFor( SvLBoxEntry* _pAnyEntry, SharedConnection& _rConnection ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getExistentConnectionFor" ); SvLBoxEntry* pDSEntry = m_pTreeView->getListBox().GetRootLevelParent( _pAnyEntry ); DBTreeListUserData* pDSData = pDSEntry @@ -3275,7 +3146,6 @@ sal_Bool SbaTableQueryBrowser::getExistentConnectionFor( SvLBoxEntry* _pAnyEntry // ----------------------------------------------------------------------------- bool SbaTableQueryBrowser::impl_isDataSourceEntry( SvLBoxEntry* _pEntry ) const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::impl_isDataSourceEntry" ); return m_pTreeModel->GetRootLevelParent( _pEntry ) == _pEntry; } #endif @@ -3283,7 +3153,6 @@ bool SbaTableQueryBrowser::impl_isDataSourceEntry( SvLBoxEntry* _pEntry ) const // ----------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::ensureConnection( SvLBoxEntry* _pDSEntry, void* pDSData, SharedConnection& _rConnection ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::ensureConnection" ); DBG_ASSERT( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::ensureConnection: this entry does not denote a data source!" ); if(_pDSEntry) { @@ -3386,7 +3255,6 @@ IMPL_LINK( SbaTableQueryBrowser, OnTreeEntryCompare, const SvSortData*, _pSortDa // ----------------------------------------------------------------------------- void SbaTableQueryBrowser::implAdministrate( SvLBoxEntry* _pApplyTo ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::implAdministrate" ); OSL_PRECOND( _pApplyTo, "SbaTableQueryBrowser::implAdministrate: illegal entry!" ); if ( !_pApplyTo ) return; @@ -3444,7 +3312,6 @@ void SbaTableQueryBrowser::implAdministrate( SvLBoxEntry* _pApplyTo ) // ----------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::requestQuickHelp( const SvLBoxEntry* _pEntry, String& _rText ) const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::requestQuickHelp" ); const DBTreeListUserData* pData = static_cast< const DBTreeListUserData* >( _pEntry->GetUserData() ); if ( ( pData->eType == etDatasource ) && pData->sAccessor.Len() ) { @@ -3457,7 +3324,6 @@ sal_Bool SbaTableQueryBrowser::requestQuickHelp( const SvLBoxEntry* _pEntry, Str // ----------------------------------------------------------------------------- PopupMenu* SbaTableQueryBrowser::getContextMenu( Control& _rControl ) const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getContextMenu" ); OSL_PRECOND( &m_pTreeView->getListBox() == &_rControl, "SbaTableQueryBrowser::getContextMenu: where does this come from?" ); if ( &m_pTreeView->getListBox() != &_rControl ) @@ -3469,21 +3335,18 @@ PopupMenu* SbaTableQueryBrowser::getContextMenu( Control& _rControl ) const // ----------------------------------------------------------------------------- IController& SbaTableQueryBrowser::getCommandController() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getCommandController" ); return *this; } // ----------------------------------------------------------------------------- ::cppu::OInterfaceContainerHelper* SbaTableQueryBrowser::getContextMenuInterceptors() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getContextMenuInterceptors" ); return &m_aContextMenuInterceptors; } // ----------------------------------------------------------------------------- Any SbaTableQueryBrowser::getCurrentSelection( Control& _rControl ) const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getCurrentSelection" ); OSL_PRECOND( &m_pTreeView->getListBox() == &_rControl, "SbaTableQueryBrowser::getCurrentSelection: where does this come from?" ); @@ -3525,7 +3388,6 @@ Any SbaTableQueryBrowser::getCurrentSelection( Control& _rControl ) const // ----------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::implGetQuerySignature( ::rtl::OUString& _rCommand, sal_Bool& _bEscapeProcessing ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::implGetQuerySignature" ); _rCommand = ::rtl::OUString(); _bEscapeProcessing = sal_False; @@ -3574,7 +3436,6 @@ sal_Bool SbaTableQueryBrowser::implGetQuerySignature( ::rtl::OUString& _rCommand //------------------------------------------------------------------------------ void SbaTableQueryBrowser::frameAction(const ::com::sun::star::frame::FrameActionEvent& aEvent) throw( RuntimeException ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::frameAction" ); if (aEvent.Frame == m_xCurrentFrameParent) { if(aEvent.Action == FrameAction_COMPONENT_DETACHING) @@ -3589,7 +3450,6 @@ void SbaTableQueryBrowser::frameAction(const ::com::sun::star::frame::FrameActio // ----------------------------------------------------------------------------- void SbaTableQueryBrowser::clearGridColumns(const Reference< XNameContainer >& _xColContainer) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::clearGridColumns" ); // first we have to clear the grid Sequence< ::rtl::OUString > aNames = _xColContainer->getElementNames(); const ::rtl::OUString* pIter = aNames.getConstArray(); @@ -3605,7 +3465,6 @@ void SbaTableQueryBrowser::clearGridColumns(const Reference< XNameContainer >& _ // ----------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::isHiContrast() const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::isHiContrast" ); sal_Bool bRet = sal_False; if ( m_pTreeView ) bRet = m_pTreeView->getListBox().GetSettings().GetStyleSettings().GetHighContrastMode(); @@ -3614,7 +3473,6 @@ sal_Bool SbaTableQueryBrowser::isHiContrast() const // ----------------------------------------------------------------------------- void SbaTableQueryBrowser::loadMenu(const Reference< XFrame >& _xFrame) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::loadMenu" ); if ( m_bShowMenu ) { OGenericUnoController::loadMenu(_xFrame); @@ -3636,7 +3494,6 @@ void SbaTableQueryBrowser::loadMenu(const Reference< XFrame >& _xFrame) // ----------------------------------------------------------------------------- ::rtl::OUString SbaTableQueryBrowser::getPrivateTitle() const { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getPrivateTitle" ); ::rtl::OUString sTitle; if ( m_pCurrentlyDisplayed ) { @@ -3661,7 +3518,6 @@ void SbaTableQueryBrowser::loadMenu(const Reference< XFrame >& _xFrame) // ----------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::preReloadForm() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::preReloadForm" ); sal_Bool bIni = sal_False; if ( !m_pCurrentlyDisplayed ) { @@ -3690,7 +3546,6 @@ sal_Bool SbaTableQueryBrowser::preReloadForm() // ----------------------------------------------------------------------------- void SbaTableQueryBrowser::postReloadForm() { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::postReloadForm" ); InitializeGridModel(getFormComponent()); LoadFinished(sal_True); //updateTitle(); @@ -3699,7 +3554,6 @@ void SbaTableQueryBrowser::postReloadForm() //------------------------------------------------------------------------------ Reference< XEmbeddedScripts > SAL_CALL SbaTableQueryBrowser::getScriptContainer() throw (RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::getScriptContainer" ); // update our database document Reference< XModel > xDocument; try @@ -3726,7 +3580,6 @@ Reference< XEmbeddedScripts > SAL_CALL SbaTableQueryBrowser::getScriptContainer( //------------------------------------------------------------------------------ void SAL_CALL SbaTableQueryBrowser::registerContextMenuInterceptor( const Reference< XContextMenuInterceptor >& _Interceptor ) throw (RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::registerContextMenuInterceptor" ); if ( _Interceptor.is() ) m_aContextMenuInterceptors.addInterface( _Interceptor ); } @@ -3734,10 +3587,90 @@ void SAL_CALL SbaTableQueryBrowser::registerContextMenuInterceptor( const Refere //------------------------------------------------------------------------------ void SAL_CALL SbaTableQueryBrowser::releaseContextMenuInterceptor( const Reference< XContextMenuInterceptor >& _Interceptor ) throw (RuntimeException) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaTableQueryBrowser::releaseContextMenuInterceptor" ); - m_aContextMenuInterceptors.removeInterface( _Interceptor ); + if ( _Interceptor.is() ) + m_aContextMenuInterceptors.removeInterface( _Interceptor ); +} + +//------------------------------------------------------------------------------ +void SAL_CALL SbaTableQueryBrowser::registeredDatabaseLocation( const DatabaseRegistrationEvent& _Event ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( Application::GetSolarMutex() ); + implAddDatasource( _Event.Name, SharedConnection() ); } +//------------------------------------------------------------------------------ +void SbaTableQueryBrowser::impl_cleanupDataSourceEntry( const String& _rDataSourceName ) +{ + // get the top-level representing the removed data source + SvLBoxEntry* pDataSourceEntry = m_pTreeView->getListBox().FirstChild( NULL ); + while ( pDataSourceEntry ) + { + if ( m_pTreeView->getListBox().GetEntryText( pDataSourceEntry ) == _rDataSourceName ) + break; + + pDataSourceEntry = m_pTreeView->getListBox().NextSibling( pDataSourceEntry ); + } + + OSL_ENSURE( pDataSourceEntry, "SbaTableQueryBrowser::impl_cleanupDataSourceEntry: do not know this data source!" ); + if ( !pDataSourceEntry ) + return; + + if ( isSelected( pDataSourceEntry ) ) + { // a table or query belonging to the deleted data source is currently beeing displayed. + OSL_ENSURE( m_pTreeView->getListBox().GetRootLevelParent( m_pCurrentlyDisplayed ) == pDataSourceEntry, + "SbaTableQueryBrowser::impl_cleanupDataSourceEntry: inconsistence (1)!" ); + unloadAndCleanup( sal_True ); + } + else + OSL_ENSURE( + ( NULL == m_pCurrentlyDisplayed ) + || ( m_pTreeView->getListBox().GetRootLevelParent( m_pCurrentlyDisplayed ) != pDataSourceEntry ), + "SbaTableQueryBrowser::impl_cleanupDataSourceEntry: inconsistence (2)!"); + + // delete any user data of the child entries of the to-be-removed entry + SvTreeEntryList* pList = m_pTreeModel->GetChildList( pDataSourceEntry ); + if ( pList ) + { + SvLBoxEntry* pEntryLoop = static_cast<SvLBoxEntry*>( pList->First() ); + while ( pEntryLoop ) + { + DBTreeListUserData* pData = static_cast< DBTreeListUserData* >( pEntryLoop->GetUserData() ); + pEntryLoop->SetUserData( NULL ); + delete pData; + pEntryLoop = static_cast< SvLBoxEntry* >( pList->Next() ); + } + } + + // remove the entry + DBTreeListUserData* pData = static_cast< DBTreeListUserData* >( pDataSourceEntry->GetUserData() ); + pDataSourceEntry->SetUserData( NULL ); + delete pData; + m_pTreeModel->Remove( pDataSourceEntry ); +} + +//------------------------------------------------------------------------------ +void SAL_CALL SbaTableQueryBrowser::revokedDatabaseLocation( const DatabaseRegistrationEvent& _Event ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( Application::GetSolarMutex() ); + + impl_cleanupDataSourceEntry( _Event.Name ); + + // maybe the object which is part of the document data source has been removed + checkDocumentDataSource(); +} + +//------------------------------------------------------------------------------ +void SAL_CALL SbaTableQueryBrowser::changedDatabaseLocation( const DatabaseRegistrationEvent& _Event ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( Application::GetSolarMutex() ); + + // in case the data source was expanded, and connected, we need to clean it up + // for simplicity, just do as if the data source were completely removed and re-added + impl_cleanupDataSourceEntry( _Event.Name ); + implAddDatasource( _Event.Name, SharedConnection() ); +} + + // ......................................................................... } // namespace dbaui // ......................................................................... diff --git a/dbaccess/source/ui/control/ColumnControlWindow.cxx b/dbaccess/source/ui/control/ColumnControlWindow.cxx index 0b9da9cfd69e..c1331a69c10e 100644 --- a/dbaccess/source/ui/control/ColumnControlWindow.cxx +++ b/dbaccess/source/ui/control/ColumnControlWindow.cxx @@ -37,7 +37,7 @@ #include "FieldControls.hxx" #endif #ifndef INCLUDED_SVTOOLS_SYSLOCALE_HXX -#include <svtools/syslocale.hxx> +#include <unotools/syslocale.hxx> #endif #ifndef _CONNECTIVITY_DBTOOLS_HXX_ #include <connectivity/dbtools.hxx> diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 4d9e81bc1f83..735e8264840c 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -53,12 +53,12 @@ #include <svx/numfmtsh.hxx> #include <svx/svxids.hrc> #include <svx/algitem.hxx> -#include <svtools/itempool.hxx> -#define _ZFORLIST_DECLARE_TABLE // ohne das bekomme ich einen Compiler-Fehler in <svtools/zforlist.hxx> -#include <svtools/zforlist.hxx> -#include <svtools/rngitem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/numuno.hxx> +#include <svl/itempool.hxx> +#define _ZFORLIST_DECLARE_TABLE // ohne das bekomme ich einen Compiler-Fehler in <svl/zforlist.hxx> +#include <svl/zforlist.hxx> +#include <svl/rngitem.hxx> +#include <svl/intitem.hxx> +#include <svl/numuno.hxx> #include <svtools/transfer.hxx> #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/util/NumberFormat.hpp> @@ -1375,6 +1375,14 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr ) ActivateAggregate( tpFormat ); break; case DataType::BIT: + if ( pFieldType->aCreateParams.getLength() ) + { + DeactivateAggregate( tpFormat ); + DeactivateAggregate( tpTextLen ); + DeactivateAggregate( tpBoolDefault ); + break; + } + // run through case DataType::BOOLEAN: DeactivateAggregate( tpTextLen ); DeactivateAggregate( tpFormat ); @@ -1473,7 +1481,9 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr ) if( pBoolDefault ) { // wenn pRequired auf sal_True gesetzt ist, dann darf das sal_Bool Feld nicht den Eintrag <<keiner>> besitzen - String sDef = BoolStringUI(::comphelper::getString(pFieldDescr->GetControlDefault())); + ::rtl::OUString sValue; + pFieldDescr->GetControlDefault() >>= sValue; + String sDef = BoolStringUI(sValue); // sicher stellen das <<keiner>> nur vorhanden ist, wenn das Feld NULL sein darf if ( ( pFieldType.get() && !pFieldType->bNullable ) || !pFieldDescr->IsNullable() ) @@ -1667,8 +1677,7 @@ void OFieldDescControl::SaveData( OFieldDescription* pFieldDescr ) ::rtl::OUString sDefault; if (pDefault) { - if ( pDefault->GetSavedValue() != pDefault->GetText() ) - sDefault = pDefault->GetText(); + sDefault = pDefault->GetText(); } else if (pBoolDefault) { diff --git a/dbaccess/source/ui/control/charsetlistbox.cxx b/dbaccess/source/ui/control/charsetlistbox.cxx index c2c893ec8d1a..05c19378d407 100644 --- a/dbaccess/source/ui/control/charsetlistbox.cxx +++ b/dbaccess/source/ui/control/charsetlistbox.cxx @@ -36,8 +36,8 @@ /** === begin UNO includes === **/ /** === end UNO includes === **/ -#include <svtools/itemset.hxx> -#include <svtools/stritem.hxx> +#include <svl/itemset.hxx> +#include <svl/stritem.hxx> //........................................................................ namespace dbaui diff --git a/dbaccess/source/ui/control/opendoccontrols.cxx b/dbaccess/source/ui/control/opendoccontrols.cxx index 12c25ef58a87..136f51ffd76c 100644 --- a/dbaccess/source/ui/control/opendoccontrols.cxx +++ b/dbaccess/source/ui/control/opendoccontrols.cxx @@ -72,7 +72,7 @@ #include <vcl/help.hxx> #endif #ifndef INCLUDED_SVTOOLS_HISTORYOPTIONS_HXX -#include <svtools/historyoptions.hxx> +#include <unotools/historyoptions.hxx> #endif #ifndef _COMPHELPER_SEQUENCEASHASHMAP_HXX_ #include <comphelper/sequenceashashmap.hxx> @@ -81,7 +81,7 @@ #include <tools/urlobj.hxx> #endif #ifndef SVTOOLS_FILENOTATION_HXX -#include <svtools/filenotation.hxx> +#include <svl/filenotation.hxx> #endif //........................................................................ diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx index 61bc0882570f..3889d091f737 100644 --- a/dbaccess/source/ui/control/sqledit.cxx +++ b/dbaccess/source/ui/control/sqledit.cxx @@ -40,7 +40,7 @@ #include "undosqledit.hxx" #include "QueryDesignView.hxx" -#include <svtools/smplhint.hxx> +#include <svl/smplhint.hxx> ////////////////////////////////////////////////////////////////////////// // OSqlEdit @@ -67,8 +67,8 @@ OSqlEdit::OSqlEdit( OQueryTextView* pParent, WinBits nWinStyle ) : ImplSetFont(); // listen for change of Font and Color Settings - StartListening(m_SourceViewConfig); - StartListening(m_ColorConfig); + m_SourceViewConfig.AddListener( this ); + m_ColorConfig.AddListener(this); //#i97044# EnableFocusSelectionHide( FALSE ); @@ -80,8 +80,8 @@ OSqlEdit::~OSqlEdit() DBG_DTOR(OSqlEdit,NULL); if (m_timerUndoActionCreation.IsActive()) m_timerUndoActionCreation.Stop(); - EndListening(m_SourceViewConfig); - EndListening(m_ColorConfig); + m_SourceViewConfig.RemoveListener(this); + m_ColorConfig.RemoveListener(this); } //------------------------------------------------------------------------------ void OSqlEdit::KeyInput( const KeyEvent& rKEvt ) @@ -196,11 +196,11 @@ void OSqlEdit::startTimer() m_timerInvalidate.Start(); } -void OSqlEdit::Notify( SfxBroadcaster& rBC, const SfxHint& /*rHint*/ ) +void OSqlEdit::ConfigurationChanged( utl::ConfigurationBroadcaster* pOption, sal_uInt32 ) { - if (&rBC == &m_SourceViewConfig) + if ( pOption == &m_SourceViewConfig ) ImplSetFont(); - else if (&rBC == &m_ColorConfig) + else if ( pOption == &m_ColorConfig ) MultiLineEditSyntaxHighlight::UpdateData(); } diff --git a/dbaccess/source/ui/control/toolboxcontroller.cxx b/dbaccess/source/ui/control/toolboxcontroller.cxx index 86f5d02f5054..6a22d8303a29 100644 --- a/dbaccess/source/ui/control/toolboxcontroller.cxx +++ b/dbaccess/source/ui/control/toolboxcontroller.cxx @@ -73,7 +73,7 @@ #include <svtools/miscopt.hxx> #endif #ifndef INCLUDED_SVTOOLS_MODULEOPTIONS_HXX -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> #endif #ifndef TOOLS_DIAGNOSE_EX_H #include <tools/diagnose_ex.h> diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx index 1f7d45706391..256016d77dea 100644 --- a/dbaccess/source/ui/dlg/CollectionView.cxx +++ b/dbaccess/source/ui/dlg/CollectionView.cxx @@ -106,7 +106,7 @@ #include <com/sun/star/awt/XWindow.hpp> #endif #ifndef INCLUDED_SVTOOLS_VIEWOPTIONS_HXX -#include <svtools/viewoptions.hxx> +#include <unotools/viewoptions.hxx> #endif #ifndef _OSL_THREAD_H_ #include <osl/thread.h> diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index ba0925d224ad..bae7abb63fc8 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -45,25 +45,25 @@ #include "dbu_misc.hrc" #endif #ifndef _SFXITEMSET_HXX -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #endif #ifndef INCLUDED_SVTOOLS_MODULEOPTIONS_HXX -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> #endif #ifndef _SFX_FCONTNR_HXX #include <sfx2/fcontnr.hxx> #endif #ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #endif #ifndef _SFXSTRITEM_HXX -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #endif #ifndef _SFXENUMITEM_HXX -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #endif #ifndef _SFXINTITEM_HXX -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #endif #ifndef _DBAUI_DATASOURCEITEMS_HXX_ #include "dsitems.hxx" @@ -102,7 +102,7 @@ #include "dsselect.hxx" #endif #ifndef SVTOOLS_FILENOTATION_HXX_ -#include <svtools/filenotation.hxx> +#include <svl/filenotation.hxx> #endif #ifndef DBACCESS_SHARED_DBUSTRINGS_HRC #include "dbustrings.hrc" diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index db21de4d9a76..4bd644cc835b 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx @@ -44,22 +44,22 @@ #include "dsmeta.hxx" #endif #ifndef _SFXITEMSET_HXX -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #endif #ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #endif #ifndef _SFXSTRITEM_HXX -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #endif #ifndef _SFXENUMITEM_HXX -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #endif #ifndef _SFXINTITEM_HXX -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #endif #ifndef INCLUDED_SVTOOLS_MODULEOPTIONS_HXX -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> #endif #ifndef _DBAUI_DATASOURCEITEMS_HXX_ #include "dsitems.hxx" @@ -98,7 +98,7 @@ #include "dsselect.hxx" #endif #ifndef SVTOOLS_FILENOTATION_HXX_ -#include <svtools/filenotation.hxx> +#include <svl/filenotation.hxx> #endif #ifndef DBACCESS_SHARED_DBUSTRINGS_HRC #include "dbustrings.hrc" diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx index 6b22d79e4b18..867d5a7fed50 100644 --- a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx @@ -44,19 +44,19 @@ #include "dbu_dlg.hrc" #endif #ifndef _SFXITEMSET_HXX -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #endif #ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #endif #ifndef _SFXSTRITEM_HXX -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #endif #ifndef _SFXENUMITEM_HXX -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #endif #ifndef _SFXINTITEM_HXX -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #endif #ifndef _DBAUI_DATASOURCEITEMS_HXX_ #include "dsitems.hxx" @@ -98,7 +98,7 @@ #include "dsselect.hxx" #endif #ifndef SVTOOLS_FILENOTATION_HXX_ -#include <svtools/filenotation.hxx> +#include <svl/filenotation.hxx> #endif #ifndef DBACCESS_SHARED_DBUSTRINGS_HRC #include "dbustrings.hrc" diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index 759054d4495e..bb9e85d3871d 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -46,16 +46,16 @@ #include "dbadminsetup.hrc" #endif #ifndef _SFXITEMSET_HXX -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #endif #ifndef _SFXSTRITEM_HXX -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #endif #ifndef _SFXENUMITEM_HXX -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #endif #ifndef _SFXINTITEM_HXX -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #endif #ifndef _DBAUI_DATASOURCEITEMS_HXX_ #include "dsitems.hxx" @@ -74,7 +74,7 @@ #include <vcl/mnemonic.hxx> #endif #ifndef _SVTOOLS_CJKOPTIONS_HXX -#include <svtools/cjkoptions.hxx> +#include <svl/cjkoptions.hxx> #endif #include <jvmaccess/virtualmachine.hxx> #ifndef _CONNECTIVITY_COMMONTOOLS_HXX_ @@ -100,7 +100,7 @@ #include <com/sun/star/sdbc/XDriverAccess.hpp> #include "dbustrings.hrc" #ifndef SVTOOLS_FILENOTATION_HXX_ -#include <svtools/filenotation.hxx> +#include <svl/filenotation.hxx> #endif #include <unotools/localfilehelper.hxx> @@ -109,7 +109,7 @@ #include "finteraction.hxx" #include <connectivity/CommonTools.hxx> #include "dbaccess_helpid.hrc" -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <svtools/roadmapwizard.hxx> #include "TextConnectionHelper.hxx" diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index 28a9b83fca35..8b86519fa812 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -34,93 +34,41 @@ #include "DbAdminImpl.hxx" #include "dsmeta.hxx" -#ifndef _SFXPOOLITEM_HXX -#include <svtools/poolitem.hxx> -#endif -#ifndef _SFXITEMPOOL_HXX -#include <svtools/itempool.hxx> -#endif -#ifndef _SFXSTRITEM_HXX -#include <svtools/stritem.hxx> -#endif -#ifndef _SFXINTITEM_HXX -#include <svtools/intitem.hxx> -#endif -#ifndef _SFXENUMITEM_HXX -#include <svtools/eitem.hxx> -#endif -#ifndef _COMPHELPER_PROPERTY_HXX_ -#include <comphelper/property.hxx> -#endif -#ifndef _COMPHELPER_SEQUENCE_HXX_ -#include <comphelper/sequence.hxx> -#endif -#ifndef _SVTOOLS_LOGINDLG_HXX_ -#include <svtools/logindlg.hxx> -#endif -#ifndef _DBHELPER_DBEXCEPTION_HXX_ -#include <connectivity/dbexception.hxx> -#endif -#include <connectivity/DriversConfig.hxx> -#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ -#include <com/sun/star/beans/PropertyAttribute.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_SQLCONTEXT_HPP_ -#include <com/sun/star/sdb/SQLContext.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBC_XDRIVERACCESS_HPP_ -#include <com/sun/star/sdbc/XDriverAccess.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBC_XDRIVER_HPP_ -#include <com/sun/star/sdbc/XDriver.hpp> -#endif -#ifndef DBAUI_DRIVERSETTINGS_HXX #include "DriverSettings.hxx" -#endif -#ifndef _DBAUI_PROPERTYSETITEM_HXX_ -#include "propertysetitem.hxx" -#endif -#ifndef _DBAUI_DATASOURCEITEMS_HXX_ -#include "dsitems.hxx" -#endif -#ifndef DBAUI_ITEMSETHELPER_HXX #include "IItemSetHelper.hxx" -#endif -#ifndef _DBU_DLG_HRC_ +#include "UITools.hxx" #include "dbu_dlg.hrc" -#endif -#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC #include "dbustrings.hrc" -#endif -#ifndef _VCL_STDTEXT_HXX -#include <vcl/stdtext.hxx> -#endif -#ifndef _SV_MSGBOX_HXX -#include <vcl/msgbox.hxx> -#endif -#ifndef _SV_WAITOBJ_HXX -#include <vcl/waitobj.hxx> -#endif -#ifndef _TYPELIB_TYPEDESCRIPTION_HXX_ -#include <typelib/typedescription.hxx> -#endif - -#ifndef _OSL_FILE_HXX_ -#include <osl/file.hxx> -#endif -#ifndef _DBAUI_STRINGLISTITEM_HXX_ -#include "stringlistitem.hxx" -#endif -#ifndef _DBAUI_MODULE_DBU_HXX_ +#include "dsitems.hxx" +#include "dsnItem.hxx" #include "moduledbu.hxx" -#endif -#ifndef DBAUI_TOOLS_HXX -#include "UITools.hxx" -#endif -#ifndef _COM_SUN_STAR_FRAME_XSTORABLE_HPP_ +#include "optionalboolitem.hxx" +#include "propertysetitem.hxx" +#include "stringlistitem.hxx" + +/** === begin UNO includes === **/ +#include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/frame/XStorable.hpp> -#endif -#include "dsnItem.hxx" +#include <com/sun/star/sdb/SQLContext.hpp> +#include <com/sun/star/sdbc/XDriver.hpp> +#include <com/sun/star/sdbc/XDriverAccess.hpp> +/** === end UNO includes === **/ + +#include <comphelper/property.hxx> +#include <comphelper/sequence.hxx> +#include <connectivity/DriversConfig.hxx> +#include <connectivity/dbexception.hxx> +#include <osl/file.hxx> +#include <svl/eitem.hxx> +#include <svl/intitem.hxx> +#include <svl/itempool.hxx> +#include <svtools/logindlg.hxx> +#include <svl/poolitem.hxx> +#include <svl/stritem.hxx> +#include <typelib/typedescription.hxx> +#include <vcl/msgbox.hxx> +#include <vcl/stdtext.hxx> +#include <vcl/waitobj.hxx> #include <algorithm> #include <functional> @@ -231,6 +179,7 @@ ODbDataSourceAdministrationHelper::ODbDataSourceAdministrationHelper(const Refer m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_AS_BEFORE_CORRNAME, INFO_AS_BEFORE_CORRELATION_NAME ) ); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CHECK_REQUIRED_FIELDS, INFO_FORMS_CHECK_REQUIRED_FIELDS ) ); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_ESCAPE_DATETIME, INFO_ESCAPE_DATETIME ) ); + m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_PRIMARY_KEY_SUPPORT, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrimaryKeySupport" ) ) ) ); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_PARAMETERNAMESUBST, INFO_PARAMETERNAMESUBST)); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_IGNOREDRIVER_PRIV, INFO_IGNOREDRIVER_PRIV)); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_BOOLEANCOMPARISON, PROPERTY_BOOLEANCOMPARISONMODE)); @@ -909,14 +858,36 @@ Any ODbDataSourceAdministrationHelper::implTranslateProperty(const SfxPoolItem* { // translate the SfxPoolItem Any aValue; - if (_pItem->ISA(SfxStringItem)) - aValue <<= ::rtl::OUString(PTR_CAST(SfxStringItem, _pItem)->GetValue().GetBuffer()); - else if (_pItem->ISA(SfxBoolItem)) - aValue <<= PTR_CAST(SfxBoolItem, _pItem)->GetValue(); - else if (_pItem->ISA(SfxInt32Item)) - aValue <<= PTR_CAST(SfxInt32Item, _pItem)->GetValue(); - else if (_pItem->ISA(OStringListItem)) - aValue <<= PTR_CAST(OStringListItem, _pItem)->getList(); + + const SfxStringItem* pStringItem = PTR_CAST( SfxStringItem, _pItem ); + const SfxBoolItem* pBoolItem = PTR_CAST( SfxBoolItem, _pItem ); + const OptionalBoolItem* pOptBoolItem = PTR_CAST( OptionalBoolItem, _pItem ); + const SfxInt32Item* pInt32Item = PTR_CAST( SfxInt32Item, _pItem ); + const OStringListItem* pStringListItem = PTR_CAST( OStringListItem, _pItem ); + + if ( pStringItem ) + { + aValue <<= ::rtl::OUString( pStringItem->GetValue().GetBuffer() ); + } + else if ( pBoolItem ) + { + aValue <<= pBoolItem->GetValue(); + } + else if ( pOptBoolItem ) + { + if ( !pOptBoolItem->HasValue() ) + aValue.clear(); + else + aValue <<= (sal_Bool)pOptBoolItem->GetValue(); + } + else if ( pInt32Item ) + { + aValue <<= pInt32Item->GetValue(); + } + else if ( pStringListItem ) + { + aValue <<= pStringListItem->getList(); + } else { DBG_ERROR("ODbDataSourceAdministrationHelper::implTranslateProperty: unsupported item type!"); @@ -957,15 +928,14 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty(const Reference< X //------------------------------------------------------------------------- void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet, sal_Int32 _nId, const Any& _rValue ) { - USHORT nId = (USHORT)_nId; - switch (_rValue.getValueType().getTypeClass()) + switch ( _rValue.getValueType().getTypeClass() ) { case TypeClass_STRING: - if ( implCheckItemType( _rSet, nId, SfxStringItem::StaticType() ) ) + if ( implCheckItemType( _rSet, _nId, SfxStringItem::StaticType() ) ) { ::rtl::OUString sValue; _rValue >>= sValue; - _rSet.Put(SfxStringItem(nId, sValue.getStr())); + _rSet.Put(SfxStringItem(_nId, sValue.getStr())); } else { DBG_ERROR( @@ -978,11 +948,24 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet break; case TypeClass_BOOLEAN: - if ( implCheckItemType( _rSet, nId, SfxBoolItem::StaticType() ) ) + if ( implCheckItemType( _rSet, _nId, SfxBoolItem::StaticType() ) ) { sal_Bool bVal = sal_False; _rValue >>= bVal; - _rSet.Put(SfxBoolItem(nId, bVal)); + _rSet.Put(SfxBoolItem(_nId, bVal)); + } + else if ( implCheckItemType( _rSet, _nId, OptionalBoolItem::StaticType() ) ) + { + OptionalBoolItem aItem( _nId ); + if ( _rValue.hasValue() ) + { + sal_Bool bValue = sal_False; + _rValue >>= bValue; + aItem.SetValue( bValue ); + } + else + aItem.ClearValue(); + _rSet.Put( aItem ); } else { DBG_ERROR( @@ -995,11 +978,11 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet break; case TypeClass_LONG: - if ( implCheckItemType( _rSet, nId, SfxInt32Item::StaticType() ) ) + if ( implCheckItemType( _rSet, _nId, SfxInt32Item::StaticType() ) ) { sal_Int32 nValue = 0; _rValue >>= nValue; - _rSet.Put( SfxInt32Item( nId, nValue ) ); + _rSet.Put( SfxInt32Item( _nId, nValue ) ); } else { DBG_ERROR( @@ -1012,7 +995,7 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet break; case TypeClass_SEQUENCE: - if ( implCheckItemType( _rSet, nId, OStringListItem::StaticType() ) ) + if ( implCheckItemType( _rSet, _nId, OStringListItem::StaticType() ) ) { // determine the element type TypeDescription aTD(_rValue.getValueType()); @@ -1027,7 +1010,7 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet { Sequence< ::rtl::OUString > aStringList; _rValue >>= aStringList; - _rSet.Put(OStringListItem(nId, aStringList)); + _rSet.Put(OStringListItem(_nId, aStringList)); } break; default: @@ -1045,7 +1028,7 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet break; case TypeClass_VOID: - _rSet.ClearItem(nId); + _rSet.ClearItem(_nId); break; default: diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.hxx b/dbaccess/source/ui/dlg/DbAdminImpl.hxx index a194ebc7b23c..9794e6e21bfb 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.hxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.hxx @@ -59,12 +59,12 @@ #include "dsntypes.hxx" #endif #ifndef _SFXITEMSET_HXX -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #endif #ifndef _COM_SUN_STAR_FRAME_XMODEL_HPP_ #include <com/sun/star/frame/XModel.hpp> #endif -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> class Window; //......................................................................... diff --git a/dbaccess/source/ui/dlg/DriverSettings.cxx b/dbaccess/source/ui/dlg/DriverSettings.cxx index cf5d2edd65fc..4977658daeac 100644 --- a/dbaccess/source/ui/dlg/DriverSettings.cxx +++ b/dbaccess/source/ui/dlg/DriverSettings.cxx @@ -32,13 +32,13 @@ #include "precompiled_dbaccess.hxx" #include "DriverSettings.hxx" -#include "dsitems.hxx" -#include "datasourceui.hxx" -#include <connectivity/DriversConfig.hxx> +#include "dsmeta.hxx" #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/beans/NamedValue.hpp> +#include <connectivity/DriversConfig.hxx> + using ::com::sun::star::uno::Sequence; using ::com::sun::star::beans::NamedValue; @@ -47,34 +47,23 @@ void ODriversSettings::getSupportedIndirectSettings( const ::rtl::OUString& _sUR { // for a number of settings, we do not need to use hard-coded here, but can ask a // central DataSourceUI instance. - // TODO: isn't DataSourceUI obsolete, now that this is in the configuration? - DataSourceMetaData aMeta(_sURLPrefix); - DataSourceUI aDSUI( aMeta ); - const USHORT nGenericKnownSettings[] = + DataSourceMetaData aMeta( _sURLPrefix ); + const FeatureSet& rFeatures( aMeta.getFeatureSet() ); + for ( FeatureSet::const_iterator feature = rFeatures.begin(); + feature != rFeatures.end(); + ++feature + ) { - DSID_SQL92CHECK, - DSID_APPEND_TABLE_ALIAS, - DSID_AS_BEFORE_CORRNAME, - DSID_ENABLEOUTERJOIN, - DSID_IGNOREDRIVER_PRIV, - DSID_PARAMETERNAMESUBST, - DSID_SUPPRESSVERSIONCL, - DSID_CATALOG, - DSID_SCHEMA, - DSID_INDEXAPPENDIX, - DSID_CHECK_REQUIRED_FIELDS, - DSID_AUTORETRIEVEENABLED, - DSID_AUTOINCREMENTVALUE, - DSID_AUTORETRIEVEVALUE, - DSID_BOOLEANCOMPARISON, - DSID_ESCAPE_DATETIME, - 0 - }; - for ( const USHORT* pGenericKnowSetting = nGenericKnownSettings; *pGenericKnowSetting; ++pGenericKnowSetting ) - if ( aDSUI.hasSetting( *pGenericKnowSetting ) ) - _out_rDetailsIds.push_back( *pGenericKnowSetting ); + _out_rDetailsIds.push_back( *feature ); + } // the rest is configuration-based + // TODO: that's not really true: *everything* is configuration-based nowadays, even the FeatureSet obtained + // from the DataSourceMetaData has been initialized from the configuration. So in fact, we could consolidate + // the two blocks. + // The best approach would be to extend the FeatureSet to contain *all* known data source features, not only + // the ones from the "Advanced settings" UI. + ::connectivity::DriversConfig aDriverConfig(_xFactory); const ::comphelper::NamedValueCollection& aProperties = aDriverConfig.getProperties(_sURLPrefix); #if OSL_DEBUG_LEVEL > 0 @@ -117,7 +106,11 @@ void ODriversSettings::getSupportedIndirectSettings( const ::rtl::OUString& _sUR ,TProperties(0,::rtl::OUString()) }; // TODO: This mapping between IDs and property names already exists - in ODbDataSourceAdministrationHelper::ODbDataSourceAdministrationHelper. - // We should not duplicate it here. + // Another mapping (which is also duplicated in ODbDataSourceAdministrationHelper) exists in dsmeta.cxx. We should + // consolidate those three places into one. + // However, care has to be taken: We need to distinguish between "features" and "properties" of a data source (resp. driver). + // That is, a driver can support a certain property, but not allow to change it in the UI, which means it would + // not have the respective "feature". for ( TProperties* pProps = aProps; pProps->first; ++pProps ) { if ( aProperties.has(pProps->second) ) diff --git a/dbaccess/source/ui/dlg/DriverSettings.hxx b/dbaccess/source/ui/dlg/DriverSettings.hxx index 154013a11bda..015ded56a042 100644 --- a/dbaccess/source/ui/dlg/DriverSettings.hxx +++ b/dbaccess/source/ui/dlg/DriverSettings.hxx @@ -33,7 +33,7 @@ #ifndef _DBAUI_DSNTYPES_HXX_ #include "dsntypes.hxx" #endif -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #include <vector> class SfxTabPage; diff --git a/dbaccess/source/ui/dlg/ExtensionNotPresent.cxx b/dbaccess/source/ui/dlg/ExtensionNotPresent.cxx index f9bd1e007341..33f65f50cb39 100644 --- a/dbaccess/source/ui/dlg/ExtensionNotPresent.cxx +++ b/dbaccess/source/ui/dlg/ExtensionNotPresent.cxx @@ -44,7 +44,7 @@ /** === end UNO includes === **/ #include <connectivity/dbconversion.hxx> -#include <svtools/syslocale.hxx> +#include <unotools/syslocale.hxx> #include <svx/globlmn.hrc> #include <svx/svxids.hrc> #include <tools/debug.hxx> diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx index d183f97acba5..ca73fabfe8ac 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx @@ -51,16 +51,16 @@ #endif #ifndef _SFXITEMSET_HXX -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #endif #ifndef _SFXSTRITEM_HXX -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #endif #ifndef _SFXENUMITEM_HXX -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #endif #ifndef _SFXINTITEM_HXX -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #endif #ifndef _DBAUI_DATASOURCEITEMS_HXX_ #include "dsitems.hxx" @@ -81,7 +81,7 @@ #include <vcl/mnemonic.hxx> #endif #ifndef _SVTOOLS_CJKOPTIONS_HXX -#include <svtools/cjkoptions.hxx> +#include <svl/cjkoptions.hxx> #endif #include <jvmaccess/virtualmachine.hxx> #ifndef _DBAUI_ADASTAT_HXX_ @@ -109,7 +109,7 @@ #endif #ifndef SVTOOLS_FILENOTATION_HXX_ -#include <svtools/filenotation.hxx> +#include <svl/filenotation.hxx> #endif #ifndef _UNOTOOLS_LOCALFILEHELPER_HXX @@ -141,7 +141,7 @@ #endif #ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #endif #ifndef SVTOOLS_INC_ROADMAPWIZARD_HXX diff --git a/dbaccess/source/ui/dlg/UserAdminDlg.cxx b/dbaccess/source/ui/dlg/UserAdminDlg.cxx index 204a57dc8758..0697124b69da 100644 --- a/dbaccess/source/ui/dlg/UserAdminDlg.cxx +++ b/dbaccess/source/ui/dlg/UserAdminDlg.cxx @@ -45,9 +45,9 @@ #include <comphelper/componentcontext.hxx> #include <connectivity/dbmetadata.hxx> #include <cppuhelper/exc_hlp.hxx> -#include <svtools/eitem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/eitem.hxx> +#include <svl/intitem.hxx> +#include <svl/stritem.hxx> #include <tools/diagnose_ex.h> #include <vcl/msgbox.hxx> #include <vcl/stdtext.hxx> diff --git a/dbaccess/source/ui/dlg/admincontrols.cxx b/dbaccess/source/ui/dlg/admincontrols.cxx index 8af119b127b0..5139b1e77895 100755..100644 --- a/dbaccess/source/ui/dlg/admincontrols.cxx +++ b/dbaccess/source/ui/dlg/admincontrols.cxx @@ -32,9 +32,9 @@ #include "dsitems.hxx" #include "moduledbu.hxx" -#include <svtools/eitem.hxx> -#include <svtools/stritem.hxx> -#include <svtools/intitem.hxx> +#include <svl/eitem.hxx> +#include <svl/stritem.hxx> +#include <svl/intitem.hxx> //........................................................................ namespace dbaui diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx index c67d34311147..c1b9ddbd33c5 100644 --- a/dbaccess/source/ui/dlg/adminpages.cxx +++ b/dbaccess/source/ui/dlg/adminpages.cxx @@ -31,70 +31,31 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" -#ifndef _DBAUI_ADMINPAGES_HXX_ #include "adminpages.hxx" -#endif -#ifndef _DBAUI_DBADMIN_HRC_ #include "dbadmin.hrc" -#endif -#ifndef _DBU_DLG_HRC_ +#include "dbadmin.hxx" #include "dbu_dlg.hrc" -#endif -#ifndef _SFXSTRITEM_HXX -#include <svtools/stritem.hxx> -#endif -#ifndef _SFXENUMITEM_HXX -#include <svtools/eitem.hxx> -#endif -#ifndef _SFXINTITEM_HXX -#include <svtools/intitem.hxx> -#endif -#ifndef _DBAUI_DATASOURCEITEMS_HXX_ -#include "dsitems.hxx" -#endif -#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC #include "dbustrings.hrc" -#endif -#ifndef _DBAUI_DBADMIN_HXX_ -#include "dbadmin.hxx" -#endif -#ifndef _SV_MSGBOX_HXX -#include <vcl/msgbox.hxx> -#endif -#ifndef _DBAUI_SQLMESSAGE_HXX_ -#include "sqlmessage.hxx" -#endif -#ifndef _SV_ACCEL_HXX -#include <vcl/accel.hxx> -#endif -#include <algorithm> -#include <stdlib.h> -#ifndef _OSL_FILE_HXX_ -#include <osl/file.hxx> -#endif -#ifndef _DBAUI_DSSELECT_HXX_ +#include "dsitems.hxx" #include "dsselect.hxx" -#endif -#ifndef _DBAUI_ODBC_CONFIG_HXX_ -#include "odbcconfig.hxx" -#endif -#ifndef _DBAUI_LOCALRESACCESS_HXX_ #include "localresaccess.hxx" -#endif -#ifndef _SV_FIELD_HXX +#include "odbcconfig.hxx" +#include "optionalboolitem.hxx" +#include "sqlmessage.hxx" + +#include <osl/file.hxx> +#include <svl/eitem.hxx> +#include <svl/intitem.hxx> +#include <svl/stritem.hxx> +#include <vcl/accel.hxx> +#include <vcl/button.hxx> +#include <vcl/edit.hxx> #include <vcl/field.hxx> -#endif -#ifndef _SV_LSTBOX_HXX #include <vcl/lstbox.hxx> -#endif -#ifndef _SV_EDIT_HXX -#include <vcl/edit.hxx> -#endif -#ifndef _SV_BUTTON_HXX -#include <vcl/button.hxx> -#endif - +#include <vcl/msgbox.hxx> +#include <algorithm> +#include <stdlib.h> //......................................................................... namespace dbaui @@ -256,7 +217,16 @@ namespace dbaui if ( _bRevertValue ) bValue = !bValue; - _rSet.Put( SfxBoolItem( _nID, bValue ) ); + if ( _pCheckBox->IsTriStateEnabled() ) + { + OptionalBoolItem aValue( _nID ); + if ( _pCheckBox->GetState() != STATE_DONTKNOW ) + aValue.SetValue( bValue ); + _rSet.Put( aValue ); + } + else + _rSet.Put( SfxBoolItem( _nID, bValue ) ); + _bChangedSomething = sal_True; } } diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx index 7f0b5ee16515..1fbe6806df74 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.cxx +++ b/dbaccess/source/ui/dlg/advancedsettings.cxx @@ -37,8 +37,7 @@ #include "dsitems.hxx" #include "DbAdminImpl.hxx" #include "DriverSettings.hxx" -#include "datasourceui.hxx" - +#include "optionalboolitem.hxx" #include "dbu_resource.hrc" #include "dbu_dlg.hrc" #include "dbadmin.hrc" @@ -47,9 +46,9 @@ /** === begin UNO includes === **/ /** === end UNO includes === **/ -#include <svtools/eitem.hxx> -#include <svtools/intitem.hxx> -#include <svtools/stritem.hxx> +#include <svl/eitem.hxx> +#include <svl/intitem.hxx> +#include <svl/stritem.hxx> #include <vcl/msgbox.hxx> @@ -98,15 +97,16 @@ namespace dbaui ,m_pCheckRequiredFields( NULL ) ,m_pIgnoreCurrency(NULL) ,m_pEscapeDateTime(NULL) + ,m_pPrimaryKeySupport(NULL) ,m_pBooleanComparisonModeLabel( NULL ) ,m_pBooleanComparisonMode( NULL ) ,m_aControlDependencies() ,m_aBooleanSettings() - ,m_aSupported( _rDSMeta.getAdvancedSettingsSupport() ) + ,m_bHasBooleanComparisonMode( _rDSMeta.getFeatureSet().has( DSID_BOOLEANCOMPARISON ) ) { impl_initBooleanSettings(); - DataSourceUI aDSUI( _rDSMeta ); + const FeatureSet& rFeatures( _rDSMeta.getFeatureSet() ); // create all the check boxes for the boolean settings for ( BooleanSettingDescs::const_iterator setting = m_aBooleanSettings.begin(); setting != m_aBooleanSettings.end(); @@ -114,11 +114,16 @@ namespace dbaui ) { USHORT nItemId = setting->nItemId; - if ( aDSUI.hasSetting( nItemId ) ) + if ( rFeatures.has( nItemId ) ) { - USHORT nID = setting->nControlResId; - (*setting->ppControl) = new CheckBox( this, ModuleRes( nID ) ); + USHORT nResourceId = setting->nControlResId; + (*setting->ppControl) = new CheckBox( this, ModuleRes( nResourceId ) ); (*setting->ppControl)->SetClickHdl( getControlModifiedLink() ); + + // check whether this must be a tristate check box + const SfxPoolItem& rItem = _rCoreAttrs.Get( nItemId ); + if ( rItem.ISA( OptionalBoolItem ) ) + (*setting->ppControl)->EnableTriState( TRUE ); } } @@ -148,7 +153,7 @@ namespace dbaui } // create the controls for the boolean comparison mode - if ( m_aSupported.bBooleanComparisonMode ) + if ( m_bHasBooleanComparisonMode ) { m_pBooleanComparisonModeLabel = new FixedText( this, ModuleRes( FT_BOOLEANCOMPARISON ) ); m_pBooleanComparisonMode = new ListBox( this, ModuleRes( LB_BOOLEANCOMPARISON ) ); @@ -185,6 +190,7 @@ namespace dbaui DELETEZ( m_pCheckRequiredFields ); DELETEZ( m_pIgnoreCurrency ); DELETEZ( m_pEscapeDateTime ); + DELETEZ( m_pPrimaryKeySupport ); DELETEZ( m_pBooleanComparisonModeLabel ); DELETEZ( m_pBooleanComparisonMode ); } @@ -210,13 +216,12 @@ namespace dbaui { &m_pCheckRequiredFields, CB_CHECK_REQUIRED, DSID_CHECK_REQUIRED_FIELDS, false }, { &m_pIgnoreCurrency, CB_IGNORECURRENCY, DSID_IGNORECURRENCY, false }, { &m_pEscapeDateTime, CB_ESCAPE_DATETIME, DSID_ESCAPE_DATETIME, false }, + { &m_pPrimaryKeySupport, CB_PRIMARY_KEY_SUPPORT, DSID_PRIMARY_KEY_SUPPORT, false }, { NULL, 0, 0, false } }; for ( const BooleanSettingDesc* pCopy = aSettings; pCopy->nItemId != 0; ++pCopy ) { - USHORT nID = pCopy->nItemId; - (void) nID; m_aBooleanSettings.push_back( *pCopy ); } } @@ -224,7 +229,7 @@ namespace dbaui // ----------------------------------------------------------------------- void SpecialSettingsPage::fillWindows( ::std::vector< ISaveValueWrapper* >& _rControlList ) { - if ( m_aSupported.bBooleanComparisonMode ) + if ( m_bHasBooleanComparisonMode ) { _rControlList.push_back( new ODisableWrapper< FixedText >( m_pBooleanComparisonModeLabel ) ); } @@ -244,7 +249,7 @@ namespace dbaui } } - if ( m_aSupported.bBooleanComparisonMode ) + if ( m_bHasBooleanComparisonMode ) _rControlList.push_back( new OSaveValueWrapper< ListBox >( m_pBooleanComparisonMode ) ); } @@ -270,16 +275,35 @@ namespace dbaui if ( !*setting->ppControl ) continue; - SFX_ITEMSET_GET( _rSet, pItem, SfxBoolItem, setting->nItemId, sal_True ); - bool bValue = pItem->GetValue(); - if ( setting->bInvertedDisplay ) - bValue = !bValue; + ::boost::optional< bool > aValue; - (*setting->ppControl)->Check( bValue ); + SFX_ITEMSET_GET( _rSet, pItem, SfxPoolItem, setting->nItemId, sal_True ); + if ( pItem->ISA( SfxBoolItem ) ) + { + aValue.reset( PTR_CAST( SfxBoolItem, pItem )->GetValue() ); + } + else if ( pItem->ISA( OptionalBoolItem ) ) + { + aValue = PTR_CAST( OptionalBoolItem, pItem )->GetFullValue(); + } + else + DBG_ERROR( "SpecialSettingsPage::implInitControls: unknown boolean item type!" ); + + if ( !aValue ) + { + (*setting->ppControl)->SetState( STATE_DONTKNOW ); + } + else + { + BOOL bValue = *aValue; + if ( setting->bInvertedDisplay ) + bValue = !bValue; + (*setting->ppControl)->Check( bValue ); + } } // the non-boolean items - if ( m_aSupported.bBooleanComparisonMode ) + if ( m_bHasBooleanComparisonMode ) { SFX_ITEMSET_GET( _rSet, pBooleanComparison, SfxInt32Item, DSID_BOOLEANCOMPARISON, sal_True ); m_pBooleanComparisonMode->SelectEntryPos( static_cast< USHORT >( pBooleanComparison->GetValue() ) ); @@ -305,7 +329,7 @@ namespace dbaui } // the non-boolean items - if ( m_aSupported.bBooleanComparisonMode ) + if ( m_bHasBooleanComparisonMode ) { if ( m_pBooleanComparisonMode->GetSelectEntryPos() != m_pBooleanComparisonMode->GetSavedValue() ) { @@ -420,14 +444,14 @@ namespace dbaui const ::rtl::OUString eType = m_pImpl->getDatasourceType(*_pItems); DataSourceMetaData aMeta( eType ); - const AdvancedSettingsSupport& rAdvancedSupport( aMeta.getAdvancedSettingsSupport() ); + const FeatureSet& rFeatures( aMeta.getFeatureSet() ); // auto-generated values? - if ( rAdvancedSupport.bGeneratedValues ) + if ( rFeatures.supportsGeneratedValues() ) AddTabPage( PAGE_GENERATED_VALUES, String( ModuleRes( STR_GENERATED_VALUE ) ), ODriversSettings::CreateGeneratedValuesPage, NULL ); // any "special settings"? - if ( rAdvancedSupport.supportsAnySpecialSetting() ) + if ( rFeatures.supportsAnySpecialSetting() ) AddTabPage( PAGE_ADVANCED_SETTINGS_SPECIAL, String( ModuleRes( STR_DS_BEHAVIOUR ) ), ODriversSettings::CreateSpecialSettingsPage, NULL ); // remove the reset button - it's meaning is much too ambiguous in this dialog @@ -446,8 +470,8 @@ namespace dbaui bool AdvancedSettingsDialog::doesHaveAnyAdvancedSettings( const ::rtl::OUString& _sURL ) { DataSourceMetaData aMeta( _sURL ); - const AdvancedSettingsSupport& rSupport( aMeta.getAdvancedSettingsSupport() ); - if ( rSupport.bGeneratedValues || rSupport.supportsAnySpecialSetting() ) + const FeatureSet& rFeatures( aMeta.getFeatureSet() ); + if ( rFeatures.supportsGeneratedValues() || rFeatures.supportsAnySpecialSetting() ) return true; return false; } diff --git a/dbaccess/source/ui/dlg/advancedsettings.hrc b/dbaccess/source/ui/dlg/advancedsettings.hrc index 9617df464bd3..66dedbb0086c 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.hrc +++ b/dbaccess/source/ui/dlg/advancedsettings.hrc @@ -31,7 +31,7 @@ #ifndef DBAUI_ADVANCEDSETTINGS_HRC #define DBAUI_ADVANCEDSETTINGS_HRC -#define ADVANCED_CHECKBOX_OPTIONS 14 +#define ADVANCED_CHECKBOX_OPTIONS 15 #define ADVANCED_LISTBOX_OPTIONS 1 #define ADVANCED_PAGE_X 200 @@ -40,7 +40,7 @@ /* label */ FIXEDTEXT_HEIGHT + RELATED_CONTROLS + \ /* check boxes */ ( ADVANCED_CHECKBOX_OPTIONS * ( CHECKBOX_HEIGHT + RELATED_CONTROLS ) ) + \ /* list boxes */ ( ADVANCED_LISTBOX_OPTIONS * ( LISTBOX_HEIGHT + RELATED_CONTROLS ) ) + \ - /* bottom space */ START_Y - RELATED_CONTROLS + /* bottom space */ START_Y #define STR_GENERATED_VALUE 1 @@ -64,6 +64,7 @@ #define CB_CHECK_REQUIRED 13 #define CB_IGNORECURRENCY 14 #define CB_ESCAPE_DATETIME 15 +#define CB_PRIMARY_KEY_SUPPORT 16 #define ET_AUTOINCREMENTVALUE 1 #define ET_RETRIEVE_AUTO 2 diff --git a/dbaccess/source/ui/dlg/advancedsettings.hxx b/dbaccess/source/ui/dlg/advancedsettings.hxx index 78a572d7fb0f..8145db32c4e2 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.hxx +++ b/dbaccess/source/ui/dlg/advancedsettings.hxx @@ -74,6 +74,7 @@ namespace dbaui CheckBox* m_pCheckRequiredFields; CheckBox* m_pIgnoreCurrency; CheckBox* m_pEscapeDateTime; + CheckBox* m_pPrimaryKeySupport; FixedText* m_pBooleanComparisonModeLabel; ListBox* m_pBooleanComparisonMode; @@ -83,8 +84,7 @@ namespace dbaui BooleanSettingDescs m_aBooleanSettings; - AdvancedSettingsSupport - m_aSupported; + bool m_bHasBooleanComparisonMode; public: virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); diff --git a/dbaccess/source/ui/dlg/advancedsettings.src b/dbaccess/source/ui/dlg/advancedsettings.src index acb5fbb81656..dc06146402d7 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.src +++ b/dbaccess/source/ui/dlg/advancedsettings.src @@ -206,7 +206,18 @@ Size = MAP_APPFONT ( ADVANCED_PAGE_X -12 , CHECKBOX_HEIGHT ) ; \ TabStop = TRUE ; \ HelpId = HID_DSADMIN_ESCAPE_DATETIME; \ - Text [ en-US ] = "Use ODBC conformant date/time literals"; \ + Text [ en-US ] = "Use ODBC conformant date/time literals"; \ + }; + + +#define AUTO_PRIMARY_KEY_SUPPORT(AUTO_Y) \ + CheckBox CB_PRIMARY_KEY_SUPPORT \ + { \ + Pos = MAP_APPFONT ( 6 , AUTO_Y ) ; \ + Size = MAP_APPFONT ( ADVANCED_PAGE_X - 12 , CHECKBOX_HEIGHT ) ; \ + TabStop = TRUE ; \ + HelpId = HID_DSADMIN_PRIMARY_KEY_SUPPORT; \ + Text [ en-US ] = "Supports primary keys"; \ }; @@ -321,8 +332,9 @@ TabPage PAGE_ADVANCED_SETTINGS_SPECIAL AUTO_DOSLINEENDS( 11*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 10*CHECKBOX_HEIGHT + RELATED_CONTROLS ) AUTO_CHECKREQUIRED( 12*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 11*CHECKBOX_HEIGHT + RELATED_CONTROLS ) AUTO_IGNORECURRENCY( 13*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 12*CHECKBOX_HEIGHT + RELATED_CONTROLS ) - AUTO_ESCAPE_DATETIME( 14*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 14*CHECKBOX_HEIGHT + RELATED_CONTROLS ) - AUTO_BOOLEANCOMPARISON( 15*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 13*CHECKBOX_HEIGHT + RELATED_CONTROLS + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 ) + AUTO_ESCAPE_DATETIME( 14*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 14*CHECKBOX_HEIGHT + RELATED_CONTROLS ) + AUTO_PRIMARY_KEY_SUPPORT( 15*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 15*CHECKBOX_HEIGHT + RELATED_CONTROLS ) + AUTO_BOOLEANCOMPARISON( 16*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 14*CHECKBOX_HEIGHT + RELATED_CONTROLS + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 ) }; //------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/dlg/datasourceui.cxx b/dbaccess/source/ui/dlg/datasourceui.cxx deleted file mode 100644 index f0a56e8dec83..000000000000 --- a/dbaccess/source/ui/dlg/datasourceui.cxx +++ /dev/null @@ -1,99 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: datasourceui.cxx,v $ - * $Revision: 1.5.68.1 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "datasourceui.hxx" -#include "dsmeta.hxx" -#include "dsitems.hxx" - -/** === begin UNO includes === **/ -/** === end UNO includes === **/ - -//........................................................................ -namespace dbaui -{ -//........................................................................ - - /** === begin UNO using === **/ - using ::com::sun::star::uno::Reference; - using ::com::sun::star::uno::UNO_QUERY; - using ::com::sun::star::uno::UNO_QUERY_THROW; - using ::com::sun::star::uno::Exception; - using ::com::sun::star::uno::RuntimeException; - /** === end UNO using === **/ - - //==================================================================== - //= DataSourceUI - //==================================================================== - //-------------------------------------------------------------------- - DataSourceUI::DataSourceUI( const DataSourceMetaData& _rDSMeta ) - :m_aDSMeta( _rDSMeta ) - { - } - - //-------------------------------------------------------------------- - DataSourceUI::~DataSourceUI() - { - } - - //-------------------------------------------------------------------- - bool DataSourceUI::hasSetting( const USHORT _nItemId ) const - { - const AdvancedSettingsSupport& rAdvancedSupport( m_aDSMeta.getAdvancedSettingsSupport() ); - - switch ( _nItemId ) - { - case DSID_SQL92CHECK: return rAdvancedSupport.bUseSQL92NamingConstraints; - case DSID_APPEND_TABLE_ALIAS: return rAdvancedSupport.bAppendTableAliasInSelect; - case DSID_AS_BEFORE_CORRNAME: return rAdvancedSupport.bUseKeywordAsBeforeAlias; - case DSID_ENABLEOUTERJOIN: return rAdvancedSupport.bUseBracketedOuterJoinSyntax; - case DSID_IGNOREDRIVER_PRIV: return rAdvancedSupport.bIgnoreDriverPrivileges; - case DSID_PARAMETERNAMESUBST: return rAdvancedSupport.bParameterNameSubstitution; - case DSID_SUPPRESSVERSIONCL: return rAdvancedSupport.bDisplayVersionColumns; - case DSID_CATALOG: return rAdvancedSupport.bUseCatalogInSelect; - case DSID_SCHEMA: return rAdvancedSupport.bUseSchemaInSelect; - case DSID_INDEXAPPENDIX: return rAdvancedSupport.bUseIndexDirectionKeyword; - case DSID_DOSLINEENDS: return rAdvancedSupport.bUseDOSLineEnds; - case DSID_BOOLEANCOMPARISON: return rAdvancedSupport.bBooleanComparisonMode; - case DSID_CHECK_REQUIRED_FIELDS:return rAdvancedSupport.bFormsCheckRequiredFields; - case DSID_AUTORETRIEVEENABLED: return rAdvancedSupport.bGeneratedValues; - case DSID_AUTOINCREMENTVALUE: return rAdvancedSupport.bGeneratedValues; - case DSID_AUTORETRIEVEVALUE: return rAdvancedSupport.bGeneratedValues; - case DSID_IGNORECURRENCY: return rAdvancedSupport.bIgnoreCurrency; - case DSID_ESCAPE_DATETIME: return rAdvancedSupport.bEscapeDateTime; - } - - OSL_ENSURE( false, "DataSourceUI::hasSetting: this item id is currently not supported!" ); - // Support for *all* items is a medium-term goal only. - return false; - } - -//........................................................................ -} // namespace dbaui -//........................................................................ diff --git a/dbaccess/source/ui/dlg/datasourceui.hxx b/dbaccess/source/ui/dlg/datasourceui.hxx deleted file mode 100644 index 4ea63439c0d5..000000000000 --- a/dbaccess/source/ui/dlg/datasourceui.hxx +++ /dev/null @@ -1,80 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: datasourceui.hxx,v $ - * $Revision: 1.3.68.1 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef DBACCESS_DATASOURCEUI_HXX -#define DBACCESS_DATASOURCEUI_HXX - -#include "dsntypes.hxx" -#include "dsmeta.hxx" - -/** === begin UNO includes === **/ -/** === end UNO includes === **/ - -#include <boost/shared_ptr.hpp> - -//........................................................................ -namespace dbaui -{ -//........................................................................ - - //==================================================================== - //= DataSourceUI - //==================================================================== - /** encapsulates information about available UI features of a data source type - */ - class DataSourceUI - { - public: - DataSourceUI( const DataSourceMetaData& _rDSMeta ); - ~DataSourceUI(); - - /** returns whether the data source's UI contains the specified setting - - Note that at the moment, not all items are supported by this method. In particular, use - it for the following only - <ul><li>All items which refer to advanced settings (see AdvancedSettingsSupport)</li> - </ul> - - A complete support of *all* items is a medium-term goal. - - @param _nItemId - the UI's item ID for the setting in question. See dsitems.hxx. - */ - bool hasSetting( const USHORT _nItemId ) const; - - private: - DataSourceMetaData m_aDSMeta; - }; - -//........................................................................ -} // namespace dbaui -//........................................................................ - -#endif // DBACCESS_DATASOURCEUI_HXX diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx index d535a0afab02..286236be75c6 100644 --- a/dbaccess/source/ui/dlg/dbadmin.cxx +++ b/dbaccess/source/ui/dlg/dbadmin.cxx @@ -31,58 +31,26 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" -#include "dsnItem.hxx" -#ifndef _DBAUI_DBADMIN_HXX_ -#include "dbadmin.hxx" -#endif -#ifndef _DBAUI_DBADMIN_HRC_ +#include "ConnectionPage.hxx" +#include "DbAdminImpl.hxx" +#include "DriverSettings.hxx" +#include "adminpages.hxx" #include "dbadmin.hrc" -#endif -#ifndef _DBU_DLG_HRC_ +#include "dbadmin.hxx" #include "dbu_dlg.hrc" -#endif -#ifndef _DBAUI_DATASOURCEITEMS_HXX_ -#include "dsitems.hxx" -#endif -#ifndef _SFXSTRITEM_HXX -#include <svtools/stritem.hxx> -#endif -#ifndef _SFXENUMITEM_HXX -#include <svtools/eitem.hxx> -#endif -#ifndef _SFXINTITEM_HXX -#include <svtools/intitem.hxx> -#endif -#ifndef _SV_MSGBOX_HXX -#include <vcl/msgbox.hxx> -#endif -#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC #include "dbustrings.hrc" -#endif -#ifndef _DBAUI_ADMINPAGES_HXX_ -#include "adminpages.hxx" -#endif -#ifndef _DBAUI_LOCALRESACCESS_HXX_ +#include "dsitems.hxx" +#include "dsnItem.hxx" #include "localresaccess.hxx" -#endif -#ifndef _DBAUI_STRINGLISTITEM_HXX_ -#include "stringlistitem.hxx" -#endif -#ifndef _DBAUI_PROPERTYSETITEM_HXX_ +#include "optionalboolitem.hxx" #include "propertysetitem.hxx" -#endif -#ifndef _UNOTOOLS_CONFIGNODE_HXX_ +#include "stringlistitem.hxx" + +#include <svl/eitem.hxx> +#include <svl/intitem.hxx> +#include <svl/stritem.hxx> #include <unotools/confignode.hxx> -#endif -#ifndef DBAUI_CONNECTIONPAGE_HXX -#include "ConnectionPage.hxx" -#endif -#ifndef DBAUI_DRIVERSETTINGS_HXX -#include "DriverSettings.hxx" -#endif -#ifndef _DBAUI_DBADMINIMPL_HXX_ -#include "DbAdminImpl.hxx" -#endif +#include <vcl/msgbox.hxx> //......................................................................... namespace dbaui @@ -439,8 +407,9 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp *pCounter++ = new SfxBoolItem(DSID_CHECK_REQUIRED_FIELDS, sal_True); *pCounter++ = new SfxBoolItem(DSID_IGNORECURRENCY, sal_False); *pCounter++ = new SfxStringItem(DSID_CONN_SOCKET, String()); - *pCounter++ = new SfxBoolItem(DSID_ESCAPE_DATETIME, sal_True); // must be the same as in ModelImpl.cxx + *pCounter++ = new SfxBoolItem(DSID_ESCAPE_DATETIME, sal_True); *pCounter++ = new SfxStringItem(DSID_NAMED_PIPE, String()); + *pCounter++ = new OptionalBoolItem( DSID_PRIMARY_KEY_SUPPORT ); // create the pool static SfxItemInfo __READONLY_DATA aItemInfos[DSID_LAST_ITEM_ID - DSID_FIRST_ITEM_ID + 1] = @@ -500,7 +469,8 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp {0,0}, {0,0}, {0,0}, - {0,0}, /* for Escape DateTime*/ + {0,0}, + {0,0}, {0,0}, {0,0} }; diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx index 558c454b5d05..0dde529246bb 100644 --- a/dbaccess/source/ui/dlg/dbfindex.cxx +++ b/dbaccess/source/ui/dlg/dbfindex.cxx @@ -60,13 +60,13 @@ #include <tools/urlobj.hxx> #endif #ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #endif #ifndef _UCBHELPER_CONTENT_HXX #include <ucbhelper/content.hxx> #endif #ifndef SVTOOLS_FILENOTATION_HXX_ -#include <svtools/filenotation.hxx> +#include <svl/filenotation.hxx> #endif diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx index c0b460cbb329..8c84ba0a03d4 100644 --- a/dbaccess/source/ui/dlg/dbwiz.cxx +++ b/dbaccess/source/ui/dlg/dbwiz.cxx @@ -45,13 +45,13 @@ #endif #include "dsnItem.hxx" #ifndef _SFXSTRITEM_HXX -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #endif #ifndef _SFXENUMITEM_HXX -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #endif #ifndef _SFXINTITEM_HXX -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #endif #ifndef _SV_MSGBOX_HXX #include <vcl/msgbox.hxx> diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index bab1dcca3694..149d0c2d2f7a 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -40,16 +40,16 @@ #include "dsnItem.hxx" #ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #endif #ifndef _SFXSTRITEM_HXX -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #endif #ifndef _SFXENUMITEM_HXX -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #endif #ifndef _SFXINTITEM_HXX -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #endif #ifndef _SV_MSGBOX_HXX #include <vcl/msgbox.hxx> @@ -169,7 +169,7 @@ /** === end UNO includes === **/ -#include <svtools/filenotation.hxx> +#include <svl/filenotation.hxx> #include <comphelper/interaction.hxx> #include <comphelper/namedvaluecollection.hxx> #include <comphelper/sequenceashashmap.hxx> diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index 69b91b2456a9..c6af345de4f8 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -46,16 +46,16 @@ #include "dbadmin.hrc" #ifndef _SFXITEMSET_HXX -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #endif #ifndef _SFXSTRITEM_HXX -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #endif #ifndef _SFXENUMITEM_HXX -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #endif #ifndef _SFXINTITEM_HXX -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #endif #ifndef _SV_MSGBOX_HXX #include <vcl/msgbox.hxx> @@ -64,7 +64,7 @@ #include <vcl/mnemonic.hxx> #endif #ifndef _SVTOOLS_CJKOPTIONS_HXX -#include <svtools/cjkoptions.hxx> +#include <svl/cjkoptions.hxx> #endif #include <jvmaccess/virtualmachine.hxx> #ifndef DBAUI_ADABASPAGE_HRC diff --git a/dbaccess/source/ui/dlg/dlgattr.cxx b/dbaccess/source/ui/dlg/dlgattr.cxx index b6f18fc77c45..c24ca75efc4e 100644 --- a/dbaccess/source/ui/dlg/dlgattr.cxx +++ b/dbaccess/source/ui/dlg/dlgattr.cxx @@ -66,16 +66,16 @@ #include "dbu_dlg.hrc" #endif #ifndef _SFXITEMSET_HXX -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #endif #define _ZFORLIST_DECLARE_TABLE #ifndef _ZFORLIST_HXX -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #endif #include <svx/svxids.hrc> //CHINA001 #include <svx/flagsdef.hxx> //CHINA001 #ifndef _SFXINTITEM_HXX //CHINA001 -#include <svtools/intitem.hxx> //CHINA001 +#include <svl/intitem.hxx> //CHINA001 #endif //CHINA001 #ifndef _DBAUI_MODULE_DBU_HXX_ #include "moduledbu.hxx" diff --git a/dbaccess/source/ui/dlg/dsnItem.hxx b/dbaccess/source/ui/dlg/dsnItem.hxx index fce1df04b3bc..a1b002190f2f 100644 --- a/dbaccess/source/ui/dlg/dsnItem.hxx +++ b/dbaccess/source/ui/dlg/dsnItem.hxx @@ -32,7 +32,7 @@ #ifndef _DBAUI_DSNITEM_HXX_ #define _DBAUI_DSNITEM_HXX_ -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> //......................................................................... namespace dbaccess diff --git a/dbaccess/source/ui/dlg/dsselect.cxx b/dbaccess/source/ui/dlg/dsselect.cxx index e21417ffdb0c..a15924e2fccd 100644 --- a/dbaccess/source/ui/dlg/dsselect.cxx +++ b/dbaccess/source/ui/dlg/dsselect.cxx @@ -84,16 +84,16 @@ #include "dsitems.hxx" #endif #ifndef _SFXSTRITEM_HXX -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #endif #ifndef _SFXINTITEM_HXX -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #endif #ifndef _SFXENUMITEM_HXX -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #endif #ifndef _SFXITEMSET_HXX -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #endif //......................................................................... diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index c9f145f795f5..6bf7a877cf9e 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -44,7 +44,7 @@ #include <vcl/stdtext.hxx> #include "localresaccess.hxx" #include <vcl/msgbox.hxx> -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #include <vcl/waitobj.hxx> #include <com/sun/star/sdbc/XDriverAccess.hpp> #include <com/sun/star/beans/PropertyValue.hpp> diff --git a/dbaccess/source/ui/dlg/makefile.mk b/dbaccess/source/ui/dlg/makefile.mk index ca2098778f06..2ec59f3d7840 100644 --- a/dbaccess/source/ui/dlg/makefile.mk +++ b/dbaccess/source/ui/dlg/makefile.mk @@ -124,13 +124,13 @@ EXCEPTIONSFILES= \ $(SLO)$/DriverSettings.obj \ $(SLO)$/odbcconfig.obj \ $(SLO)$/advancedsettings.obj \ - $(SLO)$/datasourceui.obj \ $(SLO)$/textconnectionsettings.obj SLOFILES= \ $(EXCEPTIONSFILES) \ $(SLO)$/dlgsize.obj \ - $(SLO)$/dlgattr.obj + $(SLO)$/dlgattr.obj \ + $(SLO)$/optionalboolitem.obj .IF "$(WINDOWS_VISTA_PSDK)"!="" && "$(PROF_EDITION)"=="" DISABLE_ADO=TRUE diff --git a/dbaccess/source/ui/dlg/optionalboolitem.cxx b/dbaccess/source/ui/dlg/optionalboolitem.cxx new file mode 100644 index 000000000000..9964e393061c --- /dev/null +++ b/dbaccess/source/ui/dlg/optionalboolitem.cxx @@ -0,0 +1,75 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +************************************************************************/ +
+// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_dbaccess.hxx" + +#include "optionalboolitem.hxx" + +//........................................................................ +namespace dbaui +{ +//........................................................................ + + //==================================================================== + //= OptionalBoolItem + //==================================================================== + TYPEINIT1( OptionalBoolItem, SfxPoolItem ); + //-------------------------------------------------------------------- + OptionalBoolItem::OptionalBoolItem( sal_Int16 _nWhich ) + :SfxPoolItem( _nWhich ) + ,m_aValue() + { + } + + //-------------------------------------------------------------------- + OptionalBoolItem::OptionalBoolItem( const OptionalBoolItem& _rSource ) + :SfxPoolItem( _rSource ) + ,m_aValue( _rSource.m_aValue ) + { + } + + //-------------------------------------------------------------------- + int OptionalBoolItem::operator==( const SfxPoolItem& _rItem ) const + { + const OptionalBoolItem* pCompare = PTR_CAST( OptionalBoolItem, &_rItem ); + if ( !pCompare ) + return 0; + + if ( m_aValue == pCompare->m_aValue ) + return 1; + + return 0; + } + + //-------------------------------------------------------------------- + SfxPoolItem* OptionalBoolItem::Clone( SfxItemPool* /*_pPool*/ ) const + { + return new OptionalBoolItem( *this ); + } + +//........................................................................ +} // namespace dbaui +//........................................................................ diff --git a/dbaccess/source/ui/dlg/optionalboolitem.hxx b/dbaccess/source/ui/dlg/optionalboolitem.hxx new file mode 100644 index 000000000000..4bc2054630eb --- /dev/null +++ b/dbaccess/source/ui/dlg/optionalboolitem.hxx @@ -0,0 +1,66 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +************************************************************************/ + +#ifndef DBACCESS_OPTIONALBOOLITEM_HXX +#define DBACCESS_OPTIONALBOOLITEM_HXX + +#include <svl/poolitem.hxx> + +#include <boost/optional.hpp> + +//........................................................................ +namespace dbaui +{ +//........................................................................ + + //==================================================================== + //= OptionalBoolItem + //==================================================================== + class OptionalBoolItem : public SfxPoolItem + { + ::boost::optional< bool > m_aValue; + + public: + TYPEINFO(); + OptionalBoolItem( sal_Int16 nWhich ); + OptionalBoolItem( const OptionalBoolItem& _rSource ); + + virtual int operator==( const SfxPoolItem& _rItem ) const; + virtual SfxPoolItem* Clone( SfxItemPool* _pPool = NULL ) const; + + bool HasValue() const { return !!m_aValue; } + void ClearValue() { m_aValue.reset(); } + bool GetValue() const { return *m_aValue; } + void SetValue( const bool _bValue ) { m_aValue.reset( _bValue ); } + + const ::boost::optional< bool >& + GetFullValue() const { return m_aValue; } + }; + +//........................................................................ +} // namespace dbaui +//........................................................................ + +#endif // DBACCESS_OPTIONALBOOLITEM_HXX diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index 9ebdb683e4a4..1b94bff730d5 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -72,7 +72,7 @@ #include "localresaccess.hxx" #endif #ifndef INCLUDED_SVTOOLS_SYSLOCALE_HXX -#include <svtools/syslocale.hxx> +#include <unotools/syslocale.hxx> #endif #define EF_VISITED 0x0001 diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx index bbcd265c5f34..4625448be9fa 100644 --- a/dbaccess/source/ui/dlg/tablespage.cxx +++ b/dbaccess/source/ui/dlg/tablespage.cxx @@ -62,10 +62,10 @@ #include "stringlistitem.hxx" #endif #ifndef _SFXENUMITEM_HXX -#include <svtools/eitem.hxx> +#include <svl/eitem.hxx> #endif #ifndef _SFXSTRITEM_HXX -#include <svtools/stritem.hxx> +#include <svl/stritem.hxx> #endif #ifndef DBACCESS_SHARED_DBUSTRINGS_HRC #include "dbustrings.hrc" diff --git a/dbaccess/source/ui/inc/FieldDescriptions.hxx b/dbaccess/source/ui/inc/FieldDescriptions.hxx index ee473b032853..6ef99652908d 100644 --- a/dbaccess/source/ui/inc/FieldDescriptions.hxx +++ b/dbaccess/source/ui/inc/FieldDescriptions.hxx @@ -34,7 +34,7 @@ #include "QEnumTypes.hxx" #endif #ifndef _SVX_SVXENUM_HXX -#include <svx/svxenum.hxx> +#include <editeng/svxenum.hxx> #endif #ifndef DBAUI_TYPEINFO_HXX #include "TypeInfo.hxx" diff --git a/dbaccess/source/ui/inc/GeneralUndo.hxx b/dbaccess/source/ui/inc/GeneralUndo.hxx index 956709c00a23..91e128342161 100644 --- a/dbaccess/source/ui/inc/GeneralUndo.hxx +++ b/dbaccess/source/ui/inc/GeneralUndo.hxx @@ -31,7 +31,7 @@ #define DBAUI_GENERALUNDO_HXX #ifndef _UNDO_HXX -#include <svtools/undo.hxx> +#include <svl/undo.hxx> #endif #ifndef _DBAUI_MODULE_DBU_HXX_ #include "moduledbu.hxx" diff --git a/dbaccess/source/ui/inc/HtmlReader.hxx b/dbaccess/source/ui/inc/HtmlReader.hxx index 07f774e76aa1..a55fff20589f 100644 --- a/dbaccess/source/ui/inc/HtmlReader.hxx +++ b/dbaccess/source/ui/inc/HtmlReader.hxx @@ -37,7 +37,7 @@ #include <svtools/parhtml.hxx> #endif #ifndef _SVX_SVXENUM_HXX -#include <svx/svxenum.hxx> +#include <editeng/svxenum.hxx> #endif #ifndef _STREAM_HXX #include <tools/stream.hxx> diff --git a/dbaccess/source/ui/inc/QueryDesignView.hxx b/dbaccess/source/ui/inc/QueryDesignView.hxx index 60dfb7bdec79..6a97719e0c27 100644 --- a/dbaccess/source/ui/inc/QueryDesignView.hxx +++ b/dbaccess/source/ui/inc/QueryDesignView.hxx @@ -171,6 +171,10 @@ namespace dbaui const String& _sCriteria, ::rtl::OUString& _rsErrorMessage, ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxColumn) const; + + void fillFunctionInfo( const ::connectivity::OSQLParseNode* pNode + ,const ::rtl::OUString& sFunctionTerm + ,OTableFieldDescRef& aInfo); protected: // return the Rectangle where I can paint myself virtual void resizeDocumentView(Rectangle& rRect); diff --git a/dbaccess/source/ui/inc/TableFieldDescription.hxx b/dbaccess/source/ui/inc/TableFieldDescription.hxx index 80eeeff20dfa..9230bef621c3 100644 --- a/dbaccess/source/ui/inc/TableFieldDescription.hxx +++ b/dbaccess/source/ui/inc/TableFieldDescription.hxx @@ -83,6 +83,7 @@ namespace dbaui inline sal_Bool IsEmpty() const; + OTableFieldDesc& operator=( const OTableFieldDesc& _aField ); sal_Bool operator==( const OTableFieldDesc& rDesc ); sal_Bool IsVisible() const { return m_bVisible;} diff --git a/dbaccess/source/ui/inc/TypeInfo.hxx b/dbaccess/source/ui/inc/TypeInfo.hxx index b44daeba3beb..ee5a5235da68 100644 --- a/dbaccess/source/ui/inc/TypeInfo.hxx +++ b/dbaccess/source/ui/inc/TypeInfo.hxx @@ -83,6 +83,7 @@ const sal_uInt16 TYPE_BLOB = 27; const sal_uInt16 TYPE_CLOB = 28; const sal_uInt16 TYPE_REF = 29; const sal_uInt16 TYPE_OTHER = 30; +const sal_uInt16 TYPE_BIT = 31; class OTypeInfo { diff --git a/dbaccess/source/ui/inc/UITools.hxx b/dbaccess/source/ui/inc/UITools.hxx index 51722ee431cb..bba83b147cd5 100644 --- a/dbaccess/source/ui/inc/UITools.hxx +++ b/dbaccess/source/ui/inc/UITools.hxx @@ -40,7 +40,7 @@ #include "TypeInfo.hxx" #endif #ifndef _SVX_SVXENUM_HXX -#include <svx/svxenum.hxx> +#include <editeng/svxenum.hxx> #endif #ifndef _SV_TASKPANELIST_HXX #include <vcl/taskpanelist.hxx> diff --git a/dbaccess/source/ui/inc/WCopyTable.hxx b/dbaccess/source/ui/inc/WCopyTable.hxx index 37d0d870f538..741e6f67e590 100644 --- a/dbaccess/source/ui/inc/WCopyTable.hxx +++ b/dbaccess/source/ui/inc/WCopyTable.hxx @@ -31,55 +31,23 @@ #ifndef DBAUI_WIZ_COPYTABLEDIALOG_HXX #define DBAUI_WIZ_COPYTABLEDIALOG_HXX -#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_ #include <com/sun/star/container/XNameAccess.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_ #include <com/sun/star/sdbc/XConnection.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBC_XRESULTSET_HPP_ #include <com/sun/star/sdbc/XResultSet.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBC_XRESULTSETMETADATA_HPP_ #include <com/sun/star/sdbc/XResultSetMetaData.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBC_XDATABASEMETADATA_HPP_ #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> -#endif -#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include <com/sun/star/beans/XPropertySet.hpp> -#endif -#ifndef _COMPHELPER_STLTYPES_HXX_ #include <comphelper/stl_types.hxx> -#endif -#ifndef DBAUI_TYPEINFO_HXX #include "TypeInfo.hxx" -#endif -#ifndef _SV_BUTTON_HXX #include <vcl/button.hxx> -#endif -#ifndef _SVT_WIZDLG_HXX #include <svtools/wizdlg.hxx> -#endif -#ifndef DBAUI_DATABASEEXPORT_HXX #include "DExport.hxx" -#endif -#ifndef DBAUI_WIZ_TABBPAGE_HXX #include "WTabPage.hxx" -#endif -#ifndef DBAUI_FIELDDESCRIPTIONS_HXX #include "FieldDescriptions.hxx" -#endif -#ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_ #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBCX_XKEYSSUPPLIER_HPP_ #include <com/sun/star/sdbcx/XKeysSupplier.hpp> -#endif -#ifndef _SV_LSTBOX_HXX +#include <com/sun/star/task/XInteractionHandler.hpp> #include <vcl/lstbox.hxx> -#endif - #include <functional> namespace dbaui @@ -299,6 +267,7 @@ namespace dbaui ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xFormatter; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> m_xFactory; + ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler> m_xInteractionHandler; String m_sTypeNames; // these type names are the ones out of the resource file sal_uInt32 m_nPageCount; @@ -343,7 +312,8 @@ namespace dbaui const ICopyTableSourceObject& _rSourceObject, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xSourceConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB, + const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler>& _xInteractionHandler ); // used for importing rtf/html sources @@ -445,6 +415,8 @@ namespace dbaui void showColumnTypeNotSupported(const ::rtl::OUString& _rColumnName); void removeColumnNameFromNameMap(const ::rtl::OUString& _sName); + void showError(const ::rtl::OUString& _sErrorMesage); + void showError(const ::com::sun::star::uno::Any& _aError); }; } diff --git a/dbaccess/source/ui/inc/brwctrlr.hxx b/dbaccess/source/ui/inc/brwctrlr.hxx index 2529de3735d6..ccffbaed3ffe 100644 --- a/dbaccess/source/ui/inc/brwctrlr.hxx +++ b/dbaccess/source/ui/inc/brwctrlr.hxx @@ -56,7 +56,7 @@ #include <svtools/transfer.hxx> #include <osl/mutex.hxx> #include <vos/thread.hxx> -#include <svtools/cancel.hxx> +#include <svl/cancel.hxx> #include <cppuhelper/implbase9.hxx> #include <svtools/cliplistener.hxx> diff --git a/dbaccess/source/ui/inc/dbu_misc.hrc b/dbaccess/source/ui/inc/dbu_misc.hrc index 0ee803edec10..6aeb5b1331ab 100644 --- a/dbaccess/source/ui/inc/dbu_misc.hrc +++ b/dbaccess/source/ui/inc/dbu_misc.hrc @@ -50,10 +50,12 @@ #define STR_FILE_DOES_NOT_EXIST RID_STR_MISC_START + 13 #define STR_WARNINGS_DURING_CONNECT RID_STR_MISC_START + 14 #define STR_NAMED_OBJECT_ALREADY_EXISTS RID_STR_MISC_START + 15 +#define STR_INVALID_TABLE_NAME RID_STR_MISC_START + 16 +#define STR_INVALID_TABLE_NAME_LENGTH RID_STR_MISC_START + 17 // please adjust checking before insert new strings -#if STR_NAMED_OBJECT_ALREADY_EXISTS > RID_STR_MISC_END +#if STR_INVALID_TABLE_NAME_LENGTH > RID_STR_MISC_END #error Resource-Id Ueberlauf in #file, #line #endif diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc index 4686b540e936..7d72e16f0f2f 100644 --- a/dbaccess/source/ui/inc/dbu_resource.hrc +++ b/dbaccess/source/ui/inc/dbu_resource.hrc @@ -32,7 +32,7 @@ #define _DBU_RESOURCE_HRC_ #ifndef _SOLAR_HRC -#include <svtools/solar.hrc> +#include <svl/solar.hrc> #endif #define RID_DIALOG_START RID_DBACCESS_START @@ -182,13 +182,13 @@ // error boxes #define ERR_NOREGISTEREDDATASOURCES RID_ERRORBOX_START + 0 -#define ERROR_INVALID_TABLE_NAME_LENGTH RID_ERRORBOX_START + 1 +// free #define ERR_QRY_CRITERIA_ON_ASTERISK RID_ERRORBOX_START + 2 #define ERR_QRY_ORDERBY_ON_ASTERISK RID_ERRORBOX_START + 3 #define ERR_QRY_AMB_FIELD RID_ERRORBOX_START + 4 // FREE #define ERR_INVALID_LISTBOX_ENTRY RID_ERRORBOX_START + 6 -#define ERROR_INVALID_TABLE_NAME RID_ERRORBOX_START + 7 +// FREE #define ERR_NEED_INDEX_FIELDS RID_ERRORBOX_START + 8 #define ERR_QRY_NOSTATEMENT RID_ERRORBOX_START + 9 #define ERR_QRY_NOCRITERIA RID_ERRORBOX_START + 10 diff --git a/dbaccess/source/ui/inc/dbu_uno.hrc b/dbaccess/source/ui/inc/dbu_uno.hrc index acd15c94c7ef..6aec13955ac0 100644 --- a/dbaccess/source/ui/inc/dbu_uno.hrc +++ b/dbaccess/source/ui/inc/dbu_uno.hrc @@ -43,9 +43,12 @@ #define STR_CTW_UNSUPPORTED_COLUMN_TYPE ( RID_STR_UNO_START + 6 ) #define STR_CTW_ILLEGAL_PARAMETER_COUNT ( RID_STR_UNO_START + 7 ) #define STR_CTW_ERROR_DURING_INITIALIZATION ( RID_STR_UNO_START + 8 ) +#define STR_CTW_ERROR_UNSUPPORTED_SETTING ( RID_STR_UNO_START + 9 ) +#define STR_CTW_ERROR_NO_QUERY ( RID_STR_UNO_START + 10 ) +#define STR_CTW_ERROR_INVALID_INTERACTIONHANDLER ( RID_STR_UNO_START + 11 ) // please adjust when inserting new strings: -#define RID_STR_UNO_LAST_USED STR_CTW_ERROR_DURING_INITIALIZATION +#define RID_STR_UNO_LAST_USED STR_CTW_ERROR_INVALID_INTERACTIONHANDLER #if RID_STR_UNO_LAST_USED >= RID_STR_UNO_END #error too many resources in uno .... diff --git a/dbaccess/source/ui/dlg/dsitems.hxx b/dbaccess/source/ui/inc/dsitems.hxx index a0d95aca810b..20a6f4d83a8e 100644 --- a/dbaccess/source/ui/dlg/dsitems.hxx +++ b/dbaccess/source/ui/inc/dsitems.hxx @@ -31,6 +31,8 @@ #ifndef _DBAUI_DATASOURCEITEMS_HXX_ #define _DBAUI_DATASOURCEITEMS_HXX_ +typedef sal_Int32 ItemID; + //======================================================================== //= item ids for the data source administration dialog @@ -92,6 +94,7 @@ #define DSID_CONN_SOCKET 56 #define DSID_ESCAPE_DATETIME 57 #define DSID_NAMED_PIPE 58 +#define DSID_PRIMARY_KEY_SUPPORT 59 // don't forget to adjust DSID_LAST_ITEM_ID below! @@ -99,7 +102,7 @@ //= item range. Adjust this if you introduce new items above #define DSID_FIRST_ITEM_ID DSID_NAME -#define DSID_LAST_ITEM_ID DSID_NAMED_PIPE +#define DSID_LAST_ITEM_ID DSID_PRIMARY_KEY_SUPPORT #endif // _DBAUI_DATASOURCEITEMS_HXX_ diff --git a/dbaccess/source/ui/inc/dsmeta.hxx b/dbaccess/source/ui/inc/dsmeta.hxx index 5372c201e0c8..78ba0db1272e 100644 --- a/dbaccess/source/ui/inc/dsmeta.hxx +++ b/dbaccess/source/ui/inc/dsmeta.hxx @@ -32,6 +32,7 @@ #define DBACCESS_DSMETA_HXX #include "dsntypes.hxx" +#include "dsitems.hxx" /** === begin UNO includes === **/ /** === end UNO includes === **/ @@ -56,7 +57,7 @@ namespace dbaui //==================================================================== //= DataSourceMetaData //==================================================================== - struct AdvancedSettingsSupport; + class FeatureSet; class DataSourceMetaData_Impl; /** encapsulates meta data for a data source @@ -74,7 +75,7 @@ namespace dbaui ~DataSourceMetaData(); /// returns a struct describing this data source type's support for our known advanced settings - const AdvancedSettingsSupport& getAdvancedSettingsSupport() const; + const FeatureSet& getFeatureSet() const; /// determines whether or not the data source requires authentication static AuthenticationMode getAuthentication( const ::rtl::OUString& _sURL ); @@ -84,77 +85,56 @@ namespace dbaui }; //==================================================================== - //= AdvancedSettingsSupport + //= FeatureSet //==================================================================== - /// struct taking flags for the supported advanced settings - struct AdvancedSettingsSupport + /** can be used to ask for (UI) support for certain advanced features + */ + class FeatureSet { - // auto-generated values - bool bGeneratedValues; - // various settings as found on the "Special Settings" page in the UI - bool bUseSQL92NamingConstraints; - bool bAppendTableAliasInSelect; - bool bUseKeywordAsBeforeAlias; - bool bUseBracketedOuterJoinSyntax; - bool bIgnoreDriverPrivileges; - bool bParameterNameSubstitution; - bool bDisplayVersionColumns; - bool bUseCatalogInSelect; - bool bUseSchemaInSelect; - bool bUseIndexDirectionKeyword; - bool bUseDOSLineEnds; - bool bBooleanComparisonMode; - bool bFormsCheckRequiredFields; - bool bIgnoreCurrency; - bool bEscapeDateTime; - - // Note: If you extend this list, you need to adjust the ctor (of course) - // and (maybe) the implementation of supportsAnySpecialSetting - - AdvancedSettingsSupport() - :bGeneratedValues ( true ) - ,bUseSQL92NamingConstraints ( true ) - ,bAppendTableAliasInSelect ( true ) - ,bUseKeywordAsBeforeAlias ( true ) - ,bUseBracketedOuterJoinSyntax ( true ) - ,bIgnoreDriverPrivileges ( true ) - ,bParameterNameSubstitution ( true ) - ,bDisplayVersionColumns ( true ) - ,bUseCatalogInSelect ( true ) - ,bUseSchemaInSelect ( true ) - ,bUseIndexDirectionKeyword ( true ) - ,bUseDOSLineEnds ( true ) - ,bBooleanComparisonMode ( true ) - ,bFormsCheckRequiredFields ( true ) - ,bIgnoreCurrency ( false ) - ,bEscapeDateTime ( false ) - { - } - - /** determines whether there is support for any of the settings found on the "Special Settings" - UI - */ - inline bool supportsAnySpecialSetting() const; + public: + typedef ::std::set< ItemID >::const_iterator const_iterator; + + public: + inline FeatureSet() { } + + inline void put( const ItemID _id ) { m_aContent.insert( _id ); } + inline bool has( const ItemID _id ) const { return m_aContent.find( _id ) != m_aContent.end(); } + + inline bool supportsAnySpecialSetting() const; + inline bool supportsGeneratedValues() const; + + inline const_iterator begin() const { return m_aContent.begin(); } + inline const_iterator end() const { return m_aContent.end(); } + + private: + ::std::set< ItemID > m_aContent; }; //-------------------------------------------------------------------- - inline bool AdvancedSettingsSupport::supportsAnySpecialSetting() const + inline bool FeatureSet::supportsGeneratedValues() const + { + return has( DSID_AUTORETRIEVEENABLED ); + } + + //-------------------------------------------------------------------- + inline bool FeatureSet::supportsAnySpecialSetting() const { - return ( bUseSQL92NamingConstraints == true ) - || ( bAppendTableAliasInSelect == true ) - || ( bUseKeywordAsBeforeAlias == true ) - || ( bUseBracketedOuterJoinSyntax == true ) - || ( bIgnoreDriverPrivileges == true ) - || ( bParameterNameSubstitution == true ) - || ( bDisplayVersionColumns == true ) - || ( bUseCatalogInSelect == true ) - || ( bUseSchemaInSelect == true ) - || ( bUseIndexDirectionKeyword == true ) - || ( bUseDOSLineEnds == true ) - || ( bBooleanComparisonMode == true ) - || ( bFormsCheckRequiredFields == true ) - || ( bIgnoreCurrency == true ) - || ( bEscapeDateTime == true ) + return has( DSID_SQL92CHECK ) + || has( DSID_APPEND_TABLE_ALIAS ) + || has( DSID_AS_BEFORE_CORRNAME ) + || has( DSID_ENABLEOUTERJOIN ) + || has( DSID_IGNOREDRIVER_PRIV ) + || has( DSID_PARAMETERNAMESUBST ) + || has( DSID_SUPPRESSVERSIONCL ) + || has( DSID_CATALOG ) + || has( DSID_SCHEMA ) + || has( DSID_INDEXAPPENDIX ) + || has( DSID_DOSLINEENDS ) + || has( DSID_BOOLEANCOMPARISON ) + || has( DSID_CHECK_REQUIRED_FIELDS ) + || has( DSID_IGNORECURRENCY ) + || has( DSID_ESCAPE_DATETIME ) + || has( DSID_PRIMARY_KEY_SUPPORT ) ; } diff --git a/dbaccess/source/ui/inc/exsrcbrw.hxx b/dbaccess/source/ui/inc/exsrcbrw.hxx index f8c8dc54688b..d4783560732a 100644 --- a/dbaccess/source/ui/inc/exsrcbrw.hxx +++ b/dbaccess/source/ui/inc/exsrcbrw.hxx @@ -31,18 +31,11 @@ #ifndef _SBA_EXTCTRLR_HXX #define _SBA_EXTCTRLR_HXX -#ifndef _SBA_BWRCTRLR_HXX #include "brwctrlr.hxx" -#endif -#ifndef _COM_SUN_STAR_FORM_XFORMCONTROLLER_HPP_ -#include <com/sun/star/form/XFormController.hpp> -#endif -#ifndef _COMPHELPER_UNO3_HXX_ + #include <comphelper/uno3.hxx> -#endif -#ifndef _CPPUHELPER_IMPLBASE2_HXX_ #include <cppuhelper/implbase2.hxx> -#endif + //============================================================================== //= SbaExternalSourceBrowser //============================================================================== diff --git a/dbaccess/source/ui/inc/indexdialog.hxx b/dbaccess/source/ui/inc/indexdialog.hxx index b8a89b0dbf8d..26ee146ca237 100644 --- a/dbaccess/source/ui/inc/indexdialog.hxx +++ b/dbaccess/source/ui/inc/indexdialog.hxx @@ -62,7 +62,7 @@ #include <svtools/svtreebx.hxx> #endif #ifndef INCLUDED_SVTOOLS_VIEWOPTIONS_HXX -#include <svtools/viewoptions.hxx> +#include <unotools/viewoptions.hxx> #endif #ifndef _DBAUI_INDEXES_HXX_ #include "indexes.hxx" diff --git a/dbaccess/source/ui/inc/propertysetitem.hxx b/dbaccess/source/ui/inc/propertysetitem.hxx index 7d104fcce714..70defabbb2e2 100644 --- a/dbaccess/source/ui/inc/propertysetitem.hxx +++ b/dbaccess/source/ui/inc/propertysetitem.hxx @@ -32,7 +32,7 @@ #define _DBAUI_PROPERTYSETITEM_HXX_ #ifndef _SFXPOOLITEM_HXX -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #endif #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include <com/sun/star/beans/XPropertySet.hpp> diff --git a/dbaccess/source/ui/inc/querycontroller.hxx b/dbaccess/source/ui/inc/querycontroller.hxx index 70be5b60407a..6db721095c15 100644 --- a/dbaccess/source/ui/inc/querycontroller.hxx +++ b/dbaccess/source/ui/inc/querycontroller.hxx @@ -54,7 +54,7 @@ #include <connectivity/sqliterator.hxx> #include <connectivity/sqlnode.hxx> #include <connectivity/sqlparse.hxx> -#include <svtools/undo.hxx> +#include <svl/undo.hxx> class VCLXWindow; namespace dbaui diff --git a/dbaccess/source/ui/inc/sqledit.hxx b/dbaccess/source/ui/inc/sqledit.hxx index 039ea9f8404b..57bb75a0b927 100644 --- a/dbaccess/source/ui/inc/sqledit.hxx +++ b/dbaccess/source/ui/inc/sqledit.hxx @@ -31,14 +31,14 @@ #define DBAUI_SQLEDIT_HXX #include <svtools/editsyntaxhighlighter.hxx> -#include <svtools/lstner.hxx> +#include <svl/lstner.hxx> #include <svtools/colorcfg.hxx> -#include <svtools/sourceviewconfig.hxx> +#include <unotools/sourceviewconfig.hxx> namespace dbaui { class OQueryTextView; - class OSqlEdit : public MultiLineEditSyntaxHighlight, SfxListener + class OSqlEdit : public MultiLineEditSyntaxHighlight, utl::ConfigurationListener { private: Timer m_timerInvalidate; @@ -48,7 +48,7 @@ namespace dbaui OQueryTextView* m_pView; BOOL m_bAccelAction; // Wird bei Cut, Copy, Paste gesetzt BOOL m_bStopTimer; - svt::SourceViewConfig m_SourceViewConfig; + utl::SourceViewConfig m_SourceViewConfig; svtools::ColorConfig m_ColorConfig; DECL_LINK(OnUndoActionTimer, void*); @@ -82,7 +82,7 @@ namespace dbaui void stopTimer(); void startTimer(); - virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 ); using MultiLineEditSyntaxHighlight::Notify; }; } diff --git a/dbaccess/source/ui/inc/stringlistitem.hxx b/dbaccess/source/ui/inc/stringlistitem.hxx index 09a4792ceb63..3f27dc797e15 100644 --- a/dbaccess/source/ui/inc/stringlistitem.hxx +++ b/dbaccess/source/ui/inc/stringlistitem.hxx @@ -32,7 +32,7 @@ #define _DBAUI_STRINGLISTITEM_HXX_ #ifndef _SFXPOOLITEM_HXX -#include <svtools/poolitem.hxx> +#include <svl/poolitem.hxx> #endif #ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_ diff --git a/dbaccess/source/ui/inc/unodatbr.hxx b/dbaccess/source/ui/inc/unodatbr.hxx index c6315cc1db22..23d9cfd5b542 100644 --- a/dbaccess/source/ui/inc/unodatbr.hxx +++ b/dbaccess/source/ui/inc/unodatbr.hxx @@ -70,8 +70,11 @@ #ifndef _COM_SUN_STAR_SDB_APPLICATION_DATABASEOBJECTCONTAINER_HPP_ #include <com/sun/star/sdb/application/DatabaseObjectContainer.hpp> #endif -#ifndef _CPPUHELPER_IMPLBASE4_HXX_ -#include <cppuhelper/implbase4.hxx> +#ifndef _COM_SUN_STAR_SDB_DATABASEOBJECTCONTAINER_HPP_ +#include <com/sun/star/sdb/XDatabaseRegistrationsListener.hpp> +#endif +#ifndef _CPPUHELPER_IMPLBASE5_HXX_ +#include <cppuhelper/implbase5.hxx> #endif #ifndef _DBACCESS_UI_CALLBACKS_HXX_ #include "callbacks.hxx" @@ -113,10 +116,11 @@ namespace dbaui class ImageProvider; // ===================================================================== - typedef ::cppu::ImplHelper4 < ::com::sun::star::frame::XStatusListener + typedef ::cppu::ImplHelper5 < ::com::sun::star::frame::XStatusListener , ::com::sun::star::view::XSelectionSupplier , ::com::sun::star::document::XScriptInvocationContext , ::com::sun::star::ui::XContextMenuInterception + , ::com::sun::star::sdb::XDatabaseRegistrationsListener > SbaTableQueryBrowser_Base; class SbaTableQueryBrowser :public SbaXDataBrowserController @@ -256,6 +260,11 @@ namespace dbaui virtual void SAL_CALL registerContextMenuInterceptor( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XContextMenuInterceptor >& Interceptor ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL releaseContextMenuInterceptor( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XContextMenuInterceptor >& Interceptor ) throw (::com::sun::star::uno::RuntimeException); + // XDatabaseRegistrationsListener + virtual void SAL_CALL registeredDatabaseLocation( const ::com::sun::star::sdb::DatabaseRegistrationEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL revokedDatabaseLocation( const ::com::sun::star::sdb::DatabaseRegistrationEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL changedDatabaseLocation( const ::com::sun::star::sdb::DatabaseRegistrationEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + protected: // SbaXDataBrowserController overridables virtual sal_Bool InitializeForm(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > & xForm); @@ -339,6 +348,11 @@ namespace dbaui const SharedConnection& _rxConnection ); + void implAddDatasource( const String& _rDataSourceName, const SharedConnection& _rxConnection ); + + /// removes (and cleans up) the entry for the given data source + void impl_cleanupDataSourceEntry( const String& _rDataSourceName ); + /// clears the tree list box void clearTreeModel(); diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx index f533c719160e..a1b29faf1afa 100644 --- a/dbaccess/source/ui/misc/DExport.cxx +++ b/dbaccess/source/ui/misc/DExport.cxx @@ -50,7 +50,7 @@ #include "dbu_misc.hrc" #include <connectivity/dbconversion.hxx> #include <sfx2/sfxhtml.hxx> -#include <svtools/numuno.hxx> +#include <svl/numuno.hxx> #include <connectivity/dbtools.hxx> #include <comphelper/extract.hxx> #include "TypeInfo.hxx" @@ -65,8 +65,8 @@ #include "WCopyTable.hxx" #include "WExtendPages.hxx" #include "WCPage.hxx" -#include <svtools/syslocale.hxx> -#include <svtools/zforlist.hxx> +#include <unotools/syslocale.hxx> +#include <svl/zforlist.hxx> #include <connectivity/dbexception.hxx> #include <connectivity/FValue.hxx> #include <com/sun/star/sdbc/SQLWarning.hpp> @@ -479,6 +479,7 @@ sal_Int16 ODatabaseExport::CheckString(const String& aCheckToken, sal_Int16 _nOl case NumberFormat::DATETIME: case NumberFormat::TEXT: case NumberFormat::DATE: + nNumberFormat = _nOldNumberFormat; break; case NumberFormat::ALL: nNumberFormat = NumberFormat::DATE; @@ -494,6 +495,7 @@ sal_Int16 ODatabaseExport::CheckString(const String& aCheckToken, sal_Int16 _nOl case NumberFormat::DATETIME: case NumberFormat::TEXT: case NumberFormat::TIME: + nNumberFormat = _nOldNumberFormat; break; case NumberFormat::ALL: nNumberFormat = NumberFormat::TIME; @@ -510,6 +512,7 @@ sal_Int16 ODatabaseExport::CheckString(const String& aCheckToken, sal_Int16 _nOl nNumberFormat = NumberFormat::CURRENCY; break; case NumberFormat::CURRENCY: + nNumberFormat = _nOldNumberFormat; break; case NumberFormat::ALL: nNumberFormat = NumberFormat::CURRENCY; @@ -526,6 +529,7 @@ sal_Int16 ODatabaseExport::CheckString(const String& aCheckToken, sal_Int16 _nOl switch(_nOldNumberFormat) { case NumberFormat::NUMBER: + nNumberFormat = _nOldNumberFormat; break; case NumberFormat::CURRENCY: nNumberFormat = NumberFormat::CURRENCY; @@ -549,6 +553,7 @@ sal_Int16 ODatabaseExport::CheckString(const String& aCheckToken, sal_Int16 _nOl case NumberFormat::DATETIME: case NumberFormat::TEXT: case NumberFormat::TIME: + nNumberFormat = _nOldNumberFormat; break; case NumberFormat::ALL: nNumberFormat = NumberFormat::DATETIME; diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx index b95423b77c24..4c9fb3ded1bb 100644 --- a/dbaccess/source/ui/misc/HtmlReader.cxx +++ b/dbaccess/source/ui/misc/HtmlReader.cxx @@ -63,7 +63,7 @@ #include "QEnumTypes.hxx" #include "WCPage.hxx" #include <tools/inetmime.hxx> -#include <svtools/inettype.hxx> +#include <svl/inettype.hxx> #include <rtl/tencinfo.h> #include "UITools.hxx" #include <vcl/svapp.hxx> diff --git a/dbaccess/source/ui/misc/RowSetDrop.cxx b/dbaccess/source/ui/misc/RowSetDrop.cxx index 53b1105c6aba..2c679ba22da8 100644 --- a/dbaccess/source/ui/misc/RowSetDrop.cxx +++ b/dbaccess/source/ui/misc/RowSetDrop.cxx @@ -237,6 +237,12 @@ sal_Bool ORowSetImportExport::insertNewRow() case DataType::VARBINARY: aValue <<= m_xRow->getBytes(*aIter); break; + case DataType::BLOB: + aValue <<= m_xRow->getBlob(*aIter); + break; + case DataType::CLOB: + aValue <<= m_xRow->getClob(*aIter); + break; default: OSL_ENSURE(0,"Unknown type"); } diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx index 02765c333c21..438f43911923 100644 --- a/dbaccess/source/ui/misc/TokenWriter.cxx +++ b/dbaccess/source/ui/misc/TokenWriter.cxx @@ -55,15 +55,15 @@ #include <tools/color.hxx> #include <svtools/htmlout.hxx> #include <sfx2/frmhtmlw.hxx> -#include <svtools/numuno.hxx> +#include <svl/numuno.hxx> #include <vcl/svapp.hxx> #include "UITools.hxx" #include <toolkit/helper/vclunohelper.hxx> #include <vcl/outdev.hxx> #include <svtools/rtfout.hxx> -#include <svx/htmlcfg.hxx> +#include <svtools/htmlcfg.hxx> #include <connectivity/formattedcolumnvalue.hxx> -#include <svtools/syslocale.hxx> +#include <unotools/syslocale.hxx> #include <comphelper/componentcontext.hxx> #include <rtl/logfile.hxx> diff --git a/dbaccess/source/ui/misc/ToolBoxHelper.cxx b/dbaccess/source/ui/misc/ToolBoxHelper.cxx index 8982ae4571da..a9029301741c 100644 --- a/dbaccess/source/ui/misc/ToolBoxHelper.cxx +++ b/dbaccess/source/ui/misc/ToolBoxHelper.cxx @@ -61,13 +61,13 @@ namespace dbaui DBG_CTOR(OToolBoxHelper,NULL); OSL_ENSURE(m_nSymbolsSize != SvtMiscOptions().GetCurrentSymbolsSize(),"SymbolsSize should not be identical"); - SvtMiscOptions().AddListener( LINK( this, OToolBoxHelper, ConfigOptionsChanged ) ); + SvtMiscOptions().AddListenerLink( LINK( this, OToolBoxHelper, ConfigOptionsChanged ) ); Application::AddEventListener( LINK( this, OToolBoxHelper, SettingsChanged ) ); } // ----------------------------------------------------------------------------- OToolBoxHelper::~OToolBoxHelper() { - SvtMiscOptions().RemoveListener( LINK( this, OToolBoxHelper, ConfigOptionsChanged ) ); + SvtMiscOptions().RemoveListenerLink( LINK( this, OToolBoxHelper, ConfigOptionsChanged ) ); Application::RemoveEventListener( LINK( this, OToolBoxHelper, SettingsChanged ) ); DBG_DTOR(OToolBoxHelper,NULL); } diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 20cb7cb9308e..8d7e24e2792c 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -198,7 +198,7 @@ #define ITEMID_NUMBERINFO SID_ATTR_NUMBERFORMAT_INFO #ifndef _SFXITEMPOOL_HXX -#include <svtools/itempool.hxx> +#include <svl/itempool.hxx> #endif #ifndef _STRING_HXX #include <tools/string.hxx> @@ -207,16 +207,16 @@ #include "dbaccess_helpid.hrc" #endif #ifndef _SFXITEMSET_HXX //autogen wg. SfxItemSet -#include <svtools/itemset.hxx> +#include <svl/itemset.hxx> #endif #ifndef DBACCESS_SBA_GRID_HRC #include "sbagrid.hrc" #endif #ifndef _SFXRNGITEM_HXX -#include <svtools/rngitem.hxx> +#include <svl/rngitem.hxx> #endif #ifndef _SFXINTITEM_HXX -#include <svtools/intitem.hxx> +#include <svl/intitem.hxx> #endif #ifndef _SVX_ALGITEM_HXX #include <svx/algitem.hxx> @@ -229,7 +229,7 @@ #include <svx/numinf.hxx> #endif #ifndef _ZFORLIST_HXX -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #endif #ifndef DBAUI_SBATTRDLG_HXX #include "dlgattr.hxx" @@ -283,13 +283,13 @@ #include <tools/diagnose_ex.h> #endif #ifndef _NUMUNO_HXX -#include <svtools/numuno.hxx> +#include <svl/numuno.hxx> #endif #ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #endif #ifndef SVTOOLS_FILENOTATION_HXX_ -#include <svtools/filenotation.hxx> +#include <svl/filenotation.hxx> #endif #ifndef _SVT_FILEVIEW_HXX #include <svtools/fileview.hxx> @@ -803,6 +803,12 @@ void fillTypeInfo( const Reference< ::com::sun::star::sdbc::XConnection>& _rxCo aName = _rsTypeNames.GetToken(TYPE_DATETIME); break; case DataType::BIT: + if ( pInfo->aCreateParams.getLength() ) + { + aName = _rsTypeNames.GetToken(TYPE_BIT); + break; + } + // run through case DataType::BOOLEAN: aName = _rsTypeNames.GetToken(TYPE_BOOL); break; @@ -1155,7 +1161,7 @@ sal_Bool callColumnFormatDialog(Window* _pParent, if (_bHasFormat) { // if the col is bound to a text field we have to disallow all non-text formats - if ((DataType::CHAR == _nDataType) || (DataType::VARCHAR == _nDataType) || (DataType::LONGVARCHAR == _nDataType)) + if ((DataType::CHAR == _nDataType) || (DataType::VARCHAR == _nDataType) || (DataType::LONGVARCHAR == _nDataType) || (DataType::CLOB == _nDataType)) { bText = sal_True; pFormatDescriptor->Put(SfxBoolItem(SID_ATTR_NUMBERFORMAT_ONE_AREA, sal_True)); @@ -1622,6 +1628,10 @@ TOTypeInfoSP queryTypeInfoByType(sal_Int32 _nDataType,const OTypeInfoMap& _rType if ( pTypeInfo = queryTypeInfoByType(DataType::LONGVARCHAR,_rTypeInfo) ) break; break; + case DataType::LONGVARCHAR: + if ( pTypeInfo = queryTypeInfoByType(DataType::CLOB,_rTypeInfo) ) + break; + break; default: ; } // switch(_nDataType) diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx index 63a910929836..85804dec9d0c 100644 --- a/dbaccess/source/ui/misc/WCPage.cxx +++ b/dbaccess/source/ui/misc/WCPage.cxx @@ -227,7 +227,8 @@ sal_Bool OCopyTable::LeavePage() if ( !aNameCheck.isNameValid( m_edTableName.GetText(), aErrorInfo ) ) { aErrorInfo.append( SQLExceptionInfo::SQL_CONTEXT, String( ModuleRes( STR_SUGGEST_APPEND_TABLE_DATA ) ) ); - ::dbaui::showError( aErrorInfo, m_pParent, m_pParent->m_xFactory ); + m_pParent->showError(aErrorInfo.get()); + return sal_False; } @@ -245,7 +246,8 @@ sal_Bool OCopyTable::LeavePage() sal_Int32 nMaxLength = xMeta->getMaxTableNameLength(); if ( nMaxLength && sTable.getLength() > nMaxLength ) { - ErrorBox(this, ModuleRes(ERROR_INVALID_TABLE_NAME_LENGTH)).Execute(); + String sError(ModuleRes(STR_INVALID_TABLE_NAME_LENGTH)); + m_pParent->showError(sError); return sal_False; } @@ -256,8 +258,7 @@ sal_Bool OCopyTable::LeavePage() String aInfoString( ModuleRes(STR_WIZ_PKEY_ALREADY_DEFINED) ); aInfoString += String(' '); aInfoString += String(m_pParent->m_aKeyName); - InfoBox aNameInfoBox( this, aInfoString ); - aNameInfoBox.Execute(); + m_pParent->showError(aInfoString); return sal_False; } } @@ -288,7 +289,8 @@ sal_Bool OCopyTable::LeavePage() if(!m_pParent->m_sName.getLength()) { - ErrorBox(this, ModuleRes(ERROR_INVALID_TABLE_NAME)).Execute(); + String sError(ModuleRes(STR_INVALID_TABLE_NAME)); + m_pParent->showError(sError); return sal_False; } @@ -367,9 +369,8 @@ sal_Bool OCopyTable::checkAppendData() if ( !xTable.is() ) { - ErrorBox( this, ModuleRes( ERROR_INVALID_TABLE_NAME ) ).Execute(); - // TODO: shouldn't this be some kind of showError? In case of the UNO service for this wizard, - // shouldn't this even be a usage of the service's interaction handler? + String sError(ModuleRes(STR_INVALID_TABLE_NAME)); + m_pParent->showError(sError); return sal_False; } return sal_True; diff --git a/dbaccess/source/ui/misc/WColumnSelect.cxx b/dbaccess/source/ui/misc/WColumnSelect.cxx index 69d5c3bad4fd..12173965f739 100644 --- a/dbaccess/source/ui/misc/WColumnSelect.cxx +++ b/dbaccess/source/ui/misc/WColumnSelect.cxx @@ -140,6 +140,7 @@ void OWizColumnSelect::Reset() clearListBox(m_lbOrgColumnNames); clearListBox(m_lbNewColumnNames); + m_pParent->m_mNameMapping.clear(); // insert the source columns in the left listbox const ODatabaseExport::TColumnVector* pSrcColumns = m_pParent->getSrcVector(); diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index 1feb51cf49a9..b178947bf5f9 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -46,6 +46,7 @@ /** === begin UNO includes === **/ #include <com/sun/star/sdb/application/CopyTableOperation.hpp> +#include <com/sun/star/sdb/SQLContext.hpp> #include <com/sun/star/sdbc/ColumnValue.hpp> #include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/sdbc/XResultSet.hpp> @@ -62,7 +63,10 @@ #include <comphelper/extract.hxx> #include <comphelper/types.hxx> +#include <comphelper/interaction.hxx> #include <connectivity/dbtools.hxx> +#include <connectivity/dbmetadata.hxx> +#include <connectivity/dbexception.hxx> #include <rtl/logfile.hxx> #include <rtl/ustrbuf.hxx> @@ -79,9 +83,12 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::com::sun::star::util; +using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::task; +using namespace dbtools; namespace CopyTableOperation = ::com::sun::star::sdb::application::CopyTableOperation; @@ -565,7 +572,8 @@ namespace //------------------------------------------------------------------------ OCopyTableWizard::OCopyTableWizard( Window * pParent, const ::rtl::OUString& _rDefaultName, sal_Int16 _nOperation, const ICopyTableSourceObject& _rSourceObject, const Reference< XConnection >& _xSourceConnection, - const Reference< XConnection >& _xConnection, const Reference< XMultiServiceFactory >& _rxORB ) + const Reference< XConnection >& _xConnection, const Reference< XMultiServiceFactory >& _rxORB, + const Reference< XInteractionHandler>& _xInteractionHandler) : WizardDialog( pParent, ModuleRes(WIZ_RTFCOPYTABLE)) ,m_pbHelp( this , ModuleRes(PB_HELP)) ,m_pbCancel( this , ModuleRes(PB_CANCEL)) @@ -577,6 +585,7 @@ OCopyTableWizard::OCopyTableWizard( Window * pParent, const ::rtl::OUString& _rD ,m_rSourceObject( _rSourceObject ) ,m_xFormatter( getNumberFormatter( _xConnection, _rxORB ) ) ,m_xFactory(_rxORB) + ,m_xInteractionHandler(_xInteractionHandler) ,m_sTypeNames(ModuleRes(STR_TABLEDESIGN_DBFIELDTYPES)) ,m_nPageCount(0) ,m_bDeleteSourceColumns(sal_True) @@ -632,6 +641,22 @@ OCopyTableWizard::OCopyTableWizard( Window * pParent, const ::rtl::OUString& _rD if ( !lcl_sameConnection_throw( _xSourceConnection, m_xDestConnection ) ) bAllowViews = false; + if ( m_bInterConnectionCopy ) + { + Reference< XDatabaseMetaData > xSrcMeta = _xSourceConnection->getMetaData(); + ::rtl::OUString sCatalog; + ::rtl::OUString sSchema; + ::rtl::OUString sTable; + ::dbtools::qualifiedNameComponents( xSrcMeta, + m_sName, + sCatalog, + sSchema, + sTable, + ::dbtools::eInDataManipulation); + + m_sName = ::dbtools::composeTableName(m_xDestConnection->getMetaData(),sCatalog,sSchema,sTable,sal_False,::dbtools::eInTableDefinitions); + } + OCopyTable* pPage1( new OCopyTable( this ) ); pPage1->disallowUseHeaderLine(); if ( !bAllowViews ) @@ -684,6 +709,8 @@ OCopyTableWizard::OCopyTableWizard( Window* pParent, const ::rtl::OUString& _rDe ::dbaui::fillTypeInfo( _xConnection, m_sTypeNames, m_aTypeInfo, m_aTypeInfoIndex ); ::dbaui::fillTypeInfo( _xConnection, m_sTypeNames, m_aDestTypeInfo, m_aDestTypeInfoIndex ); + m_xInteractionHandler.set( m_xFactory->createInstance( SERVICE_SDB_INTERACTION_HANDLER ), UNO_QUERY); + OCopyTable* pPage1( new OCopyTable( this ) ); pPage1->disallowViews(); pPage1->setCreateStyleAction(); @@ -907,6 +934,7 @@ IMPL_LINK( OCopyTableWizard, ImplOKHdl, OKButton*, EMPTYARG ) OWizTypeSelect* pPage = static_cast<OWizTypeSelect*>(GetPage(3)); if ( pPage ) { + m_mNameMapping.clear(); pPage->setDisplayRow(nBreakPos); ShowPage(3); return 0; @@ -918,33 +946,37 @@ IMPL_LINK( OCopyTableWizard, ImplOKHdl, OKButton*, EMPTYARG ) { ODatabaseExport::TColumns::iterator aFind = ::std::find_if(m_vDestColumns.begin(),m_vDestColumns.end() ,::std::compose1(::std::mem_fun(&OFieldDescription::IsPrimaryKey),::std::select2nd<ODatabaseExport::TColumns::value_type>())); - if ( aFind == m_vDestColumns.end() ) + if ( aFind == m_vDestColumns.end() && m_xInteractionHandler.is() ) { + String sTitle(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY_HEAD)); String sMsg(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY)); - OSQLMessageBox aBox(this, sTitle,sMsg, WB_YES_NO_CANCEL | WB_DEF_YES); - - INT16 nReturn = aBox.Execute(); - - switch(nReturn ) + SQLContext aError; + aError.Message = sMsg; + ::rtl::Reference< ::comphelper::OInteractionRequest > xRequest( new ::comphelper::OInteractionRequest( makeAny( aError ) ) ); + ::rtl::Reference< ::comphelper::OInteractionApprove > xYes = new ::comphelper::OInteractionApprove; + xRequest->addContinuation( xYes.get() ); + xRequest->addContinuation( new ::comphelper::OInteractionDisapprove ); + ::rtl::Reference< ::comphelper::OInteractionAbort > xAbort = new ::comphelper::OInteractionAbort; + xRequest->addContinuation( xAbort.get() ); + + m_xInteractionHandler->handle( xRequest.get() ); + + if ( xYes->wasSelected() ) { - case RET_YES: - { - OCopyTable* pPage = static_cast<OCopyTable*>(GetPage(0)); - m_bCreatePrimaryKeyColumn = sal_True; - m_aKeyName = pPage->GetKeyName(); - if ( !m_aKeyName.getLength() ) - m_aKeyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ID" ) ); - m_aKeyName = createUniqueName( m_aKeyName ); - sal_Int32 nBreakPos2 = 0; - CheckColumns(nBreakPos2); - break; - } - case RET_CANCEL: - ShowPage(3); - return 0; - default: - ; + OCopyTable* pPage = static_cast<OCopyTable*>(GetPage(0)); + m_bCreatePrimaryKeyColumn = sal_True; + m_aKeyName = pPage->GetKeyName(); + if ( !m_aKeyName.getLength() ) + m_aKeyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ID" ) ); + m_aKeyName = createUniqueName( m_aKeyName ); + sal_Int32 nBreakPos2 = 0; + CheckColumns(nBreakPos2); + } + else if ( xAbort->wasSelected() ) + { + ShowPage(3); + return 0; } } } @@ -1381,23 +1413,12 @@ Reference< XPropertySet > OCopyTableWizard::createTable() // ----------------------------------------------------------------------------- bool OCopyTableWizard::supportsPrimaryKey( const Reference< XConnection >& _rxConnection ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OCopyTableWizard::supportsPrimaryKey" ); OSL_PRECOND( _rxConnection.is(), "OCopyTableWizard::supportsPrimaryKey: invalid connection!" ); + if ( !_rxConnection.is() ) + return false; - bool bSupports( false ); - if ( _rxConnection.is() ) - { - try - { - Reference< XDatabaseMetaData > xMetaData( _rxConnection->getMetaData(), UNO_QUERY_THROW ); - bSupports = xMetaData->supportsCoreSQLGrammar(); - } - catch(const Exception&) - { - DBG_UNHANDLED_EXCEPTION(); - } - } - return bSupports; + ::dbtools::DatabaseMetaData aMetaData( _rxConnection ); + return aMetaData.supportsPrimaryKeys(); } // ----------------------------------------------------------------------------- @@ -1591,6 +1612,26 @@ TOTypeInfoSP OCopyTableWizard::convertType(const TOTypeInfoSP& _pType,sal_Bool& if ( supportsType(DataType::LONGVARCHAR,nDefaultType) ) break; break; + case DataType::LONGVARCHAR: + if ( supportsType(DataType::CLOB,nDefaultType) ) + break; + break; + case DataType::BINARY: + if ( supportsType(DataType::VARBINARY,nDefaultType) ) + break; + break; + case DataType::VARBINARY: + if ( supportsType(DataType::LONGVARBINARY,nDefaultType) ) + break; + break; + case DataType::LONGVARBINARY: + if ( supportsType(DataType::BLOB,nDefaultType) ) + break; + if ( supportsType(DataType::LONGVARCHAR,nDefaultType) ) + break; + if ( supportsType(DataType::CLOB,nDefaultType) ) + break; + break; default: nDefaultType = DataType::VARCHAR; } @@ -1636,7 +1677,28 @@ void OCopyTableWizard::showColumnTypeNotSupported(const ::rtl::OUString& _rColum RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OCopyTableWizard::showColumnTypeNotSupported" ); String sMessage( ModuleRes( STR_UNKNOWN_TYPE_FOUND ) ); sMessage.SearchAndReplaceAscii("#1",_rColumnName); - - OSQLWarningBox( this, sMessage ).Execute(); + showError(sMessage); +} +//------------------------------------------------------------------------------- +void OCopyTableWizard::showError(const ::rtl::OUString& _sErrorMesage) +{ + SQLExceptionInfo aInfo(_sErrorMesage); + showError(aInfo.get()); } //------------------------------------------------------------------------------- +void OCopyTableWizard::showError(const Any& _aError) +{ + if ( _aError.hasValue() && m_xInteractionHandler.is() ) + { + try + { + ::rtl::Reference< ::comphelper::OInteractionRequest > xRequest( new ::comphelper::OInteractionRequest( _aError ) ); + m_xInteractionHandler->handle( xRequest.get() ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } +} + diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx index ceeb058528df..a964b0e13d38 100644 --- a/dbaccess/source/ui/misc/WTypeSelect.cxx +++ b/dbaccess/source/ui/misc/WTypeSelect.cxx @@ -178,7 +178,7 @@ void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId ) { String strMessage = String(ModuleRes(STR_TABLEDESIGN_DUPLICATE_NAME)); strMessage.SearchAndReplaceAscii("$column$", sNewName); - OSQLWarningBox( this, strMessage ).Execute(); + pWiz->showError(strMessage); pCurFieldDescr->SetName(sName); DisplayData(pCurFieldDescr); static_cast<OWizTypeSelect*>(GetParent())->setDuplicateName(sal_True); diff --git a/dbaccess/source/ui/misc/WizardPages.src b/dbaccess/source/ui/misc/WizardPages.src index 638feb92e54c..329f08b222d9 100644 --- a/dbaccess/source/ui/misc/WizardPages.src +++ b/dbaccess/source/ui/misc/WizardPages.src @@ -552,20 +552,18 @@ String STR_COPYTABLE_TITLE_COPY Text [ en-US ] = "Copy table" ; }; -ErrorBox ERROR_INVALID_TABLE_NAME +String STR_INVALID_TABLE_NAME { - Buttons = WB_OK; - Message [ en-US ] = "This table name is not valid in the current database."; + Text [ en-US ] = "This table name is not valid in the current database."; }; String STR_SUGGEST_APPEND_TABLE_DATA { Text [ en-US ] = "Choose the option 'Append data' on the first page to append data to an existing table."; }; -ErrorBox ERROR_INVALID_TABLE_NAME_LENGTH +String STR_INVALID_TABLE_NAME_LENGTH { - Buttons = WB_OK; - Message [ en-US ] = "Please change the table name. It is too long."; + Text [ en-US ] = "Please change the table name. It is too long."; }; Image IMG_SORTUP_H diff --git a/dbaccess/source/ui/misc/datasourceconnector.cxx b/dbaccess/source/ui/misc/datasourceconnector.cxx index 470ab5f08ba3..409e86150843 100644 --- a/dbaccess/source/ui/misc/datasourceconnector.cxx +++ b/dbaccess/source/ui/misc/datasourceconnector.cxx @@ -86,7 +86,7 @@ #include <vcl/button.hxx> #endif #ifndef SVTOOLS_FILENOTATION_HXX -#include <svtools/filenotation.hxx> +#include <svl/filenotation.hxx> #endif #ifndef TOOLS_DIAGNOSE_EX_H #include <tools/diagnose_ex.h> diff --git a/dbaccess/source/ui/misc/dsmeta.cxx b/dbaccess/source/ui/misc/dsmeta.cxx index b152f12688e2..7d299c7f5910 100644 --- a/dbaccess/source/ui/misc/dsmeta.cxx +++ b/dbaccess/source/ui/misc/dsmeta.cxx @@ -47,32 +47,6 @@ namespace dbaui using namespace ::com::sun::star; /** === end UNO using === **/ - struct InitAdvanced : public AdvancedSettingsSupport - { - enum Special { All, AllButIgnoreCurrency, None }; - - InitAdvanced( Special _eType ) - :AdvancedSettingsSupport() - { - bGeneratedValues = ( _eType == All ) || ( _eType == AllButIgnoreCurrency ); - bUseSQL92NamingConstraints = ( _eType == All ) || ( _eType == AllButIgnoreCurrency ); - bAppendTableAliasInSelect = ( _eType == All ) || ( _eType == AllButIgnoreCurrency ); - bUseKeywordAsBeforeAlias = ( _eType == All ) || ( _eType == AllButIgnoreCurrency ); - bUseBracketedOuterJoinSyntax = ( _eType == All ) || ( _eType == AllButIgnoreCurrency ); - bIgnoreDriverPrivileges = ( _eType == All ) || ( _eType == AllButIgnoreCurrency ); - bParameterNameSubstitution = ( _eType == All ) || ( _eType == AllButIgnoreCurrency ); - bDisplayVersionColumns = ( _eType == All ) || ( _eType == AllButIgnoreCurrency ); - bUseCatalogInSelect = ( _eType == All ) || ( _eType == AllButIgnoreCurrency ); - bUseSchemaInSelect = ( _eType == All ) || ( _eType == AllButIgnoreCurrency ); - bUseIndexDirectionKeyword = ( _eType == All ) || ( _eType == AllButIgnoreCurrency ); - bUseDOSLineEnds = ( _eType == All ) || ( _eType == AllButIgnoreCurrency ); - bBooleanComparisonMode = ( _eType == All ) || ( _eType == AllButIgnoreCurrency ); - bFormsCheckRequiredFields = ( _eType == All ) || ( _eType == AllButIgnoreCurrency ); - bIgnoreCurrency = ( _eType == All ); - bEscapeDateTime = ( _eType == All ) || ( _eType == AllButIgnoreCurrency ); - } - }; - struct FeatureSupport { // authentication mode of the data source @@ -89,98 +63,75 @@ namespace dbaui } }; + struct FeatureMapping + { + /// one of the items from dsitems.hxx + ItemID nItemID; + const sal_Char* pAsciiFeatureName; + }; + //==================================================================== //= global tables //==================================================================== //-------------------------------------------------------------------- - static const AdvancedSettingsSupport& getAdvancedSettingsSupport( const ::rtl::OUString& _sURL ) + static const FeatureMapping* lcl_getFeatureMappings() { - DECLARE_STL_USTRINGACCESS_MAP( AdvancedSettingsSupport, AdvancedSupport); - static AdvancedSupport s_aSupport; - if ( s_aSupport.empty() ) + static const FeatureMapping s_aMappings[] = { + { DSID_AUTORETRIEVEENABLED, "GeneratedValues" }, + { DSID_AUTOINCREMENTVALUE, "GeneratedValues" }, + { DSID_AUTORETRIEVEVALUE, "GeneratedValues" }, + { DSID_SQL92CHECK, "UseSQL92NamingConstraints" }, + { DSID_APPEND_TABLE_ALIAS, "AppendTableAliasInSelect" }, + { DSID_AS_BEFORE_CORRNAME, "UseKeywordAsBeforeAlias" }, + { DSID_ENABLEOUTERJOIN, "UseBracketedOuterJoinSyntax" }, + { DSID_IGNOREDRIVER_PRIV, "IgnoreDriverPrivileges" }, + { DSID_PARAMETERNAMESUBST, "ParameterNameSubstitution" }, + { DSID_SUPPRESSVERSIONCL, "DisplayVersionColumns" }, + { DSID_CATALOG, "UseCatalogInSelect" }, + { DSID_SCHEMA, "UseSchemaInSelect" }, + { DSID_INDEXAPPENDIX, "UseIndexDirectionKeyword" }, + { DSID_DOSLINEENDS, "UseDOSLineEnds" }, + { DSID_BOOLEANCOMPARISON, "BooleanComparisonMode" }, + { DSID_CHECK_REQUIRED_FIELDS, "FormsCheckRequiredFields" }, + { DSID_IGNORECURRENCY, "IgnoreCurrency" }, + { DSID_ESCAPE_DATETIME, "EscapeDateTime" }, + { DSID_PRIMARY_KEY_SUPPORT, "PrimaryKeySupport" }, + { 0, NULL } + }; + return s_aMappings; + } + + //-------------------------------------------------------------------- + static const FeatureSet& lcl_getFeatureSet( const ::rtl::OUString _rURL ) + { + typedef ::std::map< ::rtl::OUString, FeatureSet, ::comphelper::UStringLess > FeatureSets; + static FeatureSets s_aFeatureSets; + if ( s_aFeatureSets.empty() ) { - ::connectivity::DriversConfig aDriverConfig(::comphelper::getProcessServiceFactory()); - const uno::Sequence< ::rtl::OUString > aURLs = aDriverConfig.getURLs(); - const ::rtl::OUString* pIter = aURLs.getConstArray(); - const ::rtl::OUString* pEnd = pIter + aURLs.getLength(); - for(;pIter != pEnd;++pIter) + ::connectivity::DriversConfig aDriverConfig( ::comphelper::getProcessServiceFactory() ); + const uno::Sequence< ::rtl::OUString > aPatterns = aDriverConfig.getURLs(); + for ( const ::rtl::OUString* pattern = aPatterns.getConstArray(); + pattern != aPatterns.getConstArray() + aPatterns.getLength(); + ++pattern + ) { - InitAdvanced aInit(InitAdvanced::None); - const uno::Sequence< beans::NamedValue> aProperties = aDriverConfig.getFeatures(*pIter).getNamedValues(); - const beans::NamedValue* pPropertiesIter = aProperties.getConstArray(); - const beans::NamedValue* pPropertiesEnd = pPropertiesIter + aProperties.getLength(); - for (;pPropertiesIter != pPropertiesEnd ; ++pPropertiesIter) + FeatureSet aCurrentSet; + const ::comphelper::NamedValueCollection aCurrentFeatures( aDriverConfig.getFeatures( *pattern ).getNamedValues() ); + + const FeatureMapping* pFeatureMapping = lcl_getFeatureMappings(); + while ( pFeatureMapping->pAsciiFeatureName ) { - if ( pPropertiesIter->Name.equalsAscii("GeneratedValues") ) - { - pPropertiesIter->Value >>= aInit.bGeneratedValues; - } - else if ( pPropertiesIter->Name.equalsAscii("UseSQL92NamingConstraints") ) - { - pPropertiesIter->Value >>= aInit.bUseSQL92NamingConstraints; - } - else if ( pPropertiesIter->Name.equalsAscii("AppendTableAliasInSelect") ) - { - pPropertiesIter->Value >>= aInit.bAppendTableAliasInSelect; - } - else if ( pPropertiesIter->Name.equalsAscii("UseKeywordAsBeforeAlias") ) - { - pPropertiesIter->Value >>= aInit.bUseKeywordAsBeforeAlias; - } - else if ( pPropertiesIter->Name.equalsAscii("UseBracketedOuterJoinSyntax") ) - { - pPropertiesIter->Value >>= aInit.bUseBracketedOuterJoinSyntax; - } - else if ( pPropertiesIter->Name.equalsAscii("IgnoreDriverPrivileges") ) - { - pPropertiesIter->Value >>= aInit.bIgnoreDriverPrivileges; - } - else if ( pPropertiesIter->Name.equalsAscii("ParameterNameSubstitution") ) - { - pPropertiesIter->Value >>= aInit.bParameterNameSubstitution; - } - else if ( pPropertiesIter->Name.equalsAscii("DisplayVersionColumns") ) - { - pPropertiesIter->Value >>= aInit.bDisplayVersionColumns; - } - else if ( pPropertiesIter->Name.equalsAscii("UseCatalogInSelect") ) - { - pPropertiesIter->Value >>= aInit.bUseCatalogInSelect; - } - else if ( pPropertiesIter->Name.equalsAscii("UseSchemaInSelect") ) - { - pPropertiesIter->Value >>= aInit.bUseSchemaInSelect; - } - else if ( pPropertiesIter->Name.equalsAscii("UseIndexDirectionKeyword") ) - { - pPropertiesIter->Value >>= aInit.bUseIndexDirectionKeyword; - } - else if ( pPropertiesIter->Name.equalsAscii("UseDOSLineEnds") ) - { - pPropertiesIter->Value >>= aInit.bUseDOSLineEnds; - } - else if ( pPropertiesIter->Name.equalsAscii("BooleanComparisonMode") ) - { - pPropertiesIter->Value >>= aInit.bBooleanComparisonMode; - } - else if ( pPropertiesIter->Name.equalsAscii("FormsCheckRequiredFields") ) - { - pPropertiesIter->Value >>= aInit.bFormsCheckRequiredFields; - } - else if ( pPropertiesIter->Name.equalsAscii("IgnoreCurrency") ) - { - pPropertiesIter->Value >>= aInit.bIgnoreCurrency; - } - else if ( pPropertiesIter->Name.equalsAscii("EscapeDateTime") ) - { - pPropertiesIter->Value >>= aInit.bEscapeDateTime; - } - } // for (;pPropertiesIter != pPropertiesEnd ; ++pPropertiesIter) - s_aSupport.insert(AdvancedSupport::value_type(*pIter,aInit)); + if ( aCurrentFeatures.has( pFeatureMapping->pAsciiFeatureName ) ) + aCurrentSet.put( pFeatureMapping->nItemID ); + ++pFeatureMapping; + } + + s_aFeatureSets[ *pattern ] = aCurrentSet; } - } // if ( s_aSupport.empty() ) - OSL_ENSURE(s_aSupport.find(_sURL) != s_aSupport.end(),"Illegal URL!"); - return s_aSupport[ _sURL ]; + } + + OSL_ENSURE( s_aFeatureSets.find( _rURL ) != s_aFeatureSets.end(), "invalid URL/pattern!" ); + return s_aFeatureSets[ _rURL ]; } //-------------------------------------------------------------------- @@ -208,8 +159,8 @@ namespace dbaui aInit = AuthPwd; } s_aSupport.insert(Supported::value_type(*pIter,aInit)); - } // for(;pIter != pEnd;++pIter) - } // if ( s_aSupport.empty() ) + } + } OSL_ENSURE(s_aSupport.find(_sURL) != s_aSupport.end(),"Illegal URL!"); return s_aSupport[ _sURL ].eAuthentication; } @@ -249,9 +200,9 @@ namespace dbaui } //-------------------------------------------------------------------- - const AdvancedSettingsSupport& DataSourceMetaData::getAdvancedSettingsSupport() const + const FeatureSet& DataSourceMetaData::getFeatureSet() const { - return ::dbaui::getAdvancedSettingsSupport( m_pImpl->getType() ); + return lcl_getFeatureSet( m_pImpl->getType() ); } //-------------------------------------------------------------------- diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx index 5869f6102eeb..13549b72d84c 100644 --- a/dbaccess/source/ui/misc/linkeddocuments.cxx +++ b/dbaccess/source/ui/misc/linkeddocuments.cxx @@ -92,7 +92,7 @@ #include "dbu_misc.hrc" #endif #ifndef SVTOOLS_FILENOTATION_HXX_ -#include <svtools/filenotation.hxx> +#include <svl/filenotation.hxx> #endif #ifndef DBACCESS_UI_BROWSER_ID_HXX #include "browserids.hxx" @@ -350,7 +350,7 @@ namespace dbaui //------------------------------------------------------------------ Reference< XComponent > OLinkedDocumentsAccess::newDocument( sal_Int32 _nNewFormId, Reference< XComponent >& _xDefinition, const sal_Int32 _nCommandType, const ::rtl::OUString& _sObjectName ) { - OSL_ENSURE(m_xDocumentContainer.is(), "OLinkedDocumentsAccess::OLinkedDocumentsAccess: invalid document container!"); + OSL_ENSURE(m_xDocumentContainer.is(), "OLinkedDocumentsAccess::newDocument: invalid document container!"); // determine the URL to use for the new document Sequence<sal_Int8> aClassId; switch (_nNewFormId) @@ -373,7 +373,7 @@ namespace dbaui case SID_DB_FORM_NEW_PILOT: default: - OSL_ENSURE(sal_False, "OLinkedDocumentsAccess::newForm: pleas use newFormWithPilot!"); + OSL_ENSURE(sal_False, "OLinkedDocumentsAccess::newDocument: please use newFormWithPilot!"); return Reference< XComponent >(); } diff --git a/dbaccess/source/ui/misc/moduledbu.cxx b/dbaccess/source/ui/misc/moduledbu.cxx index 69845372114f..6d3cae9fc6ed 100644 --- a/dbaccess/source/ui/misc/moduledbu.cxx +++ b/dbaccess/source/ui/misc/moduledbu.cxx @@ -39,7 +39,7 @@ #include <tools/resmgr.hxx> #endif #ifndef _SOLAR_HRC -#include <svtools/solar.hrc> +#include <svl/solar.hrc> #endif #ifndef _TOOLS_DEBUG_HXX #include <tools/debug.hxx> diff --git a/dbaccess/source/ui/misc/propertystorage.cxx b/dbaccess/source/ui/misc/propertystorage.cxx index 0ae5631b5803..26172eab9364 100644 --- a/dbaccess/source/ui/misc/propertystorage.cxx +++ b/dbaccess/source/ui/misc/propertystorage.cxx @@ -36,9 +36,9 @@ /** === begin UNO includes === **/ /** === end UNO includes === **/ -#include <svtools/itemset.hxx> -#include <svtools/stritem.hxx> -#include <svtools/eitem.hxx> +#include <svl/itemset.hxx> +#include <svl/stritem.hxx> +#include <svl/eitem.hxx> #include <memory> diff --git a/dbaccess/source/ui/querydesign/JoinDesignView.cxx b/dbaccess/source/ui/querydesign/JoinDesignView.cxx index bd0a593cfe89..11eb8e36f3ee 100644 --- a/dbaccess/source/ui/querydesign/JoinDesignView.cxx +++ b/dbaccess/source/ui/querydesign/JoinDesignView.cxx @@ -40,7 +40,7 @@ #include "JoinController.hxx" #endif #ifndef _UNDO_HXX -#include <svtools/undo.hxx> +#include <svl/undo.hxx> #endif #ifndef DBAUI_QYDLGTAB_HXX #include "adtabdlg.hxx" diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index 16f4990cb5b5..c240363c69e7 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -70,7 +70,7 @@ #include "browserids.hxx" #endif #ifndef _URLBMK_HXX -#include <svtools/urlbmk.hxx> +#include <svl/urlbmk.hxx> #endif #ifndef _COM_SUN_STAR_SDBC_XDATABASEMETADATA_HPP_ #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index 6c94d9bc869c..83ed283a4836 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -49,7 +49,7 @@ #include <vcl/split.hxx> #endif #ifndef _UNDO_HXX -#include <svtools/undo.hxx> +#include <svl/undo.hxx> #endif #ifndef TOOLS_DIAGNOSE_EX_H #include <tools/diagnose_ex.h> @@ -133,7 +133,7 @@ #include "sqlmessage.hxx" #endif #ifndef INCLUDED_SVTOOLS_SYSLOCALE_HXX -#include <svtools/syslocale.hxx> +#include <unotools/syslocale.hxx> #endif using namespace ::dbaui; @@ -186,11 +186,6 @@ namespace sal_Bool bHaving, bool _bAddOrOnOneLine); - void fillFunctionInfo( OQueryDesignView* _pView - ,const ::connectivity::OSQLParseNode* pNode - ,const ::rtl::OUString& sFunctionTerm - ,OTableFieldDescRef& aInfo); - //------------------------------------------------------------------------------ ::rtl::OUString quoteTableAlias(sal_Bool _bQuote, const ::rtl::OUString& _sAliasName, const ::rtl::OUString& _sQuote) { @@ -2180,35 +2175,6 @@ namespace return eErrorCode; } //------------------------------------------------------------------------------ - void fillFunctionInfo( OQueryDesignView* _pView - ,const ::connectivity::OSQLParseNode* pNode - ,const ::rtl::OUString& sFunctionTerm - ,OTableFieldDescRef& aInfo) - { - // get the type out of the funtion name - OQueryController& rController = static_cast<OQueryController&>(_pView->getController()); - sal_Int32 nDataType = DataType::DOUBLE; - ::rtl::OUString sFieldName = sFunctionTerm; - OSQLParseNode* pFunctionName = pNode->getChild(0); - if ( !SQL_ISPUNCTUATION(pFunctionName,"{") ) - { - if ( SQL_ISRULEOR2(pNode,length_exp,char_value_fct) ) - pFunctionName = pFunctionName->getChild(0); - - ::rtl::OUString sFunctionName = pFunctionName->getTokenValue(); - if ( !sFunctionName.getLength() ) - sFunctionName = ::rtl::OStringToOUString(OSQLParser::TokenIDToStr(pFunctionName->getTokenID()),RTL_TEXTENCODING_UTF8); - - nDataType = OSQLParser::getFunctionReturnType( - sFunctionName - ,&rController.getParser().getContext()); - } - aInfo->SetDataType(nDataType); - aInfo->SetFieldType(TAB_NORMAL_FIELD); - aInfo->SetField(sFieldName); - aInfo->SetTabWindow(NULL); - } - //------------------------------------------------------------------------------ SqlParseError InstallFields(OQueryDesignView* _pView, const ::connectivity::OSQLParseNode* pNode, OJoinTableView::OTableWindowMap* pTabList ) @@ -2216,7 +2182,7 @@ namespace if( pNode==0 || !SQL_ISRULE(pNode,select_statement)) return eNoSelectStatement; - ::connectivity::OSQLParseNode* pParseTree = pNode->getChild(2); + ::connectivity::OSQLParseNode* pParseTree = pNode->getChild(2); // selection sal_Bool bFirstField = sal_True; // bei der Initialisierung mu auf alle Faelle das erste Feld neu aktiviert werden SqlParseError eErrorCode = eOk; @@ -2247,9 +2213,6 @@ namespace if ( SQL_ISRULE(pColumnRef,derived_column) ) { - if ( !xConnection.is() ) - break; - ::rtl::OUString aColumnAlias(rController.getParseIterator().getColumnAlias(pColumnRef)); // kann leer sein pColumnRef = pColumnRef->getChild(0); OTableFieldDescRef aInfo = new OTableFieldDesc(); @@ -2330,7 +2293,7 @@ namespace } else { - fillFunctionInfo(_pView,pColumnRef,aColumns,aInfo); + _pView->fillFunctionInfo(pColumnRef,aColumns,aInfo); aInfo->SetFieldAlias(aColumnAlias); } @@ -2451,7 +2414,7 @@ namespace _pView->getLocale(), static_cast<sal_Char>(_pView->getDecimalSeparator().toChar()), &rController.getParser().getContext()); - fillFunctionInfo(_pView,pArgument,sCondition,aDragLeft); + _pView->fillFunctionInfo(pArgument,sCondition,aDragLeft); aDragLeft->SetFunctionType(FKT_OTHER); aDragLeft->SetOrderDir(eOrderDir); aDragLeft->SetVisible(sal_False); @@ -2483,7 +2446,7 @@ namespace const ::connectivity::OSQLParseNode* pSelectRoot ) { SqlParseError eErrorCode = eOk; - if (!pSelectRoot->getChild(3)->getChild(2)->isLeaf()) + if (!pSelectRoot->getChild(3)->getChild(2)->isLeaf()) // opt_group_by_clause { OQueryController& rController = static_cast<OQueryController&>(_pView->getController()); ::connectivity::OSQLParseNode* pGroupBy = pSelectRoot->getChild(3)->getChild(2)->getChild(2); @@ -2518,7 +2481,7 @@ namespace &rController.getParser().getContext(), sal_True, sal_True); // quote is to true because we need quoted elements inside the function - fillFunctionInfo(_pView,pArgument,sGroupByExpression,aDragInfo); + _pView->fillFunctionInfo(pArgument,sGroupByExpression,aDragInfo); aDragInfo->SetFunctionType(FKT_OTHER); aDragInfo->SetGroupBy(sal_True); aDragInfo->SetVisible(sal_False); @@ -3242,4 +3205,32 @@ bool OQueryDesignView::initByParseIterator( ::dbtools::SQLExceptionInfo* _pError } return eErrorCode == eOk; } +//------------------------------------------------------------------------------ +void OQueryDesignView::fillFunctionInfo( const ::connectivity::OSQLParseNode* pNode + ,const ::rtl::OUString& sFunctionTerm + ,OTableFieldDescRef& aInfo) +{ + // get the type out of the funtion name + OQueryController& rController = static_cast<OQueryController&>(getController()); + sal_Int32 nDataType = DataType::DOUBLE; + ::rtl::OUString sFieldName = sFunctionTerm; + OSQLParseNode* pFunctionName = pNode->getChild(0); + if ( !SQL_ISPUNCTUATION(pFunctionName,"{") ) + { + if ( SQL_ISRULEOR2(pNode,length_exp,char_value_fct) ) + pFunctionName = pFunctionName->getChild(0); + + ::rtl::OUString sFunctionName = pFunctionName->getTokenValue(); + if ( !sFunctionName.getLength() ) + sFunctionName = ::rtl::OStringToOUString(OSQLParser::TokenIDToStr(pFunctionName->getTokenID()),RTL_TEXTENCODING_UTF8); + + nDataType = OSQLParser::getFunctionReturnType( + sFunctionName + ,&rController.getParser().getContext()); + } + aInfo->SetDataType(nDataType); + aInfo->SetFieldType(TAB_NORMAL_FIELD); + aInfo->SetField(sFieldName); + aInfo->SetTabWindow(NULL); +} // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 05c001751fef..1b468b2a69c9 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -890,78 +890,56 @@ sal_Bool OSelectionBrowseBox::saveField(const String& _sFieldName,OTableFieldDes OSL_ENSURE(0,"Unsupported function inserted!"); } - else if( SQL_ISRULEOR2(pColumnRef,position_exp,extract_exp) || - SQL_ISRULEOR2(pColumnRef,fold,char_substring_fct) || - SQL_ISRULEOR2(pColumnRef,length_exp,char_value_fct) ) - // a calculation has been found ( can be calc and function ) + else { - // append the whole text as field name // so we first clear the function field clearEntryFunctionField(_sFieldName,aSelEntry,_bListAction,nColumnId); - sal_Bool bQuote = sal_True; - sal_Int32 nDataType = DataType::DOUBLE; - OSQLParseNode* pFunctionName = pColumnRef->getChild(0); - if ( !SQL_ISPUNCTUATION(pFunctionName,"{") ) + ::rtl::OUString sFunction; + pColumnRef->parseNodeToStr( sFunction, + xConnection, + &rController.getParser().getContext(), + sal_True, + sal_True); // quote is to true because we need quoted elements inside the function + + getDesignView()->fillFunctionInfo(pColumnRef,sFunction,aSelEntry); + + if( SQL_ISRULEOR2(pColumnRef,position_exp,extract_exp) || + SQL_ISRULEOR2(pColumnRef,fold,char_substring_fct) || + SQL_ISRULEOR2(pColumnRef,length_exp,char_value_fct) ) + // a calculation has been found ( can be calc and function ) { - if ( SQL_ISRULEOR2(pColumnRef,length_exp,char_value_fct) ) - pFunctionName = pFunctionName->getChild(0); + // now parse the whole statement + sal_uInt32 nFunCount = pColumnRef->count(); + ::rtl::OUString sParameters; + for(sal_uInt32 function = 0; function < nFunCount; ++function) + pColumnRef->getChild(function)->parseNodeToStr( sParameters, xConnection, &rParser.getContext(), sal_True, sal_True ); - if ( pFunctionName ) + sOldAlias = aSelEntry->GetAlias(); + sal_Int32 nNewFunctionType = aSelEntry->GetFunctionType() | FKT_NUMERIC | FKT_OTHER; + aSelEntry->SetFunctionType(nNewFunctionType); + aSelEntry->SetField(sParameters); + } + else + { + aSelEntry->SetFieldAlias(sColumnAlias); + if ( SQL_ISRULE(pColumnRef,set_fct_spec) ) + aSelEntry->SetFunctionType(/*FKT_NUMERIC | */FKT_OTHER); + else { - ::rtl::OUString sFunctionName = pFunctionName->getTokenValue(); - if ( !sFunctionName.getLength() ) - sFunctionName = ::rtl::OStringToOUString(OSQLParser::TokenIDToStr(pFunctionName->getTokenID()),RTL_TEXTENCODING_MS_1252); - - nDataType = OSQLParser::getFunctionReturnType( - sFunctionName - ,&rController.getParser().getContext()); - aSelEntry->SetDataType(nDataType); + if ( SQL_ISRULEOR2(pColumnRef,num_value_exp,term) || SQL_ISRULE(pColumnRef,factor) ) + aSelEntry->SetDataType(DataType::DOUBLE); + else if ( SQL_ISRULE(pColumnRef,value_exp) ) + aSelEntry->SetDataType(DataType::TIMESTAMP); + else + aSelEntry->SetDataType(DataType::VARCHAR); + aSelEntry->SetFunctionType(FKT_NUMERIC | FKT_OTHER); } } - - // now parse the whole statement - sal_uInt32 nFunCount = pColumnRef->count(); - ::rtl::OUString sParameters; - for(sal_uInt32 function = 0; function < nFunCount; ++function) - pColumnRef->getChild(function)->parseNodeToStr( sParameters, xConnection, &rParser.getContext(), sal_True, bQuote ); - - ::rtl::OUString aSelectionAlias = aSelEntry->GetAlias(); aSelEntry->SetAlias(::rtl::OUString()); - - sal_Int32 nNewFunctionType = aSelEntry->GetFunctionType() | FKT_NUMERIC | FKT_OTHER; - aSelEntry->SetFunctionType(nNewFunctionType); - - - aSelEntry->SetFieldType(TAB_NORMAL_FIELD); - - aSelEntry->SetTabWindow(NULL); - - aSelEntry->SetField(sParameters); - notifyTableFieldChanged(aSelectionAlias,aSelEntry->GetAlias(),_bListAction, nColumnId); - } - else - { - clearEntryFunctionField(_sFieldName,aSelEntry,_bListAction,nColumnId); - - ::rtl::OUString aColumns; - pColumnRef->parseNodeToStr( aColumns, - xConnection, - &rController.getParser().getContext(), - sal_True, - sal_True); - // get the type out of the funtion name - sal_Int32 nDataType = DataType::DOUBLE; - aSelEntry->SetDataType(nDataType); - aSelEntry->SetField(aColumns); - aSelEntry->SetFieldType(TAB_NORMAL_FIELD); - aSelEntry->SetTabWindow(NULL); - aSelEntry->SetAlias(::rtl::OUString()); - aSelEntry->SetFieldAlias(sColumnAlias); - aSelEntry->SetFunctionType(FKT_NUMERIC | FKT_OTHER); - notifyTableFieldChanged(sOldAlias,aSelEntry->GetAlias(),_bListAction, nColumnId); } + } if ( i > 0 && InsertField(aSelEntry,BROWSER_INVALIDID,sal_True,sal_False).isEmpty() ) // may we have to append more than one field { // the field could not be isnerted @@ -1207,6 +1185,7 @@ sal_Bool OSelectionBrowseBox::SaveModified() case DataType::CHAR: case DataType::VARCHAR: case DataType::LONGVARCHAR: + case DataType::CLOB: if(aText.GetChar(0) != '\'' || aText.GetChar(aText.Len() -1) != '\'') { aText.SearchAndReplaceAll(String::CreateFromAscii("'"),String::CreateFromAscii("''")); @@ -1806,25 +1785,23 @@ void OSelectionBrowseBox::AddGroupBy( const OTableFieldDescRef& rInfo , sal_uInt pEntry->GetFunctionType() == rInfo->GetFunctionType() && pEntry->GetFunction() == rInfo->GetFunction()) { - /*sal_uInt32 nPos = aIter - rFields.begin(); - bAppend = _nCurrentPos > nPos && (rInfo->IsGroupBy() != pEntry->IsGroupBy()); - if ( bAppend ) + if ( pEntry->isNumericOrAggreateFunction() && rInfo->IsGroupBy() ) + { + pEntry->SetGroupBy(sal_False); aIter = rFields.end(); - else*/ + break; + } + else { - if ( pEntry->isNumericOrAggreateFunction() && rInfo->IsGroupBy() ) - { - pEntry->SetGroupBy(sal_False); - aIter = rFields.end(); - } - else + if ( !pEntry->IsGroupBy() && !pEntry->HasCriteria() ) // here we have a where condition which is no having clause { pEntry->SetGroupBy(rInfo->IsGroupBy()); if(!m_bGroupByUnRelated && pEntry->IsGroupBy()) pEntry->SetVisible(sal_True); + break; } } - break; + } } @@ -1886,13 +1863,14 @@ void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const S if (bCase(aField,rInfo->GetField()) && bCase(aAlias,rInfo->GetAlias()) && pEntry->GetFunctionType() == rInfo->GetFunctionType() && - pEntry->GetFunction() == rInfo->GetFunction()) + pEntry->GetFunction() == rInfo->GetFunction() && + pEntry->IsGroupBy() == rInfo->IsGroupBy() ) { if ( pEntry->isNumericOrAggreateFunction() && rInfo->IsGroupBy() ) pEntry->SetGroupBy(sal_False); else { - pEntry->SetGroupBy(rInfo->IsGroupBy()); +// pEntry->SetGroupBy(rInfo->IsGroupBy()); if(!m_bGroupByUnRelated && pEntry->IsGroupBy()) pEntry->SetVisible(sal_True); } @@ -2889,7 +2867,7 @@ bool OSelectionBrowseBox::HasFieldByAliasName(const ::rtl::OUString& rFieldName, { if ( (*aIter)->GetFieldAlias() == rFieldName ) { - rInfo = *aIter; + rInfo.getBody() = (*aIter).getBody(); break; } } diff --git a/dbaccess/source/ui/querydesign/TableFieldDescription.cxx b/dbaccess/source/ui/querydesign/TableFieldDescription.cxx index 0949c8f5dc11..a00bc3dbd54c 100644 --- a/dbaccess/source/ui/querydesign/TableFieldDescription.cxx +++ b/dbaccess/source/ui/querydesign/TableFieldDescription.cxx @@ -69,24 +69,10 @@ OTableFieldDesc::OTableFieldDesc() //------------------------------------------------------------------------------ OTableFieldDesc::OTableFieldDesc(const OTableFieldDesc& rRS) : ::vos::OReference() - ,m_vecCriteria( rRS.m_vecCriteria) - ,m_aTableName(rRS.GetTable()) - ,m_aAliasName(rRS.GetAlias()) // table range - ,m_aFieldName(rRS.GetField()) // column - ,m_aFieldAlias(rRS.GetFieldAlias()) // column alias - ,m_aFunctionName(rRS.GetFunction()) // Funktionsname - ,m_pTabWindow(rRS.GetTabWindow()) - ,m_eDataType(rRS.GetDataType()) - ,m_eFunctionType( rRS.GetFunctionType() ) - ,m_eFieldType(rRS.GetFieldType()) - ,m_eOrderDir(rRS.GetOrderDir()) - ,m_nIndex(rRS.GetFieldIndex()) - ,m_nColWidth(rRS.GetColWidth()) - ,m_nColumnId( rRS.m_nColumnId) - ,m_bGroupBy(rRS.IsGroupBy()) - ,m_bVisible(rRS.IsVisible()) + { DBG_CTOR(OTableFieldDesc,NULL); + *this = rRS; } //------------------------------------------------------------------------------ @@ -107,7 +93,31 @@ OTableFieldDesc::~OTableFieldDesc() { DBG_DTOR(OTableFieldDesc,NULL); } - +//------------------------------------------------------------------------------ +OTableFieldDesc& OTableFieldDesc::operator=( const OTableFieldDesc& rRS ) +{ + if (&rRS == this) + return *this; + + m_vecCriteria = rRS.m_vecCriteria; + m_aTableName = rRS.GetTable(); + m_aAliasName = rRS.GetAlias(); // table range + m_aFieldName = rRS.GetField(); // column + m_aFieldAlias = rRS.GetFieldAlias(); // column alias + m_aFunctionName = rRS.GetFunction(); // Funktionsname + m_pTabWindow = rRS.GetTabWindow(); + m_eDataType = rRS.GetDataType(); + m_eFunctionType = rRS.GetFunctionType(); + m_eFieldType = rRS.GetFieldType(); + m_eOrderDir = rRS.GetOrderDir(); + m_nIndex = rRS.GetFieldIndex(); + m_nColWidth = rRS.GetColWidth(); + m_nColumnId = rRS.m_nColumnId; + m_bGroupBy = rRS.IsGroupBy(); + m_bVisible = rRS.IsVisible(); + + return *this; +} //------------------------------------------------------------------------------ sal_Bool OTableFieldDesc::operator==( const OTableFieldDesc& rDesc ) { diff --git a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx index 2f3a70890e92..785e29bb9a0c 100644 --- a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx +++ b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx @@ -229,16 +229,17 @@ namespace dbaui Reference < XFrame > xBeamerFrame( m_pViewSwitch->getORB()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.Frame")),UNO_QUERY ); m_xBeamer.set( xBeamerFrame ); + OSL_ENSURE(m_xBeamer.is(),"No frame created!"); + m_xBeamer->initialize( VCLUnoHelper::GetInterface ( m_pBeamer ) ); // notify layout manager to not create internal toolbars Reference < XPropertySet > xPropSet( xBeamerFrame, UNO_QUERY ); try { const ::rtl::OUString aLayoutManager( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" )); - Reference < XPropertySet > xLMPropSet; + Reference < XPropertySet > xLMPropSet(xPropSet->getPropertyValue( aLayoutManager ),UNO_QUERY); - Any a = xPropSet->getPropertyValue( aLayoutManager ); - if ( a >>= xLMPropSet ) + if ( xLMPropSet.is() ) { const ::rtl::OUString aAutomaticToolbars( RTL_CONSTASCII_USTRINGPARAM( "AutomaticToolbars" )); xLMPropSet->setPropertyValue( aAutomaticToolbars, Any( sal_False )); @@ -248,8 +249,6 @@ namespace dbaui { } - OSL_ENSURE(m_xBeamer.is(),"No frame created!"); - m_xBeamer->initialize( VCLUnoHelper::GetInterface ( m_pBeamer ) ); m_xBeamer->setName(FRAME_NAME_QUERY_PREVIEW); // append our frame diff --git a/dbaccess/source/ui/relationdesign/RelationDesignView.cxx b/dbaccess/source/ui/relationdesign/RelationDesignView.cxx index f95ee9561946..207513489d47 100644 --- a/dbaccess/source/ui/relationdesign/RelationDesignView.cxx +++ b/dbaccess/source/ui/relationdesign/RelationDesignView.cxx @@ -40,7 +40,7 @@ #include "RelationController.hxx" #endif #ifndef _UNDO_HXX -#include <svtools/undo.hxx> +#include <svl/undo.hxx> #endif #ifndef _SV_SVAPP_HXX #include <vcl/svapp.hxx> diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx index cfd70afc2b95..ca533d84062a 100644 --- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx +++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx @@ -78,7 +78,7 @@ #include <connectivity/dbexception.hxx> #include "RTableWindow.hxx" #include "JAccess.hxx" -#include <svtools/undo.hxx> +#include <svl/undo.hxx> #include <com/sun/star/accessibility/AccessibleEventId.hpp> using namespace dbaui; diff --git a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx index 699a2db8404b..6e90ebed7e88 100644 --- a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx +++ b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx @@ -239,8 +239,19 @@ void OFieldDescription::FillFromTypeInfo(const TOTypeInfoSP& _pType,sal_Bool _bF if ( bForce ) { sal_Int32 nPrec = DEFAULT_OTHER_PRECSION; - if ( GetPrecision() ) - nPrec = GetPrecision(); + switch ( _pType->nType ) + { + case DataType::BIT: + case DataType::BLOB: + case DataType::CLOB: + nPrec = _pType->nPrecision; + break; + default: + if ( GetPrecision() ) + nPrec = GetPrecision(); + break; + } + if ( _pType->nPrecision ) SetPrecision(::std::min<sal_Int32>(nPrec ? nPrec : DEFAULT_NUMERIC_PRECSION,_pType->nPrecision)); if ( _pType->nMaximumScale ) diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index 9694d285c511..347a19ca60ad 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -1534,19 +1534,8 @@ sal_Bool OTableEditorCtrl::IsPrimaryKeyAllowed( long /*nRow*/ ) return sal_False; OTableController& rController = GetView()->getController(); - try - { - Reference<XConnection> xCon = rController.getConnection(); - - Reference< XDatabaseMetaData> xMetaData = xCon.is() ? xCon->getMetaData() : Reference< XDatabaseMetaData>(); - if(!xMetaData.is() || !xMetaData->supportsCoreSQLGrammar()) - return sal_False; // no primary keys allowed - - } - catch(SQLException&) - { - OSL_ASSERT(!"supportsCoreSQLGrammar"); - } + if ( !rController.getSdbMetaData().supportsPrimaryKeys() ) + return sal_False; Reference<XPropertySet> xTable = rController.getTable(); ////////////////////////////////////////////////////////////// diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index c447c002a830..1eed02543cda 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -30,143 +30,62 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" -#ifndef DBUI_TABLECONTROLLER_HXX -#include "TableController.hxx" -#endif -#ifndef _DBAU_REGHELPER_HXX_ +#include "FieldDescriptions.hxx" +#include "TEditControl.hxx" +#include "TableController.hxx" +#include "TableDesignView.hxx" +#include "TableRow.hxx" +#include "TypeInfo.hxx" +#include "UITools.hxx" +#include "browserids.hxx" #include "dbu_reghelper.hxx" -#endif -#ifndef _STRING_HXX -#include <tools/string.hxx> -#endif -#include <tools/diagnose_ex.h> -#ifndef _SFXSIDS_HRC -#include <sfx2/sfxsids.hrc> -#endif -#ifndef _DBU_TBL_HRC_ #include "dbu_tbl.hrc" -#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 DBACCESS_SOURCE_UI_INC_DEFAULTOBJECTNAMECHECK_HXX #include "defaultobjectnamecheck.hxx" -#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 DBAUI_DLGSAVE_HXX #include "dlgsave.hxx" -#endif -#ifndef _COM_SUN_STAR_CONTAINER_XCHILD_HPP_ +#include "dsmeta.hxx" +#include "indexdialog.hxx" +#include "sqlmessage.hxx" + +/** === begin UNO includes === **/ #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_SDB_SQLCONTEXT_HPP_ +#include <com/sun/star/frame/FrameSearchFlag.hpp> +#include <com/sun/star/frame/XTitleChangeListener.hpp> +#include <com/sun/star/frame/XUntitledNumbers.hpp> +#include <com/sun/star/io/XActiveDataSink.hpp> +#include <com/sun/star/io/XActiveDataSource.hpp> +#include <com/sun/star/sdb/CommandType.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/SQLWarning.hpp> #include <com/sun/star/sdbc/XRow.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBCX_XINDEXESSUPPLIER_HPP_ +#include <com/sun/star/sdbcx/KeyType.hpp> +#include <com/sun/star/sdbcx/XAlterTable.hpp> +#include <com/sun/star/sdbcx/XAppend.hpp> +#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp> +#include <com/sun/star/sdbcx/XDrop.hpp> #include <com/sun/star/sdbcx/XIndexesSupplier.hpp> -#endif -#include <com/sun/star/frame/XTitleChangeListener.hpp> -#ifndef _DBHELPER_DBEXCEPTION_HXX_ -#include <connectivity/dbexception.hxx> -#endif -#ifndef _COM_SUN_STAR_UI_XEXECUTABLEDIALOG_HPP_ +#include <com/sun/star/sdbcx/XTablesSupplier.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> -#endif -#include <com/sun/star/frame/XUntitledNumbers.hpp> -#ifndef _COMPHELPER_STREAMSECTION_HXX_ +/** === end UNO includes === **/ + +#include <comphelper/extract.hxx> #include <comphelper/streamsection.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_TABLEDESIGNVIEW_HXX -#include "TableDesignView.hxx" -#endif -#ifndef _COM_SUN_STAR_SDB_COMMANDTYPE_HPP_ -#include <com/sun/star/sdb/CommandType.hpp> -#endif -#ifndef DBAUI_FIELDDESCRIPTIONS_HXX -#include "FieldDescriptions.hxx" -#endif -#ifndef DBAUI_TABLEROW_HXX -#include "TableRow.hxx" -#endif -#ifndef DBAUI_TYPEINFO_HXX -#include "TypeInfo.hxx" -#endif -#ifndef DBAUI_TABLEEDITORCONTROL_HXX -#include "TEditControl.hxx" -#endif -#ifndef _DBAUI_SQLMESSAGE_HXX_ -#include "sqlmessage.hxx" -#endif -#ifndef _SV_MSGBOX_HXX +#include <comphelper/types.hxx> +#include <connectivity/dbexception.hxx> +#include <connectivity/dbtools.hxx> +#include <connectivity/dbmetadata.hxx> +#include <cppuhelper/exc_hlp.hxx> +#include <sfx2/sfxsids.hrc> +#include <tools/diagnose_ex.h> +#include <tools/string.hxx> #include <vcl/msgbox.hxx> -#endif -#ifndef _DBAUI_INDEXDIALOG_HXX_ -#include "indexdialog.hxx" -#endif -#ifndef DBAUI_TOOLS_HXX -#include "UITools.hxx" -#endif -#ifndef DBAUI_TOOLS_HXX -#include "UITools.hxx" -#endif -#include <boost/mem_fn.hpp> -#ifndef _CPPUHELPER_EXC_HLP_HXX_ -#include <cppuhelper/exc_hlp.hxx> -#endif -#include "dsmeta.hxx" +#include <boost/mem_fn.hpp> #include <boost/bind.hpp> + #include <algorithm> #include <functional> @@ -1089,7 +1008,8 @@ sal_Bool OTableController::checkColumns(sal_Bool _bNew) throw(::com::sun::star:: { sal_Bool bOk = sal_True; sal_Bool bFoundPKey = sal_False; - Reference< XDatabaseMetaData> xMetaData = getMetaData( ); + Reference< XDatabaseMetaData > xMetaData = getMetaData( ); + DatabaseMetaData aMetaData( getConnection() ); ::comphelper::UStringMixEqual bCase(xMetaData.is() ? xMetaData->supportsMixedCaseQuotedIdentifiers() : sal_True); ::std::vector< ::boost::shared_ptr<OTableRow> >::const_iterator aIter = m_vRowList.begin(); @@ -1115,39 +1035,38 @@ sal_Bool OTableController::checkColumns(sal_Bool _bNew) throw(::com::sun::star:: } } } - if(!bFoundPKey) + if ( _bNew && !bFoundPKey && aMetaData.supportsPrimaryKeys() ) { - if(_bNew && xMetaData.is() && xMetaData->supportsCoreSQLGrammar()) - { - String sTitle(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY_HEAD)); - String sMsg(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY)); - OSQLMessageBox aBox(getView(), sTitle,sMsg, WB_YES_NO_CANCEL | WB_DEF_YES); + String sTitle(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY_HEAD)); + String sMsg(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY)); + OSQLMessageBox aBox(getView(), sTitle,sMsg, WB_YES_NO_CANCEL | WB_DEF_YES); - INT16 nReturn = aBox.Execute(); - - if (nReturn == RET_YES) - { - ::boost::shared_ptr<OTableRow> pNewRow(new OTableRow()); - TOTypeInfoSP pTypeInfo = ::dbaui::queryPrimaryKeyType(m_aTypeInfo); + switch ( aBox.Execute() ) + { + case RET_YES: + { + ::boost::shared_ptr<OTableRow> pNewRow(new OTableRow()); + TOTypeInfoSP pTypeInfo = ::dbaui::queryPrimaryKeyType(m_aTypeInfo); + if ( !pTypeInfo.get() ) + break; - if ( pTypeInfo.get() ) - { - pNewRow->SetFieldType( pTypeInfo ); - OFieldDescription* pActFieldDescr = pNewRow->GetActFieldDescr(); + pNewRow->SetFieldType( pTypeInfo ); + OFieldDescription* pActFieldDescr = pNewRow->GetActFieldDescr(); - pActFieldDescr->SetAutoIncrement(sal_False); // #95927# pTypeInfo->bAutoIncrement - pActFieldDescr->SetIsNullable(ColumnValue::NO_NULLS); + pActFieldDescr->SetAutoIncrement(sal_False); // #95927# pTypeInfo->bAutoIncrement + pActFieldDescr->SetIsNullable(ColumnValue::NO_NULLS); - pActFieldDescr->SetName( createUniqueName(::rtl::OUString::createFromAscii("ID") )); - pActFieldDescr->SetPrimaryKey( sal_True ); - m_vRowList.insert(m_vRowList.begin(),pNewRow); + pActFieldDescr->SetName( createUniqueName(::rtl::OUString::createFromAscii("ID") )); + pActFieldDescr->SetPrimaryKey( sal_True ); + m_vRowList.insert(m_vRowList.begin(),pNewRow); - static_cast<OTableDesignView*>(getView())->GetEditorCtrl()->Invalidate(); - static_cast<OTableDesignView*>(getView())->GetEditorCtrl()->RowInserted(0); - } // if ( pTypeInfo.get() ) - } - else if (nReturn == RET_CANCEL) - bOk = sal_False; + static_cast<OTableDesignView*>(getView())->GetEditorCtrl()->Invalidate(); + static_cast<OTableDesignView*>(getView())->GetEditorCtrl()->RowInserted(0); + } + break; + case RET_CANCEL: + bOk = sal_False; + break; } } return bOk; @@ -1471,7 +1390,7 @@ void OTableController::alterColumns() bNeedAppendKey = sal_True; } - if ( bNeedDropKey ) + if ( bNeedDropKey && xKeyColumns.is() && xKeyColumns->getElementNames().getLength() ) dropPrimaryKey(); if ( bNeedAppendKey ) diff --git a/dbaccess/source/ui/tabledesign/TableDesignView.cxx b/dbaccess/source/ui/tabledesign/TableDesignView.cxx index c1b6ddb9978c..27fac41c5bdf 100644 --- a/dbaccess/source/ui/tabledesign/TableDesignView.cxx +++ b/dbaccess/source/ui/tabledesign/TableDesignView.cxx @@ -64,7 +64,7 @@ #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp> #endif #ifndef INCLUDED_SVTOOLS_SYSLOCALE_HXX -#include <svtools/syslocale.hxx> +#include <unotools/syslocale.hxx> #endif #ifndef DBAUI_TOOLS_HXX #include "UITools.hxx" diff --git a/dbaccess/source/ui/tabledesign/table.src b/dbaccess/source/ui/tabledesign/table.src index af911ec85c07..9fa0b0743ef4 100644 --- a/dbaccess/source/ui/tabledesign/table.src +++ b/dbaccess/source/ui/tabledesign/table.src @@ -56,7 +56,7 @@ String STR_TABLEDESIGN_DBFIELDTYPES { - Text [ en-US ] = "Unknown;Text;Number;Date/Time;Date;Time;Yes/No;Currency;Memo;Counter;Image;Text (fix);Decimal;Binary (fix);Binary;BigInt;Double;Float;Real;Integer;Small Integer;Tiny Integer;SQL Null;Object;Distinct;Structure;Field;BLOB;CLOB;REF;OTHER"; + Text [ en-US ] = "Unknown;Text;Number;Date/Time;Date;Time;Yes/No;Currency;Memo;Counter;Image;Text (fix);Decimal;Binary (fix);Binary;BigInt;Double;Float;Real;Integer;Small Integer;Tiny Integer;SQL Null;Object;Distinct;Structure;Field;BLOB;CLOB;REF;OTHER;Bit (fix)"; }; String STR_TABLEDESIGN_UNDO_PRIMKEY diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index 26f859cf2045..aa2b87fca329 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -58,6 +58,8 @@ #include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp> #include <com/sun/star/sdbc/XParameters.hpp> #include <com/sun/star/sdbc/XRow.hpp> +#include <com/sun/star/sdbc/XBlob.hpp> +#include <com/sun/star/sdbc/XClob.hpp> #include <com/sun/star/sdbcx/XRowLocate.hpp> #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp> #include <com/sun/star/sdb/SQLContext.hpp> @@ -68,6 +70,7 @@ #include <comphelper/interaction.hxx> #include <comphelper/namedvaluecollection.hxx> #include <comphelper/proparrhlp.hxx> +#include <comphelper/string.hxx> #include <connectivity/dbexception.hxx> #include <connectivity/dbtools.hxx> #include <cppuhelper/exc_hlp.hxx> @@ -127,6 +130,8 @@ namespace dbaui using ::com::sun::star::sdbc::XParameters; using ::com::sun::star::sdbc::XResultSet; using ::com::sun::star::sdbc::XRow; + using ::com::sun::star::sdbc::XBlob; + using ::com::sun::star::sdbc::XClob; using ::com::sun::star::sdbcx::XRowLocate; using ::com::sun::star::sdbc::XResultSetMetaDataSupplier; using ::com::sun::star::sdbc::XResultSetMetaData; @@ -771,9 +776,8 @@ void CopyTableWizard::impl_checkForUnsupportedSettings_throw( const Reference< X if ( sUnsupportedSetting.getLength() != 0 ) { - ::rtl::OUString sMessage( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unsupported setting in the copy source descriptor: $name$." ) ) ); - // TODO: resource - sMessage = sMessage.replaceAt( sMessage.indexOfAsciiL( "$name$", 6 ), 6, sUnsupportedSetting ); + ::rtl::OUString sMessage( String(ModuleRes( STR_CTW_ERROR_UNSUPPORTED_SETTING )) ); + ::comphelper::string::searchAndReplaceAsciiI( sMessage, "$name$", sUnsupportedSetting ); throw IllegalArgumentException( sMessage, *const_cast< CopyTableWizard* >( this ), @@ -845,8 +849,7 @@ void CopyTableWizard::impl_checkForUnsupportedSettings_throw( const Reference< X if ( _out_rCommandType == CommandType::QUERY ) // we cannot copy a query if the connection cannot provide it ... throw IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "To copy a query, your connection must be able to provide queries." ) ), - // TODO: resource + String(ModuleRes( STR_CTW_ERROR_NO_QUERY )), *const_cast< CopyTableWizard* >( this ), 1 ); @@ -1281,6 +1284,7 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou case DataType::LONGVARBINARY: case DataType::BINARY: case DataType::VARBINARY: + case DataType::BIT: aTransfer.transferComplexValue( &XRow::getBytes, &XParameters::setBytes ); break; @@ -1296,7 +1300,6 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou aTransfer.transferComplexValue( &XRow::getTimestamp, &XParameters::setTimestamp ); break; - case DataType::BIT: case DataType::BOOLEAN: aTransfer.transferValue( &XRow::getBoolean, &XParameters::setBoolean ); break; @@ -1313,6 +1316,14 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou aTransfer.transferValue( &XRow::getInt, &XParameters::setInt ); break; + case DataType::BLOB: + aTransfer.transferComplexValue( &XRow::getBlob, &XParameters::setBlob ); + break; + + case DataType::CLOB: + aTransfer.transferComplexValue( &XRow::getClob, &XParameters::setClob ); + break; + default: { ::rtl::OUString aMessage( String( ModuleRes( STR_CTW_UNSUPPORTED_COLUMN_TYPE ) ) ); @@ -1504,8 +1515,7 @@ void SAL_CALL CopyTableWizard::initialize( const Sequence< Any >& _rArguments ) { // ->createWithInteractionHandler if ( !( _rArguments[2] >>= m_xInteractionHandler ) ) throw IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The given interaction handler is invalid." ) ), - // TODO: resource + String(ModuleRes( STR_CTW_ERROR_INVALID_INTERACTIONHANDLER )), *this, 3 ); @@ -1566,7 +1576,8 @@ Dialog* CopyTableWizard::createDialog( Window* _pParent ) *m_pSourceObject, m_xSourceConnection.getTyped(), m_xDestConnection.getTyped(), - m_aContext.getLegacyServiceFactory() + m_aContext.getLegacyServiceFactory(), + m_xInteractionHandler ); impl_attributesToDialog_nothrow( *pWizard ); diff --git a/dbaccess/source/ui/uno/copytablewizard.src b/dbaccess/source/ui/uno/copytablewizard.src index 07db51196ce2..4bb6efc839cc 100644 --- a/dbaccess/source/ui/uno/copytablewizard.src +++ b/dbaccess/source/ui/uno/copytablewizard.src @@ -69,3 +69,15 @@ String STR_CTW_ERROR_DURING_INITIALIZATION { Text [ en-US ] = "An error occurred during initialization."; }; +String STR_CTW_ERROR_UNSUPPORTED_SETTING +{ + Text [ en-US ] = "Unsupported setting in the copy source descriptor: $name$."; +}; +String STR_CTW_ERROR_NO_QUERY +{ + Text [ en-US ] = "To copy a query, your connection must be able to provide queries."; +}; +String STR_CTW_ERROR_INVALID_INTERACTIONHANDLER +{ + Text [ en-US ] = "The given interaction handler is invalid."; +}; |