summaryrefslogtreecommitdiff
path: root/fpicker
diff options
context:
space:
mode:
authorTino Rachui <tra@openoffice.org>2001-07-02 07:09:57 +0000
committerTino Rachui <tra@openoffice.org>2001-07-02 07:09:57 +0000
commitced3cbd1f8ab731648f46f96d738f21010372dac (patch)
tree7df0f35fc730fc90ed2dc4db6a2e0394aa64bfce /fpicker
parent44be59e7ae1fe989464d16d1167231bc6ee8272b (diff)
IllegalArgumentException specification from XFilePickerControlAccess methods removed and methods changed
Diffstat (limited to 'fpicker')
-rw-r--r--fpicker/source/win32/filepicker/WinFileOpenImpl.cxx87
-rw-r--r--fpicker/source/win32/filepicker/WinFileOpenImpl.hxx16
2 files changed, 51 insertions, 52 deletions
diff --git a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
index 00a526c7b29b..773cdd45ab5e 100644
--- a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
+++ b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: WinFileOpenImpl.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: tra $ $Date: 2001-06-28 11:13:15 $
+ * last change: $Author: tra $ $Date: 2001-07-02 08:09:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -432,7 +432,7 @@ OUString SAL_CALL CWinFileOpenImpl::getCurrentFilter( ) throw(RuntimeException)
//=================================================================================================================
void SAL_CALL CWinFileOpenImpl::setValue( sal_Int16 aControlId, sal_Int16 aControlAction, const Any& aValue )
- throw(IllegalArgumentException, RuntimeException)
+ throw(RuntimeException)
{
if ( m_bInExecuteMode )
{
@@ -441,32 +441,31 @@ void SAL_CALL CWinFileOpenImpl::setValue( sal_Int16 aControlId, sal_Int16 aContr
// the filter listbox can be manipulated via this
// method the caller should use XFilterManager
if ( !hwndCtrl || (aControlId == LISTBOX_FILTER) )
- throw IllegalArgumentException(
- OUString::createFromAscii( "invalid control id" ),
- static_cast< XFilePicker* >( m_FilePicker ),
- 1 );
+ {
+ OSL_ENSURE( sal_False, "invalid control id" );
+ return;
+ }
CTRL_CLASS aCtrlClass = GetCtrlClass( hwndCtrl );
if ( UNKNOWN == aCtrlClass )
- throw IllegalArgumentException(
- OUString::createFromAscii( "unsupported control class" ),
- static_cast< XFilePicker* >( m_FilePicker ),
- 1 );
+ {
+ OSL_ENSURE( sal_False, "unsupported control class" );
+ return;
+ }
CTRL_SETVALUE_FUNCTION_T lpfnSetValue =
GetCtrlSetValueFunction( aCtrlClass, aControlAction );
if ( !lpfnSetValue )
- throw IllegalArgumentException(
- OUString::createFromAscii( "unsupported control action" ),
- static_cast< XFilePicker* >( m_FilePicker ),
- 2 );
+ {
+ OSL_ENSURE( sal_False, "unsupported control action" );
+ return;
+ }
// the function that we call should throw an IllegalArgumentException if
// the given value is invalid or empty, that's why we provide a Reference
// to an XInterface and a argument position
lpfnSetValue( hwndCtrl, aValue, static_cast< XFilePicker* >( m_FilePicker ), 3 );
-
}
else
{
@@ -483,7 +482,7 @@ void SAL_CALL CWinFileOpenImpl::setValue( sal_Int16 aControlId, sal_Int16 aContr
//-----------------------------------------------------------------------------------------
Any SAL_CALL CWinFileOpenImpl::getValue( sal_Int16 aControlId, sal_Int16 aControlAction )
- throw(IllegalArgumentException, RuntimeException)
+ throw(RuntimeException)
{
Any aAny;
@@ -494,26 +493,26 @@ Any SAL_CALL CWinFileOpenImpl::getValue( sal_Int16 aControlId, sal_Int16 aContro
// the filter listbox can be manipulated via this
// method the caller should use XFilterManager
if ( !hwndCtrl || (aControlId == LISTBOX_FILTER) )
- throw IllegalArgumentException(
- OUString::createFromAscii( "invalid control id" ),
- static_cast< XFilePicker* >( m_FilePicker ),
- 1 );
+ {
+ OSL_ENSURE( sal_False, "invalid control id" );
+ return aAny;
+ }
CTRL_CLASS aCtrlClass = GetCtrlClass( hwndCtrl );
if ( UNKNOWN == aCtrlClass )
- throw IllegalArgumentException(
- OUString::createFromAscii( "unsupported control class" ),
- static_cast< XFilePicker* >( m_FilePicker ),
- 1 );
+ {
+ OSL_ENSURE( sal_False, "unsupported control class" );
+ return aAny;
+ }
CTRL_GETVALUE_FUNCTION_T lpfnGetValue =
GetCtrlGetValueFunction( aCtrlClass, aControlAction );
if ( !lpfnGetValue )
- throw IllegalArgumentException(
- OUString::createFromAscii( "unsupported control action" ),
- static_cast< XFilePicker* >( m_FilePicker ),
- 2 );
+ {
+ OSL_ENSURE( sal_False, "unsupported control action" );
+ return aAny;
+ }
aAny = lpfnGetValue( hwndCtrl );
}
@@ -541,15 +540,15 @@ Any SAL_CALL CWinFileOpenImpl::getValue( sal_Int16 aControlId, sal_Int16 aContro
//-----------------------------------------------------------------------------------------
void SAL_CALL CWinFileOpenImpl::enableControl( sal_Int16 ControlID, sal_Bool bEnable )
- throw(IllegalArgumentException, RuntimeException)
+ throw(RuntimeException)
{
HWND hwndCtrl = GetHwndDlgItem( ControlID );
if ( !hwndCtrl )
- throw IllegalArgumentException(
- OUString::createFromAscii( "Invalid element id"),
- static_cast< XFilePicker* >( m_FilePicker ),
- 1 );
+ {
+ OSL_ENSURE( sal_False, "invalid element id");
+ return;
+ }
EnableWindow( hwndCtrl, bEnable );
}
@@ -559,15 +558,15 @@ void SAL_CALL CWinFileOpenImpl::enableControl( sal_Int16 ControlID, sal_Bool bEn
//-----------------------------------------------------------------------------------------
void SAL_CALL CWinFileOpenImpl::setLabel( sal_Int16 aControlId, const ::rtl::OUString& aLabel )
- throw (IllegalArgumentException, RuntimeException)
+ throw (RuntimeException)
{
HWND hwndCtrl = GetHwndDlgItem( aControlId );
if ( !hwndCtrl )
- throw IllegalArgumentException(
- OUString::createFromAscii( "Invalid element id"),
- static_cast< XFilePicker* >( m_FilePicker ),
- 1 );
+ {
+ OSL_ENSURE( sal_False, "invalid element id");
+ return;
+ }
// somewhat risky because we don't know if OUString
// has a terminating '\0'
@@ -579,15 +578,15 @@ void SAL_CALL CWinFileOpenImpl::setLabel( sal_Int16 aControlId, const ::rtl::OUS
//-----------------------------------------------------------------------------------------
OUString SAL_CALL CWinFileOpenImpl::getLabel( sal_Int16 aControlId )
- throw (IllegalArgumentException, RuntimeException)
+ throw (RuntimeException)
{
HWND hwndCtrl = GetHwndDlgItem( aControlId );
if ( !hwndCtrl )
- throw IllegalArgumentException(
- OUString::createFromAscii( "Invalid element id"),
- static_cast< XFilePicker* >( m_FilePicker ),
- 1 );
+ {
+ OSL_ENSURE( sal_False, "invalid element id");
+ return OUString( );
+ }
sal_Unicode aLabel[MAX_LABEL];
int nRet = GetWindowTextW( hwndCtrl, aLabel, MAX_LABEL );
diff --git a/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx b/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx
index fd4fecb8b940..d9a1a2a4d23d 100644
--- a/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx
+++ b/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: WinFileOpenImpl.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: tra $ $Date: 2001-06-28 11:13:03 $
+ * last change: $Author: tra $ $Date: 2001-07-02 08:09:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -165,23 +165,23 @@ public:
throw( ::com::sun::star::uno::RuntimeException );
//-----------------------------------------------------------------------------------------
- // XExtendedFilePicker
+ // XFilePickerControlAccess
//-----------------------------------------------------------------------------------------
virtual void SAL_CALL setValue( sal_Int16 aControlId, sal_Int16 aControlAction, const ::com::sun::star::uno::Any& aValue )
- throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
+ throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Any SAL_CALL getValue( sal_Int16 aControlId, sal_Int16 aControlAction )
- throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
+ throw( ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL enableControl( sal_Int16 aControlId, sal_Bool bEnable )
- throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
+ throw( ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL setLabel( sal_Int16 aControlId, const ::rtl::OUString& aLabel )
- throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getLabel( sal_Int16 aControlId )
- throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ throw ( ::com::sun::star::uno::RuntimeException);
//------------------------------------------------
// XFilePreview