[Libreoffice-commits] core.git: editeng/source idl/source rsc/source writerfilter/source

Gökhan Gurbetoğlu gokhan.gurbetoglu at pardus.org.tr
Thu Jun 23 10:01:40 UTC 2016


 editeng/source/misc/svxacorr.cxx            |    3 ++-
 idl/source/cmptools/hash.cxx                |    4 +++-
 rsc/source/tools/rscchar.cxx                |    3 ++-
 writerfilter/source/rtftok/rtftokenizer.cxx |    3 ++-
 4 files changed, 9 insertions(+), 4 deletions(-)

New commits:
commit ea5a5b1dbb669415586520c2b0c526b133aa07e4
Author: Gökhan Gurbetoğlu <gokhan.gurbetoglu at pardus.org.tr>
Date:   Tue Jun 21 11:45:30 2016 +0300

    tdf#99589 - tolower / toupper - dangerous to Turks ...
    
    Change-Id: Id3b9abd557f2b8dfc942589362452cbdb0232da9
    Reviewed-on: https://gerrit.libreoffice.org/26546
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: jan iversen <jani at documentfoundation.org>

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 8658967..d736d94 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -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 ) &&
diff --git a/idl/source/cmptools/hash.cxx b/idl/source/cmptools/hash.cxx
index 22faf38..fc63730 100644
--- a/idl/source/cmptools/hash.cxx
+++ b/idl/source/cmptools/hash.cxx
@@ -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;
diff --git a/rsc/source/tools/rscchar.cxx b/rsc/source/tools/rscchar.cxx
index b00d61f..dbe096e 100644
--- a/rsc/source/tools/rscchar.cxx
+++ b/rsc/source/tools/rscchar.cxx
@@ -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;
diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx b/writerfilter/source/rtftok/rtftokenizer.cxx
index 2dab789..83ecf69 100644
--- a/writerfilter/source/rtftok/rtftokenizer.cxx
+++ b/writerfilter/source/rtftok/rtftokenizer.cxx
@@ -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;


More information about the Libreoffice-commits mailing list