diff options
-rw-r--r-- | include/unotools/searchopt.hxx | 2 | ||||
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Common.xcs | 9 | ||||
-rw-r--r-- | unotools/source/config/searchopt.cxx | 35 |
3 files changed, 42 insertions, 4 deletions
diff --git a/include/unotools/searchopt.hxx b/include/unotools/searchopt.hxx index 5accfba2a2db..fe8509b0cb42 100644 --- a/include/unotools/searchopt.hxx +++ b/include/unotools/searchopt.hxx @@ -45,6 +45,7 @@ public: bool IsWholeWordsOnly() const; bool IsBackwards() const; bool IsUseRegularExpression() const; + bool IsUseWildcard() const; bool IsSimilaritySearch() const; bool IsUseAsianOptions() const; bool IsMatchCase() const; // also Japanese search option @@ -54,6 +55,7 @@ public: void SetWholeWordsOnly( bool bVal ); void SetBackwards( bool bVal ); void SetUseRegularExpression( bool bVal ); + void SetUseWildcard( bool bVal ); void SetSearchForStyles( bool bVal ); void SetSimilaritySearch( bool bVal ); void SetUseAsianOptions( bool bVal ); diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index 1655acb0d1d0..e06114ec195f 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -5936,6 +5936,15 @@ </info> <value>false</value> </prop> + <prop oor:name="IsUseWildcard" oor:type="xs:boolean" oor:nillable="false"> + <!-- OldPath: --> + <!-- OldLocation: --> + <!-- UIHints: Edit/Find & Replace --> + <info> + <desc>Specifies search with the use of wildcards.</desc> + </info> + <value>false</value> + </prop> <prop oor:name="IsUseRegularExpression" oor:type="xs:boolean" oor:nillable="false"> <!-- OldPath: --> <!-- OldLocation: --> diff --git a/unotools/source/config/searchopt.cxx b/unotools/source/config/searchopt.cxx index cc491e09743e..be8716fd85bf 100644 --- a/unotools/source/config/searchopt.cxx +++ b/unotools/source/config/searchopt.cxx @@ -33,7 +33,7 @@ using namespace utl; using namespace com::sun::star::uno; using namespace com::sun::star::i18n; -#define MAX_FLAGS_OFFSET 28 +#define MAX_FLAGS_OFFSET 29 class SvtSearchOptions_Impl : public ConfigItem { @@ -63,6 +63,7 @@ public: bool GetFlag( sal_uInt16 nOffset ) const; void SetFlag( sal_uInt16 nOffset, bool bVal ); + void SetSearchAlgorithm( sal_uInt16 nOffset, bool bVal ); }; SvtSearchOptions_Impl::SvtSearchOptions_Impl() : @@ -144,12 +145,13 @@ Sequence< OUString > SvtSearchOptions_Impl::GetPropertyNames() "Japanese/IsMatch_KiKu", // 20 "Japanese/IsIgnorePunctuation", // 21 "Japanese/IsIgnoreWhitespace", // 22 - "Japanese/IsIgnoreProlongedSoundMark", // 23 + "Japanese/IsIgnoreProlongedSoundMark", // 23 "Japanese/IsIgnoreMiddleDot", // 24 "IsNotes", // 25 "IsIgnoreDiacritics_CTL", // 26 "IsIgnoreKashida_CTL", // 27 "IsSearchFormatted" // 28 + "IsUseWildcard" // 29 }; const int nCount = SAL_N_ELEMENTS( aPropNames ); @@ -161,6 +163,21 @@ Sequence< OUString > SvtSearchOptions_Impl::GetPropertyNames() return aNames; } +void SvtSearchOptions_Impl::SetSearchAlgorithm( sal_uInt16 nOffset, bool bVal ) +{ + if (bVal) + { + // Search algorithms are mutually exclusive. + if (nOffset != 2 && GetFlag(2)) + SetFlag( 2, false ); + if (nOffset != 4 && GetFlag(4)) + SetFlag( 4, false ); + if (nOffset != 29 && GetFlag(29)) + SetFlag( 29, false ); + } + SetFlag( nOffset, bVal ); +} + void SvtSearchOptions_Impl::Load() { bool bSucc = false; @@ -327,7 +344,7 @@ bool SvtSearchOptions::IsUseRegularExpression() const void SvtSearchOptions::SetUseRegularExpression( bool bVal ) { - pImpl->SetFlag( 2, bVal ); + pImpl->SetSearchAlgorithm( 2, bVal ); } void SvtSearchOptions::SetSearchForStyles( bool bVal ) @@ -342,7 +359,7 @@ bool SvtSearchOptions::IsSimilaritySearch() const void SvtSearchOptions::SetSimilaritySearch( bool bVal ) { - pImpl->SetFlag( 4, bVal ); + pImpl->SetSearchAlgorithm( 4, bVal ); } bool SvtSearchOptions::IsUseAsianOptions() const @@ -585,4 +602,14 @@ void SvtSearchOptions::SetSearchFormatted( bool bVal ) pImpl->SetFlag( 28, bVal ); } +bool SvtSearchOptions::IsUseWildcard() const +{ + return pImpl->GetFlag( 29 ); +} + +void SvtSearchOptions::SetUseWildcard( bool bVal ) +{ + pImpl->SetSearchAlgorithm( 29, bVal ); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |