[Libreoffice-commits] core.git: include/i18nutil include/svl include/unotools include/vcl sfx2/source svl/source sw/qa sw/source unotools/source vcl/source
include/i18nutil/searchopt.hxx | 113 - include/svl/srchitem.hxx | 13 --- include/unotools/textsearch.hxx|7 -- include/vcl/textview.hxx |6 - include/vcl/xtextedt.hxx |4 - sfx2/source/doc/SfxRedactionHelper.cxx |2 svl/source/items/srchitem.cxx | 27 +++ sw/qa/core/macros-test.cxx |4 - sw/qa/extras/uiwriter/uiwriter7.cxx|3 sw/source/core/crsr/findtxt.cxx|6 - sw/source/core/edit/edtox.cxx |1 sw/source/core/unocore/unosrch.cxx |3 sw/source/ui/index/swuiidxmrk.cxx |1 sw/source/uibase/uiview/view2.cxx |2 unotools/source/i18n/textsearch.cxx| 39 --- vcl/source/edit/textview.cxx |4 - vcl/source/edit/xtextedt.cxx |6 - 17 files changed, 85 insertions(+), 156 deletions(-) New commits: commit 67c807ada5d7930f262ace9798629c06f0175a86 Author: Mike Kaganski AuthorDate: Wed Jun 28 05:47:16 2023 +0300 Commit: Mike Kaganski CommitDate: Wed Jun 28 11:06:54 2023 +0200 Drop i18nutil::SearchOptions It was mostly unused by now, only remained in a couple of function arguments, where callers actually passed SearchOptions2, and where internally it was converted back to SearchOptions2. Change-Id: Ib188ec3bf0de6d1f70a04eb90fb3a577df8b3d98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153687 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/include/i18nutil/searchopt.hxx b/include/i18nutil/searchopt.hxx index c215da0d296f..0fd5f98676d4 100644 --- a/include/i18nutil/searchopt.hxx +++ b/include/i18nutil/searchopt.hxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -29,12 +30,42 @@ namespace i18nutil { +inline constexpr css::util::SearchAlgorithms downgradeSearchAlgorithms2(sal_Int16 searchAlgorithms2) +{ +switch (searchAlgorithms2) +{ +case css::util::SearchAlgorithms2::ABSOLUTE: +return css::util::SearchAlgorithms_ABSOLUTE; +case css::util::SearchAlgorithms2::REGEXP: +return css::util::SearchAlgorithms_REGEXP; +case css::util::SearchAlgorithms2::APPROXIMATE: +return css::util::SearchAlgorithms_APPROXIMATE; +default: // default what? +case css::util::SearchAlgorithms2::WILDCARD: // something valid +return css::util::SearchAlgorithms_ABSOLUTE; +} +} + +inline constexpr sal_Int16 upgradeSearchAlgorithms(css::util::SearchAlgorithms searchAlgorithms) +{ +switch (searchAlgorithms) +{ +default: // default what? +case css::util::SearchAlgorithms_ABSOLUTE: +return css::util::SearchAlgorithms2::ABSOLUTE; +case css::util::SearchAlgorithms_REGEXP: +return css::util::SearchAlgorithms2::REGEXP; +case css::util::SearchAlgorithms_APPROXIMATE: +return css::util::SearchAlgorithms2::APPROXIMATE; +} +} + /** - * This is a wrapper around com::sun::star::util::SearchOptions - * but using the more type-safe TransliterationFlags enum. + * This is a wrapper around com::sun::star::util::SearchOptions and SearchOptions2, + * but using the more type-safe TransliterationFlags enum, and without obsolete + * algorithmType, which is superseded by AlgorithmType2. */ -struct SAL_WARN_UNUSED SearchOptions { -css::util::SearchAlgorithms algorithmType; +struct SAL_WARN_UNUSED SearchOptions2 { sal_Int32 searchFlag; OUString searchString; OUString replaceString; @@ -44,9 +75,11 @@ struct SAL_WARN_UNUSED SearchOptions { sal_Int32 insertedChars; TransliterationFlags transliterateFlags; -SearchOptions& operator=(css::util::SearchOptions const & other) +sal_Int16 AlgorithmType2; +sal_Int32 WildcardEscapeCharacter; + +SearchOptions2& operator=(css::util::SearchOptions2 const & other) { -algorithmType = other.algorithmType; searchFlag = other.searchFlag; searchString = other.searchString; replaceString = other.replaceString; @@ -55,58 +88,14 @@ struct SAL_WARN_UNUSED SearchOptions { deletedChars = other.deletedChars; insertedChars = other.insertedChars; transliterateFlags = static_cast(other.transliterateFlags); -return *this; -} - -SearchOptions() -: algorithmType(::css::util::SearchAlgorithms_ABSOLUTE) -, searchFlag(0) -, changedChars(0) -, deletedChars(0) -, insertedChars(0) -, transliterateFlags(TransliterationFlags::NONE) -{ -} - -SearchOptions(const css::util::SearchAlgorithms& algorithmType_, const sal_Int32 searchFlag_, - OUString searchString_, OUString replaceString_, - css::lang::Locale Locale_, - const sal_Int32 changedChars_, const sal_Int32 deletedChars_,
[Libreoffice-commits] core.git: include/i18nutil vcl/inc vcl/source
include/i18nutil/paper.hxx |4 vcl/inc/print.hrc |3 +++ vcl/source/gdi/print.cxx |1 + 3 files changed, 8 insertions(+) New commits: commit ae6f7eecfc62442584473034853539706b03f7af Author: Tor Lillqvist AuthorDate: Tue Nov 2 18:14:48 2021 +0200 Commit: Tor Lillqvist CommitDate: Tue Nov 2 19:15:08 2021 +0100 Add comments to two arrays mentioning that they must match the enum Paper At least I think they must. Also add a comment to the enum pointing at those arrays. There are now four different places in four files that must be manually kept in sync. Quite possibly more. This stinks. Change-Id: I7b5c721329c69a16b8cdf07390d481ec77c7b5ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124610 Tested-by: Jenkins Reviewed-by: Tor Lillqvist diff --git a/include/i18nutil/paper.hxx b/include/i18nutil/paper.hxx index 71ca22bb9486..b84d7b3af074 100644 --- a/include/i18nutil/paper.hxx +++ b/include/i18nutil/paper.hxx @@ -32,6 +32,10 @@ struct Locale; //!! The values of the following enumerators must correspond to the array position //!! of the respective paper size in the file i18nutil/source/utility/paper.cxx //!! Thus don't reorder the enum values here without changing the code there as well. + +//!! Also the RID_STR_PAPERNAMES array in vcl/inc/print.hrc and the +//!! PaperIndex array in Printer::GetPaperName() in +//!! vcl/source/gdi/print.cxx are parallel to this enum. enum Paper : unsigned { PAPER_A0, diff --git a/vcl/inc/print.hrc b/vcl/inc/print.hrc index b654a77ec3b8..7e19c4c75004 100644 --- a/vcl/inc/print.hrc +++ b/vcl/inc/print.hrc @@ -27,6 +27,9 @@ const TranslateId RID_STR_PAPERNAMES[] = { // To translators: This is the first entry of a sequence of paper size names + +// This array must (probably) match exactly the enum Paper in + NC_("RID_STR_PAPERNAMES", "A0"), NC_("RID_STR_PAPERNAMES", "A1"), NC_("RID_STR_PAPERNAMES", "A2"), diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 1b7e4210e691..e728edf1dca3 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -1387,6 +1387,7 @@ OUString Printer::GetPaperName( Paper ePaper ) ImplSVData* pSVData = ImplGetSVData(); if( pSVData->maPaperNames.empty() ) { +// This array must (probably) match exactly the enum Paper in static const int PaperIndex[] = { PAPER_A0, PAPER_A1, PAPER_A2, PAPER_A3, PAPER_A4, PAPER_A5, PAPER_B4_ISO, PAPER_B5_ISO,
[Libreoffice-commits] core.git: include/i18nutil
include/i18nutil/casefolding.hxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 388685ea72fc22bd375e9f31a339632e175f4290 Author: Noel Grandin AuthorDate: Thu Sep 16 15:23:35 2021 +0200 Commit: Noel Grandin CommitDate: Fri Sep 17 08:39:58 2021 +0200 improve comment Change-Id: I12a29b08f5807bcb6e0a5b6e8bc5fc0f08462e44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122197 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/i18nutil/casefolding.hxx b/include/i18nutil/casefolding.hxx index 65dfc2d515d2..b15a51ae8d04 100644 --- a/include/i18nutil/casefolding.hxx +++ b/include/i18nutil/casefolding.hxx @@ -37,7 +37,8 @@ enum class MappingType { ToTitle = 0x10, // to Title mapping SimpleFolding= 0x20, // Simple Case Folding FullFolding = 0x40, // Full Case Folding -CasedLetterMask = LowerToUpper | UpperToLower | ToUpper | ToLower | ToTitle | SimpleFolding | FullFolding, // for final sigmar +// for final sigma (where the case-mapping is different for the last letter of a word) +CasedLetterMask = LowerToUpper | UpperToLower | ToUpper | ToLower | ToTitle | SimpleFolding | FullFolding, NotValue = 0x80, // Value field is an address }; namespace o3tl {
[Libreoffice-commits] core.git: include/i18nutil
include/i18nutil/unicode.hxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 3fe1049acee148c7bf7669ef9a6d39f319230c0b Author: Andrea Gelmini AuthorDate: Thu Jul 11 22:25:32 2019 + Commit: Andrea Gelmini CommitDate: Tue Jul 23 20:14:35 2019 +0200 Fix typo Change-Id: I1881e2c8cdccf9c020ed52d2e90689e6a02791b5 Reviewed-on: https://gerrit.libreoffice.org/75561 Tested-by: Jenkins Reviewed-by: Andrea Gelmini diff --git a/include/i18nutil/unicode.hxx b/include/i18nutil/unicode.hxx index c0b20a33cba8..f0db87095f71 100644 --- a/include/i18nutil/unicode.hxx +++ b/include/i18nutil/unicode.hxx @@ -51,7 +51,7 @@ public: @param nCode A Unicode code point. -@return True if code is an Unicode variation sequence selector. +@return True if code is a Unicode variation sequence selector. */ static bool isIVSSelector(sal_uInt32 nCode) { @@ -63,7 +63,7 @@ public: @param nCode A Unicode code point. -@return True if code is an Unicode base character part of CJK IVS +@return True if code is a Unicode base character part of CJK IVS */ static bool isCJKIVSCharacter(sal_uInt32 nCode) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/i18nutil offapi/com
include/i18nutil/transliteration.hxx |2 ++ offapi/com/sun/star/i18n/TransliterationModulesExtra.idl | 11 ++- 2 files changed, 12 insertions(+), 1 deletion(-) New commits: commit 71bf07922b6ff45f9b31fb377d3ac24e172a5c65 Author: Eike RathkeDate: Wed Mar 7 21:29:09 2018 +0100 Clarify that IGNORE_DIACRITICS_CTL is not only CTL, despite its name Change-Id: I5954094131debb7cdf0fc44a9db3a3609b356baf diff --git a/include/i18nutil/transliteration.hxx b/include/i18nutil/transliteration.hxx index 6294c5eee1e5..f962929b2bdc 100644 --- a/include/i18nutil/transliteration.hxx +++ b/include/i18nutil/transliteration.hxx @@ -119,7 +119,9 @@ enum class TransliterationFlags { /// transliterate Japanese normal sized character to small sized character largeToSmall_ja_JP = int(css::i18n::TransliterationModules_largeToSmall_ja_JP), +/// Transliterate decomposing and removing diacritics, not only CTL, despite its name. IGNORE_DIACRITICS_CTL = int(css::i18n::TransliterationModulesExtra::IGNORE_DIACRITICS_CTL), +/// Ignore Kashida mark. IGNORE_KASHIDA_CTL = int(css::i18n::TransliterationModulesExtra::IGNORE_KASHIDA_CTL) }; namespace o3tl { diff --git a/offapi/com/sun/star/i18n/TransliterationModulesExtra.idl b/offapi/com/sun/star/i18n/TransliterationModulesExtra.idl index be82cf74821a..5a67714ba640 100644 --- a/offapi/com/sun/star/i18n/TransliterationModulesExtra.idl +++ b/offapi/com/sun/star/i18n/TransliterationModulesExtra.idl @@ -50,8 +50,17 @@ constants TransliterationModulesExtra */ const short TOGGLE_CASE = 202; -/// because we cannot extend TransliterationModule we used TranslationModuleExtra and it will act the same way +/** Ignore diacritics. Despite the _CTL name suffix this is not only +about CTL/Arabic diacritic characters, though these are handled +as well, but the transliteration decomposes and removes any +diacritic from characters. + +Because we cannot extend the TransliterationModules enum we use +TranslationModuleExtra and it will act the same way. + */ const long IGNORE_DIACRITICS_CTL = 0x4000; + +/** Ignore Kashida mark. */ const long IGNORE_KASHIDA_CTL = 0x0800; const long END_OF_MODULE= 0; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/i18nutil
include/i18nutil/searchopt.hxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 2ec7457eec4535e81e4a32b48df5ab45d39476db Author: Noel GrandinDate: Wed Mar 1 10:27:12 2017 +0200 Blind fix for 64-bit Windows builds Change-Id: Ica9e99fc363d8c7bfbc40dceb66ad350e5a02ce5 diff --git a/include/i18nutil/searchopt.hxx b/include/i18nutil/searchopt.hxx index 5fc8b1a..13a3195 100644 --- a/include/i18nutil/searchopt.hxx +++ b/include/i18nutil/searchopt.hxx @@ -33,7 +33,7 @@ namespace i18nutil * This is a wrapper around com::sun::star::util::SearchOptions * but using the more type-safe TransliterationFlags enum. */ -struct I18NUTIL_DLLPUBLIC SAL_WARN_UNUSED SearchOptions { +struct SAL_WARN_UNUSED SearchOptions { css::util::SearchAlgorithms algorithmType; sal_Int32 searchFlag; OUString searchString; @@ -93,7 +93,7 @@ struct I18NUTIL_DLLPUBLIC SAL_WARN_UNUSED SearchOptions { * This is a wrapper around com::sun::star::util::SearchOptions and SearchOptions2, * but using the more type-safe TransliterationFlags enum. */ -struct I18NUTIL_DLLPUBLIC SAL_WARN_UNUSED SearchOptions2 : public SearchOptions { +struct SAL_WARN_UNUSED SearchOptions2 : public SearchOptions { sal_Int16 AlgorithmType2; sal_Int32 WildcardEscapeCharacter; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits