xref: /trunk/main/svx/source/form/fmsrccfg.cxx (revision f6e50924)
1*f6e50924SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*f6e50924SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*f6e50924SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*f6e50924SAndrew Rist  * distributed with this work for additional information
6*f6e50924SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*f6e50924SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*f6e50924SAndrew Rist  * "License"); you may not use this file except in compliance
9*f6e50924SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*f6e50924SAndrew Rist  *
11*f6e50924SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*f6e50924SAndrew Rist  *
13*f6e50924SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*f6e50924SAndrew Rist  * software distributed under the License is distributed on an
15*f6e50924SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*f6e50924SAndrew Rist  * KIND, either express or implied.  See the License for the
17*f6e50924SAndrew Rist  * specific language governing permissions and limitations
18*f6e50924SAndrew Rist  * under the License.
19*f6e50924SAndrew Rist  *
20*f6e50924SAndrew Rist  *************************************************************/
21*f6e50924SAndrew Rist 
22*f6e50924SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_svx.hxx"
26cdf0e10cSrcweir #include "svx/fmsrccfg.hxx"
27cdf0e10cSrcweir #include <svl/filerec.hxx>
28cdf0e10cSrcweir #include <com/sun/star/i18n/TransliterationModules.hpp>
29cdf0e10cSrcweir #include <comphelper/processfactory.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir 
32cdf0e10cSrcweir using namespace ::com::sun::star::uno;
33cdf0e10cSrcweir using namespace ::com::sun::star::i18n;
34cdf0e10cSrcweir 
35cdf0e10cSrcweir //........................................................................
36cdf0e10cSrcweir namespace svxform
37cdf0e10cSrcweir {
38cdf0e10cSrcweir //........................................................................
39cdf0e10cSrcweir 
40cdf0e10cSrcweir 	// ====================================================================
41cdf0e10cSrcweir 	// = struct FmSearchParams - Parameter einer Suche
42cdf0e10cSrcweir 	// ====================================================================
43cdf0e10cSrcweir 
44cdf0e10cSrcweir 	//---------------------------------------------------------------------
45cdf0e10cSrcweir 	//--- 20.08.01 18:17:34 -----------------------------------------------
46cdf0e10cSrcweir 
FmSearchParams()47cdf0e10cSrcweir 	FmSearchParams::FmSearchParams()
48cdf0e10cSrcweir         :nTransliterationFlags( 0 )
49cdf0e10cSrcweir 		,nSearchForType     ( 0 )
50cdf0e10cSrcweir 		,nPosition			( MATCHING_ANYWHERE )
51cdf0e10cSrcweir 		,nLevOther			( 2 )
52cdf0e10cSrcweir 		,nLevShorter		( 2 )
53cdf0e10cSrcweir 		,nLevLonger			( 2 )
54cdf0e10cSrcweir 		,bLevRelaxed		( sal_True )
55cdf0e10cSrcweir         ,bAllFields			( sal_False )
56cdf0e10cSrcweir         ,bUseFormatter		( sal_True )
57cdf0e10cSrcweir 		,bBackwards			( sal_False )
58cdf0e10cSrcweir 		,bWildcard			( sal_False )
59cdf0e10cSrcweir 		,bRegular			( sal_False )
60cdf0e10cSrcweir 		,bApproxSearch		( sal_False )
61cdf0e10cSrcweir 		,bSoundsLikeCJK		( sal_False )
62cdf0e10cSrcweir 	{
63cdf0e10cSrcweir 		nTransliterationFlags =
64cdf0e10cSrcweir 				TransliterationModules_ignoreSpace_ja_JP
65cdf0e10cSrcweir 			|	TransliterationModules_ignoreMiddleDot_ja_JP
66cdf0e10cSrcweir 			|	TransliterationModules_ignoreProlongedSoundMark_ja_JP
67cdf0e10cSrcweir 			|	TransliterationModules_ignoreSeparator_ja_JP
68cdf0e10cSrcweir 			|	TransliterationModules_IGNORE_CASE;
69cdf0e10cSrcweir 	}
70cdf0e10cSrcweir 
71cdf0e10cSrcweir 	//---------------------------------------------------------------------
72cdf0e10cSrcweir 	//--- 21.08.01 13:31:48 -----------------------------------------------
73cdf0e10cSrcweir 
isIgnoreWidthCJK() const74cdf0e10cSrcweir 	sal_Bool FmSearchParams::isIgnoreWidthCJK( ) const
75cdf0e10cSrcweir 	{
76cdf0e10cSrcweir 		return 0 != (nTransliterationFlags & TransliterationModules_IGNORE_WIDTH);
77cdf0e10cSrcweir 	}
78cdf0e10cSrcweir 
79cdf0e10cSrcweir 	//---------------------------------------------------------------------
80cdf0e10cSrcweir 	//--- 21.08.01 13:32:03 -----------------------------------------------
81cdf0e10cSrcweir 
setIgnoreWidthCJK(sal_Bool _bIgnore)82cdf0e10cSrcweir 	void FmSearchParams::setIgnoreWidthCJK( sal_Bool _bIgnore )
83cdf0e10cSrcweir 	{
84cdf0e10cSrcweir 		if ( _bIgnore )
85cdf0e10cSrcweir 			nTransliterationFlags |= TransliterationModules_IGNORE_WIDTH;
86cdf0e10cSrcweir 		else
87cdf0e10cSrcweir 			nTransliterationFlags &= ~TransliterationModules_IGNORE_WIDTH;
88cdf0e10cSrcweir 	}
89cdf0e10cSrcweir 
90cdf0e10cSrcweir 	//---------------------------------------------------------------------
91cdf0e10cSrcweir 	//--- 21.08.01 13:47:52 -----------------------------------------------
92cdf0e10cSrcweir 
isCaseSensitive() const93cdf0e10cSrcweir 	sal_Bool FmSearchParams::isCaseSensitive( ) const
94cdf0e10cSrcweir 	{
95cdf0e10cSrcweir 	    return 0 == (nTransliterationFlags & TransliterationModules_IGNORE_CASE);
96cdf0e10cSrcweir 	}
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 	//---------------------------------------------------------------------
99cdf0e10cSrcweir 	//--- 21.08.01 13:48:00 -----------------------------------------------
100cdf0e10cSrcweir 
setCaseSensitive(sal_Bool _bCase)101cdf0e10cSrcweir 	void FmSearchParams::setCaseSensitive( sal_Bool _bCase )
102cdf0e10cSrcweir 	{
103cdf0e10cSrcweir 		if ( _bCase )
104cdf0e10cSrcweir 			nTransliterationFlags &= ~TransliterationModules_IGNORE_CASE;
105cdf0e10cSrcweir 		else
106cdf0e10cSrcweir 			nTransliterationFlags |= TransliterationModules_IGNORE_CASE;
107cdf0e10cSrcweir 	}
108cdf0e10cSrcweir 
109cdf0e10cSrcweir 	// ====================================================================
110cdf0e10cSrcweir 	// = maps from ascii values to int values
111cdf0e10cSrcweir 	// ====================================================================
112cdf0e10cSrcweir 
113cdf0e10cSrcweir 	struct Ascii2Int16
114cdf0e10cSrcweir 	{
115cdf0e10cSrcweir 		const sal_Char*	pAscii;
116cdf0e10cSrcweir 		sal_Int16		nValue;
117cdf0e10cSrcweir 	};
118cdf0e10cSrcweir 
119cdf0e10cSrcweir 	//---------------------------------------------------------------------
120cdf0e10cSrcweir 	//--- 20.08.01 18:28:38 -----------------------------------------------
121cdf0e10cSrcweir 
lcl_getSearchForTypeValueMap()122cdf0e10cSrcweir 	static const Ascii2Int16* lcl_getSearchForTypeValueMap()
123cdf0e10cSrcweir 	{
124cdf0e10cSrcweir 		static const Ascii2Int16 s_aSearchForTypeMap[] =
125cdf0e10cSrcweir 		{
126cdf0e10cSrcweir 			{ "text",		0 },
127cdf0e10cSrcweir 			{ "null",		1 },
128cdf0e10cSrcweir 			{ "non-null",	2 },
129cdf0e10cSrcweir 			{ NULL,			-1 }
130cdf0e10cSrcweir 		};
131cdf0e10cSrcweir 		return s_aSearchForTypeMap;
132cdf0e10cSrcweir 	}
133cdf0e10cSrcweir 
134cdf0e10cSrcweir 	//---------------------------------------------------------------------
135cdf0e10cSrcweir 	//--- 20.08.01 18:28:38 -----------------------------------------------
136cdf0e10cSrcweir 
lcl_getSearchPositionValueMap()137cdf0e10cSrcweir 	static const Ascii2Int16* lcl_getSearchPositionValueMap()
138cdf0e10cSrcweir 	{
139cdf0e10cSrcweir 		static const Ascii2Int16 s_aSearchPositionMap[] =
140cdf0e10cSrcweir 		{
141cdf0e10cSrcweir 			{ "anywhere-in-field",		MATCHING_ANYWHERE },
142cdf0e10cSrcweir 			{ "beginning-of-field",		MATCHING_BEGINNING },
143cdf0e10cSrcweir 			{ "end-of-field",			MATCHING_END },
144cdf0e10cSrcweir 			{ "complete-field",			MATCHING_WHOLETEXT },
145cdf0e10cSrcweir 			{ NULL,						-1 }
146cdf0e10cSrcweir 		};
147cdf0e10cSrcweir 		return s_aSearchPositionMap;
148cdf0e10cSrcweir 	}
149cdf0e10cSrcweir 
150cdf0e10cSrcweir 	//---------------------------------------------------------------------
151cdf0e10cSrcweir 	//--- 20.08.01 18:30:15 -----------------------------------------------
152cdf0e10cSrcweir 
lcl_implMapAsciiValue(const::rtl::OUString & _rAsciiValue,const Ascii2Int16 * _pMap)153cdf0e10cSrcweir 	static sal_Int16 lcl_implMapAsciiValue( const ::rtl::OUString& _rAsciiValue, const Ascii2Int16* _pMap )
154cdf0e10cSrcweir 	{
155cdf0e10cSrcweir 		// search the map for the given ascii value
156cdf0e10cSrcweir 		const Ascii2Int16* pSearch = _pMap;
157cdf0e10cSrcweir 		while ( pSearch && pSearch->pAscii )
158cdf0e10cSrcweir 		{
159cdf0e10cSrcweir 			if ( 0 == _rAsciiValue.compareToAscii( pSearch->pAscii ) )
160cdf0e10cSrcweir 				// found
161cdf0e10cSrcweir 				return pSearch->nValue;
162cdf0e10cSrcweir 			++pSearch;
163cdf0e10cSrcweir 		}
164cdf0e10cSrcweir 
165cdf0e10cSrcweir 		DBG_ERROR(
166cdf0e10cSrcweir 			(	::rtl::OString( "lcl_implMapAsciiValue: could not convert the ascii value " )
167cdf0e10cSrcweir 			+=	::rtl::OString( _rAsciiValue.getStr(), _rAsciiValue.getLength(), RTL_TEXTENCODING_ASCII_US )
168cdf0e10cSrcweir 			+=	::rtl::OString( " !" )
169cdf0e10cSrcweir 			).getStr()
170cdf0e10cSrcweir 		);
171cdf0e10cSrcweir 		return -1;
172cdf0e10cSrcweir 	}
173cdf0e10cSrcweir 
174cdf0e10cSrcweir 	//---------------------------------------------------------------------
175cdf0e10cSrcweir 	//--- 20.08.01 18:33:06 -----------------------------------------------
176cdf0e10cSrcweir 
lcl_implMapIntValue(const sal_Int16 _nValue,const Ascii2Int16 * _pMap)177cdf0e10cSrcweir 	static const sal_Char* lcl_implMapIntValue( const sal_Int16 _nValue, const Ascii2Int16* _pMap )
178cdf0e10cSrcweir 	{
179cdf0e10cSrcweir 		// search the map for the given integer value
180cdf0e10cSrcweir 		const Ascii2Int16* pSearch = _pMap;
181cdf0e10cSrcweir 		while ( pSearch && pSearch->pAscii )
182cdf0e10cSrcweir 		{
183cdf0e10cSrcweir 			if ( _nValue == pSearch->nValue )
184cdf0e10cSrcweir 				// found
185cdf0e10cSrcweir 				return pSearch->pAscii;
186cdf0e10cSrcweir 			++pSearch;
187cdf0e10cSrcweir 		}
188cdf0e10cSrcweir 
189cdf0e10cSrcweir 		DBG_ERROR(
190cdf0e10cSrcweir 			(	::rtl::OString( "lcl_implMapIntValue: could not convert the integer value " )
191cdf0e10cSrcweir 			+=	::rtl::OString::valueOf( (sal_Int32)_nValue )
192cdf0e10cSrcweir 			+=	::rtl::OString( " !" )
193cdf0e10cSrcweir 			).getStr()
194cdf0e10cSrcweir 		);
195cdf0e10cSrcweir 		static const sal_Char* s_pDummy = "";
196cdf0e10cSrcweir 			// just as a fallback ....
197cdf0e10cSrcweir 		return s_pDummy;
198cdf0e10cSrcweir 	}
199cdf0e10cSrcweir 
200cdf0e10cSrcweir 	// ====================================================================
201cdf0e10cSrcweir 	// = class FmSearchConfigItem - ein ConfigItem, dass sich Suchparameter merkt
202cdf0e10cSrcweir 	// ====================================================================
203cdf0e10cSrcweir 
204cdf0e10cSrcweir #define TA( c )		&c, getCppuType( &c )
205cdf0e10cSrcweir 
206cdf0e10cSrcweir 	//---------------------------------------------------------------------
207cdf0e10cSrcweir 	//--- 20.08.01 18:19:59 -----------------------------------------------
208cdf0e10cSrcweir 
FmSearchConfigItem()209cdf0e10cSrcweir 	FmSearchConfigItem::FmSearchConfigItem()
210cdf0e10cSrcweir 		:OConfigurationValueContainer( ::comphelper::getProcessServiceFactory(), m_aMutex, "/org.openoffice.Office.DataAccess/FormSearchOptions", CVC_UPDATE_ACCESS | CVC_LAZY_UPDATE, 2 )
211cdf0e10cSrcweir 	{
212cdf0e10cSrcweir 		// register our members so the data exchange with the node values is done automatically
213cdf0e10cSrcweir 
214cdf0e10cSrcweir 		registerExchangeLocation( "SearchHistory",						TA( aHistory ) );
215cdf0e10cSrcweir 		registerExchangeLocation( "LevenshteinOther",					TA( nLevOther ) );
216cdf0e10cSrcweir 		registerExchangeLocation( "LevenshteinShorter",					TA( nLevShorter ) );
217cdf0e10cSrcweir 		registerExchangeLocation( "LevenshteinLonger",					TA( nLevLonger ) );
218cdf0e10cSrcweir 		registerExchangeLocation( "IsLevenshteinRelaxed",				TA( bLevRelaxed ) );
219cdf0e10cSrcweir 		registerExchangeLocation( "IsSearchAllFields",					TA( bAllFields ) );
220cdf0e10cSrcweir 		registerExchangeLocation( "IsUseFormatter",						TA( bUseFormatter ) );
221cdf0e10cSrcweir 		registerExchangeLocation( "IsBackwards",						TA( bBackwards ) );
222cdf0e10cSrcweir 		registerExchangeLocation( "IsWildcardSearch",					TA( bWildcard ) );
223cdf0e10cSrcweir 		registerExchangeLocation( "IsUseRegularExpression",				TA( bRegular ) );
224cdf0e10cSrcweir 		registerExchangeLocation( "IsSimilaritySearch",					TA( bApproxSearch ) );
225cdf0e10cSrcweir 		registerExchangeLocation( "IsUseAsianOptions",					TA( bSoundsLikeCJK ) );
226cdf0e10cSrcweir 
227cdf0e10cSrcweir 		// the properties which need to be translated
228cdf0e10cSrcweir 		registerExchangeLocation( "SearchType",							TA( m_sSearchForType ) );
229cdf0e10cSrcweir 		registerExchangeLocation( "SearchPosition",						TA( m_sSearchPosition ) );
230cdf0e10cSrcweir 
231cdf0e10cSrcweir 		registerExchangeLocation( "IsMatchCase",						TA( m_bIsMatchCase ) );
232cdf0e10cSrcweir 		registerExchangeLocation( "Japanese/IsMatchFullHalfWidthForms",	TA( m_bIsMatchFullHalfWidthForms ) );
233cdf0e10cSrcweir 		registerExchangeLocation( "Japanese/IsMatchHiraganaKatakana",	TA( m_bIsMatchHiraganaKatakana ) );
234cdf0e10cSrcweir 		registerExchangeLocation( "Japanese/IsMatchContractions",		TA( m_bIsMatchContractions ) );
235cdf0e10cSrcweir 		registerExchangeLocation( "Japanese/IsMatchMinusDashCho-on",	TA( m_bIsMatchMinusDashCho_on ) );
236cdf0e10cSrcweir 		registerExchangeLocation( "Japanese/IsMatchRepeatCharMarks",	TA( m_bIsMatchRepeatCharMarks ) );
237cdf0e10cSrcweir 		registerExchangeLocation( "Japanese/IsMatchVariantFormKanji",	TA( m_bIsMatchVariantFormKanji ) );
238cdf0e10cSrcweir 		registerExchangeLocation( "Japanese/IsMatchOldKanaForms",		TA( m_bIsMatchOldKanaForms ) );
239cdf0e10cSrcweir 		registerExchangeLocation( "Japanese/IsMatch_DiZi_DuZu",			TA( m_bIsMatch_DiZi_DuZu ) );
240cdf0e10cSrcweir 		registerExchangeLocation( "Japanese/IsMatch_BaVa_HaFa",			TA( m_bIsMatch_BaVa_HaFa ) );
241cdf0e10cSrcweir 		registerExchangeLocation( "Japanese/IsMatch_TsiThiChi_DhiZi",	TA( m_bIsMatch_TsiThiChi_DhiZi ) );
242cdf0e10cSrcweir 		registerExchangeLocation( "Japanese/IsMatch_HyuIyu_ByuVyu",		TA( m_bIsMatch_HyuIyu_ByuVyu ) );
243cdf0e10cSrcweir 		registerExchangeLocation( "Japanese/IsMatch_SeShe_ZeJe",		TA( m_bIsMatch_SeShe_ZeJe ) );
244cdf0e10cSrcweir 		registerExchangeLocation( "Japanese/IsMatch_IaIya",				TA( m_bIsMatch_IaIya ) );
245cdf0e10cSrcweir 		registerExchangeLocation( "Japanese/IsMatch_KiKu",				TA( m_bIsMatch_KiKu ) );
246cdf0e10cSrcweir 		registerExchangeLocation( "Japanese/IsIgnorePunctuation",		TA( m_bIsIgnorePunctuation ) );
247cdf0e10cSrcweir 		registerExchangeLocation( "Japanese/IsIgnoreWhitespace",		TA( m_bIsIgnoreWhitespace ) );
248cdf0e10cSrcweir 		registerExchangeLocation( "Japanese/IsIgnoreProlongedSoundMark",TA( m_bIsIgnoreProlongedSoundMark ) );
249cdf0e10cSrcweir 		registerExchangeLocation( "Japanese/IsIgnoreMiddleDot",			TA( m_bIsIgnoreMiddleDot ) );
250cdf0e10cSrcweir 
251cdf0e10cSrcweir 		read( );
252cdf0e10cSrcweir 	}
253cdf0e10cSrcweir 
254cdf0e10cSrcweir 	//---------------------------------------------------------------------
255cdf0e10cSrcweir 	//--- 20.08.01 18:19:57 -----------------------------------------------
256cdf0e10cSrcweir 
~FmSearchConfigItem()257cdf0e10cSrcweir 	FmSearchConfigItem::~FmSearchConfigItem()
258cdf0e10cSrcweir 	{
259cdf0e10cSrcweir 		commit( );
260cdf0e10cSrcweir 	}
261cdf0e10cSrcweir 
262cdf0e10cSrcweir 	//---------------------------------------------------------------------
263cdf0e10cSrcweir 	//--- 20.08.01 18:20:48 -----------------------------------------------
264cdf0e10cSrcweir 
implTranslateFromConfig()265cdf0e10cSrcweir 	void FmSearchConfigItem::implTranslateFromConfig( )
266cdf0e10cSrcweir 	{
267cdf0e10cSrcweir 		// the search-for string
268cdf0e10cSrcweir 		nSearchForType = lcl_implMapAsciiValue( m_sSearchForType, lcl_getSearchForTypeValueMap() );
269cdf0e10cSrcweir 
270cdf0e10cSrcweir 		// the search position
271cdf0e10cSrcweir 		nPosition = lcl_implMapAsciiValue( m_sSearchPosition, lcl_getSearchPositionValueMap() );
272cdf0e10cSrcweir 
273cdf0e10cSrcweir 		// the transliteration flags
274cdf0e10cSrcweir 		nTransliterationFlags = 0;
275cdf0e10cSrcweir 
276cdf0e10cSrcweir 		if ( !m_bIsMatchCase				)	nTransliterationFlags |= TransliterationModules_IGNORE_CASE;
277cdf0e10cSrcweir 		if ( m_bIsMatchFullHalfWidthForms	)	nTransliterationFlags |= TransliterationModules_IGNORE_WIDTH;
278cdf0e10cSrcweir 		if ( m_bIsMatchHiraganaKatakana		)	nTransliterationFlags |= TransliterationModules_IGNORE_KANA;
279cdf0e10cSrcweir 		if ( m_bIsMatchContractions			)	nTransliterationFlags |= TransliterationModules_ignoreSize_ja_JP;
280cdf0e10cSrcweir 		if ( m_bIsMatchMinusDashCho_on		)	nTransliterationFlags |= TransliterationModules_ignoreMinusSign_ja_JP;
281cdf0e10cSrcweir 		if ( m_bIsMatchRepeatCharMarks		)	nTransliterationFlags |= TransliterationModules_ignoreIterationMark_ja_JP;
282cdf0e10cSrcweir 		if ( m_bIsMatchVariantFormKanji		)	nTransliterationFlags |= TransliterationModules_ignoreTraditionalKanji_ja_JP;
283cdf0e10cSrcweir 		if ( m_bIsMatchOldKanaForms			)	nTransliterationFlags |= TransliterationModules_ignoreTraditionalKana_ja_JP;
284cdf0e10cSrcweir 		if ( m_bIsMatch_DiZi_DuZu			)	nTransliterationFlags |= TransliterationModules_ignoreZiZu_ja_JP;
285cdf0e10cSrcweir 		if ( m_bIsMatch_BaVa_HaFa			)	nTransliterationFlags |= TransliterationModules_ignoreBaFa_ja_JP;
286cdf0e10cSrcweir 		if ( m_bIsMatch_TsiThiChi_DhiZi		)	nTransliterationFlags |= TransliterationModules_ignoreTiJi_ja_JP;
287cdf0e10cSrcweir 		if ( m_bIsMatch_HyuIyu_ByuVyu		)	nTransliterationFlags |= TransliterationModules_ignoreHyuByu_ja_JP;
288cdf0e10cSrcweir 		if ( m_bIsMatch_SeShe_ZeJe			)	nTransliterationFlags |= TransliterationModules_ignoreSeZe_ja_JP;
289cdf0e10cSrcweir 		if ( m_bIsMatch_IaIya				)	nTransliterationFlags |= TransliterationModules_ignoreIandEfollowedByYa_ja_JP;
290cdf0e10cSrcweir 		if ( m_bIsMatch_KiKu				)	nTransliterationFlags |= TransliterationModules_ignoreKiKuFollowedBySa_ja_JP;
291cdf0e10cSrcweir 
292cdf0e10cSrcweir 		if ( m_bIsIgnorePunctuation			)	nTransliterationFlags |= TransliterationModules_ignoreSeparator_ja_JP;
293cdf0e10cSrcweir 		if ( m_bIsIgnoreWhitespace			)	nTransliterationFlags |= TransliterationModules_ignoreSpace_ja_JP;
294cdf0e10cSrcweir 		if ( m_bIsIgnoreProlongedSoundMark	)	nTransliterationFlags |= TransliterationModules_ignoreProlongedSoundMark_ja_JP;
295cdf0e10cSrcweir 		if ( m_bIsIgnoreMiddleDot			)	nTransliterationFlags |= TransliterationModules_ignoreMiddleDot_ja_JP;
296cdf0e10cSrcweir 	}
297cdf0e10cSrcweir 
298cdf0e10cSrcweir 	//---------------------------------------------------------------------
299cdf0e10cSrcweir 	//--- 20.08.01 18:42:23 -----------------------------------------------
300cdf0e10cSrcweir 
implTranslateToConfig()301cdf0e10cSrcweir 	void FmSearchConfigItem::implTranslateToConfig( )
302cdf0e10cSrcweir 	{
303cdf0e10cSrcweir 		// the search-for string
304cdf0e10cSrcweir 		m_sSearchForType = ::rtl::OUString::createFromAscii( lcl_implMapIntValue( nSearchForType, lcl_getSearchForTypeValueMap() ) );
305cdf0e10cSrcweir 
306cdf0e10cSrcweir 		// the search position
307cdf0e10cSrcweir 		m_sSearchPosition = ::rtl::OUString::createFromAscii( lcl_implMapIntValue( nPosition, lcl_getSearchPositionValueMap() ) );
308cdf0e10cSrcweir 
309cdf0e10cSrcweir 		// the transliteration flags
310cdf0e10cSrcweir 
311cdf0e10cSrcweir 		m_bIsMatchCase					= ( 0 == ( nTransliterationFlags & TransliterationModules_IGNORE_CASE ) );
312cdf0e10cSrcweir 		m_bIsMatchFullHalfWidthForms	= ( 0 != ( nTransliterationFlags & TransliterationModules_IGNORE_WIDTH ) );
313cdf0e10cSrcweir 		m_bIsMatchHiraganaKatakana		= ( 0 != ( nTransliterationFlags & TransliterationModules_IGNORE_KANA ) );
314cdf0e10cSrcweir 		m_bIsMatchContractions			= ( 0 != ( nTransliterationFlags & TransliterationModules_ignoreSize_ja_JP ) );
315cdf0e10cSrcweir 		m_bIsMatchMinusDashCho_on		= ( 0 != ( nTransliterationFlags & TransliterationModules_ignoreMinusSign_ja_JP ) );
316cdf0e10cSrcweir 		m_bIsMatchRepeatCharMarks		= ( 0 != ( nTransliterationFlags & TransliterationModules_ignoreIterationMark_ja_JP ) );
317cdf0e10cSrcweir 		m_bIsMatchVariantFormKanji		= ( 0 != ( nTransliterationFlags & TransliterationModules_ignoreTraditionalKanji_ja_JP ) );
318cdf0e10cSrcweir 		m_bIsMatchOldKanaForms			= ( 0 != ( nTransliterationFlags & TransliterationModules_ignoreTraditionalKana_ja_JP ) );
319cdf0e10cSrcweir 		m_bIsMatch_DiZi_DuZu			= ( 0 != ( nTransliterationFlags & TransliterationModules_ignoreZiZu_ja_JP ) );
320cdf0e10cSrcweir 		m_bIsMatch_BaVa_HaFa			= ( 0 != ( nTransliterationFlags & TransliterationModules_ignoreBaFa_ja_JP ) );
321cdf0e10cSrcweir 		m_bIsMatch_TsiThiChi_DhiZi		= ( 0 != ( nTransliterationFlags & TransliterationModules_ignoreTiJi_ja_JP ) );
322cdf0e10cSrcweir 		m_bIsMatch_HyuIyu_ByuVyu		= ( 0 != ( nTransliterationFlags & TransliterationModules_ignoreHyuByu_ja_JP ) );
323cdf0e10cSrcweir 		m_bIsMatch_SeShe_ZeJe			= ( 0 != ( nTransliterationFlags & TransliterationModules_ignoreSeZe_ja_JP ) );
324cdf0e10cSrcweir 		m_bIsMatch_IaIya				= ( 0 != ( nTransliterationFlags & TransliterationModules_ignoreIandEfollowedByYa_ja_JP ) );
325cdf0e10cSrcweir 		m_bIsMatch_KiKu					= ( 0 != ( nTransliterationFlags & TransliterationModules_ignoreKiKuFollowedBySa_ja_JP ) );
326cdf0e10cSrcweir 
327cdf0e10cSrcweir 		m_bIsIgnorePunctuation			= ( 0 != ( nTransliterationFlags & TransliterationModules_ignoreSeparator_ja_JP ) );
328cdf0e10cSrcweir 		m_bIsIgnoreWhitespace			= ( 0 != ( nTransliterationFlags & TransliterationModules_ignoreSpace_ja_JP ) );
329cdf0e10cSrcweir 		m_bIsIgnoreProlongedSoundMark	= ( 0 != ( nTransliterationFlags & TransliterationModules_ignoreProlongedSoundMark_ja_JP ) );
330cdf0e10cSrcweir 		m_bIsIgnoreMiddleDot			= ( 0 != ( nTransliterationFlags & TransliterationModules_ignoreMiddleDot_ja_JP ) );
331cdf0e10cSrcweir 	}
332cdf0e10cSrcweir 
333cdf0e10cSrcweir 	//---------------------------------------------------------------------
334cdf0e10cSrcweir 	//--- 20.08.01 18:20:01 -----------------------------------------------
335cdf0e10cSrcweir 
getParams() const336cdf0e10cSrcweir 	const FmSearchParams& FmSearchConfigItem::getParams() const
337cdf0e10cSrcweir 	{
338cdf0e10cSrcweir 		// ensure that the properties which are not stored directly are up-to-date
339cdf0e10cSrcweir 		const_cast< FmSearchConfigItem* >( this )->implTranslateFromConfig( );
340cdf0e10cSrcweir 
341cdf0e10cSrcweir 		// and return our FmSearchParams part
342cdf0e10cSrcweir 		return *this;
343cdf0e10cSrcweir 	}
344cdf0e10cSrcweir 
345cdf0e10cSrcweir 	//---------------------------------------------------------------------
346cdf0e10cSrcweir 	//--- 20.08.01 18:41:57 -----------------------------------------------
347cdf0e10cSrcweir 
setParams(const FmSearchParams & _rParams)348cdf0e10cSrcweir 	void FmSearchConfigItem::setParams( const FmSearchParams& _rParams )
349cdf0e10cSrcweir 	{
350cdf0e10cSrcweir 		// copy the FmSearchParams part
351cdf0e10cSrcweir 		*static_cast< FmSearchParams* >( this ) = _rParams;
352cdf0e10cSrcweir 
353cdf0e10cSrcweir 		// translate the settings not represented by a direct config value
354cdf0e10cSrcweir 		implTranslateToConfig();
355cdf0e10cSrcweir 	}
356cdf0e10cSrcweir 
357cdf0e10cSrcweir //........................................................................
358cdf0e10cSrcweir }	// namespace svxform
359cdf0e10cSrcweir //........................................................................
360