diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-06-20 09:52:21 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-06-20 09:52:21 +0200 |
commit | e70b1417d22d22e3d5bdffb1f4b55bc83a4c36ef (patch) | |
tree | 3bd3a7fe6854916ee1afa9ee042fc91b3fb9c24e /dbaccess/source/ui/browser | |
parent | c00fe9ce1105c6c2a26954eeaee5e51336909a2a (diff) | |
parent | f1ea4ba4479f4a29eb0a42389d5f03c2ad280e8f (diff) |
Merge branch 'master' into feature/gnumake4
Conflicts:
dbaccess/AllLangResTarget_adabasui.mk
dbaccess/AllLangResTarget_dba.mk
dbaccess/AllLangResTarget_dbmm.mk
dbaccess/AllLangResTarget_sdbt.mk
dbaccess/Executable_odbcconfig.mk
dbaccess/JunitTest_dbaccess_unoapi.mk
dbaccess/Library_adabasui.mk
dbaccess/Library_dba.mk
dbaccess/Library_dbaxml.mk
dbaccess/Library_dbmm.mk
dbaccess/Library_sdbt.mk
dbaccess/Makefile
dbaccess/Module_dbaccess.mk
dbaccess/Package_inc.mk
dbaccess/Package_uiconfig.mk
dbaccess/prj/build.lst
dbaccess/qa/unoapi/Test.java
dbaccess/source/core/api/CacheSet.hxx
dbaccess/source/core/dataaccess/SharedConnection.hxx
dbaccess/source/core/dataaccess/connection.cxx
dbaccess/source/filter/xml/xmlAutoStyle.cxx
dbaccess/source/filter/xml/xmlColumn.cxx
dbaccess/source/filter/xml/xmlComponent.cxx
dbaccess/source/filter/xml/xmlConnectionData.cxx
dbaccess/source/filter/xml/xmlConnectionResource.cxx
dbaccess/source/filter/xml/xmlDataSource.cxx
dbaccess/source/filter/xml/xmlDataSourceInfo.cxx
dbaccess/source/filter/xml/xmlDataSourceSetting.cxx
dbaccess/source/filter/xml/xmlDataSourceSettings.cxx
dbaccess/source/filter/xml/xmlDatabaseDescription.cxx
dbaccess/source/filter/xml/xmlDocuments.cxx
dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
dbaccess/source/filter/xml/xmlHelper.cxx
dbaccess/source/filter/xml/xmlHierarchyCollection.cxx
dbaccess/source/filter/xml/xmlLogin.cxx
dbaccess/source/filter/xml/xmlQuery.cxx
dbaccess/source/filter/xml/xmlServerDatabase.cxx
dbaccess/source/filter/xml/xmlTable.cxx
dbaccess/source/filter/xml/xmlTableFilterList.cxx
dbaccess/source/filter/xml/xmlTableFilterPattern.cxx
dbaccess/source/ui/app/AppDetailPageHelper.cxx
dbaccess/source/ui/app/AppDetailView.cxx
dbaccess/source/ui/app/AppIconControl.cxx
dbaccess/source/ui/app/AppSwapWindow.cxx
dbaccess/source/ui/app/AppTitleWindow.cxx
dbaccess/source/ui/app/AppView.cxx
dbaccess/source/ui/browser/AsyncronousLink.cxx
dbaccess/source/ui/browser/genericcontroller.cxx
dbaccess/source/ui/control/ColumnControlWindow.cxx
dbaccess/source/ui/control/RelationControl.cxx
dbaccess/source/ui/control/SqlNameEdit.cxx
dbaccess/source/ui/control/TableGrantCtrl.cxx
dbaccess/source/ui/control/VertSplitView.cxx
dbaccess/source/ui/control/toolboxcontroller.cxx
dbaccess/source/ui/dlg/CollectionView.cxx
dbaccess/source/ui/dlg/ConnectionHelper.cxx
dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
dbaccess/source/ui/dlg/RelationDlg.cxx
dbaccess/source/ui/dlg/TextConnectionHelper.cxx
dbaccess/source/ui/dlg/detailpages.cxx
dbaccess/source/ui/dlg/dlgsize.cxx
dbaccess/source/ui/dlg/queryorder.cxx
dbaccess/source/ui/dlg/tablespage.cxx
dbaccess/source/ui/misc/TableCopyHelper.cxx
dbaccess/source/ui/misc/ToolBoxHelper.cxx
dbaccess/source/ui/misc/WExtendPages.cxx
dbaccess/source/ui/misc/WNameMatch.cxx
dbaccess/source/ui/misc/WTypeSelect.cxx
dbaccess/source/ui/querydesign/ConnectionLine.cxx
dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
dbaccess/source/ui/querydesign/ConnectionLineData.cxx
dbaccess/source/ui/querydesign/JAccess.cxx
dbaccess/source/ui/querydesign/JoinController.cxx
dbaccess/source/ui/querydesign/JoinDesignView.cxx
dbaccess/source/ui/querydesign/JoinExchange.cxx
dbaccess/source/ui/querydesign/JoinTableView.cxx
dbaccess/source/ui/querydesign/QTableConnection.cxx
dbaccess/source/ui/querydesign/QTableConnectionData.cxx
dbaccess/source/ui/querydesign/QTableWindow.cxx
dbaccess/source/ui/querydesign/QTableWindowData.cxx
dbaccess/source/ui/querydesign/QueryDesignView.cxx
dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx
dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx
dbaccess/source/ui/querydesign/QueryTextView.cxx
dbaccess/source/ui/querydesign/QueryViewSwitch.cxx
dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
dbaccess/source/ui/querydesign/TableConnection.cxx
dbaccess/source/ui/querydesign/TableConnectionData.cxx
dbaccess/source/ui/querydesign/TableWindow.cxx
dbaccess/source/ui/querydesign/TableWindowAccess.cxx
dbaccess/source/ui/querydesign/TableWindowData.cxx
dbaccess/source/ui/querydesign/TableWindowListBox.cxx
dbaccess/source/ui/querydesign/TableWindowTitle.cxx
dbaccess/source/ui/querydesign/querydlg.cxx
dbaccess/source/ui/querydesign/queryview.cxx
dbaccess/source/ui/relationdesign/RTableConnection.cxx
dbaccess/source/ui/relationdesign/RelationDesignView.cxx
dbaccess/source/ui/relationdesign/RelationTableView.cxx
dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx
dbaccess/source/ui/tabledesign/FieldDescriptions.cxx
dbaccess/source/ui/tabledesign/TEditControl.cxx
dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx
dbaccess/source/ui/tabledesign/TableDesignView.cxx
dbaccess/source/ui/tabledesign/TableFieldControl.cxx
dbaccess/source/ui/tabledesign/TableRow.cxx
dbaccess/source/ui/tabledesign/TableRowExchange.cxx
dbaccess/source/ui/tabledesign/TableUndo.cxx
dbaccess/source/ui/uno/ColumnControl.cxx
dbaccess/source/ui/uno/ColumnPeer.cxx
reportdesign/AllLangResTarget_rpt.mk
reportdesign/AllLangResTarget_rptui.mk
reportdesign/Library_rpt.mk
reportdesign/Library_rptui.mk
reportdesign/Library_rptxml.mk
reportdesign/Module_reportdesign.mk
reportdesign/Package_uiconfig.mk
reportdesign/Package_xml.mk
reportdesign/prj/build.lst
reportdesign/prj/makefile.mk
Diffstat (limited to 'dbaccess/source/ui/browser')
22 files changed, 405 insertions, 798 deletions
diff --git a/dbaccess/source/ui/browser/AsyncronousLink.cxx b/dbaccess/source/ui/browser/AsyncronousLink.cxx index 99c4858aaf73..f4072f5e6d1f 100644 --- a/dbaccess/source/ui/browser/AsyncronousLink.cxx +++ b/dbaccess/source/ui/browser/AsyncronousLink.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,15 +28,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbui.hxx" -#ifndef DBAUI_ASYNCRONOUSLINK_HXX #include "AsyncronousLink.hxx" -#endif -#ifndef _SV_SVAPP_HXX #include <vcl/svapp.hxx> -#endif -#ifndef _TOOLS_DEBUG_HXX #include <tools/debug.hxx> -#endif //================================================================== //= OAsyncronousLink @@ -110,3 +105,5 @@ IMPL_LINK(OAsyncronousLink, OnAsyncCall, void*, _pArg) return 0L; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/browser/bcommon.src b/dbaccess/source/ui/browser/bcommon.src index 8c79179eda20..d5b8401b4e8c 100644 --- a/dbaccess/source/ui/browser/bcommon.src +++ b/dbaccess/source/ui/browser/bcommon.src @@ -32,4 +32,3 @@ String RID_STR_TBL_TITLE { Text [ en-US ] = "Table #" ; }; - diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index d804a9c9f26b..b6a42cfc9cda 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -94,6 +95,7 @@ #include <svx/svxdlg.hxx> #include <tools/color.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <vcl/msgbox.hxx> #include <vcl/waitobj.hxx> @@ -132,7 +134,7 @@ using namespace ::svt; DBG_UNHANDLED_EXCEPTION(); \ } \ -#define DO_SAFE( action, message ) try { action; } catch(Exception&) { DBG_ERROR(message); } ; +#define DO_SAFE( action, message ) try { action; } catch(Exception&) { OSL_FAIL(message); } ; //.................................................................. namespace dbaui @@ -281,7 +283,7 @@ SbaXDataBrowserController::FormControllerImpl::~FormControllerImpl() //------------------------------------------------------------------ Reference< runtime::XFormOperations > SAL_CALL SbaXDataBrowserController::FormControllerImpl::getFormOperations() throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::getFormOperations: not supported!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::getFormOperations: not supported!" ); return NULL; } @@ -313,27 +315,27 @@ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addChildController( //------------------------------------------------------------------ Reference< runtime::XFormControllerContext > SAL_CALL SbaXDataBrowserController::FormControllerImpl::getContext() throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::getContext: no support!!" ); + OSL_FAIL( "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!!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::setContext: no support!!" ); } //------------------------------------------------------------------ Reference< XInteractionHandler > SAL_CALL SbaXDataBrowserController::FormControllerImpl::getInteractionHandler() throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::getInteractionHandler: no support!!" ); + OSL_FAIL( "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!!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::setInteractionHandler: no support!!" ); } //------------------------------------------------------------------ @@ -352,19 +354,19 @@ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setParent( const Re //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::dispose( ) throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::dispose: no, you do *not* want to do this!" ); + OSL_FAIL( "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!!" ); + OSL_FAIL( "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!!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::removeEventListener: no support!!" ); } //------------------------------------------------------------------ @@ -403,73 +405,73 @@ Reference< XEnumeration > SAL_CALL SbaXDataBrowserController::FormControllerImpl //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addModifyListener( const Reference< XModifyListener >& /*_Listener*/ ) throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addModifyListener: no support!" ); + OSL_FAIL( "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!" ); + OSL_FAIL( "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!" ); + OSL_FAIL( "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!" ); + OSL_FAIL( "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!" ); + OSL_FAIL( "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!" ); + OSL_FAIL( "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!" ); + OSL_FAIL( "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!" ); + OSL_FAIL( "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!" ); + OSL_FAIL( "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!" ); + OSL_FAIL( "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!" ); + OSL_FAIL( "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!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::removeParameterListener: no support!" ); } //------------------------------------------------------------------ @@ -502,7 +504,7 @@ Sequence< ::rtl::OUString > SAL_CALL SbaXDataBrowserController::FormControllerIm //------------------------------------------------------------------ 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 !"); + OSL_FAIL("SbaXDataBrowserController::FormControllerImpl::setModel : invalid call, can't change my model !"); } //------------------------------------------------------------------ @@ -514,7 +516,7 @@ Reference< ::com::sun::star::awt::XTabControllerModel > SAL_CALL SbaXDataBrowse //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setContainer(const Reference< ::com::sun::star::awt::XControlContainer > & /*_Container*/) throw( RuntimeException ) { - OSL_ENSURE(sal_False, "SbaXDataBrowserController::FormControllerImpl::setContainer : invalid call, can't change my container !"); + OSL_FAIL("SbaXDataBrowserController::FormControllerImpl::setContainer : invalid call, can't change my container !"); } //------------------------------------------------------------------ @@ -539,13 +541,13 @@ Sequence< Reference< ::com::sun::star::awt::XControl > > SAL_CALL SbaXDataBrowse //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::autoTabOrder(void) throw( RuntimeException ) { - OSL_ENSURE(sal_False, "SbaXDataBrowserController::FormControllerImpl::autoTabOrder : nothing to do (always have only one control) !"); + OSL_FAIL("SbaXDataBrowserController::FormControllerImpl::autoTabOrder : nothing to do (always have only one control) !"); } //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::activateTabOrder(void) throw( RuntimeException ) { - OSL_ENSURE(sal_False, "SbaXDataBrowserController::FormControllerImpl::activateTabOrder : nothing to do (always have only one control) !"); + OSL_FAIL("SbaXDataBrowserController::FormControllerImpl::activateTabOrder : nothing to do (always have only one control) !"); } //------------------------------------------------------------------ @@ -791,7 +793,7 @@ void SbaXDataBrowserController::initFormatter() { // create a new formatter m_xFormatter = Reference< ::com::sun::star::util::XNumberFormatter > ( - getORB()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.util.NumberFormatter")), UNO_QUERY); + getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatter"))), UNO_QUERY); if (m_xFormatter.is()) m_xFormatter->attachNumberFormatsSupplier(xSupplier); } @@ -878,7 +880,7 @@ sal_Bool SbaXDataBrowserController::Construct(Window* pParent) } catch(Exception&) { - DBG_ERROR("SbaXDataBrowserController::Construct : the construction of UnoDataBrowserView failed !"); + OSL_FAIL("SbaXDataBrowserController::Construct : the construction of UnoDataBrowserView failed !"); } if (!bSuccess) @@ -902,7 +904,7 @@ sal_Bool SbaXDataBrowserController::Construct(Window* pParent) // set the callbacks for the grid control SbaGridControl* pVclGrid = getBrowserView()->getVclControl(); - DBG_ASSERT(pVclGrid, "SbaXDataBrowserController::Construct : have no VCL control !"); + OSL_ENSURE(pVclGrid, "SbaXDataBrowserController::Construct : have no VCL control !"); pVclGrid->SetMasterListener(this); // -------------------------- @@ -963,14 +965,14 @@ void SbaXDataBrowserController::RemoveColumnListener(const Reference< XPropertyS Reference< XRowSet > SbaXDataBrowserController::CreateForm() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::CreateForm" ); - return Reference< XRowSet > (getORB()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.form.component.Form")), UNO_QUERY); + return Reference< XRowSet > (getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.Form"))), UNO_QUERY); } //------------------------------------------------------------------------------ Reference< ::com::sun::star::form::XFormComponent > SbaXDataBrowserController::CreateGridModel() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::CreateGridModel" ); - return Reference< ::com::sun::star::form::XFormComponent > (getORB()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.form.component.GridControl")), UNO_QUERY); + return Reference< ::com::sun::star::form::XFormComponent > (getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.GridControl"))), UNO_QUERY); } // ------------------------------------------------------------------------- @@ -1095,7 +1097,7 @@ void SAL_CALL SbaXDataBrowserController::focusLost(const FocusEvent& e) throw( R if (xCommitable.is()) xCommitable->commit(); else - OSL_ENSURE(sal_False, "SbaXDataBrowserController::focusLost : why is my control not commitable ?"); + OSL_FAIL("SbaXDataBrowserController::focusLost : why is my control not commitable ?"); } // ------------------------------------------------------------------------- @@ -1213,7 +1215,7 @@ void SbaXDataBrowserController::propertyChange(const PropertyChangeEvent& evt) t if (!xSource.is()) return; - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; // the IsModified changed to sal_False ? if ( (evt.PropertyName.equals(PROPERTY_ISMODIFIED)) && (::comphelper::getBOOL(evt.NewValue) == sal_False) @@ -1269,7 +1271,7 @@ void SbaXDataBrowserController::modified(const ::com::sun::star::lang::EventObje void SbaXDataBrowserController::elementInserted(const ::com::sun::star::container::ContainerEvent& evt) throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::elementInserted" ); - DBG_ASSERT(Reference< XInterface >(evt.Source, UNO_QUERY).get() == Reference< XInterface >(getControlModel(), UNO_QUERY).get(), + OSL_ENSURE(Reference< XInterface >(evt.Source, UNO_QUERY).get() == Reference< XInterface >(getControlModel(), UNO_QUERY).get(), "SbaXDataBrowserController::elementInserted: where did this come from (not from the grid model)?!"); Reference< XPropertySet > xNewColumn(evt.Element,UNO_QUERY); if ( xNewColumn.is() ) @@ -1280,7 +1282,7 @@ void SbaXDataBrowserController::elementInserted(const ::com::sun::star::containe void SbaXDataBrowserController::elementRemoved(const ::com::sun::star::container::ContainerEvent& evt) throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::elementRemoved" ); - DBG_ASSERT(Reference< XInterface >(evt.Source, UNO_QUERY).get() == Reference< XInterface >(getControlModel(), UNO_QUERY).get(), + OSL_ENSURE(Reference< XInterface >(evt.Source, UNO_QUERY).get() == Reference< XInterface >(getControlModel(), UNO_QUERY).get(), "SbaXDataBrowserController::elementRemoved: where did this come from (not from the grid model)?!"); Reference< XPropertySet > xOldColumn(evt.Element,UNO_QUERY); if ( xOldColumn.is() ) @@ -1291,7 +1293,7 @@ void SbaXDataBrowserController::elementRemoved(const ::com::sun::star::container void SbaXDataBrowserController::elementReplaced(const ::com::sun::star::container::ContainerEvent& evt) throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::elementReplaced" ); - DBG_ASSERT(Reference< XInterface >(evt.Source, UNO_QUERY).get() == Reference< XInterface >(getControlModel(), UNO_QUERY).get(), + OSL_ENSURE(Reference< XInterface >(evt.Source, UNO_QUERY).get() == Reference< XInterface >(getControlModel(), UNO_QUERY).get(), "SbaXDataBrowserController::elementReplaced: where did this come from (not from the grid model)?!"); Reference< XPropertySet > xOldColumn(evt.ReplacedElement,UNO_QUERY); if ( xOldColumn.is() ) @@ -1306,7 +1308,7 @@ void SbaXDataBrowserController::elementReplaced(const ::com::sun::star::containe sal_Bool SbaXDataBrowserController::suspend(sal_Bool /*bSuspend*/) throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::suspend" ); - DBG_ASSERT(m_nPendingLoadFinished == 0, "SbaXDataBrowserController::suspend : there shouldn't be a pending load !"); + OSL_ENSURE(m_nPendingLoadFinished == 0, "SbaXDataBrowserController::suspend : there shouldn't be a pending load !"); m_aAsyncGetCellFocus.CancelCall(); m_aAsyncDisplayError.CancelCall(); @@ -1434,7 +1436,7 @@ IMPL_LINK( SbaXDataBrowserController, OnAsyncDisplayError, void*, /* _pNotIntere //------------------------------------------------------------------------------ void SbaXDataBrowserController::errorOccured(const ::com::sun::star::sdb::SQLErrorEvent& aEvent) throw( RuntimeException ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::errorOccured" ); + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::errorOccurred" ); ::osl::MutexGuard aGuard( getMutex() ); SQLExceptionInfo aInfo( aEvent.Reason ); @@ -1443,7 +1445,7 @@ void SbaXDataBrowserController::errorOccured(const ::com::sun::star::sdb::SQLErr if ( m_nFormActionNestingLevel ) { - OSL_ENSURE( !m_aCurrentError.isValid(), "SbaXDataBrowserController::errorOccured: can handle one error per transaction only!" ); + OSL_ENSURE( !m_aCurrentError.isValid(), "SbaXDataBrowserController::errorOccurred: can handle one error per transaction only!" ); m_aCurrentError = aInfo; } else @@ -1460,19 +1462,12 @@ sal_Bool SbaXDataBrowserController::approveParameter(const ::com::sun::star::for if (aEvent.Source != getRowSet()) { // not my data source -> allow anything - DBG_ERROR("SbaXDataBrowserController::approveParameter : invalid event source !"); + OSL_FAIL("SbaXDataBrowserController::approveParameter : invalid event source !"); return sal_True; } Reference< ::com::sun::star::container::XIndexAccess > xParameters = aEvent.Parameters; - ::vos::OGuard aSolarGuard(Application::GetSolarMutex()); - // this may be executed in a non-main thread and we want to use vcl ... - Window* pParent = Application::GetDefDialogParent(); - // don't use the content as parent if it isn't visible - // (and don't use NULL as parent : this may be displayed in the beamer and really shouldn't be task-local) - // 69297 - FS - 25.10.99 - if (getBrowserView() && getBrowserView()->IsVisible()) - pParent = getBrowserView(); + SolarMutexGuard aSolarGuard; // default handling: instantiate an interaction handler and let it handle the parameter request try @@ -1505,7 +1500,7 @@ sal_Bool SbaXDataBrowserController::approveParameter(const ::com::sun::star::for Sequence< PropertyValue > aFinalValues = pParamValues->getValues(); if (aFinalValues.getLength() != aRequest.Parameters->getCount()) { - DBG_ERROR("SbaXDataBrowserController::approveParameter: the InteractionHandler returned nonsense!"); + OSL_FAIL("SbaXDataBrowserController::approveParameter: the InteractionHandler returned nonsense!"); setLoadingCancelled(); return sal_False; } @@ -1514,18 +1509,18 @@ sal_Bool SbaXDataBrowserController::approveParameter(const ::com::sun::star::for { Reference< XPropertySet > xParam; ::cppu::extractInterface(xParam, aRequest.Parameters->getByIndex(i)); - DBG_ASSERT(xParam.is(), "SbaXDataBrowserController::approveParameter: one of the parameters is no property set!"); + OSL_ENSURE(xParam.is(), "SbaXDataBrowserController::approveParameter: one of the parameters is no property set!"); if (xParam.is()) { #ifdef DBG_UTIL ::rtl::OUString sName; xParam->getPropertyValue(PROPERTY_NAME) >>= sName; - DBG_ASSERT(sName.equals(pFinalValues->Name), "SbaXDataBrowserController::approveParameter: suspicious value names!"); + OSL_ENSURE(sName.equals(pFinalValues->Name), "SbaXDataBrowserController::approveParameter: suspicious value names!"); #endif try { xParam->setPropertyValue(PROPERTY_VALUE, pFinalValues->Value); } catch(Exception&) { - DBG_ERROR("SbaXDataBrowserController::approveParameter: setting one of the properties failed!"); + OSL_FAIL("SbaXDataBrowserController::approveParameter: setting one of the properties failed!"); } } } @@ -1550,7 +1545,7 @@ sal_Bool SbaXDataBrowserController::approveReset(const ::com::sun::star::lang::E void SbaXDataBrowserController::resetted(const ::com::sun::star::lang::EventObject& rEvent) throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::resetted" ); - DBG_ASSERT(rEvent.Source == getControlModel(), "SbaXDataBrowserController::resetted : where did this come from ?"); + OSL_ENSURE(rEvent.Source == getControlModel(), "SbaXDataBrowserController::resetted : where did this come from ?"); (void)rEvent; setCurrentModified( sal_False ); } @@ -1610,7 +1605,7 @@ FeatureState SbaXDataBrowserController::GetState(sal_uInt16 nId) const try { Reference< XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY_THROW ); - OSL_VERIFY( xRowSetProps->getPropertyValue( ::rtl::OUString::createFromAscii( "AllowInserts" ) ) >>= bAllowInsertions ); + OSL_VERIFY( xRowSetProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllowInserts")) ) >>= bAllowInsertions ); } catch( const Exception& ) { @@ -1629,7 +1624,7 @@ FeatureState SbaXDataBrowserController::GetState(sal_uInt16 nId) const try { Reference< XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY_THROW ); - OSL_VERIFY( xRowSetProps->getPropertyValue( ::rtl::OUString::createFromAscii( "AllowDeletes" ) ) >>= bAllowDeletions ); + OSL_VERIFY( xRowSetProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllowDeletes")) ) >>= bAllowDeletions ); OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ROWCOUNT ) >>= nRowCount ); OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ISNEW ) >>= bInsertionRow ); } @@ -1746,9 +1741,9 @@ FeatureState SbaXDataBrowserController::GetState(sal_uInt16 nId) const break; // no datasource -> no edit mode sal_Int32 nDataSourcePrivileges = ::comphelper::getINT32(xDataSourceSet->getPropertyValue(PROPERTY_PRIVILEGES)); - sal_Bool bInsertAllowedAndPossible = ((nDataSourcePrivileges & ::com::sun::star::sdbcx::Privilege::INSERT) != 0) && ::comphelper::getBOOL(xDataSourceSet->getPropertyValue(::rtl::OUString::createFromAscii("AllowInserts"))); - sal_Bool bUpdateAllowedAndPossible = ((nDataSourcePrivileges & ::com::sun::star::sdbcx::Privilege::UPDATE) != 0) && ::comphelper::getBOOL(xDataSourceSet->getPropertyValue(::rtl::OUString::createFromAscii("AllowUpdates"))); - sal_Bool bDeleteAllowedAndPossible = ((nDataSourcePrivileges & ::com::sun::star::sdbcx::Privilege::DELETE) != 0) && ::comphelper::getBOOL(xDataSourceSet->getPropertyValue(::rtl::OUString::createFromAscii("AllowDeletes"))); + sal_Bool bInsertAllowedAndPossible = ((nDataSourcePrivileges & ::com::sun::star::sdbcx::Privilege::INSERT) != 0) && ::comphelper::getBOOL(xDataSourceSet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllowInserts")))); + sal_Bool bUpdateAllowedAndPossible = ((nDataSourcePrivileges & ::com::sun::star::sdbcx::Privilege::UPDATE) != 0) && ::comphelper::getBOOL(xDataSourceSet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllowUpdates")))); + sal_Bool bDeleteAllowedAndPossible = ((nDataSourcePrivileges & ::com::sun::star::sdbcx::Privilege::DELETE) != 0) && ::comphelper::getBOOL(xDataSourceSet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllowDeletes")))); if (!bInsertAllowedAndPossible && !bUpdateAllowedAndPossible && !bDeleteAllowedAndPossible) break; // no insert/update/delete -> no edit mode @@ -1798,7 +1793,7 @@ void SbaXDataBrowserController::applyParserOrder(const ::rtl::OUString& _rOldOrd Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY); if (!m_xLoadable.is()) { - OSL_ENSURE(sal_False, "SbaXDataBrowserController::applyParserOrder: invalid row set!"); + OSL_FAIL("SbaXDataBrowserController::applyParserOrder: invalid row set!"); return; } @@ -1816,7 +1811,6 @@ void SbaXDataBrowserController::applyParserOrder(const ::rtl::OUString& _rOldOrd if (!bSuccess) { xFormSet->setPropertyValue(PROPERTY_ORDER, makeAny(_rOldOrder)); - //DO_SAFE( _xParser->setOrder(_rOldOrder), "SbaXDataBrowserController::applyParserOrder: could not restore the old order of my parser !" ); try { @@ -1841,7 +1835,7 @@ void SbaXDataBrowserController::applyParserFilter(const ::rtl::OUString& _rOldFi Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY); if (!m_xLoadable.is()) { - OSL_ENSURE(sal_False, "SbaXDataBrowserController::applyParserFilter: invalid row set!"); + OSL_FAIL("SbaXDataBrowserController::applyParserFilter: invalid row set!"); return; } @@ -1999,11 +1993,11 @@ void SbaXDataBrowserController::ExecuteSearch() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::ExecuteSearch" ); // calculate the control source of the active field Reference< ::com::sun::star::form::XGrid > xGrid(getBrowserView()->getGridControl(), UNO_QUERY); - DBG_ASSERT(xGrid.is(), "SbaXDataBrowserController::ExecuteSearch : the control should have an ::com::sun::star::form::XGrid interface !"); + OSL_ENSURE(xGrid.is(), "SbaXDataBrowserController::ExecuteSearch : the control should have an ::com::sun::star::form::XGrid interface !"); Reference< ::com::sun::star::form::XGridPeer > xGridPeer(getBrowserView()->getGridControl()->getPeer(), UNO_QUERY); Reference< ::com::sun::star::container::XIndexContainer > xColumns = xGridPeer->getColumns(); - DBG_ASSERT(xGridPeer.is() && xColumns.is(), "SbaXDataBrowserController::ExecuteSearch : invalid peer !"); + OSL_ENSURE(xGridPeer.is() && xColumns.is(), "SbaXDataBrowserController::ExecuteSearch : invalid peer !"); sal_Int16 nViewCol = xGrid->getCurrentColumnPosition(); sal_Int16 nModelCol = getBrowserView()->View2ModelPos(nViewCol); @@ -2017,14 +2011,14 @@ void SbaXDataBrowserController::ExecuteSearch() Reference< XInterface > xCurControl(xColControls->getByIndex(nViewCol),UNO_QUERY); ::rtl::OUString aInitialText; if (IsSearchableControl(xCurControl, &aInitialText)) - sInitialText = (const sal_Unicode*)aInitialText; + sInitialText = aInitialText; // prohibit the synchronization of the grid's display with the cursor's position Reference< XPropertySet > xModelSet(getControlModel(), UNO_QUERY); - DBG_ASSERT(xModelSet.is(), "SbaXDataBrowserController::ExecuteSearch : no model set ?!"); - xModelSet->setPropertyValue(::rtl::OUString::createFromAscii("DisplayIsSynchron"), ::comphelper::makeBoolAny(sal_Bool(sal_False))); - xModelSet->setPropertyValue(::rtl::OUString::createFromAscii("AlwaysShowCursor"), ::comphelper::makeBoolAny(sal_Bool(sal_True))); - xModelSet->setPropertyValue(::rtl::OUString::createFromAscii("CursorColor"), makeAny(sal_Int32(COL_LIGHTRED))); + OSL_ENSURE(xModelSet.is(), "SbaXDataBrowserController::ExecuteSearch : no model set ?!"); + xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron")), ::comphelper::makeBoolAny(sal_Bool(sal_False))); + xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AlwaysShowCursor")), ::comphelper::makeBoolAny(sal_Bool(sal_True))); + xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CursorColor")), makeAny(sal_Int32(COL_LIGHTRED))); Reference< ::com::sun::star::util::XNumberFormatsSupplier > xNFS(::dbtools::getNumberFormats(::dbtools::getConnection(m_xRowSet), sal_True,getORB())); @@ -2036,7 +2030,7 @@ void SbaXDataBrowserController::ExecuteSearch() aContextNames.push_back( String::CreateFromAscii("Standard") ); pDialog = pFact->CreateFmSearchDialog(getBrowserView(), sInitialText, aContextNames, 0, LINK(this, SbaXDataBrowserController, OnSearchContextRequest)); } - DBG_ASSERT( pDialog, "SbaXDataBrowserController::ExecuteSearch: could not get the search dialog!" ); + OSL_ENSURE( pDialog, "SbaXDataBrowserController::ExecuteSearch: could not get the search dialog!" ); if ( pDialog ) { pDialog->SetActiveField( sActiveField ); @@ -2047,9 +2041,9 @@ void SbaXDataBrowserController::ExecuteSearch() } // restore the grid's normal operating state - xModelSet->setPropertyValue(::rtl::OUString::createFromAscii("DisplayIsSynchron"), ::comphelper::makeBoolAny(sal_Bool(sal_True))); - xModelSet->setPropertyValue(::rtl::OUString::createFromAscii("AlwaysShowCursor"), ::comphelper::makeBoolAny(sal_Bool(sal_False))); - xModelSet->setPropertyValue(::rtl::OUString::createFromAscii("CursorColor"), Any()); + xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron")), ::comphelper::makeBoolAny(sal_Bool(sal_True))); + xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AlwaysShowCursor")), ::comphelper::makeBoolAny(sal_Bool(sal_False))); + xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CursorColor")), Any()); } //------------------------------------------------------------------------------ @@ -2077,7 +2071,7 @@ void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< Property } catch(Exception&) { - OSL_ENSURE(0,"Exception caught!"); + OSL_FAIL("Exception caught!"); } break; case SID_FM_DELETEROWS: @@ -2149,7 +2143,6 @@ void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< Property // should be intercepted by GetState. Normally. // Unfortunately ID_BROWSER_PASTE is a 'fast call' slot, which means it may be executed without checking if it is // enabled. This would be really deadly herein if the current cell has no controller ... - // (FS - 13.04.99 - #64694#) return; Edit& rEdit = (Edit&)xCurrentController->GetWindow(); @@ -2411,7 +2404,7 @@ sal_Bool SbaXDataBrowserController::SaveModified(sal_Bool bAskFor) } catch(Exception&) { - DBG_ERROR("SbaXDataBrowserController::SaveModified : could not save the current record !"); + OSL_FAIL("SbaXDataBrowserController::SaveModified : could not save the current record !"); bResult = sal_False; } @@ -2498,7 +2491,7 @@ void SbaXDataBrowserController::CellDeactivated() //------------------------------------------------------------------------------ IMPL_LINK( SbaXDataBrowserController, OnClipboardChanged, void*, EMPTYARG ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; return OnInvalidateClipboard( NULL ); } @@ -2554,9 +2547,9 @@ IMPL_LINK(SbaXDataBrowserController, OnSearchContextRequest, FmSearchContext*, p // check all grid columns for their control source Reference< ::com::sun::star::container::XIndexAccess > xModelColumns(getFormComponent(), UNO_QUERY); - DBG_ASSERT(xModelColumns.is(), "SbaXDataBrowserController::OnSearchContextRequest : there is a grid control without columns !"); + OSL_ENSURE(xModelColumns.is(), "SbaXDataBrowserController::OnSearchContextRequest : there is a grid control without columns !"); // the case 'no columns' should be indicated with an empty container, I think ... - DBG_ASSERT(xModelColumns->getCount() >= xPeerContainer->getCount(), "SbaXDataBrowserController::OnSearchContextRequest : impossible : have more view than model columns !"); + OSL_ENSURE(xModelColumns->getCount() >= xPeerContainer->getCount(), "SbaXDataBrowserController::OnSearchContextRequest : impossible : have more view than model columns !"); String sFieldList; for (sal_Int32 nViewPos=0; nViewPos<xPeerContainer->getCount(); ++nViewPos) @@ -2565,15 +2558,15 @@ IMPL_LINK(SbaXDataBrowserController, OnSearchContextRequest, FmSearchContext*, p if (!xCurrentColumn.is()) continue; - // can we use this column control fo searching ? + // can we use this column control for searching ? if (!IsSearchableControl(xCurrentColumn)) continue; sal_uInt16 nModelPos = getBrowserView()->View2ModelPos((sal_uInt16)nViewPos); Reference< XPropertySet > xCurrentColModel(xModelColumns->getByIndex(nModelPos),UNO_QUERY); - ::rtl::OUString aName = ::comphelper::getString(xCurrentColModel->getPropertyValue(PROPERTY_CONTROLSOURCE)); + String aName = ::comphelper::getString(xCurrentColModel->getPropertyValue(PROPERTY_CONTROLSOURCE)); - sFieldList += (const sal_Unicode*)aName; + sFieldList += aName; sFieldList += ';'; pContext->arrFields.push_back(xCurrentColumn); @@ -2585,7 +2578,7 @@ IMPL_LINK(SbaXDataBrowserController, OnSearchContextRequest, FmSearchContext*, p // if the cursor is in a mode other than STANDARD -> reset Reference< XPropertySet > xCursorSet(pContext->xCursor, UNO_QUERY); - DBG_ASSERT(xCursorSet.is() && !::comphelper::getBOOL(xCursorSet->getPropertyValue(PROPERTY_ISMODIFIED)), + OSL_ENSURE(xCursorSet.is() && !::comphelper::getBOOL(xCursorSet->getPropertyValue(PROPERTY_ISMODIFIED)), "SbaXDataBrowserController::OnSearchContextRequest : please do not call for cursors with modified rows !"); if (xCursorSet.is() && ::comphelper::getBOOL(xCursorSet->getPropertyValue(PROPERTY_ISNEW))) { @@ -2599,17 +2592,17 @@ IMPL_LINK(SbaXDataBrowserController, OnSearchContextRequest, FmSearchContext*, p IMPL_LINK(SbaXDataBrowserController, OnFoundData, FmFoundRecordInformation*, pInfo) { Reference< ::com::sun::star::sdbcx::XRowLocate > xCursor(getRowSet(), UNO_QUERY); - DBG_ASSERT(xCursor.is(), "SbaXDataBrowserController::OnFoundData : shit happens. sometimes. but this is simply impossible !"); + OSL_ENSURE(xCursor.is(), "SbaXDataBrowserController::OnFoundData : shit happens. sometimes. but this is simply impossible !"); // move the cursor xCursor->moveToBookmark(pInfo->aPosition); // let the grid snyc it's display with the cursor Reference< XPropertySet > xModelSet(getControlModel(), UNO_QUERY); - DBG_ASSERT(xModelSet.is(), "SbaXDataBrowserController::OnFoundData : no model set ?!"); - Any aOld = xModelSet->getPropertyValue(::rtl::OUString::createFromAscii("DisplayIsSynchron")); - xModelSet->setPropertyValue(::rtl::OUString::createFromAscii("DisplayIsSynchron"), ::comphelper::makeBoolAny(sal_Bool(sal_True))); - xModelSet->setPropertyValue(::rtl::OUString::createFromAscii("DisplayIsSynchron"), aOld); + OSL_ENSURE(xModelSet.is(), "SbaXDataBrowserController::OnFoundData : no model set ?!"); + Any aOld = xModelSet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron"))); + xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron")), ::comphelper::makeBoolAny(sal_Bool(sal_True))); + xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron")), aOld); // and move to the field Reference< ::com::sun::star::container::XIndexAccess > aColumnControls(getBrowserView()->getGridControl()->getPeer(), UNO_QUERY); @@ -2640,7 +2633,7 @@ IMPL_LINK(SbaXDataBrowserController, OnCanceledNotFound, FmFoundRecordInformatio try { - DBG_ASSERT(xCursor.is(), "SbaXDataBrowserController::OnCanceledNotFound : shit happens. sometimes. but this is simply impossible !"); + OSL_ENSURE(xCursor.is(), "SbaXDataBrowserController::OnCanceledNotFound : shit happens. sometimes. but this is simply impossible !"); // move the cursor xCursor->moveToBookmark(pInfo->aPosition); } @@ -2651,12 +2644,12 @@ IMPL_LINK(SbaXDataBrowserController, OnCanceledNotFound, FmFoundRecordInformatio try { - // let the grid snyc it's display with the cursor + // let the grid snyc its display with the cursor Reference< XPropertySet > xModelSet(getControlModel(), UNO_QUERY); - DBG_ASSERT(xModelSet.is(), "SbaXDataBrowserController::OnCanceledNotFound : no model set ?!"); - Any aOld = xModelSet->getPropertyValue(::rtl::OUString::createFromAscii("DisplayIsSynchron")); - xModelSet->setPropertyValue(::rtl::OUString::createFromAscii("DisplayIsSynchron"), ::comphelper::makeBoolAny(sal_Bool(sal_True))); - xModelSet->setPropertyValue(::rtl::OUString::createFromAscii("DisplayIsSynchron"), aOld); + OSL_ENSURE(xModelSet.is(), "SbaXDataBrowserController::OnCanceledNotFound : no model set ?!"); + Any aOld = xModelSet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron"))); + xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron")), ::comphelper::makeBoolAny(sal_Bool(sal_True))); + xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron")), aOld); } catch( const Exception& ) { @@ -2769,7 +2762,7 @@ void SbaXDataBrowserController::unloaded(const EventObject& /*aEvent*/) throw( R RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::unloaded" ); m_xParser.clear(); InvalidateAll(); - // do this asynchron, there are other listeners reacting on this message ... + // do this asynchronously, there are other listeners reacting on this message ... // (it's a little hack : the grid columns are listening to this event, too, and their bound field may // change as a reaction on that event. as we have no chance to be notified of this change (which is // the one we're interested in) we give them time to do what they want to before invalidating our @@ -2807,7 +2800,7 @@ void SbaXDataBrowserController::enterFormAction() //------------------------------------------------------------------------------ void SbaXDataBrowserController::leaveFormAction() { - DBG_ASSERT( m_nFormActionNestingLevel > 0, "SbaXDataBrowserController::leaveFormAction : invalid call !" ); + OSL_ENSURE( m_nFormActionNestingLevel > 0, "SbaXDataBrowserController::leaveFormAction : invalid call !" ); if ( --m_nFormActionNestingLevel > 0 ) return; @@ -2843,7 +2836,7 @@ sal_Bool SbaXDataBrowserController::isValidCursor() const { bIsValid = m_xParser.is(); } - } // if ( !bIsValid ) + } return bIsValid; } @@ -2932,7 +2925,7 @@ void LoadFormHelper::implDispose() void SAL_CALL LoadFormHelper::loaded(const ::com::sun::star::lang::EventObject& /*aEvent*/) throw( RuntimeException ) { ::osl::MutexGuard aGuard(m_aAccessSafety); - DBG_ASSERT(m_eState == STARTED || m_eState == DISPOSED, "LoadFormHelper::loaded : wrong call !"); + OSL_ENSURE(m_eState == STARTED || m_eState == DISPOSED, "LoadFormHelper::loaded : wrong call !"); if (m_eState == STARTED) m_eState = LOADED; } @@ -2941,7 +2934,7 @@ void SAL_CALL LoadFormHelper::loaded(const ::com::sun::star::lang::EventObject& void SAL_CALL LoadFormHelper::unloaded(const ::com::sun::star::lang::EventObject& /*aEvent*/) throw( RuntimeException ) { ::osl::MutexGuard aGuard(m_aAccessSafety); - DBG_ERROR("LoadFormHelper::unloaded : shouldn't be called !"); + OSL_FAIL("LoadFormHelper::unloaded : shouldn't be called !"); implDispose(); } @@ -3085,3 +3078,5 @@ sal_Bool SbaXDataBrowserController::InitializeGridModel(const Reference< ::com:: //.................................................................. } // namespace dbaui //.................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/browser/brwview.cxx b/dbaccess/source/ui/browser/brwview.cxx index 37dfdaefb0c3..179ae16eaac4 100644 --- a/dbaccess/source/ui/browser/brwview.cxx +++ b/dbaccess/source/ui/browser/brwview.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,49 +29,25 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbui.hxx" -#ifndef _SBA_BWRCTRLR_HXX #include "brwctrlr.hxx" -#endif -#ifndef _SBX_BRWVIEW_HXX #include "brwview.hxx" -#endif -#ifndef _SBA_GRID_HXX #include "sbagrid.hxx" -#endif -#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include <toolkit/helper/vclunohelper.hxx> -#endif -#ifndef _COMPHELPER_TYPES_HXX_ #include <comphelper/types.hxx> -#endif -#ifndef _SV_SPLIT_HXX #include <vcl/split.hxx> -#endif -#ifndef DBACCESS_UI_DBTREEVIEW_HXX #include "dbtreeview.hxx" -#endif -#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC #include "dbustrings.hrc" -#endif -#ifndef _DBU_BRW_HRC_ #include "dbu_brw.hrc" -#endif -#ifndef _COM_SUN_STAR_FORM_XLOADABLE_HPP_ #include <com/sun/star/form/XLoadable.hpp> -#endif -#ifndef _COM_SUN_STAR_AWT_XCONTROLCONTAINER_HPP_ #include <com/sun/star/awt/XControlContainer.hpp> -#endif -#ifndef DBAUI_TOOLS_HXX #include "UITools.hxx" -#endif +#include <osl/diagnose.h> using namespace dbaui; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::form; -// using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; @@ -128,7 +105,7 @@ void UnoDataBrowserView::Construct(const Reference< ::com::sun::star::awt::XCont // create the (UNO-) control m_xGrid = new SbaXGridControl(getORB()); - DBG_ASSERT(m_xGrid.is(), "UnoDataBrowserView::Construct : could not create a grid control !"); + OSL_ENSURE(m_xGrid.is(), "UnoDataBrowserView::Construct : could not create a grid control !"); // in design mode (for the moment) m_xGrid->setDesignMode(sal_True); @@ -146,9 +123,9 @@ void UnoDataBrowserView::Construct(const Reference< ::com::sun::star::awt::XCont m_pVclControl = NULL; getVclControl(); - DBG_ASSERT(m_pVclControl != NULL, "UnoDataBrowserView::Construct : no real grid control !"); + OSL_ENSURE(m_pVclControl != NULL, "UnoDataBrowserView::Construct : no real grid control !"); } - catch(Exception&) + catch(const Exception&) { ::comphelper::disposeComponent(m_xGrid); throw; @@ -174,7 +151,7 @@ UnoDataBrowserView::~UnoDataBrowserView() ::comphelper::disposeComponent(m_xGrid); ::comphelper::disposeComponent(m_xMe); } - catch(Exception) + catch(const Exception&) {} DBG_DTOR(UnoDataBrowserView,NULL); @@ -393,3 +370,5 @@ BrowserViewStatusDisplay::~BrowserViewStatusDisplay( ) DBG_DTOR(BrowserViewStatusDisplay,NULL); } // ----------------------------------------------------------------------------- + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/browser/dataview.cxx b/dbaccess/source/ui/browser/dataview.cxx index f4e79d25781d..d58eee0feb35 100644 --- a/dbaccess/source/ui/browser/dataview.cxx +++ b/dbaccess/source/ui/browser/dataview.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,34 +29,16 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbui.hxx" -#ifndef DBAUI_DATAVIEW_HXX #include "dataview.hxx" -#endif -#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include <toolkit/unohlp.hxx> -#endif -#ifndef _COMPHELPER_TYPES_HXX_ #include <comphelper/types.hxx> -#endif #include <comphelper/namedvaluecollection.hxx> -#ifndef _SFXAPP_HXX //autogen wg. SFX_APP #include <sfx2/app.hxx> -#endif -#ifndef _SFXIMGMGR_HXX #include <sfx2/imgmgr.hxx> -#endif -#ifndef DBAUI_ICONTROLLER_HXX #include "IController.hxx" -#endif -#ifndef DBAUI_TOOLS_HXX #include "UITools.hxx" -#endif -#ifndef _SFX_HRC #include <sfx2/sfx.hrc> -#endif -#ifndef _SVTOOLS_IMGDEF_HXX #include <svtools/imgdef.hxx> -#endif #include <tools/diagnose_ex.h> //......................................................................... @@ -239,3 +222,5 @@ namespace dbaui } // namespace dbaui //......................................................................... + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/browser/dbexchange.cxx b/dbaccess/source/ui/browser/dbexchange.cxx index 4cc6bdcc2cb3..867805bc6761 100644 --- a/dbaccess/source/ui/browser/dbexchange.cxx +++ b/dbaccess/source/ui/browser/dbexchange.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -261,3 +262,4 @@ namespace dbaui } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/browser/dbloader.cxx b/dbaccess/source/ui/browser/dbloader.cxx index dd0699856a05..0997b2f863c5 100644 --- a/dbaccess/source/ui/browser/dbloader.cxx +++ b/dbaccess/source/ui/browser/dbloader.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -59,6 +60,7 @@ #include <tools/diagnose_ex.h> #include <tools/urlobj.hxx> #include <vcl/svapp.hxx> +#include <sal/macros.h> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -91,7 +93,7 @@ public: // static methods static ::rtl::OUString getImplementationName_Static() throw( ) { - return ::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.DBContentLoader"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.DBContentLoader")); } static Sequence< ::rtl::OUString> getSupportedServiceNames_Static(void) throw( ); static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > @@ -159,8 +161,8 @@ Sequence< ::rtl::OUString > SAL_CALL DBContentLoader::getSupportedServiceNames(v Sequence< ::rtl::OUString > DBContentLoader::getSupportedServiceNames_Static(void) throw( ) { Sequence< ::rtl::OUString > aSNS( 2 ); - aSNS.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.frame.FrameLoader"); - aSNS.getArray()[1] = ::rtl::OUString::createFromAscii("com.sun.star.sdb.ContentLoader"); + aSNS.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.FrameLoader")); + aSNS.getArray()[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.ContentLoader")); return aSNS; } // ------------------------------------------------------------------------- @@ -169,17 +171,17 @@ extern "C" void SAL_CALL writeDBLoaderInfo(void* pRegistryKey) Reference< XRegistryKey> xKey(reinterpret_cast< XRegistryKey*>(pRegistryKey)); // register content loader for dispatch - ::rtl::OUString aImpl = ::rtl::OUString::createFromAscii("/"); + ::rtl::OUString aImpl(RTL_CONSTASCII_USTRINGPARAM("/")); aImpl += DBContentLoader::getImplementationName_Static(); ::rtl::OUString aImpltwo = aImpl; - aImpltwo += ::rtl::OUString::createFromAscii("/UNO/Loader"); + aImpltwo += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/Loader")); Reference< XRegistryKey> xNewKey = xKey->createKey( aImpltwo ); aImpltwo = aImpl; - aImpltwo += ::rtl::OUString::createFromAscii("/Loader"); + aImpltwo += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/Loader")); Reference< XRegistryKey > xLoaderKey = xKey->createKey( aImpltwo ); - xNewKey = xLoaderKey->createKey( ::rtl::OUString::createFromAscii("Pattern") ); - xNewKey->setAsciiValue( ::rtl::OUString::createFromAscii(".component:DB*") ); + xNewKey = xLoaderKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Pattern")) ); + xNewKey->setAsciiValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".component:DB*")) ); } // ----------------------------------------------------------------------- @@ -216,7 +218,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const :: Reference< XController2 > xController; const ::rtl::OUString sComponentURL( aParser.GetMainURL( INetURLObject::DECODE_TO_IURI ) ); - for ( size_t i=0; i < sizeof( aImplementations ) / sizeof( aImplementations[0] ); ++i ) + for ( size_t i=0; i < SAL_N_ELEMENTS( aImplementations ); ++i ) { if ( sComponentURL.equalsAscii( aImplementations[i].pAsciiServiceName ) ) { @@ -227,7 +229,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const :: // if a data source browser is loaded without its tree pane, then we assume it to be a // table data view, effectively. In this case, we need to adjust the module identifier. - // 2008-02-05 / i85879 / frank.schoenheit@sun.com + // #i85879# ::comphelper::NamedValueCollection aLoadArgs( rArgs ); if ( sComponentURL == URL_COMPONENT_DATASOURCEBROWSER ) @@ -301,11 +303,11 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const :: } // init controller - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; try { Reference<XInitialization > xIni(xController,UNO_QUERY); - PropertyValue aFrame(::rtl::OUString::createFromAscii("Frame"),0,makeAny(rFrame),PropertyState_DIRECT_VALUE); + PropertyValue aFrame(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Frame")),0,makeAny(rFrame),PropertyState_DIRECT_VALUE); Sequence< Any > aInitArgs(m_aArgs.getLength()+1); Any* pBegin = aInitArgs.getArray(); @@ -356,3 +358,4 @@ void DBContentLoader::cancel(void) throw() { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/browser/dbtreemodel.cxx b/dbaccess/source/ui/browser/dbtreemodel.cxx index 94a3f7e93696..44b3508e786e 100644 --- a/dbaccess/source/ui/browser/dbtreemodel.cxx +++ b/dbaccess/source/ui/browser/dbtreemodel.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,15 +29,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbui.hxx" -#ifndef DBAUI_DBTREEMODEL_HXX #include "dbtreemodel.hxx" -#endif -#ifndef _DBU_RESOURCE_HRC_ #include "dbu_resource.hrc" -#endif -#ifndef _OSL_DIAGNOSE_H_ #include <osl/diagnose.h> -#endif namespace dbaui { @@ -53,3 +48,5 @@ namespace dbaui DBG_DTOR(DBTreeListUserData,NULL); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/browser/dbtreemodel.hxx b/dbaccess/source/ui/browser/dbtreemodel.hxx index 33186543afab..12ce3ed3925a 100644 --- a/dbaccess/source/ui/browser/dbtreemodel.hxx +++ b/dbaccess/source/ui/browser/dbtreemodel.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,21 +29,11 @@ #ifndef DBAUI_DBTREEMODEL_HXX #define DBAUI_DBTREEMODEL_HXX -#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_ #include <com/sun/star/container/XNameAccess.hpp> -#endif -#ifndef _SVLBOX_HXX #include <svtools/svlbox.hxx> -#endif -#ifndef _SVLBOXITM_HXX #include <svtools/svlbitm.hxx> -#endif -#ifndef _SBA_UNODATBR_HXX_ #include "unodatbr.hxx" -#endif -#ifndef _DBAUI_COMMON_TYPES_HXX_ #include "commontypes.hxx" -#endif // syntax of the tree userdata // datasource holds the connection @@ -77,3 +68,5 @@ namespace dbaui } #endif // DBAUI_DBTREEMODEL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/browser/dbtreeview.cxx b/dbaccess/source/ui/browser/dbtreeview.cxx index 0da64c8160b0..55452581dbb1 100644 --- a/dbaccess/source/ui/browser/dbtreeview.cxx +++ b/dbaccess/source/ui/browser/dbtreeview.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,18 +29,10 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbui.hxx" -#ifndef DBACCESS_UI_DBTREEVIEW_HXX #include "dbtreeview.hxx" -#endif -#ifndef _SVTREEBOX_HXX #include <svtools/svtreebx.hxx> -#endif -#ifndef DBAUI_DBTREELISTBOX_HXX #include "dbtreelistbox.hxx" -#endif -#ifndef DBAUI_DBTREEMODEL_HXX #include "dbtreemodel.hxx" -#endif #include "dbaccess_helpid.hrc" // ......................................................................... @@ -129,3 +122,4 @@ void DBTreeView::GetFocus() // ......................................................................... +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/browser/dbtreeview.hxx b/dbaccess/source/ui/browser/dbtreeview.hxx index b008a79a4195..2cba0dd10b08 100644 --- a/dbaccess/source/ui/browser/dbtreeview.hxx +++ b/dbaccess/source/ui/browser/dbtreeview.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,13 +29,9 @@ #ifndef DBACCESS_UI_DBTREEVIEW_HXX #define DBACCESS_UI_DBTREEVIEW_HXX -#ifndef _SV_WINDOW_HXX //autogen #include <vcl/window.hxx> -#endif -#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#endif class SvTreeListBox; class SvLBoxTreeList; @@ -80,3 +77,4 @@ namespace dbaui #endif // DBACCESS_UI_DBTREEVIEW_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx index bfed5bbbe749..d0d6bb663a53 100644 --- a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx +++ b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,33 +29,15 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbui.hxx" -#ifndef _SBA_UNODATBR_HXX_ #include "unodatbr.hxx" -#endif -#ifndef DBACCESS_UI_BROWSER_ID_HXX #include "browserids.hxx" -#endif -#ifndef _DBAUI_LISTVIEWITEMS_HXX_ #include "listviewitems.hxx" -#endif -#ifndef DBACCESS_IMAGEPROVIDER_HXX #include "imageprovider.hxx" -#endif -#ifndef _TOOLS_DEBUG_HXX -#include <tools/debug.hxx> -#endif -#ifndef DBACCESS_UI_DBTREEVIEW_HXX +#include <osl/diagnose.h> #include "dbtreeview.hxx" -#endif -#ifndef DBAUI_DBTREELISTBOX_HXX #include "dbtreelistbox.hxx" -#endif -#ifndef _DBU_BRW_HRC_ #include "dbu_brw.hrc" -#endif -#ifndef DBAUI_DBTREEMODEL_HXX #include "dbtreemodel.hxx" -#endif using namespace ::com::sun::star::frame; using namespace ::dbtools; @@ -67,7 +50,7 @@ namespace dbaui // ----------------------------------------------------------------------------- SbaTableQueryBrowser::EntryType SbaTableQueryBrowser::getChildType( SvLBoxEntry* _pEntry ) const { - DBG_ASSERT(isContainer(_pEntry), "SbaTableQueryBrowser::getChildType: invalid entry!"); + OSL_ENSURE(isContainer(_pEntry), "SbaTableQueryBrowser::getChildType: invalid entry!"); switch (getEntryType(_pEntry)) { case etTableContainer: @@ -142,7 +125,7 @@ void SbaTableQueryBrowser::select(SvLBoxEntry* _pEntry, sal_Bool _bSelect) m_pTreeModel->InvalidateEntry(_pEntry); } else { - DBG_ERROR("SbaTableQueryBrowser::select: invalid entry!"); + OSL_FAIL("SbaTableQueryBrowser::select: invalid entry!"); } } @@ -162,7 +145,7 @@ sal_Bool SbaTableQueryBrowser::isSelected(SvLBoxEntry* _pEntry) const if (pTextItem) return static_cast<OBoldListboxString*>(pTextItem)->isEmphasized(); else { - DBG_ERROR("SbaTableQueryBrowser::isSelected: invalid entry!"); + OSL_FAIL("SbaTableQueryBrowser::isSelected: invalid entry!"); } return sal_False; } @@ -174,7 +157,7 @@ void SbaTableQueryBrowser::SelectionChanged() InvalidateFeature(ID_BROWSER_INSERTCOLUMNS); InvalidateFeature(ID_BROWSER_INSERTCONTENT); InvalidateFeature(ID_BROWSER_FORMLETTER); - } // if ( !m_bShowMenu ) + } InvalidateFeature(ID_BROWSER_COPY); InvalidateFeature(ID_BROWSER_CUT); } @@ -217,7 +200,7 @@ sal_Int32 SbaTableQueryBrowser::getDatabaseObjectType( EntryType _eType ) default: break; } - OSL_ENSURE( false, "SbaTableQueryBrowser::getDatabaseObjectType: folder types and 'Unknown' not allowed here!" ); + OSL_FAIL( "SbaTableQueryBrowser::getDatabaseObjectType: folder types and 'Unknown' not allowed here!" ); return DatabaseObject::TABLE; } @@ -241,25 +224,21 @@ void SbaTableQueryBrowser::notifyHiContrastChanged() ::std::auto_ptr< ImageProvider > pImageProvider( getImageProviderFor( pEntryLoop ) ); // the images for this entry - Image aImage, aImageHC; + Image aImage; if ( pData->eType == etDatasource ) - { - aImage = pImageProvider->getDatabaseImage( false ); - aImageHC = pImageProvider->getDatabaseImage( true ); - } + aImage = pImageProvider->getDatabaseImage(); else { bool bIsFolder = !isObject( pData->eType ); if ( bIsFolder ) { sal_Int32 nObjectType( getDatabaseObjectType( pData->eType ) ); - aImage = pImageProvider->getFolderImage( nObjectType, false ); - aImageHC = pImageProvider->getFolderImage( nObjectType, true ); + aImage = pImageProvider->getFolderImage( nObjectType ); } else { sal_Int32 nObjectType( getDatabaseObjectType( pData->eType ) ); - pImageProvider->getImages( GetEntryText( pEntryLoop ), nObjectType, aImage, aImageHC ); + pImageProvider->getImages( GetEntryText( pEntryLoop ), nObjectType, aImage ); } } @@ -273,10 +252,8 @@ void SbaTableQueryBrowser::notifyHiContrastChanged() SvLBoxContextBmp* pContextBitmapItem = static_cast< SvLBoxContextBmp* >( pItem ); - pContextBitmapItem->SetBitmap1( aImage, BMP_COLOR_NORMAL ); - pContextBitmapItem->SetBitmap2( aImage, BMP_COLOR_NORMAL ); - pContextBitmapItem->SetBitmap1( aImageHC, BMP_COLOR_HIGHCONTRAST ); - pContextBitmapItem->SetBitmap2( aImageHC, BMP_COLOR_HIGHCONTRAST ); + pContextBitmapItem->SetBitmap1( aImage ); + pContextBitmapItem->SetBitmap2( aImage ); break; } @@ -289,3 +266,4 @@ void SbaTableQueryBrowser::notifyHiContrastChanged() } // namespace dbaui // ......................................................................... +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/browser/dsbrowserDnD.cxx b/dbaccess/source/ui/browser/dsbrowserDnD.cxx index 8ca7ad79f385..f30345757ddf 100644 --- a/dbaccess/source/ui/browser/dsbrowserDnD.cxx +++ b/dbaccess/source/ui/browser/dsbrowserDnD.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -47,9 +48,9 @@ #include <connectivity/dbexception.hxx> #include <connectivity/dbtools.hxx> #include <cppuhelper/exc_hlp.hxx> -#include <svtools/treelist.hxx> #include <svx/dataaccessdescriptor.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <functional> // ......................................................................... @@ -136,7 +137,7 @@ namespace dbaui EntryType eEntryType = getEntryType( pHitEntry ); if (!isContainer(eEntryType)) { - DBG_ERROR("SbaTableQueryBrowser::executeDrop: what the hell did queryDrop do?"); + OSL_FAIL("SbaTableQueryBrowser::executeDrop: what the hell did queryDrop do?"); // queryDrop shoud not have allowed us to reach this situation .... return DND_ACTION_NONE; } @@ -241,7 +242,7 @@ namespace dbaui IMPL_LINK( SbaTableQueryBrowser, OnAsyncDrop, void*, /*NOTINTERESTEDIN*/ ) { m_nAsyncDrop = 0; - ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( getMutex() ); if ( m_aAsyncDrop.nType == E_TABLE ) @@ -277,7 +278,7 @@ namespace dbaui if ( pData->xConnection.is() ) { - DBG_ASSERT( impl_isDataSourceEntry( pEntryLoop ), "SbaTableQueryBrowser::clearTreeModel: no data source entry, but a connection?" ); + OSL_ENSURE( impl_isDataSourceEntry( pEntryLoop ), "SbaTableQueryBrowser::clearTreeModel: no data source entry, but a connection?" ); // connections are to be stored *only* at the data source entries impl_releaseConnection( pData->xConnection ); } @@ -293,3 +294,4 @@ namespace dbaui } // namespace dbaui // ......................................................................... +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/browser/exsrcbrw.cxx b/dbaccess/source/ui/browser/exsrcbrw.cxx index b0dd7e72696e..0d93b52eabd2 100644 --- a/dbaccess/source/ui/browser/exsrcbrw.cxx +++ b/dbaccess/source/ui/browser/exsrcbrw.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,39 +29,17 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbui.hxx" -#ifndef _SBA_EXTCTRLR_HXX #include "exsrcbrw.hxx" -#endif -#ifndef _COM_SUN_STAR_FORM_FORMCOMPONENTTYPE_HPP_ #include <com/sun/star/form/FormComponentType.hpp> -#endif -#ifndef _COM_SUN_STAR_UTIL_XURLTRANSFORMER_HPP_ #include <com/sun/star/util/XURLTransformer.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XGRIDCOLUMNFACTORY_HPP_ #include <com/sun/star/form/XGridColumnFactory.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XLOADABLE_HPP_ #include <com/sun/star/form/XLoadable.hpp> -#endif -#ifndef _COM_SUN_STAR_FRAME_FRAMESEARCHFLAG_HPP_ #include <com/sun/star/frame/FrameSearchFlag.hpp> -#endif -#ifndef _SBA_FORMADAPTER_HXX #include "formadapter.hxx" -#endif -#ifndef _COMPHELPER_PROCESSFACTORY_HXX_ #include <comphelper/processfactory.hxx> -#endif -#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC #include "dbustrings.hrc" -#endif -#ifndef _DBU_REGHELPER_HXX_ #include "dbu_reghelper.hxx" -#endif -#ifndef TOOLS_DIAGNOSE_EX_H #include <tools/diagnose_ex.h> -#endif using namespace ::com::sun::star::uno; using namespace ::com::sun::star::sdb; @@ -175,7 +154,7 @@ void SbaExternalSourceBrowser::modified(const ::com::sun::star::lang::EventObjec void SAL_CALL SbaExternalSourceBrowser::dispatch(const ::com::sun::star::util::URL& aURL, const Sequence< ::com::sun::star::beans::PropertyValue>& aArgs) throw(::com::sun::star::uno::RuntimeException) { const ::com::sun::star::beans::PropertyValue* pArguments = aArgs.getConstArray(); - if (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/AddGridColumn"))) + if (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/AddGridColumn")))) { // search the argument describing the column to create ::rtl::OUString sControlType; @@ -184,21 +163,21 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const ::com::sun::star::util::U sal_uInt16 i; for ( i = 0; i < aArgs.getLength(); ++i, ++pArguments ) { - if (pArguments->Name.equals(::rtl::OUString::createFromAscii("ColumnType"))) + if (pArguments->Name.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ColumnType")))) { sal_Bool bCorrectType = pArguments->Value.getValueType().equals(::getCppuType((const ::rtl::OUString*)0)); OSL_ENSURE(bCorrectType, "invalid type for argument \"ColumnType\" !"); if (bCorrectType) sControlType = ::comphelper::getString(pArguments->Value); } - else if (pArguments->Name.equals(::rtl::OUString::createFromAscii("ColumnPosition"))) + else if (pArguments->Name.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ColumnPosition")))) { sal_Bool bCorrectType = pArguments->Value.getValueType().equals(::getCppuType((const sal_Int16*)0)); OSL_ENSURE(bCorrectType, "invalid type for argument \"ColumnPosition\" !"); if (bCorrectType) nControlPos = ::comphelper::getINT16(pArguments->Value); } - else if (pArguments->Name.equals(::rtl::OUString::createFromAscii("ColumnProperties"))) + else if (pArguments->Name.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ColumnProperties")))) { sal_Bool bCorrectType = pArguments->Value.getValueType().equals(::getCppuType((const Sequence< ::com::sun::star::beans::PropertyValue>*)0)); OSL_ENSURE(bCorrectType, "invalid type for argument \"ColumnProperties\" !"); @@ -206,12 +185,12 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const ::com::sun::star::util::U aControlProps = *(Sequence< ::com::sun::star::beans::PropertyValue>*)pArguments->Value.getValue(); } else - OSL_ENSURE(sal_False, ((ByteString("SbaExternalSourceBrowser::dispatch(AddGridColumn) : unknown argument (") += ByteString((const sal_Unicode*)pArguments->Name, gsl_getSystemTextEncoding()).GetBuffer()) += ") !").GetBuffer()); + OSL_FAIL(((ByteString("SbaExternalSourceBrowser::dispatch(AddGridColumn) : unknown argument (") += ByteString((const sal_Unicode*)pArguments->Name, gsl_getSystemTextEncoding()).GetBuffer()) += ") !").GetBuffer()); } if (!sControlType.getLength()) { - OSL_ENSURE(sal_False, "SbaExternalSourceBrowser::dispatch(AddGridColumn) : missing argument (ColumnType) !"); - sControlType = ::rtl::OUString::createFromAscii("TextField"); + OSL_FAIL("SbaExternalSourceBrowser::dispatch(AddGridColumn) : missing argument (ColumnType) !"); + sControlType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextField")); } OSL_ENSURE(aControlProps.getLength(), "SbaExternalSourceBrowser::dispatch(AddGridColumn) : missing argument (ColumnProperties) !"); @@ -221,7 +200,7 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const ::com::sun::star::util::U Reference< XPropertySetInfo > xNewColProperties; if (xNewCol.is()) xNewColProperties = xNewCol->getPropertySetInfo(); - // set it's properties + // set its properties if (xNewColProperties.is()) { const ::com::sun::star::beans::PropertyValue* pControlProps = aControlProps.getConstArray(); @@ -234,8 +213,7 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const ::com::sun::star::util::U } catch(Exception&) { - OSL_ENSURE(sal_False, - ( ByteString("SbaExternalSourceBrowser::dispatch : could not set a column property (") + OSL_FAIL(( ByteString("SbaExternalSourceBrowser::dispatch : could not set a column property (") += ByteString(pControlProps->Name.getStr(), (sal_uInt16)pControlProps->Name.getLength(), RTL_TEXTENCODING_ASCII_US) += ByteString(")!")).GetBuffer()); } @@ -253,20 +231,20 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const ::com::sun::star::util::U // append the column xColContainer->insertByIndex(nControlPos, makeAny(xNewCol)); } - else if (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/ClearView"))) + else if (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/ClearView")))) { ClearView(); } - else if (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/AttachToForm"))) + else if (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/AttachToForm")))) { if (!m_pDataSourceImpl) return; Reference< XRowSet > xMasterForm; - // search the arguments for he master form + // search the arguments for the master form for (sal_uInt16 i=0; i<aArgs.getLength(); ++i, ++pArguments) { - if ((pArguments->Name.equals(::rtl::OUString::createFromAscii("MasterForm"))) && (pArguments->Value.getValueTypeClass() == TypeClass_INTERFACE)) + if ((pArguments->Name.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MasterForm")))) && (pArguments->Value.getValueTypeClass() == TypeClass_INTERFACE)) { xMasterForm = Reference< XRowSet > (*(Reference< XInterface > *)pArguments->Value.getValue(), UNO_QUERY); break; @@ -274,7 +252,7 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const ::com::sun::star::util::U } if (!xMasterForm.is()) { - OSL_ENSURE(sal_False, "SbaExternalSourceBrowser::dispatch(FormSlots/AttachToForm) : please specify a form to attach to as argument !"); + OSL_FAIL("SbaExternalSourceBrowser::dispatch(FormSlots/AttachToForm) : please specify a form to attach to as argument !"); return; } @@ -293,22 +271,22 @@ Reference< ::com::sun::star::frame::XDispatch > SAL_CALL SbaExternalSourceBrows m_bInQueryDispatch = sal_True; - if ( (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/AttachToForm"))) + if ( (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/AttachToForm")))) // attach a new external form - || (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/AddGridColumn"))) + || (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/AddGridColumn")))) // add a column to the grid - || (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/ClearView"))) + || (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/ClearView")))) // clear the grid ) xReturn = (::com::sun::star::frame::XDispatch*)this; if ( !xReturn.is() - && ( (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/moveToFirst"))) - || (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/moveToPrev"))) - || (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/moveToNext"))) - || (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/moveToLast"))) - || (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/moveToNew"))) - || (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/undoRecord"))) + && ( (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/moveToFirst")))) + || (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/moveToPrev")))) + || (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/moveToNext")))) + || (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/moveToLast")))) + || (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/moveToNew")))) + || (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/undoRecord")))) ) ) { @@ -321,7 +299,7 @@ Reference< ::com::sun::star::frame::XDispatch > SAL_CALL SbaExternalSourceBrows m_xUrlTransformer->parseStrict( aNewUrl ); // set a new mark - aNewUrl.Mark = ::rtl::OUString::createFromAscii("DB/FormGridView"); + aNewUrl.Mark = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DB/FormGridView")); // this controller is instantiated when somebody dispatches the ".component:DB/FormGridView" in any // frame, so we use "FormGridView" as mark that a dispatch request came from this view @@ -446,7 +424,7 @@ void SbaExternalSourceBrowser::Attach(const Reference< XRowSet > & xMaster) } catch(Exception&) { - OSL_ENSURE(sal_False, "SbaExternalSourceBrowser::Attach : couldn't restore the cursor position !"); + OSL_FAIL("SbaExternalSourceBrowser::Attach : couldn't restore the cursor position !"); } } @@ -498,3 +476,5 @@ void SbaExternalSourceBrowser::stopListening() //================================================================== //================================================================== + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/browser/formadapter.cxx b/dbaccess/source/ui/browser/formadapter.cxx index 03b8f5358751..c74af7b41750 100644 --- a/dbaccess/source/ui/browser/formadapter.cxx +++ b/dbaccess/source/ui/browser/formadapter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,36 +29,17 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbui.hxx" -#ifndef _SBA_FORMADAPTER_HXX #include "formadapter.hxx" -#endif -#ifndef _TOOLS_DEBUG_HXX //autogen #include <tools/debug.hxx> -#endif -#ifndef _COMPHELPER_TYPES_HXX_ +#include <osl/diagnose.h> #include <comphelper/types.hxx> -#endif -#ifndef _COMPHELPER_ENUMHELPER_HXX_ #include <comphelper/enumhelper.hxx> -#endif -#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#endif -#ifndef _STRING_HXX #include <tools/string.hxx> -#endif -#ifndef _DBU_BRW_HRC_ #include "dbu_brw.hrc" -#endif -#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC #include "dbustrings.hrc" -#endif -#ifndef _CPPUHELPER_TYPEPROVIDER_HXX_ #include <cppuhelper/typeprovider.hxx> -#endif -#ifndef _COMPHELPER_SEQUENCE_HXX_ #include <comphelper/sequence.hxx> -#endif using namespace dbaui; using namespace ::com::sun::star::uno; @@ -211,7 +193,7 @@ void SbaXFormAdapter::AttachForm(const Reference< ::com::sun::star::sdbc::XRowSe if (xNewMaster == m_xMainForm) return; - DBG_ASSERT(xNewMaster.get() != static_cast< ::com::sun::star::sdbc::XRowSet* >(this), "SbaXFormAdapter::AttachForm : invalid argument !"); + OSL_ENSURE(xNewMaster.get() != static_cast< ::com::sun::star::sdbc::XRowSet* >(this), "SbaXFormAdapter::AttachForm : invalid argument !"); if (m_xMainForm.is()) { @@ -1097,52 +1079,52 @@ IMPLEMENT_LISTENER_ADMINISTRATION(SbaXFormAdapter, form, SubmitListener, m_aSubm // ------------------------------------------------------------------------- sal_Bool SAL_CALL SbaXFormAdapter::getGroupControl() throw( RuntimeException ) { - DBG_ERROR("SAL_CALL SbaXFormAdapter::getGroupControl : not supported !"); + OSL_FAIL("SAL_CALL SbaXFormAdapter::getGroupControl : not supported !"); return sal_False; } // ------------------------------------------------------------------------- void SAL_CALL SbaXFormAdapter::setGroupControl(sal_Bool /*GroupControl*/) throw( RuntimeException ) { - DBG_ERROR("SAL_CALL SbaXFormAdapter::setGroupControl : not supported !"); + OSL_FAIL("SAL_CALL SbaXFormAdapter::setGroupControl : not supported !"); } // ------------------------------------------------------------------------- void SAL_CALL SbaXFormAdapter::setControlModels(const Sequence< Reference< ::com::sun::star::awt::XControlModel > >& /*Controls*/) throw( RuntimeException ) { - DBG_ERROR("SAL_CALL SbaXFormAdapter::setControlModels : not supported !"); + OSL_FAIL("SAL_CALL SbaXFormAdapter::setControlModels : not supported !"); } // ------------------------------------------------------------------------- Sequence< Reference< ::com::sun::star::awt::XControlModel > > SAL_CALL SbaXFormAdapter::getControlModels() throw( RuntimeException ) { - DBG_ERROR("SAL_CALL SbaXFormAdapter::getControlModels : not supported !"); + OSL_FAIL("SAL_CALL SbaXFormAdapter::getControlModels : not supported !"); return Sequence< Reference< ::com::sun::star::awt::XControlModel > >(); } // ------------------------------------------------------------------------- void SAL_CALL SbaXFormAdapter::setGroup(const Sequence< Reference< ::com::sun::star::awt::XControlModel > >& /*_rGroup*/, const ::rtl::OUString& /*GroupName*/) throw( RuntimeException ) { - DBG_ERROR("SAL_CALL SbaXFormAdapter::setGroup : not supported !"); + OSL_FAIL("SAL_CALL SbaXFormAdapter::setGroup : not supported !"); } // ------------------------------------------------------------------------- sal_Int32 SAL_CALL SbaXFormAdapter::getGroupCount() throw( RuntimeException ) { - DBG_ERROR("SAL_CALL SbaXFormAdapter::getGroupCount : not supported !"); + OSL_FAIL("SAL_CALL SbaXFormAdapter::getGroupCount : not supported !"); return 0; } // ------------------------------------------------------------------------- void SAL_CALL SbaXFormAdapter::getGroup(sal_Int32 /*nGroup*/, Sequence< Reference< ::com::sun::star::awt::XControlModel > >& /*_rGroup*/, ::rtl::OUString& /*Name*/) throw( RuntimeException ) { - DBG_ERROR("SAL_CALL SbaXFormAdapter::getGroup : not supported !"); + OSL_FAIL("SAL_CALL SbaXFormAdapter::getGroup : not supported !"); } // ------------------------------------------------------------------------- void SAL_CALL SbaXFormAdapter::getGroupByName(const ::rtl::OUString& /*Name*/, Sequence< Reference< ::com::sun::star::awt::XControlModel > >& /*_rGroup*/) throw( RuntimeException ) { - DBG_ERROR("SAL_CALL SbaXFormAdapter::getGroupByName : not supported !"); + OSL_FAIL("SAL_CALL SbaXFormAdapter::getGroupByName : not supported !"); } // ::com::sun::star::lang::XComponent @@ -1207,7 +1189,7 @@ void SAL_CALL SbaXFormAdapter::removeEventListener(const Reference< ::com::sun:: void SAL_CALL SbaXFormAdapter::setFastPropertyValue(sal_Int32 nHandle, const Any& aValue) throw( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, RuntimeException ) { Reference< ::com::sun::star::beans::XFastPropertySet > xSet(m_xMainForm, UNO_QUERY); - DBG_ASSERT(xSet.is(), "SAL_CALL SbaXFormAdapter::setFastPropertyValue : have no master form !"); + OSL_ENSURE(xSet.is(), "SAL_CALL SbaXFormAdapter::setFastPropertyValue : have no master form !"); if (m_nNamePropHandle == nHandle) { @@ -1240,7 +1222,7 @@ void SAL_CALL SbaXFormAdapter::setFastPropertyValue(sal_Int32 nHandle, const Any Any SAL_CALL SbaXFormAdapter::getFastPropertyValue(sal_Int32 nHandle) throw( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, RuntimeException ) { Reference< ::com::sun::star::beans::XFastPropertySet > xSet(m_xMainForm, UNO_QUERY); - DBG_ASSERT(xSet.is(), "SAL_CALL SbaXFormAdapter::getFastPropertyValue : have no master form !"); + OSL_ENSURE(xSet.is(), "SAL_CALL SbaXFormAdapter::getFastPropertyValue : have no master form !"); if (m_nNamePropHandle == nHandle) return makeAny(m_sName); @@ -1334,7 +1316,7 @@ Sequence< Any > SAL_CALL SbaXFormAdapter::getPropertyValues(const Sequence< ::rt // search for (and fake) the NAME property const ::rtl::OUString* pNames = aPropertyNames.getConstArray(); Any* pValues = aReturn.getArray(); - DBG_ASSERT(aReturn.getLength() == aPropertyNames.getLength(), "SAL_CALL SbaXFormAdapter::getPropertyValues : the main form returned an invalid-length sequence !"); + OSL_ENSURE(aReturn.getLength() == aPropertyNames.getLength(), "SAL_CALL SbaXFormAdapter::getPropertyValues : the main form returned an invalid-length sequence !"); for (sal_Int32 i=0; i<aPropertyNames.getLength(); ++i, ++pNames, ++pValues) if (pNames->equals(PROPERTY_NAME)) { @@ -1516,7 +1498,7 @@ void SbaXFormAdapter::implInsert(const Any& aElement, sal_Int32 nIndex, const :: if (sal::static_int_cast< sal_uInt32 >(nIndex) > m_aChildren.size()) nIndex = m_aChildren.size(); - DBG_ASSERT(m_aChildren.size() == m_aChildNames.size(), "SAL_CALL SbaXFormAdapter::implInsert : inconsistent container state !"); + OSL_ENSURE(m_aChildren.size() == m_aChildNames.size(), "SAL_CALL SbaXFormAdapter::implInsert : inconsistent container state !"); m_aChildren.insert(m_aChildren.begin() + nIndex, xElement); m_aChildNames.insert(m_aChildNames.begin() + nIndex, sName); @@ -1635,7 +1617,7 @@ void SAL_CALL SbaXFormAdapter::removeByIndex(sal_Int32 _rIndex) throw( ::com::su Reference< ::com::sun::star::form::XFormComponent > xAffected = *(m_aChildren.begin() + _rIndex); - DBG_ASSERT(m_aChildren.size() == m_aChildNames.size(), "SAL_CALL SbaXFormAdapter::removeByIndex : inconsistent container state !"); + OSL_ENSURE(m_aChildren.size() == m_aChildNames.size(), "SAL_CALL SbaXFormAdapter::removeByIndex : inconsistent container state !"); m_aChildren.erase(m_aChildren.begin() + _rIndex); m_aChildNames.erase(m_aChildNames.begin() + _rIndex); @@ -1694,7 +1676,7 @@ void SAL_CALL SbaXFormAdapter::replaceByIndex(sal_Int32 _rIndex, const Any& Elem Reference< ::com::sun::star::form::XFormComponent > xOld = *(m_aChildren.begin() + _rIndex); - DBG_ASSERT(m_aChildren.size() == m_aChildNames.size(), "SAL_CALL SbaXFormAdapter::replaceByIndex : inconsistent container state !"); + OSL_ENSURE(m_aChildren.size() == m_aChildNames.size(), "SAL_CALL SbaXFormAdapter::replaceByIndex : inconsistent container state !"); *(m_aChildren.begin() + _rIndex) = xElement; *(m_aChildNames.begin() + _rIndex) = sName; @@ -1769,7 +1751,7 @@ void SAL_CALL SbaXFormAdapter::propertyChange(const ::com::sun::star::beans::Pro if(aIter != m_aChildren.end()) { sal_Int32 nPos = aIter - m_aChildren.begin(); - DBG_ASSERT(*(m_aChildNames.begin() + nPos) == ::comphelper::getString(evt.OldValue), "SAL_CALL SbaXFormAdapter::propertyChange : object has a wrong name !"); + OSL_ENSURE(*(m_aChildNames.begin() + nPos) == ::comphelper::getString(evt.OldValue), "SAL_CALL SbaXFormAdapter::propertyChange : object has a wrong name !"); *(m_aChildNames.begin() + nPos) = ::comphelper::getString(evt.NewValue); } } @@ -1792,3 +1774,4 @@ void SAL_CALL SbaXFormAdapter::disposing(const ::com::sun::star::lang::EventObje // ----------------------------------------------------------------------------- +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index aa6640d4edd5..77489aa422ae 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,106 +28,44 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbui.hxx" -#ifndef DBAUI_GENERICCONTROLLER_HXX #include "genericcontroller.hxx" -#endif -#ifndef _COMPHELPER_UNO3_HXX_ #include <comphelper/uno3.hxx> -#endif -#ifndef _TOOLKIT_AWT_VCLXWINDOW_HXX_ #include <toolkit/awt/vclxwindow.hxx> -#endif -#ifndef DBACCESS_UI_BROWSER_ID_HXX #include "browserids.hxx" -#endif -#ifndef _SV_SVAPP_HXX //autogen #include <vcl/svapp.hxx> -#endif -#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include <toolkit/helper/vclunohelper.hxx> -#endif -#ifndef DBAUI_DATAVIEW_HXX #include "dataview.hxx" -#endif -#ifndef _TOOLS_DEBUG_HXX -#include <tools/debug.hxx> -#endif -#ifndef TOOLS_DIAGNOSE_EX_H #include <tools/diagnose_ex.h> -#endif -#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC +#include <osl/diagnose.h> #include "dbustrings.hrc" -#endif -#ifndef _VCL_STDTEXT_HXX #include <vcl/stdtext.hxx> -#endif -#ifndef _CPPUHELPER_TYPEPROVIDER_HXX_ #include <cppuhelper/typeprovider.hxx> -#endif #include <framework/titlehelper.hxx> -#ifndef _COMPHELPER_SEQUENCE_HXX_ #include <comphelper/sequence.hxx> -#endif -#ifndef _COMPHELPER_EXTRACT_HXX_ #include <comphelper/extract.hxx> -#endif -#ifndef _COM_SUN_STAR_SDBC_XDATASOURCE_HPP_ #include <com/sun/star/sdbc/XDataSource.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_SQLCONTEXT_HPP_ #include <com/sun/star/sdb/SQLContext.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_XCOMPLETEDCONNECTION_HPP_ #include <com/sun/star/sdb/XCompletedConnection.hpp> -#endif -#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include <com/sun/star/beans/XPropertySet.hpp> -#endif -#ifndef _COM_SUN_STAR_TASK_XINTERACTIONHANDLER_HPP_ #include <com/sun/star/task/XInteractionHandler.hpp> -#endif -#ifndef _COM_SUN_STAR_UTIL_XCLOSEABLE_HPP_ #include <com/sun/star/util/XCloseable.hpp> -#endif -#ifndef DBAUI_TOOLS_HXX #include "UITools.hxx" -#endif -#ifndef _DBAUI_COMMON_TYPES_HXX_ #include "commontypes.hxx" -#endif -#ifndef _SV_WAITOBJ_HXX +#include <sal/macros.h> #include <vcl/waitobj.hxx> -#endif -#ifndef _URLOBJ_HXX #include <tools/urlobj.hxx> -#endif -#ifndef SVTOOLS_URIHELPER_HXX #include <svl/urihelper.hxx> -#endif -#ifndef _DBAUI_DATASOURCECONNECTOR_HXX_ #include "datasourceconnector.hxx" -#endif -#ifndef INCLUDED_SVTOOLS_MODULEOPTIONS_HXX #include <unotools/moduleoptions.hxx> -#endif -#ifndef _COM_SUN_STAR_FRAME_FRAMESEARCHFLAG_HPP_ #include <com/sun/star/frame/FrameSearchFlag.hpp> -#endif -#ifndef _COM_SUN_STAR_FRAME_STATUS_VISIBILITY_HPP_ #include <com/sun/star/frame/status/Visibility.hpp> -#endif -#ifndef _COM_SUN_STAR_UTIL_XMODIFIABLE_HPP_ #include <com/sun/star/util/XModifiable.hpp> -#endif -#ifndef _RTL_USTRING_HXX_ #include <rtl/ustring.hxx> -#endif -#ifndef _RTL_LOGFILE_HXX_ #include <rtl/logfile.hxx> -#endif #include <algorithm> -#include <hash_map> +#include <o3tl/compat_functional.hxx> +#include <boost/unordered_map.hpp> #include <cppuhelper/implbase1.hxx> #include <limits> @@ -152,7 +91,7 @@ using namespace ::comphelper; #define LAST_USER_DEFINED_FEATURE ( ::std::numeric_limits< sal_uInt16 >::max() ) // ------------------------------------------------------------------------- -typedef ::std::hash_map< sal_Int16, sal_Int16 > CommandHashMap; +typedef ::boost::unordered_map< sal_Int16, sal_Int16 > CommandHashMap; typedef ::std::list< DispatchInformation > DispatchInfoList; @@ -213,7 +152,7 @@ void UserDefinedFeatures::execute( const URL& _rFeatureURL, const Sequence< Prop if ( xDispatch == xController ) { - OSL_ENSURE( false, "UserDefinedFeatures::execute: the controller shouldn't be the dispatcher here!" ); + OSL_FAIL( "UserDefinedFeatures::execute: the controller shouldn't be the dispatcher here!" ); xDispatch.clear(); } @@ -271,7 +210,7 @@ OGenericUnoController::OGenericUnoController(const Reference< XMultiServiceFacto try { - m_xUrlTransformer = Reference< XURLTransformer > (_rM->createInstance(::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer")), UNO_QUERY); + m_xUrlTransformer = Reference< XURLTransformer > (_rM->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY); } catch(Exception&) { @@ -294,7 +233,7 @@ OGenericUnoController::OGenericUnoController() ,m_bReadOnly(sal_False) ,m_bCurrentlyModified(sal_False) { - OSL_ENSURE( false, "OGenericUnoController::OGenericUnoController: illegal call!" ); + OSL_FAIL( "OGenericUnoController::OGenericUnoController: illegal call!" ); // This ctor only exists because the MSVC compiler complained about an unresolved external // symbol. It should not be used at all. Since using it yields strange runtime problems, // we simply abort here. @@ -324,14 +263,14 @@ sal_Bool OGenericUnoController::Construct(Window* /*pParent*/) fillSupportedFeatures(); // create the database context - DBG_ASSERT(getORB().is(), "OGenericUnoController::Construct need a service factory!"); + OSL_ENSURE(getORB().is(), "OGenericUnoController::Construct need a service factory!"); try { m_xDatabaseContext = Reference< XNameAccess >(getORB()->createInstance(SERVICE_SDB_DATABASECONTEXT), UNO_QUERY); } catch(Exception&) { - DBG_ERROR("OGenericUnoController::Construct: could not create (or start listening at) the database context!"); + OSL_FAIL("OGenericUnoController::Construct: could not create (or start listening at) the database context!"); } if (!m_xDatabaseContext.is()) @@ -354,7 +293,7 @@ void OGenericUnoController::impl_initialize() // ------------------------------------------------------------------------- void SAL_CALL OGenericUnoController::initialize( const Sequence< Any >& aArguments ) throw(Exception, RuntimeException) { - vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( getMutex() ); Reference< XWindow > xParent; @@ -370,12 +309,6 @@ void SAL_CALL OGenericUnoController::initialize( const Sequence< Any >& aArgumen { xFrame.set(aValue.Value,UNO_QUERY_THROW); } - /* #i42316# - else if ( ( *pIter >>= aValue ) && ( 0 == aValue.Name.compareToAscii( "ReadOnly" ) ) ) - { - aValue.Value >>= m_bReadOnly; - } - */ else if ( ( *pIter >>= aValue ) && ( 0 == aValue.Name.compareToAscii( "Preview" ) ) ) { aValue.Value >>= m_bPreview; @@ -392,7 +325,7 @@ void SAL_CALL OGenericUnoController::initialize( const Sequence< Any >& aArgumen Window* pParentWin = pParentComponent ? pParentComponent->GetWindow() : NULL; if (!pParentWin) { - throw IllegalArgumentException( ::rtl::OUString::createFromAscii( "Parent window is null" ), *this, 1 ); + throw IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Parent window is null")), *this, 1 ); } m_aInitParameters.assign( aArguments ); @@ -400,7 +333,7 @@ void SAL_CALL OGenericUnoController::initialize( const Sequence< Any >& aArgumen ODataView* pView = getView(); if ( !pView ) - throw RuntimeException( ::rtl::OUString::createFromAscii( "unable to create a view" ), *this ); + throw RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unable to create a view")), *this ); if ( m_bReadOnly || m_bPreview ) pView->EnableInput( sal_False ); @@ -487,7 +420,7 @@ Sequence< PropertyValue > SAL_CALL OGenericUnoController::getCreationArguments() // ----------------------------------------------------------------------- void OGenericUnoController::attachFrame( const Reference< XFrame >& _rxFrame ) throw( RuntimeException ) { - vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( getMutex() ); stopFrameListening( m_aCurrentFrame.getFrame() ); @@ -545,7 +478,6 @@ namespace // #i67882# is the bug which was caused by the real fix which we did in framework // #i68216# is the bug which requests to fix the code in Draw which relies on // framework's implementation details - // 2006-08-07 / frank.schoenheit@sun.com if ( !!_rFeatureState.sTitle ) _out_rStates.push_back( makeAny( *_rFeatureState.sTitle ) ); if ( !!_rFeatureState.bChecked ) @@ -607,7 +539,6 @@ void OGenericUnoController::ImplBroadcastFeatureState(const ::rtl::OUString& _rF // it is possible that listeners are registered or revoked while // we are notifying them, so we must use a copy of m_arrStatusListener, not // m_arrStatusListener itself - // #121276# / 2005-05-19 / frank.schoenheit@sun.com Dispatch aNotifyLoop( m_arrStatusListener ); DispatchIterator iterSearch = aNotifyLoop.begin(); DispatchIterator iterEnd = aNotifyLoop.end(); @@ -681,7 +612,7 @@ void OGenericUnoController::InvalidateFeature_Impl() ::rtl::OString sMessage( "OGenericUnoController::InvalidateFeature_Impl: feature id " ); sMessage += ::rtl::OString::valueOf( aNextFeature.nId ); sMessage += ::rtl::OString( " has been invalidated, but is not supported!" ); - OSL_ENSURE( false, sMessage.getStr() ); + OSL_FAIL( sMessage.getStr() ); } #endif if ( m_aSupportedFeatures.end() != aFeaturePos ) @@ -748,7 +679,7 @@ void OGenericUnoController::InvalidateAll() void OGenericUnoController::InvalidateAll_Impl() { // --------------------------------- - // invalidate all aupported features + // invalidate all supported features for ( SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.begin(); aIter != m_aSupportedFeatures.end(); @@ -758,7 +689,7 @@ void OGenericUnoController::InvalidateAll_Impl() { ::osl::MutexGuard aGuard( m_aFeatureMutex); - DBG_ASSERT(m_aFeaturesToInvalidate.size(), "OGenericUnoController::InvalidateAll_Impl: to be called from within InvalidateFeature_Impl only!"); + OSL_ENSURE(m_aFeaturesToInvalidate.size(), "OGenericUnoController::InvalidateAll_Impl: to be called from within InvalidateFeature_Impl only!"); m_aFeaturesToInvalidate.pop_front(); if(!m_aFeaturesToInvalidate.empty()) m_aAsyncInvalidateAll.Call(); @@ -841,13 +772,13 @@ void OGenericUnoController::setMasterDispatchProvider(const Reference< XDispatch // ----------------------------------------------------------------------- void OGenericUnoController::dispatch(const URL& _aURL, const Sequence< PropertyValue >& aArgs) throw(RuntimeException) { - ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - // Since the fix for #123967#, the SolarMutex is not locked anymore when the framework calls into + SolarMutexGuard aSolarGuard; + // The SolarMutex is not locked anymore when the framework calls into // here. So, lock it ourself. The real solution would be to lock it only in the places // where it's needed, but a) this might turn out difficult, since we then also need to care // for locking in the proper order (SolarMutex and m_aMutex), and b) this would be too many places // for the time frame of the fix. - // #i52602# / frank.schoenheit@sun.com / 2005-07-29 + // #i52602# #ifdef TIMELOG ::rtl::OString sLog( "OGenericUnoController::dispatch( '" ); @@ -867,12 +798,12 @@ void OGenericUnoController::addStatusListener(const Reference< XStatusListener > if ( m_xUrlTransformer.is() ) m_xUrlTransformer->parseStrict( aParsedURL ); - // remeber the listener together with the URL + // remember the listener together with the URL m_arrStatusListener.insert( m_arrStatusListener.end(), DispatchTarget( aParsedURL, aListener ) ); // initially broadcast the state ImplBroadcastFeatureState( aParsedURL.Complete, aListener, sal_True ); - // force the new state to be broadcasted to the new listener + // force the new state to be broadcast to the new listener } // ----------------------------------------------------------------------- @@ -997,7 +928,7 @@ void OGenericUnoController::implDescribeSupportedFeature( const sal_Char* _pAsci sal_uInt16 _nFeatureId, sal_Int16 _nCommandGroup ) { #ifdef DBG_UTIL - DBG_ASSERT( m_bDescribingSupportedFeatures, "OGenericUnoController::implDescribeSupportedFeature: bad timing for this call!" ); + OSL_ENSURE( m_bDescribingSupportedFeatures, "OGenericUnoController::implDescribeSupportedFeature: bad timing for this call!" ); #endif OSL_PRECOND( _nFeatureId < FIRST_USER_DEFINED_FEATURE, "OGenericUnoController::implDescribeSupportedFeature: invalid feature id!" ); @@ -1239,7 +1170,7 @@ Reference< XFrame > SAL_CALL OGenericUnoController::getFrame(void) throw( Runtim // ----------------------------------------------------------------------------- sal_Bool SAL_CALL OGenericUnoController::attachModel(const Reference< XModel > & /*xModel*/) throw( RuntimeException ) { - OSL_ENSURE( false, "OGenericUnoController::attachModel: not supported!" ); + OSL_FAIL( "OGenericUnoController::attachModel: not supported!" ); return sal_False; } @@ -1327,11 +1258,11 @@ namespace "com.sun.star.formula.FormularProperties", "smath", "com.sun.star.chart.ChartDocument", "schart" }; - OSL_ENSURE( ( sizeof( pTransTable ) / sizeof( pTransTable[0] ) ) % 2 == 0, + OSL_ENSURE( ( SAL_N_ELEMENTS( pTransTable ) ) % 2 == 0, "lcl_getModuleHelpModuleName: odd size of translation table!" ); // loop through the table - sal_Int32 nTableEntries = ( sizeof( pTransTable ) / sizeof( pTransTable[0] ) ) / 2; + sal_Int32 nTableEntries = ( SAL_N_ELEMENTS( pTransTable ) ) / 2; const sal_Char** pDocumentService = pTransTable; const sal_Char** pHelpModuleName = pTransTable + 1; for ( sal_Int32 j=0; j<nTableEntries; ++j ) @@ -1370,7 +1301,7 @@ namespace pReturn = "sbasic"; else { - OSL_ENSURE( sal_False, "lcl_getModuleHelpModuleName: no installed module found" ); + OSL_FAIL( "lcl_getModuleHelpModuleName: no installed module found" ); } } } @@ -1391,7 +1322,7 @@ namespace void OGenericUnoController::openHelpAgent(rtl::OUString const& _suHelpStringURL ) { rtl::OUString suURL(_suHelpStringURL); - rtl::OUString sLanguage = rtl::OUString::createFromAscii("Language="); + rtl::OUString sLanguage(RTL_CONSTASCII_USTRINGPARAM("Language=")); if (suURL.indexOf(sLanguage) == -1) { AppendConfigToken(suURL, sal_False /* sal_False := add '&' */ ); @@ -1454,7 +1385,7 @@ Reference< awt::XWindow> OGenericUnoController::getTopMostContainerWindow() cons // ----------------------------------------------------------------------------- Reference< XTitle > OGenericUnoController::impl_getTitleHelper_throw() { - ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( getMutex() ); if ( ! m_xTitleHelper.is ()) @@ -1488,7 +1419,7 @@ Reference< XTitle > OGenericUnoController::impl_getTitleHelper_throw() void SAL_CALL OGenericUnoController::setTitle(const ::rtl::OUString& sTitle) throw (RuntimeException) { - vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( getMutex() ); m_bExternalTitle = sal_True; impl_getTitleHelper_throw()->setTitle (sTitle); @@ -1571,7 +1502,7 @@ sal_uInt16 OGenericUnoController::registerCommandURL( const ::rtl::OUString& _rC ++nFeatureId; if ( nFeatureId == LAST_USER_DEFINED_FEATURE ) { - OSL_ENSURE( false, "OGenericUnoController::registerCommandURL: no more space for user defined features!" ); + OSL_FAIL( "OGenericUnoController::registerCommandURL: no more space for user defined features!" ); return 0L; } @@ -1642,12 +1573,22 @@ Sequence< ::sal_Int16 > SAL_CALL OGenericUnoController::getSupportedCommandGroup ::std::transform( aCmdHashMap.begin(), aCmdHashMap.end(), aCommandGroups.getArray(), - ::std::select1st< CommandHashMap::value_type >() + ::o3tl::select1st< CommandHashMap::value_type >() ); return aCommandGroups; } +namespace +{ + //Current c++0x draft (apparently) has std::identity, but not operator() + template<typename T> struct SGI_identity : public std::unary_function<T,T> + { + T& operator()(T& x) const { return x; } + const T& operator()(const T& x) const { return x; } + }; +} + // ----------------------------------------------------------------------------- Sequence< DispatchInformation > SAL_CALL OGenericUnoController::getConfigurableDispatchInformation( ::sal_Int16 CommandGroup ) throw (RuntimeException) { @@ -1669,7 +1610,7 @@ Sequence< DispatchInformation > SAL_CALL OGenericUnoController::getConfigurableD ::std::transform( aInformationList.begin(), aInformationList.end(), aInformation.getArray(), - ::std::identity< DispatchInformation >() + SGI_identity< DispatchInformation >() ); return aInformation; @@ -1690,8 +1631,9 @@ void OGenericUnoController::fillSupportedFeatures() void SAL_CALL OGenericUnoController::dispose() throw(::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aSolarGuard(Application::GetSolarMutex()); + SolarMutexGuard aSolarGuard; OGenericUnoController_Base::dispose(); } } // namespace dbaui +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/browser/makefile.mk b/dbaccess/source/ui/browser/makefile.mk deleted file mode 100644 index a7dbd7413d78..000000000000 --- a/dbaccess/source/ui/browser/makefile.mk +++ /dev/null @@ -1,71 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# 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. -# -#************************************************************************* - -PRJ=..$/..$/.. -PRJINC=$(PRJ)$/source -PRJNAME=dbaccess -TARGET=browser - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile.pmk -# --- Files -------------------------------------------------------- - -EXCEPTIONSFILES=\ - $(SLO)$/genericcontroller.obj \ - $(SLO)$/dsbrowserDnD.obj \ - $(SLO)$/dataview.obj \ - $(SLO)$/dbexchange.obj \ - $(SLO)$/dbloader.obj \ - $(SLO)$/sbagrid.obj \ - $(SLO)$/formadapter.obj \ - $(SLO)$/brwview.obj \ - $(SLO)$/brwctrlr.obj \ - $(SLO)$/unodatbr.obj \ - $(SLO)$/sbamultiplex.obj \ - $(SLO)$/exsrcbrw.obj \ - $(SLO)$/dbtreemodel.obj \ - $(SLO)$/dsEntriesNoExp.obj \ - $(SLO)$/dbtreeview.obj - -SLOFILES =\ - $(EXCEPTIONSFILES)\ - $(SLO)$/AsyncronousLink.obj - -SRS1NAME=$(TARGET) -SRC1FILES = sbabrw.src \ - sbagrid.src - -# --- Targets ------------------------------------------------------- - - -.INCLUDE : target.mk - -$(SRS)$/$(TARGET).srs: $(SOLARINCDIR)$/svx$/globlmn.hrc - - diff --git a/dbaccess/source/ui/browser/sbabrw.src b/dbaccess/source/ui/browser/sbabrw.src index 476fcf683b3f..eebcc013788d 100644 --- a/dbaccess/source/ui/browser/sbabrw.src +++ b/dbaccess/source/ui/browser/sbabrw.src @@ -33,7 +33,6 @@ #ifndef DBACCESS_UI_BROWSER_ID_HXX #include "browserids.hxx" #endif -// #include <sfx2/sfx.hrc> #ifndef _GLOBLMN_HRC #include <svx/globlmn.hrc> #endif @@ -43,14 +42,12 @@ QueryBox QUERY_BRW_SAVEMODIFIED { Buttons = WB_YES_NO_CANCEL ; DefButton = WB_DEF_YES ; - /* ### ACHTUNG: Neuer Text in Resource? Soll der genderte Datensatz gespeichert werden? : Soll der genderte Datensatz gespeichert werden? */ Message [ en-US ] = "The current record has been changed.\nDo you want to save the changes?" ; }; QueryBox QUERY_BRW_DELETE_ROWS { Buttons = WB_YES_NO ; - /* ### ACHTUNG: Neuer Text in Resource? Sollen die selektierten Daten gelscht werden? : Sollen die selektierten Daten gelscht werden? */ Message [ en-US ] = "Do you want to delete the selected data?" ; }; @@ -63,6 +60,7 @@ String SBA_BROWSER_SETTING_ORDER { Text [ en-US ] = "Error setting the sort criteria"; }; + String SBA_BROWSER_SETTING_FILTER { Text [ en-US ] = "Error setting the filter criteria"; @@ -140,13 +138,13 @@ QueryBox QUERY_BRW_DELETE_QUERY_CONFIRM { Buttons = WB_YES_NO ; Message [ en-US ] = "The query already exists. Do you want to delete it?" ; - }; +}; QueryBox QUERY_CONNECTION_LOST { Buttons = WB_YES_NO ; Message [ en-US ] = "The connection to the database has been lost. Do you want to reconnect?" ; - }; +}; String STR_OPENTABLES_WARNINGS { @@ -161,22 +159,22 @@ String STR_OPENTABLES_WARNINGS_DETAILS String STR_CONNECTING_DATASOURCE { Text [ en-US ] = "Connecting to \"$name$\" ..."; - }; +}; String STR_LOADING_QUERY { Text [ en-US ] = "Loading query $name$ ..."; - }; +}; String STR_LOADING_TABLE { Text [ en-US ] = "Loading table $name$ ..."; - }; +}; String STR_NO_TABLE_FORMAT_INSIDE { Text [ en-US ] = "No table format could be found." ; - }; +}; String STR_COULDNOTCONNECT_DATASOURCE { @@ -200,4 +198,3 @@ Menu RID_MENU_REFRESH_DATA }; }; }; - diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 29362d14e261..cfd2bc0ec109 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,206 +29,88 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbui.hxx" -#ifndef DBACCESS_SBA_GRID_HRC #include "sbagrid.hrc" -#endif -#ifndef _SVX_SVXIDS_HRC #include <svx/svxids.hrc> -#endif #define ITEMID_HORJUSTIFY SID_ATTR_ALIGN_HOR_JUSTIFY #define ITEMID_VERJUSTIFY SID_ATTR_ALIGN_VER_JUSTIFY -//#define ITEMID_ORIENTATION SID_ATTR_ALIGN_ORIENTATION #define ITEMID_LINEBREAK SID_ATTR_ALIGN_LINEBREAK #define ITEMID_MARGIN SID_ATTR_ALIGN_MARGIN #define ITEMID_NUMBERINFO SID_ATTR_NUMBERFORMAT_INFO #define _ZFORLIST_DECLARE_TABLE -#ifndef _SVX_NUMINF_HXX #include <svx/numinf.hxx> -#endif -#ifndef _SVX_DBAEXCHANGE_HXX_ #include <svx/dbaexchange.hxx> -#endif -#ifndef _COM_SUN_STAR_UI_DIALOGS_XEXECUTABLEDIALOG_HPP_ #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> -#endif -#ifndef _SBA_GRID_HXX #include "sbagrid.hxx" -#endif -#ifndef DBAUI_SBATTRDLG_HXX #include "dlgattr.hxx" -#endif -#ifndef _DBAUI_DLGSIZE_HXX #include "dlgsize.hxx" -#endif -#ifndef _COM_SUN_STAR_FORM_XLOADABLE_HPP_ #include <com/sun/star/form/XLoadable.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_COMMANDTYPE_HPP_ #include <com/sun/star/sdb/CommandType.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_XSQLQUERYCOMPOSERFACTORY_HPP_ #include <com/sun/star/sdb/XSQLQueryComposerFactory.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_XRESULTSETACCESS_HPP_ #include <com/sun/star/sdb/XResultSetAccess.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_XFORM_HPP_ #include <com/sun/star/form/XForm.hpp> -#endif -#ifndef _COM_SUN_STAR_CONTAINER_XINDEXCONTAINER_HPP_ #include <com/sun/star/container/XIndexContainer.hpp> -#endif -#ifndef _COM_SUN_STAR_UTIL_NUMBERFORMAT_HPP_ #include <com/sun/star/util/NumberFormat.hpp> -#endif -#ifndef _COM_SUN_STAR_VIEW_XSELECTIONSUPPLIER_HPP_ #include <com/sun/star/view/XSelectionSupplier.hpp> -#endif -#ifndef _COM_SUN_STAR_FORM_DATASELECTIONTYPE_HPP_ #include <com/sun/star/form/DataSelectionType.hpp> -#endif -#ifndef _COM_SUN_STAR_AWT_TEXTALIGN_HPP_ #include <com/sun/star/awt/TextAlign.hpp> -#endif -#ifndef _COM_SUN_STAR_AWT_XTEXTCOMPONENT_HPP_ #include <com/sun/star/awt/XTextComponent.hpp> -#endif -#ifndef _COM_SUN_STAR_UTIL_DATE_HPP_ #include <com/sun/star/util/Date.hpp> -#endif -#ifndef _COM_SUN_STAR_UTIL_TIME_HPP_ #include <com/sun/star/util/Time.hpp> -#endif -#ifndef _COM_SUN_STAR_UTIL_DATETIME_HPP_ #include <com/sun/star/util/DateTime.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBC_XRESULTSETUPDATE_HPP_ #include <com/sun/star/sdbc/XResultSetUpdate.hpp> -#endif -#ifndef _URLOBJ_HXX #include <tools/urlobj.hxx> -#endif -#ifndef TOOLS_DIAGNOSE_EX_H #include <tools/diagnose_ex.h> -#endif -#ifndef _SFXINTITEM_HXX #include <svl/intitem.hxx> -#endif -#ifndef _SVX_ALGITEM_HXX //autogen #include <svx/algitem.hxx> -#endif -#ifndef _SV_MULTISEL_HXX //autogen #include <tools/multisel.hxx> -#endif -#ifndef _SVX_SVXIDS_HRC #include <svx/svxids.hrc> -#endif -#ifndef _NUMUNO_HXX #include <svl/numuno.hxx> -#endif -#ifndef _SFXITEMPOOL_HXX //autogen wg. SfxItemInfo #include <svl/itempool.hxx> -#endif -#ifndef _SFXITEMSET_HXX //autogen wg. SfxItemSet #include <svl/itemset.hxx> -#endif -#ifndef _SFXRNGITEM_HXX #include <svl/rngitem.hxx> -#endif -#ifndef _SV_WAITOBJ_HXX #include <vcl/waitobj.hxx> -#endif -#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include <toolkit/helper/vclunohelper.hxx> -#endif -#ifndef _ZFORLIST_HXX #include <svl/zforlist.hxx> -#endif -#ifndef _CPPUHELPER_QUERYINTERFACE_HXX_ #include <cppuhelper/queryinterface.hxx> -#endif -#ifndef _CONNECTIVITY_DBTOOLS_HXX_ #include <connectivity/dbtools.hxx> -#endif -#ifndef _DBHELPER_DBCONVERSION_HXX_ #include <connectivity/dbconversion.hxx> -#endif -#ifndef _CPPUHELPER_TYPEPROVIDER_HXX_ #include <cppuhelper/typeprovider.hxx> -#endif -#ifndef _RTL_UUID_H_ -#include <rtl/uuid.h> -#endif -#ifndef _RTL_MEMORY_H_ #include <rtl/memory.h> -#endif -#ifndef _COMPHELPER_EXTRACT_HXX_ #include <comphelper/extract.hxx> -#endif -#ifndef _COM_SUN_STAR_SDBCX_XTABLESSUPPLIER_HPP_ +#include <comphelper/servicehelper.hxx> #include <com/sun/star/sdbcx/XTablesSupplier.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBC_DATATYPE_HPP_ #include <com/sun/star/sdbc/DataType.hpp> -#endif -#ifndef _SV_MSGBOX_HXX #include <vcl/msgbox.hxx> -#endif -#ifndef _SVX_DBEXCH_HRC #include <svx/dbexch.hrc> -#endif -#ifndef _DBU_BRW_HRC_ #include "dbu_brw.hrc" -#endif -#ifndef DBACCESS_UI_BROWSER_ID_HXX #include "browserids.hxx" -#endif -#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC #include "dbustrings.hrc" -#endif -#ifndef _DBU_REGHELPER_HXX_ #include "dbu_reghelper.hxx" -#endif -#ifndef DBAUI_DBEXCHANGE_HXX #include "dbexchange.hxx" -#endif -#ifndef DBAUI_TABLEROW_EXCHANGE_HXX #include "TableRowExchange.hxx" -#endif -#ifndef DBAUI_TABLEROW_HXX #include "TableRow.hxx" -#endif -#ifndef DBAUI_FIELDDESCRIPTIONS_HXX #include "FieldDescriptions.hxx" -#endif -#ifndef _SVTOOLS_STRINGTRANSFER_HXX_ #include <svtools/stringtransfer.hxx> -#endif -#ifndef _VCL_STDTEXT_HXX #include <vcl/stdtext.hxx> -#endif -#ifndef DBAUI_TOOLS_HXX #include "UITools.hxx" -#endif -#ifndef DBAUI_TOKENWRITER_HXX #include "TokenWriter.hxx" -#endif +#include <osl/diagnose.h> using namespace ::com::sun::star::ui::dialogs; using namespace ::com::sun::star::uno; @@ -278,16 +161,16 @@ Reference< XInterface > SAL_CALL SbaXGridControl::Create(const Reference<XMultiS //------------------------------------------------------------------------------ ::rtl::OUString SbaXGridControl::getImplementationName_Static() throw( RuntimeException ) { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.dbu.SbaXGridControl"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.dbu.SbaXGridControl")); } //------------------------------------------------------------------------------ Sequence< ::rtl::OUString> SbaXGridControl::getSupportedServiceNames_Static(void) throw( RuntimeException ) { Sequence< ::rtl::OUString> aSupported(3); - aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.form.control.InteractionGridControl"); - aSupported[1] = ::rtl::OUString::createFromAscii("com.sun.star.form.control.GridControl"); - aSupported[2] = ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControl"); + aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.control.InteractionGridControl")); + aSupported[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.control.GridControl")); + aSupported[2] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControl")); return aSupported; } DBG_NAME(SbaXGridControl ); @@ -369,14 +252,11 @@ void SAL_CALL SbaXGridControl::createPeer(const Reference< ::com::sun::star::awt { FmXGridControl::createPeer(rToolkit, rParentPeer); - DBG_ASSERT(/*(0 == m_nPeerCreationLevel) && */!mbCreatingPeer, "FmXGridControl::createPeer : recursion!"); + OSL_ENSURE(!mbCreatingPeer, "FmXGridControl::createPeer : recursion!"); // see the base class' createPeer for a comment on this - // 14.05.2001 - 86836 - frank.schoenheit@germany.sun.com // TODO: why the hell this whole class does not use any mutex? -// if (0 == m_nPeerCreationLevel) - { Reference< ::com::sun::star::frame::XDispatch > xDisp(getPeer(), UNO_QUERY); for ( StatusMultiplexerArray::iterator aIter = m_aStatusMultiplexer.begin(); aIter != m_aStatusMultiplexer.end(); @@ -385,7 +265,6 @@ void SAL_CALL SbaXGridControl::createPeer(const Reference< ::com::sun::star::awt if ((*aIter).second && (*aIter).second->getLength()) xDisp->addStatusListener((*aIter).second, (*aIter).first); } - } } //--------------------------------------------------------------------------------------- @@ -447,7 +326,7 @@ void SAL_CALL SbaXGridControl::removeStatusListener(const Reference< ::com::sun: //--------------------------------------------------------------------------------------- void SAL_CALL SbaXGridControl::dispose(void) throw( RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; EventObject aEvt; aEvt.Source = *this; @@ -541,10 +420,10 @@ Any SAL_CALL SbaXGridPeer::queryInterface(const Type& _rType) throw (RuntimeExce //--------------------------------------------------------------------------------------- Reference< ::com::sun::star::frame::XDispatch > SAL_CALL SbaXGridPeer::queryDispatch(const ::com::sun::star::util::URL& aURL, const ::rtl::OUString& aTargetFrameName, sal_Int32 nSearchFlags) throw( RuntimeException ) { - if ( (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:GridSlots/BrowserAttribs"))) - || (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:GridSlots/RowHeight"))) - || (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:GridSlots/ColumnAttribs"))) - || (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:GridSlots/ColumnWidth"))) + if ( (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:GridSlots/BrowserAttribs")))) + || (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:GridSlots/RowHeight")))) + || (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:GridSlots/ColumnAttribs")))) + || (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:GridSlots/ColumnWidth")))) ) { return (::com::sun::star::frame::XDispatch*)this; @@ -559,7 +438,7 @@ IMPL_LINK( SbaXGridPeer, OnDispatchEvent, void*, /*NOTINTERESTEDIN*/ ) SbaGridControl* pGrid = static_cast< SbaGridControl* >( GetWindow() ); if ( pGrid ) // if this fails, we were disposing before arriving here { - if ( Application::GetMainThreadIdentifier() != ::vos::OThread::getCurrentIdentifier() ) + if ( Application::GetMainThreadIdentifier() != ::osl::Thread::getCurrentIdentifier() ) { // still not in the main thread (see SbaXGridPeer::dispatch). post an event, again // without moving the special even to the back of the queue @@ -581,13 +460,13 @@ IMPL_LINK( SbaXGridPeer, OnDispatchEvent, void*, /*NOTINTERESTEDIN*/ ) SbaXGridPeer::DispatchType SbaXGridPeer::classifyDispatchURL( const URL& _rURL ) { DispatchType eURLType = dtUnknown; - if ( _rURL.Complete.equalsAscii( ".uno:GridSlots/BrowserAttribs" ) ) + if ( _rURL.Complete.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:GridSlots/BrowserAttribs" ) ) ) eURLType = dtBrowserAttribs; - else if ( _rURL.Complete.equalsAscii( ".uno:GridSlots/RowHeight" ) ) + else if ( _rURL.Complete.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:GridSlots/RowHeight" ) ) ) eURLType = dtRowHeight; - else if ( _rURL.Complete.equalsAscii( ".uno:GridSlots/ColumnAttribs" ) ) + else if ( _rURL.Complete.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:GridSlots/ColumnAttribs" ) ) ) eURLType = dtColumnAttribs; - else if ( _rURL.Complete.equalsAscii( ".uno:GridSlots/ColumnWidth" ) ) + else if ( _rURL.Complete.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:GridSlots/ColumnWidth" ) ) ) eURLType = dtColumnWidth; return eURLType; } @@ -599,7 +478,7 @@ void SAL_CALL SbaXGridPeer::dispatch(const URL& aURL, const Sequence< PropertyVa if (!pGrid) return; - if ( Application::GetMainThreadIdentifier() != ::vos::OThread::getCurrentIdentifier() ) + if ( Application::GetMainThreadIdentifier() != ::osl::Thread::getCurrentIdentifier() ) { // we're not in the main thread. This is bad, as we want to raise windows here, // and VCL does not like windows to be opened in non-main threads (at least on Win32). @@ -622,22 +501,22 @@ void SAL_CALL SbaXGridPeer::dispatch(const URL& aURL, const Sequence< PropertyVa return; } - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sal_Int16 nColId = -1; const PropertyValue* pArgs = aArgs.getConstArray(); for (sal_uInt16 i=0; i<aArgs.getLength(); ++i, ++pArgs) { - if (pArgs->Name == ::rtl::OUString::createFromAscii("ColumnViewPos")) + if (pArgs->Name == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ColumnViewPos"))) { nColId = pGrid->GetColumnIdFromViewPos(::comphelper::getINT16(pArgs->Value)); break; } - if (pArgs->Name == ::rtl::OUString::createFromAscii("ColumnModelPos")) + if (pArgs->Name == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ColumnModelPos"))) { nColId = pGrid->GetColumnIdFromModelPos(::comphelper::getINT16(pArgs->Value)); break; } - if (pArgs->Name == ::rtl::OUString::createFromAscii("ColumnId")) + if (pArgs->Name == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ColumnId"))) { nColId = ::comphelper::getINT16(pArgs->Value); break; @@ -665,7 +544,7 @@ void SAL_CALL SbaXGridPeer::dispatch(const URL& aURL, const Sequence< PropertyVa case dtColumnAttribs: { - DBG_ASSERT(nColId != -1, "SbaXGridPeer::dispatch : invalid parameter !"); + OSL_ENSURE(nColId != -1, "SbaXGridPeer::dispatch : invalid parameter !"); if (nColId != -1) break; pGrid->SetColAttrs(nColId); @@ -674,7 +553,7 @@ void SAL_CALL SbaXGridPeer::dispatch(const URL& aURL, const Sequence< PropertyVa case dtColumnWidth: { - DBG_ASSERT(nColId != -1, "SbaXGridPeer::dispatch : invalid parameter !"); + OSL_ENSURE(nColId != -1, "SbaXGridPeer::dispatch : invalid parameter !"); if (nColId != -1) break; pGrid->SetColWidth(nColId); @@ -710,24 +589,16 @@ void SAL_CALL SbaXGridPeer::removeStatusListener(const Reference< ::com::sun::st pCont->removeInterface(xControl); } -//--------------------------------------------------------------------------------------- +namespace +{ + class theSbaXGridPeerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSbaXGridPeerUnoTunnelId > {}; +} + const Sequence< sal_Int8 > & SbaXGridPeer::getUnoTunnelId() { - static Sequence< sal_Int8 > * pSeq = 0; - if( !pSeq ) - { - ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ); - if( !pSeq ) - { - static Sequence< sal_Int8 > aSeq( 16 ); - rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0,sal_True ); - pSeq = &aSeq; - } - } - return *pSeq; + return theSbaXGridPeerUnoTunnelId::get().getSeq(); } -//--------------------------------------------------------------------------------------- Sequence< Type > SAL_CALL SbaXGridPeer::getTypes() throw (RuntimeException) { Sequence< Type > aTypes = FmXGridPeer::getTypes(); @@ -778,7 +649,7 @@ SbaGridHeader::SbaGridHeader(BrowseBox* pParent, WinBits nWinBits) //--------------------------------------------------------------------------------------- void SbaGridHeader::StartDrag( sal_Int8 _nAction, const Point& _rPosPixel ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; // in the new DnD API, the solar mutex is not locked when StartDrag get's called ImplStartColumnDrag( _nAction, _rPosPixel ); @@ -793,10 +664,6 @@ void SbaGridHeader::MouseButtonDown( const MouseEvent& _rMEvt ) // the base class will start a column move here, which we don't want to allow // (at the moment. If we store relative positions with the columns, we can allow column moves ....) -// sal_uInt16 nPos(0); -// sal_uInt16 nHitTest = ImplHitTest( _rMEvt.GetPosPixel(), mnMouseOff, nPos ); -// if (!nHitTest & HEAD_HITTEST_DIVIDER) -// return; } FmGridHeader::MouseButtonDown(_rMEvt); @@ -981,7 +848,7 @@ void SbaGridControl::PreExecuteRowContextMenu(sal_uInt16 nRow, PopupMenu& rMenu) rMenu.InsertItem(ID_BROWSER_ROWHEIGHT, aNewItems.GetItemText(ID_BROWSER_ROWHEIGHT), 0, nPos++); rMenu.SetHelpId(ID_BROWSER_ROWHEIGHT, aNewItems.GetHelpId(ID_BROWSER_ROWHEIGHT)); rMenu.InsertSeparator(nPos++); - } // if (!IsReadOnlyDB()) + } if ( GetSelectRowCount() > 0 ) { @@ -1076,7 +943,7 @@ void SbaGridControl::SetRowHeight() } catch(Exception&) { - OSL_ENSURE(0,"setPropertyValue: PROPERTY_ROW_HEIGHT throws a exception"); + OSL_FAIL("setPropertyValue: PROPERTY_ROW_HEIGHT throws a exception"); } } } @@ -1112,13 +979,13 @@ void SbaGridControl::SetBrowserAttrs() try { PropertyValue aArg; - aArg.Name = ::rtl::OUString::createFromAscii("IntrospectedObject"); + aArg.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IntrospectedObject")); aArg.Value <<= xGridModel; Sequence< Any > aDialogArgs(1); aDialogArgs[0] <<= aArg; Reference< XInterface > xDialog = getServiceManager()->createInstanceWithArguments( - ::rtl::OUString::createFromAscii("com.sun.star.form.ControlFontDialog"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.ControlFontDialog")), aDialogArgs ); if (!xDialog.is()) @@ -1234,11 +1101,11 @@ Reference< XPropertySet > SbaGridControl::getField(sal_uInt16 nModelPos) xEmptyReturn.set(xCol->getPropertyValue(PROPERTY_BOUNDFIELD),UNO_QUERY); } else - OSL_ENSURE(0,"SbaGridControl::getField getColumns returns NULL or ModelPos is > than count!"); + OSL_FAIL("SbaGridControl::getField getColumns returns NULL or ModelPos is > than count!"); } catch(Exception&) { - OSL_ENSURE(0,"SbaGridControl::getField Exception occured!"); + OSL_FAIL("SbaGridControl::getField Exception occurred!"); } return xEmptyReturn; @@ -1290,7 +1157,7 @@ void SbaGridControl::MouseButtonDown( const BrowserMouseEvent& rMEvt) //--------------------------------------------------------------------------------------- void SbaGridControl::StartDrag( sal_Int8 _nAction, const Point& _rPosPixel ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; // in the new DnD API, the solar mutex is not locked when StartDrag get's called sal_Bool bHandled = sal_False; @@ -1324,14 +1191,14 @@ void SbaGridControl::StartDrag( sal_Int8 _nAction, const Point& _rPosPixel ) // check which kind of dragging has to be initiated if ( bHitHandle // the handle column // AND - && ( GetSelectRowCount() // at least one row is selected - // OR - || ( (nRow >= 0) // a row below the header - && !bCurrentRowVirtual // we aren't appending a new record - && (nRow != GetCurrentPos()) // a row which is not the current one - ) // OR - || ( (0 == GetSelectRowCount()) // no rows selected - && (-1 == nRow) // hit the header + && ( GetSelectRowCount() // at least one row is selected + // OR + || ( (nRow >= 0) // a row below the header + && !bCurrentRowVirtual // we aren't appending a new record + && (nRow != GetCurrentPos()) // a row which is not the current one + ) // OR + || ( (0 == GetSelectRowCount()) // no rows selected + && (-1 == nRow) // hit the header ) ) ) @@ -1391,7 +1258,7 @@ void SbaGridControl::Command(const CommandEvent& rEvt) void SbaGridControl::DoColumnDrag(sal_uInt16 nColumnPos) { Reference< XPropertySet > xDataSource(getDataSource(), UNO_QUERY); - DBG_ASSERT(xDataSource.is(), "SbaGridControl::DoColumnDrag : invalid data source !"); + OSL_ENSURE(xDataSource.is(), "SbaGridControl::DoColumnDrag : invalid data source !"); Reference< XPropertySet > xAffectedCol; Reference< XPropertySet > xAffectedField; @@ -1414,7 +1281,7 @@ void SbaGridControl::DoColumnDrag(sal_uInt16 nColumnPos) } catch(Exception&) { - DBG_ERROR("SbaGridControl::DoColumnDrag : something went wrong while getting the column"); + OSL_FAIL("SbaGridControl::DoColumnDrag : something went wrong while getting the column"); } if (0 == sField.getLength()) return; @@ -1427,7 +1294,7 @@ void SbaGridControl::DoColumnDrag(sal_uInt16 nColumnPos) // ----------------------------------------------------------------------- void SbaGridControl::CopySelectedRowsToClipboard() { - DBG_ASSERT( GetSelectRowCount() > 0, "SbaGridControl::CopySelectedRowsToClipboard: invalid call!" ); + OSL_ENSURE( GetSelectRowCount() > 0, "SbaGridControl::CopySelectedRowsToClipboard: invalid call!" ); implTransferSelectedRows( (sal_Int16)FirstSelectedRow(), true ); } @@ -1441,7 +1308,7 @@ void SbaGridControl::DoRowDrag( sal_Int16 nRowPos ) void SbaGridControl::implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfClipboardFalseIfDrag ) { Reference< XPropertySet > xForm( getDataSource(), UNO_QUERY ); - DBG_ASSERT( xForm.is(), "SbaGridControl::implTransferSelectedRows: invalid form!" ); + OSL_ENSURE( xForm.is(), "SbaGridControl::implTransferSelectedRows: invalid form!" ); // build the sequence of numbers of selected rows Sequence< Any > aSelectedRows; @@ -1497,7 +1364,7 @@ void SbaGridControl::DoFieldDrag(sal_uInt16 nColumnPos, sal_Int16 nRowPos) } catch(Exception&) { - DBG_ERROR("SbaGridControl::DoFieldDrag : could not retrieve the cell's contents !"); + OSL_FAIL("SbaGridControl::DoFieldDrag : could not retrieve the cell's contents !"); return; } @@ -1515,8 +1382,6 @@ void SbaGridControl::DoFieldDrag(sal_uInt16 nColumnPos, sal_Int16 nRowPos) { switch (_aType.mnSotId) { -// case SOT_FORMAT_RTF: // RTF data descriptions -// case SOT_FORMATSTR_ID_HTML: // HTML data descriptions case SOT_FORMATSTR_ID_DBACCESS_TABLE: // table descriptor case SOT_FORMATSTR_ID_DBACCESS_QUERY: // query descriptor case SOT_FORMATSTR_ID_DBACCESS_COMMAND: // SQL command @@ -1658,7 +1523,7 @@ sal_Int8 SbaGridControl::ExecuteDrop( const BrowserExecuteDropEvent& rEvt ) if (IsCurrentAppending()) --nCorrectRowCount; // the current data record doesn't really exist, we are appending a new one - DBG_ASSERT((nCol != BROWSER_INVALIDID) && (nRow < nCorrectRowCount), "SbaGridControl::Drop : dropped on an invalid position !"); + OSL_ENSURE((nCol != BROWSER_INVALIDID) && (nRow < nCorrectRowCount), "SbaGridControl::Drop : dropped on an invalid position !"); // AcceptDrop should have caught this // from now we work with ids instead of positions @@ -1770,7 +1635,7 @@ IMPL_LINK(SbaGridControl, AsynchDropEvent, void*, /*EMPTY_ARG*/) ::rtl::OUString sRet; if ( ::svt::BBTYPE_BROWSEBOX == eObjType ) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; sRet = String(ModuleRes(STR_DATASOURCE_GRIDCONTROL_DESC)); } else @@ -1784,3 +1649,4 @@ void SbaGridControl::DeleteSelectedRows() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/browser/sbagrid.src b/dbaccess/source/ui/browser/sbagrid.src index 1362944d5847..b3fd77757364 100644 --- a/dbaccess/source/ui/browser/sbagrid.src +++ b/dbaccess/source/ui/browser/sbagrid.src @@ -102,10 +102,12 @@ String STR_QRY_TITLE { Text [ en-US ] = "Query #" ; }; + String STR_TBL_TITLE { Text [ en-US ] = "Table #" ; }; + String STR_VIEW_TITLE { Text [ en-US ] = "View #" ; @@ -122,7 +124,7 @@ String STR_NO_COLUMNNAME_MATCHING Text [ en-US ] = "No matching column names were found."; }; -String STR_ERROR_OCCURED_WHILE_COPYING +String STR_ERROR_OCCURRED_WHILE_COPYING { Text [ en-US ] = "An error occurred. Do you want to continue copying?"; }; @@ -136,4 +138,3 @@ String STR_DATASOURCE_GRIDCONTROL_DESC { Text [ en-US ] = "Shows the selected table or query."; }; - diff --git a/dbaccess/source/ui/browser/sbamultiplex.cxx b/dbaccess/source/ui/browser/sbamultiplex.cxx index a3986ad7117e..a37722ff489b 100644 --- a/dbaccess/source/ui/browser/sbamultiplex.cxx +++ b/dbaccess/source/ui/browser/sbamultiplex.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbui.hxx" -#ifndef _SBA_MULTIPLEX_HXX #include "sbamultiplex.hxx" -#endif using namespace dbaui; //================================================================== @@ -109,3 +108,4 @@ void SbaXPropertiesChangeMultiplexer::propertiesChange(const ::com::sun::star::u ((::com::sun::star::beans::XPropertiesChangeListener*)aIt.next())->propertiesChange(aMulti); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 2a3fdd428ade..0da24c5a3f9a 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -122,9 +123,9 @@ #include <svx/algitem.hxx> #include <svx/dataaccessdescriptor.hxx> #include <svx/databaseregistrationui.hxx> -#include <svx/gridctrl.hxx> #include <toolkit/unohlp.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <tools/multisel.hxx> #include <tools/urlobj.hxx> #include <unotools/confignode.hxx> @@ -207,19 +208,19 @@ void SafeRemovePropertyListener(const Reference< XPropertySet > & xSet, const :: // ------------------------------------------------------------------------- ::rtl::OUString SbaTableQueryBrowser::getImplementationName_Static() throw(RuntimeException) { - return ::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.ODatasourceBrowser"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.ODatasourceBrowser")); } //------------------------------------------------------------------------- ::comphelper::StringSequence SbaTableQueryBrowser::getSupportedServiceNames_Static() throw(RuntimeException) { ::comphelper::StringSequence aSupported(1); - aSupported.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdb.DataSourceBrowser"); + aSupported.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.DataSourceBrowser")); return aSupported; } //------------------------------------------------------------------------- Reference< XInterface > SAL_CALL SbaTableQueryBrowser::Create(const Reference<XMultiServiceFactory >& _rxFactory) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; return *(new SbaTableQueryBrowser(_rxFactory)); } @@ -250,7 +251,7 @@ SbaTableQueryBrowser::~SbaTableQueryBrowser() DBG_DTOR(SbaTableQueryBrowser,NULL); if ( !rBHelper.bDisposed && !rBHelper.bInDispose ) { - OSL_ENSURE(0,"Please check who doesn't dispose this component!"); + OSL_FAIL("Please check who doesn't dispose this component!"); // increment ref count to prevent double call of Dtor osl_incrementInterlockedCount( &m_refCount ); dispose(); @@ -316,7 +317,7 @@ Sequence< sal_Int8 > SAL_CALL SbaTableQueryBrowser::getImplementationId( ) thro //------------------------------------------------------------------------------ void SAL_CALL SbaTableQueryBrowser::disposing() { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; // doin' a lot of VCL stuff here -> lock the SolarMutex // kiss our listeners goodbye @@ -370,12 +371,12 @@ sal_Bool SbaTableQueryBrowser::Construct(Window* pParent) 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_THROW ); + m_xCollator = Reference< XCollator >( getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.Collator")) ), UNO_QUERY_THROW ); m_xCollator->loadDefaultCollator( Application::GetSettings().GetLocale(), 0 ); } - catch(Exception&) + catch(const Exception&) { - DBG_ERROR("SbaTableQueryBrowser::Construct: could not create (or start listening at) the database context!"); + OSL_FAIL("SbaTableQueryBrowser::Construct: could not create (or start listening at) the database context!"); } // some help ids if (getBrowserView() && getBrowserView()->getVclControl()) @@ -744,7 +745,7 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun:: case DataType::BIT: case DataType::BOOLEAN: { - aCurrentModelType = ::rtl::OUString::createFromAscii("CheckBox"); + aCurrentModelType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CheckBox")); aInitialValues.push_back( NamedValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VisualEffect" ) ), makeAny( VisualEffect::FLAT ) ) ); sDefaultProperty = PROPERTY_DEFAULTSTATE; @@ -766,7 +767,7 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun:: case DataType::BINARY: case DataType::VARBINARY: case DataType::LONGVARBINARY: - aCurrentModelType = ::rtl::OUString::createFromAscii("TextField"); + aCurrentModelType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextField")); sDefaultProperty = PROPERTY_DEFAULTTEXT; break; @@ -775,12 +776,12 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun:: bFormattedIsNumeric = sal_False; // NO break! default: - aCurrentModelType = ::rtl::OUString::createFromAscii("FormattedField"); + aCurrentModelType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FormattedField")); sDefaultProperty = PROPERTY_EFFECTIVEDEFAULT; if ( xSupplier.is() ) - aInitialValues.push_back( NamedValue( ::rtl::OUString::createFromAscii( "FormatsSupplier" ), makeAny( xSupplier ) ) ); - aInitialValues.push_back( NamedValue( ::rtl::OUString::createFromAscii( "TreatAsNumber" ), makeAny( (sal_Bool)bFormattedIsNumeric ) ) ); + aInitialValues.push_back( NamedValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FormatsSupplier")), makeAny( xSupplier ) ) ); + aInitialValues.push_back( NamedValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TreatAsNumber")), makeAny( (sal_Bool)bFormattedIsNumeric ) ) ); aCopyProperties.push_back( PROPERTY_FORMATKEY ); break; } @@ -858,7 +859,7 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun:: } } } - catch(Exception&) + catch(const Exception&) { DBG_UNHANDLED_EXCEPTION(); return sal_False; @@ -1007,7 +1008,7 @@ void SbaTableQueryBrowser::propertyChange(const PropertyChangeEvent& evt) throw( // ----------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::suspend(sal_Bool bSuspend) throw( RuntimeException ) { - vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( getMutex() ); if ( getView() && getView()->IsInModalMode() ) return sal_False; @@ -1041,7 +1042,7 @@ void SAL_CALL SbaTableQueryBrowser::statusChanged( const FeatureStateEvent& _rEv { if ( _rEvent.FeatureURL.Complete == aLoop->second.aURL.Complete) { - DBG_ASSERT( xSource.get() == aLoop->second.xDispatcher.get(), "SbaTableQueryBrowser::statusChanged: inconsistent!" ); + OSL_ENSURE( xSource.get() == aLoop->second.xDispatcher.get(), "SbaTableQueryBrowser::statusChanged: inconsistent!" ); // update the enabled state aLoop->second.bEnabled = _rEvent.IsEnabled; @@ -1079,7 +1080,7 @@ void SAL_CALL SbaTableQueryBrowser::statusChanged( const FeatureStateEvent& _rEv } } - DBG_ASSERT(aLoop != m_aExternalFeatures.end(), "SbaTableQueryBrowser::statusChanged: don't know who sent this!"); + OSL_ENSURE(aLoop != m_aExternalFeatures.end(), "SbaTableQueryBrowser::statusChanged: don't know who sent this!"); } // ------------------------------------------------------------------------- @@ -1092,7 +1093,7 @@ void SbaTableQueryBrowser::checkDocumentDataSource() if (!bKnownDocDataSource) { if (NULL != pDataSourceEntry) - { // at least the data source is know + { // at least the data source is known if (NULL != pContainerEntry) bKnownDocDataSource = sal_True; // assume we know it. // TODO: should we expand the object container? This may be too expensive just for checking .... @@ -1143,7 +1144,6 @@ namespace if ( aURL.GetProtocol() != INET_PROT_NOT_VALID ) { _rDisplayName = aURL.getBase(INetURLObject::LAST_SEGMENT,true,INetURLObject::DECODE_WITH_CHARSET); - // _rDisplayName = aURL.getName(INetURLObject::LAST_SEGMENT,true,INetURLObject::DECODE_WITH_CHARSET); _rUniqueId = aURL.GetMainURL( INetURLObject::NO_DECODE ); return true; } @@ -1173,11 +1173,11 @@ namespace // ------------------------------------------------------------------------- String SbaTableQueryBrowser::getDataSourceAcessor( SvLBoxEntry* _pDataSourceEntry ) const { - DBG_ASSERT( _pDataSourceEntry, "SbaTableQueryBrowser::getDataSourceAcessor: invalid entry!" ); + OSL_ENSURE( _pDataSourceEntry, "SbaTableQueryBrowser::getDataSourceAcessor: invalid entry!" ); DBTreeListUserData* pData = static_cast< DBTreeListUserData* >( _pDataSourceEntry->GetUserData() ); - DBG_ASSERT( pData, "SbaTableQueryBrowser::getDataSourceAcessor: invalid entry data!" ); - DBG_ASSERT( pData->eType == etDatasource, "SbaTableQueryBrowser::getDataSourceAcessor: entry does not denote a data source!" ); + OSL_ENSURE( pData, "SbaTableQueryBrowser::getDataSourceAcessor: invalid entry data!" ); + OSL_ENSURE( pData->eType == etDatasource, "SbaTableQueryBrowser::getDataSourceAcessor: entry does not denote a data source!" ); return pData->sAccessor.Len() ? pData->sAccessor : GetEntryText( _pDataSourceEntry ); } @@ -1198,7 +1198,7 @@ SvLBoxEntry* SbaTableQueryBrowser::getObjectEntry(const ::rtl::OUString& _rDataS String sDisplayName, sDataSourceId; bool bIsDataSourceURL = getDataSourceDisplayName_isURL( _rDataSource, sDisplayName, sDataSourceId ); // the display name may differ from the URL for readability reasons - // #i33699# - 2004-09-24 - fs@openoffice.org + // #i33699# FilterByEntryDataId aFilter( sDataSourceId ); SvLBoxEntry* pDataSource = m_pTreeView->getListBox().GetEntryPosByName( sDisplayName, NULL, &aFilter ); @@ -1210,7 +1210,7 @@ SvLBoxEntry* SbaTableQueryBrowser::getObjectEntry(const ::rtl::OUString& _rDataS // add new entries to the list box model implAddDatasource( _rDataSource, _rxConnection ); pDataSource = m_pTreeView->getListBox().GetEntryPosByName( sDisplayName, NULL, &aFilter ); - DBG_ASSERT( pDataSource, "SbaTableQueryBrowser::getObjectEntry: hmm - did not find it again!" ); + OSL_ENSURE( pDataSource, "SbaTableQueryBrowser::getObjectEntry: hmm - did not find it again!" ); } } if (_ppDataSourceEntry) @@ -1280,13 +1280,12 @@ SvLBoxEntry* SbaTableQueryBrowser::getObjectEntry(const ::rtl::OUString& _rDataS } } } - catch(Exception&) + catch(const Exception&) { - DBG_ERROR("SbaTableQueryBrowser::populateTree: could not fill the tree"); + OSL_FAIL("SbaTableQueryBrowser::populateTree: could not fill the tree"); } } } - // m_pTreeView->getListBox().Expand(pCommandType); } while ( nIndex >= 0 ); } @@ -1314,7 +1313,7 @@ SvLBoxEntry* SbaTableQueryBrowser::getObjectEntry(const ::svx::ODataAccessDescri void SbaTableQueryBrowser::connectExternalDispatches() { Reference< XDispatchProvider > xProvider( getFrame(), UNO_QUERY ); - DBG_ASSERT(xProvider.is(), "SbaTableQueryBrowser::connectExternalDispatches: no DispatchProvider !"); + OSL_ENSURE(xProvider.is(), "SbaTableQueryBrowser::connectExternalDispatches: no DispatchProvider !"); if (xProvider.is()) { if ( m_aExternalFeatures.empty() ) @@ -1332,7 +1331,7 @@ void SbaTableQueryBrowser::connectExternalDispatches() ID_BROWSER_INSERTCONTENT }; - for ( size_t i=0; i < sizeof( pURLs ) / sizeof( pURLs[0] ); ++i ) + for ( size_t i=0; i < SAL_N_ELEMENTS( pURLs ); ++i ) { URL aURL; aURL.Complete = ::rtl::OUString::createFromAscii( pURLs[i] ); @@ -1348,12 +1347,12 @@ void SbaTableQueryBrowser::connectExternalDispatches() ) { feature->second.xDispatcher = xProvider->queryDispatch( - feature->second.aURL, ::rtl::OUString::createFromAscii("_parent"), FrameSearchFlag::PARENT + feature->second.aURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_parent")), FrameSearchFlag::PARENT ); if ( feature->second.xDispatcher.get() == static_cast< XDispatch* >( this ) ) { - OSL_ENSURE( sal_False, "SbaTableQueryBrowser::connectExternalDispatches: this should not happen anymore!" ); + OSL_FAIL( "SbaTableQueryBrowser::connectExternalDispatches: this should not happen anymore!" ); // (nowadays, the URLs aren't in our SupportedFeatures list anymore, so we should // not supply a dispatcher for this) feature->second.xDispatcher.clear(); @@ -1445,7 +1444,7 @@ void SAL_CALL SbaTableQueryBrowser::disposing( const ::com::sun::star::lang::Eve DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(pDSLoop->GetUserData()); if ( pData && pData->xConnection == xCon ) { - // we set the conenction to null to avoid a second disposing of the connection + // we set the connection to null to avoid a second disposing of the connection pData->xConnection.clear(); closeConnection(pDSLoop,sal_False); break; @@ -1477,7 +1476,7 @@ void SbaTableQueryBrowser::implRemoveStatusListeners() } catch (Exception&) { - DBG_ERROR("SbaTableQueryBrowser::implRemoveStatusListeners: could not remove a status listener!"); + OSL_FAIL("SbaTableQueryBrowser::implRemoveStatusListeners: could not remove a status listener!"); } } } @@ -1487,7 +1486,7 @@ void SbaTableQueryBrowser::implRemoveStatusListeners() // ------------------------------------------------------------------------- sal_Bool SAL_CALL SbaTableQueryBrowser::select( const Any& _rSelection ) throw (IllegalArgumentException, RuntimeException) { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; // doin' a lot of VCL stuff here -> lock the SolarMutex Sequence< PropertyValue > aDescriptorSequence; @@ -1502,7 +1501,7 @@ sal_Bool SAL_CALL SbaTableQueryBrowser::select( const Any& _rSelection ) throw ( } catch(const Exception&) { - OSL_ENSURE(sal_False, "SbaTableQueryBrowser::select: could not extract the descriptor!"); + OSL_FAIL("SbaTableQueryBrowser::select: could not extract the descriptor!"); } // check the precense of the props we need @@ -1565,7 +1564,7 @@ void SbaTableQueryBrowser::attachFrame(const Reference< ::com::sun::star::frame: Reference< XFrame > xCurrentFrame( getFrame() ); if ( xCurrentFrame.is() ) { - m_xCurrentFrameParent = xCurrentFrame->findFrame(::rtl::OUString::createFromAscii("_parent"),FrameSearchFlag::PARENT); + m_xCurrentFrameParent = xCurrentFrame->findFrame(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_parent")),FrameSearchFlag::PARENT); if ( m_xCurrentFrameParent.is() ) m_xCurrentFrameParent->addFrameActionListener((::com::sun::star::frame::XFrameActionListener*)this); @@ -1822,7 +1821,6 @@ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const aReturn.bEnabled = aReturn.bEnabled && getBrowserView()->getVclControl()->GetSelectRowCount(); // disabled for native queries which are not saved within the database - // 67706 - 23.08.99 - FS Reference< XPropertySet > xDataSource(getRowSet(), UNO_QUERY); try { @@ -1836,7 +1834,7 @@ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const } catch(DisposedException&) { - OSL_ENSURE(sal_False, "SbaTableQueryBrowser::GetState: object already disposed!"); + OSL_FAIL("SbaTableQueryBrowser::GetState: object already disposed!"); } catch( const Exception& ) { @@ -1859,7 +1857,7 @@ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const case CommandType::COMMAND: sTitle = String(ModuleRes(STR_QRY_TITLE)); break; default: - DBG_ASSERT(sal_False, "SbaTableQueryBrowser::GetState: unknown command type!"); + OSL_FAIL("SbaTableQueryBrowser::GetState: unknown command type!"); } ::rtl::OUString aName; xProp->getPropertyValue(PROPERTY_COMMAND) >>= aName; @@ -1887,7 +1885,7 @@ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const { aReturn.bEnabled = m_aCurrentFrame.isActive(); break; - } // if ( getBrowserView()->getVclControl()->GetSelectRowCount() ) + } else aReturn.bEnabled = pControl->canCopyCellText(pControl->GetCurRow(), pControl->GetCurColumnId()); break; @@ -2012,7 +2010,7 @@ void SbaTableQueryBrowser::Execute(sal_uInt16 nId, const Sequence< PropertyValue if ( !pGrid->IsAllSelected() ) { // transfer the selected rows only if not all rows are selected // (all rows means the whole table) - // i3832 - 03.04.2002 - fs@openoffice.org + // #i3832# if (pSelection != NULL) { aSelection.realloc(pSelection->GetSelectCount()); @@ -2035,11 +2033,11 @@ void SbaTableQueryBrowser::Execute(sal_uInt16 nId, const Sequence< PropertyValue } catch(DisposedException&) { - OSL_ENSURE(0,"Object already disposed!"); + OSL_FAIL("Object already disposed!"); } - catch(Exception&) + catch(const Exception&) { - DBG_ERROR("SbaTableQueryBrowser::Execute(ID_BROWSER_?): could not clone the cursor!"); + OSL_FAIL("SbaTableQueryBrowser::Execute(ID_BROWSER_?): could not clone the cursor!"); } Reference<XPropertySet> xProp(getRowSet(),UNO_QUERY); @@ -2108,7 +2106,7 @@ void SbaTableQueryBrowser::implAddDatasource(const String& _rDbName, Image& _rDb String& _rQueryName, Image& _rQueryImage, String& _rTableName, Image& _rTableImage, const SharedConnection& _rxConnection) { - vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; // initialize the names/images if necessary if (!_rQueryName.Len()) _rQueryName = String(ModuleRes(RID_STR_QUERIES_CONTAINER)); @@ -2117,16 +2115,16 @@ void SbaTableQueryBrowser::implAddDatasource(const String& _rDbName, Image& _rDb ImageProvider aImageProvider; if (!_rQueryImage) - _rQueryImage = aImageProvider.getFolderImage( DatabaseObject::QUERY, isHiContrast() ); + _rQueryImage = aImageProvider.getFolderImage( DatabaseObject::QUERY ); if (!_rTableImage) - _rTableImage = aImageProvider.getFolderImage( DatabaseObject::TABLE, isHiContrast() ); + _rTableImage = aImageProvider.getFolderImage( DatabaseObject::TABLE ); if (!_rDbImage) - _rDbImage = aImageProvider.getDatabaseImage( isHiContrast() ); + _rDbImage = aImageProvider.getDatabaseImage(); // add the entry for the data source // special handling for data sources denoted by URLs - we do not want to display this ugly URL, do we? - // #i33699# - 2004-09-24 - fs@openoffice.org + // #i33699# String sDSDisplayName, sDataSourceId; getDataSourceDisplayName_isURL( _rDbName, sDSDisplayName, sDataSourceId ); @@ -2203,9 +2201,9 @@ void SbaTableQueryBrowser::populateTree(const Reference<XNameAccess>& _xNameAcce } } } - catch(Exception&) + catch(const Exception&) { - DBG_ERROR("SbaTableQueryBrowser::populateTree: could not fill the tree"); + OSL_FAIL("SbaTableQueryBrowser::populateTree: could not fill the tree"); } } @@ -2214,15 +2212,13 @@ SvLBoxEntry* SbaTableQueryBrowser::implAppendEntry( SvLBoxEntry* _pParent, const { ::std::auto_ptr< ImageProvider > pImageProvider( getImageProviderFor( _pParent ) ); - Image aImage, aImageHC; - pImageProvider->getImages( _rName, getDatabaseObjectType( _eEntryType ), aImage, aImageHC ); + Image aImage; + pImageProvider->getImages( _rName, getDatabaseObjectType( _eEntryType ), aImage ); SvLBoxEntry* pNewEntry = m_pTreeView->getListBox().InsertEntry( _rName, _pParent, _eEntryType == etQueryContainer , LIST_APPEND, _pUserData ); - m_pTreeView->getListBox().SetExpandedEntryBmp( pNewEntry, aImage, BMP_COLOR_NORMAL ); - m_pTreeView->getListBox().SetCollapsedEntryBmp( pNewEntry, aImage, BMP_COLOR_NORMAL ); - m_pTreeView->getListBox().SetExpandedEntryBmp( pNewEntry, aImageHC, BMP_COLOR_HIGHCONTRAST ); - m_pTreeView->getListBox().SetCollapsedEntryBmp( pNewEntry, aImageHC, BMP_COLOR_HIGHCONTRAST ); + m_pTreeView->getListBox().SetExpandedEntryBmp( pNewEntry, aImage ); + m_pTreeView->getListBox().SetCollapsedEntryBmp( pNewEntry, aImage ); return pNewEntry; } @@ -2304,7 +2300,7 @@ IMPL_LINK(SbaTableQueryBrowser, OnExpandEntry, SvLBoxEntry*, _pParent) if(e.TargetException >>= aSql) aInfo = aSql; else - OSL_ENSURE(sal_False, "SbaTableQueryBrowser::OnExpandEntry: something strange happended!"); + OSL_FAIL("SbaTableQueryBrowser::OnExpandEntry: something strange happended!"); } catch( const Exception& ) { @@ -2315,7 +2311,7 @@ IMPL_LINK(SbaTableQueryBrowser, OnExpandEntry, SvLBoxEntry*, _pParent) } else return 0L; - // 0 indicates that an error occured + // 0 indicates that an error occurred } else { // we have to expand the queries or bookmarks @@ -2332,7 +2328,7 @@ IMPL_LINK(SbaTableQueryBrowser, OnExpandEntry, SvLBoxEntry*, _pParent) //------------------------------------------------------------------------------ sal_Bool SbaTableQueryBrowser::ensureEntryObject( SvLBoxEntry* _pEntry ) { - DBG_ASSERT(_pEntry, "SbaTableQueryBrowser::ensureEntryObject: invalid argument!"); + OSL_ENSURE(_pEntry, "SbaTableQueryBrowser::ensureEntryObject: invalid argument!"); if (!_pEntry) return sal_False; @@ -2394,7 +2390,7 @@ sal_Bool SbaTableQueryBrowser::ensureEntryObject( SvLBoxEntry* _pEntry ) bSuccess = pEntryData->xContainer.is(); } else { - DBG_ERROR("SbaTableQueryBrowser::ensureEntryObject: no XQueryDefinitionsSupplier interface!"); + OSL_FAIL("SbaTableQueryBrowser::ensureEntryObject: no XQueryDefinitionsSupplier interface!"); } } catch( const Exception& ) @@ -2406,7 +2402,7 @@ sal_Bool SbaTableQueryBrowser::ensureEntryObject( SvLBoxEntry* _pEntry ) break; default: - DBG_ERROR("SbaTableQueryBrowser::ensureEntryObject: ooops ... missing some implementation here!"); + OSL_FAIL("SbaTableQueryBrowser::ensureEntryObject: ooops ... missing some implementation here!"); // TODO ... break; } @@ -2503,7 +2499,7 @@ sal_Bool SbaTableQueryBrowser::implLoadAnything(const ::rtl::OUString& _rDataSou DBG_UNHANDLED_EXCEPTION(); } } - catch(Exception&) + catch(const Exception&) { DBG_UNHANDLED_EXCEPTION(); } @@ -2777,12 +2773,12 @@ bool SbaTableQueryBrowser::implSelect( SvLBoxEntry* _pEntry ) if(e.TargetException >>= aSql) showError(SQLExceptionInfo(aSql)); else - OSL_ENSURE(sal_False, "SbaTableQueryBrowser::implSelect: something strange happended!"); + OSL_FAIL("SbaTableQueryBrowser::implSelect: something strange happended!"); // reset the values xRowSetProps->setPropertyValue(PROPERTY_DATASOURCENAME,Any()); xRowSetProps->setPropertyValue(PROPERTY_ACTIVE_CONNECTION,Any()); } - catch(Exception&) + catch(const Exception&) { // reset the values xRowSetProps->setPropertyValue(PROPERTY_DATASOURCENAME,Any()); @@ -2819,7 +2815,7 @@ SvLBoxEntry* SbaTableQueryBrowser::getEntryFromContainer(const Reference<XNameAc // ------------------------------------------------------------------------- void SAL_CALL SbaTableQueryBrowser::elementInserted( const ContainerEvent& _rEvent ) throw(RuntimeException) { - vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; Reference< XNameAccess > xNames(_rEvent.Source, UNO_QUERY); // first search for a definition container where we can insert this element @@ -2864,7 +2860,7 @@ sal_Bool SbaTableQueryBrowser::isCurrentlyDisplayedChanged(const String& _sName, // ------------------------------------------------------------------------- void SAL_CALL SbaTableQueryBrowser::elementRemoved( const ContainerEvent& _rEvent ) throw(RuntimeException) { - ::vos::OGuard aSolarGuard(Application::GetSolarMutex()); + SolarMutexGuard aSolarGuard; Reference< XNameAccess > xNames(_rEvent.Source, UNO_QUERY); // get the top-level representing the removed data source @@ -2917,7 +2913,7 @@ void SAL_CALL SbaTableQueryBrowser::elementRemoved( const ContainerEvent& _rEven // ------------------------------------------------------------------------- void SAL_CALL SbaTableQueryBrowser::elementReplaced( const ContainerEvent& _rEvent ) throw(RuntimeException) { - ::vos::OGuard aSolarGuard(Application::GetSolarMutex()); + SolarMutexGuard aSolarGuard; Reference< XNameAccess > xNames(_rEvent.Source, UNO_QUERY); SvLBoxEntry* pContainer = getEntryFromContainer(xNames); @@ -2978,7 +2974,7 @@ void SAL_CALL SbaTableQueryBrowser::elementReplaced( const ContainerEvent& _rEve } else if (xNames.get() == m_xDatabaseContext.get()) { // a datasource has been replaced in the context - DBG_ERROR("SbaTableQueryBrowser::elementReplaced: no support for replaced data sources!"); + OSL_FAIL("SbaTableQueryBrowser::elementReplaced: no support for replaced data sources!"); // very suspicious: the database context should not allow to replace data source, only to register // and revoke them } @@ -3017,8 +3013,8 @@ void SbaTableQueryBrowser::impl_releaseConnection( SharedConnection& _rxConnecti // ------------------------------------------------------------------------- void SbaTableQueryBrowser::disposeConnection( SvLBoxEntry* _pDSEntry ) { - DBG_ASSERT( _pDSEntry, "SbaTableQueryBrowser::disposeConnection: invalid entry (NULL)!" ); - DBG_ASSERT( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::disposeConnection: invalid entry (not top-level)!" ); + OSL_ENSURE( _pDSEntry, "SbaTableQueryBrowser::disposeConnection: invalid entry (NULL)!" ); + OSL_ENSURE( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::disposeConnection: invalid entry (not top-level)!" ); if ( _pDSEntry ) { @@ -3031,8 +3027,8 @@ void SbaTableQueryBrowser::disposeConnection( SvLBoxEntry* _pDSEntry ) // ------------------------------------------------------------------------- void SbaTableQueryBrowser::closeConnection(SvLBoxEntry* _pDSEntry,sal_Bool _bDisposeConnection) { - DBG_ASSERT(_pDSEntry, "SbaTableQueryBrowser::closeConnection: invalid entry (NULL)!"); - DBG_ASSERT( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::closeConnection: invalid entry (not top-level)!"); + OSL_ENSURE(_pDSEntry, "SbaTableQueryBrowser::closeConnection: invalid entry (NULL)!"); + OSL_ENSURE( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::closeConnection: invalid entry (not top-level)!"); // if one of the entries of the given DS is displayed currently, unload the form if (m_pCurrentlyDisplayed && (m_pTreeView->getListBox().GetRootLevelParent(m_pCurrentlyDisplayed) == _pDSEntry)) @@ -3116,11 +3112,11 @@ void SbaTableQueryBrowser::unloadAndCleanup( sal_Bool _bDisposeConnection ) if(e.TargetException >>= aSql) showError(SQLExceptionInfo(aSql)); else - OSL_ENSURE(sal_False, "SbaTableQueryBrowser::unloadAndCleanup: something strange happended!"); + OSL_FAIL("SbaTableQueryBrowser::unloadAndCleanup: something strange happended!"); } - catch(Exception&) + catch(const Exception&) { - OSL_ENSURE(sal_False, "SbaTableQueryBrowser::unloadAndCleanup: could not reset the form"); + OSL_FAIL("SbaTableQueryBrowser::unloadAndCleanup: could not reset the form"); } } @@ -3154,7 +3150,7 @@ namespace // ------------------------------------------------------------------------- void SbaTableQueryBrowser::impl_initialize() { - ::vos::OGuard aGuard(Application::GetSolarMutex()); + SolarMutexGuard aGuard; // doin' a lot of VCL stuff here -> lock the SolarMutex // first initialize the parent @@ -3229,7 +3225,7 @@ void SbaTableQueryBrowser::impl_initialize() if ( xFormMultiSet.is() ) xFormMultiSet->setPropertyValues(aProperties, aValues); } - catch(Exception) + catch(const Exception&) { DBG_UNHANDLED_EXCEPTION(); } @@ -3281,7 +3277,7 @@ void SbaTableQueryBrowser::impl_initialize() } catch( const Exception& ) { - OSL_ENSURE( sal_False, "SbaTableQueryBrowser::impl_initialize: a connection parent which does not have a 'Name'!??" ); + OSL_FAIL( "SbaTableQueryBrowser::impl_initialize: a connection parent which does not have a 'Name'!??" ); } } } @@ -3318,7 +3314,7 @@ void SbaTableQueryBrowser::impl_initialize() } catch(const Exception&) { - OSL_ENSURE(sal_False, "SbaTableQueryBrowser::impl_initialize: could not set the update related names!"); + OSL_FAIL("SbaTableQueryBrowser::impl_initialize: could not set the update related names!"); } } @@ -3397,7 +3393,7 @@ sal_Bool SbaTableQueryBrowser::getExistentConnectionFor( SvLBoxEntry* _pAnyEntry return _rConnection.is(); } -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 // ----------------------------------------------------------------------------- bool SbaTableQueryBrowser::impl_isDataSourceEntry( SvLBoxEntry* _pEntry ) const { @@ -3408,7 +3404,7 @@ bool SbaTableQueryBrowser::impl_isDataSourceEntry( SvLBoxEntry* _pEntry ) const // ----------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::ensureConnection( SvLBoxEntry* _pDSEntry, void* pDSData, SharedConnection& _rConnection ) { - DBG_ASSERT( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::ensureConnection: this entry does not denote a data source!" ); + OSL_ENSURE( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::ensureConnection: this entry does not denote a data source!" ); if(_pDSEntry) { DBTreeListUserData* pTreeListData = static_cast<DBTreeListUserData*>(pDSData); @@ -3447,7 +3443,7 @@ IMPL_LINK( SbaTableQueryBrowser, OnTreeEntryCompare, const SvSortData*, _pSortDa { SvLBoxEntry* pLHS = static_cast<SvLBoxEntry*>(_pSortData->pLeft); SvLBoxEntry* pRHS = static_cast<SvLBoxEntry*>(_pSortData->pRight); - DBG_ASSERT(pLHS && pRHS, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid tree entries!"); + OSL_ENSURE(pLHS && pRHS, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid tree entries!"); // we want the table entry and the end so we have to do a check if (isContainer(pRHS)) @@ -3477,13 +3473,13 @@ IMPL_LINK( SbaTableQueryBrowser, OnTreeEntryCompare, const SvSortData*, _pSortDa if ( ( eLeft == etQueryContainer ) && ( eRight == etTableContainer ) ) return COMPARE_LESS; - OSL_ENSURE( false, "SbaTableQueryBrowser::OnTreeEntryCompare: unexpected case!" ); + OSL_FAIL( "SbaTableQueryBrowser::OnTreeEntryCompare: unexpected case!" ); return COMPARE_EQUAL; } SvLBoxString* pLeftTextItem = static_cast<SvLBoxString*>(pLHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); SvLBoxString* pRightTextItem = static_cast<SvLBoxString*>(pRHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); - DBG_ASSERT(pLeftTextItem && pRightTextItem, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid text items!"); + OSL_ENSURE(pLeftTextItem && pRightTextItem, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid text items!"); String sLeftText = pLeftTextItem->GetText(); String sRightText = pRightTextItem->GetText(); @@ -3496,7 +3492,7 @@ IMPL_LINK( SbaTableQueryBrowser, OnTreeEntryCompare, const SvSortData*, _pSortDa { nCompareResult = m_xCollator->compareString(sLeftText, sRightText); } - catch(Exception&) + catch(const Exception&) { } } @@ -3633,7 +3629,7 @@ Any SbaTableQueryBrowser::getCurrentSelection( Control& _rControl ) const break; default: - OSL_ENSURE( false, "SbaTableQueryBrowser::getCurrentSelection: invalid (unexpected) object type!" ); + OSL_FAIL( "SbaTableQueryBrowser::getCurrentSelection: invalid (unexpected) object type!" ); break; } @@ -3648,7 +3644,7 @@ sal_Bool SbaTableQueryBrowser::implGetQuerySignature( ::rtl::OUString& _rCommand try { - // ontain the dss (data source signature) of the form + // contain the dss (data source signature) of the form ::rtl::OUString sDataSourceName; ::rtl::OUString sCommand; sal_Int32 nCommandType = CommandType::COMMAND; @@ -3718,14 +3714,6 @@ void SbaTableQueryBrowser::clearGridColumns(const Reference< XNameContainer >& _ } } // ----------------------------------------------------------------------------- -sal_Bool SbaTableQueryBrowser::isHiContrast() const -{ - sal_Bool bRet = sal_False; - if ( m_pTreeView ) - bRet = m_pTreeView->getListBox().GetSettings().GetStyleSettings().GetHighContrastMode(); - return bRet; -} -// ----------------------------------------------------------------------------- void SbaTableQueryBrowser::loadMenu(const Reference< XFrame >& _xFrame) { if ( m_bShowMenu ) @@ -3762,7 +3750,7 @@ void SbaTableQueryBrowser::loadMenu(const Reference< XFrame >& _xFrame) sTitle = aURL.getBase(INetURLObject::LAST_SEGMENT,true,INetURLObject::DECODE_WITH_CHARSET); if ( sName.getLength() ) { - sName += ::rtl::OUString::createFromAscii(" - "); + sName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - ")); sName += sTitle; sTitle = sName; } @@ -3803,7 +3791,6 @@ void SbaTableQueryBrowser::postReloadForm() { InitializeGridModel(getFormComponent()); LoadFinished(sal_True); - //updateTitle(); } //------------------------------------------------------------------------------ @@ -3849,7 +3836,7 @@ void SAL_CALL SbaTableQueryBrowser::releaseContextMenuInterceptor( const Referen //------------------------------------------------------------------------------ void SAL_CALL SbaTableQueryBrowser::registeredDatabaseLocation( const DatabaseRegistrationEvent& _Event ) throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; implAddDatasource( _Event.Name, SharedConnection() ); } @@ -3886,13 +3873,12 @@ void SbaTableQueryBrowser::impl_cleanupDataSourceEntry( const String& _rDataSour SvTreeEntryList* pList = m_pTreeModel->GetChildList( pDataSourceEntry ); if ( pList ) { - SvLBoxEntry* pEntryLoop = static_cast<SvLBoxEntry*>( pList->First() ); - while ( pEntryLoop ) + for ( size_t i = 0, n = pList->size(); i < n; ++i ) { + SvLBoxEntry* pEntryLoop = static_cast<SvLBoxEntry*>((*pList)[ i ]); DBTreeListUserData* pData = static_cast< DBTreeListUserData* >( pEntryLoop->GetUserData() ); pEntryLoop->SetUserData( NULL ); delete pData; - pEntryLoop = static_cast< SvLBoxEntry* >( pList->Next() ); } } @@ -3906,7 +3892,7 @@ void SbaTableQueryBrowser::impl_cleanupDataSourceEntry( const String& _rDataSour //------------------------------------------------------------------------------ void SAL_CALL SbaTableQueryBrowser::revokedDatabaseLocation( const DatabaseRegistrationEvent& _Event ) throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; impl_cleanupDataSourceEntry( _Event.Name ); @@ -3917,7 +3903,7 @@ void SAL_CALL SbaTableQueryBrowser::revokedDatabaseLocation( const DatabaseRegis //------------------------------------------------------------------------------ void SAL_CALL SbaTableQueryBrowser::changedDatabaseLocation( const DatabaseRegistrationEvent& _Event ) throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; // 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 @@ -3931,3 +3917,4 @@ void SAL_CALL SbaTableQueryBrowser::changedDatabaseLocation( const DatabaseRegis // ......................................................................... +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |