summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/app/AppController.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/ui/app/AppController.cxx')
-rw-r--r--dbaccess/source/ui/app/AppController.cxx65
1 files changed, 32 insertions, 33 deletions
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index b401ec7cd07b..96e0ae16ae4c 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.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.
@@ -78,8 +79,8 @@
#include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
#include <com/sun/star/container/XHierarchicalName.hpp>
/** === end UNO includes === **/
-#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
+#include <osl/diagnose.h>
#include <tools/string.hxx>
#include <svl/urihelper.hxx>
@@ -124,7 +125,7 @@
#include <svx/dbaobjectex.hxx>
#include <svx/svxdlg.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include "AppView.hxx"
#include "browserids.hxx"
#include "dbu_reghelper.hxx"
@@ -194,7 +195,7 @@ namespace DatabaseObjectContainer = ::com::sun::star::sdb::application::Database
Sequence< ::rtl::OUString> OApplicationController::getSupportedServiceNames_Static(void) throw( RuntimeException )
{
Sequence< ::rtl::OUString> aSupported(1);
- aSupported.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdb.application.DefaultViewController");
+ aSupported.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.application.DefaultViewController"));
return aSupported;
}
//-------------------------------------------------------------------------
@@ -336,7 +337,7 @@ OApplicationController::~OApplicationController()
{
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();
@@ -446,7 +447,7 @@ void SAL_CALL OApplicationController::disposing()
m_xModel.clear();
}
}
- catch(Exception)
+ catch(const Exception&)
{
DBG_UNHANDLED_EXCEPTION();
}
@@ -468,12 +469,12 @@ sal_Bool OApplicationController::Construct(Window* _pParent)
getContainer()->Construct();
bSuccess = sal_True;
}
- catch(SQLException&)
+ catch(const SQLException&)
{
}
- catch(Exception&)
+ catch(const Exception&)
{
- DBG_ERROR("OApplicationController::Construct : the construction of UnoDataBrowserView failed !");
+ OSL_FAIL("OApplicationController::Construct : the construction of UnoDataBrowserView failed !");
}
if ( !bSuccess )
@@ -504,7 +505,7 @@ void SAL_CALL OApplicationController::disposing(const EventObject& _rSource) thr
Reference<XConnection> xCon(_rSource.Source, UNO_QUERY);
if ( xCon.is() )
{
- DBG_ASSERT( m_xDataSourceConnection == xCon,
+ OSL_ENSURE( m_xDataSourceConnection == xCon,
"OApplicationController::disposing: which connection does this come from?" );
if ( getContainer() && getContainer()->getElementType() == E_TABLE )
@@ -549,7 +550,7 @@ sal_Bool SAL_CALL OApplicationController::suspend(sal_Bool bSuspend) throw( Runt
);
}
- ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( getMutex() );
if ( getView() && getView()->IsInModalMode() )
@@ -1018,7 +1019,7 @@ namespace
// -----------------------------------------------------------------------------
void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& aArgs)
{
- ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( getMutex() );
if ( isUserDefinedFeature( _nId ) )
@@ -1115,7 +1116,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
const PropertyValue* pEnd = pIter + aArgs.getLength();
for( ; pIter != pEnd ; ++pIter)
{
- if ( pIter->Name.equalsAscii("FormatStringId") )
+ if ( pIter->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FormatStringId")) )
{
SotFormatStringId nFormatId = 0;
if ( pIter->Value >>= nFormatId )
@@ -1272,7 +1273,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
case ID_NEW_TABLE_DESIGN:
break;
default:
- OSL_ENSURE(0,"illegal switch call!");
+ OSL_FAIL("illegal switch call!");
}
if ( bAutoPilot )
getContainer()->PostUserEvent( LINK( this, OApplicationController, OnCreateWithPilot ), reinterpret_cast< void* >( eType ) );
@@ -1555,7 +1556,7 @@ OApplicationView* OApplicationController::getContainer() const
// ::com::sun::star::container::XContainerListener
void SAL_CALL OApplicationController::elementInserted( const ContainerEvent& _rEvent ) throw(RuntimeException)
{
- ::vos::OGuard aSolarGuard(Application::GetSolarMutex());
+ SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( getMutex() );
Reference< XContainer > xContainer(_rEvent.Source, UNO_QUERY);
@@ -1591,7 +1592,7 @@ void SAL_CALL OApplicationController::elementInserted( const ContainerEvent& _rE
// -----------------------------------------------------------------------------
void SAL_CALL OApplicationController::elementRemoved( const ContainerEvent& _rEvent ) throw(RuntimeException)
{
- ::vos::OGuard aSolarGuard(Application::GetSolarMutex());
+ SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( getMutex() );
Reference< XContainer > xContainer(_rEvent.Source, UNO_QUERY);
@@ -1625,7 +1626,7 @@ void SAL_CALL OApplicationController::elementRemoved( const ContainerEvent& _rEv
// -----------------------------------------------------------------------------
void SAL_CALL OApplicationController::elementReplaced( const ContainerEvent& _rEvent ) throw(RuntimeException)
{
- ::vos::OGuard aSolarGuard(Application::GetSolarMutex());
+ SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( getMutex() );
Reference< XContainer > xContainer(_rEvent.Source, UNO_QUERY);
@@ -1693,7 +1694,7 @@ namespace
case E_NONE:
break;
default:
- OSL_ENSURE(0,"Invalid ElementType!");
+ OSL_FAIL("Invalid ElementType!");
break;
}
return sToolbar;
@@ -1927,7 +1928,7 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const
break;
default:
- OSL_ENSURE( false, "OApplicationController::openElement: illegal object type!" );
+ OSL_FAIL( "OApplicationController::openElement: illegal object type!" );
break;
}
return xRet;
@@ -2038,7 +2039,7 @@ Reference< XComponent > OApplicationController::newElement( ElementType _eType,
break;
default:
- OSL_ENSURE( false, "OApplicationController::newElement: illegal type!" );
+ OSL_FAIL( "OApplicationController::newElement: illegal type!" );
break;
}
@@ -2073,7 +2074,7 @@ void OApplicationController::addContainerListener(const Reference<XNameAccess>&
// -----------------------------------------------------------------------------
void OApplicationController::renameEntry()
{
- ::vos::OGuard aSolarGuard(Application::GetSolarMutex());
+ SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( getMutex() );
OSL_ENSURE(getContainer(),"View is NULL! -> GPF");
@@ -2277,7 +2278,7 @@ void OApplicationController::showPreviewFor(const ElementType _eType,const ::rtl
return;
default:
- OSL_ENSURE( false, "OApplicationController::showPreviewFor: unexpected element type!" );
+ OSL_FAIL( "OApplicationController::showPreviewFor: unexpected element type!" );
break;
}
}
@@ -2339,7 +2340,7 @@ void OApplicationController::onDeleteEntry()
nId = SID_DB_APP_REPORT_DELETE;
break;
default:
- OSL_ENSURE(0,"Invalid ElementType!");
+ OSL_FAIL("Invalid ElementType!");
break;
}
executeChecked(nId,Sequence<PropertyValue>());
@@ -2499,9 +2500,6 @@ sal_Int8 OApplicationController::queryDrop( const AcceptDropEvent& _rEvt, const
nAction = DND_ACTION_NONE;
}
}
- /*else
- nAction = nActionAskedFor & DND_ACTION_COPYMOVE;
- */
}
return nAction;
}
@@ -2516,7 +2514,7 @@ sal_Int8 OApplicationController::executeDrop( const ExecuteDropEvent& _rEvt )
OApplicationView* pView = getContainer();
if ( !pView || pView->getElementType() == E_NONE )
{
- DBG_ERROR("OApplicationController::executeDrop: what the hell did queryDrop do?");
+ OSL_FAIL("OApplicationController::executeDrop: what the hell did queryDrop do?");
// queryDrop shoud not have allowed us to reach this situation ....
return DND_ACTION_NONE;
}
@@ -2653,7 +2651,7 @@ IMPL_LINK( OApplicationController, OnFirstControllerConnected, void*, /**/ )
if ( !m_xModel.is() )
{
- OSL_ENSURE( false, "OApplicationController::OnFirstControllerConnected: too late!" );
+ OSL_FAIL( "OApplicationController::OnFirstControllerConnected: too late!" );
}
// if we have forms or reports which contain macros/scripts, then show a warning
@@ -2718,7 +2716,7 @@ sal_Bool SAL_CALL OApplicationController::attachModel(const Reference< XModel >
const Reference< XModifiable > xDocModify( _rxModel, UNO_QUERY );
if ( ( !xOfficeDoc.is() || !xDocModify.is() ) && _rxModel.is() )
{
- DBG_ERROR( "OApplicationController::attachModel: invalid model!" );
+ OSL_FAIL( "OApplicationController::attachModel: invalid model!" );
return sal_False;
}
@@ -2855,7 +2853,7 @@ void SAL_CALL OApplicationController::removeSelectionChangeListener( const Refer
// -----------------------------------------------------------------------------
::sal_Bool SAL_CALL OApplicationController::select( const Any& _aSelection ) throw (IllegalArgumentException, RuntimeException)
{
- ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( getMutex() );
Sequence< ::rtl::OUString> aSelection;
if ( !_aSelection.hasValue() || !getView() )
@@ -2874,7 +2872,7 @@ void SAL_CALL OApplicationController::removeSelectionChangeListener( const Refer
const NamedValue* pEnd = pIter + aCurrentSelection.getLength();
for(;pIter != pEnd;++pIter)
{
- if ( pIter->Name.equalsAscii("Type") )
+ if ( pIter->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Type")) )
{
sal_Int32 nType = 0;
pIter->Value >>= nType;
@@ -2882,7 +2880,7 @@ void SAL_CALL OApplicationController::removeSelectionChangeListener( const Refer
throw IllegalArgumentException();
eType = static_cast< ElementType >( nType );
}
- else if ( pIter->Name.equalsAscii("Selection") )
+ else if ( pIter->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Selection")) )
pIter->Value >>= aSelection;
}
@@ -2978,7 +2976,7 @@ void SAL_CALL OApplicationController::removeSelectionChangeListener( const Refer
// -----------------------------------------------------------------------------
Any SAL_CALL OApplicationController::getSelection( ) throw (RuntimeException)
{
- ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( getMutex() );
Sequence< NamedDatabaseObject > aCurrentSelection;
@@ -2998,7 +2996,7 @@ Any SAL_CALL OApplicationController::getSelection( ) throw (RuntimeException)
case E_FORM: aCurrentSelection[0].Type = DatabaseObjectContainer::FORMS; break;
case E_REPORT: aCurrentSelection[0].Type = DatabaseObjectContainer::REPORTS; break;
default:
- OSL_ENSURE( false, "OApplicationController::getSelection: unexpected current element type!" );
+ OSL_FAIL( "OApplicationController::getSelection: unexpected current element type!" );
break;
}
}
@@ -3036,3 +3034,4 @@ void OApplicationController::impl_migrateScripts_nothrow()
} // namespace dbaui
//........................................................................
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */