summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-23 16:15:18 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-03-01 07:28:03 +0000
commit4c09fc48e9fa9114f32f2973090cbe75177cdd37 (patch)
tree09d4ee3c2d75d038f45ba13a086a344d35aeadb6 /sw
parentd97380c66904328e9d706a0b03a6800dc048aa7d (diff)
typesafe wrappers for css::i18nutil::TransliterationModules
and related css::util::SearchOptions2 The TransliterationModules enum has it's constants spread over multiple UNO enum/constant-collections - TransliterationModules and TransliterationModulesExtra, which means that most code simply uses sal_Int32. Wrap them up into a better bundle so that only the lowest layer needs to deal directly with the UNO constants. Change-Id: I1edeab79fcc7817a4a97c933ef84ab7015bb849b Reviewed-on: https://gerrit.libreoffice.org/34582 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/PostItMgr.hxx6
-rw-r--r--sw/inc/crsrsh.hxx12
-rw-r--r--sw/inc/editsh.hxx9
-rw-r--r--sw/inc/pam.hxx10
-rw-r--r--sw/inc/swcrsr.hxx9
-rw-r--r--sw/inc/unosrch.hxx7
-rw-r--r--sw/qa/core/macros-test.cxx6
-rw-r--r--sw/qa/core/uwriter.cxx17
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx12
-rw-r--r--sw/source/core/bastyp/init.cxx6
-rw-r--r--sw/source/core/crsr/crsrsh.cxx5
-rw-r--r--sw/source/core/crsr/findattr.cxx10
-rw-r--r--sw/source/core/crsr/findtxt.cxx13
-rw-r--r--sw/source/core/edit/editsh.cxx2
-rw-r--r--sw/source/core/edit/edtox.cxx13
-rw-r--r--sw/source/core/inc/UndoOverwrite.hxx4
-rw-r--r--sw/source/core/txtnode/txtedt.cxx7
-rw-r--r--sw/source/core/unocore/unosrch.cxx7
-rw-r--r--sw/source/ui/index/swuiidxmrk.cxx9
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx4
-rw-r--r--sw/source/uibase/inc/wrtsh.hxx8
-rw-r--r--sw/source/uibase/shells/annotsh.cxx25
-rw-r--r--sw/source/uibase/shells/drwtxtsh.cxx25
-rw-r--r--sw/source/uibase/shells/textsh.cxx24
-rw-r--r--sw/source/uibase/uiview/srcview.cxx4
-rw-r--r--sw/source/uibase/uiview/view2.cxx7
-rw-r--r--sw/source/uibase/uiview/viewsrch.cxx5
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx6
-rw-r--r--sw/source/uibase/wrtsh/select.cxx4
29 files changed, 129 insertions, 147 deletions
diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx
index bf657c01926a..38c24ba78bf2 100644
--- a/sw/inc/PostItMgr.hxx
+++ b/sw/inc/PostItMgr.hxx
@@ -29,7 +29,6 @@
#include <swrect.hxx>
#include <unotools/configitem.hxx>
#include <unotools/options.hxx>
-#include <com/sun/star/util/SearchOptions2.hpp>
#include <com/sun/star/uno/Any.hxx>
#include <SidebarWindowsTypes.hxx>
#include <svl/lstner.hxx>
@@ -63,6 +62,7 @@ class SwFrame;
namespace vcl { class Window; }
struct ImplSVEvent;
class OutlinerSearchable;
+namespace i18nutil { struct SearchOptions2; }
#define COL_NOTES_SIDEPANE_ARROW_ENABLED RGB_COLORDATA(0,0,0)
#define COL_NOTES_SIDEPANE_ARROW_DISABLED RGB_COLORDATA(172,168,153)
@@ -273,8 +273,8 @@ class SwPostItMgr: public SfxListener
void CheckMetaText();
sal_uInt16 Replace(SvxSearchItem* pItem);
- sal_uInt16 SearchReplace(const SwFormatField &pField, const css::util::SearchOptions2& rSearchOptions,bool bSrchForward);
- sal_uInt16 FinishSearchReplace(const css::util::SearchOptions2& rSearchOptions,bool bSrchForward);
+ sal_uInt16 SearchReplace(const SwFormatField &pField, const i18nutil::SearchOptions2& rSearchOptions,bool bSrchForward);
+ sal_uInt16 FinishSearchReplace(const i18nutil::SearchOptions2& rSearchOptions,bool bSrchForward);
void AssureStdModeAtShell();
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index bcb9eb4a7357..2b03f7bbb734 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -67,14 +67,12 @@ class SwPostItField;
class SwTextField;
struct SwPosition;
-namespace com { namespace sun { namespace star { namespace util {
+namespace i18nutil {
struct SearchOptions2;
-} } } }
-
+}
namespace com { namespace sun { namespace star { namespace text {
class XTextRange;
}}}}
-
namespace com { namespace sun { namespace star { namespace container {
class XStringKeyMap;
}}}}
@@ -140,7 +138,7 @@ const int CRSR_POSOLD = 0x01, // cursor stays at old position
CRSR_POSCHG = 0x02; // position changed by the layout
/// Helperfunction to resolve backward references in regular expressions
-OUString *ReplaceBackReferences( const css::util::SearchOptions2& rSearchOpt, SwPaM* pPam );
+OUString *ReplaceBackReferences( const i18nutil::SearchOptions2& rSearchOpt, SwPaM* pPam );
class SW_DLLPUBLIC SwCursorShell
: public SwViewShell
@@ -364,7 +362,7 @@ public:
bool MoveColumn( SwWhichColumn, SwPosColumn );
bool MoveRegion( SwWhichRegion, SwMoveFnCollection const & );
- sal_uLong Find( const css::util::SearchOptions2& rSearchOpt,
+ sal_uLong Find( const i18nutil::SearchOptions2& rSearchOpt,
bool bSearchInNotes,
SwDocPositions eStart, SwDocPositions eEnd,
bool& bCancel,
@@ -379,7 +377,7 @@ public:
SwDocPositions eStart, SwDocPositions eEnd,
bool& bCancel,
FindRanges eRng,
- const css::util::SearchOptions2* pSearchOpt,
+ const i18nutil::SearchOptions2* pSearchOpt,
const SfxItemSet* rReplSet );
// Position the Cursor
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index beb75f833aef..be04c6a52033 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -102,18 +102,19 @@ struct SwConversionArgs;
enum class SvtScriptType;
enum class SfxClassificationPolicyType;
enum class RedlineFlags;
+enum class TransliterationFlags;
namespace com { namespace sun { namespace star { namespace uno {
template < class > class Sequence;
}}}}
namespace svx{
-struct SpellPortion;
-typedef std::vector<SpellPortion> SpellPortions;
+ struct SpellPortion;
+ typedef std::vector<SpellPortion> SpellPortions;
}
namespace sfx2{
-class LinkManager;
+ class LinkManager;
}
namespace sw {
@@ -188,7 +189,7 @@ public:
bool DelFullPara();
/// Change text to Upper/Lower/Hiragana/Katagana/...
- void TransliterateText( sal_uInt32 nType );
+ void TransliterateText( TransliterationFlags nType );
/// Count words in current selection.
void CountWords( SwDocStat& rStat ) const;
diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx
index 771e753d7b34..ca69c7a104f3 100644
--- a/sw/inc/pam.hxx
+++ b/sw/inc/pam.hxx
@@ -38,11 +38,9 @@ class SwNode;
class SwContentNode;
class SwPaM;
class Point;
-
-namespace com { namespace sun { namespace star { namespace util {
+namespace i18nutil {
struct SearchOptions2;
-} } } }
-
+}
namespace utl {
class TextSearch;
}
@@ -187,7 +185,7 @@ public:
SwGoInDoc fnGo = GoInContent );
/// Search.
- bool Find( const css::util::SearchOptions2& rSearchOpt,
+ bool Find( const i18nutil::SearchOptions2& rSearchOpt,
bool bSearchInNotes,
utl::TextSearch& rSText,
SwMoveFnCollection const & fnMove = fnMoveForward,
@@ -202,7 +200,7 @@ public:
SwMoveFnCollection const & fnMove,
const SwPaM *pPam, bool bInReadOnly, bool bMoveFirst );
- bool DoSearch( const css::util::SearchOptions2& rSearchOpt, utl::TextSearch& rSText,
+ bool DoSearch( const i18nutil::SearchOptions2& rSearchOpt, utl::TextSearch& rSText,
SwMoveFnCollection const & fnMove, bool bSrchForward, bool bRegSearch, bool bChkEmptyPara, bool bChkParaEnd,
sal_Int32 &nStart, sal_Int32 &nEnd, sal_Int32 nTextLen, SwNode* pNode, SwPaM* pPam);
diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx
index 6eeaf657628d..f41c96c5c5c0 100644
--- a/sw/inc/swcrsr.hxx
+++ b/sw/inc/swcrsr.hxx
@@ -26,10 +26,9 @@
#include <cshtyp.hxx>
struct SwCursor_SavePos;
-
-namespace com { namespace sun { namespace star { namespace util {
+namespace i18nutil {
struct SearchOptions2;
-} } } }
+}
// Base structure for parameters of the find-methods.
// Returns values of found-call.
@@ -113,7 +112,7 @@ public:
SwMoveFnCollection const & MakeFindRange( SwDocPositions, SwDocPositions,
SwPaM* ) const;
- sal_uLong Find( const css::util::SearchOptions2& rSearchOpt,
+ sal_uLong Find( const i18nutil::SearchOptions2& rSearchOpt,
bool bSearchInNotes,
SwDocPositions nStart, SwDocPositions nEnde,
bool& bCancel,
@@ -128,7 +127,7 @@ public:
SwDocPositions nStart, SwDocPositions nEnde,
bool& bCancel,
FindRanges = FindRanges::InBody,
- const css::util::SearchOptions2* pSearchOpt = nullptr,
+ const i18nutil::SearchOptions2* pSearchOpt = nullptr,
const SfxItemSet* rReplSet = nullptr );
// UI versions
diff --git a/sw/inc/unosrch.hxx b/sw/inc/unosrch.hxx
index cd19de5657a7..73169cc85bda 100644
--- a/sw/inc/unosrch.hxx
+++ b/sw/inc/unosrch.hxx
@@ -30,9 +30,9 @@ class SwXTextDocument;
class SwSearchProperties_Impl;
class SfxItemSet;
-namespace com{namespace sun{namespace star{namespace util{
+namespace i18nutil {
struct SearchOptions2;
-}}}}
+}
class SwXTextSearch : public cppu::WeakImplHelper
<
@@ -109,8 +109,7 @@ public:
bool HasSearchAttributes() const;
bool HasReplaceAttributes() const;
- void FillSearchOptions( css::util::SearchOptions2&
- rSearchOpt ) const;
+ void FillSearchOptions( i18nutil::SearchOptions2& rSearchOpt ) const;
};
#endif
diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx
index 88e4e1116304..ed2324a62053 100644
--- a/sw/qa/core/macros-test.cxx
+++ b/sw/qa/core/macros-test.cxx
@@ -39,6 +39,7 @@
#include <com/sun/star/awt/XControlModel.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
+#include <i18nutil/searchopt.hxx>
#include <sfx2/app.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/docfile.hxx>
@@ -543,7 +544,7 @@ void SwMacrosTest::testFindReplace()
pPaM->Move(fnMoveBackward, GoInDoc);
bool bCancel(false);
- util::SearchOptions2 opts(
+ i18nutil::SearchOptions2 opts(
util::SearchAlgorithms_REGEXP,
65536,
"$",
@@ -552,7 +553,8 @@ void SwMacrosTest::testFindReplace()
2,
2,
2,
- 1073745152,
+ TransliterationFlags::IGNORE_CASE | TransliterationFlags::IGNORE_WIDTH |
+ TransliterationFlags::IGNORE_KASHIDA_CTL | TransliterationFlags::IGNORE_DIACRITICS_CTL,
util::SearchAlgorithms2::REGEXP,
'\\');
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index 9486e369e9e7..c0c45601fc8a 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -13,10 +13,9 @@
#include <rtl/strbuf.hxx>
#include <osl/file.hxx>
-#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
-
#include <comphelper/processfactory.hxx>
#include <comphelper/random.hxx>
+#include <i18nutil/transliteration.hxx>
#include <tools/urlobj.hxx>
#include <unotools/tempfile.hxx>
#include <unotools/transliterationwrapper.hxx>
@@ -1145,7 +1144,7 @@ void SwDocTest::randomTest()
}
static OUString
-translitTest(SwDoc & rDoc, SwPaM & rPaM, sal_uInt32 const nType)
+translitTest(SwDoc & rDoc, SwPaM & rPaM, TransliterationFlags const nType)
{
utl::TransliterationWrapper aTrans(
::comphelper::getProcessComponentContext(), nType);
@@ -1165,22 +1164,22 @@ void SwDocTest::testTransliterate()
CPPUNIT_ASSERT_EQUAL(OUString("FOOBAR"),
translitTest(*m_pDoc, aPaM,
- i18n::TransliterationModules_LOWERCASE_UPPERCASE));
+ TransliterationFlags::LOWERCASE_UPPERCASE));
CPPUNIT_ASSERT_EQUAL(OUString("Foobar"),
translitTest(*m_pDoc, aPaM,
- i18n::TransliterationModulesExtra::TITLE_CASE));
+ TransliterationFlags::TITLE_CASE));
CPPUNIT_ASSERT_EQUAL(OUString("fOOBAR"),
translitTest(*m_pDoc, aPaM,
- i18n::TransliterationModulesExtra::TOGGLE_CASE));
+ TransliterationFlags::TOGGLE_CASE));
CPPUNIT_ASSERT_EQUAL(OUString("foobar"),
translitTest(*m_pDoc, aPaM,
- i18n::TransliterationModules_UPPERCASE_LOWERCASE));
+ TransliterationFlags::UPPERCASE_LOWERCASE));
CPPUNIT_ASSERT_EQUAL(OUString("Foobar"),
translitTest(*m_pDoc, aPaM,
- i18n::TransliterationModulesExtra::SENTENCE_CASE));
+ TransliterationFlags::SENTENCE_CASE));
CPPUNIT_ASSERT_EQUAL(OUString("Foobar"),
translitTest(*m_pDoc, aPaM,
- i18n::TransliterationModules_HIRAGANA_KATAKANA));
+ TransliterationFlags::HIRAGANA_KATAKANA));
}
namespace
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 8e6479f20538..d9c76ba5c459 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -54,6 +54,8 @@
#include <editeng/scripttypeitem.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/wghtitem.hxx>
+#include <i18nutil/transliteration.hxx>
+#include <i18nutil/searchopt.hxx>
#include <reffld.hxx>
#include <txatbase.hxx>
#include <ftnidx.hxx>
@@ -71,11 +73,9 @@
#include "com/sun/star/util/XNumberFormatTypes.hpp"
#include "com/sun/star/util/NumberFormat.hpp"
#include "com/sun/star/util/XNumberFormatsSupplier.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/util/SearchAlgorithms.hpp"
-#include "com/sun/star/i18n/TransliterationModulesExtra.hpp"
#include "com/sun/star/sdbcx/XTablesSupplier.hpp"
#include "com/sun/star/text/XParagraphCursor.hpp"
#include "com/sun/star/util/XPropertyReplace.hpp"
@@ -2005,7 +2005,7 @@ void SwUiWriterTest::testSearchWithTransliterate()
SwPaM aPaM(aIdx);
pDoc->getIDocumentContentOperations().InsertString(aPaM,"This is Other PARAGRAPH");
}
- css::util::SearchOptions2 SearchOpt;
+ i18nutil::SearchOptions2 SearchOpt;
SearchOpt.algorithmType = css::util::SearchAlgorithms_ABSOLUTE;
SearchOpt.searchFlag = css::util::SearchFlags::ALL_IGNORE_CASE;
SearchOpt.searchString = "other";
@@ -2013,7 +2013,7 @@ void SwUiWriterTest::testSearchWithTransliterate()
SearchOpt.changedChars = 0;
SearchOpt.deletedChars = 0;
SearchOpt.insertedChars = 0;
- SearchOpt.transliterateFlags = css::i18n::TransliterationModulesExtra::IGNORE_DIACRITICS_CTL;
+ SearchOpt.transliterateFlags = TransliterationFlags::IGNORE_DIACRITICS_CTL;
SearchOpt.AlgorithmType2 = css::util::SearchAlgorithms2::ABSOLUTE;
SearchOpt.WildcardEscapeCharacter = 0;
//transliteration option set so that at least one of the search strings is not found
@@ -2022,7 +2022,7 @@ void SwUiWriterTest::testSearchWithTransliterate()
CPPUNIT_ASSERT_EQUAL(OUString(""),pShellCursor->GetText());
CPPUNIT_ASSERT_EQUAL(0,(int)case1);
SearchOpt.searchString = "paragraph";
- SearchOpt.transliterateFlags = css::i18n::TransliterationModulesExtra::IGNORE_KASHIDA_CTL;
+ SearchOpt.transliterateFlags = TransliterationFlags::IGNORE_KASHIDA_CTL;
//transliteration option set so that all search strings are found
sal_uLong case2 = pWrtShell->SearchPattern(SearchOpt,true,SwDocPositions::Start,SwDocPositions::End);
pShellCursor = pWrtShell->getShellCursor(true);
@@ -2047,7 +2047,7 @@ void SwUiWriterTest::testTdf73660()
pWrtShell->Insert(aData5 + " ");
pWrtShell->Insert("Now we have enough text let's test search for all the cases");
//searching for all 5 strings entered with soft-hyphen, search string contains no soft-hyphen
- css::util::SearchOptions2 searchOpt;
+ i18nutil::SearchOptions2 searchOpt;
searchOpt.algorithmType = css::util::SearchAlgorithms_REGEXP;
searchOpt.searchFlag = css::util::SearchFlags::NORM_WORD_ONLY;
//case 1
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 44c935c6deac..45500bfc5f16 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -902,9 +902,9 @@ namespace
uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
xTransWrp.reset(new ::utl::TransliterationWrapper( xContext,
- i18n::TransliterationModules_IGNORE_CASE |
- i18n::TransliterationModules_IGNORE_KANA |
- i18n::TransliterationModules_IGNORE_WIDTH ));
+ TransliterationFlags::IGNORE_CASE |
+ TransliterationFlags::IGNORE_KANA |
+ TransliterationFlags::IGNORE_WIDTH ));
xTransWrp->loadModuleIfNeeded( static_cast<sal_uInt16>(GetAppLanguage()) );
}
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 9084a272f94e..d252ad9273ba 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <com/sun/star/util/SearchOptions2.hpp>
#include <com/sun/star/text/XTextRange.hpp>
#include <hintids.hxx>
@@ -3169,7 +3168,7 @@ bool SwCursorShell::SelectHiddenRange()
return bRet;
}
-sal_uLong SwCursorShell::Find( const SearchOptions2& rSearchOpt,
+sal_uLong SwCursorShell::Find( const i18nutil::SearchOptions2& rSearchOpt,
bool bSearchInNotes,
SwDocPositions eStart, SwDocPositions eEnd,
bool& bCancel,
@@ -3211,7 +3210,7 @@ sal_uLong SwCursorShell::Find( const SfxItemSet& rSet,
SwDocPositions eStart, SwDocPositions eEnd,
bool& bCancel,
FindRanges eRng,
- const SearchOptions2* pSearchOpt,
+ const i18nutil::SearchOptions2* pSearchOpt,
const SfxItemSet* rReplSet )
{
if( m_pTableCursor )
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index ba1753624a5e..09c0153a2cf4 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -18,10 +18,10 @@
*/
#include <com/sun/star/lang/Locale.hpp>
-#include <com/sun/star/util/SearchOptions2.hpp>
#include <com/sun/star/util/SearchAlgorithms2.hpp>
#include <com/sun/star/util/SearchFlags.hpp>
#include <i18nlangtag/languagetag.hxx>
+#include <i18nutil/searchopt.hxx>
#include <hintids.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
@@ -1056,12 +1056,12 @@ struct SwFindParaAttr : public SwFindParas
{
bool bValue;
const SfxItemSet *pSet, *pReplSet;
- const SearchOptions2 *pSearchOpt;
+ const i18nutil::SearchOptions2 *pSearchOpt;
SwCursor& m_rCursor;
std::unique_ptr<utl::TextSearch> pSText;
SwFindParaAttr( const SfxItemSet& rSet, bool bNoCollection,
- const SearchOptions2* pOpt, const SfxItemSet* pRSet,
+ const i18nutil::SearchOptions2* pOpt, const SfxItemSet* pRSet,
SwCursor& rCursor )
: bValue( bNoCollection ), pSet( &rSet ), pReplSet( pRSet ),
pSearchOpt( pOpt ), m_rCursor( rCursor ) {}
@@ -1109,7 +1109,7 @@ int SwFindParaAttr::Find( SwPaM* pCursor, SwMoveFnCollection const & fnMove, con
// then search in text of it
if( !pSText )
{
- SearchOptions2 aTmp( *pSearchOpt );
+ i18nutil::SearchOptions2 aTmp( *pSearchOpt );
// search in selection
aTmp.searchFlag |= (SearchFlags::REG_NOT_BEGINOFLINE |
@@ -1221,7 +1221,7 @@ bool SwFindParaAttr::IsReplaceMode() const
sal_uLong SwCursor::Find( const SfxItemSet& rSet, bool bNoCollections,
SwDocPositions nStart, SwDocPositions nEnd,
bool& bCancel, FindRanges eFndRngs,
- const SearchOptions2* pSearchOpt,
+ const i18nutil::SearchOptions2* pSearchOpt,
const SfxItemSet* pReplSet )
{
// switch off OLE-notifications
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index 70a0f726389f..c12aa4f9f2b2 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -19,7 +19,6 @@
#include <memory>
-#include <com/sun/star/util/SearchOptions2.hpp>
#include <com/sun/star/util/SearchFlags.hpp>
#include <comphelper/lok.hxx>
#include <comphelper/string.hxx>
@@ -221,7 +220,7 @@ size_t GetPostIt(sal_Int32 aCount,const SwpHints *pHts)
return aIndex;
}
-bool SwPaM::Find( const SearchOptions2& rSearchOpt, bool bSearchInNotes , utl::TextSearch& rSText,
+bool SwPaM::Find( const i18nutil::SearchOptions2& rSearchOpt, bool bSearchInNotes , utl::TextSearch& rSText,
SwMoveFnCollection const & fnMove, const SwPaM * pRegion,
bool bInReadOnly )
{
@@ -469,7 +468,7 @@ bool SwPaM::Find( const SearchOptions2& rSearchOpt, bool bSearchInNotes , utl::T
return bFound;
}
-bool SwPaM::DoSearch( const SearchOptions2& rSearchOpt, utl::TextSearch& rSText,
+bool SwPaM::DoSearch( const i18nutil::SearchOptions2& rSearchOpt, utl::TextSearch& rSText,
SwMoveFnCollection const & fnMove, bool bSrchForward, bool bRegSearch,
bool bChkEmptyPara, bool bChkParaEnd,
sal_Int32 &nStart, sal_Int32 &nEnd, sal_Int32 nTextLen,
@@ -632,13 +631,13 @@ bool SwPaM::DoSearch( const SearchOptions2& rSearchOpt, utl::TextSearch& rSText,
/// parameters for search and replace in text
struct SwFindParaText : public SwFindParas
{
- const SearchOptions2& m_rSearchOpt;
+ const i18nutil::SearchOptions2& m_rSearchOpt;
SwCursor& m_rCursor;
utl::TextSearch m_aSText;
bool m_bReplace;
bool m_bSearchInNotes;
- SwFindParaText( const SearchOptions2& rOpt, bool bSearchInNotes, bool bRepl, SwCursor& rCursor )
+ SwFindParaText( const i18nutil::SearchOptions2& rOpt, bool bSearchInNotes, bool bRepl, SwCursor& rCursor )
: m_rSearchOpt( rOpt ), m_rCursor( rCursor ), m_aSText( utl::TextSearch::UpgradeToSearchOptions2( rOpt) ),
m_bReplace( bRepl ), m_bSearchInNotes( bSearchInNotes )
{}
@@ -712,7 +711,7 @@ bool SwFindParaText::IsReplaceMode() const
return m_bReplace;
}
-sal_uLong SwCursor::Find( const SearchOptions2& rSearchOpt, bool bSearchInNotes,
+sal_uLong SwCursor::Find( const i18nutil::SearchOptions2& rSearchOpt, bool bSearchInNotes,
SwDocPositions nStart, SwDocPositions nEnd,
bool& bCancel, FindRanges eFndRngs, bool bReplace )
{
@@ -745,7 +744,7 @@ sal_uLong SwCursor::Find( const SearchOptions2& rSearchOpt, bool bSearchInNotes,
return nRet;
}
-OUString *ReplaceBackReferences( const SearchOptions2& rSearchOpt, SwPaM* pPam )
+OUString *ReplaceBackReferences( const i18nutil::SearchOptions2& rSearchOpt, SwPaM* pPam )
{
OUString *pRet = nullptr;
if( pPam && pPam->HasMark() &&
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 94686b67e129..b58e657ab84a 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -970,7 +970,7 @@ void SwEditShell::SetExtTextInputData( const CommandExtTextInputData& rData )
}
}
-void SwEditShell::TransliterateText( sal_uInt32 nType )
+void SwEditShell::TransliterateText( TransliterationFlags nType )
{
utl::TransliterationWrapper aTrans( ::comphelper::getProcessComponentContext(), nType );
StartAllAction();
diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx
index c4756af05c95..10162be0ecee 100644
--- a/sw/source/core/edit/edtox.cxx
+++ b/sw/source/core/edit/edtox.cxx
@@ -17,11 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#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 <comphelper/string.hxx>
+#include <i18nutil/transliteration.hxx>
+#include <i18nutil/searchopt.hxx>
#include <svl/fstathelper.hxx>
#include <osl/thread.h>
#include <unotools/textsearch.hxx>
@@ -311,16 +311,15 @@ void SwEditShell::ApplyAutoMark()
sal_Int32 nLEV_Other = 2; // -> changedChars;
sal_Int32 nLEV_Longer = 3; //! -> deletedChars;
sal_Int32 nLEV_Shorter = 1; //! -> insertedChars;
- sal_Int32 nTransliterationFlags = 0;
sal_Int32 nSrchFlags = SearchFlags::LEV_RELAXED;
- SearchOptions2 aSearchOpt(
+ i18nutil::SearchOptions2 aSearchOpt(
SearchAlgorithms_ABSOLUTE, nSrchFlags,
"", "",
SvtSysLocale().GetLanguageTag().getLocale(),
nLEV_Other, nLEV_Longer, nLEV_Shorter,
- nTransliterationFlags,
+ TransliterationFlags::NONE,
SearchAlgorithms2::ABSOLUTE,
'\\' );
@@ -354,12 +353,12 @@ void SwEditShell::ApplyAutoMark()
if (!bCaseSensitive)
{
aSearchOpt.transliterateFlags |=
- TransliterationModules_IGNORE_CASE;
+ TransliterationFlags::IGNORE_CASE;
}
else
{
aSearchOpt.transliterateFlags &=
- ~TransliterationModules_IGNORE_CASE;
+ ~TransliterationFlags::IGNORE_CASE;
}
if ( bWordOnly)
aSearchOpt.searchFlag |= SearchFlags::NORM_WORD_ONLY;
diff --git a/sw/source/core/inc/UndoOverwrite.hxx b/sw/source/core/inc/UndoOverwrite.hxx
index a573f90b8982..1b520fae1efb 100644
--- a/sw/source/core/inc/UndoOverwrite.hxx
+++ b/sw/source/core/inc/UndoOverwrite.hxx
@@ -26,7 +26,7 @@
class SwRedlineSaveDatas;
class SwTextNode;
-
+enum class TransliterationFlags;
namespace utl {
class TransliterationWrapper;
}
@@ -69,7 +69,7 @@ struct UndoTransliterate_Data;
class SwUndoTransliterate : public SwUndo, public SwUndRng
{
std::vector< UndoTransliterate_Data * > aChanges;
- sal_uInt32 nType;
+ TransliterationFlags nType;
void DoTransliterate(SwDoc & rDoc, SwPaM & rPam);
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 9517d953a6bb..5054698874f4 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -25,6 +25,7 @@
#include <editeng/fontitem.hxx>
#include <editeng/scripttypeitem.hxx>
#include <editeng/hangulhanja.hxx>
+#include <i18nutil/transliteration.hxx>
#include <SwSmartTagMgr.hxx>
#include <linguistic/lngprops.hxx>
#include <officecfg/Office/Writer.hxx>
@@ -71,8 +72,6 @@
#include <com/sun/star/i18n/WordType.hpp>
#include <com/sun/star/i18n/ScriptType.hpp>
-#include <com/sun/star/i18n/TransliterationModules.hpp>
-#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
#include <vector>
#include <utility>
@@ -1712,7 +1711,7 @@ void SwTextNode::TransliterateText(
std::vector< swTransliterationChgData > aChanges;
swTransliterationChgData aChgData;
- if (rTrans.getType() == (sal_uInt32)TransliterationModulesExtra::TITLE_CASE)
+ if (rTrans.getType() == TransliterationFlags::TITLE_CASE)
{
// for 'capitalize every word' we need to iterate over each word
@@ -1776,7 +1775,7 @@ void SwTextNode::TransliterateText(
nWordType);
}
}
- else if (rTrans.getType() == (sal_uInt32)TransliterationModulesExtra::SENTENCE_CASE)
+ else if (rTrans.getType() == TransliterationFlags::SENTENCE_CASE)
{
// for 'sentence case' we need to iterate sentence by sentence
diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx
index 7f94288aefa5..6f3f7bd0e319 100644
--- a/sw/source/core/unocore/unosrch.cxx
+++ b/sw/source/core/unocore/unosrch.cxx
@@ -24,14 +24,13 @@
#include <unobaseclass.hxx>
#include <unomid.h>
+#include <i18nutil/searchopt.hxx>
#include <o3tl/any.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <editeng/unolingu.hxx>
-#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 <com/sun/star/beans/PropertyAttribute.hpp>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -715,7 +714,7 @@ uno::Sequence< OUString > SwXTextSearch::getSupportedServiceNames()
return aRet;
}
-void SwXTextSearch::FillSearchOptions( util::SearchOptions2& rSearchOpt ) const
+void SwXTextSearch::FillSearchOptions( i18nutil::SearchOptions2& rSearchOpt ) const
{
if( m_bSimilarity )
{
@@ -743,7 +742,7 @@ void SwXTextSearch::FillSearchOptions( util::SearchOptions2& rSearchOpt ) const
rSearchOpt.replaceString = m_sReplaceText;
if( !m_bCase )
- rSearchOpt.transliterateFlags |= i18n::TransliterationModules_IGNORE_CASE;
+ rSearchOpt.transliterateFlags |= TransliterationFlags::IGNORE_CASE;
if( m_bWord )
rSearchOpt.searchFlag |= util::SearchFlags::NORM_WORD_ONLY;
diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx
index 199d3ecdbccb..fd79226e02ab 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -25,11 +25,10 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/Bibliography.hpp>
-#include <com/sun/star/i18n/TransliterationModules.hpp>
#include <com/sun/star/i18n/IndexEntrySupplier.hpp>
-#include <com/sun/star/util/SearchOptions2.hpp>
#include <com/sun/star/util/SearchAlgorithms2.hpp>
#include <com/sun/star/util/SearchFlags.hpp>
+#include <i18nutil/searchopt.hxx>
#include <svl/stritem.hxx>
#include <vcl/layout.hxx>
#include <sfx2/dispatch.hxx>
@@ -438,15 +437,15 @@ static void lcl_SelectSameStrings(SwWrtShell& rSh, bool bWordOnly, bool bCaseSen
{
rSh.Push();
- SearchOptions2 aSearchOpt(
+ i18nutil::SearchOptions2 aSearchOpt(
SearchAlgorithms_ABSOLUTE,
( bWordOnly ? SearchFlags::NORM_WORD_ONLY : 0 ),
rSh.GetSelText(), OUString(),
GetAppLanguageTag().getLocale(),
0, 0, 0,
(bCaseSensitive
- ? 0
- : static_cast<int>(TransliterationModules_IGNORE_CASE)),
+ ? TransliterationFlags::NONE
+ : TransliterationFlags::IGNORE_CASE),
SearchAlgorithms2::ABSOLUTE,
'\\' );
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index a3f53456b322..eb838a1d1774 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -2199,7 +2199,7 @@ sal_uInt16 SwPostItMgr::Replace(SvxSearchItem* pItem)
return aResult;
}
-sal_uInt16 SwPostItMgr::FinishSearchReplace(const css::util::SearchOptions2& rSearchOptions, bool bSrchForward)
+sal_uInt16 SwPostItMgr::FinishSearchReplace(const i18nutil::SearchOptions2& rSearchOptions, bool bSrchForward)
{
SwSidebarWin* pWin = GetActiveSidebarWin();
SvxSearchItem aItem(SID_SEARCH_ITEM );
@@ -2211,7 +2211,7 @@ sal_uInt16 SwPostItMgr::FinishSearchReplace(const css::util::SearchOptions2& rSe
return aResult;
}
-sal_uInt16 SwPostItMgr::SearchReplace(const SwFormatField &pField, const css::util::SearchOptions2& rSearchOptions, bool bSrchForward)
+sal_uInt16 SwPostItMgr::SearchReplace(const SwFormatField &pField, const i18nutil::SearchOptions2& rSearchOptions, bool bSrchForward)
{
sal_uInt16 aResult = 0;
SwSidebarWin* pWin = GetSidebarWin(&pField);
diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx
index c3b63ef2d03e..894e3cbe2658 100644
--- a/sw/source/uibase/inc/wrtsh.hxx
+++ b/sw/source/uibase/inc/wrtsh.hxx
@@ -46,9 +46,9 @@ class NaviContentBookmark;
struct SwCallMouseEvent;
class SfxStringListItem;
-namespace com { namespace sun { namespace star { namespace util {
+namespace i18nutil {
struct SearchOptions2;
-} } } }
+}
typedef sal_Int32 SelectionType;
namespace nsSelectionType
@@ -360,7 +360,7 @@ typedef bool (SwWrtShell:: *FNSimpleMove)();
void GetDoStrings( DoType eDoType, SfxStringListItem& rStrLstItem ) const;
// search and replace
- sal_uLong SearchPattern(const css::util::SearchOptions2& rSearchOpt,
+ sal_uLong SearchPattern(const i18nutil::SearchOptions2& rSearchOpt,
bool bSearchInNotes,
SwDocPositions eStart, SwDocPositions eEnd,
FindRanges eFlags = FindRanges::InBody,
@@ -375,7 +375,7 @@ typedef bool (SwWrtShell:: *FNSimpleMove)();
bool bNoColls,
SwDocPositions eStart, SwDocPositions eEnd,
FindRanges eFlags = FindRanges::InBody,
- const css::util::SearchOptions2* pSearchOpt = nullptr,
+ const i18nutil::SearchOptions2* pSearchOpt = nullptr,
const SfxItemSet* pReplaceSet = nullptr);
void AutoCorrect( SvxAutoCorrect& rACorr, sal_Unicode cChar );
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index 80520635b2fb..3477a7ea3621 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -19,13 +19,12 @@
#include <hintids.hxx>
-#include <com/sun/star/i18n/TransliterationModules.hpp>
-#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
#include <com/sun/star/i18n/TextConversionOption.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <i18nlangtag/mslangid.hxx>
+#include <i18nutil/transliteration.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/bindings.hxx>
@@ -1427,43 +1426,43 @@ void SwAnnotationShell::ExecTransliteration(SfxRequest &rReq)
using namespace ::com::sun::star::i18n;
- sal_uInt32 nMode = 0;
+ TransliterationFlags nMode = TransliterationFlags::NONE;
switch( rReq.GetSlot() )
{
case SID_TRANSLITERATE_SENTENCE_CASE:
- nMode = TransliterationModulesExtra::SENTENCE_CASE;
+ nMode = TransliterationFlags::SENTENCE_CASE;
break;
case SID_TRANSLITERATE_TITLE_CASE:
- nMode = TransliterationModulesExtra::TITLE_CASE;
+ nMode = TransliterationFlags::TITLE_CASE;
break;
case SID_TRANSLITERATE_TOGGLE_CASE:
- nMode = TransliterationModulesExtra::TOGGLE_CASE;
+ nMode = TransliterationFlags::TOGGLE_CASE;
break;
case SID_TRANSLITERATE_UPPER:
- nMode = TransliterationModules_LOWERCASE_UPPERCASE;
+ nMode = TransliterationFlags::LOWERCASE_UPPERCASE;
break;
case SID_TRANSLITERATE_LOWER:
- nMode = TransliterationModules_UPPERCASE_LOWERCASE;
+ nMode = TransliterationFlags::UPPERCASE_LOWERCASE;
break;
case SID_TRANSLITERATE_HALFWIDTH:
- nMode = TransliterationModules_FULLWIDTH_HALFWIDTH;
+ nMode = TransliterationFlags::FULLWIDTH_HALFWIDTH;
break;
case SID_TRANSLITERATE_FULLWIDTH:
- nMode = TransliterationModules_HALFWIDTH_FULLWIDTH;
+ nMode = TransliterationFlags::HALFWIDTH_FULLWIDTH;
break;
case SID_TRANSLITERATE_HIRAGANA:
- nMode = TransliterationModules_KATAKANA_HIRAGANA;
+ nMode = TransliterationFlags::KATAKANA_HIRAGANA;
break;
case SID_TRANSLITERATE_KATAGANA:
- nMode = TransliterationModules_HIRAGANA_KATAKANA;
+ nMode = TransliterationFlags::HIRAGANA_KATAKANA;
break;
default:
OSL_ENSURE(false, "wrong dispatcher");
}
- if( nMode )
+ if( nMode != TransliterationFlags::NONE )
pOLV->TransliterateText( nMode );
}
diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx
index 70cc06b6cb24..5537cd54ad89 100644
--- a/sw/source/uibase/shells/drwtxtsh.cxx
+++ b/sw/source/uibase/shells/drwtxtsh.cxx
@@ -19,6 +19,7 @@
#include <hintids.hxx>
#include <i18nlangtag/lang.h>
+#include <i18nutil/transliteration.hxx>
#include <svl/slstitm.hxx>
#include <svl/cjkoptions.hxx>
#include <editeng/fontitem.hxx>
@@ -40,8 +41,6 @@
#include <editeng/outliner.hxx>
#include <editeng/editstat.hxx>
#include <svx/svdoutl.hxx>
-#include <com/sun/star/i18n/TransliterationModules.hpp>
-#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
#include <com/sun/star/i18n/TextConversionOption.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
@@ -615,45 +614,45 @@ void SwDrawTextShell::ExecTransliteration( SfxRequest & rReq )
using namespace i18n;
- sal_uInt32 nMode = 0;
+ TransliterationFlags nMode = TransliterationFlags::NONE;
switch( rReq.GetSlot() )
{
case SID_TRANSLITERATE_SENTENCE_CASE:
- nMode = TransliterationModulesExtra::SENTENCE_CASE;
+ nMode = TransliterationFlags::SENTENCE_CASE;
break;
case SID_TRANSLITERATE_TITLE_CASE:
- nMode = TransliterationModulesExtra::TITLE_CASE;
+ nMode = TransliterationFlags::TITLE_CASE;
break;
case SID_TRANSLITERATE_TOGGLE_CASE:
- nMode = TransliterationModulesExtra::TOGGLE_CASE;
+ nMode = TransliterationFlags::TOGGLE_CASE;
break;
case SID_TRANSLITERATE_UPPER:
- nMode = TransliterationModules_LOWERCASE_UPPERCASE;
+ nMode = TransliterationFlags::LOWERCASE_UPPERCASE;
break;
case SID_TRANSLITERATE_LOWER:
- nMode = TransliterationModules_UPPERCASE_LOWERCASE;
+ nMode = TransliterationFlags::UPPERCASE_LOWERCASE;
break;
case SID_TRANSLITERATE_HALFWIDTH:
- nMode = TransliterationModules_FULLWIDTH_HALFWIDTH;
+ nMode = TransliterationFlags::FULLWIDTH_HALFWIDTH;
break;
case SID_TRANSLITERATE_FULLWIDTH:
- nMode = TransliterationModules_HALFWIDTH_FULLWIDTH;
+ nMode = TransliterationFlags::HALFWIDTH_FULLWIDTH;
break;
case SID_TRANSLITERATE_HIRAGANA:
- nMode = TransliterationModules_KATAKANA_HIRAGANA;
+ nMode = TransliterationFlags::KATAKANA_HIRAGANA;
break;
case SID_TRANSLITERATE_KATAGANA:
- nMode = TransliterationModules_HIRAGANA_KATAKANA;
+ nMode = TransliterationFlags::HIRAGANA_KATAKANA;
break;
default:
OSL_ENSURE(false, "wrong dispatcher");
}
- if( nMode )
+ if( nMode != TransliterationFlags::NONE )
{
OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index d7b7dc123d17..29b1298898ba 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -52,8 +52,6 @@
#include <vcl/graphicfilter.hxx>
#include <sfx2/htmlmode.hxx>
#include <svtools/htmlcfg.hxx>
-#include <com/sun/star/i18n/TransliterationModules.hpp>
-#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
#include <com/sun/star/embed/Aspects.hpp>
#include <comphelper/classids.hxx>
@@ -781,45 +779,45 @@ void SwTextShell::ExecDelete(SfxRequest &rReq)
void SwTextShell::ExecTransliteration( SfxRequest & rReq )
{
using namespace ::com::sun::star::i18n;
- sal_uInt32 nMode = 0;
+ TransliterationFlags nMode = TransliterationFlags::NONE;
switch( rReq.GetSlot() )
{
case SID_TRANSLITERATE_SENTENCE_CASE:
- nMode = TransliterationModulesExtra::SENTENCE_CASE;
+ nMode = TransliterationFlags::SENTENCE_CASE;
break;
case SID_TRANSLITERATE_TITLE_CASE:
- nMode = TransliterationModulesExtra::TITLE_CASE;
+ nMode = TransliterationFlags::TITLE_CASE;
break;
case SID_TRANSLITERATE_TOGGLE_CASE:
- nMode = TransliterationModulesExtra::TOGGLE_CASE;
+ nMode = TransliterationFlags::TOGGLE_CASE;
break;
case SID_TRANSLITERATE_UPPER:
- nMode = TransliterationModules_LOWERCASE_UPPERCASE;
+ nMode = TransliterationFlags::LOWERCASE_UPPERCASE;
break;
case SID_TRANSLITERATE_LOWER:
- nMode = TransliterationModules_UPPERCASE_LOWERCASE;
+ nMode = TransliterationFlags::UPPERCASE_LOWERCASE;
break;
case SID_TRANSLITERATE_HALFWIDTH:
- nMode = TransliterationModules_FULLWIDTH_HALFWIDTH;
+ nMode = TransliterationFlags::FULLWIDTH_HALFWIDTH;
break;
case SID_TRANSLITERATE_FULLWIDTH:
- nMode = TransliterationModules_HALFWIDTH_FULLWIDTH;
+ nMode = TransliterationFlags::HALFWIDTH_FULLWIDTH;
break;
case SID_TRANSLITERATE_HIRAGANA:
- nMode = TransliterationModules_KATAKANA_HIRAGANA;
+ nMode = TransliterationFlags::KATAKANA_HIRAGANA;
break;
case SID_TRANSLITERATE_KATAGANA:
- nMode = TransliterationModules_HIRAGANA_KATAKANA;
+ nMode = TransliterationFlags::HIRAGANA_KATAKANA;
break;
default:
OSL_ENSURE(false, "wrong dispatcher");
}
- if( nMode )
+ if( nMode != TransliterationFlags::NONE )
GetShell().TransliterateText( nMode );
}
diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx
index 77950de87c9f..bb1827bc21a1 100644
--- a/sw/source/uibase/uiview/srcview.cxx
+++ b/sw/source/uibase/uiview/srcview.cxx
@@ -18,7 +18,6 @@
*/
#include <hintids.hxx>
-#include <com/sun/star/util/SearchOptions2.hpp>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <comphelper/string.hxx>
#include <unotools/tempfile.hxx>
@@ -94,7 +93,6 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::ui::dialogs;
using namespace ::sfx2;
-using ::com::sun::star::util::SearchOptions2;
#define SWSRCVIEWFLAGS ( SfxViewShellFlags::CAN_PRINT | SfxViewShellFlags::NO_NEWWINDOW )
@@ -579,7 +577,7 @@ void SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem,
if( !bForward )
aPaM = TextPaM( TEXT_PARA_ALL, TEXT_INDEX_ALL );
- util::SearchOptions2 aSearchOpt( rSearchItem.GetSearchOptions() );
+ i18nutil::SearchOptions2 aSearchOpt( rSearchItem.GetSearchOptions() );
aSearchOpt.Locale = GetAppLanguageTag().getLocale();
sal_uInt16 nFound;
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index af44ff794712..9fa93e28003e 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -19,9 +19,7 @@
#include <config_features.h>
-#include <com/sun/star/util/SearchOptions2.hpp>
#include <com/sun/star/util/SearchAlgorithms2.hpp>
-#include <com/sun/star/i18n/TransliterationModules.hpp>
#include <o3tl/any.hxx>
#include <vcl/graphicfilter.hxx>
#include <com/sun/star/sdb/DatabaseContext.hpp>
@@ -146,6 +144,7 @@
#include <vcl/GraphicNativeTransform.hxx>
#include <vcl/GraphicNativeMetadata.hxx>
#include <vcl/settings.hxx>
+#include <i18nutil/searchopt.hxx>
#include <memory>
@@ -1992,12 +1991,12 @@ bool SwView::JumpToSwMark( const OUString& rMark )
// normal text search
m_pWrtShell->EnterStdMode();
- SearchOptions2 aSearchOpt(
+ i18nutil::SearchOptions2 aSearchOpt(
SearchAlgorithms_ABSOLUTE, 0,
sName, OUString(),
SvtSysLocale().GetLanguageTag().getLocale(),
0,0,0,
- TransliterationModules_IGNORE_CASE,
+ TransliterationFlags::IGNORE_CASE,
SearchAlgorithms2::ABSOLUTE,
'\\' );
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx
index 6bbc5f402b7b..f29aa9427924 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -26,7 +26,6 @@
#include <hintids.hxx>
-#include <com/sun/star/util/SearchOptions2.hpp>
#include <svl/cjkoptions.hxx>
#include <svl/ctloptions.hxx>
#include <svx/pageitem.hxx>
@@ -310,7 +309,7 @@ void SwView::ExecSearch(SfxRequest& rReq)
if (bBack)
m_pWrtShell->Push();
OUString aReplace( m_pSrchItem->GetReplaceString() );
- SearchOptions2 aTmp( m_pSrchItem->GetSearchOptions() );
+ i18nutil::SearchOptions2 aTmp( m_pSrchItem->GetSearchOptions() );
OUString *pBackRef = ReplaceBackReferences( aTmp, m_pWrtShell->GetCursor() );
if( pBackRef )
m_pSrchItem->SetReplaceString( *pBackRef );
@@ -833,7 +832,7 @@ sal_uLong SwView::FUNC_Search( const SwSearchOptions& rOptions )
// build SearchOptions to be used
- SearchOptions2 aSearchOpt( m_pSrchItem->GetSearchOptions() );
+ i18nutil::SearchOptions2 aSearchOpt( m_pSrchItem->GetSearchOptions() );
aSearchOpt.Locale = GetAppLanguageTag().getLocale();
if( !bDoReplace )
aSearchOpt.replaceString.clear();
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 4c18778dec5c..cea95ba2b755 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -84,7 +84,6 @@
#include <globals.hrc>
#include <unomid.h>
#include <unotools/printwarningoptions.hxx>
-#include <com/sun/star/util/SearchOptions2.hpp>
#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
@@ -135,6 +134,7 @@
#include <editeng/langitem.hxx>
#include <docary.hxx>
#include <i18nlangtag/languagetag.hxx>
+#include <i18nutil/searchopt.hxx>
#include <format.hxx>
#include <charfmt.hxx>
@@ -749,7 +749,7 @@ sal_Int32 SwXTextDocument::replaceAll(const Reference< util::XSearchDescriptor >
int eRanges(FindRanges::InBody|FindRanges::InSelAll);
- util::SearchOptions2 aSearchOpt;
+ i18nutil::SearchOptions2 aSearchOpt;
pSearch->FillSearchOptions( aSearchOpt );
SwDocPositions eStart = pSearch->m_bBack ? SwDocPositions::End : SwDocPositions::Start;
@@ -871,7 +871,7 @@ SwUnoCursor* SwXTextDocument::FindAny(const Reference< util::XSearchDescriptor >
rRangeNode.FindFooterStartNode() ;
}
- util::SearchOptions2 aSearchOpt;
+ i18nutil::SearchOptions2 aSearchOpt;
pSearch->FillSearchOptions( aSearchOpt );
/**
diff --git a/sw/source/uibase/wrtsh/select.cxx b/sw/source/uibase/wrtsh/select.cxx
index 0874d2af4f73..34542165c62f 100644
--- a/sw/source/uibase/wrtsh/select.cxx
+++ b/sw/source/uibase/wrtsh/select.cxx
@@ -209,7 +209,7 @@ long SwWrtShell::SelAll()
// Description: Text search
-sal_uLong SwWrtShell::SearchPattern( const SearchOptions2& rSearchOpt, bool bSearchInNotes,
+sal_uLong SwWrtShell::SearchPattern( const i18nutil::SearchOptions2& rSearchOpt, bool bSearchInNotes,
SwDocPositions eStt, SwDocPositions eEnd,
FindRanges eFlags, bool bReplace )
{
@@ -255,7 +255,7 @@ sal_uLong SwWrtShell::SearchTempl( const OUString &rTempl,
sal_uLong SwWrtShell::SearchAttr( const SfxItemSet& rFindSet, bool bNoColls,
SwDocPositions eStart, SwDocPositions eEnd,
- FindRanges eFlags, const SearchOptions2* pSearchOpt,
+ FindRanges eFlags, const i18nutil::SearchOptions2* pSearchOpt,
const SfxItemSet* pReplaceSet )
{
// no enhancement of existing selections