xref: /aoo4110/main/sw/inc/swerror.h (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SWSWERROR_H
25 #define _SWSWERROR_H
26 
27 #include <tools/errcode.hxx>
28 
29 #define ERROR_SW_BASE			(ERRCODE_AREA_SW)
30 #define ERROR_SW_READ_BASE		(ERROR_SW_BASE | ERRCODE_CLASS_READ)
31 #define ERROR_SW_WRITE_BASE		(ERROR_SW_BASE | ERRCODE_CLASS_WRITE)
32 
33 #define WARN_SW_BASE			(ERRCODE_AREA_SW | ERRCODE_WARNING_MASK)
34 #define WARN_SW_READ_BASE		(WARN_SW_BASE | ERRCODE_CLASS_READ )
35 #define WARN_SW_WRITE_BASE		(WARN_SW_BASE | ERRCODE_CLASS_WRITE )
36 
37 
38 // Import Fehler
39 #define ERR_SWG_FILE_FORMAT_ERROR     (ERROR_SW_READ_BASE | 1 )
40 #define ERR_SWG_READ_ERROR              (ERROR_SW_READ_BASE   | 2 )
41 
42 #define ERR_SW6_INPUT_FILE				(ERROR_SW_READ_BASE	| 4 )
43 #define ERR_SW6_NOWRITER_FILE			(ERROR_SW_READ_BASE	| 5 )
44 #define ERR_SW6_UNEXPECTED_EOF			(ERROR_SW_READ_BASE	| 6 )
45 #define ERR_SW6_PASSWD					(ERROR_SW_READ_BASE	| 7 )
46 
47 #define ERR_WW6_NO_WW6_FILE_ERR			(ERROR_SW_READ_BASE	| 8 )
48 #define ERR_WW6_FASTSAVE_ERR            (ERROR_SW_READ_BASE | 9 )
49 
50 #define ERR_FORMAT_ROWCOL               (ERROR_SW_READ_BASE | 12)
51 
52 #define ERR_SWG_NEW_VERSION				(ERROR_SW_READ_BASE | 13)
53 #define ERR_WW8_NO_WW8_FILE_ERR			(ERROR_SW_READ_BASE	| 14)
54 
55 #define ERR_FORMAT_FILE_ROWCOL          (ERROR_SW_READ_BASE | 15)
56 
57 // Export Fehler
58 #define ERR_SWG_WRITE_ERROR               (ERROR_SW_WRITE_BASE | 30 )
59 #define   ERR_SWG_OLD_GLOSSARY            (ERROR_SW_WRITE_BASE | 31 )
60 #define ERR_WRITE_ERROR_FILE			(ERROR_SW_WRITE_BASE | 35 )
61 
62 // Import/Export Fehler
63 #define ERR_SWG_INTERNAL_ERROR            (ERROR_SW_BASE  | 50 )
64 
65 #define ERR_TXTBLOCK_NEWFILE_ERROR		(ERROR_SW_BASE|ERRCODE_CLASS_LOCKING | 55 )
66 
67 // weitere Fehler und Fehlerklassen
68 #define ERR_AUTOPATH_ERROR				(ERROR_SW_BASE|ERRCODE_CLASS_PATH | 55 )
69 #define ERR_TBLSPLIT_ERROR				(ERROR_SW_BASE|ERRCODE_CLASS_NONE| 56 )
70 #define ERR_TBLINSCOL_ERROR				(ERROR_SW_BASE|ERRCODE_CLASS_NONE| 57 )
71 #define ERR_TBLDDECHG_ERROR				(ERROR_SW_BASE|ERRCODE_CLASS_NONE| 58 )
72 
73 // ----- Warnings ---------------------------
74 
75 // Import - Warnings
76 #define WARN_SWG_NO_DRAWINGS            (WARN_SW_READ_BASE | 70 )
77 #define WARN_WW6_FASTSAVE_ERR           (WARN_SW_READ_BASE | 71 )
78 // continued below
79 
80 // Import & Export - Warnings
81 #define WARN_SWG_FEATURES_LOST          (WARN_SW_BASE | 72 )
82 #define WARN_SWG_OLE                    (WARN_SW_BASE | 73 )
83 #define	WARN_SWG_POOR_LOAD          	(WARN_SW_BASE | 74 )
84 
85 // Export warnings
86 #define WARN_SWG_HTML_NO_MACROS			(WARN_SW_WRITE_BASE |75)
87 #define WARN_WRITE_ERROR_FILE			(WARN_SW_WRITE_BASE |76)
88 
89 // More Import & Export  - Warnings
90 #define WARN_FORMAT_FILE_ROWCOL         (WARN_SW_READ_BASE | 77)
91 
92 #ifndef __RSC
93 
IsWarning(sal_uLong nErr)94 inline FASTBOOL IsWarning( sal_uLong nErr )
95 {
96 	return 0 != ( nErr & ERRCODE_WARNING_MASK & nErr );
97 }
98 
IsError(sal_uLong nErr)99 inline FASTBOOL IsError( sal_uLong nErr )
100 {
101 	return nErr && 0 == ( ERRCODE_WARNING_MASK & nErr );
102 }
103 
104 #endif
105 
106 
107 #endif
108 
109