25#include <osl/diagnose.h>
30#include <com/sun/star/util/SearchAlgorithms2.hpp>
31#include <com/sun/star/util/SearchFlags.hpp>
32#include <com/sun/star/beans/PropertyAttribute.hpp>
38#include <unordered_map>
44 std::unordered_map<OUString, beans::PropertyValue>
maValues;
56 void SetProperties(
const uno::Sequence< beans::PropertyValue >& aSearchAttribs);
73 for(
const beans::PropertyValue& rSearchAttrib : aSearchAttribs)
75 const OUString&
sName = rSearchAttrib.Name;
77 throw beans::UnknownPropertyException(
sName);
84 uno::Sequence< beans::PropertyValue > aRet(
maValues.size());
85 beans::PropertyValue* pProps = aRet.getArray();
86 sal_Int32 nPropCount = 0;
89 pProps[nPropCount++] = rPair.second;
97 std::unique_ptr<SfxPoolItem> pBoxItem,
154 auto funcClone = [&
rSet](sal_uInt16 nWID, std::unique_ptr<SfxPoolItem> & rpPoolItem)
158 return rpPoolItem.get();
164 assert(pPropEntry &&
"SetProperties only enters values into maValues if mrMap.hasPropertyByName() was true");
166 sal_uInt16 nWID = rPropEntry.
nWID;
170 pTempItem = funcClone(nWID, pBoxItem);
173 pTempItem = funcClone(nWID, pCharBoxItem);
176 pTempItem = funcClone(nWID, pBreakItem);
179 pTempItem = funcClone(nWID, pAutoKernItem);
182 pTempItem = funcClone(nWID, pBrushItem);
185 pTempItem = funcClone(nWID, pCasemapItem);
188 pTempItem = funcClone(nWID, pCharColorItem);
191 pTempItem = funcClone(nWID, pContourItem);
194 pTempItem = funcClone(nWID, pCrossedOutItem);
197 pTempItem = funcClone(nWID, pEscItem);
200 pTempItem = funcClone(nWID, pBlinkItem);
203 pTempItem = funcClone(nWID, pFontItem);
206 pTempItem = funcClone(nWID, pFontSizeItem);
209 pTempItem = funcClone(nWID, pKernItem);
212 pTempItem = funcClone(nWID, pLangItem);
215 pTempItem = funcClone(nWID, pNHyphItem);
218 pTempItem = funcClone(nWID, pPostItem);
221 pTempItem = funcClone(nWID, pShadItem);
224 pTempItem = funcClone(nWID, pCharFormatItem);
227 pTempItem = funcClone(nWID, pULineItem);
230 pTempItem = funcClone(nWID, pOLineItem);
233 pTempItem = funcClone(nWID, pWeightItem);
236 pTempItem = funcClone(nWID, pDropItem);
239 pTempItem = funcClone(nWID, pInetItem);
242 pTempItem = funcClone(nWID, pDescItem);
245 pTempItem = funcClone(nWID, pAdjItem);
248 pTempItem = funcClone(nWID, pBackItem);
251 pTempItem = funcClone(nWID, pULItem);
254 pTempItem = funcClone(nWID, pFirstLineIndent);
257 pTempItem = funcClone(nWID, pTextLeftMargin);
260 pTempItem = funcClone(nWID, pRightMargin);
263 pTempItem = funcClone(nWID, pLRItem);
266 pTempItem = funcClone(nWID, pKeepItem);
269 pTempItem = funcClone(nWID, pLineNumItem);
272 pTempItem = funcClone(nWID, pLineSpaceItem);
275 pTempItem = funcClone(nWID, pRegItem);
278 pTempItem = funcClone(nWID, pSplitItem);
281 pTempItem = funcClone(nWID, pTabItem);
284 pTempItem = funcClone(nWID, pWLineItem);
287 pTempItem = funcClone(nWID, pFontCJKItem);
290 pTempItem = funcClone(nWID, pFontSizeCJKItem);
293 pTempItem = funcClone(nWID, pCJKLangItem);
296 pTempItem = funcClone(nWID, pCJKPostureItem);
299 pTempItem = funcClone(nWID, pCJKWeightItem);
302 pTempItem = funcClone(nWID, pFontCTLItem);
305 pTempItem = funcClone(nWID, pFontSizeCTLItem);
308 pTempItem = funcClone(nWID, pCTLLangItem);
311 pTempItem = funcClone(nWID, pCTLPostureItem);
314 pTempItem = funcClone(nWID, pCTLWeightItem);
317 pTempItem = funcClone(nWID, pShadowItem);
320 pTempItem = funcClone(nWID, pCharReliefItem);
323 pTempItem = funcClone(nWID, pCharRotate);
326 pTempItem = funcClone(nWID, pCharScaleWidth);
329 pTempItem = funcClone(nWID, pParaVertAlign);
332 pTempItem = funcClone(nWID, pParaOrphans);
335 pTempItem = funcClone(nWID, pParaWidows);
366 m_bSimilarity(false),
371 m_bIsValueSearch(true)
420 throw beans::UnknownPropertyException(
"Unknown property: " + rPropertyName,
static_cast < cppu::OWeakObject *
> (
this ) );
422 if ( pEntry->
nFlags & beans::PropertyAttribute::READONLY)
423 throw beans::PropertyVetoException (
"Property is read-only: " + rPropertyName,
static_cast < cppu::OWeakObject *
> (
this ) );
453 throw beans::UnknownPropertyException(
"Unknown property: " + rPropertyName,
static_cast < cppu::OWeakObject *
> (
this ) );
483 OSL_FAIL(
"not implemented");
488 OSL_FAIL(
"not implemented");
493 OSL_FAIL(
"not implemented");
498 OSL_FAIL(
"not implemented");
555 return "SwXTextSearch";
565 return {
"com.sun.star.util.SearchDescriptor",
"com.sun.star.util.ReplaceDescriptor" };
577 rSearchOpt.
searchFlag |= util::SearchFlags::LEV_RELAXED;
595 rSearchOpt.
searchFlag |= util::SearchFlags::NORM_WORD_ONLY;
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
const SfxItemPropertyMapEntry * getByName(std::u16string_view rName) const
bool hasPropertyByName(std::u16string_view rName) const
const SfxItemPropertyMap & getPropertyMap() const
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
SfxItemPool * GetPool() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void InvalidateItem(sal_uInt16 nWhich)
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
void SetProperties(const uno::Sequence< beans::PropertyValue > &aSearchAttribs)
void FillItemSet(SfxItemSet &rSet, bool bIsValueSearch) const
uno::Sequence< beans::PropertyValue > GetProperties() const
SwSearchProperties_Impl()
SwSearchProperties_Impl & operator=(const SwSearchProperties_Impl &)=delete
std::unordered_map< OUString, beans::PropertyValue > maValues
SwSearchProperties_Impl(const SwSearchProperties_Impl &)=delete
bool HasAttributes() const
void FillSearchItemSet(SfxItemSet &rSet) const
void FillSearchOptions(i18nutil::SearchOptions2 &rSearchOpt) const
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual OUString SAL_CALL getSearchString() override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
void FillReplaceItemSet(SfxItemSet &rSet) const
virtual ~SwXTextSearch() override
bool HasReplaceAttributes() const
virtual sal_Bool SAL_CALL getValueSearch() override
virtual void SAL_CALL setValueSearch(sal_Bool ValueSearch_) override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
bool HasSearchAttributes() const
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getSearchAttributes() override
std::unique_ptr< SwSearchProperties_Impl > m_pSearchProperties
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual void SAL_CALL setSearchAttributes(const css::uno::Sequence< css::beans::PropertyValue > &aSearchAttribs) override
virtual OUString SAL_CALL getReplaceString() override
std::unique_ptr< SwSearchProperties_Impl > m_pReplaceProperties
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getReplaceAttributes() override
const SfxItemPropertySet * m_pPropSet
virtual void SAL_CALL setSearchString(const OUString &aString) override
virtual void SAL_CALL setReplaceString(const OUString &aReplaceString) override
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual void SAL_CALL setReplaceAttributes(const css::uno::Sequence< css::beans::PropertyValue > &aSearchAttribs) override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
constexpr TypedWhichId< SvxCrossedOutItem > RES_CHRATR_CROSSEDOUT(5)
constexpr TypedWhichId< SvxFormatKeepItem > RES_KEEP(116)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
constexpr TypedWhichId< SvxAutoKernItem > RES_CHRATR_AUTOKERN(17)
constexpr TypedWhichId< SvxShadowItem > RES_CHRATR_SHADOW(41)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr TypedWhichId< SvxFirstLineIndentItem > RES_MARGIN_FIRSTLINE(91)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
constexpr TypedWhichId< SvxShadowedItem > RES_CHRATR_SHADOWED(13)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(99)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CTL_WEIGHT(31)
constexpr TypedWhichId< SvxAdjustItem > RES_PARATR_ADJUST(64)
constexpr TypedWhichId< SvxContourItem > RES_CHRATR_CONTOUR(4)
constexpr TypedWhichId< SvxCharReliefItem > RES_CHRATR_RELIEF(36)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
constexpr TypedWhichId< SvxEscapementItem > RES_CHRATR_ESCAPEMENT(6)
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
constexpr TypedWhichId< SvxCharScaleWidthItem > RES_CHRATR_SCALEW(35)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
constexpr TypedWhichId< SvxCaseMapItem > RES_CHRATR_CASEMAP(RES_CHRATR_BEGIN)
constexpr TypedWhichId< SvxLineSpacingItem > RES_PARATR_LINESPACING(RES_PARATR_BEGIN)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CTL_POSTURE(30)
constexpr TypedWhichId< SvxOrphansItem > RES_PARATR_ORPHANS(66)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
constexpr TypedWhichId< SwFormatLineNumber > RES_LINENUMBER(122)
constexpr TypedWhichId< SwFormatCharFormat > RES_TXTATR_CHARFMT(52)
constexpr TypedWhichId< SvxBlinkItem > RES_CHRATR_BLINK(18)
constexpr TypedWhichId< SvxOverlineItem > RES_CHRATR_OVERLINE(38)
constexpr TypedWhichId< SvxParaVertAlignItem > RES_PARATR_VERTALIGN(76)
constexpr TypedWhichId< SvxWidowsItem > RES_PARATR_WIDOWS(67)
constexpr TypedWhichId< SvxCharRotateItem > RES_CHRATR_ROTATE(32)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(112)
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(100)
constexpr TypedWhichId< SwFormatDrop > RES_PARATR_DROP(70)
constexpr TypedWhichId< SvxRightMarginItem > RES_MARGIN_RIGHT(93)
constexpr TypedWhichId< SvxTextLeftMarginItem > RES_MARGIN_TEXTLEFT(92)
constexpr TypedWhichId< SvxWordLineModeItem > RES_CHRATR_WORDLINEMODE(16)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CJK_WEIGHT(26)
constexpr TypedWhichId< SvxKerningItem > RES_CHRATR_KERNING(9)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
constexpr TypedWhichId< SvxFormatSplitItem > RES_PARATR_SPLIT(65)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CJK_POSTURE(25)
constexpr TypedWhichId< SwRegisterItem > RES_PARATR_REGISTER(71)
constexpr TypedWhichId< SvxBoxItem > RES_CHRATR_BOX(40)
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
constexpr TypedWhichId< SvxNoHyphenItem > RES_CHRATR_NOHYPHEN(19)
const LanguageTag & GetAppLanguageTag()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
detail::Optional< bool >::type tryAccess< bool >(css::uno::Any const &any)
TransliterationFlags transliterateFlags
SwUnoPropertyMapProvider aSwMapProvider
#define PROPERTY_MAP_TEXT_CURSOR
#define WID_REGULAR_EXPRESSION
#define WID_SIMILARITY_REMOVE
#define WID_SIMILARITY_RELAX
#define PROPERTY_MAP_TEXT_SEARCH
#define WID_SIMILARITY_ADD
#define WID_SIMILARITY_EXCHANGE
#define WID_CASE_SENSITIVE