diff options
author | Eike Rathke <erack@redhat.com> | 2016-02-24 22:37:57 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-02-24 22:42:05 +0100 |
commit | 21edff2a37c9c22d200df2638e31f7ff3afe85b6 (patch) | |
tree | 8b3ded0d95c55ddf739e4baf71d5726fa79d80ab /include/svl | |
parent | eb3e47dbf798103d09bb8f3461959726e917a75f (diff) |
let SvxSearchItem use SearchOptions2
And all those places that interface to SvxSearchItem.
Change-Id: I08915824a596cd0f247a89f44e4684cd22b98082
Diffstat (limited to 'include/svl')
-rw-r--r-- | include/svl/memberid.hrc | 7 | ||||
-rw-r--r-- | include/svl/srchitem.hxx | 21 |
2 files changed, 19 insertions, 9 deletions
diff --git a/include/svl/memberid.hrc b/include/svl/memberid.hrc index f3fdd5334667..b5a2262958e5 100644 --- a/include/svl/memberid.hrc +++ b/include/svl/memberid.hrc @@ -35,9 +35,9 @@ // SvxSearchItem // XXX When changing the MID count here, also increment the corresponding -// SvxSearchItem SFX_DECL_TYPE(n) value to match, and add a member to -// struct SvxSearch in sfx2/sdi/sfxitems.sdi so that dependent slot items get -// generated. +// SvxSearchItem SFX_DECL_TYPE(n) value in include/sfx2/msg.hxx to match, and +// add a member to struct SvxSearch in sfx2/sdi/sfxitems.sdi so that dependent +// slot items get generated. #define MID_SEARCH_STYLEFAMILY 1 #define MID_SEARCH_CELLTYPE 2 #define MID_SEARCH_ROWDIRECTION 3 @@ -60,6 +60,7 @@ #define MID_SEARCH_STARTPOINTX 20 #define MID_SEARCH_STARTPOINTY 21 #define MID_SEARCH_SEARCHFORMATTED 22 +#define MID_SEARCH_ALGORITHMTYPE2 23 #endif diff --git a/include/svl/srchitem.hxx b/include/svl/srchitem.hxx index a2f3d79bfda6..dd7afac19f2b 100644 --- a/include/svl/srchitem.hxx +++ b/include/svl/srchitem.hxx @@ -22,7 +22,8 @@ #include <sal/config.h> #include <svl/svldllapi.h> #include <com/sun/star/util/XSearchDescriptor.hpp> -#include <com/sun/star/util/SearchOptions.hpp> +#include <com/sun/star/util/SearchOptions2.hpp> +#include <com/sun/star/util/SearchAlgorithms2.hpp> #include <com/sun/star/util/SearchFlags.hpp> #include <com/sun/star/i18n/TransliterationModules.hpp> #include <unotools/configitem.hxx> @@ -63,7 +64,7 @@ class SVL_DLLPUBLIC SvxSearchItem : public SfxPoolItem, public utl::ConfigItem { - css::util::SearchOptions m_aSearchOpt; + css::util::SearchOptions2 m_aSearchOpt; SfxStyleFamily m_eFamily; // style family @@ -177,9 +178,9 @@ public: inline sal_uInt16 GetLEVLonger() const; inline void SetLEVLonger(sal_uInt16 nSet); - inline const css::util::SearchOptions & + inline const css::util::SearchOptions2 & GetSearchOptions() const; - inline void SetSearchOptions( const css::util::SearchOptions &rOpt ); + inline void SetSearchOptions( const css::util::SearchOptions2 &rOpt ); inline sal_Int32 GetTransliterationFlags() const; void SetTransliterationFlags( sal_Int32 nFlags ); @@ -234,6 +235,10 @@ bool SvxSearchItem::GetSelection() const bool SvxSearchItem::GetRegExp() const { + // Ensure old and new algorithm types are in sync until all places are + // adapted to use only new types. + assert( (m_aSearchOpt.algorithmType == css::util::SearchAlgorithms_REGEXP) == + (m_aSearchOpt.AlgorithmType2 == css::util::SearchAlgorithms2::REGEXP)); return m_aSearchOpt.algorithmType == css::util::SearchAlgorithms_REGEXP ; } @@ -274,15 +279,19 @@ void SvxSearchItem::SetLEVLonger( sal_uInt16 nVal ) bool SvxSearchItem::IsLevenshtein() const { + // Ensure old and new algorithm types are in sync until all places are + // adapted to use only new types. + assert( (m_aSearchOpt.algorithmType == css::util::SearchAlgorithms_APPROXIMATE) == + (m_aSearchOpt.AlgorithmType2 == css::util::SearchAlgorithms2::APPROXIMATE)); return m_aSearchOpt.algorithmType == css::util::SearchAlgorithms_APPROXIMATE; } -const css::util::SearchOptions & SvxSearchItem::GetSearchOptions() const +const css::util::SearchOptions2 & SvxSearchItem::GetSearchOptions() const { return m_aSearchOpt; } -void SvxSearchItem::SetSearchOptions( const css::util::SearchOptions &rOpt ) +void SvxSearchItem::SetSearchOptions( const css::util::SearchOptions2 &rOpt ) { m_aSearchOpt = rOpt; } |