diff options
Diffstat (limited to 'dbaccess/source/ui/browser/formadapter.cxx')
-rw-r--r-- | dbaccess/source/ui/browser/formadapter.cxx | 55 |
1 files changed, 19 insertions, 36 deletions
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: */ |