i18npool/inc/transliteration_body.hxx |4 -
i18npool/source/characterclassification/cclass_unicode.cxx |6 -
i18npool/source/transliteration/transliteration_body.cxx | 38
+-
i18npool/source/transliteration/transliteration_caseignore.cxx |2
i18nutil/source/utility/casefolding.cxx| 30 +--
include/i18nutil/casefolding.hxx | 38
+-
6 files changed, 64 insertions(+), 54 deletions(-)
New commits:
commit 33efbfda45a96f540f976abf3dc00ab256872af4
Author: Noel Grandin
Date: Tue May 10 15:04:39 2016 +0200
convert MappingType to scoped enum
Change-Id: I1f00e1fbdb9213d0c2f30da116684b77842282f5
Reviewed-on: https://gerrit.libreoffice.org/24851
Tested-by: Jenkins
Reviewed-by: Noel Grandin
diff --git a/i18npool/inc/transliteration_body.hxx
b/i18npool/inc/transliteration_body.hxx
index 01757b9..5561699 100644
--- a/i18npool/inc/transliteration_body.hxx
+++ b/i18npool/inc/transliteration_body.hxx
@@ -56,7 +56,7 @@ public:
const OUString& str2 ) throw(css::uno::RuntimeException,
std::exception) override;
protected:
-sal_uInt8 nMappingType;
+MappingType nMappingType;
};
class Transliteration_u2l : public Transliteration_body
@@ -75,7 +75,7 @@ class Transliteration_casemapping : public
Transliteration_body
{
public:
Transliteration_casemapping();
-void SAL_CALL setMappingType(const sal_uInt8 rMappingType, const
css::lang::Locale& rLocale );
+void SAL_CALL setMappingType(const MappingType rMappingType, const
css::lang::Locale& rLocale );
};
class Transliteration_togglecase : public Transliteration_body
diff --git a/i18npool/source/characterclassification/cclass_unicode.cxx
b/i18npool/source/characterclassification/cclass_unicode.cxx
index e9e9612..c4a8bab 100644
--- a/i18npool/source/characterclassification/cclass_unicode.cxx
+++ b/i18npool/source/characterclassification/cclass_unicode.cxx
@@ -63,7 +63,7 @@ cclass_Unicode::toUpper( const OUString& Text, sal_Int32
nPos, sal_Int32 nCount,
if (nCount + nPos > len)
nCount = len - nPos;
-trans->setMappingType(MappingTypeToUpper, rLocale);
+trans->setMappingType(MappingType::ToUpper, rLocale);
return trans->transliterateString2String(Text, nPos, nCount);
}
@@ -75,7 +75,7 @@ cclass_Unicode::toLower( const OUString& Text, sal_Int32
nPos, sal_Int32 nCount,
if (nCount + nPos > len)
nCount = len - nPos;
-trans->setMappingType(MappingTypeToLower, rLocale);
+trans->setMappingType(MappingType::ToLower, rLocale);
return trans->transliterateString2String(Text, nPos, nCount);
}
@@ -89,7 +89,7 @@ cclass_Unicode::toTitle( const OUString& Text, sal_Int32
nPos, sal_Int32 nCount,
if (nCount + nPos > len)
nCount = len - nPos;
-trans->setMappingType(MappingTypeToTitle, rLocale);
+trans->setMappingType(MappingType::ToTitle, rLocale);
rtl_uString* pStr = rtl_uString_alloc(nCount);
sal_Unicode* out = pStr->buffer;
Reference< BreakIteratorImpl > xBrk(new BreakIteratorImpl(m_xContext));
diff --git a/i18npool/source/transliteration/transliteration_body.cxx
b/i18npool/source/transliteration/transliteration_body.cxx
index 982c80c..0470ed4 100644
--- a/i18npool/source/transliteration/transliteration_body.cxx
+++ b/i18npool/source/transliteration/transliteration_body.cxx
@@ -40,7 +40,7 @@ namespace com { namespace sun { namespace star { namespace
i18n {
Transliteration_body::Transliteration_body()
{
-nMappingType = 0;
+nMappingType = MappingType::NONE;
transliterationName = "Transliteration_body";
implementationName =
"com.sun.star.i18n.Transliteration.Transliteration_body";
}
@@ -68,22 +68,22 @@ Transliteration_body::transliterateRange( const OUString&
str1, const OUString&
return ostr;
}
-static sal_uInt8 lcl_getMappingTypeForToggleCase( sal_uInt8 nMappingType,
sal_Unicode cChar )
+static MappingType lcl_getMappingTypeForToggleCase( MappingType nMappingType,
sal_Unicode cChar )
{
-sal_uInt8 nRes = nMappingType;
+MappingType nRes = nMappingType;
// take care of TOGGLE_CASE transliteration:
// nMappingType should not be a combination of flags, thuse we decide now
// which one to use.
-if (nMappingType == (MappingTypeLowerToUpper | MappingTypeUpperToLower))
+if (nMappingType == (MappingType::LowerToUpper |
MappingType::UpperToLower))
{
const sal_Int16 nType = unicode::getUnicodeType( cChar );
if (nType & 0x02 /* lower case*/)
-nRes = MappingTypeLowerToUpper;
+nRes = MappingType::LowerToUpper;
else
{
// should also work properly for non-upper characters like white
spaces, numbers, ...
-nRes = MappingTypeUpperToLower;
+nRes = MappingType::UpperToLower;
}
}
@@ -106,8 +106,8 @@ Transli