xref: /aoo41x/main/svl/source/items/srchitem.cxx (revision 40df464e)
1*40df464eSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*40df464eSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*40df464eSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*40df464eSAndrew Rist  * distributed with this work for additional information
6*40df464eSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*40df464eSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*40df464eSAndrew Rist  * "License"); you may not use this file except in compliance
9*40df464eSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*40df464eSAndrew Rist  *
11*40df464eSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*40df464eSAndrew Rist  *
13*40df464eSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*40df464eSAndrew Rist  * software distributed under the License is distributed on an
15*40df464eSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*40df464eSAndrew Rist  * KIND, either express or implied.  See the License for the
17*40df464eSAndrew Rist  * specific language governing permissions and limitations
18*40df464eSAndrew Rist  * under the License.
19*40df464eSAndrew Rist  *
20*40df464eSAndrew Rist  *************************************************************/
21*40df464eSAndrew Rist 
22*40df464eSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_svl.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir // include ---------------------------------------------------------------
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include <svl/srchitem.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include <unotools/searchopt.hxx>
32cdf0e10cSrcweir #include <com/sun/star/util/XReplaceable.hpp>
33cdf0e10cSrcweir #include <com/sun/star/util/XSearchable.hpp>
34cdf0e10cSrcweir #include <com/sun/star/util/XSearchDescriptor.hpp>
35cdf0e10cSrcweir #include <com/sun/star/util/XPropertyReplace.hpp>
36cdf0e10cSrcweir #include <com/sun/star/util/XReplaceDescriptor.hpp>
37cdf0e10cSrcweir #include <com/sun/star/lang/Locale.hpp>
38cdf0e10cSrcweir #include <svl/memberid.hrc>
39cdf0e10cSrcweir #include <i18npool/mslangid.hxx>
40cdf0e10cSrcweir 
41cdf0e10cSrcweir using namespace utl;
42cdf0e10cSrcweir using namespace com::sun::star::beans;
43cdf0e10cSrcweir using namespace com::sun::star::i18n;
44cdf0e10cSrcweir using namespace com::sun::star::lang;
45cdf0e10cSrcweir using namespace com::sun::star::uno;
46cdf0e10cSrcweir using namespace com::sun::star::util;
47cdf0e10cSrcweir 
48cdf0e10cSrcweir #define CFG_ROOT_NODE       "Office.Common/SearchOptions"
49cdf0e10cSrcweir 
50cdf0e10cSrcweir #define SRCH_PARAMS         11
51cdf0e10cSrcweir #define SRCH_PARA_OPTIONS   "Options"
52cdf0e10cSrcweir #define SRCH_PARA_FAMILY    "Family"
53cdf0e10cSrcweir #define SRCH_PARA_COMMAND   "Command"
54cdf0e10cSrcweir #define SRCH_PARA_CELLTYPE  "CellType"
55cdf0e10cSrcweir #define SRCH_PARA_APPFLAG   "AppFlag"
56cdf0e10cSrcweir #define SRCH_PARA_ROWDIR    "RowDirection"
57cdf0e10cSrcweir #define SRCH_PARA_ALLTABLES "AllTables"
58cdf0e10cSrcweir #define SRCH_PARA_BACKWARD  "Backward"
59cdf0e10cSrcweir #define SRCH_PARA_PATTERN   "Pattern"
60cdf0e10cSrcweir #define SRCH_PARA_CONTENT   "Content"
61cdf0e10cSrcweir #define SRCH_PARA_ASIANOPT  "AsianOptions"
62cdf0e10cSrcweir 
63cdf0e10cSrcweir // STATIC DATA -----------------------------------------------------------
64cdf0e10cSrcweir 
65cdf0e10cSrcweir TYPEINIT1_FACTORY(SvxSearchItem, SfxPoolItem, new SvxSearchItem(0));
66cdf0e10cSrcweir 
67cdf0e10cSrcweir // -----------------------------------------------------------------------
68cdf0e10cSrcweir 
lcl_GetNotifyNames()69cdf0e10cSrcweir static Sequence< ::rtl::OUString > lcl_GetNotifyNames()
70cdf0e10cSrcweir {
71cdf0e10cSrcweir 	// names of transliteration relevant properties
72cdf0e10cSrcweir 	static const char* aTranslitNames[] =
73cdf0e10cSrcweir 	{
74cdf0e10cSrcweir 		"IsMatchCase",							//  0
75cdf0e10cSrcweir 		"Japanese/IsMatchFullHalfWidthForms",	//  1
76cdf0e10cSrcweir 		"Japanese/IsMatchHiraganaKatakana",		//  2
77cdf0e10cSrcweir 		"Japanese/IsMatchContractions",			//  3
78cdf0e10cSrcweir 		"Japanese/IsMatchMinusDashCho-on",		//  4
79cdf0e10cSrcweir 		"Japanese/IsMatchRepeatCharMarks",		//  5
80cdf0e10cSrcweir 		"Japanese/IsMatchVariantFormKanji",		//  6
81cdf0e10cSrcweir 		"Japanese/IsMatchOldKanaForms",			//  7
82cdf0e10cSrcweir 		"Japanese/IsMatch_DiZi_DuZu",			//  8
83cdf0e10cSrcweir 		"Japanese/IsMatch_BaVa_HaFa",			//  9
84cdf0e10cSrcweir 		"Japanese/IsMatch_TsiThiChi_DhiZi",		// 10
85cdf0e10cSrcweir 		"Japanese/IsMatch_HyuIyu_ByuVyu",		// 11
86cdf0e10cSrcweir 		"Japanese/IsMatch_SeShe_ZeJe",			// 12
87cdf0e10cSrcweir 		"Japanese/IsMatch_IaIya",				// 13
88cdf0e10cSrcweir 		"Japanese/IsMatch_KiKu",				// 14
89cdf0e10cSrcweir 		"Japanese/IsIgnorePunctuation",			// 15
90cdf0e10cSrcweir 		"Japanese/IsIgnoreWhitespace",			// 16
91cdf0e10cSrcweir 		"Japanese/IsIgnoreProlongedSoundMark",	// 17
92cdf0e10cSrcweir 		"Japanese/IsIgnoreMiddleDot"			// 18
93cdf0e10cSrcweir 	};
94cdf0e10cSrcweir 
95cdf0e10cSrcweir     const int nCount = sizeof( aTranslitNames ) / sizeof( aTranslitNames[0] );
96cdf0e10cSrcweir     Sequence< ::rtl::OUString > aNames( nCount );
97cdf0e10cSrcweir     ::rtl::OUString* pNames = aNames.getArray();
98cdf0e10cSrcweir 	for (sal_Int32 i = 0;  i < nCount;  ++i)
99cdf0e10cSrcweir         pNames[i] = ::rtl::OUString::createFromAscii( aTranslitNames[i] );
100cdf0e10cSrcweir 
101cdf0e10cSrcweir 	return aNames;
102cdf0e10cSrcweir }
103cdf0e10cSrcweir 
104cdf0e10cSrcweir // -----------------------------------------------------------------------
SvxSearchItem(const sal_uInt16 nId)105cdf0e10cSrcweir SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) :
106cdf0e10cSrcweir 
107cdf0e10cSrcweir 	SfxPoolItem( nId ),
108cdf0e10cSrcweir     ConfigItem( ::rtl::OUString::createFromAscii( CFG_ROOT_NODE ) ),
109cdf0e10cSrcweir 
110cdf0e10cSrcweir     aSearchOpt      (   SearchAlgorithms_ABSOLUTE,
111cdf0e10cSrcweir                         SearchFlags::LEV_RELAXED,
112cdf0e10cSrcweir                         ::rtl::OUString(),
113cdf0e10cSrcweir                         ::rtl::OUString(),
114cdf0e10cSrcweir   						Locale(),
115cdf0e10cSrcweir   						2, 2, 2,
116cdf0e10cSrcweir   						TransliterationModules_IGNORE_CASE ),
117cdf0e10cSrcweir 	eFamily			( SFX_STYLE_FAMILY_PARA ),
118cdf0e10cSrcweir 	nCommand		( 0 ),
119cdf0e10cSrcweir 	nCellType		( SVX_SEARCHIN_FORMULA ),
120cdf0e10cSrcweir 	nAppFlag		( SVX_SEARCHAPP_WRITER ),
121cdf0e10cSrcweir 	bRowDirection	( sal_True ),
122cdf0e10cSrcweir 	bAllTables		( sal_False ),
123cdf0e10cSrcweir 	bNotes			( sal_False),
124cdf0e10cSrcweir 	bBackward		( sal_False ),
125cdf0e10cSrcweir 	bPattern		( sal_False ),
126cdf0e10cSrcweir 	bContent		( sal_False ),
127cdf0e10cSrcweir 	bAsianOptions	( sal_False )
128cdf0e10cSrcweir {
129cdf0e10cSrcweir 	EnableNotification( lcl_GetNotifyNames() );
130cdf0e10cSrcweir 
131cdf0e10cSrcweir 	SvtSearchOptions aOpt;
132cdf0e10cSrcweir 
133cdf0e10cSrcweir 	bBackward 		= aOpt.IsBackwards();
134cdf0e10cSrcweir 	bAsianOptions	= aOpt.IsUseAsianOptions();
135cdf0e10cSrcweir 	bNotes = aOpt.IsNotes();
136cdf0e10cSrcweir 
137cdf0e10cSrcweir 	if (aOpt.IsUseRegularExpression())
138cdf0e10cSrcweir 		aSearchOpt.algorithmType = SearchAlgorithms_REGEXP;
139cdf0e10cSrcweir 	if (aOpt.IsSimilaritySearch())
140cdf0e10cSrcweir 		aSearchOpt.algorithmType = SearchAlgorithms_APPROXIMATE;
141cdf0e10cSrcweir 	if (aOpt.IsWholeWordsOnly())
142cdf0e10cSrcweir 		aSearchOpt.searchFlag |= SearchFlags::NORM_WORD_ONLY;
143cdf0e10cSrcweir 
144cdf0e10cSrcweir 	sal_Int32 &rFlags = aSearchOpt.transliterateFlags;
145cdf0e10cSrcweir 
146cdf0e10cSrcweir 	if (!aOpt.IsMatchCase())
147cdf0e10cSrcweir 		rFlags |= TransliterationModules_IGNORE_CASE;
148cdf0e10cSrcweir     if ( aOpt.IsMatchFullHalfWidthForms())
149cdf0e10cSrcweir 		rFlags |= TransliterationModules_IGNORE_WIDTH;
150cdf0e10cSrcweir     if ( bAsianOptions )
151cdf0e10cSrcweir     {
152cdf0e10cSrcweir         if ( aOpt.IsMatchHiraganaKatakana())
153cdf0e10cSrcweir             rFlags |= TransliterationModules_IGNORE_KANA;
154cdf0e10cSrcweir         if ( aOpt.IsMatchContractions())
155cdf0e10cSrcweir             rFlags |= TransliterationModules_ignoreSize_ja_JP;
156cdf0e10cSrcweir         if ( aOpt.IsMatchMinusDashChoon())
157cdf0e10cSrcweir             rFlags |= TransliterationModules_ignoreMinusSign_ja_JP;
158cdf0e10cSrcweir         if ( aOpt.IsMatchRepeatCharMarks())
159cdf0e10cSrcweir             rFlags |= TransliterationModules_ignoreIterationMark_ja_JP;
160cdf0e10cSrcweir         if ( aOpt.IsMatchVariantFormKanji())
161cdf0e10cSrcweir             rFlags |= TransliterationModules_ignoreTraditionalKanji_ja_JP;
162cdf0e10cSrcweir         if ( aOpt.IsMatchOldKanaForms())
163cdf0e10cSrcweir             rFlags |= TransliterationModules_ignoreTraditionalKana_ja_JP;
164cdf0e10cSrcweir         if ( aOpt.IsMatchDiziDuzu())
165cdf0e10cSrcweir             rFlags |= TransliterationModules_ignoreZiZu_ja_JP;
166cdf0e10cSrcweir         if ( aOpt.IsMatchBavaHafa())
167cdf0e10cSrcweir             rFlags |= TransliterationModules_ignoreBaFa_ja_JP;
168cdf0e10cSrcweir         if ( aOpt.IsMatchTsithichiDhizi())
169cdf0e10cSrcweir             rFlags |= TransliterationModules_ignoreTiJi_ja_JP;
170cdf0e10cSrcweir         if ( aOpt.IsMatchHyuiyuByuvyu())
171cdf0e10cSrcweir             rFlags |= TransliterationModules_ignoreHyuByu_ja_JP;
172cdf0e10cSrcweir         if ( aOpt.IsMatchSesheZeje())
173cdf0e10cSrcweir             rFlags |= TransliterationModules_ignoreSeZe_ja_JP;
174cdf0e10cSrcweir         if ( aOpt.IsMatchIaiya())
175cdf0e10cSrcweir             rFlags |= TransliterationModules_ignoreIandEfollowedByYa_ja_JP;
176cdf0e10cSrcweir         if ( aOpt.IsMatchKiku())
177cdf0e10cSrcweir             rFlags |= TransliterationModules_ignoreKiKuFollowedBySa_ja_JP;
178cdf0e10cSrcweir         if ( aOpt.IsIgnorePunctuation())
179cdf0e10cSrcweir             rFlags |= TransliterationModules_ignoreSeparator_ja_JP;
180cdf0e10cSrcweir         if ( aOpt.IsIgnoreWhitespace())
181cdf0e10cSrcweir             rFlags |= TransliterationModules_ignoreSpace_ja_JP;
182cdf0e10cSrcweir         if ( aOpt.IsIgnoreProlongedSoundMark())
183cdf0e10cSrcweir             rFlags |= TransliterationModules_ignoreProlongedSoundMark_ja_JP;
184cdf0e10cSrcweir         if ( aOpt.IsIgnoreMiddleDot())
185cdf0e10cSrcweir             rFlags |= TransliterationModules_ignoreMiddleDot_ja_JP;
186cdf0e10cSrcweir     }
187cdf0e10cSrcweir 
188cdf0e10cSrcweir }
189cdf0e10cSrcweir 
190cdf0e10cSrcweir // -----------------------------------------------------------------------
191cdf0e10cSrcweir 
SvxSearchItem(const SvxSearchItem & rItem)192cdf0e10cSrcweir SvxSearchItem::SvxSearchItem( const SvxSearchItem& rItem ) :
193cdf0e10cSrcweir 
194cdf0e10cSrcweir 	SfxPoolItem	( rItem ),
195cdf0e10cSrcweir     ConfigItem( ::rtl::OUString::createFromAscii( CFG_ROOT_NODE ) ),
196cdf0e10cSrcweir 
197cdf0e10cSrcweir 	aSearchOpt		( rItem.aSearchOpt ),
198cdf0e10cSrcweir 	eFamily			( rItem.eFamily ),
199cdf0e10cSrcweir 	nCommand		( rItem.nCommand ),
200cdf0e10cSrcweir 	nCellType		( rItem.nCellType ),
201cdf0e10cSrcweir 	nAppFlag		( rItem.nAppFlag ),
202cdf0e10cSrcweir 	bRowDirection	( rItem.bRowDirection ),
203cdf0e10cSrcweir 	bAllTables		( rItem.bAllTables ),
204cdf0e10cSrcweir 	bNotes			( rItem.bNotes),
205cdf0e10cSrcweir 	bBackward		( rItem.bBackward ),
206cdf0e10cSrcweir 	bPattern		( rItem.bPattern ),
207cdf0e10cSrcweir 	bContent		( rItem.bContent ),
208cdf0e10cSrcweir 	bAsianOptions	( rItem.bAsianOptions )
209cdf0e10cSrcweir {
210cdf0e10cSrcweir 	EnableNotification( lcl_GetNotifyNames() );
211cdf0e10cSrcweir }
212cdf0e10cSrcweir 
213cdf0e10cSrcweir // -----------------------------------------------------------------------
214cdf0e10cSrcweir 
~SvxSearchItem()215cdf0e10cSrcweir SvxSearchItem::~SvxSearchItem()
216cdf0e10cSrcweir {
217cdf0e10cSrcweir }
218cdf0e10cSrcweir 
219cdf0e10cSrcweir // -----------------------------------------------------------------------
Clone(SfxItemPool *) const220cdf0e10cSrcweir SfxPoolItem* SvxSearchItem::Clone( SfxItemPool *) const
221cdf0e10cSrcweir {
222cdf0e10cSrcweir 	return new SvxSearchItem(*this);
223cdf0e10cSrcweir }
224cdf0e10cSrcweir 
225cdf0e10cSrcweir // -----------------------------------------------------------------------
226cdf0e10cSrcweir 
227cdf0e10cSrcweir //! used below
operator ==(const SearchOptions & rItem1,const SearchOptions & rItem2)228cdf0e10cSrcweir static sal_Bool operator == ( const SearchOptions& rItem1, const SearchOptions& rItem2 )
229cdf0e10cSrcweir {
230cdf0e10cSrcweir 	return rItem1.algorithmType 		== rItem2.algorithmType	&&
231cdf0e10cSrcweir 		   rItem1.searchFlag 			== rItem2.searchFlag	&&
232cdf0e10cSrcweir 		   rItem1.searchString 			== rItem2.searchString	&&
233cdf0e10cSrcweir 		   rItem1.replaceString 		== rItem2.replaceString	&&
234cdf0e10cSrcweir 		   //rItem1.Locale 				== rItem2.Locale		&&
235cdf0e10cSrcweir 		   rItem1.changedChars 			== rItem2.changedChars	&&
236cdf0e10cSrcweir 		   rItem1.deletedChars 			== rItem2.deletedChars	&&
237cdf0e10cSrcweir 		   rItem1.insertedChars 		== rItem2.insertedChars	&&
238cdf0e10cSrcweir 		   rItem1.transliterateFlags	== rItem2.transliterateFlags;
239cdf0e10cSrcweir }
240cdf0e10cSrcweir 
241cdf0e10cSrcweir 
operator ==(const SfxPoolItem & rItem) const242cdf0e10cSrcweir int SvxSearchItem::operator==( const SfxPoolItem& rItem ) const
243cdf0e10cSrcweir {
244cdf0e10cSrcweir 	DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal which or type" );
245cdf0e10cSrcweir 	const SvxSearchItem &rSItem = (SvxSearchItem &) rItem;
246cdf0e10cSrcweir 	return ( nCommand 		== rSItem.nCommand )		&&
247cdf0e10cSrcweir 		   ( bBackward 		== rSItem.bBackward )		&&
248cdf0e10cSrcweir 		   ( bPattern 		== rSItem.bPattern )		&&
249cdf0e10cSrcweir 		   ( bContent 		== rSItem.bContent )		&&
250cdf0e10cSrcweir 		   ( eFamily 		== rSItem.eFamily )			&&
251cdf0e10cSrcweir 		   ( bRowDirection 	== rSItem.bRowDirection )	&&
252cdf0e10cSrcweir 		   ( bAllTables 	== rSItem.bAllTables )		&&
253cdf0e10cSrcweir 		   ( nCellType 		== rSItem.nCellType )		&&
254cdf0e10cSrcweir 		   ( nAppFlag 		== rSItem.nAppFlag )		&&
255cdf0e10cSrcweir 		   ( bAsianOptions	== rSItem.bAsianOptions )	&&
256cdf0e10cSrcweir 		   ( aSearchOpt     == rSItem.aSearchOpt )		&&
257cdf0e10cSrcweir 		   ( bNotes			== rSItem.bNotes );
258cdf0e10cSrcweir }
259cdf0e10cSrcweir 
260cdf0e10cSrcweir 
261cdf0e10cSrcweir //------------------------------------------------------------------------
262cdf0e10cSrcweir 
GetPresentation(SfxItemPresentation,SfxMapUnit,SfxMapUnit,XubString &,const IntlWrapper *) const263cdf0e10cSrcweir SfxItemPresentation SvxSearchItem::GetPresentation
264cdf0e10cSrcweir (
265cdf0e10cSrcweir 	SfxItemPresentation ,
266cdf0e10cSrcweir 	SfxMapUnit			,
267cdf0e10cSrcweir 	SfxMapUnit			,
268cdf0e10cSrcweir 	XubString& 			,
269cdf0e10cSrcweir     const IntlWrapper *
270cdf0e10cSrcweir )	const
271cdf0e10cSrcweir {
272cdf0e10cSrcweir 	return SFX_ITEM_PRESENTATION_NONE;
273cdf0e10cSrcweir }
274cdf0e10cSrcweir 
GetFromDescriptor(const::com::sun::star::uno::Reference<::com::sun::star::util::XSearchDescriptor> & rDescr)275cdf0e10cSrcweir void SvxSearchItem::GetFromDescriptor( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor >& rDescr )
276cdf0e10cSrcweir {
277cdf0e10cSrcweir 	SetSearchString( rDescr->getSearchString() );
278cdf0e10cSrcweir 	::com::sun::star::uno::Any aAny = rDescr->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchWords") ) );
279cdf0e10cSrcweir 	sal_Bool bTemp = false;
280cdf0e10cSrcweir 	aAny >>= bTemp ;
281cdf0e10cSrcweir 	SetWordOnly( bTemp );
282cdf0e10cSrcweir 	aAny = rDescr->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchCaseSensitive") ) );
283cdf0e10cSrcweir 	aAny >>= bTemp ;
284cdf0e10cSrcweir 	SetExact( bTemp );
285cdf0e10cSrcweir 	aAny = rDescr->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchBackwards") ) );
286cdf0e10cSrcweir 	aAny >>= bTemp ;
287cdf0e10cSrcweir 	SetBackward( bTemp );
288cdf0e10cSrcweir 	aAny = rDescr->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchInSelection") ) );
289cdf0e10cSrcweir 	aAny >>= bTemp ;
290cdf0e10cSrcweir 	SetSelection( bTemp );
291cdf0e10cSrcweir 	aAny = rDescr->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchRegularExpression") ) );
292cdf0e10cSrcweir 	aAny >>= bTemp ;
293cdf0e10cSrcweir 	SetRegExp( bTemp );
294cdf0e10cSrcweir 	aAny = rDescr->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchSimilarity") ) );
295cdf0e10cSrcweir 	aAny >>= bTemp ;
296cdf0e10cSrcweir 	SetLevenshtein( bTemp );
297cdf0e10cSrcweir 	aAny = rDescr->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchSimilarityRelax") ) );
298cdf0e10cSrcweir 	aAny >>= bTemp ;
299cdf0e10cSrcweir 	SetLEVRelaxed( bTemp );
300cdf0e10cSrcweir 	aAny = rDescr->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchSimilarityExchange") ) );
301cdf0e10cSrcweir 	sal_Int16 nTemp = 0;
302cdf0e10cSrcweir 	aAny >>= nTemp ;
303cdf0e10cSrcweir 	SetLEVOther( nTemp );
304cdf0e10cSrcweir 	aAny = rDescr->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchSimilarityRemove") ) );
305cdf0e10cSrcweir 	aAny >>= nTemp ;
306cdf0e10cSrcweir 	SetLEVShorter( nTemp );
307cdf0e10cSrcweir 	aAny = rDescr->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchSimilarityAdd") ) );
308cdf0e10cSrcweir 	aAny >>= nTemp ;
309cdf0e10cSrcweir 	SetLEVLonger( nTemp );
310cdf0e10cSrcweir }
311cdf0e10cSrcweir 
SetToDescriptor(::com::sun::star::uno::Reference<::com::sun::star::util::XSearchDescriptor> & rDescr)312cdf0e10cSrcweir void SvxSearchItem::SetToDescriptor( ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > & rDescr )
313cdf0e10cSrcweir {
314cdf0e10cSrcweir 	rDescr->setSearchString( GetSearchString() );
315cdf0e10cSrcweir 	::com::sun::star::uno::Any aAny;
316cdf0e10cSrcweir 	aAny <<= GetWordOnly() ;
317cdf0e10cSrcweir 	rDescr->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchWords") ), aAny );
318cdf0e10cSrcweir 	aAny <<= GetExact() ;
319cdf0e10cSrcweir 	rDescr->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchCaseSensitive") ), aAny );
320cdf0e10cSrcweir 	aAny <<= GetBackward() ;
321cdf0e10cSrcweir 	rDescr->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchBackwards") ), aAny );
322cdf0e10cSrcweir 	aAny <<= GetSelection() ;
323cdf0e10cSrcweir 	rDescr->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchInSelection") ), aAny );
324cdf0e10cSrcweir 	aAny <<= GetRegExp() ;
325cdf0e10cSrcweir 	rDescr->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchRegularExpression") ), aAny );
326cdf0e10cSrcweir 	aAny <<= IsLevenshtein() ;
327cdf0e10cSrcweir 	rDescr->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchSimilarity") ), aAny );
328cdf0e10cSrcweir 	aAny <<= IsLEVRelaxed() ;
329cdf0e10cSrcweir 	rDescr->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchSimilarityRelax") ), aAny );
330cdf0e10cSrcweir 	aAny <<= GetLEVOther() ;
331cdf0e10cSrcweir 	rDescr->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchSimilarityExchange") ), aAny );
332cdf0e10cSrcweir 	aAny <<= GetLEVShorter() ;
333cdf0e10cSrcweir 	rDescr->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchSimilarityRemove") ), aAny );
334cdf0e10cSrcweir 	aAny <<= GetLEVLonger() ;
335cdf0e10cSrcweir 	rDescr->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchSimilarityAdd") ), aAny );
336cdf0e10cSrcweir }
337cdf0e10cSrcweir 
338cdf0e10cSrcweir 
Notify(const Sequence<::rtl::OUString> &)339cdf0e10cSrcweir void SvxSearchItem::Notify( const Sequence< ::rtl::OUString > & )
340cdf0e10cSrcweir {
341cdf0e10cSrcweir 	// applies transliteration changes in the configuration database
342cdf0e10cSrcweir 	// to the current SvxSearchItem
343cdf0e10cSrcweir 	SetTransliterationFlags( SvtSearchOptions().GetTransliterationFlags() );
344cdf0e10cSrcweir }
345cdf0e10cSrcweir 
Commit()346cdf0e10cSrcweir void SvxSearchItem::Commit()
347cdf0e10cSrcweir {
348cdf0e10cSrcweir }
349cdf0e10cSrcweir 
SetMatchFullHalfWidthForms(sal_Bool bVal)350cdf0e10cSrcweir void SvxSearchItem::SetMatchFullHalfWidthForms( sal_Bool bVal )
351cdf0e10cSrcweir {
352cdf0e10cSrcweir     if (bVal)
353cdf0e10cSrcweir 		aSearchOpt.transliterateFlags |=  TransliterationModules_IGNORE_WIDTH;
354cdf0e10cSrcweir 	else
355cdf0e10cSrcweir 		aSearchOpt.transliterateFlags &= ~TransliterationModules_IGNORE_WIDTH;
356cdf0e10cSrcweir }
357cdf0e10cSrcweir 
358cdf0e10cSrcweir 
SetWordOnly(sal_Bool bVal)359cdf0e10cSrcweir void SvxSearchItem::SetWordOnly( sal_Bool bVal )
360cdf0e10cSrcweir {
361cdf0e10cSrcweir 	if (bVal)
362cdf0e10cSrcweir 		aSearchOpt.searchFlag |=  SearchFlags::NORM_WORD_ONLY;
363cdf0e10cSrcweir 	else
364cdf0e10cSrcweir 		aSearchOpt.searchFlag &= ~SearchFlags::NORM_WORD_ONLY;
365cdf0e10cSrcweir }
366cdf0e10cSrcweir 
367cdf0e10cSrcweir 
SetExact(sal_Bool bVal)368cdf0e10cSrcweir void SvxSearchItem::SetExact( sal_Bool bVal )
369cdf0e10cSrcweir {
370cdf0e10cSrcweir 	if (!bVal)
371cdf0e10cSrcweir 		aSearchOpt.transliterateFlags |=  TransliterationModules_IGNORE_CASE;
372cdf0e10cSrcweir 	else
373cdf0e10cSrcweir 		aSearchOpt.transliterateFlags &= ~TransliterationModules_IGNORE_CASE;
374cdf0e10cSrcweir }
375cdf0e10cSrcweir 
376cdf0e10cSrcweir 
SetSelection(sal_Bool bVal)377cdf0e10cSrcweir void SvxSearchItem::SetSelection( sal_Bool bVal )
378cdf0e10cSrcweir {
379cdf0e10cSrcweir 	if (bVal)
380cdf0e10cSrcweir 	{
381cdf0e10cSrcweir 		aSearchOpt.searchFlag |=  (SearchFlags::REG_NOT_BEGINOFLINE |
382cdf0e10cSrcweir 								   SearchFlags::REG_NOT_ENDOFLINE);
383cdf0e10cSrcweir 	}
384cdf0e10cSrcweir 	else
385cdf0e10cSrcweir 	{
386cdf0e10cSrcweir 		aSearchOpt.searchFlag &= ~(SearchFlags::REG_NOT_BEGINOFLINE |
387cdf0e10cSrcweir 								   SearchFlags::REG_NOT_ENDOFLINE);
388cdf0e10cSrcweir 	}
389cdf0e10cSrcweir }
390cdf0e10cSrcweir 
391cdf0e10cSrcweir 
SetRegExp(sal_Bool bVal)392cdf0e10cSrcweir void SvxSearchItem::SetRegExp( sal_Bool bVal )
393cdf0e10cSrcweir {
394cdf0e10cSrcweir     if ( bVal )
395cdf0e10cSrcweir 		aSearchOpt.algorithmType = SearchAlgorithms_REGEXP;
396cdf0e10cSrcweir     else if ( SearchAlgorithms_REGEXP == aSearchOpt.algorithmType )
397cdf0e10cSrcweir 		aSearchOpt.algorithmType = SearchAlgorithms_ABSOLUTE;
398cdf0e10cSrcweir }
399cdf0e10cSrcweir 
400cdf0e10cSrcweir 
SetLEVRelaxed(sal_Bool bVal)401cdf0e10cSrcweir void SvxSearchItem::SetLEVRelaxed( sal_Bool bVal )
402cdf0e10cSrcweir {
403cdf0e10cSrcweir 	if (bVal)
404cdf0e10cSrcweir 		aSearchOpt.searchFlag |=  SearchFlags::LEV_RELAXED;
405cdf0e10cSrcweir 	else
406cdf0e10cSrcweir 		aSearchOpt.searchFlag &= ~SearchFlags::LEV_RELAXED;
407cdf0e10cSrcweir }
408cdf0e10cSrcweir 
409cdf0e10cSrcweir 
SetLevenshtein(sal_Bool bVal)410cdf0e10cSrcweir void SvxSearchItem::SetLevenshtein( sal_Bool bVal )
411cdf0e10cSrcweir {
412cdf0e10cSrcweir     if ( bVal )
413cdf0e10cSrcweir 		aSearchOpt.algorithmType = SearchAlgorithms_APPROXIMATE;
414cdf0e10cSrcweir     else if ( SearchAlgorithms_APPROXIMATE == aSearchOpt.algorithmType )
415cdf0e10cSrcweir         aSearchOpt.algorithmType = SearchAlgorithms_ABSOLUTE;
416cdf0e10cSrcweir }
417cdf0e10cSrcweir 
418cdf0e10cSrcweir 
SetTransliterationFlags(sal_Int32 nFlags)419cdf0e10cSrcweir void SvxSearchItem::SetTransliterationFlags( sal_Int32 nFlags )
420cdf0e10cSrcweir {
421cdf0e10cSrcweir 	aSearchOpt.transliterateFlags = nFlags;
422cdf0e10cSrcweir }
423cdf0e10cSrcweir 
QueryValue(com::sun::star::uno::Any & rVal,sal_uInt8 nMemberId) const424cdf0e10cSrcweir sal_Bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const
425cdf0e10cSrcweir {
426cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
427cdf0e10cSrcweir     switch ( nMemberId )
428cdf0e10cSrcweir 	{
429cdf0e10cSrcweir         case 0 :
430cdf0e10cSrcweir         {
431cdf0e10cSrcweir             Sequence< PropertyValue > aSeq( SRCH_PARAMS );
432cdf0e10cSrcweir             aSeq[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SRCH_PARA_OPTIONS ) );
433cdf0e10cSrcweir             aSeq[0].Value <<= aSearchOpt;
434cdf0e10cSrcweir             aSeq[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SRCH_PARA_FAMILY ));
435cdf0e10cSrcweir             aSeq[1].Value <<= sal_Int16( eFamily );
436cdf0e10cSrcweir             aSeq[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SRCH_PARA_COMMAND ));
437cdf0e10cSrcweir             aSeq[2].Value <<= nCommand;
438cdf0e10cSrcweir             aSeq[3].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SRCH_PARA_CELLTYPE ));
439cdf0e10cSrcweir             aSeq[3].Value <<= nCellType;
440cdf0e10cSrcweir             aSeq[4].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SRCH_PARA_APPFLAG ));
441cdf0e10cSrcweir             aSeq[4].Value <<= nAppFlag;
442cdf0e10cSrcweir             aSeq[5].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SRCH_PARA_ROWDIR ));
443cdf0e10cSrcweir             aSeq[5].Value <<= bRowDirection;
444cdf0e10cSrcweir             aSeq[6].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SRCH_PARA_ALLTABLES ));
445cdf0e10cSrcweir             aSeq[6].Value <<= bAllTables;
446cdf0e10cSrcweir             aSeq[7].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SRCH_PARA_BACKWARD ));
447cdf0e10cSrcweir             aSeq[7].Value <<= bBackward;
448cdf0e10cSrcweir             aSeq[8].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SRCH_PARA_PATTERN ));
449cdf0e10cSrcweir             aSeq[8].Value <<= bPattern;
450cdf0e10cSrcweir             aSeq[9].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SRCH_PARA_CONTENT ));
451cdf0e10cSrcweir             aSeq[9].Value <<= bContent;
452cdf0e10cSrcweir             aSeq[10].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SRCH_PARA_ASIANOPT ));
453cdf0e10cSrcweir             aSeq[10].Value <<= bAsianOptions;
454cdf0e10cSrcweir             rVal <<= aSeq;
455cdf0e10cSrcweir         }
456cdf0e10cSrcweir         break;
457cdf0e10cSrcweir         case MID_SEARCH_COMMAND:
458cdf0e10cSrcweir             rVal <<= (sal_Int16) nCommand; break;
459cdf0e10cSrcweir         case MID_SEARCH_STYLEFAMILY:
460cdf0e10cSrcweir             rVal <<= (sal_Int16) eFamily; break;
461cdf0e10cSrcweir         case MID_SEARCH_CELLTYPE:
462cdf0e10cSrcweir             rVal <<= (sal_Int32) nCellType; break;
463cdf0e10cSrcweir         case MID_SEARCH_ROWDIRECTION:
464cdf0e10cSrcweir             rVal <<= (sal_Bool) bRowDirection; break;
465cdf0e10cSrcweir         case MID_SEARCH_ALLTABLES:
466cdf0e10cSrcweir             rVal <<= (sal_Bool) bAllTables; break;
467cdf0e10cSrcweir         case MID_SEARCH_BACKWARD:
468cdf0e10cSrcweir             rVal <<= (sal_Bool) bBackward; break;
469cdf0e10cSrcweir         case MID_SEARCH_PATTERN:
470cdf0e10cSrcweir             rVal <<= (sal_Bool) bPattern; break;
471cdf0e10cSrcweir         case MID_SEARCH_CONTENT:
472cdf0e10cSrcweir             rVal <<= (sal_Bool) bContent; break;
473cdf0e10cSrcweir         case MID_SEARCH_ASIANOPTIONS:
474cdf0e10cSrcweir             rVal <<= (sal_Bool) bAsianOptions; break;
475cdf0e10cSrcweir         case MID_SEARCH_ALGORITHMTYPE:
476cdf0e10cSrcweir             rVal <<= (sal_Int16) aSearchOpt.algorithmType; break;
477cdf0e10cSrcweir         case MID_SEARCH_FLAGS:
478cdf0e10cSrcweir             rVal <<= aSearchOpt.searchFlag; break;
479cdf0e10cSrcweir         case MID_SEARCH_SEARCHSTRING:
480cdf0e10cSrcweir             rVal <<= aSearchOpt.searchString; break;
481cdf0e10cSrcweir         case MID_SEARCH_REPLACESTRING:
482cdf0e10cSrcweir             rVal <<= aSearchOpt.replaceString; break;
483cdf0e10cSrcweir         case MID_SEARCH_CHANGEDCHARS:
484cdf0e10cSrcweir             rVal <<= aSearchOpt.changedChars; break;
485cdf0e10cSrcweir         case MID_SEARCH_DELETEDCHARS:
486cdf0e10cSrcweir             rVal <<= aSearchOpt.deletedChars; break;
487cdf0e10cSrcweir         case MID_SEARCH_INSERTEDCHARS:
488cdf0e10cSrcweir             rVal <<= aSearchOpt.insertedChars; break;
489cdf0e10cSrcweir         case MID_SEARCH_TRANSLITERATEFLAGS:
490cdf0e10cSrcweir             rVal <<= aSearchOpt.transliterateFlags; break;
491cdf0e10cSrcweir         case MID_SEARCH_LOCALE:
492cdf0e10cSrcweir         {
493cdf0e10cSrcweir             sal_Int16 nLocale;
494cdf0e10cSrcweir             if (aSearchOpt.Locale.Language.getLength() || aSearchOpt.Locale.Country.getLength() )
495cdf0e10cSrcweir                 nLocale = MsLangId::convertLocaleToLanguage( aSearchOpt.Locale );
496cdf0e10cSrcweir 			else
497cdf0e10cSrcweir                 nLocale = LANGUAGE_NONE;
498cdf0e10cSrcweir             rVal <<= nLocale;
499cdf0e10cSrcweir             break;
500cdf0e10cSrcweir         }
501cdf0e10cSrcweir 
502cdf0e10cSrcweir         default:
503cdf0e10cSrcweir             DBG_ERRORFILE( "SvxSearchItem::QueryValue(): Unknown MemberId" );
504cdf0e10cSrcweir             return sal_False;
505cdf0e10cSrcweir 	}
506cdf0e10cSrcweir 
507cdf0e10cSrcweir     return sal_True;
508cdf0e10cSrcweir }
509cdf0e10cSrcweir 
510cdf0e10cSrcweir // -----------------------------------------------------------------------
511cdf0e10cSrcweir 
PutValue(const com::sun::star::uno::Any & rVal,sal_uInt8 nMemberId)512cdf0e10cSrcweir sal_Bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId )
513cdf0e10cSrcweir {
514cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
515cdf0e10cSrcweir     sal_Bool bRet = sal_False;
516cdf0e10cSrcweir     sal_Int32 nInt = 0;
517cdf0e10cSrcweir     switch ( nMemberId )
518cdf0e10cSrcweir 	{
519cdf0e10cSrcweir         case 0 :
520cdf0e10cSrcweir         {
521cdf0e10cSrcweir             Sequence< PropertyValue > aSeq;
522cdf0e10cSrcweir             if ( ( rVal >>= aSeq ) && ( aSeq.getLength() == SRCH_PARAMS ) )
523cdf0e10cSrcweir             {
524cdf0e10cSrcweir                 sal_Int16 nConvertedCount( 0 );
525cdf0e10cSrcweir                 for ( sal_Int32 i = 0; i < aSeq.getLength(); ++i )
526cdf0e10cSrcweir                 {
527cdf0e10cSrcweir                     if ( aSeq[i].Name.equalsAscii( SRCH_PARA_OPTIONS ) )
528cdf0e10cSrcweir                     {
529cdf0e10cSrcweir                         if ( ( aSeq[i].Value >>= aSearchOpt ) == sal_True )
530cdf0e10cSrcweir                             ++nConvertedCount;
531cdf0e10cSrcweir                     }
532cdf0e10cSrcweir                     else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_FAMILY ) )
533cdf0e10cSrcweir                     {
534cdf0e10cSrcweir                         sal_uInt16 nTemp( 0 );
535cdf0e10cSrcweir                         if ( ( aSeq[i].Value >>= nTemp ) == sal_True )
536cdf0e10cSrcweir                         {
537cdf0e10cSrcweir                             eFamily = SfxStyleFamily( nTemp );
538cdf0e10cSrcweir                             ++nConvertedCount;
539cdf0e10cSrcweir                         }
540cdf0e10cSrcweir                     }
541cdf0e10cSrcweir                     else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_COMMAND ) )
542cdf0e10cSrcweir                     {
543cdf0e10cSrcweir                         if ( ( aSeq[i].Value >>= nCommand ) == sal_True )
544cdf0e10cSrcweir                             ++nConvertedCount;
545cdf0e10cSrcweir                     }
546cdf0e10cSrcweir                     else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_CELLTYPE ) )
547cdf0e10cSrcweir                     {
548cdf0e10cSrcweir                         if ( ( aSeq[i].Value >>= nCellType ) == sal_True )
549cdf0e10cSrcweir                             ++nConvertedCount;
550cdf0e10cSrcweir                     }
551cdf0e10cSrcweir                     else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_APPFLAG ) )
552cdf0e10cSrcweir                     {
553cdf0e10cSrcweir                         if ( ( aSeq[i].Value >>= nAppFlag ) == sal_True )
554cdf0e10cSrcweir                             ++nConvertedCount;
555cdf0e10cSrcweir                     }
556cdf0e10cSrcweir                     else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_ROWDIR ) )
557cdf0e10cSrcweir                     {
558cdf0e10cSrcweir                         if ( ( aSeq[i].Value >>= bRowDirection ) == sal_True )
559cdf0e10cSrcweir                             ++nConvertedCount;
560cdf0e10cSrcweir                     }
561cdf0e10cSrcweir                     else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_ALLTABLES ) )
562cdf0e10cSrcweir                     {
563cdf0e10cSrcweir                         if ( ( aSeq[i].Value >>= bAllTables ) == sal_True )
564cdf0e10cSrcweir                             ++nConvertedCount;
565cdf0e10cSrcweir                     }
566cdf0e10cSrcweir                     else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_BACKWARD ) )
567cdf0e10cSrcweir                     {
568cdf0e10cSrcweir                         if ( ( aSeq[i].Value >>= bBackward ) == sal_True )
569cdf0e10cSrcweir                             ++nConvertedCount;
570cdf0e10cSrcweir                     }
571cdf0e10cSrcweir                     else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_PATTERN ) )
572cdf0e10cSrcweir                     {
573cdf0e10cSrcweir                         if ( ( aSeq[i].Value >>= bPattern ) == sal_True )
574cdf0e10cSrcweir                             ++nConvertedCount;
575cdf0e10cSrcweir                     }
576cdf0e10cSrcweir                     else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_CONTENT ) )
577cdf0e10cSrcweir                     {
578cdf0e10cSrcweir                         if ( ( aSeq[i].Value >>= bContent ) == sal_True )
579cdf0e10cSrcweir                             ++nConvertedCount;
580cdf0e10cSrcweir                     }
581cdf0e10cSrcweir                     else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_ASIANOPT ) )
582cdf0e10cSrcweir                     {
583cdf0e10cSrcweir                         if ( ( aSeq[i].Value >>= bAsianOptions ) == sal_True )
584cdf0e10cSrcweir                             ++nConvertedCount;
585cdf0e10cSrcweir                     }
586cdf0e10cSrcweir                 }
587cdf0e10cSrcweir 
588cdf0e10cSrcweir                 bRet = ( nConvertedCount == SRCH_PARAMS );
589cdf0e10cSrcweir             }
590cdf0e10cSrcweir             break;
591cdf0e10cSrcweir         }
592cdf0e10cSrcweir         case MID_SEARCH_COMMAND:
593cdf0e10cSrcweir             bRet = (rVal >>= nInt); nCommand = (sal_uInt16) nInt; break;
594cdf0e10cSrcweir         case MID_SEARCH_STYLEFAMILY:
595cdf0e10cSrcweir             bRet = (rVal >>= nInt); eFamily =  (SfxStyleFamily) (sal_Int16) nInt; break;
596cdf0e10cSrcweir         case MID_SEARCH_CELLTYPE:
597cdf0e10cSrcweir             bRet = (rVal >>= nInt); nCellType = (sal_uInt16) nInt; break;
598cdf0e10cSrcweir         case MID_SEARCH_ROWDIRECTION:
599cdf0e10cSrcweir             bRet = (rVal >>= bRowDirection); break;
600cdf0e10cSrcweir         case MID_SEARCH_ALLTABLES:
601cdf0e10cSrcweir             bRet = (rVal >>= bAllTables); break;
602cdf0e10cSrcweir         case MID_SEARCH_BACKWARD:
603cdf0e10cSrcweir             bRet = (rVal >>= bBackward); break;
604cdf0e10cSrcweir         case MID_SEARCH_PATTERN:
605cdf0e10cSrcweir             bRet = (rVal >>= bPattern); break;
606cdf0e10cSrcweir         case MID_SEARCH_CONTENT:
607cdf0e10cSrcweir             bRet = (rVal >>= bContent); break;
608cdf0e10cSrcweir         case MID_SEARCH_ASIANOPTIONS:
609cdf0e10cSrcweir             bRet = (rVal >>= bAsianOptions); break;
610cdf0e10cSrcweir         case MID_SEARCH_ALGORITHMTYPE:
611cdf0e10cSrcweir             bRet = (rVal >>= nInt); aSearchOpt.algorithmType = (SearchAlgorithms)(sal_Int16)nInt; break;
612cdf0e10cSrcweir         case MID_SEARCH_FLAGS:
613cdf0e10cSrcweir             bRet = (rVal >>= aSearchOpt.searchFlag); break;
614cdf0e10cSrcweir         case MID_SEARCH_SEARCHSTRING:
615cdf0e10cSrcweir             bRet = (rVal >>= aSearchOpt.searchString); break;
616cdf0e10cSrcweir         case MID_SEARCH_REPLACESTRING:
617cdf0e10cSrcweir             bRet = (rVal >>= aSearchOpt.replaceString); break;
618cdf0e10cSrcweir         case MID_SEARCH_CHANGEDCHARS:
619cdf0e10cSrcweir             bRet = (rVal >>= aSearchOpt.changedChars); break;
620cdf0e10cSrcweir         case MID_SEARCH_DELETEDCHARS:
621cdf0e10cSrcweir             bRet = (rVal >>= aSearchOpt.deletedChars); break;
622cdf0e10cSrcweir         case MID_SEARCH_INSERTEDCHARS:
623cdf0e10cSrcweir             bRet = (rVal >>= aSearchOpt.insertedChars); break;
624cdf0e10cSrcweir         case MID_SEARCH_TRANSLITERATEFLAGS:
625cdf0e10cSrcweir             bRet = (rVal >>= aSearchOpt.transliterateFlags); break;
626cdf0e10cSrcweir         case MID_SEARCH_LOCALE:
627cdf0e10cSrcweir         {
628cdf0e10cSrcweir             bRet = (rVal >>= nInt);
629cdf0e10cSrcweir             if ( bRet )
630cdf0e10cSrcweir             {
631cdf0e10cSrcweir                 if ( nInt == LANGUAGE_NONE )
632cdf0e10cSrcweir                 {
633cdf0e10cSrcweir                     aSearchOpt.Locale = ::com::sun::star::lang::Locale();
634cdf0e10cSrcweir                 }
635cdf0e10cSrcweir                 else
636cdf0e10cSrcweir                 {
637cdf0e10cSrcweir                     MsLangId::convertLanguageToLocale( (sal_Int16) nInt, aSearchOpt.Locale );
638cdf0e10cSrcweir                 }
639cdf0e10cSrcweir             }
640cdf0e10cSrcweir             break;
641cdf0e10cSrcweir         }
642cdf0e10cSrcweir 		default:
643cdf0e10cSrcweir             DBG_ERROR( "Unknown MemberId" );
644cdf0e10cSrcweir 	}
645cdf0e10cSrcweir 
646cdf0e10cSrcweir     return bRet;
647cdf0e10cSrcweir }
648cdf0e10cSrcweir 
649cdf0e10cSrcweir 
650