[Libreoffice-commits] core.git: i18npool/source i18nutil/source include/i18nutil offapi/com

2023-05-29 Thread Khaled Hosny (via logerrit)
 i18npool/source/characterclassification/unoscripttypedetector.cxx |   14 +-
 i18nutil/source/utility/scripttypedetector.cxx|   49 
--
 include/i18nutil/scripttypedetector.hxx   |3 
 offapi/com/sun/star/i18n/CTLScriptType.idl|1 
 offapi/com/sun/star/i18n/XScriptTypeDetector.idl  |3 
 5 files changed, 10 insertions(+), 60 deletions(-)

New commits:
commit d7ddac208516ce2350c84c434aad933b345c9509
Author: Khaled Hosny 
AuthorDate: Mon May 29 11:27:40 2023 +0300
Commit: خالد حسني 
CommitDate: Mon May 29 16:23:07 2023 +0200

Remove recently unused CTLScriptType code

This is now unused after:

commit 98f7ec383db74a6491e925e30125d3fbf270afc2
Author: Khaled Hosny 
Date:   Sun May 28 16:28:52 2023 +0300

tdf#139863, tdf#155514: Don’t split COMPLEX text portions

The code is also broken as it doesn’t handle surrogate pairs.

The UNO API now throws an exception.

Change-Id: I454ed741e3834e762a2731d671c21a3e73515da3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152359
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Reviewed-by: خالد حسني 

diff --git a/i18npool/source/characterclassification/unoscripttypedetector.cxx 
b/i18npool/source/characterclassification/unoscripttypedetector.cxx
index afcd2708ce90..1d48ed864724 100644
--- a/i18npool/source/characterclassification/unoscripttypedetector.cxx
+++ b/i18npool/source/characterclassification/unoscripttypedetector.cxx
@@ -43,23 +43,21 @@ UnoScriptTypeDetector::endOfScriptDirection( const 
OUString& Text, sal_Int32 nPo
 }
 
 sal_Int16 SAL_CALL
-UnoScriptTypeDetector::getCTLScriptType( const OUString& Text, sal_Int32 nPos )
+UnoScriptTypeDetector::getCTLScriptType( const OUString&, sal_Int32 )
 {
-return ScriptTypeDetector::getCTLScriptType(Text, nPos);
+throw css::uno::RuntimeException("not implemented");
 }
 
-// Begin of Script Type is inclusive.
 sal_Int32 SAL_CALL
-UnoScriptTypeDetector::beginOfCTLScriptType( const OUString& Text, sal_Int32 
nPos )
+UnoScriptTypeDetector::beginOfCTLScriptType( const OUString&, sal_Int32 )
 {
-return ScriptTypeDetector::beginOfCTLScriptType(Text, nPos);
+throw css::uno::RuntimeException("not implemented");
 }
 
-// End of the Script Type is exclusive, the return value pointing to the begin 
of next script type
 sal_Int32 SAL_CALL
-UnoScriptTypeDetector::endOfCTLScriptType( const OUString& Text, sal_Int32 
nPos )
+UnoScriptTypeDetector::endOfCTLScriptType( const OUString&, sal_Int32 )
 {
-return ScriptTypeDetector::endOfCTLScriptType(Text, nPos);
+throw css::uno::RuntimeException("not implemented");
 }
 
 OUString SAL_CALL
diff --git a/i18nutil/source/utility/scripttypedetector.cxx 
b/i18nutil/source/utility/scripttypedetector.cxx
index f096ecbde831..5bc3f9bb2aa1 100644
--- a/i18nutil/source/utility/scripttypedetector.cxx
+++ b/i18nutil/source/utility/scripttypedetector.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include 
 #include 
 #include 
 #include 
@@ -82,52 +81,4 @@ sal_Int32 ScriptTypeDetector::endOfScriptDirection( 
std::u16string_view Text, sa
 return cPos == nPos ? -1 : cPos;
 }
 
