bump product version to 5.0.4.1
[LibreOffice.git] / svl / source / items / srchitem.cxx
blob986463e1d4893fd681baf474c1b22eec56af381b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sal/config.h>
22 #include <sal/log.hxx>
23 #include <svl/srchitem.hxx>
24 #include <sal/macros.h>
25 #include <osl/diagnose.h>
27 #include <unotools/searchopt.hxx>
28 #include <com/sun/star/util/XReplaceable.hpp>
29 #include <com/sun/star/util/XSearchable.hpp>
30 #include <com/sun/star/util/XSearchDescriptor.hpp>
31 #include <com/sun/star/util/XPropertyReplace.hpp>
32 #include <com/sun/star/util/XReplaceDescriptor.hpp>
33 #include <com/sun/star/lang/Locale.hpp>
34 #include <svl/memberid.hrc>
35 #include <i18nlangtag/languagetag.hxx>
36 #include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
38 using namespace utl;
39 using namespace com::sun::star;
40 using namespace com::sun::star::beans;
41 using namespace com::sun::star::i18n;
42 using namespace com::sun::star::uno;
43 using namespace com::sun::star::util;
45 #define CFG_ROOT_NODE "Office.Common/SearchOptions"
47 #define SRCH_PARAMS 12
48 #define SRCH_PARA_OPTIONS "Options"
49 #define SRCH_PARA_FAMILY "Family"
50 #define SRCH_PARA_COMMAND "Command"
51 #define SRCH_PARA_CELLTYPE "CellType"
52 #define SRCH_PARA_APPFLAG "AppFlag"
53 #define SRCH_PARA_ROWDIR "RowDirection"
54 #define SRCH_PARA_ALLTABLES "AllTables"
55 #define SRCH_PARA_SEARCHFILTERED "SearchFiltered"
56 #define SRCH_PARA_BACKWARD "Backward"
57 #define SRCH_PARA_PATTERN "Pattern"
58 #define SRCH_PARA_CONTENT "Content"
59 #define SRCH_PARA_ASIANOPT "AsianOptions"
61 // STATIC DATA
63 TYPEINIT1_FACTORY(SvxSearchItem, SfxPoolItem, new SvxSearchItem(0));
67 static Sequence< OUString > lcl_GetNotifyNames()
69 // names of transliteration relevant properties
70 static const char* aTranslitNames[] =
72 "IsMatchCase", // 0
73 "Japanese/IsMatchFullHalfWidthForms", // 1
74 "Japanese/IsMatchHiraganaKatakana", // 2
75 "Japanese/IsMatchContractions", // 3
76 "Japanese/IsMatchMinusDashCho-on", // 4
77 "Japanese/IsMatchRepeatCharMarks", // 5
78 "Japanese/IsMatchVariantFormKanji", // 6
79 "Japanese/IsMatchOldKanaForms", // 7
80 "Japanese/IsMatch_DiZi_DuZu", // 8
81 "Japanese/IsMatch_BaVa_HaFa", // 9
82 "Japanese/IsMatch_TsiThiChi_DhiZi", // 10
83 "Japanese/IsMatch_HyuIyu_ByuVyu", // 11
84 "Japanese/IsMatch_SeShe_ZeJe", // 12
85 "Japanese/IsMatch_IaIya", // 13
86 "Japanese/IsMatch_KiKu", // 14
87 "Japanese/IsIgnorePunctuation", // 15
88 "Japanese/IsIgnoreWhitespace", // 16
89 "Japanese/IsIgnoreProlongedSoundMark", // 17
90 "Japanese/IsIgnoreMiddleDot", // 18
91 "IsIgnoreDiacritics_CTL", // 19
92 "IsIgnoreKashida_CTL" // 20
95 const int nCount = SAL_N_ELEMENTS( aTranslitNames );
96 Sequence< OUString > aNames( nCount );
97 OUString* pNames = aNames.getArray();
98 for (sal_Int32 i = 0; i < nCount; ++i)
99 pNames[i] = OUString::createFromAscii( aTranslitNames[i] );
101 return aNames;
105 SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) :
107 SfxPoolItem( nId ),
108 ConfigItem( OUString(CFG_ROOT_NODE ) ),
110 aSearchOpt ( SearchAlgorithms_ABSOLUTE,
111 SearchFlags::LEV_RELAXED,
112 OUString(),
113 OUString(),
114 lang::Locale(),
115 2, 2, 2,
116 TransliterationModules_IGNORE_CASE ),
117 eFamily ( SFX_STYLE_FAMILY_PARA ),
118 nCommand ( SvxSearchCmd::FIND ),
119 nCellType ( SvxSearchCellType::FORMULA ),
120 nAppFlag ( SvxSearchApp::WRITER ),
121 bRowDirection ( true ),
122 bAllTables ( false ),
123 bSearchFiltered ( false ),
124 bNotes ( false),
125 bBackward ( false ),
126 bPattern ( false ),
127 bContent ( false ),
128 bAsianOptions ( false ),
129 m_nStartPointX(0),
130 m_nStartPointY(0)
132 EnableNotification( lcl_GetNotifyNames() );
134 SvtSearchOptions aOpt;
136 bBackward = aOpt.IsBackwards();
137 bAsianOptions = aOpt.IsUseAsianOptions();
138 bNotes = aOpt.IsNotes();
140 if (aOpt.IsUseRegularExpression())
141 aSearchOpt.algorithmType = SearchAlgorithms_REGEXP;
142 if (aOpt.IsSimilaritySearch())
143 aSearchOpt.algorithmType = SearchAlgorithms_APPROXIMATE;
144 if (aOpt.IsWholeWordsOnly())
145 aSearchOpt.searchFlag |= SearchFlags::NORM_WORD_ONLY;
147 sal_Int32 &rFlags = aSearchOpt.transliterateFlags;
149 if (!aOpt.IsMatchCase())
150 rFlags |= TransliterationModules_IGNORE_CASE;
151 if ( aOpt.IsMatchFullHalfWidthForms())
152 rFlags |= TransliterationModules_IGNORE_WIDTH;
153 if ( aOpt.IsIgnoreDiacritics_CTL())
154 rFlags |= TransliterationModulesExtra::IGNORE_DIACRITICS_CTL ;
155 if ( aOpt.IsIgnoreKashida_CTL())
156 rFlags |= TransliterationModulesExtra::IGNORE_KASHIDA_CTL ;
157 if ( bAsianOptions )
159 if ( aOpt.IsMatchHiraganaKatakana())
160 rFlags |= TransliterationModules_IGNORE_KANA;
161 if ( aOpt.IsMatchContractions())
162 rFlags |= TransliterationModules_ignoreSize_ja_JP;
163 if ( aOpt.IsMatchMinusDashChoon())
164 rFlags |= TransliterationModules_ignoreMinusSign_ja_JP;
165 if ( aOpt.IsMatchRepeatCharMarks())
166 rFlags |= TransliterationModules_ignoreIterationMark_ja_JP;
167 if ( aOpt.IsMatchVariantFormKanji())
168 rFlags |= TransliterationModules_ignoreTraditionalKanji_ja_JP;
169 if ( aOpt.IsMatchOldKanaForms())
170 rFlags |= TransliterationModules_ignoreTraditionalKana_ja_JP;
171 if ( aOpt.IsMatchDiziDuzu())
172 rFlags |= TransliterationModules_ignoreZiZu_ja_JP;
173 if ( aOpt.IsMatchBavaHafa())
174 rFlags |= TransliterationModules_ignoreBaFa_ja_JP;
175 if ( aOpt.IsMatchTsithichiDhizi())
176 rFlags |= TransliterationModules_ignoreTiJi_ja_JP;
177 if ( aOpt.IsMatchHyuiyuByuvyu())
178 rFlags |= TransliterationModules_ignoreHyuByu_ja_JP;
179 if ( aOpt.IsMatchSesheZeje())
180 rFlags |= TransliterationModules_ignoreSeZe_ja_JP;
181 if ( aOpt.IsMatchIaiya())
182 rFlags |= TransliterationModules_ignoreIandEfollowedByYa_ja_JP;
183 if ( aOpt.IsMatchKiku())
184 rFlags |= TransliterationModules_ignoreKiKuFollowedBySa_ja_JP;
185 if ( aOpt.IsIgnorePunctuation())
186 rFlags |= TransliterationModules_ignoreSeparator_ja_JP;
187 if ( aOpt.IsIgnoreWhitespace())
188 rFlags |= TransliterationModules_ignoreSpace_ja_JP;
189 if ( aOpt.IsIgnoreProlongedSoundMark())
190 rFlags |= TransliterationModules_ignoreProlongedSoundMark_ja_JP;
191 if ( aOpt.IsIgnoreMiddleDot())
192 rFlags |= TransliterationModules_ignoreMiddleDot_ja_JP;
199 SvxSearchItem::SvxSearchItem( const SvxSearchItem& rItem ) :
201 SfxPoolItem ( rItem ),
202 ConfigItem( OUString(CFG_ROOT_NODE ) ),
204 aSearchOpt ( rItem.aSearchOpt ),
205 eFamily ( rItem.eFamily ),
206 nCommand ( rItem.nCommand ),
207 nCellType ( rItem.nCellType ),
208 nAppFlag ( rItem.nAppFlag ),
209 bRowDirection ( rItem.bRowDirection ),
210 bAllTables ( rItem.bAllTables ),
211 bSearchFiltered ( rItem.bSearchFiltered ),
212 bNotes ( rItem.bNotes),
213 bBackward ( rItem.bBackward ),
214 bPattern ( rItem.bPattern ),
215 bContent ( rItem.bContent ),
216 bAsianOptions ( rItem.bAsianOptions ),
217 m_nStartPointX(rItem.m_nStartPointX),
218 m_nStartPointY(rItem.m_nStartPointY)
220 EnableNotification( lcl_GetNotifyNames() );
225 SvxSearchItem::~SvxSearchItem()
230 SfxPoolItem* SvxSearchItem::Clone( SfxItemPool *) const
232 return new SvxSearchItem(*this);
237 //! used below
238 static bool operator == ( const SearchOptions& rItem1, const SearchOptions& rItem2 )
240 return rItem1.algorithmType == rItem2.algorithmType &&
241 rItem1.searchFlag == rItem2.searchFlag &&
242 rItem1.searchString == rItem2.searchString &&
243 rItem1.replaceString == rItem2.replaceString &&
244 //rItem1.Locale == rItem2.Locale &&
245 rItem1.changedChars == rItem2.changedChars &&
246 rItem1.deletedChars == rItem2.deletedChars &&
247 rItem1.insertedChars == rItem2.insertedChars &&
248 rItem1.transliterateFlags == rItem2.transliterateFlags;
252 bool SvxSearchItem::operator==( const SfxPoolItem& rItem ) const
254 DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal which or type" );
255 const SvxSearchItem &rSItem = static_cast<const SvxSearchItem &>(rItem);
256 return ( nCommand == rSItem.nCommand ) &&
257 ( bBackward == rSItem.bBackward ) &&
258 ( bPattern == rSItem.bPattern ) &&
259 ( bContent == rSItem.bContent ) &&
260 ( eFamily == rSItem.eFamily ) &&
261 ( bRowDirection == rSItem.bRowDirection ) &&
262 ( bAllTables == rSItem.bAllTables ) &&
263 ( bSearchFiltered == rSItem.bSearchFiltered ) &&
264 ( nCellType == rSItem.nCellType ) &&
265 ( nAppFlag == rSItem.nAppFlag ) &&
266 ( bAsianOptions == rSItem.bAsianOptions ) &&
267 ( aSearchOpt == rSItem.aSearchOpt ) &&
268 ( bNotes == rSItem.bNotes );
273 bool SvxSearchItem::GetPresentation
275 SfxItemPresentation ,
276 SfxMapUnit ,
277 SfxMapUnit ,
278 OUString& ,
279 const IntlWrapper *
280 ) const
282 return false;
285 void SvxSearchItem::Notify( const Sequence< OUString > & )
287 // applies transliteration changes in the configuration database
288 // to the current SvxSearchItem
289 SetTransliterationFlags( SvtSearchOptions().GetTransliterationFlags() );
292 void SvxSearchItem::ImplCommit()
296 void SvxSearchItem::SetMatchFullHalfWidthForms( bool bVal )
298 if (bVal)
299 aSearchOpt.transliterateFlags |= TransliterationModules_IGNORE_WIDTH;
300 else
301 aSearchOpt.transliterateFlags &= ~TransliterationModules_IGNORE_WIDTH;
305 void SvxSearchItem::SetWordOnly( bool bVal )
307 if (bVal)
308 aSearchOpt.searchFlag |= SearchFlags::NORM_WORD_ONLY;
309 else
310 aSearchOpt.searchFlag &= ~SearchFlags::NORM_WORD_ONLY;
314 void SvxSearchItem::SetExact( bool bVal )
316 if (!bVal)
317 aSearchOpt.transliterateFlags |= TransliterationModules_IGNORE_CASE;
318 else
319 aSearchOpt.transliterateFlags &= ~TransliterationModules_IGNORE_CASE;
323 void SvxSearchItem::SetSelection( bool bVal )
325 if (bVal)
327 aSearchOpt.searchFlag |= (SearchFlags::REG_NOT_BEGINOFLINE |
328 SearchFlags::REG_NOT_ENDOFLINE);
330 else
332 aSearchOpt.searchFlag &= ~(SearchFlags::REG_NOT_BEGINOFLINE |
333 SearchFlags::REG_NOT_ENDOFLINE);
338 void SvxSearchItem::SetRegExp( bool bVal )
340 if ( bVal )
341 aSearchOpt.algorithmType = SearchAlgorithms_REGEXP;
342 else if ( SearchAlgorithms_REGEXP == aSearchOpt.algorithmType )
343 aSearchOpt.algorithmType = SearchAlgorithms_ABSOLUTE;
347 void SvxSearchItem::SetLEVRelaxed( bool bVal )
349 if (bVal)
350 aSearchOpt.searchFlag |= SearchFlags::LEV_RELAXED;
351 else
352 aSearchOpt.searchFlag &= ~SearchFlags::LEV_RELAXED;
356 void SvxSearchItem::SetLevenshtein( bool bVal )
358 if ( bVal )
359 aSearchOpt.algorithmType = SearchAlgorithms_APPROXIMATE;
360 else if ( SearchAlgorithms_APPROXIMATE == aSearchOpt.algorithmType )
361 aSearchOpt.algorithmType = SearchAlgorithms_ABSOLUTE;
365 void SvxSearchItem::SetTransliterationFlags( sal_Int32 nFlags )
367 aSearchOpt.transliterateFlags = nFlags;
370 bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const
372 nMemberId &= ~CONVERT_TWIPS;
373 switch ( nMemberId )
375 case 0 :
377 Sequence< PropertyValue > aSeq( SRCH_PARAMS );
378 aSeq[0].Name = SRCH_PARA_OPTIONS;
379 aSeq[0].Value <<= aSearchOpt;
380 aSeq[1].Name = SRCH_PARA_FAMILY;
381 aSeq[1].Value <<= sal_Int16( eFamily );
382 aSeq[2].Name = SRCH_PARA_COMMAND;
383 aSeq[2].Value <<= static_cast<sal_uInt16>(nCommand);
384 aSeq[3].Name = SRCH_PARA_CELLTYPE;
385 aSeq[3].Value <<= static_cast<sal_uInt16>(nCellType);
386 aSeq[4].Name = SRCH_PARA_APPFLAG;
387 aSeq[4].Value <<= static_cast<sal_uInt16>(nAppFlag);
388 aSeq[5].Name = SRCH_PARA_ROWDIR;
389 aSeq[5].Value <<= bRowDirection;
390 aSeq[6].Name = SRCH_PARA_ALLTABLES;
391 aSeq[6].Value <<= bAllTables;
392 aSeq[6].Name = SRCH_PARA_SEARCHFILTERED;
393 aSeq[6].Value <<= bSearchFiltered;
394 aSeq[7].Name = SRCH_PARA_BACKWARD;
395 aSeq[7].Value <<= bBackward;
396 aSeq[8].Name = SRCH_PARA_PATTERN;
397 aSeq[8].Value <<= bPattern;
398 aSeq[9].Name = SRCH_PARA_CONTENT;
399 aSeq[9].Value <<= bContent;
400 aSeq[10].Name = SRCH_PARA_ASIANOPT;
401 aSeq[10].Value <<= bAsianOptions;
402 rVal <<= aSeq;
404 break;
405 case MID_SEARCH_COMMAND:
406 rVal <<= (sal_Int16) nCommand; break;
407 case MID_SEARCH_STYLEFAMILY:
408 rVal <<= (sal_Int16) eFamily; break;
409 case MID_SEARCH_CELLTYPE:
410 rVal <<= (sal_Int32) nCellType; break;
411 case MID_SEARCH_ROWDIRECTION:
412 rVal <<= bRowDirection; break;
413 case MID_SEARCH_ALLTABLES:
414 rVal <<= bAllTables; break;
415 case MID_SEARCH_SEARCHFILTERED:
416 rVal <<= bSearchFiltered; break;
417 case MID_SEARCH_BACKWARD:
418 rVal <<= bBackward; break;
419 case MID_SEARCH_PATTERN:
420 rVal <<= bPattern; break;
421 case MID_SEARCH_CONTENT:
422 rVal <<= bContent; break;
423 case MID_SEARCH_ASIANOPTIONS:
424 rVal <<= bAsianOptions; break;
425 case MID_SEARCH_ALGORITHMTYPE:
426 rVal <<= (sal_Int16) aSearchOpt.algorithmType; break;
427 case MID_SEARCH_FLAGS:
428 rVal <<= aSearchOpt.searchFlag; break;
429 case MID_SEARCH_SEARCHSTRING:
430 rVal <<= aSearchOpt.searchString; break;
431 case MID_SEARCH_REPLACESTRING:
432 rVal <<= aSearchOpt.replaceString; break;
433 case MID_SEARCH_CHANGEDCHARS:
434 rVal <<= aSearchOpt.changedChars; break;
435 case MID_SEARCH_DELETEDCHARS:
436 rVal <<= aSearchOpt.deletedChars; break;
437 case MID_SEARCH_INSERTEDCHARS:
438 rVal <<= aSearchOpt.insertedChars; break;
439 case MID_SEARCH_TRANSLITERATEFLAGS:
440 rVal <<= aSearchOpt.transliterateFlags; break;
441 case MID_SEARCH_LOCALE:
443 sal_Int16 nLocale;
444 if (!aSearchOpt.Locale.Language.isEmpty() || !aSearchOpt.Locale.Country.isEmpty() )
445 nLocale = LanguageTag::convertToLanguageType( aSearchOpt.Locale );
446 else
447 nLocale = LANGUAGE_NONE;
448 rVal <<= nLocale;
449 break;
452 default:
453 SAL_WARN( "svl.items", "SvxSearchItem::QueryValue(): Unknown MemberId" );
454 return false;
457 return true;
462 bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId )
464 nMemberId &= ~CONVERT_TWIPS;
465 bool bRet = false;
466 sal_Int32 nInt = 0;
467 switch ( nMemberId )
469 case 0 :
471 Sequence< PropertyValue > aSeq;
472 if ( ( rVal >>= aSeq ) && ( aSeq.getLength() == SRCH_PARAMS ) )
474 sal_Int16 nConvertedCount( 0 );
475 for ( sal_Int32 i = 0; i < aSeq.getLength(); ++i )
477 if ( aSeq[i].Name == SRCH_PARA_OPTIONS )
479 if ( aSeq[i].Value >>= aSearchOpt )
480 ++nConvertedCount;
482 else if ( aSeq[i].Name == SRCH_PARA_FAMILY )
484 sal_uInt16 nTemp( 0 );
485 if ( aSeq[i].Value >>= nTemp )
487 eFamily = SfxStyleFamily( nTemp );
488 ++nConvertedCount;
491 else if ( aSeq[i].Name == SRCH_PARA_COMMAND )
493 sal_uInt16 nTmp;
494 if ( aSeq[i].Value >>= nTmp )
496 nCommand = static_cast<SvxSearchCmd>(nTmp);
497 ++nConvertedCount;
500 else if ( aSeq[i].Name == SRCH_PARA_CELLTYPE )
502 sal_uInt16 nTmp;
503 if ( aSeq[i].Value >>= nTmp )
505 nCellType = static_cast<SvxSearchCellType>(nTmp);
506 ++nConvertedCount;
509 else if ( aSeq[i].Name == SRCH_PARA_APPFLAG )
511 sal_uInt16 nTmp;
512 if ( aSeq[i].Value >>= nTmp )
514 nAppFlag = static_cast<SvxSearchApp>(nTmp);
515 ++nConvertedCount;
518 else if ( aSeq[i].Name == SRCH_PARA_ROWDIR )
520 if ( aSeq[i].Value >>= bRowDirection )
521 ++nConvertedCount;
523 else if ( aSeq[i].Name == SRCH_PARA_ALLTABLES )
525 if ( aSeq[i].Value >>= bAllTables )
526 ++nConvertedCount;
528 else if ( aSeq[i].Name == SRCH_PARA_SEARCHFILTERED )
530 if ( aSeq[i].Value >>= bSearchFiltered )
531 ++nConvertedCount;
533 else if ( aSeq[i].Name == SRCH_PARA_BACKWARD )
535 if ( aSeq[i].Value >>= bBackward )
536 ++nConvertedCount;
538 else if ( aSeq[i].Name == SRCH_PARA_PATTERN )
540 if ( aSeq[i].Value >>= bPattern )
541 ++nConvertedCount;
543 else if ( aSeq[i].Name == SRCH_PARA_CONTENT )
545 if ( aSeq[i].Value >>= bContent )
546 ++nConvertedCount;
548 else if ( aSeq[i].Name == SRCH_PARA_ASIANOPT )
550 if ( aSeq[i].Value >>= bAsianOptions )
551 ++nConvertedCount;
555 bRet = ( nConvertedCount == SRCH_PARAMS );
557 break;
559 case MID_SEARCH_COMMAND:
560 bRet = (rVal >>= nInt); nCommand = static_cast<SvxSearchCmd>(nInt); break;
561 case MID_SEARCH_STYLEFAMILY:
562 bRet = (rVal >>= nInt); eFamily = (SfxStyleFamily) (sal_Int16) nInt; break;
563 case MID_SEARCH_CELLTYPE:
564 bRet = (rVal >>= nInt); nCellType = static_cast<SvxSearchCellType>(nInt); break;
565 case MID_SEARCH_ROWDIRECTION:
566 bRet = (rVal >>= bRowDirection); break;
567 case MID_SEARCH_ALLTABLES:
568 bRet = (rVal >>= bAllTables); break;
569 case MID_SEARCH_SEARCHFILTERED:
570 bRet = (rVal >>= bSearchFiltered); break;
571 case MID_SEARCH_BACKWARD:
572 bRet = (rVal >>= bBackward); break;
573 case MID_SEARCH_PATTERN:
574 bRet = (rVal >>= bPattern); break;
575 case MID_SEARCH_CONTENT:
576 bRet = (rVal >>= bContent); break;
577 case MID_SEARCH_ASIANOPTIONS:
578 bRet = (rVal >>= bAsianOptions); break;
579 case MID_SEARCH_ALGORITHMTYPE:
580 bRet = (rVal >>= nInt); aSearchOpt.algorithmType = (SearchAlgorithms)(sal_Int16)nInt; break;
581 case MID_SEARCH_FLAGS:
582 bRet = (rVal >>= aSearchOpt.searchFlag); break;
583 case MID_SEARCH_SEARCHSTRING:
584 bRet = (rVal >>= aSearchOpt.searchString); break;
585 case MID_SEARCH_REPLACESTRING:
586 bRet = (rVal >>= aSearchOpt.replaceString); break;
587 case MID_SEARCH_CHANGEDCHARS:
588 bRet = (rVal >>= aSearchOpt.changedChars); break;
589 case MID_SEARCH_DELETEDCHARS:
590 bRet = (rVal >>= aSearchOpt.deletedChars); break;
591 case MID_SEARCH_INSERTEDCHARS:
592 bRet = (rVal >>= aSearchOpt.insertedChars); break;
593 case MID_SEARCH_TRANSLITERATEFLAGS:
594 bRet = (rVal >>= aSearchOpt.transliterateFlags); break;
595 case MID_SEARCH_LOCALE:
597 bRet = (rVal >>= nInt);
598 if ( bRet )
600 if ( nInt == LANGUAGE_NONE )
602 aSearchOpt.Locale = ::com::sun::star::lang::Locale();
604 else
606 aSearchOpt.Locale = LanguageTag::convertToLocale( nInt);
609 break;
611 case MID_SEARCH_STARTPOINTX:
613 bRet = (rVal >>= m_nStartPointX);
614 break;
616 case MID_SEARCH_STARTPOINTY:
618 bRet = (rVal >>= m_nStartPointY);
619 break;
621 default:
622 OSL_FAIL( "Unknown MemberId" );
625 return bRet;
628 sal_Int32 SvxSearchItem::GetStartPointX() const
630 return m_nStartPointX;
633 sal_Int32 SvxSearchItem::GetStartPointY() const
635 return m_nStartPointY;
638 bool SvxSearchItem::HasStartPoint() const
640 return m_nStartPointX > 0 || m_nStartPointY > 0;
643 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */