diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-14 11:31:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-15 08:24:33 +0200 |
commit | ec8c98f59869bee0e327d32f39480a0e4b1330bc (patch) | |
tree | ee68d29cd51c60a8a939fd454955410e66e3b66c /hwpfilter | |
parent | 11503e99be09b4e8faa465559fbdacb06e8896cc (diff) |
use more SAL_N_ELEMENTS part 3
Change-Id: I82e366fefd2e31928b99840fe76649cc3521e623
Reviewed-on: https://gerrit.libreoffice.org/38789
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'hwpfilter')
-rw-r--r-- | hwpfilter/source/fontmap.cxx | 7 | ||||
-rw-r--r-- | hwpfilter/source/hbox.cxx | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/hwpfilter/source/fontmap.cxx b/hwpfilter/source/fontmap.cxx index a59d131f8c78..003001308412 100644 --- a/hwpfilter/source/fontmap.cxx +++ b/hwpfilter/source/fontmap.cxx @@ -24,6 +24,7 @@ #include <string.h> #endif +#include <sal/types.h> #include <fontmap.hxx> struct FontEntry @@ -145,16 +146,14 @@ const char* const RepFontTab[] = int getRepFamilyName(const char* orig, char *buf, double &ratio) { - int i; - int size = sizeof(FontMapTab)/sizeof(FontEntry); - for( i = 0 ; i < size ; i++) + for( int i = 0 ; i < int(SAL_N_ELEMENTS(FontMapTab)); i++) { if( !strcmp(orig, FontMapTab[i].familyname) ){ ratio = FontMapTab[i].ratio; return strlen( strcpy(buf,RepFontTab[FontMapTab[i].key]) ); } } - ratio = FontMapTab[0].ratio; + ratio = FontMapTab[0].ratio; return strlen( strcpy(buf, RepFontTab[0] ) ); } diff --git a/hwpfilter/source/hbox.cxx b/hwpfilter/source/hbox.cxx index ef6348817f48..9ad331945798 100644 --- a/hwpfilter/source/hbox.cxx +++ b/hwpfilter/source/hbox.cxx @@ -480,7 +480,7 @@ static hchar olHanglJaso(int num, int type) if (type == OL_HANGL_JASO) { - num = num % (14 + (sizeof(jung) / sizeof(char))); + num = num % (14 + SAL_N_ELEMENTS(jung)); if (num < 14) hh = (han_init[num] << 8) | 'A'; @@ -493,7 +493,7 @@ static hchar olHanglJaso(int num, int type) hh = (han_init[num] << 8) | 'a'; else { - int j = (num / 14) % (sizeof(jung2) / sizeof(char)); + int j = (num / 14) % SAL_N_ELEMENTS(jung2); num = num % 14; hh = (han_init[num] << 8) | (jung2[j] << 5) | 1; |