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