LibreOffice Module sw (master)  1
unosrch.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #include <hintids.hxx>
21 #include <unosrch.hxx>
22 #include <unomap.hxx>
23 #include <swtypes.hxx>
24 
25 #include <osl/diagnose.h>
27 #include <i18nutil/searchopt.hxx>
28 #include <o3tl/any.hxx>
29 #include <vcl/svapp.hxx>
30 #include <com/sun/star/util/SearchAlgorithms2.hpp>
31 #include <com/sun/star/util/SearchFlags.hpp>
32 #include <com/sun/star/beans/PropertyAttribute.hpp>
35 #include <svl/itemprop.hxx>
36 #include <svl/itempool.hxx>
37 #include <memory>
38 
39 using namespace ::com::sun::star;
40 
42 {
43  std::unordered_map<OUString, beans::PropertyValue> maValues;
45 
48 
49 public:
51 
55  void SetProperties(const uno::Sequence< beans::PropertyValue >& aSearchAttribs);
56  uno::Sequence< beans::PropertyValue > GetProperties() const;
57 
58  void FillItemSet(SfxItemSet& rSet, bool bIsValueSearch) const;
59  bool HasAttributes() const;
60 };
61 
63  mrMap( aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)->getPropertyMap() )
64 {
65 }
66 
67 void SwSearchProperties_Impl::SetProperties(const uno::Sequence< beans::PropertyValue >& aSearchAttribs)
68 {
69  //delete all existing values
70  maValues.clear();
71 
72  for(const beans::PropertyValue& rSearchAttrib : aSearchAttribs)
73  {
74  const OUString& sName = rSearchAttrib.Name;
75  if( !mrMap.hasPropertyByName(sName) )
76  throw beans::UnknownPropertyException(sName);
77  maValues[sName] = rSearchAttrib;
78  }
79 }
80 
81 uno::Sequence< beans::PropertyValue > SwSearchProperties_Impl::GetProperties() const
82 {
83  uno::Sequence< beans::PropertyValue > aRet(maValues.size());
84  beans::PropertyValue* pProps = aRet.getArray();
85  sal_Int32 nPropCount = 0;
86  for(auto const & rPair : maValues)
87  {
88  pProps[nPropCount++] = rPair.second;
89  }
90  return aRet;
91 }
92 
93 void SwSearchProperties_Impl::FillItemSet(SfxItemSet& rSet, bool bIsValueSearch) const
94 {
95 
96  std::unique_ptr<SfxPoolItem> pBoxItem,
97  pCharBoxItem,
98  pBreakItem,
99  pAutoKernItem ,
100  pWLineItem ,
101  pTabItem ,
102  pSplitItem ,
103  pRegItem ,
104  pLineSpaceItem ,
105  pLineNumItem ,
106  pKeepItem ,
107  pLRItem ,
108  pULItem ,
109  pBackItem ,
110  pAdjItem ,
111  pDescItem ,
112  pInetItem ,
113  pDropItem ,
114  pWeightItem ,
115  pULineItem ,
116  pOLineItem ,
117  pCharFormatItem ,
118  pShadItem ,
119  pPostItem ,
120  pNHyphItem ,
121  pLangItem ,
122  pKernItem ,
123  pFontSizeItem ,
124  pFontItem ,
125  pBlinkItem ,
126  pEscItem ,
127  pCrossedOutItem ,
128  pContourItem ,
129  pCharColorItem ,
130  pCasemapItem ,
131  pBrushItem ,
132  pFontCJKItem,
133  pFontSizeCJKItem,
134  pCJKLangItem,
135  pCJKPostureItem,
136  pCJKWeightItem,
137  pFontCTLItem,
138  pFontSizeCTLItem,
139  pCTLLangItem,
140  pCTLPostureItem,
141  pCTLWeightItem,
142  pShadowItem ;
143 
144  auto funcClone = [&rSet](sal_uInt16 nWID, std::unique_ptr<SfxPoolItem> & rpPoolItem)
145  {
146  if(!rpPoolItem)
147  rpPoolItem.reset(rSet.GetPool()->GetDefaultItem(nWID).Clone());
148  return rpPoolItem.get();
149  };
150  for(auto const & rPair : maValues)
151  {
152  SfxPoolItem* pTempItem = nullptr;
153  const SfxItemPropertyMapEntry* pPropEntry = mrMap.getByName(rPair.first);
154  assert(pPropEntry && "SetProperties only enters values into maValues if mrMap.hasPropertyByName() wass true");
155  const SfxItemPropertyMapEntry & rPropEntry = *pPropEntry;
156  sal_uInt16 nWID = rPropEntry.nWID;
157  switch(nWID)
158  {
159  case RES_BOX:
160  pTempItem = funcClone(nWID, pBoxItem);
161  break;
162  case RES_CHRATR_BOX:
163  pTempItem = funcClone(nWID, pCharBoxItem);
164  break;
165  case RES_BREAK:
166  pTempItem = funcClone(nWID, pBreakItem);
167  break;
168  case RES_CHRATR_AUTOKERN:
169  pTempItem = funcClone(nWID, pAutoKernItem);
170  break;
172  pTempItem = funcClone(nWID, pBrushItem);
173  break;
174  case RES_CHRATR_CASEMAP:
175  pTempItem = funcClone(nWID, pCasemapItem);
176  break;
177  case RES_CHRATR_COLOR:
178  pTempItem = funcClone(nWID, pCharColorItem);
179  break;
180  case RES_CHRATR_CONTOUR:
181  pTempItem = funcClone(nWID, pContourItem);
182  break;
184  pTempItem = funcClone(nWID, pCrossedOutItem);
185  break;
187  pTempItem = funcClone(nWID, pEscItem);
188  break;
189  case RES_CHRATR_BLINK:
190  pTempItem = funcClone(nWID, pBlinkItem);
191  break;
192  case RES_CHRATR_FONT:
193  pTempItem = funcClone(nWID, pFontItem);
194  break;
195  case RES_CHRATR_FONTSIZE:
196  pTempItem = funcClone(nWID, pFontSizeItem);
197  break;
198  case RES_CHRATR_KERNING:
199  pTempItem = funcClone(nWID, pKernItem);
200  break;
201  case RES_CHRATR_LANGUAGE:
202  pTempItem = funcClone(nWID, pLangItem);
203  break;
204  case RES_CHRATR_NOHYPHEN:
205  pTempItem = funcClone(nWID, pNHyphItem);
206  break;
207  case RES_CHRATR_POSTURE:
208  pTempItem = funcClone(nWID, pPostItem);
209  break;
210  case RES_CHRATR_SHADOWED:
211  pTempItem = funcClone(nWID, pShadItem);
212  break;
213  case RES_TXTATR_CHARFMT:
214  pTempItem = funcClone(nWID, pCharFormatItem);
215  break;
217  pTempItem = funcClone(nWID, pULineItem);
218  break;
219  case RES_CHRATR_OVERLINE:
220  pTempItem = funcClone(nWID, pOLineItem);
221  break;
222  case RES_CHRATR_WEIGHT:
223  pTempItem = funcClone(nWID, pWeightItem);
224  break;
225  case RES_PARATR_DROP:
226  pTempItem = funcClone(nWID, pDropItem);
227  break;
228  case RES_TXTATR_INETFMT:
229  pTempItem = funcClone(nWID, pInetItem);
230  break;
231  case RES_PAGEDESC:
232  pTempItem = funcClone(nWID, pDescItem);
233  break;
234  case RES_PARATR_ADJUST:
235  pTempItem = funcClone(nWID, pAdjItem);
236  break;
237  case RES_BACKGROUND:
238  pTempItem = funcClone(nWID, pBackItem);
239  break;
240  case RES_UL_SPACE:
241  pTempItem = funcClone(nWID, pULItem);
242  break;
243  case RES_LR_SPACE:
244  pTempItem = funcClone(nWID, pLRItem);
245  break;
246  case RES_KEEP:
247  pTempItem = funcClone(nWID, pKeepItem);
248  break;
249  case RES_LINENUMBER:
250  pTempItem = funcClone(nWID, pLineNumItem);
251  break;
253  pTempItem = funcClone(nWID, pLineSpaceItem);
254  break;
255  case RES_PARATR_REGISTER:
256  pTempItem = funcClone(nWID, pRegItem);
257  break;
258  case RES_PARATR_SPLIT:
259  pTempItem = funcClone(nWID, pSplitItem);
260  break;
261  case RES_PARATR_TABSTOP:
262  pTempItem = funcClone(nWID, pTabItem);
263  break;
265  pTempItem = funcClone(nWID, pWLineItem);
266  break;
267  case RES_CHRATR_CJK_FONT:
268  pTempItem = funcClone(nWID, pFontCJKItem);
269  break;
271  pTempItem = funcClone(nWID, pFontSizeCJKItem);
272  break;
274  pTempItem = funcClone(nWID, pCJKLangItem);
275  break;
277  pTempItem = funcClone(nWID, pCJKPostureItem);
278  break;
280  pTempItem = funcClone(nWID, pCJKWeightItem);
281  break;
282  case RES_CHRATR_CTL_FONT:
283  pTempItem = funcClone(nWID, pFontCTLItem);
284  break;
286  pTempItem = funcClone(nWID, pFontSizeCTLItem);
287  break;
289  pTempItem = funcClone(nWID, pCTLLangItem);
290  break;
292  pTempItem = funcClone(nWID, pCTLPostureItem);
293  break;
295  pTempItem = funcClone(nWID, pCTLWeightItem);
296  break;
297  case RES_CHRATR_SHADOW:
298  pTempItem = funcClone(nWID, pShadowItem);
299  break;
300  }
301  if(pTempItem)
302  {
303  if(bIsValueSearch)
304  {
305  pTempItem->PutValue(rPair.second.Value, rPropEntry.nMemberId);
306  rSet.Put(*pTempItem);
307  }
308  else
309  rSet.InvalidateItem( pTempItem->Which() );
310  }
311  }
312 }
313 
315 {
316  return !maValues.empty();
317 }
318 
320  m_pSearchProperties( new SwSearchProperties_Impl),
321  m_pReplaceProperties( new SwSearchProperties_Impl),
322  m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_SEARCH)),
323  m_bAll(false),
324  m_bWord(false),
325  m_bBack(false),
326  m_bExpr(false),
327  m_bCase(false),
328  m_bStyles(false),
329  m_bSimilarity(false),
330  m_bLevRelax(false),
331  m_nLevExchange(2),
332  m_nLevAdd(2),
333  m_nLevRemove(2),
334  m_bIsValueSearch(true)
335 {
336 }
337 
339 {
340  m_pSearchProperties.reset();
341  m_pReplaceProperties.reset();
342 }
343 
344 namespace
345 {
346 }
347 
348 const uno::Sequence< sal_Int8 > & SwXTextSearch::getUnoTunnelId()
349 {
350  static const comphelper::UnoIdInit theSwXTextSearchUnoTunnelId;
351  return theSwXTextSearchUnoTunnelId.getSeq();
352 }
353 
354 sal_Int64 SAL_CALL SwXTextSearch::getSomething( const uno::Sequence< sal_Int8 >& rId )
355 {
356  return comphelper::getSomethingImpl(rId, this);
357 }
358 
360 {
361  SolarMutexGuard aGuard;
362  return m_sSearchText;
363 }
364 
365 void SwXTextSearch::setSearchString(const OUString& rString)
366 {
367  SolarMutexGuard aGuard;
368  m_sSearchText = rString;
369 }
370 
372 {
373  SolarMutexGuard aGuard;
374  return m_sReplaceText;
375 }
376 
377 void SwXTextSearch::setReplaceString(const OUString& rReplaceString)
378 {
379  SolarMutexGuard aGuard;
380  m_sReplaceText = rReplaceString;
381 }
382 
383 uno::Reference< beans::XPropertySetInfo > SwXTextSearch::getPropertySetInfo()
384 {
385  static uno::Reference< beans::XPropertySetInfo > aRef = m_pPropSet->getPropertySetInfo();
386  return aRef;
387 }
388 
389 void SwXTextSearch::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue)
390 {
391  SolarMutexGuard aGuard;
392  const SfxItemPropertyMapEntry* pEntry = m_pPropSet->getPropertyMap().getByName(rPropertyName);
393  if(!pEntry)
394  throw beans::UnknownPropertyException("Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
395 
396  if ( pEntry->nFlags & beans::PropertyAttribute::READONLY)
397  throw beans::PropertyVetoException ("Property is read-only: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
398  bool bVal = false;
399  if(auto b = o3tl::tryAccess<bool>(aValue))
400  bVal = *b;
401  switch(pEntry->nWID)
402  {
403  case WID_SEARCH_ALL : m_bAll = bVal; break;
404  case WID_WORDS: m_bWord = bVal; break;
405  case WID_BACKWARDS : m_bBack = bVal; break;
406  case WID_REGULAR_EXPRESSION : m_bExpr = bVal; break;
407  case WID_CASE_SENSITIVE : m_bCase = bVal; break;
408  //case WID_IN_SELECTION : bInSel = bVal; break;
409  case WID_STYLES : m_bStyles = bVal; break;
410  case WID_SIMILARITY : m_bSimilarity = bVal; break;
411  case WID_SIMILARITY_RELAX: m_bLevRelax = bVal; break;
412  case WID_SIMILARITY_EXCHANGE: aValue >>= m_nLevExchange; break;
413  case WID_SIMILARITY_ADD: aValue >>= m_nLevAdd; break;
414  case WID_SIMILARITY_REMOVE : aValue >>= m_nLevRemove;break;
415  };
416 
417 }
418 
419 uno::Any SwXTextSearch::getPropertyValue(const OUString& rPropertyName)
420 {
421  SolarMutexGuard aGuard;
422  uno::Any aRet;
423 
424  const SfxItemPropertyMapEntry* pEntry = m_pPropSet->getPropertyMap().getByName(rPropertyName);
425  bool bSet = false;
426  if(!pEntry)
427  throw beans::UnknownPropertyException("Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
428 
429  sal_Int16 nSet = 0;
430  switch(pEntry->nWID)
431  {
432  case WID_SEARCH_ALL : bSet = m_bAll; goto SET_BOOL;
433  case WID_WORDS: bSet = m_bWord; goto SET_BOOL;
434  case WID_BACKWARDS : bSet = m_bBack; goto SET_BOOL;
435  case WID_REGULAR_EXPRESSION : bSet = m_bExpr; goto SET_BOOL;
436  case WID_CASE_SENSITIVE : bSet = m_bCase; goto SET_BOOL;
437  //case WID_IN_SELECTION : bSet = bInSel; goto SET_BOOL;
438  case WID_STYLES : bSet = m_bStyles; goto SET_BOOL;
439  case WID_SIMILARITY : bSet = m_bSimilarity; goto SET_BOOL;
440  case WID_SIMILARITY_RELAX: bSet = m_bLevRelax;
441 SET_BOOL:
442  aRet <<= bSet;
443  break;
444  case WID_SIMILARITY_EXCHANGE: nSet = m_nLevExchange; goto SET_UINT16;
445  case WID_SIMILARITY_ADD: nSet = m_nLevAdd; goto SET_UINT16;
446  case WID_SIMILARITY_REMOVE : nSet = m_nLevRemove;
447 SET_UINT16:
448  aRet <<= nSet;
449  break;
450  }
451 
452  return aRet;
453 }
454 
455 void SwXTextSearch::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
456 {
457  OSL_FAIL("not implemented");
458 }
459 
460 void SwXTextSearch::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
461 {
462  OSL_FAIL("not implemented");
463 }
464 
465 void SwXTextSearch::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/)
466 {
467  OSL_FAIL("not implemented");
468 }
469 
470 void SwXTextSearch::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/)
471 {
472  OSL_FAIL("not implemented");
473 }
474 
476 {
477  SolarMutexGuard aGuard;
478  return m_bIsValueSearch;
479 }
480 
482 {
483  SolarMutexGuard aGuard;
484  m_bIsValueSearch = ValueSearch_;
485 }
486 
487 uno::Sequence< beans::PropertyValue > SwXTextSearch::getSearchAttributes()
488 {
489  return m_pSearchProperties->GetProperties();
490 }
491 
492 void SwXTextSearch::setSearchAttributes(const uno::Sequence< beans::PropertyValue >& rSearchAttribs)
493 {
494  m_pSearchProperties->SetProperties(rSearchAttribs);
495 }
496 
497 uno::Sequence< beans::PropertyValue > SwXTextSearch::getReplaceAttributes()
498 {
499  return m_pReplaceProperties->GetProperties();
500 }
501 
502 void SwXTextSearch::setReplaceAttributes(const uno::Sequence< beans::PropertyValue >& rReplaceAttribs)
503 {
504  m_pReplaceProperties->SetProperties(rReplaceAttribs);
505 }
506 
508 {
509  m_pSearchProperties->FillItemSet(rSet, m_bIsValueSearch);
510 }
511 
513 {
514  m_pReplaceProperties->FillItemSet(rSet, m_bIsValueSearch);
515 }
516 
518 {
519  return m_pSearchProperties->HasAttributes();
520 }
521 
523 {
524  return m_pReplaceProperties->HasAttributes();
525 }
526 
528 {
529  return "SwXTextSearch";
530 }
531 
532 sal_Bool SwXTextSearch::supportsService(const OUString& rServiceName)
533 {
534  return cppu::supportsService(this, rServiceName);
535 }
536 
537 uno::Sequence< OUString > SwXTextSearch::getSupportedServiceNames()
538 {
539  return { "com.sun.star.util.SearchDescriptor", "com.sun.star.util.ReplaceDescriptor" };
540 }
541 
543 {
544  if( m_bSimilarity )
545  {
546  rSearchOpt.algorithmType = util::SearchAlgorithms_APPROXIMATE;
547  rSearchOpt.AlgorithmType2 = util::SearchAlgorithms2::APPROXIMATE;
548  rSearchOpt.changedChars = m_nLevExchange;
549  rSearchOpt.deletedChars = m_nLevRemove;
550  rSearchOpt.insertedChars = m_nLevAdd;
551  if( m_bLevRelax )
552  rSearchOpt.searchFlag |= util::SearchFlags::LEV_RELAXED;
553  }
554  else if( m_bExpr )
555  {
556  rSearchOpt.algorithmType = util::SearchAlgorithms_REGEXP;
557  rSearchOpt.AlgorithmType2 = util::SearchAlgorithms2::REGEXP;
558  }
559  else
560  {
561  rSearchOpt.algorithmType = util::SearchAlgorithms_ABSOLUTE;
562  rSearchOpt.AlgorithmType2 = util::SearchAlgorithms2::ABSOLUTE;
563  }
564 
565  rSearchOpt.Locale = GetAppLanguageTag().getLocale();
566  rSearchOpt.searchString = m_sSearchText;
567  rSearchOpt.replaceString = m_sReplaceText;
568 
569  if( !m_bCase )
570  rSearchOpt.transliterateFlags |= TransliterationFlags::IGNORE_CASE;
571  if( m_bWord )
572  rSearchOpt.searchFlag |= util::SearchFlags::NORM_WORD_ONLY;
573 
574 // bInSel: 1; // How is that possible?
575 // TODO: pSearch->bStyles!
576 // inSelection??
577 // aSrchParam.SetSrchInSelection(TypeConversion::toBOOL(aVal));
578 }
579 
580 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
Definition: unosrch.cxx:354
constexpr TypedWhichId< SvxBlinkItem > RES_CHRATR_BLINK(18)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(93)
constexpr TypedWhichId< SvxCrossedOutItem > RES_CHRATR_CROSSEDOUT(5)
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unosrch.cxx:537
constexpr TypedWhichId< SvxEscapementItem > RES_CHRATR_ESCAPEMENT(6)
bool HasReplaceAttributes() const
Definition: unosrch.cxx:522
#define WID_STYLES
Definition: unomap.hxx:136
#define PROPERTY_MAP_TEXT_CURSOR
Definition: unomap.hxx:27
bool HasSearchAttributes() const
Definition: unosrch.cxx:517
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
constexpr TypedWhichId< SvxFormatKeepItem > RES_KEEP(110)
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unosrch.cxx:460
SfxItemPropertyMap mrMap
Definition: unosrch.cxx:44
#define WID_SIMILARITY_RELAX
Definition: unomap.hxx:138
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
sal_Int16 m_nLevRemove
Definition: unosrch.hxx:63
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
virtual void SAL_CALL setSearchString(const OUString &aString) override
Definition: unosrch.cxx:365
void FillSearchOptions(i18nutil::SearchOptions2 &rSearchOpt) const
Definition: unosrch.cxx:542
constexpr TypedWhichId< SwRegisterItem > RES_PARATR_REGISTER(71)
OUString m_sSearchText
Definition: unosrch.hxx:46
virtual ~SwXTextSearch() override
Definition: unosrch.cxx:338
void InvalidateItem(sal_uInt16 nWhich)
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(94)
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
constexpr TypedWhichId< SvxAutoKernItem > RES_CHRATR_AUTOKERN(17)
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getReplaceAttributes() override
Definition: unosrch.cxx:497
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosrch.cxx:465
constexpr TypedWhichId< SvxBoxItem > RES_CHRATR_BOX(40)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CJK_POSTURE(25)
#define WID_CASE_SENSITIVE
Definition: unomap.hxx:134
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
std::unique_ptr< SwSearchProperties_Impl > m_pSearchProperties
Definition: unosrch.hxx:49
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
bool m_bWord
Definition: unosrch.hxx:54
const SfxItemPropertyMapEntry * getByName(std::u16string_view rName) const
bool hasPropertyByName(std::u16string_view rName) const
constexpr TypedWhichId< SvxCaseMapItem > RES_CHRATR_CASEMAP(RES_CHRATR_BEGIN)
bool m_bExpr
Definition: unosrch.hxx:56
constexpr TypedWhichId< SvxShadowItem > RES_CHRATR_SHADOW(41)
OUString m_sReplaceText
Definition: unosrch.hxx:47
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
constexpr TypedWhichId< SwFormatDrop > RES_PARATR_DROP(70)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
virtual void SAL_CALL setValueSearch(sal_Bool ValueSearch_) override
Definition: unosrch.cxx:481
constexpr TypedWhichId< SwFormatCharFormat > RES_TXTATR_CHARFMT(52)
const SfxItemPropertySet * m_pPropSet
Definition: unosrch.hxx:52
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unosrch.cxx:389
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
const char * sName
#define WID_BACKWARDS
Definition: unomap.hxx:132
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
css::lang::Locale Locale
const css::uno::Sequence< sal_Int8 > & getSeq() const
#define WID_SEARCH_ALL
Definition: unomap.hxx:142
#define WID_SIMILARITY_REMOVE
Definition: unomap.hxx:141
#define WID_SIMILARITY_EXCHANGE
Definition: unomap.hxx:139
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unosrch.cxx:383
bool m_bCase
Definition: unosrch.hxx:57
#define WID_WORDS
Definition: unomap.hxx:131
std::unique_ptr< SwSearchProperties_Impl > m_pReplaceProperties
Definition: unosrch.hxx:50
virtual OUString SAL_CALL getReplaceString() override
Definition: unosrch.cxx:371
TransliterationFlags transliterateFlags
constexpr TypedWhichId< SvxShadowedItem > RES_CHRATR_SHADOWED(13)
unsigned char sal_Bool
const SfxItemPropertyMap & getPropertyMap() const
constexpr TypedWhichId< SvxLineSpacingItem > RES_PARATR_LINESPACING(RES_PARATR_BEGIN)
bool m_bBack
Definition: unosrch.hxx:55
constexpr TypedWhichId< SvxOverlineItem > RES_CHRATR_OVERLINE(38)
virtual OUString SAL_CALL getImplementationName() override
Definition: unosrch.cxx:527
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
SfxItemPool * GetPool() const
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unosrch.cxx:532
css::util::SearchAlgorithms algorithmType
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getSearchAttributes() override
Definition: unosrch.cxx:487
bool HasAttributes() const
Definition: unosrch.cxx:314
const LanguageTag & GetAppLanguageTag()
Definition: init.cxx:730
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
SwSearchProperties_Impl & operator=(const SwSearchProperties_Impl &)=delete
sal_Int16 m_nLevAdd
Definition: unosrch.hxx:62
void FillReplaceItemSet(SfxItemSet &rSet) const
Definition: unosrch.cxx:512
std::unordered_map< OUString, beans::PropertyValue > maValues
Definition: unosrch.cxx:43
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unosrch.cxx:455
sal_Int16 m_nLevExchange
Definition: unosrch.hxx:61
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
#define WID_REGULAR_EXPRESSION
Definition: unomap.hxx:133
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unosrch.cxx:419
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CJK_WEIGHT(26)
constexpr TypedWhichId< SvxFormatSplitItem > RES_PARATR_SPLIT(65)
#define PROPERTY_MAP_TEXT_SEARCH
Definition: unomap.hxx:37
constexpr TypedWhichId< SvxWordLineModeItem > RES_CHRATR_WORDLINEMODE(16)
sal_Int64 getSomethingImpl(const css::uno::Sequence< sal_Int8 > &rId, T *pThis, FallbackToGetSomethingOf< Base >={})
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CTL_WEIGHT(31)
virtual OUString SAL_CALL getSearchString() override
Definition: unosrch.cxx:359
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CTL_POSTURE(30)
void SetProperties(const uno::Sequence< beans::PropertyValue > &aSearchAttribs)
Definition: unosrch.cxx:67
virtual sal_Bool SAL_CALL getValueSearch() override
Definition: unosrch.cxx:475
SwUnoPropertyMapProvider aSwMapProvider
Definition: unomap1.cxx:87
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unosrch.cxx:470
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
virtual void SAL_CALL setReplaceString(const OUString &aReplaceString) override
Definition: unosrch.cxx:377
virtual void SAL_CALL setReplaceAttributes(const css::uno::Sequence< css::beans::PropertyValue > &aSearchAttribs) override
Definition: unosrch.cxx:502
#define WID_SIMILARITY
Definition: unomap.hxx:137
constexpr TypedWhichId< SwFormatLineNumber > RES_LINENUMBER(116)
detail::Optional< bool >::type tryAccess< bool >(css::uno::Any const &any)
constexpr TypedWhichId< SvxNoHyphenItem > RES_CHRATR_NOHYPHEN(19)
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unosrch.cxx:348
void FillItemSet(SfxItemSet &rSet, bool bIsValueSearch) const
Definition: unosrch.cxx:93
void FillSearchItemSet(SfxItemSet &rSet) const
Definition: unosrch.cxx:507
bool m_bStyles
Definition: unosrch.hxx:58
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
bool m_bIsValueSearch
Definition: unosrch.hxx:65
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr TypedWhichId< SvxKerningItem > RES_CHRATR_KERNING(9)
#define WID_SIMILARITY_ADD
Definition: unomap.hxx:140
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
sal_uInt16 Which() const
constexpr TypedWhichId< SvxAdjustItem > RES_PARATR_ADJUST(64)
bool m_bSimilarity
Definition: unosrch.hxx:59
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
uno::Sequence< beans::PropertyValue > GetProperties() const
Definition: unosrch.cxx:81
virtual void SAL_CALL setSearchAttributes(const css::uno::Sequence< css::beans::PropertyValue > &aSearchAttribs) override
Definition: unosrch.cxx:492
bool m_bLevRelax
Definition: unosrch.hxx:60
constexpr TypedWhichId< SvxContourItem > RES_CHRATR_CONTOUR(4)