-sal_Int16 ScriptTypeDetector::getCTLScriptType( std::u16string_view Text, 
sal_Int32 nPos )
-{
-static const ScriptTypeList typeList[] = {
-{ UnicodeScript_kHebrew,  UnicodeScript_kHebrew,  
CTLScriptType::CTL_HEBREW },// 10
-{ UnicodeScript_kArabic,  UnicodeScript_kArabic,  
CTLScriptType::CTL_ARABIC },// 11
-{ UnicodeScript_kDevanagari,  UnicodeScript_kDevanagari,  
CTLScriptType::CTL_INDIC }, // 14
-{ UnicodeScript_kThai,UnicodeScript_kThai,
CTLScriptType::CTL_THAI },  // 24
-{ UnicodeScript_kScriptCount, UnicodeScript_kScriptCount, 
CTLScriptType::CTL_UNKNOWN }// 88
-};
-
-return unicode::getUnicodeScriptType(Text[nPos], typeList);
-}
-
-// Begin of Script Type is inclusive.
-sal_Int32 ScriptTypeDetector::beginOfCTLScriptType( std::u16string_view Text, 
sal_Int32 nPos )
-{
-if (nPos < 0)
-return 0;
-else if (o3tl::make_unsigned(nPos) >= Text.size())
-return Text.size();
-else {
-sal_Int16 cType = getCTLScriptType(Text, nPos);
-for (nPos--; nPos >= 0; nPos--) {
-if (cType != getCTLScriptType(Text, nPos))
-break;
-}
-return nPos + 1;
-}
-}
-
-// End of the Script Type is exclusive, the return value pointing to the begin 
of next script type
-sal_Int32 ScriptTypeDetector::endOfCTLScriptType( std::u16string_view Text, 
sal_Int32 nPos )
-{
-if (nPos < 0)
-return 0;
-else if (o3tl::make_unsigned(nPos) >= Text.size())
-return Text.size();
-else {
-sal_Int16 cType = getCTLScriptType(Text, nPos);
-sal_Int32 len = Text.size();
-fo

[Libreoffice-commits] core.git: i18npool/source i18nutil/source idl/source include/comphelper jvmfwk/plugins slideshow/source unodevtools/source writerfilter/source xmlsecurity/source

2023-03-30 Thread Noel Grandin (via logerrit)
 i18npool/source/characterclassification/cclass_unicode_parser.cxx |   10 
+++--
 i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx |3 -
 i18nutil/source/utility/unicode.cxx   |3 -
 idl/source/prj/database.cxx   |   13 
+++---
 include/comphelper/traceevent.hxx |9 
+---
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx   |6 
+--
 slideshow/source/engine/rehearsetimingsactivity.cxx   |6 
+--
 unodevtools/source/skeletonmaker/cppcompskeleton.cxx  |   20 
--
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |3 -
 writerfilter/source/rtftok/rtfsprm.cxx|4 --
 xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx |3 -
 11 files changed, 32 insertions(+), 48 deletions(-)

New commits:
commit db7f33af1438538bb51b376242294ecd3bfcb055
Author: Noel Grandin 
AuthorDate: Thu Mar 30 16:10:11 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Mar 30 20:03:41 2023 +

loplugin:stringadd in various

when applying my upcoming patch to also consider O[U]StringBuffer

Change-Id: I8cf6a47ad357ddc73e2c430d966be72d5efd1485
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149767
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/i18npool/source/characterclassification/cclass_unicode_parser.cxx 
b/i18npool/source/characterclassification/cclass_unicode_parser.cxx
index 313e42a0f2fe..aed29ea1ce5b 100644
--- a/i18npool/source/characterclassification/cclass_unicode_parser.cxx
+++ b/i18npool/source/characterclassification/cclass_unicode_parser.cxx
@@ -906,8 +906,9 @@ void cclass_Unicode::parseText( ParseResult& r, const 
OUString& rText, sal_Int32
 {
 if ( cLast == '\\' )
 {   // escaped
-aSymbol.append(rText.subView(postSymbolIndex, 
nextCharIndex - postSymbolIndex - 2));
-aSymbol.append(OUString(¤t, 1));
+aSymbol.append(
+
OUString::Concat(rText.subView(postSymbolIndex, nextCharIndex - postSymbolIndex 
- 2))
++ OUString(¤t, 1));
 }
 else
 {
@@ -931,8 +932,9 @@ void cclass_Unicode::parseText( ParseResult& r, const 
OUString& rText, sal_Int32
 {
 if ( cLast == '\\' )
 {   // escaped
-aSymbol.append(rText.subView(postSymbolIndex, 
nextCharIndex - postSymbolIndex - 2));
-aSymbol.append(OUString(¤t, 1));
+aSymbol.append(
+rText.subView(postSymbolIndex, nextCharIndex - 
postSymbolIndex - 2)
++ OUString(¤t, 1));
 }
 else if (current == nextChar &&
 !(nContTypes & 
KParseTokens::TWO_DOUBLE_QUOTES_BREAK_STRING) )
diff --git 
a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx 
b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
index 8ab363672f9e..29be9856a02d 100644
--- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
+++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
@@ -1129,8 +1129,7 @@ OUString 
DefaultNumberingProvider::makeNumberingIdentifier(sal_Int16 index)
 aPropertiesRange[1].Name = "Value";
 for (sal_Int32 j = 1; j <= 3; j++) {
 aPropertiesRange[1].Value <<= j;
-result.append( makeNumberingString( aProperties, aLocale ) );
-result.append(", ");
+result.append( makeNumberingString( aProperties, aLocale ) + ", " 
);
 }
 result.append("...");
 // Make known duplicate generated identifiers unique.
diff --git a/i18nutil/source/utility/unicode.cxx 
b/i18nutil/source/utility/unicode.cxx
index 730b5105d52c..35bfb25f728f 100644
--- a/i18nutil/source/utility/unicode.cxx
+++ b/i18nutil/source/utility/unicode.cxx
@@ -1127,8 +1127,7 @@ OUString ToggleUnicodeCodepoint::ReplacementString()
 //pad with zeros - minimum length of 4.
 for( sal_Int32 i = 4 - aTmp.getLength(); i > 0; --i )
 aTmp.insert( 0,"0" );
-output.append( "U+" );
-output.append( aTmp );
+output.append( "U+" + aTmp );
 }
 }
 return output.makeStringAndClear();
diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx
index 9aba715edaf4..229696b021ec 100644
--- a/idl/source/prj/database.cxx
+++ b/idl/source/prj/database.cxx
@@ -417,8 +417,7 @@ void SvIdlDataBase::WriteError( SvTokenStream & rInStm )
 // error text
 if( !

[Libreoffice-commits] core.git: i18npool/source i18nutil/source include/i18nutil

2018-12-19 Thread Libreoffice Gerrit user
 i18npool/source/transliteration/halfwidthToFullwidth.cxx |2 +-
 i18nutil/source/utility/widthfolding.cxx |2 +-
 include/i18nutil/widthfolding.hxx|2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 6c9effd0e5a76ce18a211c5f8b41e00187e67ed4
Author: Andrea Gelmini 
AuthorDate: Wed Dec 19 15:14:57 2018 +
Commit: Julien Nabet 
CommitDate: Thu Dec 20 08:49:50 2018 +0100

Fix typo in code

It passed "make check" on Linux

Change-Id: I577f6ff01e8216ed85556ce4b3365fd924f75608
Reviewed-on: https://gerrit.libreoffice.org/65468
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/i18npool/source/transliteration/halfwidthToFullwidth.cxx 
b/i18npool/source/transliteration/halfwidthToFullwidth.cxx
index 4857f2896ecf..e9d6ebd89c61 100644
--- a/i18npool/source/transliteration/halfwidthToFullwidth.cxx
+++ b/i18npool/source/transliteration/halfwidthToFullwidth.cxx
@@ -78,7 +78,7 @@ halfwidthToFullwidthLikeJIS::transliterateImpl( const 
OUString& inStr, sal_Int32
 const OUString& newStr = transliteration_OneToOne::transliterateImpl( 
inStr, startPos, nCount, offset, false);
 
 // Composition: KA + voice-mark --> GA
-return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr, 0, 
newStr.getLength(), offset, useOffset, WIDTHFOLDNIG_DONT_USE_COMBINED_VU );
+return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr, 0, 
newStr.getLength(), offset, useOffset, WIDTHFOLDING_DONT_USE_COMBINED_VU );
 }
 
 
diff --git a/i18nutil/source/utility/widthfolding.cxx 
b/i18nutil/source/utility/widthfolding.cxx
index 62c4aa14b1e5..5b6b33b1426e 100644
--- a/i18nutil/source/utility/widthfolding.cxx
+++ b/i18nutil/source/utility/widthfolding.cxx
@@ -161,7 +161,7 @@ OUString widthfolding::compose_ja_voiced_sound_marks (const 
OUString& inStr, sal
 bCompose = true;
 
   // not to use combined KATAKANA LETTER VU
-  if ( previousChar == 0x30a6 && (nFlags & 
WIDTHFOLDNIG_DONT_USE_COMBINED_VU) )
+  if ( previousChar == 0x30a6 && (nFlags & 
WIDTHFOLDING_DONT_USE_COMBINED_VU) )
 bCompose = false;
 
   if( bCompose ){
diff --git a/include/i18nutil/widthfolding.hxx 
b/include/i18nutil/widthfolding.hxx
index 310bf954a304..90048110ce1f 100644
--- a/include/i18nutil/widthfolding.hxx
+++ b/include/i18nutil/widthfolding.hxx
@@ -28,7 +28,7 @@ namespace i18nutil { class oneToOneMapping; }
 
 namespace i18nutil {
 
-#define WIDTHFOLDNIG_DONT_USE_COMBINED_VU 0x01
+#define WIDTHFOLDING_DONT_USE_COMBINED_VU 0x01
 
 class I18NUTIL_DLLPUBLIC widthfolding
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: i18npool/source i18nutil/source

2014-12-17 Thread Michael Weghorn
 i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx |2 
 i18npool/source/localedata/localedata.cxx |   65 
++
 i18npool/source/search/levdis.cxx |4 
 i18npool/source/transliteration/textToPronounce_zh.cxx|5 
 i18nutil/source/utility/oneToOneMapping.cxx   |   12 -
 i18nutil/source/utility/widthfolding.cxx  |   12 -
 6 files changed, 32 insertions(+), 68 deletions(-)

New commits:
commit 652e09f734fefb9b49787e8e565d235d504a1e73
Author: Michael Weghorn 
Date:   Wed Dec 17 17:54:18 2014 +0100

fdo#39440 reduce scope of local variables

This addresses some cppcheck warnings.

Change-Id: I7e85aca5a86f993a9906525edffbd44a179dc245
Reviewed-on: https://gerrit.libreoffice.org/13510
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git 
a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx 
b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
index 684ef2b..d790c19 100644
--- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
+++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
@@ -395,7 +395,6 @@ void lcl_formatPersianWord( sal_Int32 nNumber, OUString& 
rsResult )
 throw( IllegalArgumentException, RuntimeException )
 {
 OUStringBuffer aTemp(64);
-unsigned int nDigit;
 static const sal_Unicode asPersianWord_conjunction_data[] = 
{0x20,0x0648,0x20,0};
 OUString asPersianWord_conjunction( asPersianWord_conjunction_data );
 unsigned char nSection = 0;
@@ -409,6 +408,7 @@ void lcl_formatPersianWord( sal_Int32 nNumber, OUString& 
rsResult )
 aTemp.insert( 0, asPersianWord_conjunction).insert( 0, 
table_PersianWord_decadeX[nSection-1]);
 }
 
+unsigned int nDigit;
 if ((nDigit = nPart % 100) < 20)
 {
 if (!aTemp.isEmpty())
diff --git a/i18npool/source/localedata/localedata.cxx 
b/i18npool/source/localedata/localedata.cxx
index 85a16dc..875ab3c 100644
--- a/i18npool/source/localedata/localedata.cxx
+++ b/i18npool/source/localedata/localedata.cxx
@@ -369,13 +369,11 @@ LocaleDataImpl::~LocaleDataImpl()
 LocaleDataItem SAL_CALL
 LocaleDataImpl::getLocaleItem( const Locale& rLocale ) throw(RuntimeException, 
std::exception)
 {
-sal_Unicode **dataItem = NULL;
-
 MyFunc_Type func = (MyFunc_Type) getFunctionSymbol( rLocale, 
"getLocaleItem" );
 
 if ( func ) {
 sal_Int16 dataItemCount = 0;
-dataItem = func(dataItemCount);
+sal_Unicode **dataItem = func(dataItemCount);
 
 LocaleDataItem item(
 dataItem[0],
@@ -444,13 +442,11 @@ lcl_LookupTableHelper::lcl_LookupTableHelper()
 
 lcl_LookupTableHelper::~lcl_LookupTableHelper()
 {
-LocaleDataLookupTableItem* pItem = 0;
-
 std::vector::const_iterator 
aEnd(maLookupTable.end());
 std::vector::iterator 
aIter(maLookupTable.begin());
 
 for ( ; aIter != aEnd; ++aIter ) {
-pItem = *aIter;
+LocaleDataLookupTableItem* pItem = *aIter;
 delete pItem->module;
 delete pItem;
 }
@@ -480,13 +476,12 @@ oslGenericFunction SAL_CALL 
lcl_LookupTableHelper::getFunctionSymbolByName(
 (bFallback && aFallback.equalsAscii(aLibTable[i].pLocale)))
 {
 #ifndef DISABLE_DYNLOADING
-LocaleDataLookupTableItem* pCurrent = 0;
 OUStringBuffer aBuf(strlen(aLibTable[i].pLocale) + 1 + 
strlen(pFunction));
 {
 ::osl::MutexGuard aGuard( maMutex );
 for (size_t l = 0; l < maLookupTable.size(); l++)
 {
-pCurrent = maLookupTable[l];
+LocaleDataLookupTableItem* pCurrent = maLookupTable[l];
 if (pCurrent->dllName == aLibTable[i].pLib)
 {
 OSL_ASSERT( pOutCachedItem );
@@ -761,13 +756,11 @@ LocaleDataImpl::getAllCalendars( const Locale& rLocale ) 
throw(RuntimeException,
 Sequence< Currency2 > SAL_CALL
 LocaleDataImpl::getAllCurrencies2( const Locale& rLocale ) 
throw(RuntimeException, std::exception)
 {
-sal_Unicode **allCurrencies = NULL;
-
 MyFunc_Type func = (MyFunc_Type) getFunctionSymbol( rLocale, 
"getAllCurrencies" );
 
 if ( func ) {
 sal_Int16 currencyCount = 0;
-allCurrencies = func(currencyCount);
+sal_Unicode **allCurrencies = func(currencyCount);
 
 Sequence< Currency2 > seq(currencyCount);
 for(int i = 0, nOff = 0; i < currencyCount; i++, nOff += 8 ) {
@@ -896,14 +889,12 @@ LocaleDataImpl::getAllFormats( const Locale& rLocale ) 
throw(RuntimeException, s
 Sequence< OUString > SAL_CALL
 LocaleDataImpl::getDateAcceptancePatterns( const Locale& rLocale ) 
throw(RuntimeException, std::exception)
 {
-sal_Unicode **patternsArray = NULL;
-
 MyFunc_Type func = (MyFunc_Type) getF