LCOV - code coverage report
Current view: top level - libreoffice/sw/inc - swerror.h (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 2 2 100.0 %
Date: 2012-12-27 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef _SWSWERROR_H
      21             : #define _SWSWERROR_H
      22             : 
      23             : #include <tools/errcode.hxx>
      24             : 
      25             : #define ERROR_SW_BASE           (ERRCODE_AREA_SW)
      26             : #define ERROR_SW_READ_BASE      (ERROR_SW_BASE | ERRCODE_CLASS_READ)
      27             : #define ERROR_SW_WRITE_BASE     (ERROR_SW_BASE | ERRCODE_CLASS_WRITE)
      28             : 
      29             : #define WARN_SW_BASE            (ERRCODE_AREA_SW | ERRCODE_WARNING_MASK)
      30             : #define WARN_SW_READ_BASE       (WARN_SW_BASE | ERRCODE_CLASS_READ )
      31             : #define WARN_SW_WRITE_BASE      (WARN_SW_BASE | ERRCODE_CLASS_WRITE )
      32             : 
      33             : 
      34             : // Import Errors
      35             : #define ERR_SWG_FILE_FORMAT_ERROR     (ERROR_SW_READ_BASE | 1 )
      36             : #define ERR_SWG_READ_ERROR              (ERROR_SW_READ_BASE   | 2 )
      37             : 
      38             : #define ERR_SW6_INPUT_FILE              (ERROR_SW_READ_BASE | 4 )
      39             : #define ERR_SW6_NOWRITER_FILE           (ERROR_SW_READ_BASE | 5 )
      40             : #define ERR_SW6_UNEXPECTED_EOF          (ERROR_SW_READ_BASE | 6 )
      41             : #define ERR_SW6_PASSWD                  (ERROR_SW_READ_BASE | 7 )
      42             : 
      43             : #define ERR_WW6_NO_WW6_FILE_ERR         (ERROR_SW_READ_BASE | 8 )
      44             : #define ERR_WW6_FASTSAVE_ERR            (ERROR_SW_READ_BASE | 9 )
      45             : 
      46             : #define ERR_FORMAT_ROWCOL               (ERROR_SW_READ_BASE | 12)
      47             : 
      48             : #define ERR_SWG_NEW_VERSION             (ERROR_SW_READ_BASE | 13)
      49             : #define ERR_WW8_NO_WW8_FILE_ERR         (ERROR_SW_READ_BASE | 14)
      50             : 
      51             : #define ERR_FORMAT_FILE_ROWCOL          (ERROR_SW_READ_BASE | 15)
      52             : 
      53             : // Export errors
      54             : #define ERR_SWG_WRITE_ERROR               (ERROR_SW_WRITE_BASE | 30 )
      55             : #define   ERR_SWG_OLD_GLOSSARY            (ERROR_SW_WRITE_BASE | 31 )
      56             : #define ERR_WRITE_ERROR_FILE            (ERROR_SW_WRITE_BASE | 35 )
      57             : 
      58             : // Import/Export errors
      59             : #define ERR_SWG_INTERNAL_ERROR            (ERROR_SW_BASE  | 50 )
      60             : 
      61             : #define ERR_TXTBLOCK_NEWFILE_ERROR      (ERROR_SW_BASE|ERRCODE_CLASS_LOCKING | 55 )
      62             : 
      63             : // other errors and errorclasses
      64             : #define ERR_AUTOPATH_ERROR              (ERROR_SW_BASE|ERRCODE_CLASS_PATH | 55 )
      65             : #define ERR_TBLSPLIT_ERROR              (ERROR_SW_BASE|ERRCODE_CLASS_NONE| 56 )
      66             : #define ERR_TBLINSCOL_ERROR             (ERROR_SW_BASE|ERRCODE_CLASS_NONE| 57 )
      67             : #define ERR_TBLDDECHG_ERROR             (ERROR_SW_BASE|ERRCODE_CLASS_NONE| 58 )
      68             : 
      69             : // ----- Warnings ---------------------------
      70             : 
      71             : // Import - Warnings
      72             : #define WARN_SWG_NO_DRAWINGS            (WARN_SW_READ_BASE | 70 )
      73             : #define WARN_WW6_FASTSAVE_ERR           (WARN_SW_READ_BASE | 71 )
      74             : // continued below
      75             : 
      76             : // Import & Export - Warnings
      77             : #define WARN_SWG_FEATURES_LOST          (WARN_SW_BASE | 72 )
      78             : #define WARN_SWG_OLE                    (WARN_SW_BASE | 73 )
      79             : #define WARN_SWG_POOR_LOAD              (WARN_SW_BASE | 74 )
      80             : 
      81             : // Export warnings
      82             : #define WARN_SWG_HTML_NO_MACROS         (WARN_SW_WRITE_BASE |75)
      83             : #define WARN_WRITE_ERROR_FILE           (WARN_SW_WRITE_BASE |76)
      84             : 
      85             : // More Import & Export  - Warnings
      86             : #define WARN_FORMAT_FILE_ROWCOL         (WARN_SW_READ_BASE | 77)
      87             : 
      88             : #ifndef __RSC
      89             : 
      90             : inline bool IsWarning( sal_uLong nErr )
      91             : {
      92             :     return 0 != ( nErr & ERRCODE_WARNING_MASK & nErr );
      93             : }
      94             : 
      95         136 : inline bool IsError( sal_uLong nErr )
      96             : {
      97         136 :     return nErr && 0 == ( ERRCODE_WARNING_MASK & nErr );
      98             : }
      99             : 
     100             : #endif
     101             : 
     102             : 
     103             : #endif
     104             : 
     105             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10