diff options
Diffstat (limited to 'dbaccess/source/ui/app/AppControllerDnD.cxx')
-rw-r--r-- | dbaccess/source/ui/app/AppControllerDnD.cxx | 160 |
1 files changed, 18 insertions, 142 deletions
diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx index 16df2130520f..0789d693da03 100644 --- a/dbaccess/source/ui/app/AppControllerDnD.cxx +++ b/dbaccess/source/ui/app/AppControllerDnD.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,196 +29,70 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbui.hxx" -#ifndef DBAUI_APPCONTROLLER_HXX #include "AppController.hxx" -#endif -#ifndef _COMPHELPER_SEQUENCE_HXX_ #include <comphelper/sequence.hxx> -#endif -#ifndef _COMPHELPER_PROPERTY_HXX_ #include <comphelper/property.hxx> -#endif -#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC #include "dbustrings.hrc" -#endif -#ifndef _COM_SUN_STAR_SDBCX_XDATADESCRIPTORFACTORY_HPP_ #include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBCX_XAPPEND_HPP_ #include <com/sun/star/sdbcx/XAppend.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_ #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_XSINGLESELECTQUERYCOMPOSER_HPP_ #include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp> -#endif -#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_ #include <com/sun/star/container/XNameContainer.hpp> -#endif -#ifndef _COM_SUN_STAR_UNO_XNAMINGSERVICE_HPP_ #include <com/sun/star/uno/XNamingService.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBC_XDATASOURCE_HPP_ #include <com/sun/star/sdbc/XDataSource.hpp> -#endif -#ifndef _COM_SUN_STAR_FRAME_XSTORABLE_HPP_ #include <com/sun/star/frame/XStorable.hpp> -#endif -#ifndef _COM_SUN_STAR_CONTAINER_XCHILD_HPP_ #include <com/sun/star/container/XChild.hpp> -#endif -#ifndef _COM_SUN_STAR_CONTAINER_XHIERARCHICALNAMECONTAINER_HPP_ #include <com/sun/star/container/XHierarchicalNameContainer.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBC_DATATYPE_HPP_ #include <com/sun/star/sdbc/DataType.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_COMMANDTYPE_HPP_ #include <com/sun/star/sdb/CommandType.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_XBOOKMARKSSUPPLIER_HPP_ #include <com/sun/star/sdb/XBookmarksSupplier.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_SQLCONTEXT_HPP_ #include <com/sun/star/sdb/SQLContext.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBCX_XTABLESSUPPLIER_HPP_ #include <com/sun/star/sdbcx/XTablesSupplier.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBCX_XVIEWSSUPPLIER_HPP_ #include <com/sun/star/sdbcx/XViewsSupplier.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_XQUERYDEFINITIONSSUPPLIER_HPP_ #include <com/sun/star/sdb/XQueryDefinitionsSupplier.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBCX_XDROP_HPP_ #include <com/sun/star/sdbcx/XDrop.hpp> -#endif -#ifndef _TOOLS_DEBUG_HXX -#include <tools/debug.hxx> -#endif -#ifndef _URLOBJ_HXX #include <tools/urlobj.hxx> -#endif -#ifndef _UNOTOOLS_UCBHELPER_HXX #include <unotools/ucbhelper.hxx> -#endif -#ifndef DBAUI_DLGSAVE_HXX #include "dlgsave.hxx" -#endif -#ifndef _COMPHELPER_TYPES_HXX_ #include <comphelper/types.hxx> -#endif -#ifndef _SV_MSGBOX_HXX #include <vcl/msgbox.hxx> -#endif -#ifndef _CPPUHELPER_TYPEPROVIDER_HXX_ #include <cppuhelper/typeprovider.hxx> -#endif -#ifndef _CPPUHELPER_EXC_HLP_HXX_ #include <cppuhelper/exc_hlp.hxx> -#endif -#ifndef _DBHELPER_DBEXCEPTION_HXX_ #include <connectivity/dbexception.hxx> -#endif -#ifndef _SV_WAITOBJ_HXX #include <vcl/waitobj.hxx> -#endif -#ifndef _RTL_USTRBUF_HXX_ #include <rtl/ustrbuf.hxx> -#endif -#ifndef DBAUI_APPVIEW_HXX #include "AppView.hxx" -#endif -#ifndef _SVX_DATACCESSDESCRIPTOR_HXX_ #include <svx/dataaccessdescriptor.hxx> -#endif -#ifndef SVX_DBAOBJECTEX_HXX #include <svx/dbaobjectex.hxx> -#endif -#ifndef DBACCESS_UI_BROWSER_ID_HXX #include "browserids.hxx" -#endif -#ifndef _DBAU_REGHELPER_HXX_ #include "dbu_reghelper.hxx" -#endif -#ifndef _DBU_APP_HRC_ #include "dbu_app.hrc" -#endif -#ifndef _SV_MENU_HXX #include <vcl/menu.hxx> -#endif -#ifndef _COMPHELPER_UNO3_HXX_ #include <comphelper/uno3.hxx> -#endif -#ifndef _SV_SVAPP_HXX //autogen #include <vcl/svapp.hxx> -#endif -#ifndef _SVLBOXITM_HXX #include <svtools/svlbitm.hxx> -#endif -#ifndef _DBAUI_LISTVIEWITEMS_HXX_ #include "listviewitems.hxx" -#endif -#ifndef DBAUI_APPDETAILVIEW_HXX #include "AppDetailView.hxx" -#endif -#ifndef _DBAUI_LINKEDDOCUMENTS_HXX_ #include "linkeddocuments.hxx" -#endif -#ifndef _SV_LSTBOX_HXX #include <vcl/lstbox.hxx> -#endif -#ifndef _DBHELPER_DBEXCEPTION_HXX_ #include <connectivity/dbexception.hxx> -#endif -#ifndef _CONNECTIVITY_DBTOOLS_HXX_ #include <connectivity/dbtools.hxx> -#endif -#ifndef _DBAUI_SQLMESSAGE_HXX_ #include "sqlmessage.hxx" -#endif -#ifndef _STRING_HXX #include <tools/string.hxx> -#endif -#ifndef DBAUI_DBEXCHANGE_HXX #include "dbexchange.hxx" -#endif -#ifndef DBAUI_TOOLS_HXX #include "UITools.hxx" -#endif #include <algorithm> -#ifndef _SVTREEBOX_HXX #include <svtools/svtreebx.hxx> -#endif -#ifndef _COM_SUN_STAR_SDB_XREPORTDOCUMENTSSUPPLIER_HPP_ #include <com/sun/star/sdb/XReportDocumentsSupplier.hpp> -#endif -#ifndef _COM_SUN_STAR_SDB_XFORMDOCUMENTSSUPPLIER_HPP_ #include <com/sun/star/sdb/XFormDocumentsSupplier.hpp> -#endif -#ifndef _FILEDLGHELPER_HXX #include <sfx2/filedlghelper.hxx> -#endif -#ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX #include <unotools/pathoptions.hxx> -#endif -#ifndef _SFX_DOCFILT_HACK_HXX #include <sfx2/docfilt.hxx> -#endif -#ifndef _SVT_FILEVIEW_HXX #include <svtools/fileview.hxx> -#endif -#ifndef TOOLS_DIAGNOSE_EX_H #include <tools/diagnose_ex.h> -#endif -#ifndef DBACCESS_SOURCE_UI_MISC_DEFAULTOBJECTNAMECHECK_HXX +#include <osl/diagnose.h> #include "defaultobjectnamecheck.hxx" -#endif -#ifndef _VOS_MUTEX_HXX_ -#include <vos/mutex.hxx> -#endif +#include <osl/mutex.hxx> #include "subcomponentmanager.hxx" //........................................................................ @@ -298,7 +173,7 @@ void OApplicationController::deleteTables(const ::std::vector< ::rtl::OUString>& if(e.TargetException >>= aSql) aErrorInfo = aSql; else - OSL_ENSURE(sal_False, "OApplicationController::implDropTable: something strange happended!"); + OSL_FAIL("OApplicationController::implDropTable: something strange happended!"); } catch( const Exception& ) { @@ -336,7 +211,7 @@ void OApplicationController::deleteObjects( ElementType _eType, const ::std::vec // The list of elements to delete is allowed to contain related elements: A given element may // be the ancestor or child of another element from the list. // We want to ensure that ancestors get deleted first, so we normalize the list in this respect. - // #i33353# - 2004-09-27 - fs@openoffice.org + // #i33353# ::std::set< ::rtl::OUString > aDeleteNames; // Note that this implicitly uses ::std::less< ::rtl::OUString > a comparison operation, which // results in lexicographical order, which is exactly what we need, because "foo" is *before* @@ -390,7 +265,7 @@ void OApplicationController::deleteObjects( ElementType _eType, const ::std::vec // now that we removed the element, care for all it's child elements // which may also be a part of the list - // #i33353# - 2004-09-27 - fs@openoffice.org + // #i33353# OSL_ENSURE( aThisRound->getLength() - 1 >= 0, "OApplicationController::deleteObjects: empty name?" ); ::rtl::OUStringBuffer sSmallestSiblingName( *aThisRound ); sSmallestSiblingName.append( (sal_Unicode)( '/' + 1) ); @@ -419,7 +294,7 @@ void OApplicationController::deleteObjects( ElementType _eType, const ::std::vec if ( e.TargetException >>= aSql ) showError( SQLExceptionInfo( e.TargetException ) ); else - OSL_ENSURE( sal_False, "OApplicationController::deleteObjects: something strange happended!" ); + OSL_FAIL( "OApplicationController::deleteObjects: something strange happended!" ); } catch( const Exception& ) { @@ -440,7 +315,7 @@ void OApplicationController::deleteObjects( ElementType _eType, const ::std::vec // ----------------------------------------------------------------------------- void OApplicationController::deleteEntries() { - ::vos::OGuard aSolarGuard(Application::GetSolarMutex()); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( getMutex() ); if ( getContainer() ) @@ -470,7 +345,7 @@ void OApplicationController::deleteEntries() // ----------------------------------------------------------------------------- const SharedConnection& OApplicationController::ensureConnection( ::dbtools::SQLExceptionInfo* _pErrorInfo ) { - ::vos::OGuard aSolarGuard(Application::GetSolarMutex()); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( getMutex() ); if ( !m_xDataSourceConnection.is() ) @@ -586,7 +461,7 @@ Reference< XNameAccess > OApplicationController::getElements( ElementType _eType // ----------------------------------------------------------------------------- void OApplicationController::getSelectionElementNames(::std::vector< ::rtl::OUString>& _rNames) const { - ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( getMutex() ); OSL_ENSURE(getContainer(),"View isn't valid! -> GPF"); @@ -619,7 +494,7 @@ TransferableHelper* OApplicationController::copyObject() { try { - ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( getMutex() ); ElementType eType = getContainer()->getElementType(); @@ -693,7 +568,7 @@ sal_Bool OApplicationController::paste( ElementType _eType,const ::svx::ODataAcc if ( CommandType::QUERY == nCommandType || CommandType::COMMAND == nCommandType ) { - // read all nescessary data + // read all necessary data ::rtl::OUString sCommand; sal_Bool bEscapeProcessing = sal_True; @@ -711,7 +586,7 @@ sal_Bool OApplicationController::paste( ElementType _eType,const ::svx::ODataAcc bValidDescriptor = (0 != sCommand.getLength()); if (!bValidDescriptor) { - DBG_ERROR("OApplicationController::paste: invalid descriptor!"); + OSL_FAIL("OApplicationController::paste: invalid descriptor!"); return sal_False; } @@ -762,7 +637,7 @@ sal_Bool OApplicationController::paste( ElementType _eType,const ::svx::ODataAcc if (!bSuccess) { - DBG_ERROR("OApplicationController::paste: could not extract the source query object!"); + OSL_FAIL("OApplicationController::paste: could not extract the source query object!"); // TODO: maybe this is worth an error message to be displayed to the user .... return sal_False; } @@ -773,7 +648,7 @@ sal_Bool OApplicationController::paste( ElementType _eType,const ::svx::ODataAcc Reference< XSingleServiceFactory > xQueryFactory(xDestQueries, UNO_QUERY); if (!xQueryFactory.is()) { - DBG_ERROR("OApplicationController::paste: invalid destination query container!"); + OSL_FAIL("OApplicationController::paste: invalid destination query container!"); return sal_False; } @@ -805,7 +680,7 @@ sal_Bool OApplicationController::paste( ElementType _eType,const ::svx::ODataAcc // create a new object Reference< XPropertySet > xNewQuery(xQueryFactory->createInstance(), UNO_QUERY); - DBG_ASSERT(xNewQuery.is(), "OApplicationController::paste: invalid object created by factory!"); + OSL_ENSURE(xNewQuery.is(), "OApplicationController::paste: invalid object created by factory!"); if (xNewQuery.is()) { // initialize @@ -902,7 +777,7 @@ sal_Bool OApplicationController::isTableFormat() const IMPL_LINK( OApplicationController, OnAsyncDrop, void*, /*NOTINTERESTEDIN*/ ) { m_nAsyncDrop = 0; - ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( getMutex() ); @@ -940,3 +815,4 @@ IMPL_LINK( OApplicationController, OnAsyncDrop, void*, /*NOTINTERESTEDIN*/ ) //........................................................................ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |