summaryrefslogtreecommitdiff
path: root/hwpfilter
diff options
context:
space:
mode:
authorGökhan Gurbetoğlu <gokhan.gurbetoglu@pardus.org.tr>2016-06-20 17:40:13 +0300
committerjan iversen <jani@documentfoundation.org>2016-06-23 09:59:49 +0000
commit9b9e5cfd2fa629b2e1dc4a193e48a4a4e8d34126 (patch)
tree61a81a6bd407cb9a06bfd8920d982ea714d63bcf /hwpfilter
parent8ab7db320ff158949d2eadaa6e654115201ddf61 (diff)
tdf#99589 - tolower / toupper - dangerous to Turks ...
Change-Id: I8b0fe9354232a7b60f3605fa6f90f6741f7bf683 Reviewed-on: https://gerrit.libreoffice.org/26537 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org>
Diffstat (limited to 'hwpfilter')
-rw-r--r--hwpfilter/source/hbox.cxx6
-rw-r--r--hwpfilter/source/hwpeq.cxx18
2 files changed, 14 insertions, 10 deletions
diff --git a/hwpfilter/source/hbox.cxx b/hwpfilter/source/hbox.cxx
index e501949ace73..bd30edc2eec1 100644
--- a/hwpfilter/source/hbox.cxx
+++ b/hwpfilter/source/hbox.cxx
@@ -31,6 +31,8 @@
#include "drawdef.h"
#include "hcode.h"
+#include <rtl/character.hxx>
+
int HBox::boxCount = 0;
HBox::HBox(hchar hch)
@@ -586,7 +588,7 @@ static void getOutlineNumStr(int style, int level, int num, hchar * hstr)
ptr = buf;
while (*ptr)
{
- *ptr = sal::static_int_cast<char>(toupper(*ptr));
+ *ptr = sal::static_int_cast<char>(rtl::toAsciiUpperCase(*ptr));
ptr++;
}
}
@@ -688,7 +690,7 @@ hchar_string Outline::GetUnicode() const
char *ptr = dest;
while( *ptr )
{
- *ptr = sal::static_int_cast<char>(toupper(*ptr));
+ *ptr = sal::static_int_cast<char>(rtl::toAsciiUpperCase(*ptr));
ptr++;
}
}
diff --git a/hwpfilter/source/hwpeq.cxx b/hwpfilter/source/hwpeq.cxx
index dd461103a1a6..b87574cab863 100644
--- a/hwpfilter/source/hwpeq.cxx
+++ b/hwpfilter/source/hwpeq.cxx
@@ -32,6 +32,8 @@ using namespace std;
#include <sal/types.h>
#include <sal/macros.h>
+#include <rtl/character.hxx>
+
/* @Man: change the hwp formula to LaTeX */
#ifdef _WIN32
# define ENDL "\r\n"
@@ -416,15 +418,15 @@ void make_keyword( char *keyword, const char *token)
memcpy(keyword, token, len);
keyword[len] = 0;
- if( (token[0] & 0x80) || islower(token[0]) || strlen(token) < 2 )
+ if( (token[0] & 0x80) || rtl::isAsciiLowerCase(token[0]) || strlen(token) < 2 )
return;
- int capital = isupper(keyword[1]);
+ int capital = rtl::isAsciiUpperCase(keyword[1]);
for( ptr = keyword + 2; *ptr && result; ptr++ )
{
if( (*ptr & 0x80) ||
- (!capital && isupper(*ptr)) ||
- (capital && islower(*ptr)) )
+ (!capital && rtl::isAsciiUpperCase(*ptr)) ||
+ (capital && rtl::isAsciiLowerCase(*ptr)) )
{
result = false;
}
@@ -435,8 +437,8 @@ void make_keyword( char *keyword, const char *token)
ptr = keyword;
while( *ptr )
{
- if( isupper(*ptr) )
- *ptr = sal::static_int_cast<char>(tolower(*ptr));
+ if( rtl::isAsciiUpperCase(*ptr) )
+ *ptr = sal::static_int_cast<char>(rtl::toAsciiLowerCase(*ptr));
ptr++;
}
}
@@ -687,8 +689,8 @@ static char eq2ltxconv(MzString& sstr, istream *strm, const char *sentinel)
key[0] = '\\';
strcpy(key + 1, eq->key);
}
- if( (eq->flag & EQ_CASE) && isupper(token[0]) )
- key[1] = sal::static_int_cast<char>(toupper(key[1]));
+ if( (eq->flag & EQ_CASE) && rtl::isAsciiUpperCase(token[0]) )
+ key[1] = sal::static_int_cast<char>(rtl::toAsciiUpperCase(key[1]));
token = key;
}