Kaydet (Commit) ea5a5b1d authored tarafından Gökhan Gurbetoğlu's avatar Gökhan Gurbetoğlu 🇹🇷 Kaydeden (comit) jan iversen

tdf#99589 - tolower / toupper - dangerous to Turks ...

Change-Id: Id3b9abd557f2b8dfc942589362452cbdb0232da9
Reviewed-on: https://gerrit.libreoffice.org/26546Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarjan iversen <jani@documentfoundation.org>
üst 9b9e5cfd
......@@ -66,6 +66,7 @@
#include <vcl/help.hxx>
#include <set>
#include <unordered_map>
#include <rtl/character.hxx>
using namespace ::com::sun::star::ucb;
using namespace ::com::sun::star::uno;
......@@ -1374,7 +1375,7 @@ void SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& rDoc, const OUString& rTxt,
if( ( IsAutoCorrFlag( ChgOrdinalNumber ) &&
(nInsPos >= 2 ) && // fdo#69762 avoid autocorrect for 2e-3
( '-' != cChar || 'E' != toupper(rTxt[nInsPos-1]) || '0' > rTxt[nInsPos-2] || '9' < rTxt[nInsPos-2] ) &&
( '-' != cChar || 'E' != rtl::toAsciiUpperCase(rTxt[nInsPos-1]) || '0' > rTxt[nInsPos-2] || '9' < rTxt[nInsPos-2] ) &&
FnChgOrdinalNumber( rDoc, rTxt, nCapLttrPos, nInsPos, eLang ) ) ||
( IsAutoCorrFlag( SetINetAttr ) &&
( ' ' == cChar || '\t' == cChar || 0x0a == cChar || !cChar ) &&
......
......@@ -26,6 +26,8 @@
#include <hash.hxx>
#include <tools/debug.hxx>
#include <rtl/character.hxx>
SvStringHashEntry::~SvStringHashEntry() { };
SvHashTable::SvHashTable( sal_uInt32 nMaxEntries )
......@@ -121,7 +123,7 @@ sal_uInt32 SvStringHashTable::HashFunc( const OString& rElement ) const
int nShift = 0;
while( *pStr )
{
if( isupper( *pStr ) )
if( rtl::isAsciiUpperCase( *pStr ) )
nHash ^= sal_uInt32(*pStr - 'A' + 26) << nShift;
else
nHash ^= sal_uInt32(*pStr - 'a') << nShift;
......
......@@ -26,6 +26,7 @@
#include <rtl/textcvt.h>
#include <rtl/textenc.h>
#include <rtl/alloc.h>
#include <rtl/character.hxx>
char * RscChar::MakeUTF8( char * pStr, sal_uInt16 nTextEncoding )
{
......@@ -109,7 +110,7 @@ char * RscChar::MakeUTF8( char * pStr, sal_uInt16 nTextEncoding )
{
if( isdigit( *pStr ) )
nChar = nChar * 16 + (sal_uInt8)*pStr - (sal_uInt8)'0';
else if( isupper( *pStr ) )
else if( rtl::isAsciiUpperCase( *pStr ) )
nChar = nChar * 16 + (sal_uInt8)*pStr - (sal_uInt8)'A' +10;
else
nChar = nChar * 16 + (sal_uInt8)*pStr - (sal_uInt8)'a' +10;
......
......@@ -12,6 +12,7 @@
#include <vcl/svapp.hxx>
#include <rtl/strbuf.hxx>
#include <rtfskipdestination.hxx>
#include <rtl/character.hxx>
#include <com/sun/star/io/BufferSizeExceededException.hpp>
using namespace com::sun::star;
......@@ -169,7 +170,7 @@ int RTFTokenizer::asHex(char ch)
ret = ch - '0';
else
{
if (islower(ch))
if (rtl::isAsciiLowerCase(ch))
{
if (ch < 'a' || ch > 'f')
return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment