[Libreoffice-commits] core.git: sd/inc

Noel Grandin noel.grandin at collabora.co.uk
Mon Aug 21 08:58:08 UTC 2017


 sd/inc/errhdl.hrc  |    9 +++------
 sd/inc/sderror.hxx |   17 ++++-------------
 2 files changed, 7 insertions(+), 19 deletions(-)

New commits:
commit 60dc8572e677b6c29f73d8848d9d6036d8d1ff05
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Aug 21 08:51:40 2017 +0200

    simplify sd error macros
    
    Change-Id: I0c2a720c4dddda77715e9d2697e9436f48a7d471
    Reviewed-on: https://gerrit.libreoffice.org/41377
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sd/inc/errhdl.hrc b/sd/inc/errhdl.hrc
index bcaa2a0a5328..f568a0292f62 100644
--- a/sd/inc/errhdl.hrc
+++ b/sd/inc/errhdl.hrc
@@ -24,17 +24,14 @@
 
 #include "sderror.hxx"
 
-#define ERR_CODE( class, err )  ErrCode(class | (sal_uInt32(err) - ERROR_SD_BASE))
-#define WARN_CODE( class, err ) ErrCode(class | (sal_uInt32(err) - WARN_SD_BASE))
-
 const ErrMsgCode RID_SD_ERRHDL[] =
 {
     { NC_("RID_SD_ERRHDL", "File format error found at $(ARG1)(row,col)."),
-      ERR_CODE ( ERRCODE_CLASS_READ , ERR_FORMAT_ROWCOL ) },
+      ERR_FORMAT_ROWCOL },
     { NC_("RID_SD_ERRHDL", "Format error discovered in the file in sub-document $(ARG1) at position $(ARG2)(row,col)."),
-      ERR_CODE ( ERRCODE_CLASS_READ , ERR_FORMAT_FILE_ROWCOL ) },
+      ERR_FORMAT_FILE_ROWCOL },
     { NC_("RID_SD_ERRHDL", "Format error discovered in the file in sub-document $(ARG1) at position $(ARG2)(row,col)."),
-      ERR_CODE ( ERRCODE_CLASS_READ , WARN_FORMAT_FILE_ROWCOL ) },
+      WARN_FORMAT_FILE_ROWCOL },
     { nullptr, ERRCODE_NONE }
 };
 
diff --git a/sd/inc/sderror.hxx b/sd/inc/sderror.hxx
index 4f52035a13c0..2be4c8c634b3 100644
--- a/sd/inc/sderror.hxx
+++ b/sd/inc/sderror.hxx
@@ -22,21 +22,12 @@
 
 #include <vcl/errcode.hxx>
 
-#define ERROR_SD_BASE           (ERRCODE_AREA_SD)
-#define ERROR_SD_READ_BASE      (ERROR_SD_BASE | ERRCODE_CLASS_READ)
-#define ERROR_SD_WRITE_BASE     (ERROR_SD_BASE | ERRCODE_CLASS_WRITE)
-
-#define WARN_SD_BASE            (ERRCODE_AREA_SD | ERRCODE_WARNING_MASK)
-#define WARN_SD_READ_BASE       (WARN_SD_BASE | ERRCODE_CLASS_READ )
-#define WARN_SD_WRITE_BASE      (WARN_SD_BASE | ERRCODE_CLASS_WRITE )
-
 // Import errors
-#define ERR_FORMAT_ROWCOL               ErrCode(ERROR_SD_READ_BASE | 1)
-#define ERR_FORMAT_FILE_ROWCOL          ErrCode(ERROR_SD_READ_BASE | 2)
-
-// ----- Warnings ---------------------------
+#define ERR_FORMAT_ROWCOL               ErrCode(ERRCODE_AREA_SD | ERRCODE_CLASS_READ | 1)
+#define ERR_FORMAT_FILE_ROWCOL          ErrCode(ERRCODE_AREA_SD | ERRCODE_CLASS_READ | 2)
 
-#define WARN_FORMAT_FILE_ROWCOL         ErrCode(WARN_SD_READ_BASE | 100)
+// Warnings
+#define WARN_FORMAT_FILE_ROWCOL         ErrCode(ERRCODE_AREA_SD | ERRCODE_WARNING_MASK | ERRCODE_CLASS_READ | 100)
 
 #endif
 


More information about the Libreoffice-commits mailing list