diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-09 08:52:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-21 08:42:30 +0200 |
commit | 528632660b72b105345945c13c5b68060d94a91b (patch) | |
tree | 860508d482959abeb9175f0ce6b9e65954269f95 /include | |
parent | aee66aa85e75f67135e5c6079a281e18402d261a (diff) |
convert ErrCode to strong typedef
would have preferred to re-use o3tl::strong_int, of which this
is a modified copy, but there are lots of convenience accessors
which are nice to define on the class.
Change-Id: I301b807aaf02fbced3bf75de1e1692cde6c0340a
Reviewed-on: https://gerrit.libreoffice.org/38497
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
28 files changed, 474 insertions, 439 deletions
diff --git a/include/basic/basmgr.hxx b/include/basic/basmgr.hxx index 97ebcdddc056..4dfc8833669b 100644 --- a/include/basic/basmgr.hxx +++ b/include/basic/basmgr.hxx @@ -48,14 +48,14 @@ enum class BasicErrorReason class BASIC_DLLPUBLIC BasicError { private: - sal_uInt64 nErrorId; + ErrCode nErrorId; BasicErrorReason nReason; public: BasicError( const BasicError& rErr ); - BasicError( sal_uInt64 nId, BasicErrorReason nR ); + BasicError( ErrCode nId, BasicErrorReason nR ); - sal_uInt64 GetErrorId() const { return nErrorId; } + ErrCode GetErrorId() const { return nErrorId; } }; class ErrorManager; diff --git a/include/basic/sberrors.hxx b/include/basic/sberrors.hxx index 95ccfa1c6cc3..a3a10da70f65 100644 --- a/include/basic/sberrors.hxx +++ b/include/basic/sberrors.hxx @@ -54,227 +54,227 @@ #define ERRCODE_BASIC_NOT_A_COLL ERRCODE_SBX_NOT_A_COLL // Object not a collection // Append Basic specific error messages to ERRCODE_AREA_SBX -#define ERRCODE_BASIC_NO_GOSUB ((LAST_SBX_ERROR_ID+1UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_NO_GOSUB ErrCode((LAST_SBX_ERROR_ID+1UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Return without Gosub -#define ERRCODE_BASIC_REDO_FROM_START ((LAST_SBX_ERROR_ID+2UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_REDO_FROM_START ErrCode((LAST_SBX_ERROR_ID+2UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Redo form start (SB internal) -#define ERRCODE_BASIC_NO_MEMORY ((LAST_SBX_ERROR_ID+3UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_NO_MEMORY ErrCode((LAST_SBX_ERROR_ID+3UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Out of memory -#define ERRCODE_BASIC_ALREADY_DIM ((LAST_SBX_ERROR_ID+4UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_ALREADY_DIM ErrCode((LAST_SBX_ERROR_ID+4UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Array already dimensioned -#define ERRCODE_BASIC_DUPLICATE_DEF ((LAST_SBX_ERROR_ID+5UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DUPLICATE_DEF ErrCode((LAST_SBX_ERROR_ID+5UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Duplicate definition -#define ERRCODE_BASIC_VAR_UNDEFINED ((LAST_SBX_ERROR_ID+6UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_VAR_UNDEFINED ErrCode((LAST_SBX_ERROR_ID+6UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Variable undefined (SB) -#define ERRCODE_BASIC_USER_ABORT ((LAST_SBX_ERROR_ID+7UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_USER_ABORT ErrCode((LAST_SBX_ERROR_ID+7UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // User interrupt occurred -#define ERRCODE_BASIC_BAD_RESUME ((LAST_SBX_ERROR_ID+8UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_BAD_RESUME ErrCode((LAST_SBX_ERROR_ID+8UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Resume without error -#define ERRCODE_BASIC_STACK_OVERFLOW ((LAST_SBX_ERROR_ID+9UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_STACK_OVERFLOW ErrCode((LAST_SBX_ERROR_ID+9UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Out of stack space -#define ERRCODE_BASIC_BAD_DLL_LOAD ((LAST_SBX_ERROR_ID+10UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_BAD_DLL_LOAD ErrCode((LAST_SBX_ERROR_ID+10UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Error in loading DLL -#define ERRCODE_BASIC_BAD_DLL_CALL ((LAST_SBX_ERROR_ID+11UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_BAD_DLL_CALL ErrCode((LAST_SBX_ERROR_ID+11UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Bad DLL calling convention -#define ERRCODE_BASIC_BAD_CHANNEL ((LAST_SBX_ERROR_ID+12UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_BAD_CHANNEL ErrCode((LAST_SBX_ERROR_ID+12UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Bad file name or number -#define ERRCODE_BASIC_FILE_NOT_FOUND ((LAST_SBX_ERROR_ID+13UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_FILE_NOT_FOUND ErrCode((LAST_SBX_ERROR_ID+13UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // File not found -#define ERRCODE_BASIC_BAD_FILE_MODE ((LAST_SBX_ERROR_ID+14UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_BAD_FILE_MODE ErrCode((LAST_SBX_ERROR_ID+14UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Bad file mode -#define ERRCODE_BASIC_FILE_ALREADY_OPEN ((LAST_SBX_ERROR_ID+15UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_FILE_ALREADY_OPEN ErrCode((LAST_SBX_ERROR_ID+15UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // File already open -#define ERRCODE_BASIC_IO_ERROR ((LAST_SBX_ERROR_ID+16UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_IO_ERROR ErrCode((LAST_SBX_ERROR_ID+16UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Device I/O error -#define ERRCODE_BASIC_FILE_EXISTS ((LAST_SBX_ERROR_ID+17UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_FILE_EXISTS ErrCode((LAST_SBX_ERROR_ID+17UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // File already exists -#define ERRCODE_BASIC_BAD_RECORD_LENGTH ((LAST_SBX_ERROR_ID+18UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_BAD_RECORD_LENGTH ErrCode((LAST_SBX_ERROR_ID+18UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // bad record length -#define ERRCODE_BASIC_DISK_FULL ((LAST_SBX_ERROR_ID+19UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DISK_FULL ErrCode((LAST_SBX_ERROR_ID+19UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // disk full -#define ERRCODE_BASIC_READ_PAST_EOF ((LAST_SBX_ERROR_ID+20UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_READ_PAST_EOF ErrCode((LAST_SBX_ERROR_ID+20UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Input past end of file -#define ERRCODE_BASIC_BAD_RECORD_NUMBER ((LAST_SBX_ERROR_ID+21UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_BAD_RECORD_NUMBER ErrCode((LAST_SBX_ERROR_ID+21UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Bad record number -#define ERRCODE_BASIC_TOO_MANY_FILES ((LAST_SBX_ERROR_ID+22UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_TOO_MANY_FILES ErrCode((LAST_SBX_ERROR_ID+22UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Too many files -#define ERRCODE_BASIC_NO_DEVICE ((LAST_SBX_ERROR_ID+23UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_NO_DEVICE ErrCode((LAST_SBX_ERROR_ID+23UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Device not available -#define ERRCODE_BASIC_ACCESS_DENIED ((LAST_SBX_ERROR_ID+24UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_ACCESS_DENIED ErrCode((LAST_SBX_ERROR_ID+24UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Permission denied -#define ERRCODE_BASIC_NOT_READY ((LAST_SBX_ERROR_ID+25UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_NOT_READY ErrCode((LAST_SBX_ERROR_ID+25UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Disk not ready -#define ERRCODE_BASIC_NOT_IMPLEMENTED ((LAST_SBX_ERROR_ID+26UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_NOT_IMPLEMENTED ErrCode((LAST_SBX_ERROR_ID+26UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Feature not implemented -#define ERRCODE_BASIC_DIFFERENT_DRIVE ((LAST_SBX_ERROR_ID+27UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DIFFERENT_DRIVE ErrCode((LAST_SBX_ERROR_ID+27UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // No rename with different drive -#define ERRCODE_BASIC_ACCESS_ERROR ((LAST_SBX_ERROR_ID+28UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_ACCESS_ERROR ErrCode((LAST_SBX_ERROR_ID+28UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Path/File access error -#define ERRCODE_BASIC_PATH_NOT_FOUND ((LAST_SBX_ERROR_ID+29UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_PATH_NOT_FOUND ErrCode((LAST_SBX_ERROR_ID+29UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Path not found -#define ERRCODE_BASIC_BAD_PATTERN ((LAST_SBX_ERROR_ID+30UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_BAD_PATTERN ErrCode((LAST_SBX_ERROR_ID+30UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Invalid pattern string -#define ERRCODE_BASIC_IS_NULL ((LAST_SBX_ERROR_ID+31UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_IS_NULL ErrCode((LAST_SBX_ERROR_ID+31UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Invalid use of Null // DDE messages from 250-299 -#define ERRCODE_BASIC_DDE_ERROR ((LAST_SBX_ERROR_ID+32UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DDE_ERROR ErrCode((LAST_SBX_ERROR_ID+32UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) -#define ERRCODE_BASIC_DDE_WAITINGACK ((LAST_SBX_ERROR_ID+33UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DDE_WAITINGACK ErrCode((LAST_SBX_ERROR_ID+33UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) -#define ERRCODE_BASIC_DDE_OUTOFCHANNELS ((LAST_SBX_ERROR_ID+34UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DDE_OUTOFCHANNELS ErrCode((LAST_SBX_ERROR_ID+34UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) -#define ERRCODE_BASIC_DDE_NO_RESPONSE ((LAST_SBX_ERROR_ID+35UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DDE_NO_RESPONSE ErrCode((LAST_SBX_ERROR_ID+35UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) -#define ERRCODE_BASIC_DDE_MULT_RESPONSES ((LAST_SBX_ERROR_ID+36UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DDE_MULT_RESPONSES ErrCode((LAST_SBX_ERROR_ID+36UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) -#define ERRCODE_BASIC_DDE_CHANNEL_LOCKED ((LAST_SBX_ERROR_ID+37UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DDE_CHANNEL_LOCKED ErrCode((LAST_SBX_ERROR_ID+37UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) -#define ERRCODE_BASIC_DDE_NOTPROCESSED ((LAST_SBX_ERROR_ID+38UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DDE_NOTPROCESSED ErrCode((LAST_SBX_ERROR_ID+38UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) -#define ERRCODE_BASIC_DDE_TIMEOUT ((LAST_SBX_ERROR_ID+39UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DDE_TIMEOUT ErrCode((LAST_SBX_ERROR_ID+39UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) -#define ERRCODE_BASIC_DDE_USER_INTERRUPT ((LAST_SBX_ERROR_ID+40UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DDE_USER_INTERRUPT ErrCode((LAST_SBX_ERROR_ID+40UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) -#define ERRCODE_BASIC_DDE_BUSY ((LAST_SBX_ERROR_ID+41UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DDE_BUSY ErrCode((LAST_SBX_ERROR_ID+41UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) -#define ERRCODE_BASIC_DDE_NO_DATA ((LAST_SBX_ERROR_ID+42UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DDE_NO_DATA ErrCode((LAST_SBX_ERROR_ID+42UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) -#define ERRCODE_BASIC_DDE_WRONG_DATA_FORMAT ((LAST_SBX_ERROR_ID+43UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DDE_WRONG_DATA_FORMAT ErrCode((LAST_SBX_ERROR_ID+43UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) -#define ERRCODE_BASIC_DDE_PARTNER_QUIT ((LAST_SBX_ERROR_ID+44UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DDE_PARTNER_QUIT ErrCode((LAST_SBX_ERROR_ID+44UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) -#define ERRCODE_BASIC_DDE_CONV_CLOSED ((LAST_SBX_ERROR_ID+45UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DDE_CONV_CLOSED ErrCode((LAST_SBX_ERROR_ID+45UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) -#define ERRCODE_BASIC_DDE_NO_CHANNEL ((LAST_SBX_ERROR_ID+46UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DDE_NO_CHANNEL ErrCode((LAST_SBX_ERROR_ID+46UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) -#define ERRCODE_BASIC_DDE_INVALID_LINK ((LAST_SBX_ERROR_ID+47UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DDE_INVALID_LINK ErrCode((LAST_SBX_ERROR_ID+47UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) -#define ERRCODE_BASIC_DDE_QUEUE_OVERFLOW ((LAST_SBX_ERROR_ID+48UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DDE_QUEUE_OVERFLOW ErrCode((LAST_SBX_ERROR_ID+48UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) -#define ERRCODE_BASIC_DDE_LINK_ALREADY_EST ((LAST_SBX_ERROR_ID+49UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DDE_LINK_ALREADY_EST ErrCode((LAST_SBX_ERROR_ID+49UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) -#define ERRCODE_BASIC_DDE_LINK_INV_TOPIC ((LAST_SBX_ERROR_ID+50UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DDE_LINK_INV_TOPIC ErrCode((LAST_SBX_ERROR_ID+50UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) -#define ERRCODE_BASIC_DDE_DLL_NOT_FOUND ((LAST_SBX_ERROR_ID+51UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DDE_DLL_NOT_FOUND ErrCode((LAST_SBX_ERROR_ID+51UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) -#define ERRCODE_BASIC_NEEDS_OBJECT ((LAST_SBX_ERROR_ID+52UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_NEEDS_OBJECT ErrCode((LAST_SBX_ERROR_ID+52UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Object required -#define ERRCODE_BASIC_BAD_ORDINAL ((LAST_SBX_ERROR_ID+53UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_BAD_ORDINAL ErrCode((LAST_SBX_ERROR_ID+53UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Invalid ordinal -#define ERRCODE_BASIC_DLLPROC_NOT_FOUND ((LAST_SBX_ERROR_ID+54UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_DLLPROC_NOT_FOUND ErrCode((LAST_SBX_ERROR_ID+54UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Specified DLL function not found -#define ERRCODE_BASIC_BAD_CLIPBD_FORMAT ((LAST_SBX_ERROR_ID+55UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_BAD_CLIPBD_FORMAT ErrCode((LAST_SBX_ERROR_ID+55UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Invalid clipboard format // Debugger messages from 700-799 -#define ERRCODE_BASIC_PROPERTY_NOT_FOUND ((LAST_SBX_ERROR_ID+56UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_PROPERTY_NOT_FOUND ErrCode((LAST_SBX_ERROR_ID+56UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Class not have property -#define ERRCODE_BASIC_METHOD_NOT_FOUND ((LAST_SBX_ERROR_ID+57UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_METHOD_NOT_FOUND ErrCode((LAST_SBX_ERROR_ID+57UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Class does not have method -#define ERRCODE_BASIC_ARG_MISSING ((LAST_SBX_ERROR_ID+58UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_ARG_MISSING ErrCode((LAST_SBX_ERROR_ID+58UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Missing required argument -#define ERRCODE_BASIC_BAD_NUMBER_OF_ARGS ((LAST_SBX_ERROR_ID+59UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_BAD_NUMBER_OF_ARGS ErrCode((LAST_SBX_ERROR_ID+59UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Bad number of arguments -#define ERRCODE_BASIC_METHOD_FAILED ((LAST_SBX_ERROR_ID+60UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_METHOD_FAILED ErrCode((LAST_SBX_ERROR_ID+60UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Method failed -#define ERRCODE_BASIC_SETPROP_FAILED ((LAST_SBX_ERROR_ID+61UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_SETPROP_FAILED ErrCode((LAST_SBX_ERROR_ID+61UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Unable to set property -#define ERRCODE_BASIC_GETPROP_FAILED ((LAST_SBX_ERROR_ID+62UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_GETPROP_FAILED ErrCode((LAST_SBX_ERROR_ID+62UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) // Unable to get property // Compiler Errors (do not occur at runtime) // These IDs can shift at any time -#define ERRCODE_BASIC_UNEXPECTED ((LAST_SBX_ERROR_ID+63UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_UNEXPECTED ErrCode((LAST_SBX_ERROR_ID+63UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Unexpected symbol: xx -#define ERRCODE_BASIC_EXPECTED ((LAST_SBX_ERROR_ID+64UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_EXPECTED ErrCode((LAST_SBX_ERROR_ID+64UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Expected: xx -#define ERRCODE_BASIC_SYMBOL_EXPECTED ((LAST_SBX_ERROR_ID+65UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_SYMBOL_EXPECTED ErrCode((LAST_SBX_ERROR_ID+65UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Symbol expected -#define ERRCODE_BASIC_VAR_EXPECTED ((LAST_SBX_ERROR_ID+66UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_VAR_EXPECTED ErrCode((LAST_SBX_ERROR_ID+66UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Variable expected -#define ERRCODE_BASIC_LABEL_EXPECTED ((LAST_SBX_ERROR_ID+67UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_LABEL_EXPECTED ErrCode((LAST_SBX_ERROR_ID+67UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Label expected -#define ERRCODE_BASIC_LVALUE_EXPECTED ((LAST_SBX_ERROR_ID+68UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_LVALUE_EXPECTED ErrCode((LAST_SBX_ERROR_ID+68UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Lvalue expected -#define ERRCODE_BASIC_VAR_DEFINED ((LAST_SBX_ERROR_ID+69UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_VAR_DEFINED ErrCode((LAST_SBX_ERROR_ID+69UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Variable xxx already defined -#define ERRCODE_BASIC_PROC_DEFINED ((LAST_SBX_ERROR_ID+70UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_PROC_DEFINED ErrCode((LAST_SBX_ERROR_ID+70UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Procedure xx already defined -#define ERRCODE_BASIC_LABEL_DEFINED ((LAST_SBX_ERROR_ID+71UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_LABEL_DEFINED ErrCode((LAST_SBX_ERROR_ID+71UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Label xxx already defined -#define ERRCODE_BASIC_UNDEF_VAR ((LAST_SBX_ERROR_ID+72UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_UNDEF_VAR ErrCode((LAST_SBX_ERROR_ID+72UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Variable xx undefined -#define ERRCODE_BASIC_UNDEF_ARRAY ((LAST_SBX_ERROR_ID+73UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_UNDEF_ARRAY ErrCode((LAST_SBX_ERROR_ID+73UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Array or function xx undefined -#define ERRCODE_BASIC_UNDEF_PROC ((LAST_SBX_ERROR_ID+74UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_UNDEF_PROC ErrCode((LAST_SBX_ERROR_ID+74UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Procedure xxx undefined -#define ERRCODE_BASIC_UNDEF_LABEL ((LAST_SBX_ERROR_ID+75UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_UNDEF_LABEL ErrCode((LAST_SBX_ERROR_ID+75UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Label xxx undefined -#define ERRCODE_BASIC_UNDEF_TYPE ((LAST_SBX_ERROR_ID+76UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_UNDEF_TYPE ErrCode((LAST_SBX_ERROR_ID+76UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Unknown user defined type xxx -#define ERRCODE_BASIC_BAD_EXIT ((LAST_SBX_ERROR_ID+77UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_BAD_EXIT ErrCode((LAST_SBX_ERROR_ID+77UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Exit XXX expected -#define ERRCODE_BASIC_BAD_BLOCK ((LAST_SBX_ERROR_ID+78UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_BAD_BLOCK ErrCode((LAST_SBX_ERROR_ID+78UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Unterminated statement block: missing XX -#define ERRCODE_BASIC_BAD_BRACKETS ((LAST_SBX_ERROR_ID+79UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_BAD_BRACKETS ErrCode((LAST_SBX_ERROR_ID+79UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Parentheses do not match -#define ERRCODE_BASIC_BAD_DECLARATION ((LAST_SBX_ERROR_ID+80UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_BAD_DECLARATION ErrCode((LAST_SBX_ERROR_ID+80UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Symbol xx defined differently -#define ERRCODE_BASIC_BAD_PARAMETERS ((LAST_SBX_ERROR_ID+81UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_BAD_PARAMETERS ErrCode((LAST_SBX_ERROR_ID+81UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Parameters do not match -#define ERRCODE_BASIC_BAD_CHAR_IN_NUMBER ((LAST_SBX_ERROR_ID+82UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_BAD_CHAR_IN_NUMBER ErrCode((LAST_SBX_ERROR_ID+82UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Bad character in number -#define ERRCODE_BASIC_MUST_HAVE_DIMS ((LAST_SBX_ERROR_ID+83UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_MUST_HAVE_DIMS ErrCode((LAST_SBX_ERROR_ID+83UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Array needs dimensioning -#define ERRCODE_BASIC_NO_IF ((LAST_SBX_ERROR_ID+84UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_NO_IF ErrCode((LAST_SBX_ERROR_ID+84UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Else/Endif without If -#define ERRCODE_BASIC_NOT_IN_SUBR ((LAST_SBX_ERROR_ID+85UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_NOT_IN_SUBR ErrCode((LAST_SBX_ERROR_ID+85UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // xxx not allowed within a sub -#define ERRCODE_BASIC_NOT_IN_MAIN ((LAST_SBX_ERROR_ID+86UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_NOT_IN_MAIN ErrCode((LAST_SBX_ERROR_ID+86UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // xxx not allowed outside a sub -#define ERRCODE_BASIC_WRONG_DIMS ((LAST_SBX_ERROR_ID+87UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_WRONG_DIMS ErrCode((LAST_SBX_ERROR_ID+87UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Dimensions do not match -#define ERRCODE_BASIC_BAD_OPTION ((LAST_SBX_ERROR_ID+88UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_BAD_OPTION ErrCode((LAST_SBX_ERROR_ID+88UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Unknown option: xxx -#define ERRCODE_BASIC_CONSTANT_REDECLARED ((LAST_SBX_ERROR_ID+89UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_CONSTANT_REDECLARED ErrCode((LAST_SBX_ERROR_ID+89UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Constant xx redeclared -#define ERRCODE_BASIC_PROG_TOO_LARGE ((LAST_SBX_ERROR_ID+90UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_PROG_TOO_LARGE ErrCode((LAST_SBX_ERROR_ID+90UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Program is too large -#define ERRCODE_BASIC_NO_STRINGS_ARRAYS ((LAST_SBX_ERROR_ID+91UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_NO_STRINGS_ARRAYS ErrCode((LAST_SBX_ERROR_ID+91UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) -#define ERRCODE_BASIC_EXCEPTION ((LAST_SBX_ERROR_ID+92UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_EXCEPTION ErrCode((LAST_SBX_ERROR_ID+92UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_RUNTIME) -#define ERRCODE_BASMGR_STDLIBOPEN (LAST_SBX_ERROR_ID+93UL) | ERRCODE_AREA_SBX -#define ERRCODE_BASMGR_STDLIBSAVE (LAST_SBX_ERROR_ID+94UL) | ERRCODE_AREA_SBX -#define ERRCODE_BASMGR_LIBLOAD (LAST_SBX_ERROR_ID+95UL) | ERRCODE_AREA_SBX -#define ERRCODE_BASMGR_LIBCREATE (LAST_SBX_ERROR_ID+96UL) | ERRCODE_AREA_SBX -#define ERRCODE_BASMGR_LIBSAVE (LAST_SBX_ERROR_ID+97UL) | ERRCODE_AREA_SBX -#define ERRCODE_BASMGR_LIBDEL (LAST_SBX_ERROR_ID+98UL) | ERRCODE_AREA_SBX -#define ERRCODE_BASMGR_MGROPEN (LAST_SBX_ERROR_ID+99UL) | ERRCODE_AREA_SBX -#define ERRCODE_BASMGR_MGRSAVE (LAST_SBX_ERROR_ID+100UL) | ERRCODE_AREA_SBX -#define ERRCODE_BASMGR_REMOVELIB (LAST_SBX_ERROR_ID+101UL) | ERRCODE_AREA_SBX -#define ERRCODE_BASMGR_UNLOADLIB (LAST_SBX_ERROR_ID+102UL) | ERRCODE_AREA_SBX +#define ERRCODE_BASMGR_STDLIBOPEN ErrCode((LAST_SBX_ERROR_ID+93UL) | ERRCODE_AREA_SBX) +#define ERRCODE_BASMGR_STDLIBSAVE ErrCode((LAST_SBX_ERROR_ID+94UL) | ERRCODE_AREA_SBX) +#define ERRCODE_BASMGR_LIBLOAD ErrCode((LAST_SBX_ERROR_ID+95UL) | ERRCODE_AREA_SBX) +#define ERRCODE_BASMGR_LIBCREATE ErrCode((LAST_SBX_ERROR_ID+96UL) | ERRCODE_AREA_SBX) +#define ERRCODE_BASMGR_LIBSAVE ErrCode((LAST_SBX_ERROR_ID+97UL) | ERRCODE_AREA_SBX) +#define ERRCODE_BASMGR_LIBDEL ErrCode((LAST_SBX_ERROR_ID+98UL) | ERRCODE_AREA_SBX) +#define ERRCODE_BASMGR_MGROPEN ErrCode((LAST_SBX_ERROR_ID+99UL) | ERRCODE_AREA_SBX) +#define ERRCODE_BASMGR_MGRSAVE ErrCode((LAST_SBX_ERROR_ID+100UL) | ERRCODE_AREA_SBX) +#define ERRCODE_BASMGR_REMOVELIB ErrCode((LAST_SBX_ERROR_ID+101UL) | ERRCODE_AREA_SBX) +#define ERRCODE_BASMGR_UNLOADLIB ErrCode((LAST_SBX_ERROR_ID+102UL) | ERRCODE_AREA_SBX) -#define ERRCODE_BASIC_ARRAY_FIX ((LAST_SBX_ERROR_ID+104UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_ARRAY_FIX ErrCode((LAST_SBX_ERROR_ID+104UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // This array is fixed -#define ERRCODE_BASIC_STRING_OVERFLOW ((LAST_SBX_ERROR_ID+105UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_STRING_OVERFLOW ErrCode((LAST_SBX_ERROR_ID+105UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Out of string space -#define ERRCODE_BASIC_EXPR_TOO_COMPLEX ((LAST_SBX_ERROR_ID+106UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_EXPR_TOO_COMPLEX ErrCode((LAST_SBX_ERROR_ID+106UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Expression too complex -#define ERRCODE_BASIC_OPER_NOT_PERFORM ((LAST_SBX_ERROR_ID+107UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_OPER_NOT_PERFORM ErrCode((LAST_SBX_ERROR_ID+107UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Can't perform requested operation -#define ERRCODE_BASIC_TOO_MANY_DLL ((LAST_SBX_ERROR_ID+108UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_TOO_MANY_DLL ErrCode((LAST_SBX_ERROR_ID+108UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // Too many dll application clients -#define ERRCODE_BASIC_LOOP_NOT_INIT ((LAST_SBX_ERROR_ID+109UL) | ERRCODE_AREA_SBX | \ +#define ERRCODE_BASIC_LOOP_NOT_INIT ErrCode((LAST_SBX_ERROR_ID+109UL) | ERRCODE_AREA_SBX | \ ERRCODE_CLASS_COMPILER) // For loop not initialized -#define ERRCODE_BASIC_COMPAT ((LAST_SBX_ERROR_ID+103UL)| ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) +#define ERRCODE_BASIC_COMPAT ErrCode((LAST_SBX_ERROR_ID+103UL)| ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Grid messages from 30000-30999 // OLE messages from 31000-31999 diff --git a/include/basic/sbxdef.hxx b/include/basic/sbxdef.hxx index 973a472640fa..e524f7e225c6 100644 --- a/include/basic/sbxdef.hxx +++ b/include/basic/sbxdef.hxx @@ -130,35 +130,35 @@ enum class SbxNameType { // Type of the questioned name of a variable // New error codes per define #define ERRCODE_SBX_OK ERRCODE_NONE // processed -#define ERRCODE_SBX_SYNTAX (1UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_COMPILER) -#define ERRCODE_SBX_NOTIMP (2UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_NOTSUPPORTED) -#define ERRCODE_SBX_OVERFLOW (3UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_SBX) // overflow -#define ERRCODE_SBX_BOUNDS (4UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_SBX) // Invalid array index -#define ERRCODE_SBX_ZERODIV (5UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_SBX) // Division by zero -#define ERRCODE_SBX_CONVERSION (6UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_SBX) // wrong data type -#define ERRCODE_SBX_BAD_PARAMETER (7UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // invalid Parameter -#define ERRCODE_SBX_PROC_UNDEFINED (8UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Sub or Func not def -#define ERRCODE_SBX_ERROR (9UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_UNKNOWN) // generic object error -#define ERRCODE_SBX_NO_OBJECT (10UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Object var not object -#define ERRCODE_SBX_CANNOT_LOAD (11UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_CREATE) // Object init/load fail -#define ERRCODE_SBX_BAD_INDEX (12UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_SBX) // Invalid object index -#define ERRCODE_SBX_NO_ACTIVE_OBJECT (13UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_ACCESS) // Object not active -#define ERRCODE_SBX_BAD_PROP_VALUE (14UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Bad property value -#define ERRCODE_SBX_PROP_READONLY (15UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_READ) // Property is read only -#define ERRCODE_SBX_PROP_WRITEONLY (16UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_WRITE) // Property is write only -#define ERRCODE_SBX_INVALID_OBJECT (17UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_ACCESS) // Invalid object reference -#define ERRCODE_SBX_NO_METHOD (18UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Property or Method unknown -#define ERRCODE_SBX_INVALID_USAGE_OBJECT (19UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_ACCESS) // Invalid object usage -#define ERRCODE_SBX_NO_OLE (20UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_ACCESS) // No OLE-Object -#define ERRCODE_SBX_BAD_METHOD (21UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Method not supported -#define ERRCODE_SBX_OLE_ERROR (22UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // OLE Automation Error -#define ERRCODE_SBX_BAD_ACTION (23UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_NOTSUPPORTED) // Action not supported -#define ERRCODE_SBX_NO_NAMED_ARGS (24UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // No named arguments -#define ERRCODE_SBX_BAD_LOCALE (25UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_NOTSUPPORTED) // Locale not supported -#define ERRCODE_SBX_NAMED_NOT_FOUND (26UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Unknown named argument -#define ERRCODE_SBX_NOT_OPTIONAL (27UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Argument not optional -#define ERRCODE_SBX_WRONG_ARGS (28UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_SBX) // Invalid number of arguments -#define ERRCODE_SBX_NOT_A_COLL (29UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Object contains no elements +#define ERRCODE_SBX_SYNTAX ErrCode(1UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_COMPILER) +#define ERRCODE_SBX_NOTIMP ErrCode(2UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_NOTSUPPORTED) +#define ERRCODE_SBX_OVERFLOW ErrCode(3UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_SBX) // overflow +#define ERRCODE_SBX_BOUNDS ErrCode(4UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_SBX) // Invalid array index +#define ERRCODE_SBX_ZERODIV ErrCode(5UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_SBX) // Division by zero +#define ERRCODE_SBX_CONVERSION ErrCode(6UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_SBX) // wrong data type +#define ERRCODE_SBX_BAD_PARAMETER ErrCode(7UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // invalid Parameter +#define ERRCODE_SBX_PROC_UNDEFINED ErrCode(8UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Sub or Func not def +#define ERRCODE_SBX_ERROR ErrCode(9UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_UNKNOWN) // generic object error +#define ERRCODE_SBX_NO_OBJECT ErrCode(10UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Object var not object +#define ERRCODE_SBX_CANNOT_LOAD ErrCode(11UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_CREATE) // Object init/load fail +#define ERRCODE_SBX_BAD_INDEX ErrCode(12UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_SBX) // Invalid object index +#define ERRCODE_SBX_NO_ACTIVE_OBJECT ErrCode(13UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_ACCESS) // Object not active +#define ERRCODE_SBX_BAD_PROP_VALUE ErrCode(14UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Bad property value +#define ERRCODE_SBX_PROP_READONLY ErrCode(15UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_READ) // Property is read only +#define ERRCODE_SBX_PROP_WRITEONLY ErrCode(16UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_WRITE) // Property is write only +#define ERRCODE_SBX_INVALID_OBJECT ErrCode(17UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_ACCESS) // Invalid object reference +#define ERRCODE_SBX_NO_METHOD ErrCode(18UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Property or Method unknown +#define ERRCODE_SBX_INVALID_USAGE_OBJECT ErrCode(19UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_ACCESS) // Invalid object usage +#define ERRCODE_SBX_NO_OLE ErrCode(20UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_ACCESS) // No OLE-Object +#define ERRCODE_SBX_BAD_METHOD ErrCode(21UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Method not supported +#define ERRCODE_SBX_OLE_ERROR ErrCode(22UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // OLE Automation Error +#define ERRCODE_SBX_BAD_ACTION ErrCode(23UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_NOTSUPPORTED) // Action not supported +#define ERRCODE_SBX_NO_NAMED_ARGS ErrCode(24UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // No named arguments +#define ERRCODE_SBX_BAD_LOCALE ErrCode(25UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_NOTSUPPORTED) // Locale not supported +#define ERRCODE_SBX_NAMED_NOT_FOUND ErrCode(26UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Unknown named argument +#define ERRCODE_SBX_NOT_OPTIONAL ErrCode(27UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Argument not optional +#define ERRCODE_SBX_WRONG_ARGS ErrCode(28UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_SBX) // Invalid number of arguments +#define ERRCODE_SBX_NOT_A_COLL ErrCode(29UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME) // Object contains no elements #define LAST_SBX_ERROR_ID 29UL #ifndef __RSC diff --git a/include/editeng/editdata.hxx b/include/editeng/editdata.hxx index 40bb2de969c4..4c493865659f 100644 --- a/include/editeng/editdata.hxx +++ b/include/editeng/editdata.hxx @@ -55,9 +55,9 @@ enum class EEAnchorMode { EDITENG_DLLPUBLIC extern const size_t EE_APPEND; // Error messages for Read / Write Method -#define EE_READWRITE_OK (ERRCODE_NONE) -#define EE_READWRITE_WRONGFORMAT (SVSTREAM_ERRBASE_USER+1) -#define EE_READWRITE_GENERALERROR (SVSTREAM_ERRBASE_USER+2) +#define EE_READWRITE_OK ERRCODE_NONE +#define EE_READWRITE_WRONGFORMAT ErrCode(SVSTREAM_ERRBASE_USER+1) +#define EE_READWRITE_GENERALERROR ErrCode(SVSTREAM_ERRBASE_USER+2) #define EDITUNDO_REMOVECHARS 100 #define EDITUNDO_CONNECTPARAS 101 diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx index ff9bed37e27c..05ccb792d5f6 100644 --- a/include/editeng/editeng.hxx +++ b/include/editeng/editeng.hxx @@ -39,6 +39,7 @@ #include <editeng/eedata.hxx> #include <o3tl/typed_flags_set.hxx> #include <svl/languageoptions.hxx> +#include <vcl/errcode.hxx> #include <functional> namespace com { namespace sun { namespace star { @@ -364,8 +365,7 @@ public: void Draw( OutputDevice* pOutDev, const tools::Rectangle& rOutRect, const Point& rStartDocPos, bool bClip ); void Draw( OutputDevice* pOutDev, const Point& rStartPos, short nOrientation = 0 ); - // sal_uInt32: Error code of the stream. - sal_uLong Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat, SvKeyValueIterator* pHTTPHeaderAttrs = nullptr ); + ErrCode Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat, SvKeyValueIterator* pHTTPHeaderAttrs = nullptr ); void Write( SvStream& rOutput, EETextFormat ); void SetStatusEventHdl( const Link<EditStatus&,void>& rLink ); diff --git a/include/editeng/editerr.hxx b/include/editeng/editerr.hxx index f020d01a4855..041e5320e547 100644 --- a/include/editeng/editerr.hxx +++ b/include/editeng/editerr.hxx @@ -21,9 +21,9 @@ #include <vcl/errcode.hxx> -#define ERRCODE_SVX_LINGU_LANGUAGENOTEXISTS (2UL | ERRCODE_AREA_SVX) +#define ERRCODE_SVX_LINGU_LANGUAGENOTEXISTS ErrCode(2UL | ERRCODE_AREA_SVX) -#define ERRCODE_SVX_GRAPHIC_WRONG_FILEFORMAT (8UL | ERRCODE_AREA_SVX | \ +#define ERRCODE_SVX_GRAPHIC_WRONG_FILEFORMAT ErrCode(8UL | ERRCODE_AREA_SVX | \ ERRCODE_CLASS_READ ) #endif diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx index 61dc4949ae63..f402730653a0 100644 --- a/include/editeng/editview.hxx +++ b/include/editeng/editview.hxx @@ -29,6 +29,7 @@ #include <tools/gen.hxx> #include <tools/link.hxx> #include <vcl/cursor.hxx> +#include <vcl/errcode.hxx> #include <editeng/editstat.hxx> #include <svl/languageoptions.hxx> #include <LibreOfficeKit/LibreOfficeKitTypes.h> @@ -187,7 +188,7 @@ public: void RemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich ); void RemoveAttribsKeepLanguages( bool bRemoveParaAttribs ); - sal_uInt32 Read( SvStream& rInput, EETextFormat eFormat, SvKeyValueIterator* pHTTPHeaderAttrs ); + ErrCode Read( SvStream& rInput, EETextFormat eFormat, SvKeyValueIterator* pHTTPHeaderAttrs ); void SetBackgroundColor( const Color& rColor ); Color GetBackgroundColor() const; diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index dd83ed03c9cd..d5f5d7e3b9bc 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -892,7 +892,7 @@ public: sal_Int32 GetLineLen( sal_Int32 nParagraph, sal_Int32 nLine ) const; sal_uLong GetLineHeight( sal_Int32 nParagraph ); - sal_uLong Read( SvStream& rInput, const OUString& rBaseURL, sal_uInt16, SvKeyValueIterator* pHTTPHeaderAttrs = nullptr ); + ErrCode Read( SvStream& rInput, const OUString& rBaseURL, sal_uInt16, SvKeyValueIterator* pHTTPHeaderAttrs = nullptr ); ::svl::IUndoManager& GetUndoManager(); ::svl::IUndoManager* SetUndoManager(::svl::IUndoManager* pNew); diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx index cba04af4a281..0b83b0561fcd 100644 --- a/include/sfx2/app.hxx +++ b/include/sfx2/app.hxx @@ -153,8 +153,8 @@ public: /** * @param pArgs Takes ownership */ - sal_uIntPtr LoadTemplate( SfxObjectShellLock& xDoc, const OUString& rFileName, SfxItemSet* pArgs ); - vcl::Window* GetTopWindow() const; + ErrCode LoadTemplate( SfxObjectShellLock& xDoc, const OUString& rFileName, SfxItemSet* pArgs ); + vcl::Window* GetTopWindow() const; // members SfxFilterMatcher& GetFilterMatcher(); diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx index 352cbac471b1..38d5f691a133 100644 --- a/include/sfx2/docfile.hxx +++ b/include/sfx2/docfile.hxx @@ -141,12 +141,12 @@ public: void Download( const Link<void*,void>& aLink = Link<void*,void>()); void SetDoneLink( const Link<void*,void>& rLink ); - sal_uInt32 GetErrorCode() const; - sal_uInt32 GetError() const - { return ERRCODE_TOERROR(GetErrorCode()); } - sal_uInt32 GetLastStorageCreationState(); + ErrCode GetErrorCode() const; + ErrCode GetError() const + { return GetErrorCode().IgnoreWarning(); } + ErrCode GetLastStorageCreationState(); - void SetError(sal_uInt32 nError); + void SetError(ErrCode nError); void CloseInStream(); bool CloseOutStream(); diff --git a/include/sfx2/docinf.hxx b/include/sfx2/docinf.hxx index 19a1075d2dd0..a1c03eb08371 100644 --- a/include/sfx2/docinf.hxx +++ b/include/sfx2/docinf.hxx @@ -22,6 +22,7 @@ #include <sal/config.h> #include <sfx2/dllapi.h> #include <sal/types.h> +#include <vcl/errcode.hxx> #include <com/sun/star/uno/Reference.hxx> @@ -42,7 +43,7 @@ namespace sfx2 { @param i_xDocProps Document meta-data @param i_pStorage OLE Storage */ -sal_uInt32 SFX2_DLLPUBLIC LoadOlePropertySet( +ErrCode SFX2_DLLPUBLIC LoadOlePropertySet( const css::uno::Reference< css::document::XDocumentProperties>& i_xDocProps, SotStorage* i_pStorage ); diff --git a/include/sfx2/fcontnr.hxx b/include/sfx2/fcontnr.hxx index 996f8aca4f42..414e88044f5e 100644 --- a/include/sfx2/fcontnr.hxx +++ b/include/sfx2/fcontnr.hxx @@ -83,10 +83,10 @@ public: SAL_DLLPRIVATE static bool IsFilterInstalled_Impl( const std::shared_ptr<const SfxFilter>& pFilter ); DECL_DLLPRIVATE_LINK( MaybeFileHdl_Impl, OUString*, bool ); - sal_uInt32 GuessFilterIgnoringContent( SfxMedium& rMedium, std::shared_ptr<const SfxFilter>& ) const; - sal_uInt32 GuessFilter( SfxMedium& rMedium, std::shared_ptr<const SfxFilter>& , SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const; - sal_uInt32 GuessFilterControlDefaultUI( SfxMedium& rMedium, std::shared_ptr<const SfxFilter>&, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const; - sal_uInt32 DetectFilter( SfxMedium& rMedium, std::shared_ptr<const SfxFilter>& ) const; + ErrCode GuessFilterIgnoringContent( SfxMedium& rMedium, std::shared_ptr<const SfxFilter>& ) const; + ErrCode GuessFilter( SfxMedium& rMedium, std::shared_ptr<const SfxFilter>& , SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const; + ErrCode GuessFilterControlDefaultUI( SfxMedium& rMedium, std::shared_ptr<const SfxFilter>&, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const; + ErrCode DetectFilter( SfxMedium& rMedium, std::shared_ptr<const SfxFilter>& ) const; std::shared_ptr<const SfxFilter> GetFilter4Mime( const OUString& rMime, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED) const; std::shared_ptr<const SfxFilter> GetFilter4ClipBoardId( SotClipboardFormatId nId, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const; diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index fc13b6a0b345..5b97ce138570 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -296,9 +296,9 @@ public: SAL_DLLPRIVATE void SetMacroMode_Impl(bool bModal=true); void ResetError(); - sal_uInt32 GetError() const; - sal_uInt32 GetErrorCode() const; - void SetError(sal_uInt32 rErr); + ErrCode GetError() const; + ErrCode GetErrorCode() const; + void SetError(ErrCode rErr); /** * Initialize bare minimum just enough for unit test runs. @@ -420,7 +420,7 @@ public: const css::uno::Sequence< css::beans::PropertyValue >& GetModifyPasswordInfo() const; bool SetModifyPasswordInfo( const css::uno::Sequence< css::beans::PropertyValue >& aInfo ); - static sal_uInt32 HandleFilter( SfxMedium* pMedium, SfxObjectShell* pDoc ); + static ErrCode HandleFilter( SfxMedium* pMedium, SfxObjectShell* pDoc ); virtual bool PrepareClose(bool bUI = true); virtual HiddenInformation GetHiddenInformationState( HiddenInformation nStates ); @@ -684,7 +684,7 @@ public: SAL_DLLPRIVATE static bool UseInteractionToHandleError( const css::uno::Reference< css::task::XInteractionHandler >& xHandler, - sal_uInt32 nError ); + ErrCode nError ); SAL_DLLPRIVATE const SfxObjectShell_Impl* Get_Impl() const { return pImpl.get(); } SAL_DLLPRIVATE void SetCreateMode_Impl( SfxObjectCreateMode nMode ); diff --git a/include/sfx2/opengrf.hxx b/include/sfx2/opengrf.hxx index 9533a86f9b20..542e573304cf 100644 --- a/include/sfx2/opengrf.hxx +++ b/include/sfx2/opengrf.hxx @@ -31,12 +31,12 @@ public: SvxOpenGraphicDialog ( const OUString& rTitle ); ~SvxOpenGraphicDialog (); - short Execute(); + ErrCode Execute(); void SetPath( const OUString& rPath, bool bLinkState ); OUString GetPath() const; - int GetGraphic(Graphic&) const; + ErrCode GetGraphic(Graphic&) const; void EnableLink(bool); void AsLink(bool); diff --git a/include/sfx2/sfxbasemodel.hxx b/include/sfx2/sfxbasemodel.hxx index 6620fed6f1e5..e721a77e35f4 100644 --- a/include/sfx2/sfxbasemodel.hxx +++ b/include/sfx2/sfxbasemodel.hxx @@ -730,7 +730,7 @@ private: SAL_DLLPRIVATE void loadCmisProperties(); - SAL_DLLPRIVATE SfxMedium* handleLoadError( sal_uInt32 nError, SfxMedium* pMedium ); + SAL_DLLPRIVATE SfxMedium* handleLoadError( ErrCode nError, SfxMedium* pMedium ); // private variables and methods diff --git a/include/sot/storage.hxx b/include/sot/storage.hxx index f659149d9f42..2aa3ac0131d8 100644 --- a/include/sot/storage.hxx +++ b/include/sot/storage.hxx @@ -105,7 +105,7 @@ public: return m_nVersion; } - ErrCode GetError() const { return ERRCODE_TOERROR(m_nError); } + ErrCode GetError() const { return m_nError.IgnoreWarning(); } void SetError( ErrCode nErrorCode ) { if( m_nError == ERRCODE_NONE ) diff --git a/include/svtools/ehdl.hxx b/include/svtools/ehdl.hxx index 681a22ac2872..51f78bf27506 100644 --- a/include/svtools/ehdl.hxx +++ b/include/svtools/ehdl.hxx @@ -39,7 +39,7 @@ public: SfxErrorContext( sal_uInt16 nCtxIdP, const OUString &aArg1, vcl::Window *pWin=nullptr, sal_uInt16 nResIdP=USHRT_MAX, ResMgr *pMgrP=nullptr); - bool GetString(sal_uInt32 nErrId, OUString &rStr) override; + bool GetString(ErrCode nErrId, OUString &rStr) override; private: sal_uInt16 nCtxId; @@ -51,16 +51,16 @@ private: class SVT_DLLPUBLIC SfxErrorHandler : private ErrorHandler { public: - SfxErrorHandler(sal_uInt16 nId, sal_uLong lStart, sal_uLong lEnd, ResMgr *pMgr=nullptr); + SfxErrorHandler(sal_uInt16 nId, ErrCode lStart, ErrCode lEnd, ResMgr *pMgr=nullptr); virtual ~SfxErrorHandler() override; protected: - bool GetErrorString(sal_uLong lErrId, OUString &) const; + bool GetErrorString(ErrCode lErrId, OUString &) const; private: - sal_uLong lStart; - sal_uLong lEnd; + ErrCode lStart; + ErrCode lEnd; sal_uInt16 nId; ResMgr *pMgr; std::unique_ptr<ResMgr> diff --git a/include/svtools/sfxecode.hxx b/include/svtools/sfxecode.hxx index 6fde5916271a..625a50e42a5c 100644 --- a/include/svtools/sfxecode.hxx +++ b/include/svtools/sfxecode.hxx @@ -21,27 +21,27 @@ #include <vcl/errcode.hxx> -#define ERRCODE_SFX_NOTATEMPLATE (ERRCODE_AREA_SFX|ERRCODE_CLASS_FORMAT|2) -#define ERRCODE_SFX_GENERAL (ERRCODE_AREA_SFX|ERRCODE_CLASS_GENERAL|3) -#define ERRCODE_SFX_DOLOADFAILED (ERRCODE_AREA_SFX|ERRCODE_CLASS_READ|4) -#define ERRCODE_SFX_ALREADYOPEN (ERRCODE_AREA_SFX|ERRCODE_CLASS_ALREADYEXISTS|10) -#define ERRCODE_SFX_WRONGPASSWORD (ERRCODE_AREA_SFX|ERRCODE_CLASS_READ|11) -#define ERRCODE_SFX_DOCUMENTREADONLY (ERRCODE_AREA_SFX|ERRCODE_CLASS_WRITE|12) -#define ERRCODE_SFX_OLEGENERAL (ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|14) -#define ERRCODE_SFX_TEMPLATENOTFOUND (ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|15) +#define ERRCODE_SFX_NOTATEMPLATE ErrCode(ERRCODE_AREA_SFX|ERRCODE_CLASS_FORMAT|2) +#define ERRCODE_SFX_GENERAL ErrCode(ERRCODE_AREA_SFX|ERRCODE_CLASS_GENERAL|3) +#define ERRCODE_SFX_DOLOADFAILED ErrCode(ERRCODE_AREA_SFX|ERRCODE_CLASS_READ|4) +#define ERRCODE_SFX_ALREADYOPEN ErrCode(ERRCODE_AREA_SFX|ERRCODE_CLASS_ALREADYEXISTS|10) +#define ERRCODE_SFX_WRONGPASSWORD ErrCode(ERRCODE_AREA_SFX|ERRCODE_CLASS_READ|11) +#define ERRCODE_SFX_DOCUMENTREADONLY ErrCode(ERRCODE_AREA_SFX|ERRCODE_CLASS_WRITE|12) +#define ERRCODE_SFX_OLEGENERAL ErrCode(ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|14) +#define ERRCODE_SFX_TEMPLATENOTFOUND ErrCode(ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|15) -#define ERRCODE_SFX_CANTCREATECONTENT (ERRCODE_AREA_SFX|ERRCODE_CLASS_CREATE|21) -#define ERRCODE_SFX_INVALIDSYNTAX (ERRCODE_AREA_SFX|ERRCODE_CLASS_PATH|36) -#define ERRCODE_SFX_CANTCREATEFOLDER (ERRCODE_AREA_SFX|ERRCODE_CLASS_CREATE|37) -#define ERRCODE_SFX_CANTGETPASSWD (ERRCODE_AREA_SFX| ERRCODE_CLASS_READ | 42) -#define ERRCODE_SFX_NOMOREDOCUMENTSALLOWED (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 44) -#define ERRCODE_SFX_CANTCREATEBACKUP (ERRCODE_AREA_SFX | ERRCODE_CLASS_CREATE | 50) -#define ERRCODE_SFX_MACROS_SUPPORT_DISABLED (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 51) -#define ERRCODE_SFX_DOCUMENT_MACRO_DISABLED (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 52) -#define ERRCODE_SFX_SHARED_NOPASSWORDCHANGE (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 54) -#define ERRCODE_SFX_INCOMPLETE_ENCRYPTION (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 55) -#define ERRCODE_SFX_DOCUMENT_MACRO_DISABLED_MAC (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 56) -#define ERRCODE_SFX_FORMAT_ROWCOL (ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 57) +#define ERRCODE_SFX_CANTCREATECONTENT ErrCode(ERRCODE_AREA_SFX|ERRCODE_CLASS_CREATE|21) +#define ERRCODE_SFX_INVALIDSYNTAX ErrCode(ERRCODE_AREA_SFX|ERRCODE_CLASS_PATH|36) +#define ERRCODE_SFX_CANTCREATEFOLDER ErrCode(ERRCODE_AREA_SFX|ERRCODE_CLASS_CREATE|37) +#define ERRCODE_SFX_CANTGETPASSWD ErrCode(ERRCODE_AREA_SFX| ERRCODE_CLASS_READ | 42) +#define ERRCODE_SFX_NOMOREDOCUMENTSALLOWED ErrCode(ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 44) +#define ERRCODE_SFX_CANTCREATEBACKUP ErrCode(ERRCODE_AREA_SFX | ERRCODE_CLASS_CREATE | 50) +#define ERRCODE_SFX_MACROS_SUPPORT_DISABLED ErrCode(ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 51) +#define ERRCODE_SFX_DOCUMENT_MACRO_DISABLED ErrCode(ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 52) +#define ERRCODE_SFX_SHARED_NOPASSWORDCHANGE ErrCode(ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 54) +#define ERRCODE_SFX_INCOMPLETE_ENCRYPTION ErrCode(ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 55) +#define ERRCODE_SFX_DOCUMENT_MACRO_DISABLED_MAC ErrCode(ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 56) +#define ERRCODE_SFX_FORMAT_ROWCOL ErrCode(ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 57) // Various diff --git a/include/svtools/soerr.hxx b/include/svtools/soerr.hxx index 7dc3347f3598..dfc1b88f3ed8 100644 --- a/include/svtools/soerr.hxx +++ b/include/svtools/soerr.hxx @@ -24,15 +24,15 @@ // error codes #define RID_SO_ERROR_HANDLER 32000 -#define SO_ERR() (ERRCODE_AREA_SO | ERRCODE_CLASS_SO) -#define SO_WRN() (ERRCODE_AREA_SO | ERRCODE_CLASS_SO | ERRCODE_WARNING_MASK) - -#define ERRCODE_SO_GENERALERROR (SO_ERR() | 1) -#define ERRCODE_SO_FALSE (SO_WRN() | 23) -#define ERRCODE_SO_PENDING (SO_ERR() | 25) -#define ERRCODE_SO_CANNOT_DOVERB_NOW (SO_WRN() | 28) -#define ERRCODE_SO_NOVERBS (SO_ERR() | 30) -#define ERRCODE_SO_NOTIMPL (SO_ERR() | 33) +#define SO_ERR(x) ErrCode(ERRCODE_AREA_SO | ERRCODE_CLASS_SO | x) +#define SO_WRN(x) ErrCode(ERRCODE_AREA_SO | ERRCODE_CLASS_SO | ERRCODE_WARNING_MASK | x) + +#define ERRCODE_SO_GENERALERROR SO_ERR(1) +#define ERRCODE_SO_FALSE SO_WRN(23) +#define ERRCODE_SO_PENDING SO_ERR(25) +#define ERRCODE_SO_CANNOT_DOVERB_NOW SO_WRN(28) +#define ERRCODE_SO_NOVERBS SO_ERR(30) +#define ERRCODE_SO_NOTIMPL SO_ERR(33) // error contexts #define RID_SO_ERRCTX 32001 diff --git a/include/svx/svxerr.hxx b/include/svx/svxerr.hxx index f8c0ffae98c5..2c9fb5c08922 100644 --- a/include/svx/svxerr.hxx +++ b/include/svx/svxerr.hxx @@ -23,47 +23,47 @@ // define ---------------------------------------------------------------- -#define ERRCODE_SVX_LINGU_THESAURUSNOTEXISTS (1UL | ERRCODE_AREA_SVX | \ +#define ERRCODE_SVX_LINGU_THESAURUSNOTEXISTS ErrCode(1UL | ERRCODE_AREA_SVX | \ ERRCODE_CLASS_NOTEXISTS) -#define ERRCODE_SVX_LINGU_LINGUNOTEXISTS (3UL | ERRCODE_AREA_SVX | \ +#define ERRCODE_SVX_LINGU_LINGUNOTEXISTS ErrCode(3UL | ERRCODE_AREA_SVX | \ ERRCODE_CLASS_NOTEXISTS ) -#define ERRCODE_SVX_LINGU_HYPHENNOTEXISTS (4UL | ERRCODE_AREA_SVX | \ +#define ERRCODE_SVX_LINGU_HYPHENNOTEXISTS ErrCode(4UL | ERRCODE_AREA_SVX | \ ERRCODE_CLASS_NOTEXISTS ) -#define ERRCODE_SVX_LINGU_DICT_NOTREADABLE (5UL | ERRCODE_AREA_SVX | \ +#define ERRCODE_SVX_LINGU_DICT_NOTREADABLE ErrCode(5UL | ERRCODE_AREA_SVX | \ ERRCODE_CLASS_READ ) -#define ERRCODE_SVX_LINGU_DICT_NOTWRITEABLE (6UL | ERRCODE_AREA_SVX | \ +#define ERRCODE_SVX_LINGU_DICT_NOTWRITEABLE ErrCode(6UL | ERRCODE_AREA_SVX | \ ERRCODE_CLASS_WRITE ) -#define ERRCODE_SVX_GRAPHIC_NOTREADABLE (7UL | ERRCODE_AREA_SVX | \ +#define ERRCODE_SVX_GRAPHIC_NOTREADABLE ErrCode(7UL | ERRCODE_AREA_SVX | \ ERRCODE_CLASS_READ ) -#define ERRCODE_SVX_LINGU_NOLANGUAGE (9UL | ERRCODE_AREA_SVX | \ +#define ERRCODE_SVX_LINGU_NOLANGUAGE ErrCode(9UL | ERRCODE_AREA_SVX | \ ERRCODE_CLASS_NOTEXISTS ) -#define ERRCODE_SVX_FORMS_NOIOSERVICES (10UL | ERRCODE_AREA_SVX ) -#define ERRCODE_SVX_FORMS_READWRITEFAILED (11UL | ERRCODE_AREA_SVX ) +#define ERRCODE_SVX_FORMS_NOIOSERVICES ErrCode(10UL | ERRCODE_AREA_SVX ) +#define ERRCODE_SVX_FORMS_READWRITEFAILED ErrCode(11UL | ERRCODE_AREA_SVX ) -#define ERRCODE_SVX_BULLETITEM_NOBULLET (12UL | ERRCODE_AREA_SVX ) +#define ERRCODE_SVX_BULLETITEM_NOBULLET ErrCode(12UL | ERRCODE_AREA_SVX ) -#define ERRCODE_SVX_MODIFIED_VBASIC_STORAGE (13UL | ERRCODE_AREA_SVX \ +#define ERRCODE_SVX_MODIFIED_VBASIC_STORAGE ErrCode(13UL | ERRCODE_AREA_SVX \ | ERRCODE_WARNING_MASK \ | ERRCODE_CLASS_WRITE ) -#define ERRCODE_SVX_VBASIC_STORAGE_EXIST (14UL | ERRCODE_AREA_SVX \ +#define ERRCODE_SVX_VBASIC_STORAGE_EXIST ErrCode(14UL | ERRCODE_AREA_SVX \ | ERRCODE_WARNING_MASK \ | ERRCODE_CLASS_WRITE ) /** Error message: "Wrong password." */ -#define ERRCODE_SVX_WRONGPASS (15UL | ERRCODE_AREA_SVX | ERRCODE_CLASS_NONE) +#define ERRCODE_SVX_WRONGPASS ErrCode(15UL | ERRCODE_AREA_SVX | ERRCODE_CLASS_NONE) /** Error message: "Read error. Unsupported encryption method." */ -#define ERRCODE_SVX_READ_FILTER_CRYPT (16UL | ERRCODE_AREA_SVX | ERRCODE_CLASS_READ) +#define ERRCODE_SVX_READ_FILTER_CRYPT ErrCode(16UL | ERRCODE_AREA_SVX | ERRCODE_CLASS_READ) /** Error message: "Read error. Passwort encrypted Powerpoint documents..." */ -#define ERRCODE_SVX_READ_FILTER_PPOINT (17UL | ERRCODE_AREA_SVX | ERRCODE_CLASS_READ) +#define ERRCODE_SVX_READ_FILTER_PPOINT ErrCode(17UL | ERRCODE_AREA_SVX | ERRCODE_CLASS_READ) /** Error message: "Warning. Passwort protection is not supported when..." */ -#define ERRCODE_SVX_EXPORT_FILTER_CRYPT (18UL | ERRCODE_AREA_SVX | ERRCODE_CLASS_EXPORT | ERRCODE_WARNING_MASK) +#define ERRCODE_SVX_EXPORT_FILTER_CRYPT ErrCode(18UL | ERRCODE_AREA_SVX | ERRCODE_CLASS_EXPORT | ERRCODE_WARNING_MASK) // both codes will be used twice : with ERRCODE_CLASS_READ- and ERRCODE_CLASS_WRITE-bits diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx index b47d150aca29..a6c5adbea898 100644 --- a/include/tools/stream.hxx +++ b/include/tools/stream.hxx @@ -161,7 +161,7 @@ private: ///< into the derived stream (cf. PutBack) bool m_isSwap; bool m_isEof; - sal_uInt32 m_nError; + ErrCode m_nError; SvStreamEndian m_nEndian; SvStreamCompressFlags m_nCompressMode; LineEnd m_eLineDelimiter; @@ -206,10 +206,9 @@ public: SvLockBytes* GetLockBytes() const { return m_xLockBytes.get(); } - sal_uInt32 GetError() const { return ERRCODE_TOERROR(m_nError); } - sal_uInt32 GetErrorCode() const { return m_nError; } - - void SetError( sal_uInt32 nErrorCode ); + ErrCode GetError() const { return m_nError.IgnoreWarning(); } + ErrCode GetErrorCode() const { return m_nError; } + void SetError( ErrCode nErrorCode ); virtual void ResetError(); void SetEndian( SvStreamEndian SvStreamEndian ); diff --git a/include/vbahelper/vbahelper.hxx b/include/vbahelper/vbahelper.hxx index 0aa29ecd6e79..909382d01c78 100644 --- a/include/vbahelper/vbahelper.hxx +++ b/include/vbahelper/vbahelper.hxx @@ -32,6 +32,7 @@ #include <vbahelper/vbadllapi.h> #include <vcl/pointr.hxx> #include <vcl/ptrstyle.hxx> +#include <vcl/errcode.hxx> namespace com { namespace sun { namespace star { namespace awt { class XControl; } @@ -262,16 +263,16 @@ class VBAHELPER_DLLPUBLIC DebugHelper { public: /// @throws css::script::BasicErrorException - static void basicexception( const css::uno::Exception& ex, int err, const OUString& /*additionalArgument*/ ); + static void basicexception( const css::uno::Exception& ex, ErrCode err, const OUString& /*additionalArgument*/ ); /// @throws css::script::BasicErrorException - static void basicexception( int err, const OUString& additionalArgument ); + static void basicexception( ErrCode err, const OUString& additionalArgument ); /// @throws css::script::BasicErrorException static void basicexception( const css::uno::Exception& ex ); /// @throws css::script::BasicErrorException - static void runtimeexception( int err ); + static void runtimeexception( ErrCode err ); }; } // vba diff --git a/include/vcl/cvtgrf.hxx b/include/vcl/cvtgrf.hxx index a615951b5094..b4d7641a0dd8 100644 --- a/include/vcl/cvtgrf.hxx +++ b/include/vcl/cvtgrf.hxx @@ -39,8 +39,8 @@ public: GraphicConverter(); ~GraphicConverter(); - static sal_uLong Import( SvStream& rIStm, Graphic& rGraphic, ConvertDataFormat nFormat = ConvertDataFormat::Unknown ); - static sal_uLong Export( SvStream& rOStm, const Graphic& rGraphic, ConvertDataFormat nFormat ); + static ErrCode Import( SvStream& rIStm, Graphic& rGraphic, ConvertDataFormat nFormat = ConvertDataFormat::Unknown ); + static ErrCode Export( SvStream& rOStm, const Graphic& rGraphic, ConvertDataFormat nFormat ); void SetFilterHdl( const Link<ConvertData&,bool>& rLink ) { maFilterHdl = rLink; } const Link<ConvertData&,bool>& GetFilterHdl() const { return maFilterHdl; } diff --git a/include/vcl/errcode.hxx b/include/vcl/errcode.hxx index ecd7c788c0cd..1ea3b304e8c9 100644 --- a/include/vcl/errcode.hxx +++ b/include/vcl/errcode.hxx @@ -21,12 +21,13 @@ #define INCLUDED_VCL_ERRCODE_HXX #ifndef __RSC +#include <rtl/ustring.hxx> #include <tools/solar.h> -#define CAST_TO_UINT32(a) ((sal_uInt32)(a)) -#else -#define CAST_TO_UINT32(a) (a) +#include <tools/toolsdllapi.h> +#include <ostream> #endif + /* 01234567012345670123456701234567 @@ -46,65 +47,134 @@ Warning || || | Code */ -#define ERRCODE_ERROR_MASK 0x3fffffffUL -#define ERRCODE_WARNING_MASK 0x80000000UL -#define ERRCODE_RES_MASK 0x7fff - -#define ERRCODE_CLASS_SHIFT 8 -#define ERRCODE_AREA_SHIFT 13 -#define ERRCODE_DYNAMIC_SHIFT 26 - -#define ERRCODE_CLASS_MASK CAST_TO_UINT32(31UL <<ERRCODE_CLASS_SHIFT) - -#define ERRCODE_DYNAMIC_START CAST_TO_UINT32(1UL <<ERRCODE_DYNAMIC_SHIFT) -#define ERRCODE_DYNAMIC_COUNT 31UL -#define ERRCODE_DYNAMIC_MASK CAST_TO_UINT32(31UL <<ERRCODE_DYNAMIC_SHIFT) +#define ERRCODE_ERROR_MASK 0x3fffffffUL +#define ERRCODE_WARNING_MASK 0x80000000UL +#define ERRCODE_RES_MASK 0x7fff -#ifdef __RSC +#define ERRCODE_CLASS_SHIFT 8 +#define ERRCODE_AREA_SHIFT 13 +#define ERRCODE_DYNAMIC_SHIFT 26 -#define ERRCODE_TOERROR(x) \ - ((x & ERRCODE_WARNING_MASK) ? 0 : (x & ERRCODE_ERROR_MASK)) +#define ERRCODE_CLASS_MASK (31UL << ERRCODE_CLASS_SHIFT) -#else +#define ERRCODE_DYNAMIC_START ( 1UL << ERRCODE_DYNAMIC_SHIFT) +#define ERRCODE_DYNAMIC_COUNT 31UL +#define ERRCODE_DYNAMIC_MASK (31UL << ERRCODE_DYNAMIC_SHIFT) -typedef sal_uInt32 ErrCode; +/** we get included in contexts that don't have access to config_typesizes.h or C++11 */ +#ifndef __RSC -inline sal_uInt32 ERRCODE_TOERROR( ErrCode x ) +class ErrCode final +{ +public: + explicit constexpr ErrCode(sal_uInt32 value) : m_value(value) {} + constexpr ErrCode() : m_value(0) {} + + explicit operator sal_uInt32() const { return m_value; } + explicit operator bool() const { return m_value != 0; } + + bool operator<(ErrCode const & other) const { return m_value < other.m_value; } + bool operator<=(ErrCode const & other) const { return m_value <= other.m_value; } + bool operator>(ErrCode const & other) const { return m_value > other.m_value; } + bool operator>=(ErrCode const & other) const { return m_value >= other.m_value; } + bool operator==(ErrCode const & other) const { return m_value == other.m_value; } + bool operator!=(ErrCode const & other) const { return m_value != other.m_value; } + + /** convert to ERRCODE_NONE if it's a warning, else return the error */ + ErrCode IgnoreWarning() const { + return (m_value & ERRCODE_WARNING_MASK) + ? ErrCode(0UL) + : ErrCode(static_cast<sal_uInt32>(m_value & ERRCODE_ERROR_MASK)); + } + + bool IsWarning() const { + return m_value & ERRCODE_WARNING_MASK; + } + + ErrCode MakeWarning() const { + return ErrCode(m_value & ERRCODE_WARNING_MASK); + } + + bool IsError() { + return m_value && !IsWarning(); + } + + bool IsDynamic() const { + return m_value & ERRCODE_DYNAMIC_MASK; + } + + sal_uInt32 GetDynamic() const { + return (m_value & ERRCODE_DYNAMIC_MASK) >> ERRCODE_DYNAMIC_SHIFT; + } + + ErrCode StripDynamic() const { + return ErrCode(m_value & ~ERRCODE_DYNAMIC_MASK); + } + + sal_uInt16 GetRest() const { + return m_value & ERRCODE_RES_MASK; + } + + sal_uInt32 GetClass() const { + return m_value & ERRCODE_CLASS_MASK; + } + + OUString toHexString() const { + return "0x" + OUString::number(m_value, 16); + } + + bool anyOf(ErrCode v) const { + return *this == v; + } + + template<typename... Args> + bool anyOf(ErrCode first, Args... args) const { + return *this == first || anyOf(args...); + } +private: + sal_uInt32 m_value; +}; + +inline std::ostream& operator<<(std::ostream& os, const ErrCode& err) { - return ((x & ERRCODE_WARNING_MASK) ? 0 : (x & ERRCODE_ERROR_MASK)); + os << sal_uInt32(err); return os; } +#else +#define ErrCode(X) (X) #endif -#define ERRCODE_AREA_TOOLS CAST_TO_UINT32(0UL << ERRCODE_AREA_SHIFT) -#define ERRCODE_AREA_SV CAST_TO_UINT32(1UL << ERRCODE_AREA_SHIFT) -#define ERRCODE_AREA_SFX CAST_TO_UINT32(2UL << ERRCODE_AREA_SHIFT) -#define ERRCODE_AREA_INET CAST_TO_UINT32(3UL << ERRCODE_AREA_SHIFT) -#define ERRCODE_AREA_IO ERRCODE_AREA_TOOLS -#define ERRCODE_AREA_VCL CAST_TO_UINT32(4UL << ERRCODE_AREA_SHIFT) +#define ERRCODE_AREA_TOOLS (0 << ERRCODE_AREA_SHIFT) +#define ERRCODE_AREA_SV (1 << ERRCODE_AREA_SHIFT) +#define ERRCODE_AREA_SFX (2 << ERRCODE_AREA_SHIFT) +#define ERRCODE_AREA_INET (3 << ERRCODE_AREA_SHIFT) +#define ERRCODE_AREA_IO ERRCODE_AREA_TOOLS +#define ERRCODE_AREA_VCL (4 << ERRCODE_AREA_SHIFT) -#define ERRCODE_AREA_LIB1 CAST_TO_UINT32(8UL << ERRCODE_AREA_SHIFT) +#define ERRCODE_AREA_LIB1 (8 << ERRCODE_AREA_SHIFT) #define ERRCODE_AREA_SVX ERRCODE_AREA_LIB1 #define ERRCODE_AREA_SVX_END (ERRCODE_AREA_SO-1) -#define ERRCODE_AREA_SO CAST_TO_UINT32(9UL << ERRCODE_AREA_SHIFT) +#define ERRCODE_AREA_SO (9 << ERRCODE_AREA_SHIFT) #define ERRCODE_AREA_SO_END (ERRCODE_AREA_SBX-1) -#define ERRCODE_AREA_SBX CAST_TO_UINT32(10UL << ERRCODE_AREA_SHIFT) -#define ERRCODE_AREA_SBX_END CAST_TO_UINT32((11UL << ERRCODE_AREA_SHIFT) - 1) -#define ERRCODE_AREA_DB CAST_TO_UINT32(11UL << ERRCODE_AREA_SHIFT) -#define ERRCODE_AREA_DB_END CAST_TO_UINT32((12UL << ERRCODE_AREA_SHIFT) - 1) -#define ERRCODE_AREA_JAVA CAST_TO_UINT32(12UL << ERRCODE_AREA_SHIFT) -#define ERRCODE_AREA_JAVA_END CAST_TO_UINT32((13UL << ERRCODE_AREA_SHIFT) - 1) -#define ERRCODE_AREA_UUI CAST_TO_UINT32(13UL << ERRCODE_AREA_SHIFT) -#define ERRCODE_AREA_UUI_END CAST_TO_UINT32((14UL << ERRCODE_AREA_SHIFT) - 1) -#define ERRCODE_AREA_LIB2 CAST_TO_UINT32(14UL << ERRCODE_AREA_SHIFT) -#define ERRCODE_AREA_LIB2_END CAST_TO_UINT32((15UL << ERRCODE_AREA_SHIFT) - 1) - -#define ERRCODE_AREA_APP1 CAST_TO_UINT32(32UL << ERRCODE_AREA_SHIFT) -#define ERRCODE_AREA_APP2 CAST_TO_UINT32(40UL << ERRCODE_AREA_SHIFT) -#define ERRCODE_AREA_APP3 CAST_TO_UINT32(48UL << ERRCODE_AREA_SHIFT) -#define ERRCODE_AREA_APP4 CAST_TO_UINT32(56UL << ERRCODE_AREA_SHIFT) -#define ERRCODE_AREA_APP5 CAST_TO_UINT32(64UL << ERRCODE_AREA_SHIFT) -#define ERRCODE_AREA_APP6 CAST_TO_UINT32(72UL << ERRCODE_AREA_SHIFT) +#define ERRCODE_AREA_SBX (10 << ERRCODE_AREA_SHIFT) +#define ERRCODE_AREA_SBX_END ((11 << ERRCODE_AREA_SHIFT) - 1) +#define ERRCODE_AREA_DB (11 << ERRCODE_AREA_SHIFT) +#define ERRCODE_AREA_DB_END ((12 << ERRCODE_AREA_SHIFT) - 1) +#define ERRCODE_AREA_JAVA (12 << ERRCODE_AREA_SHIFT) +#define ERRCODE_AREA_JAVA_END ((13 << ERRCODE_AREA_SHIFT) - 1) +#define ERRCODE_AREA_UUI (13 << ERRCODE_AREA_SHIFT) +#define ERRCODE_AREA_UUI_END ((14 << ERRCODE_AREA_SHIFT) - 1) +#define ERRCODE_AREA_LIB2 (14 << ERRCODE_AREA_SHIFT) +#define ERRCODE_AREA_LIB2_END ((15 << ERRCODE_AREA_SHIFT) - 1) +#define ERRCODE_AREA_CHAOS (15 << ERRCODE_AREA_SHIFT) +#define ERRCODE_AREA_CHAOS_END ((16 << ERRCODE_AREA_SHIFT) - 1) + +#define ERRCODE_AREA_APP1 (32 << ERRCODE_AREA_SHIFT) +#define ERRCODE_AREA_APP2 (40 << ERRCODE_AREA_SHIFT) +#define ERRCODE_AREA_APP3 (48 << ERRCODE_AREA_SHIFT) +#define ERRCODE_AREA_APP4 (56 << ERRCODE_AREA_SHIFT) +#define ERRCODE_AREA_APP5 (64 << ERRCODE_AREA_SHIFT) +#define ERRCODE_AREA_APP6 (72 << ERRCODE_AREA_SHIFT) #define ERRCODE_AREA_SC ERRCODE_AREA_APP1 #define ERRCODE_AREA_SC_END (ERRCODE_AREA_APP2-1) @@ -117,150 +187,112 @@ inline sal_uInt32 ERRCODE_TOERROR( ErrCode x ) #define ERRCODE_AREA_OFA_END (ERRCODE_AREA_APP6-1) -#define ERRCODE_CLASS_NONE CAST_TO_UINT32(0UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_ABORT CAST_TO_UINT32(1UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_GENERAL CAST_TO_UINT32(2UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_NOTEXISTS CAST_TO_UINT32(3UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_ALREADYEXISTS CAST_TO_UINT32(4UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_ACCESS CAST_TO_UINT32(5UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_PATH CAST_TO_UINT32(6UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_LOCKING CAST_TO_UINT32(7UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_PARAMETER CAST_TO_UINT32(8UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_SPACE CAST_TO_UINT32(9UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_NOTSUPPORTED CAST_TO_UINT32(10UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_READ CAST_TO_UINT32(11UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_WRITE CAST_TO_UINT32(12UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_UNKNOWN CAST_TO_UINT32(13UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_VERSION CAST_TO_UINT32(14UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_FORMAT CAST_TO_UINT32(15UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_CREATE CAST_TO_UINT32(16UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_IMPORT CAST_TO_UINT32(17UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_EXPORT CAST_TO_UINT32(18UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_FILTER CAST_TO_UINT32(19UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_SO CAST_TO_UINT32(20UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_SBX CAST_TO_UINT32(21UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_RUNTIME CAST_TO_UINT32(22UL << ERRCODE_CLASS_SHIFT) -#define ERRCODE_CLASS_COMPILER CAST_TO_UINT32(23UL << ERRCODE_CLASS_SHIFT) - -#define ERRCODE_NONE CAST_TO_UINT32(0UL) -#define ERRCODE_ABORT ERRCODE_IO_ABORT - -#define ERRCODE_IO_MISPLACEDCHAR CAST_TO_UINT32(1UL |ERRCODE_CLASS_PARAMETER|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_NOTEXISTS CAST_TO_UINT32(2UL |ERRCODE_CLASS_NOTEXISTS|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_ALREADYEXISTS CAST_TO_UINT32(3UL |ERRCODE_CLASS_ALREADYEXISTS|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_NOTADIRECTORY CAST_TO_UINT32(4UL |ERRCODE_CLASS_PARAMETER|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_NOTAFILE CAST_TO_UINT32(5UL |ERRCODE_CLASS_PARAMETER|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_INVALIDDEVICE CAST_TO_UINT32(6UL |ERRCODE_CLASS_PATH|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_ACCESSDENIED CAST_TO_UINT32(7UL |ERRCODE_CLASS_ACCESS|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_LOCKVIOLATION CAST_TO_UINT32(8UL |ERRCODE_CLASS_LOCKING|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_OUTOFSPACE CAST_TO_UINT32(9UL |ERRCODE_CLASS_SPACE|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_ISWILDCARD CAST_TO_UINT32(11UL|ERRCODE_CLASS_PARAMETER|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_NOTSUPPORTED CAST_TO_UINT32(12UL|ERRCODE_CLASS_NOTSUPPORTED|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_GENERAL CAST_TO_UINT32(13UL|ERRCODE_CLASS_GENERAL|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_TOOMANYOPENFILES CAST_TO_UINT32(14UL|ERRCODE_CLASS_SPACE|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_CANTREAD CAST_TO_UINT32(15UL|ERRCODE_CLASS_READ|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_CANTWRITE CAST_TO_UINT32(16UL|ERRCODE_CLASS_WRITE|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_OUTOFMEMORY CAST_TO_UINT32(17UL|ERRCODE_CLASS_SPACE|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_CANTSEEK CAST_TO_UINT32(18UL|ERRCODE_CLASS_GENERAL|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_CANTTELL CAST_TO_UINT32(19UL|ERRCODE_CLASS_GENERAL|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_WRONGVERSION CAST_TO_UINT32(20UL|ERRCODE_CLASS_VERSION|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_WRONGFORMAT CAST_TO_UINT32(21UL|ERRCODE_CLASS_FORMAT|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_INVALIDCHAR CAST_TO_UINT32(22UL|ERRCODE_CLASS_PARAMETER|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_UNKNOWN CAST_TO_UINT32(23UL|ERRCODE_CLASS_UNKNOWN|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_INVALIDACCESS CAST_TO_UINT32(24UL|ERRCODE_CLASS_ACCESS|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_CANTCREATE CAST_TO_UINT32(25UL|ERRCODE_CLASS_CREATE|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_INVALIDPARAMETER CAST_TO_UINT32(26UL|ERRCODE_CLASS_PARAMETER|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_ABORT CAST_TO_UINT32(27UL|ERRCODE_CLASS_ABORT|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_NOTEXISTSPATH CAST_TO_UINT32(28UL |ERRCODE_CLASS_NOTEXISTS|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_PENDING CAST_TO_UINT32(29UL |ERRCODE_CLASS_NOTEXISTS|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_RECURSIVE CAST_TO_UINT32(30UL |ERRCODE_CLASS_PARAMETER|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_NAMETOOLONG CAST_TO_UINT32(31UL |ERRCODE_CLASS_PARAMETER|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_INVALIDLENGTH CAST_TO_UINT32(32UL |ERRCODE_CLASS_PARAMETER|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_CURRENTDIR CAST_TO_UINT32(33UL |ERRCODE_CLASS_PARAMETER|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_NOTSAMEDEVICE CAST_TO_UINT32(34UL |ERRCODE_CLASS_PARAMETER|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_DEVICENOTREADY CAST_TO_UINT32(35UL |ERRCODE_CLASS_READ|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_BADCRC CAST_TO_UINT32(36UL |ERRCODE_CLASS_READ|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_WRITEPROTECTED CAST_TO_UINT32(37UL |ERRCODE_CLASS_ACCESS|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_BROKENPACKAGE CAST_TO_UINT32(38UL |ERRCODE_CLASS_FORMAT|\ - ERRCODE_AREA_IO) -#define ERRCODE_IO_NOTSTORABLEINBINARYFORMAT CAST_TO_UINT32(39UL |ERRCODE_CLASS_FORMAT|\ - ERRCODE_AREA_IO) +#define ERRCODE_CLASS_NONE ( 0 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_ABORT ( 1 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_GENERAL ( 2 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_NOTEXISTS ( 3 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_ALREADYEXISTS ( 4 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_ACCESS ( 5 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_PATH ( 6 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_LOCKING ( 7 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_PARAMETER ( 8 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_SPACE ( 9 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_NOTSUPPORTED (10 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_READ (11 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_WRITE (12 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_UNKNOWN (13 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_VERSION (14 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_FORMAT (15 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_CREATE (16 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_IMPORT (17 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_EXPORT (18 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_SO (20 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_SBX (21 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_RUNTIME (22 << ERRCODE_CLASS_SHIFT) +#define ERRCODE_CLASS_COMPILER (23 << ERRCODE_CLASS_SHIFT) + +#define ERRCODE_NONE ErrCode(0UL) + +#define ERRCODE_IO_MISPLACEDCHAR ErrCode(1UL | ERRCODE_CLASS_PARAMETER | ERRCODE_AREA_IO) +#define ERRCODE_IO_NOTEXISTS ErrCode(2UL | ERRCODE_CLASS_NOTEXISTS | ERRCODE_AREA_IO) +#define ERRCODE_IO_ALREADYEXISTS ErrCode(3UL | ERRCODE_CLASS_ALREADYEXISTS | ERRCODE_AREA_IO) +#define ERRCODE_IO_NOTADIRECTORY ErrCode(4UL | ERRCODE_CLASS_PARAMETER | ERRCODE_AREA_IO) +#define ERRCODE_IO_NOTAFILE ErrCode(5UL | ERRCODE_CLASS_PARAMETER | ERRCODE_AREA_IO) +#define ERRCODE_IO_INVALIDDEVICE ErrCode(6UL | ERRCODE_CLASS_PATH | ERRCODE_AREA_IO) +#define ERRCODE_IO_ACCESSDENIED ErrCode(7UL | ERRCODE_CLASS_ACCESS | ERRCODE_AREA_IO) +#define ERRCODE_IO_LOCKVIOLATION ErrCode(8UL | ERRCODE_CLASS_LOCKING | ERRCODE_AREA_IO) +#define ERRCODE_IO_OUTOFSPACE ErrCode(9UL | ERRCODE_CLASS_SPACE | ERRCODE_AREA_IO) +#define ERRCODE_IO_ISWILDCARD ErrCode(11UL | ERRCODE_CLASS_PARAMETER | ERRCODE_AREA_IO) +#define ERRCODE_IO_NOTSUPPORTED ErrCode(12UL | ERRCODE_CLASS_NOTSUPPORTED | ERRCODE_AREA_IO) +#define ERRCODE_IO_GENERAL ErrCode(13UL | ERRCODE_CLASS_GENERAL | ERRCODE_AREA_IO) +#define ERRCODE_IO_TOOMANYOPENFILES ErrCode(14UL | ERRCODE_CLASS_SPACE | ERRCODE_AREA_IO) +#define ERRCODE_IO_CANTREAD ErrCode(15UL | ERRCODE_CLASS_READ | ERRCODE_AREA_IO) +#define ERRCODE_IO_CANTWRITE ErrCode(16UL | ERRCODE_CLASS_WRITE | ERRCODE_AREA_IO) +#define ERRCODE_IO_OUTOFMEMORY ErrCode(17UL | ERRCODE_CLASS_SPACE | ERRCODE_AREA_IO) +#define ERRCODE_IO_CANTSEEK ErrCode(18UL | ERRCODE_CLASS_GENERAL | ERRCODE_AREA_IO) +#define ERRCODE_IO_CANTTELL ErrCode(19UL | ERRCODE_CLASS_GENERAL | ERRCODE_AREA_IO) +#define ERRCODE_IO_WRONGVERSION ErrCode(20UL | ERRCODE_CLASS_VERSION | ERRCODE_AREA_IO) +#define ERRCODE_IO_WRONGFORMAT ErrCode(21UL | ERRCODE_CLASS_FORMAT | ERRCODE_AREA_IO) +#define ERRCODE_IO_INVALIDCHAR ErrCode(22UL | ERRCODE_CLASS_PARAMETER | ERRCODE_AREA_IO) +#define ERRCODE_IO_UNKNOWN ErrCode(23UL | ERRCODE_CLASS_UNKNOWN | ERRCODE_AREA_IO) +#define ERRCODE_IO_INVALIDACCESS ErrCode(24UL | ERRCODE_CLASS_ACCESS | ERRCODE_AREA_IO) +#define ERRCODE_IO_CANTCREATE ErrCode(25UL | ERRCODE_CLASS_CREATE | ERRCODE_AREA_IO) +#define ERRCODE_IO_INVALIDPARAMETER ErrCode(26UL | ERRCODE_CLASS_PARAMETER | ERRCODE_AREA_IO) +#define ERRCODE_IO_ABORT ErrCode(27UL | ERRCODE_CLASS_ABORT | ERRCODE_AREA_IO) +#define ERRCODE_IO_NOTEXISTSPATH ErrCode(28UL | ERRCODE_CLASS_NOTEXISTS | ERRCODE_AREA_IO) +#define ERRCODE_IO_PENDING ErrCode(29UL | ERRCODE_CLASS_NOTEXISTS | ERRCODE_AREA_IO) +#define ERRCODE_IO_RECURSIVE ErrCode(30UL | ERRCODE_CLASS_PARAMETER | ERRCODE_AREA_IO) +#define ERRCODE_IO_NAMETOOLONG ErrCode(31UL | ERRCODE_CLASS_PARAMETER | ERRCODE_AREA_IO) +#define ERRCODE_IO_INVALIDLENGTH ErrCode(32UL | ERRCODE_CLASS_PARAMETER | ERRCODE_AREA_IO) +#define ERRCODE_IO_CURRENTDIR ErrCode(33UL | ERRCODE_CLASS_PARAMETER | ERRCODE_AREA_IO) +#define ERRCODE_IO_NOTSAMEDEVICE ErrCode(34UL | ERRCODE_CLASS_PARAMETER | ERRCODE_AREA_IO) +#define ERRCODE_IO_DEVICENOTREADY ErrCode(35UL | ERRCODE_CLASS_READ | ERRCODE_AREA_IO) +#define ERRCODE_IO_BADCRC ErrCode(36UL | ERRCODE_CLASS_READ | ERRCODE_AREA_IO) +#define ERRCODE_IO_WRITEPROTECTED ErrCode(37UL | ERRCODE_CLASS_ACCESS | ERRCODE_AREA_IO) +#define ERRCODE_IO_BROKENPACKAGE ErrCode(38UL | ERRCODE_CLASS_FORMAT | ERRCODE_AREA_IO) +#define ERRCODE_IO_NOTSTORABLEINBINARYFORMAT ErrCode(39UL | ERRCODE_CLASS_FORMAT | ERRCODE_AREA_IO) // StreamErrorCodes -#define SVSTREAM_GENERALERROR ERRCODE_IO_GENERAL -#define SVSTREAM_FILE_NOT_FOUND ERRCODE_IO_NOTEXISTS -#define SVSTREAM_PATH_NOT_FOUND ERRCODE_IO_NOTEXISTSPATH -#define SVSTREAM_TOO_MANY_OPEN_FILES ERRCODE_IO_TOOMANYOPENFILES -#define SVSTREAM_ACCESS_DENIED ERRCODE_IO_ACCESSDENIED -#define SVSTREAM_SHARING_VIOLATION ERRCODE_IO_LOCKVIOLATION -#define SVSTREAM_LOCKING_VIOLATION ERRCODE_IO_LOCKVIOLATION -#define SVSTREAM_SHARE_BUFF_EXCEEDED ERRCODE_IO_LOCKVIOLATION +#define SVSTREAM_GENERALERROR ERRCODE_IO_GENERAL +#define SVSTREAM_FILE_NOT_FOUND ERRCODE_IO_NOTEXISTS +#define SVSTREAM_PATH_NOT_FOUND ERRCODE_IO_NOTEXISTSPATH +#define SVSTREAM_TOO_MANY_OPEN_FILES ERRCODE_IO_TOOMANYOPENFILES +#define SVSTREAM_ACCESS_DENIED ERRCODE_IO_ACCESSDENIED +#define SVSTREAM_SHARING_VIOLATION ERRCODE_IO_LOCKVIOLATION +#define SVSTREAM_LOCKING_VIOLATION ERRCODE_IO_LOCKVIOLATION +#define SVSTREAM_SHARE_BUFF_EXCEEDED ERRCODE_IO_LOCKVIOLATION -#define SVSTREAM_INVALID_ACCESS ERRCODE_IO_INVALIDACCESS -#define SVSTREAM_INVALID_HANDLE ERRCODE_IO_GENERAL -#define SVSTREAM_CANNOT_MAKE ERRCODE_IO_CANTCREATE -#define SVSTREAM_INVALID_PARAMETER ERRCODE_IO_INVALIDPARAMETER +#define SVSTREAM_INVALID_ACCESS ERRCODE_IO_INVALIDACCESS +#define SVSTREAM_INVALID_HANDLE ERRCODE_IO_GENERAL +#define SVSTREAM_CANNOT_MAKE ERRCODE_IO_CANTCREATE +#define SVSTREAM_INVALID_PARAMETER ERRCODE_IO_INVALIDPARAMETER -#define SVSTREAM_READ_ERROR ERRCODE_IO_CANTREAD -#define SVSTREAM_WRITE_ERROR ERRCODE_IO_CANTWRITE -#define SVSTREAM_SEEK_ERROR ERRCODE_IO_CANTSEEK +#define SVSTREAM_READ_ERROR ERRCODE_IO_CANTREAD +#define SVSTREAM_WRITE_ERROR ERRCODE_IO_CANTWRITE +#define SVSTREAM_SEEK_ERROR ERRCODE_IO_CANTSEEK -#define SVSTREAM_OUTOFMEMORY ERRCODE_IO_OUTOFMEMORY +#define SVSTREAM_OUTOFMEMORY ERRCODE_IO_OUTOFMEMORY -#define SVSTREAM_FILEFORMAT_ERROR ERRCODE_IO_WRONGFORMAT -#define SVSTREAM_WRONGVERSION ERRCODE_IO_WRONGVERSION +#define SVSTREAM_FILEFORMAT_ERROR ERRCODE_IO_WRONGFORMAT +#define SVSTREAM_WRONGVERSION ERRCODE_IO_WRONGVERSION -#define SVSTREAM_DISK_FULL ERRCODE_IO_OUTOFSPACE +#define SVSTREAM_DISK_FULL ERRCODE_IO_OUTOFSPACE // For the EditEngine: -#define SVSTREAM_ERRBASE_USER ERRCODE_AREA_LIB1 +#define SVSTREAM_ERRBASE_USER ERRCODE_AREA_LIB1 + +#define PRINTER_ABORT ERRCODE_IO_ABORT +#define PRINTER_GENERALERROR ERRCODE_IO_GENERAL -#define PRINTER_ABORT ERRCODE_IO_ABORT -#define PRINTER_GENERALERROR ERRCODE_IO_GENERAL +#define ERRCODE_ABORT ERRCODE_IO_ABORT -#define ERRCODE_INET_NAME_RESOLVE (ERRCODE_AREA_INET | ERRCODE_CLASS_READ | 1) -#define ERRCODE_INET_CONNECT (ERRCODE_AREA_INET | ERRCODE_CLASS_READ | 2) -#define ERRCODE_INET_READ (ERRCODE_AREA_INET | ERRCODE_CLASS_READ | 3) -#define ERRCODE_INET_WRITE (ERRCODE_AREA_INET | ERRCODE_CLASS_WRITE| 4) -#define ERRCODE_INET_GENERAL (ERRCODE_AREA_INET | ERRCODE_CLASS_WRITE |5) -#define ERRCODE_INET_OFFLINE (ERRCODE_AREA_INET | ERRCODE_CLASS_READ |6) +#define ERRCODE_INET_NAME_RESOLVE ErrCode(ERRCODE_AREA_INET | ERRCODE_CLASS_READ | 1) +#define ERRCODE_INET_CONNECT ErrCode(ERRCODE_AREA_INET | ERRCODE_CLASS_READ | 2) +#define ERRCODE_INET_READ ErrCode(ERRCODE_AREA_INET | ERRCODE_CLASS_READ | 3) +#define ERRCODE_INET_WRITE ErrCode(ERRCODE_AREA_INET | ERRCODE_CLASS_WRITE| 4) +#define ERRCODE_INET_GENERAL ErrCode(ERRCODE_AREA_INET | ERRCODE_CLASS_WRITE| 5) +#define ERRCODE_INET_OFFLINE ErrCode(ERRCODE_AREA_INET | ERRCODE_CLASS_READ | 6) #endif diff --git a/include/vcl/errinf.hxx b/include/vcl/errinf.hxx index c55011dd0b5d..996afd23f8f1 100644 --- a/include/vcl/errinf.hxx +++ b/include/vcl/errinf.hxx @@ -131,8 +131,8 @@ public: @return what sort of dialog to use, with what buttons */ - static DialogMask HandleError(sal_uInt32 nId, DialogMask nMask = DialogMask::MAX); - static bool GetErrorString(sal_uInt32 nId, OUString& rStr); + static DialogMask HandleError(ErrCode nId, DialogMask nMask = DialogMask::MAX); + static bool GetErrorString(ErrCode nId, OUString& rStr); protected: virtual bool CreateString(const ErrorInfo*, OUString &) const = 0; @@ -142,16 +142,16 @@ protected: class SAL_WARN_UNUSED VCL_DLLPUBLIC ErrorInfo { public: - ErrorInfo(sal_uInt32 nArgUserId) : + ErrorInfo(ErrCode nArgUserId) : nUserId(nArgUserId) {} virtual ~ErrorInfo(); - sal_uInt32 GetErrorCode() const { return nUserId; } + ErrCode GetErrorCode() const { return nUserId; } - static ErrorInfo* GetErrorInfo(sal_uInt32); + static ErrorInfo* GetErrorInfo(ErrCode); private: - sal_uInt32 nUserId; + ErrCode nUserId; }; class SAL_WARN_UNUSED VCL_DLLPUBLIC DynamicErrorInfo : public ErrorInfo @@ -159,10 +159,10 @@ class SAL_WARN_UNUSED VCL_DLLPUBLIC DynamicErrorInfo : public ErrorInfo friend class ImplDynamicErrorInfo; public: - DynamicErrorInfo(sal_uInt32 nUserId, DialogMask nMask); + DynamicErrorInfo(ErrCode nUserId, DialogMask nMask); virtual ~DynamicErrorInfo() override; - operator sal_uInt32() const; + operator ErrCode() const; DialogMask GetDialogMask() const; private: @@ -173,7 +173,7 @@ private: class SAL_WARN_UNUSED VCL_DLLPUBLIC StringErrorInfo : public DynamicErrorInfo { public: - StringErrorInfo(sal_uInt32 nUserId, + StringErrorInfo(ErrCode nUserId, const OUString& aStringP, DialogMask nMask = DialogMask::NONE); @@ -187,7 +187,7 @@ private: class SAL_WARN_UNUSED VCL_DLLPUBLIC TwoStringErrorInfo: public DynamicErrorInfo { public: - TwoStringErrorInfo(sal_uInt32 nUserID, const OUString & rTheArg1, + TwoStringErrorInfo(ErrCode nUserID, const OUString & rTheArg1, const OUString & rTheArg2, DialogMask nMask): DynamicErrorInfo(nUserID, nMask), aArg1(rTheArg1), aArg2(rTheArg2) {} @@ -210,7 +210,7 @@ public: ErrorContext(vcl::Window *pWin); virtual ~ErrorContext(); - virtual bool GetString(sal_uInt32 nErrId, OUString& rCtxStr) = 0; + virtual bool GetString(ErrCode nErrId, OUString& rCtxStr) = 0; vcl::Window* GetParent(); static ErrorContext* GetContext(); diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx index fa112d71066c..d67237975ae1 100644 --- a/include/vcl/graphicfilter.hxx +++ b/include/vcl/graphicfilter.hxx @@ -36,13 +36,13 @@ class SvStream; struct WMF_EXTERNALHEADER; struct ConvertData; -#define ERRCODE_GRFILTER_OPENERROR (ERRCODE_AREA_VCL | ERRCODE_CLASS_GENERAL | 1) -#define ERRCODE_GRFILTER_IOERROR (ERRCODE_AREA_VCL | ERRCODE_CLASS_GENERAL | 2) -#define ERRCODE_GRFILTER_FORMATERROR (ERRCODE_AREA_VCL | ERRCODE_CLASS_GENERAL | 3) -#define ERRCODE_GRFILTER_VERSIONERROR (ERRCODE_AREA_VCL | ERRCODE_CLASS_GENERAL | 4) -#define ERRCODE_GRFILTER_FILTERERROR (ERRCODE_AREA_VCL | ERRCODE_CLASS_GENERAL | 5) -#define ERRCODE_GRFILTER_ABORT (ERRCODE_AREA_VCL | ERRCODE_CLASS_GENERAL | 6) -#define ERRCODE_GRFILTER_TOOBIG (ERRCODE_AREA_VCL | ERRCODE_CLASS_GENERAL | 7) +#define ERRCODE_GRFILTER_OPENERROR ErrCode(ERRCODE_AREA_VCL | ERRCODE_CLASS_GENERAL | 1) +#define ERRCODE_GRFILTER_IOERROR ErrCode(ERRCODE_AREA_VCL | ERRCODE_CLASS_GENERAL | 2) +#define ERRCODE_GRFILTER_FORMATERROR ErrCode(ERRCODE_AREA_VCL | ERRCODE_CLASS_GENERAL | 3) +#define ERRCODE_GRFILTER_VERSIONERROR ErrCode(ERRCODE_AREA_VCL | ERRCODE_CLASS_GENERAL | 4) +#define ERRCODE_GRFILTER_FILTERERROR ErrCode(ERRCODE_AREA_VCL | ERRCODE_CLASS_GENERAL | 5) +#define ERRCODE_GRFILTER_ABORT ErrCode(ERRCODE_AREA_VCL | ERRCODE_CLASS_GENERAL | 6) +#define ERRCODE_GRFILTER_TOOBIG ErrCode(ERRCODE_AREA_VCL | ERRCODE_CLASS_GENERAL | 7) #define GRFILTER_OUTHINT_GREY 1 @@ -220,9 +220,9 @@ public: /** Information about errors during the GraphicFilter operation. */ struct FilterErrorEx { - sal_uLong nStreamError; + ErrCode nStreamError; - FilterErrorEx() : nStreamError( 0UL ) {} + FilterErrorEx() : nStreamError( ERRCODE_NONE ) {} }; /** Class to import and export graphic formats. */ @@ -271,11 +271,11 @@ public: sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW, sal_uInt16 * pDeterminedFormat = nullptr, GraphicFilterImportFlags nImportFlags = GraphicFilterImportFlags::NONE ); - sal_uInt16 CanImportGraphic( const OUString& rPath, SvStream& rStream, + ErrCode CanImportGraphic( const OUString& rPath, SvStream& rStream, sal_uInt16 nFormat, sal_uInt16 * pDeterminedFormat); - sal_uInt16 ImportGraphic( Graphic& rGraphic, const OUString& rPath, + ErrCode ImportGraphic( Graphic& rGraphic, const OUString& rPath, SvStream& rStream, sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW, sal_uInt16 * pDeterminedFormat = nullptr, GraphicFilterImportFlags nImportFlags = GraphicFilterImportFlags::NONE, @@ -298,12 +298,12 @@ public: const Link<ConvertData&,bool> GetFilterCallback() const; static GraphicFilter& GetGraphicFilter(); - static int LoadGraphic( const OUString& rPath, const OUString& rFilter, + static ErrCode LoadGraphic( const OUString& rPath, const OUString& rFilter, Graphic& rGraphic, GraphicFilter* pFilter = nullptr, sal_uInt16* pDeterminedFormat = nullptr ); - sal_uInt16 compressAsPNG(const Graphic& rGraphic, SvStream& rOutputStream); + ErrCode compressAsPNG(const Graphic& rGraphic, SvStream& rOutputStream); protected: OUString aFilterPath; @@ -311,7 +311,7 @@ protected: private: void ImplInit(); - sal_uLong ImplSetError( sal_uLong nError, const SvStream* pStm = nullptr ); + ErrCode ImplSetError( ErrCode nError, const SvStream* pStm = nullptr ); ErrCode ImpTestOrFindFormat( const OUString& rPath, SvStream& rStream, sal_uInt16& rFormat ); DECL_LINK( FilterCallback, ConvertData&, bool ); diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx index 90faa219190b..4de18652f0a8 100644 --- a/include/vcl/print.hxx +++ b/include/vcl/print.hxx @@ -193,7 +193,7 @@ private: JobSetup maJobSetup; Point maPageOffset; Size maPaperSize; - sal_uLong mnError; + ErrCode mnError; sal_uInt16 mnPageQueueSize; sal_uInt16 mnCopyCount; bool mbDefPrinter; @@ -215,7 +215,7 @@ private: SAL_DLLPRIVATE bool StartJob( const OUString& rJobName, std::shared_ptr<vcl::PrinterController>& ); - static SAL_DLLPRIVATE sal_uLong + static SAL_DLLPRIVATE ErrCode ImplSalPrinterErrorCodeToVCL( sal_uLong nError ); private: diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx index c8d0ffe41524..edfd17e4f9e3 100644 --- a/include/xmloff/xmlexp.hxx +++ b/include/xmloff/xmlexp.hxx @@ -60,6 +60,7 @@ #include <xmloff/ProgressBarHelper.hxx> #include <cppuhelper/implbase.hxx> #include <tools/fldunit.hxx> +#include <vcl/errcode.hxx> #include <list> #include <memory> @@ -398,7 +399,7 @@ public: void addChaffWhenEncryptedStorage(); // Export the document. - virtual sal_uInt32 exportDoc( enum ::xmloff::token::XMLTokenEnum eClass = ::xmloff::token::XML_TOKEN_INVALID ); + virtual ErrCode exportDoc( enum ::xmloff::token::XMLTokenEnum eClass = ::xmloff::token::XML_TOKEN_INVALID ); virtual void addDataStyle(const sal_Int32 nNumberFormat, bool bTimeFormat = false ); virtual void exportDataStyles(); |