25#include <osl/diagnose.h>
29#include <com/sun/star/beans/PropertyValue.hpp>
30#include <com/sun/star/lang/Locale.hpp>
34#include <unordered_set>
65 static const char* aTranslitNames[] =
68 "Japanese/IsMatchFullHalfWidthForms",
69 "Japanese/IsMatchHiraganaKatakana",
70 "Japanese/IsMatchContractions",
71 "Japanese/IsMatchMinusDashCho-on",
72 "Japanese/IsMatchRepeatCharMarks",
73 "Japanese/IsMatchVariantFormKanji",
74 "Japanese/IsMatchOldKanaForms",
75 "Japanese/IsMatch_DiZi_DuZu",
76 "Japanese/IsMatch_BaVa_HaFa",
77 "Japanese/IsMatch_TsiThiChi_DhiZi",
78 "Japanese/IsMatch_HyuIyu_ByuVyu",
79 "Japanese/IsMatch_SeShe_ZeJe",
80 "Japanese/IsMatch_IaIya",
81 "Japanese/IsMatch_KiKu",
82 "Japanese/IsIgnorePunctuation",
83 "Japanese/IsIgnoreWhitespace",
84 "Japanese/IsIgnoreProlongedSoundMark",
85 "Japanese/IsIgnoreMiddleDot",
86 "IsIgnoreDiacritics_CTL",
92 OUString* pNames = aNames.getArray();
94 pNames[
i] = OUString::createFromAscii( aTranslitNames[
i] );
105 m_aSearchOpt ( SearchFlags::LEV_RELAXED,
111 SearchAlgorithms2::
ABSOLUTE,
'\\' ),
116 m_bRowDirection ( true ),
117 m_bAllTables ( false ),
118 m_bSearchFiltered ( false ),
119 m_bSearchFormatted( false ),
121 m_bBackward ( false ),
122 m_bPattern ( false ),
123 m_bContent ( false ),
124 m_bAsianOptions ( false ),
154 rFlags |= TransliterationFlags::IGNORE_CASE;
156 rFlags |= TransliterationFlags::IGNORE_WIDTH;
158 rFlags |= TransliterationFlags::IGNORE_DIACRITICS_CTL ;
160 rFlags |= TransliterationFlags::IGNORE_KASHIDA_CTL ;
165 rFlags |= TransliterationFlags::IGNORE_KANA;
167 rFlags |= TransliterationFlags::ignoreSize_ja_JP;
169 rFlags |= TransliterationFlags::ignoreMinusSign_ja_JP;
171 rFlags |= TransliterationFlags::ignoreIterationMark_ja_JP;
173 rFlags |= TransliterationFlags::ignoreTraditionalKanji_ja_JP;
175 rFlags |= TransliterationFlags::ignoreTraditionalKana_ja_JP;
177 rFlags |= TransliterationFlags::ignoreZiZu_ja_JP;
179 rFlags |= TransliterationFlags::ignoreBaFa_ja_JP;
181 rFlags |= TransliterationFlags::ignoreTiJi_ja_JP;
183 rFlags |= TransliterationFlags::ignoreHyuByu_ja_JP;
185 rFlags |= TransliterationFlags::ignoreSeZe_ja_JP;
187 rFlags |= TransliterationFlags::ignoreIandEfollowedByYa_ja_JP;
189 rFlags |= TransliterationFlags::ignoreKiKuFollowedBySa_ja_JP;
191 rFlags |= TransliterationFlags::ignoreSeparator_ja_JP;
193 rFlags |= TransliterationFlags::ignoreSpace_ja_JP;
195 rFlags |= TransliterationFlags::ignoreProlongedSoundMark_ja_JP;
197 rFlags |= TransliterationFlags::ignoreMiddleDot_ja_JP;
206 m_aSearchOpt ( rItem.m_aSearchOpt ),
207 m_eFamily ( rItem.m_eFamily ),
208 m_nCommand ( rItem.m_nCommand ),
209 m_nCellType ( rItem.m_nCellType ),
210 m_nAppFlag ( rItem.m_nAppFlag ),
211 m_bRowDirection ( rItem.m_bRowDirection ),
212 m_bAllTables ( rItem.m_bAllTables ),
213 m_bSearchFiltered ( rItem.m_bSearchFiltered ),
214 m_bSearchFormatted ( rItem.m_bSearchFormatted ),
215 m_bNotes ( rItem.m_bNotes),
216 m_bBackward ( rItem.m_bBackward ),
217 m_bPattern ( rItem.m_bPattern ),
218 m_bContent ( rItem.m_bContent ),
219 m_bAsianOptions ( rItem.m_bAsianOptions ),
220 m_nStartPointX(rItem.m_nStartPointX),
221 m_nStartPointY(rItem.m_nStartPointY)
254 assert(SfxPoolItem::operator==(rItem));
260 bool bIgnoreCommand)
const
338 SearchFlags::REG_NOT_ENDOFLINE);
343 SearchFlags::REG_NOT_ENDOFLINE);
403 nMemberId &= ~CONVERT_TWIPS;
432 rVal <<= static_cast<sal_Int16>(
m_nCommand);
break;
434 rVal <<= static_cast<sal_Int16>(
m_eFamily);
break;
436 rVal <<= static_cast<sal_Int32>(
m_nCellType);
break;
478 rVal <<= static_cast<sal_Int16>(
static_cast<sal_uInt16
>(nLocale));
483 SAL_WARN(
"svl.items",
"SvxSearchItem::QueryValue(): Unknown MemberId" );
493 nMemberId &= ~CONVERT_TWIPS;
494 auto ExtractNumericAny = [](
const css::uno::Any&
a,
auto& target)
499 target =
static_cast<std::remove_reference_t<decltype(target)
>>(nInt);
509 std::unordered_set<OUString> aConvertedParams;
510 for (
const auto& rProp :
aSeq)
514 if (css::util::SearchOptions2 nTmpSearchOpt2; rProp.Value >>= nTmpSearchOpt2)
517 aConvertedParams.insert(rProp.Name);
523 aConvertedParams.insert(rProp.Name);
528 aConvertedParams.insert(rProp.Name);
533 aConvertedParams.insert(rProp.Name);
537 if (ExtractNumericAny(rProp.Value,
m_nAppFlag))
538 aConvertedParams.insert(rProp.Name);
543 aConvertedParams.insert(rProp.Name);
548 aConvertedParams.insert(rProp.Name);
553 aConvertedParams.insert(rProp.Name);
558 aConvertedParams.insert(rProp.Name);
563 aConvertedParams.insert(rProp.Name);
568 aConvertedParams.insert(rProp.Name);
573 aConvertedParams.insert(rProp.Name);
578 aConvertedParams.insert(rProp.Name);
586 return ExtractNumericAny(rVal,
m_eFamily);
606 if (SearchAlgorithms eVal; ExtractNumericAny(rVal, eVal))
641 OSL_FAIL(
"Unknown MemberId" );
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
static LanguageType convertToLanguageType(const css::lang::Locale &rLocale, bool bResolveSystem=true)
Base class for providers of defaults of SfxPoolItems.
bool IsMatchBavaHafa() const
bool IsMatchTsithichiDhizi() const
bool IsMatchVariantFormKanji() const
bool IsMatchIaiya() const
bool IsMatchDiziDuzu() const
bool IsMatchHiraganaKatakana() const
bool IsMatchFullHalfWidthForms() const
bool IsIgnoreMiddleDot() const
bool IsWholeWordsOnly() const
bool IsUseRegularExpression() const
bool IsIgnoreKashida_CTL() const
bool IsMatchOldKanaForms() const
bool IsSimilaritySearch() const
bool IsMatchContractions() const
bool IsIgnorePunctuation() const
bool IsUseWildcard() const
bool IsIgnoreProlongedSoundMark() const
bool IsMatchRepeatCharMarks() const
bool IsIgnoreDiacritics_CTL() const
bool IsIgnoreWhitespace() const
bool IsMatchHyuiyuByuvyu() const
bool IsMatchMinusDashChoon() const
bool IsMatchSesheZeje() const
bool IsUseAsianOptions() const
bool HasStartPoint() const
Either x or y start point is set.
SvxSearchItem(const sal_uInt16 nId)
static SfxPoolItem * CreateDefault()
void SetLevenshtein(bool bVal)
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
This virtual method allows to get a textual representation of the value for the SfxPoolItem subclasse...
virtual ~SvxSearchItem() override
virtual bool operator==(const SfxPoolItem &) const override
void SetSelection(bool bNewSelection)
i18nutil::SearchOptions2 m_aSearchOpt
void SetLEVRelaxed(bool bSet)
bool equalsIgnoring(const SvxSearchItem &rSItem, bool bIgnoreReplace, bool bIgnoreCommand) const
void SetExact(bool bNewExact)
void SetTransliterationFlags(TransliterationFlags nFlags)
virtual SvxSearchItem * Clone(SfxItemPool *pPool=nullptr) const override
void SetMatchFullHalfWidthForms(bool bVal)
void SetRegExp(bool bVal)
void SetWordOnly(bool bNewWordOnly)
virtual void ImplCommit() override
sal_Int32 GetStartPointX() const
TransliterationFlags GetTransliterationFlags() const
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
SvxSearchCellType m_nCellType
virtual void Notify(const css::uno::Sequence< OUString > &rPropertyNames) override
void SetWildcard(bool bVal)
sal_Int32 GetStartPointY() const
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
bool EnableNotification(const css::uno::Sequence< OUString > &rNames, bool bEnableInternalNotification=false)
Sequence< sal_Int8 > aSeq
#define SAL_WARN(area, stream)
#define SAL_N_ELEMENTS(arr)
#define MID_SEARCH_REPLACESTRING
#define MID_SEARCH_CHANGEDCHARS
#define MID_SEARCH_ASIANOPTIONS
#define MID_SEARCH_COMMAND
#define MID_SEARCH_ALGORITHMTYPE2
#define MID_SEARCH_DELETEDCHARS
#define MID_SEARCH_TRANSLITERATEFLAGS
#define MID_SEARCH_PATTERN
#define MID_SEARCH_ROWDIRECTION
#define MID_SEARCH_STARTPOINTY
#define MID_SEARCH_SEARCHSTRING
#define MID_SEARCH_CELLTYPE
#define MID_SEARCH_CONTENT
#define MID_SEARCH_INSERTEDCHARS
#define MID_SEARCH_ALGORITHMTYPE
#define MID_SEARCH_SEARCHFILTERED
#define MID_SEARCH_SEARCHFORMATTED
#define MID_SEARCH_STARTPOINTX
#define MID_SEARCH_STYLEFAMILY
#define MID_SEARCH_BACKWARD
#define MID_SEARCH_ALLTABLES
#define MID_SEARCH_LOCALE
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
constexpr css::util::SearchAlgorithms downgradeSearchAlgorithms2(sal_Int16 searchAlgorithms2)
constexpr sal_Int16 upgradeSearchAlgorithms(css::util::SearchAlgorithms searchAlgorithms)
static bool equalsWithoutLocaleOrReplace(const i18nutil::SearchOptions2 &rItem1, const i18nutil::SearchOptions2 &rItem2)
used below
constexpr OUStringLiteral SRCH_PARA_ALLTABLES
constexpr OUStringLiteral SRCH_PARA_OPTIONS
constexpr OUStringLiteral CFG_ROOT_NODE
constexpr OUStringLiteral SRCH_PARA_CONTENT
static Sequence< OUString > lcl_GetNotifyNames()
constexpr OUStringLiteral SRCH_PARA_PATTERN
constexpr OUStringLiteral SRCH_PARA_FAMILY
constexpr OUStringLiteral SRCH_PARA_COMMAND
constexpr OUStringLiteral SRCH_PARA_APPFLAG
constexpr OUStringLiteral SRCH_PARA_ROWDIR
constexpr OUStringLiteral SRCH_PARA_BACKWARD
constexpr OUStringLiteral SRCH_PARA_SEARCHFILTERED
constexpr OUStringLiteral SRCH_PARA_ASIANOPT
constexpr OUStringLiteral SRCH_PARA_SEARCHFORMATTED
constexpr OUStringLiteral SRCH_PARA_CELLTYPE
css::util::SearchOptions2 toUnoSearchOptions2() const
TransliterationFlags transliterateFlags
sal_Int32 WildcardEscapeCharacter