[Libreoffice-commits] core.git: basic/source cui/source editeng/source forms/source i18npool/inc i18npool/qa i18npool/source i18nutil/source include/editeng include/i18nutil include/svl include/svx include/unotools include/vcl reportdesign/source sc/inc sc/qa sc/source sd/source svl/source svx/source sw/inc sw/qa sw/source unotools/source vcl/source
Noel Grandin
noel.grandin at collabora.co.uk
Wed Mar 1 07:28:37 UTC 2017
basic/source/classes/global.cxx | 3
basic/source/runtime/methods.cxx | 22 -
basic/source/runtime/runtime.cxx | 6
cui/source/dialogs/cuifmsearch.cxx | 3
cui/source/factory/dlgfact.cxx | 4
cui/source/factory/dlgfact.hxx | 4
cui/source/inc/cuisrchdlg.hxx | 6
cui/source/options/cuisrchdlg.cxx | 5
cui/source/options/optaboutconfig.cxx | 3
cui/source/options/optaboutconfig.hxx | 4
cui/source/options/optjsearch.cxx | 88 +++---
cui/source/options/optjsearch.hxx | 13
editeng/source/editeng/editeng.cxx | 4
editeng/source/editeng/editundo.cxx | 2
editeng/source/editeng/editundo.hxx | 6
editeng/source/editeng/editview.cxx | 2
editeng/source/editeng/impedit.hxx | 2
editeng/source/editeng/impedit4.cxx | 10
editeng/source/misc/svxacorr.cxx | 5
editeng/source/outliner/outlvw.cxx | 2
forms/source/xforms/computedexpression.cxx | 4
i18npool/inc/transliteration_caseignore.hxx | 2
i18npool/qa/cppunit/test_textsearch.cxx | 5
i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx | 1
i18npool/source/search/textsearch.cxx | 77 ++---
i18npool/source/transliteration/transliteration_caseignore.cxx | 5
i18nutil/source/utility/casefolding.cxx | 9
include/editeng/editeng.hxx | 6
include/editeng/editview.hxx | 3
include/editeng/outliner.hxx | 16 -
include/i18nutil/casefolding.hxx | 5
include/i18nutil/searchopt.hxx | 142 ++++++++++
include/i18nutil/transliteration.hxx | 132 +++++++++
include/svl/ondemand.hxx | 8
include/svl/srchitem.hxx | 25 -
include/svx/fmsrccfg.hxx | 9
include/svx/fmsrcimp.hxx | 9
include/svx/srchdlg.hxx | 9
include/svx/svxdlg.hxx | 17 -
include/unotools/caserotate.hxx | 5
include/unotools/searchopt.hxx | 3
include/unotools/textsearch.hxx | 18 -
include/unotools/transliterationwrapper.hxx | 7
include/vcl/textview.hxx | 7
include/vcl/xtextedt.hxx | 2
reportdesign/source/ui/inspection/GeometryHandler.cxx | 6
sc/inc/document.hxx | 2
sc/inc/global.hxx | 8
sc/inc/viewutil.hxx | 6
sc/qa/unit/ucalc.cxx | 4
sc/source/core/data/documen8.cxx | 6
sc/source/core/data/table6.cxx | 8
sc/source/core/tool/cellkeytranslator.cxx | 5
sc/source/core/tool/interpr1.cxx | 4
sc/source/ui/docshell/docfunc.cxx | 2
sc/source/ui/drawfunc/drtxtob.cxx | 4
sc/source/ui/inc/docfunc.hxx | 7
sc/source/ui/inc/undoblk.hxx | 5
sc/source/ui/inc/viewfunc.hxx | 2
sc/source/ui/undo/undoblk.cxx | 2
sc/source/ui/view/cellsh1.cxx | 6
sc/source/ui/view/editsh.cxx | 4
sc/source/ui/view/viewfun2.cxx | 2
sc/source/ui/view/viewutil.cxx | 25 -
sd/source/ui/view/drviewse.cxx | 24 -
sd/source/ui/view/outlnvsh.cxx | 23 -
svl/source/items/srchitem.cxx | 84 +++--
svx/source/dialog/srchdlg.cxx | 44 +--
svx/source/form/fmsrccfg.cxx | 107 +++----
svx/source/form/fmsrcimp.cxx | 21 -
svx/source/tbxctrls/tbunosearchcontrollers.cxx | 15 -
sw/inc/PostItMgr.hxx | 6
sw/inc/crsrsh.hxx | 12
sw/inc/editsh.hxx | 9
sw/inc/pam.hxx | 10
sw/inc/swcrsr.hxx | 9
sw/inc/unosrch.hxx | 7
sw/qa/core/macros-test.cxx | 6
sw/qa/core/uwriter.cxx | 17 -
sw/qa/extras/uiwriter/uiwriter.cxx | 12
sw/source/core/bastyp/init.cxx | 6
sw/source/core/crsr/crsrsh.cxx | 5
sw/source/core/crsr/findattr.cxx | 10
sw/source/core/crsr/findtxt.cxx | 13
sw/source/core/edit/editsh.cxx | 2
sw/source/core/edit/edtox.cxx | 13
sw/source/core/inc/UndoOverwrite.hxx | 4
sw/source/core/txtnode/txtedt.cxx | 7
sw/source/core/unocore/unosrch.cxx | 7
sw/source/ui/index/swuiidxmrk.cxx | 9
sw/source/uibase/docvw/PostItMgr.cxx | 4
sw/source/uibase/inc/wrtsh.hxx | 8
sw/source/uibase/shells/annotsh.cxx | 25 -
sw/source/uibase/shells/drwtxtsh.cxx | 25 -
sw/source/uibase/shells/textsh.cxx | 24 -
sw/source/uibase/uiview/srcview.cxx | 4
sw/source/uibase/uiview/view2.cxx | 7
sw/source/uibase/uiview/viewsrch.cxx | 5
sw/source/uibase/uno/unotxdoc.cxx | 6
sw/source/uibase/wrtsh/select.cxx | 4
unotools/source/config/searchopt.cxx | 50 +--
unotools/source/i18n/caserotate.cxx | 15 -
unotools/source/i18n/textsearch.cxx | 27 -
unotools/source/i18n/transliterationwrapper.cxx | 21 -
vcl/source/app/i18nhelp.cxx | 8
vcl/source/edit/textview.cxx | 5
vcl/source/edit/xtextedt.cxx | 7
107 files changed, 911 insertions(+), 644 deletions(-)
New commits:
commit 4c09fc48e9fa9114f32f2973090cbe75177cdd37
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Thu Feb 23 16:15:18 2017 +0200
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 at collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/basic/source/classes/global.cxx b/basic/source/classes/global.cxx
index 0c45b28..8f5472d 100644
--- a/basic/source/classes/global.cxx
+++ b/basic/source/classes/global.cxx
@@ -9,6 +9,7 @@
#include <comphelper/processfactory.hxx>
#include <i18nlangtag/lang.h>
+#include <i18nutil/transliteration.hxx>
#include <rtl/instance.hxx>
#include <unotools/transliterationwrapper.hxx>
#include <vcl/svapp.hxx>
@@ -26,7 +27,7 @@ namespace
lclTransliterationWrapper()
: m_aTransliteration(
comphelper::getProcessComponentContext(),
- css::i18n::TransliterationModules_IGNORE_CASE )
+ TransliterationFlags::IGNORE_CASE )
{
const LanguageType eOfficeLanguage = Application::GetSettings().GetLanguageTag().getLanguageType();
m_aTransliteration.loadModuleIfNeeded( eOfficeLanguage );
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 3447bff..33e4f36 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -1667,9 +1667,9 @@ RTLFUNC(StrComp)
uno::Reference< uno::XComponentContext > xContext = getProcessComponentContext();
pTransliterationWrapper = GetSbData()->pTransliterationWrapper =
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 );
}
LanguageType eLangType = Application::GetSettings().GetLanguageTag().getLanguageType();
@@ -4266,7 +4266,7 @@ RTLFUNC(StrConv)
return;
}
- sal_Int32 nType = 0;
+ TransliterationFlags nType = TransliterationFlags::NONE;
if ( (nConversion & 0x03) == 3 ) // vbProperCase
{
const CharClass& rCharClass = GetCharClass();
@@ -4274,30 +4274,30 @@ RTLFUNC(StrConv)
}
else if ( (nConversion & 0x01) == 1 ) // vbUpperCase
{
- nType |= i18n::TransliterationModules_LOWERCASE_UPPERCASE;
+ nType |= TransliterationFlags::LOWERCASE_UPPERCASE;
}
else if ( (nConversion & 0x02) == 2 ) // vbLowerCase
{
- nType |= i18n::TransliterationModules_UPPERCASE_LOWERCASE;
+ nType |= TransliterationFlags::UPPERCASE_LOWERCASE;
}
if ( (nConversion & 0x04) == 4 ) // vbWide
{
- nType |= i18n::TransliterationModules_HALFWIDTH_FULLWIDTH;
+ nType |= TransliterationFlags::HALFWIDTH_FULLWIDTH;
}
else if ( (nConversion & 0x08) == 8 ) // vbNarrow
{
- nType |= i18n::TransliterationModules_FULLWIDTH_HALFWIDTH;
+ nType |= TransliterationFlags::FULLWIDTH_HALFWIDTH;
}
if ( (nConversion & 0x10) == 16) // vbKatakana
{
- nType |= i18n::TransliterationModules_HIRAGANA_KATAKANA;
+ nType |= TransliterationFlags::HIRAGANA_KATAKANA;
}
else if ( (nConversion & 0x20) == 32 ) // vbHiragana
{
- nType |= i18n::TransliterationModules_KATAKANA_HIRAGANA;
+ nType |= TransliterationFlags::KATAKANA_HIRAGANA;
}
OUString aNewStr( aOldStr );
- if( nType != 0 )
+ if( nType != TransliterationFlags::NONE )
{
uno::Reference< uno::XComponentContext > xContext = getProcessComponentContext();
::utl::TransliterationWrapper aTransliterationWrapper( xContext, nType );
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 2f9284e..e3615b1 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -28,7 +28,6 @@
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/script/XDefaultMethod.hpp>
#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/util/SearchOptions2.hpp>
#include <com/sun/star/util/SearchAlgorithms2.hpp>
#include <comphelper/processfactory.hxx>
@@ -48,6 +47,7 @@
#include <svl/zforlist.hxx>
+#include <i18nutil/searchopt.hxx>
#include <unotools/syslocale.hxx>
#include <unotools/textsearch.hxx>
@@ -1503,7 +1503,7 @@ void SbiRuntime::StepLIKE()
OUString pattern = VBALikeToRegexp(refVar1->GetOUString());
OUString value = refVar2->GetOUString();
- css::util::SearchOptions2 aSearchOpt;
+ i18nutil::SearchOptions2 aSearchOpt;
aSearchOpt.AlgorithmType2 = css::util::SearchAlgorithms2::REGEXP;
@@ -1518,7 +1518,7 @@ void SbiRuntime::StepLIKE()
}
if( bTextMode )
{
- aSearchOpt.transliterateFlags |= css::i18n::TransliterationModules_IGNORE_CASE;
+ aSearchOpt.transliterateFlags |= TransliterationFlags::IGNORE_CASE;
}
SbxVariable* pRes = new SbxVariable;
utl::TextSearch aSearch( aSearchOpt);
diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx
index 8d404c4..81d008d 100644
--- a/cui/source/dialogs/cuifmsearch.cxx
+++ b/cui/source/dialogs/cuifmsearch.cxx
@@ -31,7 +31,6 @@
#include "cuifmsearch.hxx"
#include <svx/srchdlg.hxx>
#include <svl/cjkoptions.hxx>
-#include <com/sun/star/i18n/TransliterationModules.hpp>
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
#include <svx/svxdlg.hxx>
@@ -382,7 +381,7 @@ IMPL_LINK(FmSearchDialog, OnClickedSpecialSettings, Button*, pButton, void )
aDlg->Execute();
- sal_Int32 nFlags = aDlg->GetTransliterationFlags();
+ TransliterationFlags nFlags = aDlg->GetTransliterationFlags();
m_pSearchEngine->SetTransliterationFlags(nFlags);
m_pcbCase->Check(m_pSearchEngine->GetCaseSensitive());
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 354554d..6b96401 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -551,7 +551,7 @@ void AbstractSvxCaptionDialog_Impl::SetValidateFramePosLink( const Link<SvxSwFra
pDlg->SetValidateFramePosLink( rLink );
}
-sal_Int32 AbstractSvxJSearchOptionsDialog_Impl::GetTransliterationFlags() const
+TransliterationFlags AbstractSvxJSearchOptionsDialog_Impl::GetTransliterationFlags() const
{
return pDlg->GetTransliterationFlags();
}
@@ -1089,7 +1089,7 @@ VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateSchTransformTabDi
VclPtr<AbstractSvxJSearchOptionsDialog> AbstractDialogFactory_Impl::CreateSvxJSearchOptionsDialog( vcl::Window* pParent,
const SfxItemSet& rOptionsSet,
- sal_Int32 nInitialFlags)
+ TransliterationFlags nInitialFlags)
{
VclPtrInstance<SvxJSearchOptionsDialog> pDlg( pParent, rOptionsSet, nInitialFlags );
return VclPtr<AbstractSvxJSearchOptionsDialog_Impl>::Create( pDlg );
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 2160c8a..2cf6761 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -254,7 +254,7 @@ class SvxJSearchOptionsDialog;
class AbstractSvxJSearchOptionsDialog_Impl :public AbstractSvxJSearchOptionsDialog
{
DECL_ABSTDLG_BASE(AbstractSvxJSearchOptionsDialog_Impl,SvxJSearchOptionsDialog)
- virtual sal_Int32 GetTransliterationFlags() const override;
+ virtual TransliterationFlags GetTransliterationFlags() const override;
};
class AbstractSvxTransformTabDialog_Impl : public AbstractSvxTransformTabDialog
@@ -549,7 +549,7 @@ public:
sal_uInt16 nLonger) override;
virtual VclPtr<AbstractSvxJSearchOptionsDialog> CreateSvxJSearchOptionsDialog( vcl::Window* pParent,
const SfxItemSet& rOptionsSet,
- sal_Int32 nInitialFlags) override;
+ TransliterationFlags nInitialFlags) override;
virtual VclPtr<AbstractFmInputRecordNoDialog> CreateFmInputRecordNoDialog() override;
virtual VclPtr<AbstractSvxNewDictionaryDialog> CreateSvxNewDictionaryDialog( vcl::Window* pParent ) override;
virtual VclPtr<VclAbstractDialog> CreateSvxEditDictionaryDialog( vcl::Window* pParent,
diff --git a/cui/source/inc/cuisrchdlg.hxx b/cui/source/inc/cuisrchdlg.hxx
index c3d6649..8edf762 100644
--- a/cui/source/inc/cuisrchdlg.hxx
+++ b/cui/source/inc/cuisrchdlg.hxx
@@ -35,7 +35,7 @@ class SvxJSearchOptionsPage;
class SvxJSearchOptionsDialog : public SfxSingleTabDialog
{
- sal_Int32 nInitialTlFlags;
+ TransliterationFlags nInitialTlFlags;
VclPtr<SvxJSearchOptionsPage> pPage;
SvxJSearchOptionsDialog( const SvxJSearchOptionsDialog & ) = delete;
@@ -43,14 +43,14 @@ class SvxJSearchOptionsDialog : public SfxSingleTabDialog
public:
SvxJSearchOptionsDialog(vcl::Window *pParent,
- const SfxItemSet& rOptionsSet, sal_Int32 nInitialFlags);
+ const SfxItemSet& rOptionsSet, TransliterationFlags nInitialFlags);
virtual ~SvxJSearchOptionsDialog() override;
virtual void dispose() override;
// Window
virtual void Activate() override;
- sal_Int32 GetTransliterationFlags() const;
+ TransliterationFlags GetTransliterationFlags() const;
};
#endif
diff --git a/cui/source/options/cuisrchdlg.cxx b/cui/source/options/cuisrchdlg.cxx
index bff4d1a..0b3bf50 100644
--- a/cui/source/options/cuisrchdlg.cxx
+++ b/cui/source/options/cuisrchdlg.cxx
@@ -30,7 +30,6 @@
#include <sfx2/viewsh.hxx>
#include <sfx2/basedlgs.hxx>
#include <svl/cjkoptions.hxx>
-#include <com/sun/star/i18n/TransliterationModules.hpp>
#include "cuisrchdlg.hxx"
@@ -48,7 +47,7 @@
// class SvxJSearchOptionsDialog -----------------------------------------
SvxJSearchOptionsDialog::SvxJSearchOptionsDialog(vcl::Window *pParent,
- const SfxItemSet& rOptionsSet, sal_Int32 nInitialFlags)
+ const SfxItemSet& rOptionsSet, TransliterationFlags nInitialFlags)
: SfxSingleTabDialog(pParent, rOptionsSet)
, nInitialTlFlags( nInitialFlags )
{
@@ -77,7 +76,7 @@ void SvxJSearchOptionsDialog::Activate()
pPage->SetTransliterationFlags( nInitialTlFlags );
}
-sal_Int32 SvxJSearchOptionsDialog::GetTransliterationFlags() const
+TransliterationFlags SvxJSearchOptionsDialog::GetTransliterationFlags() const
{
return pPage->GetTransliterationFlags();
}
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index 99fcc3f..38c30f1b 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -25,7 +25,6 @@
#include <com/sun/star/container/XHierarchicalName.hpp>
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#include <com/sun/star/util/XChangesBatch.hpp>
-#include <com/sun/star/i18n/TransliterationModules.hpp>
#include <com/sun/star/util/SearchFlags.hpp>
#include <com/sun/star/util/SearchAlgorithms2.hpp>
#include <unotools/textsearch.hxx>
@@ -175,7 +174,7 @@ CuiAboutConfigTabPage::CuiAboutConfigTabPage( vcl::Window* pParent/*, const SfxI
aTabs[4] = aTabs[3] + fWidth * 8;
m_options.AlgorithmType2 = util::SearchAlgorithms2::ABSOLUTE;
- m_options.transliterateFlags |= i18n::TransliterationModules_IGNORE_CASE;
+ m_options.transliterateFlags |= TransliterationFlags::IGNORE_CASE;
m_options.searchFlag |= (util::SearchFlags::REG_NOT_BEGINOFLINE |
util::SearchFlags::REG_NOT_ENDOFLINE);
diff --git a/cui/source/options/optaboutconfig.hxx b/cui/source/options/optaboutconfig.hxx
index 91641d1..b33be65 100644
--- a/cui/source/options/optaboutconfig.hxx
+++ b/cui/source/options/optaboutconfig.hxx
@@ -12,8 +12,8 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/util/SearchOptions2.hpp>
+#include <i18nutil/searchopt.hxx>
#include <sfx2/tabdlg.hxx>
#include <svtools/simptabl.hxx>
#include <vcl/edit.hxx>
@@ -52,7 +52,7 @@ private:
VclPtr< SvSimpleTable > m_pPrefBox;
//for search
- css::util::SearchOptions2 m_options;
+ i18nutil::SearchOptions2 m_options;
SvTreeListEntries m_prefBoxEntries;
void AddToModifiedVector( const std::shared_ptr< Prop_Impl >& rProp );
diff --git a/cui/source/options/optjsearch.cxx b/cui/source/options/optjsearch.cxx
index ce5f61a..bbe587a 100644
--- a/cui/source/options/optjsearch.cxx
+++ b/cui/source/options/optjsearch.cxx
@@ -18,7 +18,7 @@
*/
#include <unotools/searchopt.hxx>
-#include <com/sun/star/i18n/TransliterationModules.hpp>
+#include <i18nutil/transliteration.hxx>
#include <cuires.hrc>
#include <dialmgr.hxx>
#include <optjsearch.hxx>
@@ -51,7 +51,7 @@ SvxJSearchOptionsPage::SvxJSearchOptionsPage( vcl::Window* pParent, const SfxIte
get( m_pIgnoreMiddleDot, "ignoremiddledot");
bSaveOptions = true;
- nTransliterationFlags = 0x00000000;
+ nTransliterationFlags = TransliterationFlags::NONE;
}
SvxJSearchOptionsPage::~SvxJSearchOptionsPage()
@@ -89,92 +89,92 @@ VclPtr<SfxTabPage> SvxJSearchOptionsPage::Create( vcl::Window* pParent, const Sf
}
-void SvxJSearchOptionsPage::SetTransliterationFlags( sal_Int32 nSettings )
+void SvxJSearchOptionsPage::SetTransliterationFlags( TransliterationFlags nSettings )
{
- bool bVal = 0 != (nSettings & TransliterationModules_IGNORE_CASE);
+ bool bVal(nSettings & TransliterationFlags::IGNORE_CASE);
m_pMatchCase ->Check( bVal ); //! treat as equal uppercase/lowercase
- bVal = 0 != (nSettings & TransliterationModules_IGNORE_WIDTH);
+ bVal = bool(nSettings & TransliterationFlags::IGNORE_WIDTH);
m_pMatchFullHalfWidth ->Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_IGNORE_KANA);
+ bVal = bool(nSettings & TransliterationFlags::IGNORE_KANA);
m_pMatchHiraganaKatakana ->Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreSize_ja_JP);
+ bVal = bool(nSettings & TransliterationFlags::ignoreSize_ja_JP);
m_pMatchContractions ->Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreMinusSign_ja_JP);
+ bVal = bool(nSettings & TransliterationFlags::ignoreMinusSign_ja_JP);
m_pMatchMinusDashChoon ->Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreIterationMark_ja_JP);
+ bVal = bool(nSettings & TransliterationFlags::ignoreIterationMark_ja_JP);
m_pMatchRepeatCharMarks ->Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreTraditionalKanji_ja_JP);
+ bVal = bool(nSettings & TransliterationFlags::ignoreTraditionalKanji_ja_JP);
m_pMatchVariantFormKanji ->Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreTraditionalKana_ja_JP);
+ bVal = bool(nSettings & TransliterationFlags::ignoreTraditionalKana_ja_JP);
m_pMatchOldKanaForms ->Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreZiZu_ja_JP);
+ bVal = bool(nSettings & TransliterationFlags::ignoreZiZu_ja_JP);
m_pMatchDiziDuzu ->Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreBaFa_ja_JP);
+ bVal = bool(nSettings & TransliterationFlags::ignoreBaFa_ja_JP);
m_pMatchBavaHafa ->Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreTiJi_ja_JP);
+ bVal = bool(nSettings & TransliterationFlags::ignoreTiJi_ja_JP);
m_pMatchTsithichiDhizi ->Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreHyuByu_ja_JP);
+ bVal = bool(nSettings & TransliterationFlags::ignoreHyuByu_ja_JP);
m_pMatchHyuiyuByuvyu ->Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreSeZe_ja_JP);
+ bVal = bool(nSettings & TransliterationFlags::ignoreSeZe_ja_JP);
m_pMatchSesheZeje ->Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreIandEfollowedByYa_ja_JP);
+ bVal = bool(nSettings & TransliterationFlags::ignoreIandEfollowedByYa_ja_JP);
m_pMatchIaiya ->Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreKiKuFollowedBySa_ja_JP);
+ bVal = bool(nSettings & TransliterationFlags::ignoreKiKuFollowedBySa_ja_JP);
m_pMatchKiku ->Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreSeparator_ja_JP);
+ bVal = bool(nSettings & TransliterationFlags::ignoreSeparator_ja_JP);
m_pIgnorePunctuation ->Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreSpace_ja_JP);
+ bVal = bool(nSettings & TransliterationFlags::ignoreSpace_ja_JP);
m_pIgnoreWhitespace ->Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreProlongedSoundMark_ja_JP);
+ bVal = bool(nSettings & TransliterationFlags::ignoreProlongedSoundMark_ja_JP);
m_pMatchProlongedSoundMark->Check( bVal );
- bVal = 0 != (nSettings & TransliterationModules_ignoreMiddleDot_ja_JP);
+ bVal = bool(nSettings & TransliterationFlags::ignoreMiddleDot_ja_JP);
m_pIgnoreMiddleDot ->Check( bVal );
nTransliterationFlags = nSettings;
}
-sal_Int32 SvxJSearchOptionsPage::GetTransliterationFlags_Impl()
+TransliterationFlags SvxJSearchOptionsPage::GetTransliterationFlags_Impl()
{
- sal_Int32 nTmp = 0;
+ TransliterationFlags nTmp = TransliterationFlags::NONE;
if (m_pMatchCase->IsChecked()) //! treat as equal uppercase/lowercase
- nTmp |= TransliterationModules_IGNORE_CASE;
+ nTmp |= TransliterationFlags::IGNORE_CASE;
if (m_pMatchFullHalfWidth->IsChecked())
- nTmp |= TransliterationModules_IGNORE_WIDTH;
+ nTmp |= TransliterationFlags::IGNORE_WIDTH;
if (m_pMatchHiraganaKatakana->IsChecked())
- nTmp |= TransliterationModules_IGNORE_KANA;
+ nTmp |= TransliterationFlags::IGNORE_KANA;
if (m_pMatchContractions->IsChecked())
- nTmp |= TransliterationModules_ignoreSize_ja_JP;
+ nTmp |= TransliterationFlags::ignoreSize_ja_JP;
if (m_pMatchMinusDashChoon->IsChecked())
- nTmp |= TransliterationModules_ignoreMinusSign_ja_JP;
+ nTmp |= TransliterationFlags::ignoreMinusSign_ja_JP;
if (m_pMatchRepeatCharMarks->IsChecked())
- nTmp |= TransliterationModules_ignoreIterationMark_ja_JP;
+ nTmp |= TransliterationFlags::ignoreIterationMark_ja_JP;
if (m_pMatchVariantFormKanji->IsChecked())
- nTmp |= TransliterationModules_ignoreTraditionalKanji_ja_JP;
+ nTmp |= TransliterationFlags::ignoreTraditionalKanji_ja_JP;
if (m_pMatchOldKanaForms->IsChecked())
- nTmp |= TransliterationModules_ignoreTraditionalKana_ja_JP;
+ nTmp |= TransliterationFlags::ignoreTraditionalKana_ja_JP;
if (m_pMatchDiziDuzu->IsChecked())
- nTmp |= TransliterationModules_ignoreZiZu_ja_JP;
+ nTmp |= TransliterationFlags::ignoreZiZu_ja_JP;
if (m_pMatchBavaHafa->IsChecked())
- nTmp |= TransliterationModules_ignoreBaFa_ja_JP;
+ nTmp |= TransliterationFlags::ignoreBaFa_ja_JP;
if (m_pMatchTsithichiDhizi->IsChecked())
- nTmp |= TransliterationModules_ignoreTiJi_ja_JP;
+ nTmp |= TransliterationFlags::ignoreTiJi_ja_JP;
if (m_pMatchHyuiyuByuvyu->IsChecked())
- nTmp |= TransliterationModules_ignoreHyuByu_ja_JP;
+ nTmp |= TransliterationFlags::ignoreHyuByu_ja_JP;
if (m_pMatchSesheZeje->IsChecked())
- nTmp |= TransliterationModules_ignoreSeZe_ja_JP;
+ nTmp |= TransliterationFlags::ignoreSeZe_ja_JP;
if (m_pMatchIaiya->IsChecked())
- nTmp |= TransliterationModules_ignoreIandEfollowedByYa_ja_JP;
+ nTmp |= TransliterationFlags::ignoreIandEfollowedByYa_ja_JP;
if (m_pMatchKiku->IsChecked())
- nTmp |= TransliterationModules_ignoreKiKuFollowedBySa_ja_JP;
+ nTmp |= TransliterationFlags::ignoreKiKuFollowedBySa_ja_JP;
if (m_pIgnorePunctuation->IsChecked())
- nTmp |= TransliterationModules_ignoreSeparator_ja_JP;
+ nTmp |= TransliterationFlags::ignoreSeparator_ja_JP;
if (m_pIgnoreWhitespace->IsChecked())
- nTmp |= TransliterationModules_ignoreSpace_ja_JP;
+ nTmp |= TransliterationFlags::ignoreSpace_ja_JP;
if (m_pMatchProlongedSoundMark->IsChecked())
- nTmp |= TransliterationModules_ignoreProlongedSoundMark_ja_JP;
+ nTmp |= TransliterationFlags::ignoreProlongedSoundMark_ja_JP;
if (m_pIgnoreMiddleDot->IsChecked())
- nTmp |= TransliterationModules_ignoreMiddleDot_ja_JP;
+ nTmp |= TransliterationFlags::ignoreMiddleDot_ja_JP;
nTransliterationFlags = nTmp;
return nTransliterationFlags;
@@ -234,7 +234,7 @@ void SvxJSearchOptionsPage::Reset( const SfxItemSet* )
bool SvxJSearchOptionsPage::FillItemSet( SfxItemSet* )
{
- sal_Int32 nOldVal = nTransliterationFlags;
+ TransliterationFlags nOldVal = nTransliterationFlags;
nTransliterationFlags = GetTransliterationFlags_Impl();
bool bModified = nOldVal != nTransliterationFlags;
diff --git a/cui/source/options/optjsearch.hxx b/cui/source/options/optjsearch.hxx
index 542e1c1..b6d7680 100644
--- a/cui/source/options/optjsearch.hxx
+++ b/cui/source/options/optjsearch.hxx
@@ -52,10 +52,12 @@ private:
VclPtr<CheckBox> m_pIgnoreWhitespace;
VclPtr<CheckBox> m_pIgnoreMiddleDot;
- sal_Int32 nTransliterationFlags;
- bool bSaveOptions;
+ TransliterationFlags
+ nTransliterationFlags;
+ bool bSaveOptions;
- sal_Int32 GetTransliterationFlags_Impl();
+ TransliterationFlags
+ GetTransliterationFlags_Impl();
public:
SvxJSearchOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet );
@@ -68,8 +70,9 @@ public:
void EnableSaveOptions( bool bVal ) { bSaveOptions = bVal; }
- sal_Int32 GetTransliterationFlags() const { return nTransliterationFlags; }
- void SetTransliterationFlags( sal_Int32 nSettings );
+ TransliterationFlags
+ GetTransliterationFlags() const { return nTransliterationFlags; }
+ void SetTransliterationFlags( TransliterationFlags nSettings );
};
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index dccbed4..d8a1341 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -472,12 +472,12 @@ LanguageType EditEngine::GetLanguage( sal_Int32 nPara, sal_Int32 nPos ) const
}
-void EditEngine::TransliterateText( const ESelection& rSelection, sal_Int32 nTransliterationMode )
+void EditEngine::TransliterateText( const ESelection& rSelection, TransliterationFlags nTransliterationMode )
{
pImpEditEngine->TransliterateText( pImpEditEngine->CreateSel( rSelection ), nTransliterationMode );
}
-EditSelection EditEngine::TransliterateText(const EditSelection& rSelection, sal_Int32 nTransliterationMode)
+EditSelection EditEngine::TransliterateText(const EditSelection& rSelection, TransliterationFlags nTransliterationMode)
{
return pImpEditEngine->TransliterateText(rSelection, nTransliterationMode);
}
diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx
index 925cf1f..30650d1 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -586,7 +586,7 @@ void EditUndoSetAttribs::ImpSetSelection( EditView* /*pView*/ )
pEE->GetActiveView()->GetImpEditView()->SetEditSelection(aSel);
}
-EditUndoTransliteration::EditUndoTransliteration(EditEngine* pEE, const ESelection& rESel, sal_Int32 nM) :
+EditUndoTransliteration::EditUndoTransliteration(EditEngine* pEE, const ESelection& rESel, TransliterationFlags nM) :
EditUndo(EDITUNDO_TRANSLITERATE, pEE),
aOldESel(rESel), nMode(nM), pTxtObj(nullptr) {}
diff --git a/editeng/source/editeng/editundo.hxx b/editeng/source/editeng/editundo.hxx
index 9e798a7..a21d609 100644
--- a/editeng/source/editeng/editundo.hxx
+++ b/editeng/source/editeng/editundo.hxx
@@ -29,6 +29,7 @@
class EditEngine;
class EditView;
enum class SetAttribsMode;
+enum class TransliterationFlags;
// EditUndoDelContent
@@ -250,13 +251,14 @@ private:
ESelection aOldESel;
ESelection aNewESel;
- sal_Int32 nMode;
+ TransliterationFlags
+ nMode;
std::unique_ptr<EditTextObject>
pTxtObj;
OUString aText;
public:
- EditUndoTransliteration(EditEngine* pEE, const ESelection& rESel, sal_Int32 nMode);
+ EditUndoTransliteration(EditEngine* pEE, const ESelection& rESel, TransliterationFlags nMode);
virtual ~EditUndoTransliteration() override;
void SetText( const OUString& rText ) { aText = rText; }
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 553fe19..e328805 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -734,7 +734,7 @@ EVAnchorMode EditView::GetAnchorMode() const
return pImpEditView->GetAnchorMode();
}
-void EditView::TransliterateText( sal_Int32 nTransliterationMode )
+void EditView::TransliterateText( TransliterationFlags nTransliterationMode )
{
EditSelection aOldSel( pImpEditView->GetEditSelection() );
EditSelection aNewSel = pImpEditView->pEditEngine->TransliterateText( pImpEditView->GetEditSelection(), nTransliterationMode );
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 51452ad..c047f51 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -995,7 +995,7 @@ public:
const OUString& GetAutoCompleteText() const { return aAutoCompleteText; }
void SetAutoCompleteText(const OUString& rStr, bool bUpdateTipWindow);
- EditSelection TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode );
+ EditSelection TransliterateText( const EditSelection& rSelection, TransliterationFlags nTransliterationMode );
short ReplaceTextOnly( ContentNode* pNode, sal_Int32 nCurrentStart, sal_Int32 nLen, const OUString& rText, const css::uno::Sequence< sal_Int32 >& rOffsets );
void SetAsianCompressionMode( CharCompressType n );
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 7d52278..80cfabf 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -67,8 +67,6 @@
#include <com/sun/star/linguistic2/XMeaning.hpp>
#include <com/sun/star/i18n/ScriptType.hpp>
#include <com/sun/star/i18n/WordType.hpp>
-#include <com/sun/star/i18n/TransliterationModules.hpp>
-#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
#include <unotools/transliterationwrapper.hxx>
#include <unotools/textsearch.hxx>
#include <comphelper/processfactory.hxx>
@@ -2603,7 +2601,7 @@ bool ImpEditEngine::Search( const SvxSearchItem& rSearchItem, EditView* pEditVie
bool ImpEditEngine::ImpSearch( const SvxSearchItem& rSearchItem,
const EditSelection& rSearchSelection, const EditPaM& rStartPos, EditSelection& rFoundSel )
{
- util::SearchOptions2 aSearchOptions( rSearchItem.GetSearchOptions() );
+ i18nutil::SearchOptions2 aSearchOptions( rSearchItem.GetSearchOptions() );
aSearchOptions.Locale = GetLocale( rStartPos );
bool bBack = rSearchItem.GetBackward();
@@ -2710,7 +2708,7 @@ namespace
};
}
-EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode )
+EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, TransliterationFlags nTransliterationMode )
{
uno::Reference < i18n::XBreakIterator > _xBI( ImplGetBreakIterator() );
if (!_xBI.is())
@@ -2761,7 +2759,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
std::vector< eeTransliterationChgData > aChanges;
eeTransliterationChgData aChgData;
- if (nTransliterationMode == i18n::TransliterationModulesExtra::TITLE_CASE)
+ if (nTransliterationMode == TransliterationFlags::TITLE_CASE)
{
// for 'capitalize every word' we need to iterate over each word
@@ -2826,7 +2824,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
}
DBG_ASSERT( nCurrentEnd >= aEndBndry.endPos, "failed to reach end of transliteration" );
}
- else if (nTransliterationMode == i18n::TransliterationModulesExtra::SENTENCE_CASE)
+ else if (nTransliterationMode == TransliterationFlags::SENTENCE_CASE)
{
// for 'sentence case' we need to iterate sentence by sentence
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index fdd66c3..dbf222d 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/lang/Locale.hpp>
#include <tools/urlobj.hxx>
#include <i18nlangtag/mslangid.hxx>
+#include <i18nutil/transliteration.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <sot/storinfo.hxx>
@@ -214,8 +215,8 @@ static TransliterationWrapper& GetIgnoreTranslWrapper()
{
static int bIsInit = 0;
static TransliterationWrapper aWrp( ::comphelper::getProcessComponentContext(),
- css::i18n::TransliterationModules_IGNORE_KANA |
- css::i18n::TransliterationModules_IGNORE_WIDTH );
+ TransliterationFlags::IGNORE_KANA |
+ TransliterationFlags::IGNORE_WIDTH );
if( !bIsInit )
{
aWrp.loadModuleIfNeeded( GetAppLang().getLanguageType() );
diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx
index bf061d3..a08eb17 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -1293,7 +1293,7 @@ sal_Int32 OutlinerView::StartSearchAndReplace( const SvxSearchItem& rSearchItem
return pEditView->StartSearchAndReplace( rSearchItem );
}
-void OutlinerView::TransliterateText( sal_Int32 nTransliterationMode )
+void OutlinerView::TransliterateText( TransliterationFlags nTransliterationMode )
{
pEditView->TransliterateText( nTransliterationMode );
}
diff --git a/forms/source/xforms/computedexpression.cxx b/forms/source/xforms/computedexpression.cxx
index 68975c2..96d9812 100644
--- a/forms/source/xforms/computedexpression.cxx
+++ b/forms/source/xforms/computedexpression.cxx
@@ -31,6 +31,7 @@
#include <osl/diagnose.h>
+#include <i18nutil/searchopt.hxx>
#include <unotools/textsearch.hxx>
#include <comphelper/processfactory.hxx>
@@ -40,7 +41,6 @@ using com::sun::star::xml::xpath::XXPathAPI;
using com::sun::star::xml::xpath::XPathExtension;
using com::sun::star::xml::xpath::XXPathExtension;
using com::sun::star::xml::xpath::XPathObjectType_XPATH_UNDEFINED;
-using com::sun::star::util::SearchOptions2;
namespace xforms
@@ -74,7 +74,7 @@ bool ComputedExpression::_checkExpression( const sal_Char* pExpression ) const
assert(pExpression && "no expression?");
// call RegExp engine
- SearchOptions2 aSearchOptions;
+ i18nutil::SearchOptions2 aSearchOptions;
aSearchOptions.AlgorithmType2 = css::util::SearchAlgorithms2::REGEXP;
aSearchOptions.searchString = OUString( pExpression, strlen(pExpression), RTL_TEXTENCODING_ASCII_US );
utl::TextSearch aTextSearch( aSearchOptions );
diff --git a/i18npool/inc/transliteration_caseignore.hxx b/i18npool/inc/transliteration_caseignore.hxx
index 93c91ea..dff9a94 100644
--- a/i18npool/inc/transliteration_caseignore.hxx
+++ b/i18npool/inc/transliteration_caseignore.hxx
@@ -49,7 +49,7 @@ public:
const OUString& s2) override;
protected:
- TransliterationModules moduleLoaded;
+ TransliterationFlags moduleLoaded;
private:
/// @throws css::uno::RuntimeException
sal_Int32 SAL_CALL compare(
diff --git a/i18npool/qa/cppunit/test_textsearch.cxx b/i18npool/qa/cppunit/test_textsearch.cxx
index a5a6243..1118b5a 100644
--- a/i18npool/qa/cppunit/test_textsearch.cxx
+++ b/i18npool/qa/cppunit/test_textsearch.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/util/XTextSearch2.hpp>
#include <com/sun/star/i18n/Transliteration.hpp>
#include <unotest/bootstrapfixturebase.hxx>
+#include <i18nutil/transliteration.hxx>
#include <unicode/regex.h>
@@ -127,8 +128,8 @@ void TestTextSearch::testSearches()
CPPUNIT_ASSERT_EQUAL( bStartRes, aRes.startOffset[0] );
CPPUNIT_ASSERT_EQUAL( bEndRes, aRes.endOffset[0] );
- aOptions.transliterateFlags = ::css::i18n::TransliterationModules::TransliterationModules_IGNORE_CASE
- | ::css::i18n::TransliterationModules::TransliterationModules_IGNORE_WIDTH;
+ aOptions.transliterateFlags = (sal_Int32) (TransliterationFlags::IGNORE_CASE
+ | TransliterationFlags::IGNORE_WIDTH);
aOptions.searchString = "([^ ]*)[ ]*([^ ]*)";
m_xSearch->setOptions(aOptions);
aRes = m_xSearch->searchForward("11 22 33", 2, 7);
diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
index 847434d..e9a3e29 100644
--- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
+++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
@@ -56,7 +56,6 @@
#include <rtl/ustrbuf.hxx>
#include <com/sun/star/i18n/XTransliteration.hpp>
#include <com/sun/star/i18n/TransliterationType.hpp>
-#include <com/sun/star/i18n/TransliterationModulesNew.hpp>
#include <com/sun/star/i18n/XLocaleData.hpp>
#include <bullet.h>
diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx
index f1e09da..6eef20d 100644
--- a/i18npool/source/search/textsearch.cxx
+++ b/i18npool/source/search/textsearch.cxx
@@ -36,6 +36,7 @@
#include <cppuhelper/factory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/weak.hxx>
+#include <i18nutil/transliteration.hxx>
#include <rtl/ustrbuf.hxx>
#include <sal/log.hxx>
@@ -54,56 +55,56 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::i18n;
using namespace ::com::sun::star;
-const sal_Int32 COMPLEX_TRANS_MASK =
- TransliterationModules_ignoreBaFa_ja_JP |
- TransliterationModules_ignoreIterationMark_ja_JP |
- TransliterationModules_ignoreTiJi_ja_JP |
- TransliterationModules_ignoreHyuByu_ja_JP |
- TransliterationModules_ignoreSeZe_ja_JP |
- TransliterationModules_ignoreIandEfollowedByYa_ja_JP |
- TransliterationModules_ignoreKiKuFollowedBySa_ja_JP |
- TransliterationModules_ignoreProlongedSoundMark_ja_JP;
+const TransliterationFlags COMPLEX_TRANS_MASK =
+ TransliterationFlags::ignoreBaFa_ja_JP |
+ TransliterationFlags::ignoreIterationMark_ja_JP |
+ TransliterationFlags::ignoreTiJi_ja_JP |
+ TransliterationFlags::ignoreHyuByu_ja_JP |
+ TransliterationFlags::ignoreSeZe_ja_JP |
+ TransliterationFlags::ignoreIandEfollowedByYa_ja_JP |
+ TransliterationFlags::ignoreKiKuFollowedBySa_ja_JP |
+ TransliterationFlags::ignoreProlongedSoundMark_ja_JP;
namespace
{
-sal_Int32 maskComplexTrans( sal_Int32 n )
+TransliterationFlags maskComplexTrans( TransliterationFlags n )
{
// IGNORE_KANA and FULLWIDTH_HALFWIDTH are simple but need to take effect
// in complex transliteration.
return
n & (COMPLEX_TRANS_MASK | // all set ignore bits
- TransliterationModules_IGNORE_KANA | // plus IGNORE_KANA bit
- TransliterationModules_FULLWIDTH_HALFWIDTH); // and the FULLWIDTH_HALFWIDTH value
+ TransliterationFlags::IGNORE_KANA | // plus IGNORE_KANA bit
+ TransliterationFlags::FULLWIDTH_HALFWIDTH); // and the FULLWIDTH_HALFWIDTH value
}
-bool isComplexTrans( sal_Int32 n )
+bool isComplexTrans( TransliterationFlags n )
{
- return n & COMPLEX_TRANS_MASK;
+ return bool(n & COMPLEX_TRANS_MASK);
}
-sal_Int32 maskSimpleTrans( sal_Int32 n )
+TransliterationFlags maskSimpleTrans( TransliterationFlags n )
{
return n & ~COMPLEX_TRANS_MASK;
}
-bool isSimpleTrans( sal_Int32 n )
+bool isSimpleTrans( TransliterationFlags n )
{
- return maskSimpleTrans(n) != 0;
+ return bool(maskSimpleTrans(n));
}
// Regex patterns are case sensitive.
-sal_Int32 maskSimpleRegexTrans( sal_Int32 n )
+TransliterationFlags maskSimpleRegexTrans( TransliterationFlags n )
{
- sal_Int32 m = (n & TransliterationModules_IGNORE_MASK) & ~TransliterationModules_IGNORE_CASE;
- sal_Int32 v = n & TransliterationModules_NON_IGNORE_MASK;
- if (v == TransliterationModules_UPPERCASE_LOWERCASE || v == TransliterationModules_LOWERCASE_UPPERCASE)
- v = 0;
+ TransliterationFlags m = (n & TransliterationFlags::IGNORE_MASK) & ~TransliterationFlags::IGNORE_CASE;
+ TransliterationFlags v = n & TransliterationFlags::NON_IGNORE_MASK;
+ if (v == TransliterationFlags::UPPERCASE_LOWERCASE || v == TransliterationFlags::LOWERCASE_UPPERCASE)
+ v = TransliterationFlags::NONE;
return (m | v) & ~COMPLEX_TRANS_MASK;
}
-bool isSimpleRegexTrans( sal_Int32 n )
+bool isSimpleRegexTrans( TransliterationFlags n )
{
- return maskSimpleRegexTrans(n) != 0;
+ return bool(maskSimpleRegexTrans(n));
}
};
@@ -144,27 +145,28 @@ void TextSearch::setOptions2( const SearchOptions2& rOptions )
pJumpTable2 = nullptr;
maWildcardReversePattern.clear();
maWildcardReversePattern2.clear();
+ TransliterationFlags transliterateFlags = (TransliterationFlags) aSrchPara.transliterateFlags;
// Create Transliteration class
- if( isSimpleTrans( aSrchPara.transliterateFlags) )
+ if( isSimpleTrans( transliterateFlags) )
{
if( !xTranslit.is() )
xTranslit.set( Transliteration::create( m_xContext ) );
xTranslit->loadModule(
- (TransliterationModules) maskSimpleTrans( aSrchPara.transliterateFlags),
+ (TransliterationModules)maskSimpleTrans(transliterateFlags),
aSrchPara.Locale);
}
else if( xTranslit.is() )
xTranslit = nullptr;
// Create Transliteration for 2<->1, 2<->2 transliteration
- if ( isComplexTrans( aSrchPara.transliterateFlags) )
+ if ( isComplexTrans( transliterateFlags) )
{
if( !xTranslit2.is() )
xTranslit2.set( Transliteration::create( m_xContext ) );
// Load transliteration module
xTranslit2->loadModule(
- (TransliterationModules) maskComplexTrans( aSrchPara.transliterateFlags),
+ (TransliterationModules) maskComplexTrans(transliterateFlags),
aSrchPara.Locale);
}
@@ -176,17 +178,17 @@ void TextSearch::setOptions2( const SearchOptions2& rOptions )
// Transliterate search string.
if (aSrchPara.AlgorithmType2 == SearchAlgorithms2::REGEXP)
{
- if (isSimpleRegexTrans( aSrchPara.transliterateFlags))
+ if (isSimpleRegexTrans(transliterateFlags))
{
- if (maskSimpleRegexTrans( aSrchPara.transliterateFlags) !=
- maskSimpleTrans( aSrchPara.transliterateFlags))
+ if (maskSimpleRegexTrans(transliterateFlags) !=
+ maskSimpleTrans(transliterateFlags))
{
css::uno::Reference< XExtendedTransliteration > xTranslitPattern(
Transliteration::create( m_xContext ));
if (xTranslitPattern.is())
{
xTranslitPattern->loadModule(
- (TransliterationModules) maskSimpleRegexTrans( aSrchPara.transliterateFlags),
+ (TransliterationModules) maskSimpleRegexTrans(transliterateFlags),
aSrchPara.Locale);
sSrchStr = xTranslitPattern->transliterateString2String(
aSrchPara.searchString, 0, aSrchPara.searchString.getLength());
@@ -205,11 +207,11 @@ void TextSearch::setOptions2( const SearchOptions2& rOptions )
}
else
{
- if ( xTranslit.is() && isSimpleTrans( aSrchPara.transliterateFlags) )
+ if ( xTranslit.is() && isSimpleTrans(transliterateFlags) )
sSrchStr = xTranslit->transliterateString2String(
aSrchPara.searchString, 0, aSrchPara.searchString.getLength());
- if ( xTranslit2.is() && isComplexTrans( aSrchPara.transliterateFlags) )
+ if ( xTranslit2.is() && isComplexTrans(transliterateFlags) )
sSrchStr2 = xTranslit2->transliterateString2String(
aSrchPara.searchString, 0, aSrchPara.searchString.getLength());
}
@@ -827,10 +829,11 @@ SearchResult TextSearch::NSrchBkwrd( const OUString& searchStr, sal_Int32 startP
void TextSearch::RESrchPrepare( const css::util::SearchOptions2& rOptions)
{
+ TransliterationFlags transliterateFlags = (TransliterationFlags)rOptions.transliterateFlags;
// select the transliterated pattern string
const OUString& rPatternStr =
- (isSimpleTrans( rOptions.transliterateFlags) ? sSrchStr
- : (isComplexTrans( rOptions.transliterateFlags) ? sSrchStr2 : rOptions.searchString));
+ (isSimpleTrans(transliterateFlags) ? sSrchStr
+ : (isComplexTrans(transliterateFlags) ? sSrchStr2 : rOptions.searchString));
sal_uInt32 nIcuSearchFlags = UREGEX_UWORD; // request UAX#29 unicode capability
// map css::util::SearchFlags to ICU uregex.h flags
@@ -842,7 +845,7 @@ void TextSearch::RESrchPrepare( const css::util::SearchOptions2& rOptions)
// Note that the search flag ALL_IGNORE_CASE is deprecated in UNO
// probably because the transliteration flag IGNORE_CASE handles it as well.
if( (rOptions.searchFlag & css::util::SearchFlags::ALL_IGNORE_CASE) != 0
- || (rOptions.transliterateFlags & TransliterationModules_IGNORE_CASE) != 0)
+ || (transliterateFlags & TransliterationFlags::IGNORE_CASE))
nIcuSearchFlags |= UREGEX_CASE_INSENSITIVE;
UErrorCode nIcuErr = U_ZERO_ERROR;
// assumption: transliteration didn't mangle regexp control chars
diff --git a/i18npool/source/transliteration/transliteration_caseignore.cxx b/i18npool/source/transliteration/transliteration_caseignore.cxx
index e6f0061e..9ac4712 100644
--- a/i18npool/source/transliteration/transliteration_caseignore.cxx
+++ b/i18npool/source/transliteration/transliteration_caseignore.cxx
@@ -22,6 +22,7 @@
#include <i18nutil/oneToOneMapping.hxx>
#include <i18nutil/casefolding.hxx>
+#include <i18nutil/transliteration.hxx>
#include "transliteration_caseignore.hxx"
@@ -33,7 +34,7 @@ namespace com { namespace sun { namespace star { namespace i18n {
Transliteration_caseignore::Transliteration_caseignore()
{
nMappingType = MappingType::FullFolding;
- moduleLoaded = (TransliterationModules)0;
+ moduleLoaded = TransliterationFlags::NONE;
transliterationName = "case ignore (generic)";
implementationName = "com.sun.star.i18n.Transliteration.Transliteration_caseignore";
}
@@ -41,7 +42,7 @@ Transliteration_caseignore::Transliteration_caseignore()
void SAL_CALL
Transliteration_caseignore::loadModule( TransliterationModules modName, const Locale& rLocale )
{
- moduleLoaded = (TransliterationModules) (moduleLoaded|modName);
+ moduleLoaded |= (TransliterationFlags)modName;
aLocale = rLocale;
}
diff --git a/i18nutil/source/utility/casefolding.cxx b/i18nutil/source/utility/casefolding.cxx
index 22bce09..1f6c060 100644
--- a/i18nutil/source/utility/casefolding.cxx
+++ b/i18nutil/source/utility/casefolding.cxx
@@ -20,6 +20,7 @@
#include "i18nutil/casefolding.hxx"
#include "casefolding_data.h"
#include "i18nutil/widthfolding.hxx"
+#include "i18nutil/transliteration.hxx"
using namespace com::sun::star::lang;
using namespace com::sun::star::uno;
@@ -129,7 +130,7 @@ is_ja_voice_sound_mark(sal_Unicode& current, sal_Unicode next)
return c != 0;
}
-sal_Unicode casefolding::getNextChar(const sal_Unicode *str, sal_Int32& idx, sal_Int32 len, MappingElement& e, Locale& aLocale, MappingType nMappingType, TransliterationModules moduleLoaded)
+sal_Unicode casefolding::getNextChar(const sal_Unicode *str, sal_Int32& idx, sal_Int32 len, MappingElement& e, Locale& aLocale, MappingType nMappingType, TransliterationFlags moduleLoaded)
{
if( idx >= len )
{
@@ -139,7 +140,7 @@ sal_Unicode casefolding::getNextChar(const sal_Unicode *str, sal_Int32& idx, sal
sal_Unicode c;
- if (moduleLoaded & TransliterationModules_IGNORE_CASE) {
+ if (moduleLoaded & TransliterationFlags::IGNORE_CASE) {
if( e.current >= e.element.nmap ) {
e.element = getValue(str, idx++, len, aLocale, nMappingType);
e.current = 0;
@@ -149,13 +150,13 @@ sal_Unicode casefolding::getNextChar(const sal_Unicode *str, sal_Int32& idx, sal
c = *(str + idx++);
}
- if (moduleLoaded & TransliterationModules_IGNORE_KANA) {
+ if (moduleLoaded & TransliterationFlags::IGNORE_KANA) {
if ((0x3040 <= c && c <= 0x3094) || (0x309d <= c && c <= 0x309f))
c += 0x60;
}
// composition: KA + voice-mark --> GA. see halfwidthToFullwidth.cxx for detail
- if (moduleLoaded & TransliterationModules_IGNORE_WIDTH) {
+ if (moduleLoaded & TransliterationFlags::IGNORE_WIDTH) {
static oneToOneMapping& half2fullTable = widthfolding::gethalf2fullTable();
c = half2fullTable[c];
if (0x3040 <= c && c <= 0x30ff && idx < len &&
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx
index 921b60f..b9ce522 100644
--- a/include/editeng/editeng.hxx
+++ b/include/editeng/editeng.hxx
@@ -110,7 +110,7 @@ struct EPaM;
class DeletedNodeInfo;
class ParaPortionList;
enum class CharCompressType;
-
+enum class TransliterationFlags;
/** values for:
SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs::All );
@@ -253,8 +253,8 @@ public:
LanguageType GetLanguage(const EditPaM& rPaM) const;
LanguageType GetLanguage( sal_Int32 nPara, sal_Int32 nPos ) const;
- void TransliterateText( const ESelection& rSelection, sal_Int32 nTransliterationMode );
- EditSelection TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode );
+ void TransliterateText( const ESelection& rSelection, TransliterationFlags nTransliterationMode );
+ EditSelection TransliterateText( const EditSelection& rSelection, TransliterationFlags nTransliterationMode );
void SetAsianCompressionMode( CharCompressType nCompression );
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index adabc65..15e53a1 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -58,6 +58,7 @@ class SfxStyleSheet;
namespace vcl { class Font; }
class FontList;
class OutputDevice;
+enum class TransliterationFlags;
namespace com {
namespace sun {
@@ -224,7 +225,7 @@ public:
// for text conversion
void StartTextConversion( LanguageType nSrcLang, LanguageType nDestLang, const vcl::Font *pDestFont, sal_Int32 nOptions, bool bIsInteractive, bool bMultipleDoc );
- void TransliterateText( sal_Int32 nTransliterationMode );
+ void TransliterateText( TransliterationFlags nTransliterationMode );
bool IsCursorAtWrongSpelledWord();
bool IsWrongSpelledWordAtPos( const Point& rPosPixel, bool bMarkIfWrong = false );
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 2c1f781..034de47 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -47,7 +47,6 @@
#include <editeng/paragraphdata.hxx>
#include <o3tl/typed_flags_set.hxx>
-
#include <functional>
#include <vector>
@@ -84,26 +83,25 @@ class OverflowingText;
class NonOverflowingText;
class OutlinerViewShell;
enum class CharCompressType;
+enum class TransliterationFlags;
+class SvxFieldData;
namespace svl
{
class IUndoManager;
}
-
-class SvxFieldData;
-
-
namespace com { namespace sun { namespace star { namespace linguistic2 {
class XSpellChecker1;
class XHyphenator;
}}}}
namespace svx{
-struct SpellPortion;
-typedef std::vector<SpellPortion> SpellPortions;
+ struct SpellPortion;
+ typedef std::vector<SpellPortion> SpellPortions;
}
-
namespace basegfx { class B2DPolyPolygon; }
+
+
// internal use only!
enum class ParaFlag
{
@@ -300,7 +298,7 @@ public:
// for text conversion
void StartTextConversion( LanguageType nSrcLang, LanguageType nDestLang, const vcl::Font *pDestFont, sal_Int32 nOptions, bool bIsInteractive, bool bMultipleDoc );
- void TransliterateText( sal_Int32 nTransliterationMode );
+ void TransliterateText( TransliterationFlags nTransliterationMode );
ESelection GetSelection();
diff --git a/include/i18nutil/casefolding.hxx b/include/i18nutil/casefolding.hxx
index 31a6d4f..493875a 100644
--- a/include/i18nutil/casefolding.hxx
+++ b/include/i18nutil/casefolding.hxx
@@ -20,12 +20,13 @@
#define INCLUDED_I18NUTIL_CASEFOLDING_HXX
#include <sal/types.h>
-#include <com/sun/star/i18n/TransliterationModules.hpp>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <i18nutil/i18nutildllapi.h>
#include <o3tl/typed_flags_set.hxx>
+enum class TransliterationFlags;
+
enum class MappingType {
NONE = 0x00,
LowerToUpper = 0x01, // Upper to Lower mapping
@@ -77,7 +78,7 @@ public:
/// @throws css::uno::RuntimeException
static Mapping& getConditionalValue(const sal_Unicode* str, sal_Int32 pos, sal_Int32 len, css::lang::Locale& aLocale, MappingType nMappingType);
/// @throws css::uno::RuntimeException
- static sal_Unicode getNextChar(const sal_Unicode *str, sal_Int32& idx, sal_Int32 len, MappingElement& e, css::lang::Locale& aLocale, MappingType nMappingtype, TransliterationModules moduleLoaded);
+ static sal_Unicode getNextChar(const sal_Unicode *str, sal_Int32& idx, sal_Int32 len, MappingElement& e, css::lang::Locale& aLocale, MappingType nMappingtype, TransliterationFlags moduleLoaded);
};
diff --git a/include/i18nutil/searchopt.hxx b/include/i18nutil/searchopt.hxx
new file mode 100644
index 0000000..5fc8b1a
--- /dev/null
+++ b/include/i18nutil/searchopt.hxx
@@ -0,0 +1,142 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef INCLUDED_I18NUTIL_SEARCHOPT_HXX
+#define INCLUDED_I18NUTIL_SEARCHOPT_HXX
+
+#include <sal/types.h>
+#include "com/sun/star/lang/Locale.hpp"
+#include "com/sun/star/util/SearchAlgorithms.hpp"
+#include "com/sun/star/util/SearchOptions2.hpp"
+#include <i18nutil/i18nutildllapi.h>
+#include <i18nutil/transliteration.hxx>
+
+namespace i18nutil
+{
+
+/**
+ * This is a wrapper around com::sun::star::util::SearchOptions
+ * but using the more type-safe TransliterationFlags enum.
+ */
+struct I18NUTIL_DLLPUBLIC SAL_WARN_UNUSED SearchOptions {
+ css::util::SearchAlgorithms algorithmType;
+ sal_Int32 searchFlag;
+ OUString searchString;
+ OUString replaceString;
+ css::lang::Locale Locale;
+ sal_Int32 changedChars;
+ sal_Int32 deletedChars;
+ sal_Int32 insertedChars;
+ TransliterationFlags transliterateFlags;
+
+ SearchOptions& operator=(css::util::SearchOptions const & other)
+ {
+ algorithmType = other.algorithmType;
+ searchFlag = other.searchFlag;
+ searchString = other.searchString;
+ replaceString = other.replaceString;
+ Locale = other.Locale;
+ changedChars = other.changedChars;
+ deletedChars = other.deletedChars;
+ insertedChars = other.insertedChars;
+ transliterateFlags = (TransliterationFlags)other.transliterateFlags;
+ return *this;
+ }
+
+ SearchOptions()
+ : algorithmType(::css::util::SearchAlgorithms_ABSOLUTE)
+ , searchFlag(0)
+ , searchString()
+ , replaceString()
+ , Locale()
+ , changedChars(0)
+ , deletedChars(0)
+ , insertedChars(0)
+ , transliterateFlags(TransliterationFlags::NONE)
+ {
+ }
+
+ SearchOptions(const css::util::SearchAlgorithms& algorithmType_, const sal_Int32 searchFlag_,
+ const OUString& searchString_, const OUString& replaceString_,
+ const css::lang::Locale& Locale_,
+ const sal_Int32 changedChars_, const sal_Int32 deletedChars_, const sal_Int32 insertedChars_,
+ const TransliterationFlags& transliterateFlags_)
+ : algorithmType(algorithmType_)
+ , searchFlag(searchFlag_)
+ , searchString(searchString_)
+ , replaceString(replaceString_)
+ , Locale(Locale_)
+ , changedChars(changedChars_)
+ , deletedChars(deletedChars_)
+ , insertedChars(insertedChars_)
+ , transliterateFlags(transliterateFlags_)
+ {
+ }
+};
+
+/**
+ * This is a wrapper around com::sun::star::util::SearchOptions and SearchOptions2,
+ * but using the more type-safe TransliterationFlags enum.
+ */
+struct I18NUTIL_DLLPUBLIC SAL_WARN_UNUSED SearchOptions2 : public SearchOptions {
+
+ sal_Int16 AlgorithmType2;
+ sal_Int32 WildcardEscapeCharacter;
+
+ SearchOptions2& operator=(css::util::SearchOptions2 const & other)
+ {
+ SearchOptions::operator=(other);
+ AlgorithmType2 = other.AlgorithmType2;
+ WildcardEscapeCharacter = other.WildcardEscapeCharacter;
+ return *this;
+ }
+
+
+ css::util::SearchOptions2 toUnoSearchOptions2() const
+ {
+ return css::util::SearchOptions2(algorithmType, searchFlag,
+ searchString, replaceString,
+ Locale,
+ changedChars, deletedChars, insertedChars,
+ (sal_Int32)transliterateFlags,
+ AlgorithmType2, WildcardEscapeCharacter);
+ }
+
+ SearchOptions2()
+ : SearchOptions()
+ , AlgorithmType2(0)
+ , WildcardEscapeCharacter(0)
+ {}
+
+ SearchOptions2(const css::util::SearchAlgorithms& algorithmType_, const sal_Int32 searchFlag_,
+ const OUString& searchString_, const OUString& replaceString_,
+ const css::lang::Locale& Locale_,
+ const sal_Int32 changedChars_, const sal_Int32 deletedChars_, const sal_Int32 insertedChars_,
+ const TransliterationFlags& transliterateFlags_,
+ const sal_Int16 AlgorithmType2_, const sal_Int32 WildcardEscapeCharacter_)
+ : SearchOptions(algorithmType_, searchFlag_, searchString_, replaceString_, Locale_, changedChars_, deletedChars_, insertedChars_, transliterateFlags_)
+ , AlgorithmType2(AlgorithmType2_)
+ , WildcardEscapeCharacter(WildcardEscapeCharacter_)
+ {}
+};
+
+}; // namespace
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/i18nutil/transliteration.hxx b/include/i18nutil/transliteration.hxx
new file mode 100644
index 0000000..b8cafa6
--- /dev/null
+++ b/include/i18nutil/transliteration.hxx
@@ -0,0 +1,132 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef INCLUDED_I18NUTIL_TRANSLITERATION_HXX
+#define INCLUDED_I18NUTIL_TRANSLITERATION_HXX
+
+#include <sal/types.h>
+#include <com/sun/star/i18n/TransliterationModules.hpp>
+#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
+#include <o3tl/typed_flags_set.hxx>
+
+/**
+ * This is a superset type of the com::sun::star::i18n::TransliterationModules and TransliterationModulesExtra,
+ * with some extra type checking
+ */
+enum class TransliterationFlags {
+ NONE = 0,
+ /// Transliterate a string from upper case to lower case
+ UPPERCASE_LOWERCASE = css::i18n::TransliterationModules_UPPERCASE_LOWERCASE,
+ /// Transliterate a string from lower case to upper case
+ LOWERCASE_UPPERCASE = css::i18n::TransliterationModules_LOWERCASE_UPPERCASE,
+ /// Transliterate a string from half width character to full width character
+ HALFWIDTH_FULLWIDTH = css::i18n::TransliterationModules_HALFWIDTH_FULLWIDTH,
+ /// Transliterate a string from full width character to half width character
+ FULLWIDTH_HALFWIDTH = css::i18n::TransliterationModules_FULLWIDTH_HALFWIDTH,
+ /// Transliterate a Japanese string from Katakana to Hiragana
+ KATAKANA_HIRAGANA = css::i18n::TransliterationModules_KATAKANA_HIRAGANA,
+ /// Transliterate a Japanese string from Hiragana to Katakana
+ HIRAGANA_KATAKANA = css::i18n::TransliterationModules_HIRAGANA_KATAKANA,
+ /// Transliterate an ASCII number string to Simplified Chinese lower case number string in spellout format
+ NumToTextLower_zh_CN = css::i18n::TransliterationModules_NumToTextLower_zh_CN,
+ /// Transliterate an ASCII number string to Simplified Chinese upper case number string in spellout format
+ NumToTextUpper_zh_CN = css::i18n::TransliterationModules_NumToTextUpper_zh_CN,
+ /// Transliterate an ASCII number string to Traditional Chinese lower case number string in spellout format
+ NumToTextLower_zh_TW = css::i18n::TransliterationModules_NumToTextLower_zh_TW,
+ /// Transliterate an ASCII number string to Traditional Chinese upper case number string in spellout format
+ NumToTextUpper_zh_TW = css::i18n::TransliterationModules_NumToTextUpper_zh_TW,
+ /// Transliterate an ASCII number string to formal Korean Hangul number string in spellout format
+ NumToTextFormalHangul_ko = css::i18n::TransliterationModules_NumToTextFormalHangul_ko,
+ /// Transliterate an ASCII number string to formal Korean Hanja lower case number string in spellout format
+ NumToTextFormalLower_ko = css::i18n::TransliterationModules_NumToTextFormalLower_ko,
+ /// Transliterate an ASCII number string to formal Korean Hanja upper case number string in spellout format
+ NumToTextFormalUpper_ko = css::i18n::TransliterationModules_NumToTextFormalUpper_ko,
+
+ /** The first character of the sentence is put in upper case
+ */
+ SENTENCE_CASE = css::i18n::TransliterationModulesExtra::SENTENCE_CASE,
+
+
+ /** The first character of the word is put in upper case.
+ * This one is part
+ */
+ TITLE_CASE = css::i18n::TransliterationModulesExtra::TITLE_CASE,
+
+
+ /** All characters of the word are to change their case from small letters
+ * to capital letters and vice versa.
+ */
+ TOGGLE_CASE = css::i18n::TransliterationModulesExtra::TOGGLE_CASE,
+
+ NON_IGNORE_MASK = css::i18n::TransliterationModules_NON_IGNORE_MASK,
+ IGNORE_MASK = 0x7fffff00,
+
+ /// Ignore case when comparing strings by transliteration service
+ IGNORE_CASE = css::i18n::TransliterationModules_IGNORE_CASE,
+ /// Ignore Hiragana and Katakana when comparing strings by transliteration service
+ IGNORE_KANA = css::i18n::TransliterationModules_IGNORE_KANA, // ja_JP
+ /// Ignore full width and half width character when comparing strings by transliteration service
+ IGNORE_WIDTH = css::i18n::TransliterationModules_IGNORE_WIDTH, // ja_JP
+ /// Ignore Japanese traditional Kanji character in Japanese fuzzy search
+ ignoreTraditionalKanji_ja_JP = css::i18n::TransliterationModules_ignoreTraditionalKanji_ja_JP,
+ /// Ignore Japanese traditional Katakana and Hiragana character in Japanese fuzzy search
+ ignoreTraditionalKana_ja_JP = css::i18n::TransliterationModules_ignoreTraditionalKana_ja_JP,
+ /// Ignore dash or minus sign in Japanese fuzzy search
+ ignoreMinusSign_ja_JP = css::i18n::TransliterationModules_ignoreMinusSign_ja_JP,
+ /// Ignore Hiragana and Katakana iteration mark in Japanese fuzzy search
+ ignoreIterationMark_ja_JP = css::i18n::TransliterationModules_ignoreIterationMark_ja_JP,
+ /// Ignore separator punctuations in Japanese fuzzy search
+ ignoreSeparator_ja_JP = css::i18n::TransliterationModules_ignoreSeparator_ja_JP,
+ /// Ignore Katakana and Hiragana Zi/Zi and Zu/Zu in Japanese fuzzy search
+ ignoreZiZu_ja_JP = css::i18n::TransliterationModules_ignoreZiZu_ja_JP,
+ /// Ignore Katakana and Hiragana Ba/Gua and Ha/Fa in Japanese fuzzy search
+ ignoreBaFa_ja_JP = css::i18n::TransliterationModules_ignoreBaFa_ja_JP,
+ /// Ignore Katakana and Hiragana Tsui/Tea/Ti and Dyi/Ji in Japanese fuzzy search
+ ignoreTiJi_ja_JP = css::i18n::TransliterationModules_ignoreTiJi_ja_JP,
+ /// Ignore Katakana and Hiragana Hyu/Fyu and Byu/Gyu in Japanese fuzzy search
+ ignoreHyuByu_ja_JP = css::i18n::TransliterationModules_ignoreHyuByu_ja_JP,
+ /// Ignore Katakana and Hiragana Se/Sye and Ze/Je in Japanese fuzzy search
+ ignoreSeZe_ja_JP = css::i18n::TransliterationModules_ignoreSeZe_ja_JP,
+ /// Ignore Katakana YA/A which follows the character in either I or E row in Japanese fuzzy search
+ ignoreIandEfollowedByYa_ja_JP = css::i18n::TransliterationModules_ignoreIandEfollowedByYa_ja_JP,
+ /// Ignore Katakana KI/KU which follows the character in SA column in Japanese fuzzy search
+ ignoreKiKuFollowedBySa_ja_JP = css::i18n::TransliterationModules_ignoreKiKuFollowedBySa_ja_JP,
+ /// Ignore Japanese normal and small sized character in Japanese fuzzy search
+ ignoreSize_ja_JP = css::i18n::TransliterationModules_ignoreSize_ja_JP,
+ /// Ignore Japanese prolonged sound mark in Japanese fuzzy search
+ ignoreProlongedSoundMark_ja_JP = css::i18n::TransliterationModules_ignoreProlongedSoundMark_ja_JP,
+ /// Ignore middle dot in Japanese fuzzy search
+ ignoreMiddleDot_ja_JP = css::i18n::TransliterationModules_ignoreMiddleDot_ja_JP,
+ /// Ignore white space characters, include space, TAB, return, etc. in Japanese fuzzy search
+ ignoreSpace_ja_JP = css::i18n::TransliterationModules_ignoreSpace_ja_JP,
+ /// transliterate Japanese small sized character to normal sized character
+ smallToLarge_ja_JP = css::i18n::TransliterationModules_smallToLarge_ja_JP,
+ /// transliterate Japanese normal sized character to small sized character
+ largeToSmall_ja_JP = css::i18n::TransliterationModules_largeToSmall_ja_JP,
+
+ IGNORE_DIACRITICS_CTL = css::i18n::TransliterationModulesExtra::IGNORE_DIACRITICS_CTL,
+ IGNORE_KASHIDA_CTL = css::i18n::TransliterationModulesExtra::IGNORE_KASHIDA_CTL
+};
+namespace o3tl {
+ template<> struct typed_flags<TransliterationFlags> : is_typed_flags<TransliterationFlags, 0x7fffffff> {};
+}
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svl/ondemand.hxx b/include/svl/ondemand.hxx
index 69139b9..2eeebda 100644
--- a/include/svl/ondemand.hxx
+++ b/include/svl/ondemand.hxx
@@ -27,11 +27,11 @@
#include <unotools/collatorwrapper.hxx>
#include <com/sun/star/i18n/CollatorOptions.hpp>
#include <unotools/transliterationwrapper.hxx>
-#include <com/sun/star/i18n/TransliterationModules.hpp>
#include <unotools/nativenumberwrapper.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <comphelper/processfactory.hxx>
+#include <i18nutil/transliteration.hxx>
/*
On demand instantiation and initialization of several i18n wrappers,
@@ -190,7 +190,7 @@ class OnDemandTransliterationWrapper
{
css::uno::Reference< css::uno::XComponentContext > m_xContext;
LanguageType eLanguage;
- css::i18n::TransliterationModules nType;
+ TransliterationFlags nType;
mutable std::unique_ptr<::utl::TransliterationWrapper>
pPtr;
mutable bool bValid;
@@ -199,7 +199,7 @@ class OnDemandTransliterationWrapper
public:
OnDemandTransliterationWrapper()
: eLanguage( LANGUAGE_SYSTEM )
- , nType(css::i18n::TransliterationModules_END_OF_MODULE)
+ , nType(TransliterationFlags::NONE)
, pPtr(nullptr)
, bValid(false)
, bInitialized(false)
@@ -213,7 +213,7 @@ public:
)
{
m_xContext = rxContext;
- nType = css::i18n::TransliterationModules_IGNORE_CASE;
+ nType = TransliterationFlags::IGNORE_CASE;
changeLocale( eLang );
pPtr.reset();
bInitialized = true;
diff --git a/include/svl/srchitem.hxx b/include/svl/srchitem.hxx
index 2be6271..1f6d555 100644
--- a/include/svl/srchitem.hxx
+++ b/include/svl/srchitem.hxx
@@ -22,10 +22,10 @@
#include <sal/config.h>
#include <svl/svldllapi.h>
#include <com/sun/star/util/XSearchDescriptor.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 <i18nutil/transliteration.hxx>
+#include <i18nutil/searchopt.hxx>
#include <unotools/configitem.hxx>
#include <rsc/rscsfx.hxx>
#include <svl/poolitem.hxx>
@@ -63,7 +63,7 @@ class SVL_DLLPUBLIC SvxSearchItem :
public SfxPoolItem,
public utl::ConfigItem
{
- css::util::SearchOptions2 m_aSearchOpt;
+ i18nutil::SearchOptions2 m_aSearchOpt;
SfxStyleFamily m_eFamily; // style family
@@ -180,12 +180,13 @@ public:
inline sal_uInt16 GetLEVLonger() const;
inline void SetLEVLonger(sal_uInt16 nSet);
- inline const css::util::SearchOptions2 &
+ inline const i18nutil::SearchOptions2 &
GetSearchOptions() const;
- inline void SetSearchOptions( const css::util::SearchOptions2 &rOpt );
+ inline void SetSearchOptions( const i18nutil::SearchOptions2 &rOpt );
- inline sal_Int32 GetTransliterationFlags() const;
- void SetTransliterationFlags( sal_Int32 nFlags );
+ inline TransliterationFlags
+ GetTransliterationFlags() const;
+ void SetTransliterationFlags( TransliterationFlags nFlags );
inline bool IsMatchFullHalfWidthForms() const;
void SetMatchFullHalfWidthForms( bool bVal );
@@ -227,7 +228,7 @@ bool SvxSearchItem::GetWordOnly() const
bool SvxSearchItem::GetExact() const
{
- return 0 == (m_aSearchOpt.transliterateFlags & css::i18n::TransliterationModules_IGNORE_CASE);
+ return !(m_aSearchOpt.transliterateFlags & TransliterationFlags::IGNORE_CASE);
}
bool SvxSearchItem::GetSelection() const
@@ -298,24 +299,24 @@ bool SvxSearchItem::IsLevenshtein() const
return m_aSearchOpt.AlgorithmType2 == css::util::SearchAlgorithms2::APPROXIMATE;
}
-const css::util::SearchOptions2 & SvxSearchItem::GetSearchOptions() const
+const i18nutil::SearchOptions2 & SvxSearchItem::GetSearchOptions() const
{
return m_aSearchOpt;
}
-void SvxSearchItem::SetSearchOptions( const css::util::SearchOptions2 &rOpt )
+void SvxSearchItem::SetSearchOptions( const i18nutil::SearchOptions2 &rOpt )
{
m_aSearchOpt = rOpt;
}
-sal_Int32 SvxSearchItem::GetTransliterationFlags() const
+TransliterationFlags SvxSearchItem::GetTransliterationFlags() const
{
return m_aSearchOpt.transliterateFlags;
}
bool SvxSearchItem::IsMatchFullHalfWidthForms() const
{
- return 0 != (m_aSearchOpt.transliterateFlags & css::i18n::TransliterationModules_IGNORE_WIDTH);
+ return bool(m_aSearchOpt.transliterateFlags & TransliterationFlags::IGNORE_WIDTH);
}
#endif
diff --git a/include/svx/fmsrccfg.hxx b/include/svx/fmsrccfg.hxx
index 55dbdf9..2366d5b 100644
--- a/include/svx/fmsrccfg.hxx
+++ b/include/svx/fmsrccfg.hxx
@@ -24,6 +24,7 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <svx/svxdllapi.h>
+enum class TransliterationFlags;
#define MATCHING_ANYWHERE 0
#define MATCHING_BEGINNING 1
@@ -46,7 +47,8 @@ namespace svxform
struct SVX_DLLPUBLIC FmSearchParams
{
protected:
- sal_Int32 nTransliterationFlags;
+ TransliterationFlags
+ nTransliterationFlags;
// they're way too sensitive for direct access ....
public:
@@ -77,8 +79,9 @@ namespace svxform
bool isIgnoreWidthCJK( ) const;
- sal_Int32 getTransliterationFlags( ) const { return nTransliterationFlags; }
- void setTransliterationFlags( sal_Int32 _nFlags ) { nTransliterationFlags = _nFlags; }
+ TransliterationFlags
+ getTransliterationFlags( ) const { return nTransliterationFlags; }
+ void setTransliterationFlags( TransliterationFlags _nFlags ) { nTransliterationFlags = _nFlags; }
bool isCaseSensitive( ) const;
void setCaseSensitive( bool _bCase );
diff --git a/include/svx/fmsrcimp.hxx b/include/svx/fmsrcimp.hxx
index 5eaaf4e..a569335 100644
--- a/include/svx/fmsrcimp.hxx
+++ b/include/svx/fmsrcimp.hxx
@@ -38,6 +38,8 @@
#include <deque>
#include <vector>
+enum class TransliterationFlags;
+
/**
* struct FmSearchProgress - the owner of SearchEngine receives this structure for status updates
* (at the end of the search)
@@ -211,7 +213,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC FmSearchEngine final
sal_uInt16 m_nPosition; // if not regular or levenshtein, then one of the MATCHING_... values
- sal_Int32 m_nTransliterationFlags;
+ TransliterationFlags m_nTransliterationFlags;
// member access
@@ -253,8 +255,9 @@ public:
sal_uInt16 GetLevLonger() const { return m_nLevLonger; }
// all Lev. values will only be considered in case of m_bLevenshtein==sal_True
- void SetTransliterationFlags(sal_Int32 _nFlags) { m_nTransliterationFlags = _nFlags; }
- sal_Int32 GetTransliterationFlags() const { return m_nTransliterationFlags; }
+ void SetTransliterationFlags(TransliterationFlags _nFlags) { m_nTransliterationFlags = _nFlags; }
+ TransliterationFlags
+ GetTransliterationFlags() const { return m_nTransliterationFlags; }
void SetPosition(sal_uInt16 nValue) { m_nPosition = nValue; }
sal_uInt16 GetPosition() const { return m_nPosition; }
diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx
index 25798fd..3a0b1f9 100644
--- a/include/svx/srchdlg.hxx
+++ b/include/svx/srchdlg.hxx
@@ -40,6 +40,8 @@ class SvxJSearchOptionsPage;
class SvxSearchController;
struct SearchDlg_Impl;
enum class ModifyFlags;
+enum class TransliterationFlags;
+
struct SearchAttrItem
{
@@ -133,7 +135,7 @@ public:
const SearchAttrItemList* GetReplaceItemList() const
{ return pReplaceList; }
- sal_Int32 GetTransliterationFlags() const;
+ TransliterationFlags GetTransliterationFlags() const;
void SetDocWin( vcl::Window* pDocWin ) { mpDocWin = pDocWin; }
vcl::Window* GetDocWin() { return mpDocWin; }
@@ -231,7 +233,8 @@ private:
SvxSearchController* pSearchSetController;
SvxSearchController* pReplaceSetController;
- mutable sal_Int32 nTransliterationFlags;
+ mutable TransliterationFlags
+ nTransliterationFlags;
DECL_LINK( ModifyHdl_Impl, Edit&, void );
DECL_LINK( FlagHdl_Impl, Button*, void );
@@ -264,7 +267,7 @@ private:
void SetModifyFlag_Impl( const Control* pCtrl );
void SaveToModule_Impl();
- void ApplyTransliterationFlags_Impl( sal_Int32 nSettings );
+ void ApplyTransliterationFlags_Impl( TransliterationFlags nSettings );
};
#endif
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index b9e6eb4..a88bed5 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -24,9 +24,6 @@
#include <svx/zoom_def.hxx>
#include <editeng/edtdlg.hxx>
-class SdrModel;
-class SdrView;
-
#include <svx/dstribut_enum.hxx>
#include <svx/rectenum.hxx>
#include <com/sun/star/container/XIndexContainer.hpp>
@@ -42,11 +39,10 @@ namespace linguistic2{
class XThesaurus;
class XHyphenator;
}}}}
-
+class SdrModel;
+class SdrView;
class SvxSpellWrapper;
-typedef VclPtr<SfxTabPage> (*CreateSvxDistributePage)(vcl::Window *pParent, const SfxItemSet &rAttrSet, SvxDistributeHorizontal eHor, SvxDistributeVertical eVer);
-typedef const sal_uInt16* (*DialogGetRanges)();
-
+enum class TransliterationFlags;
struct ExchangeData;
class INetURLObject;
class GalleryTheme;
@@ -58,6 +54,9 @@ class SdrObject;
class SvxSpellWrapper;
struct FmSearchContext;
+typedef VclPtr<SfxTabPage> (*CreateSvxDistributePage)(vcl::Window *pParent, const SfxItemSet &rAttrSet, SvxDistributeHorizontal eHor, SvxDistributeVertical eVer);
+typedef const sal_uInt16* (*DialogGetRanges)();
+
typedef ::std::vector< OUString > TargetList;
namespace svx{ class SpellDialogChildWindow;}
@@ -163,7 +162,7 @@ class AbstractSvxJSearchOptionsDialog :public VclAbstractDialog
protected:
virtual ~AbstractSvxJSearchOptionsDialog() override = default;
public:
- virtual sal_Int32 GetTransliterationFlags() const = 0;
+ virtual TransliterationFlags GetTransliterationFlags() const = 0;
};
class AbstractFmInputRecordNoDialog :public VclAbstractDialog
@@ -396,7 +395,7 @@ public:
)=0;
virtual VclPtr<AbstractSvxJSearchOptionsDialog> CreateSvxJSearchOptionsDialog( vcl::Window* pParent,
const SfxItemSet& rOptionsSet,
- sal_Int32 nInitialFlags )=0;
+ TransliterationFlags nInitialFlags )=0;
virtual VclPtr<AbstractFmInputRecordNoDialog> CreateFmInputRecordNoDialog() = 0;
virtual VclPtr<AbstractSvxNewDictionaryDialog> CreateSvxNewDictionaryDialog( vcl::Window* pParent ) = 0;
virtual VclPtr<VclAbstractDialog> CreateSvxEditDictionaryDialog( vcl::Window* pParent,
diff --git a/include/unotools/caserotate.hxx b/include/unotools/caserotate.hxx
index 36a93b1..adc26a6 100644
--- a/include/unotools/caserotate.hxx
+++ b/include/unotools/caserotate.hxx
@@ -10,9 +10,10 @@
#define INCLUDED_UNOTOOLS_CASEROTATE_HXX
#include <sal/config.h>
-
#include <unotools/unotoolsdllapi.h>
+enum class TransliterationFlags;
+
//TODO Use XCharacterClassification::getStringType to determine the current
//(possibly mixed) case type and rotate to the next one
@@ -24,7 +25,7 @@ public:
RotateTransliteration() : nF3ShiftCounter(0)
{
}
- sal_uInt32 getNextMode();
+ TransliterationFlags getNextMode();
};
#endif
diff --git a/include/unotools/searchopt.hxx b/include/unotools/searchopt.hxx
index fe8509b..6b432190 100644
--- a/include/unotools/searchopt.hxx
+++ b/include/unotools/searchopt.hxx
@@ -24,6 +24,7 @@
#include <memory>
class SvtSearchOptions_Impl;
+enum class TransliterationFlags;
class UNOTOOLS_DLLPUBLIC SvtSearchOptions
{
@@ -38,7 +39,7 @@ public:
void Commit();
- sal_Int32 GetTransliterationFlags() const;
+ TransliterationFlags GetTransliterationFlags() const;
// General Options
diff --git a/include/unotools/textsearch.hxx b/include/unotools/textsearch.hxx
index 145e660..71048c2 100644
--- a/include/unotools/textsearch.hxx
+++ b/include/unotools/textsearch.hxx
@@ -26,7 +26,6 @@
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/util/XTextSearch2.hpp>
-#include <com/sun/star/util/SearchOptions2.hpp>
class CharClass;
@@ -39,6 +38,11 @@ namespace com {
}
}
}
+namespace i18nutil {
+ struct SearchOptions;
+ struct SearchOptions2;
+}
+enum class TransliterationFlags;
namespace utl
{
@@ -107,7 +111,7 @@ private:
int nLEV_LongerZ;
// asian flags - used for the transliteration
- long nTransliterationFlags;
+ TransliterationFlags nTransliterationFlags;
public:
SearchParam( const OUString &rText,
@@ -132,7 +136,7 @@ public:
// signed return for API use
sal_Int32 GetWildEscChar() const { return static_cast<sal_Int32>(m_cWildEscChar); }
- long GetTransliterationFlags() const { return nTransliterationFlags; }
+ TransliterationFlags GetTransliterationFlags() const { return nTransliterationFlags; }
};
// Utility class for searching a substring in a string.
@@ -147,7 +151,7 @@ public:
class UNOTOOLS_DLLPUBLIC TextSearch
{
static css::uno::Reference< css::util::XTextSearch2 >
- getXTextSearch( const css::util::SearchOptions2& rPara );
+ getXTextSearch( const i18nutil::SearchOptions2& rPara );
css::uno::Reference < css::util::XTextSearch2 >
xTextSearch;
@@ -161,7 +165,7 @@ public:
TextSearch( const SearchParam & rPara, LanguageType nLanguage );
TextSearch( const SearchParam & rPara, const CharClass& rCClass );
- TextSearch( const css::util::SearchOptions2& rPara );
+ TextSearch( const i18nutil::SearchOptions2& rPara );
~TextSearch();
/* search in the (selected) text the search string:
@@ -190,7 +194,7 @@ public:
sal_Int32* pStart, sal_Int32* pEnd,
css::util::SearchResult* pRes = nullptr );
- void SetLocale( const css::util::SearchOptions2& rOpt,
+ void SetLocale( const i18nutil::SearchOptions2& rOpt,
const css::lang::Locale& rLocale );
/* replace back references in the replace string by the sub expressions from the search result */
@@ -200,7 +204,7 @@ public:
SearchOptions2 yet. Better fix your module if you want to support
wildcard search.
*/
- static css::util::SearchOptions2 UpgradeToSearchOptions2( const css::util::SearchOptions& rOptions );
+ static i18nutil::SearchOptions2 UpgradeToSearchOptions2( const i18nutil::SearchOptions& rOptions );
};
diff --git a/include/unotools/transliterationwrapper.hxx b/include/unotools/transliterationwrapper.hxx
index 2c2caa7..7508386 100644
--- a/include/unotools/transliterationwrapper.hxx
+++ b/include/unotools/transliterationwrapper.hxx
@@ -30,6 +30,7 @@ namespace com { namespace sun { namespace star {
class XComponentContext;
}
}}}
+enum class TransliterationFlags;
namespace utl
{
@@ -38,7 +39,7 @@ class UNOTOOLS_DLLPUBLIC TransliterationWrapper
{
css::uno::Reference< css::i18n::XExtendedTransliteration > xTrans;
LanguageTag aLanguageTag;
- sal_uInt32 nType;
+ TransliterationFlags nType;
mutable bool bFirstCall;
TransliterationWrapper( const TransliterationWrapper& ) = delete;
@@ -49,11 +50,11 @@ class UNOTOOLS_DLLPUBLIC TransliterationWrapper
public:
TransliterationWrapper( const css::uno::Reference< css::uno::XComponentContext > & rxContext,
- sal_uInt32 nType );
+ TransliterationFlags nType );
~TransliterationWrapper();
- sal_uInt32 getType() const { return nType; }
+ TransliterationFlags getType() const { return nType; }
bool needLanguageForTheMode() const;
diff --git a/include/vcl/textview.hxx b/include/vcl/textview.hxx
index 5937e90..435295d 100644
--- a/include/vcl/textview.hxx
+++ b/include/vcl/textview.hxx
@@ -47,6 +47,9 @@ namespace com { namespace sun { namespace star {
struct SearchOptions;
}
}}}
+namespace i18nutil {
+ struct SearchOptions;
+}
struct ImpTextView;
@@ -204,8 +207,8 @@ public:
bool MatchGroup();
- bool Search( const css::util::SearchOptions& rSearchOptions, bool bForward );
- sal_uInt16 Replace( const css::util::SearchOptions& rSearchOptions, bool bAll, bool bForward );
+ bool Search( const i18nutil::SearchOptions& rSearchOptions, bool bForward );
+ sal_uInt16 Replace( const i18nutil::SearchOptions& rSearchOptions, bool bAll, bool bForward );
bool IndentBlock();
bool UnindentBlock();
diff --git a/include/vcl/xtextedt.hxx b/include/vcl/xtextedt.hxx
index 3db5f6c..23b0d05 100644
--- a/include/vcl/xtextedt.hxx
+++ b/include/vcl/xtextedt.hxx
@@ -40,7 +40,7 @@ public:
virtual ~ExtTextEngine() override;
TextSelection MatchGroup( const TextPaM& rCursor ) const;
- bool Search( TextSelection& rSel, const css::util::SearchOptions& rSearchOptions, bool bForward = true );
+ bool Search( TextSelection& rSel, const i18nutil::SearchOptions& rSearchOptions, bool bForward = true );
};
#endif // INCLUDED_VCL_XTEXTEDT_HXX
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index bb111ce..32c4801 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -32,6 +32,7 @@
#include "uistrings.hrc"
#include "reportformula.hxx"
+#include <i18nutil/searchopt.hxx>
#include <unotools/textsearch.hxx>
#include <unotools/configmgr.hxx>
@@ -58,7 +59,6 @@
#include <com/sun/star/sdb/FilterDialog.hpp>
#include <com/sun/star/sdb/SQLContext.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
-#include <com/sun/star/util/SearchOptions2.hpp>
#include <com/sun/star/util/SearchAlgorithms2.hpp>
#include <com/sun/star/util/MeasureUnit.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
@@ -1889,7 +1889,7 @@ bool GeometryHandler::impl_isDefaultFunction_nothrow( const uno::Reference< repo
try
{
const OUString sFormula( _xFunction->getFormula() );
- util::SearchOptions2 aSearchOptions;
+ i18nutil::SearchOptions2 aSearchOptions;
aSearchOptions.AlgorithmType2 = util::SearchAlgorithms2::REGEXP;
aSearchOptions.searchFlag = 0x00000100;
::std::vector< DefaultFunction >::const_iterator aIter = m_aDefaultFunctions.begin();
@@ -2108,7 +2108,7 @@ bool GeometryHandler::impl_isCounterFunction_throw(const OUString& _sQuotedFunct
if ( aInitalFormula.IsPresent )
{
const OUString sFormula( aFind.first->second.first->getFormula() );
- util::SearchOptions2 aSearchOptions;
+ i18nutil::SearchOptions2 aSearchOptions;
aSearchOptions.AlgorithmType2 = util::SearchAlgorithms2::REGEXP;
aSearchOptions.searchFlag = 0x00000100;
aSearchOptions.searchString = m_aCounterFunction.m_sSearchString;
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index a18b2ea..4b05b6a 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1496,7 +1496,7 @@ public:
InsertDeleteFlags nFlags, ScPasteFunc nFunction,
bool bSkipEmpty, bool bAsLink );
- void TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nType );
+ void TransliterateText( const ScMarkData& rMultiMark, TransliterationFlags nType );
SC_DLLPUBLIC void InitUndo( ScDocument* pSrcDoc, SCTAB nTab1, SCTAB nTab2,
bool bColInfo = false, bool bRowInfo = false );
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 77f929f..dd3fadf 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -37,12 +37,10 @@ struct ScCalcConfig;
enum class SvtScriptType;
enum class FormulaError : sal_uInt16;
-#define SC_COLLATOR_IGNORES ( \
- css::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE )
+#define SC_COLLATOR_IGNORES css::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE
-#define SC_TRANSLITERATION_IGNORECASE ( \
- css::i18n::TransliterationModules_IGNORE_CASE )
-#define SC_TRANSLITERATION_CASESENSE 0
+#define SC_TRANSLITERATION_IGNORECASE TransliterationFlags::IGNORE_CASE
+#define SC_TRANSLITERATION_CASESENSE TransliterationFlags::NONE
// Calc has lots of names...
// Clipboard names are in so3/soapp.hxx now
diff --git a/sc/inc/viewutil.hxx b/sc/inc/viewutil.hxx
index 2819ace..af37b96 100644
--- a/sc/inc/viewutil.hxx
+++ b/sc/inc/viewutil.hxx
@@ -27,7 +27,6 @@ class SfxBindings;
class SvxFontItem;
class SfxViewShell;
class SfxViewFrame;
-
class ScChangeAction;
class ScChangeViewSettings;
class ScDocument;
@@ -35,6 +34,9 @@ class ScAddress;
class ScRange;
class ScMarkData;
enum class SvtScriptType;
+enum class TransliterationFlags;
+
+
enum class ScUpdateMode { All, Marks };
class SC_DLLPUBLIC ScViewUtil
@@ -54,7 +56,7 @@ public:
static sal_uInt16 GetEffLanguage( ScDocument* pDoc, const ScAddress& rPos );
- static sal_Int32 GetTransliterationType( sal_uInt16 nSlotID );
+ static TransliterationFlags GetTransliterationType( sal_uInt16 nSlotID );
static bool HasFiltered( const ScRange& rRange, ScDocument* pDoc );
/** Fit a range to cover nRows number of unfiltered rows.
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index c715c5e..cf0e984 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -94,8 +94,6 @@
#include <utility>
#include <vector>
-#include <com/sun/star/i18n/TransliterationModules.hpp>
-
struct TestImpl
{
ScDocShellRef m_xDocShell;
@@ -5912,7 +5910,7 @@ void Test::testTransliterateText()
aMark.SetMarkArea(ScRange(0,0,0,0,2,0));
ScDocFunc& rFunc = getDocShell().GetDocFunc();
rFunc.TransliterateText(
- aMark, i18n::TransliterationModules_LOWERCASE_UPPERCASE, true);
+ aMark, TransliterationFlags::LOWERCASE_UPPERCASE, true);
CPPUNIT_ASSERT_EQUAL(OUString("MIKE"), m_pDoc->GetString(ScAddress(0,0,0)));
CPPUNIT_ASSERT_EQUAL(OUString("NOAH"), m_pDoc->GetString(ScAddress(0,1,0)));
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 30bcf98..59c611e 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -45,8 +45,6 @@
#include <vcl/virdev.hxx>
#include <vcl/msgbox.hxx>
-#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
-
#include "inputopt.hxx"
#include "global.hxx"
#include "table.hxx"
@@ -1184,7 +1182,7 @@ SfxBindings* ScDocument::GetViewBindings()
return nullptr;
}
-void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nType )
+void ScDocument::TransliterateText( const ScMarkData& rMultiMark, TransliterationFlags nType )
{
OSL_ENSURE( rMultiMark.IsMultiMarked(), "TransliterateText: no selection" );
@@ -1216,7 +1214,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp
// for performance reasons.
if (aCell.meType == CELLTYPE_EDIT ||
(aCell.meType == CELLTYPE_STRING &&
- ( nType == i18n::TransliterationModulesExtra::SENTENCE_CASE || nType == i18n::TransliterationModulesExtra::TITLE_CASE)))
+ ( nType == TransliterationFlags::SENTENCE_CASE || nType == TransliterationFlags::TITLE_CASE)))
{
if (!pEngine)
pEngine.reset(new ScFieldEditEngine(this, GetEnginePool(), GetEditPool()));
diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index 7cf1557..2d38b7b 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <com/sun/star/i18n/TransliterationModules.hpp>
-
#include <unotools/textsearch.hxx>
#include <svl/srchitem.hxx>
#include <editeng/editobj.hxx>
@@ -800,7 +798,7 @@ bool ScTable::SearchAndReplace(
else
{
// SearchParam no longer needed - SearchOptions contains all settings
- css::util::SearchOptions2 aSearchOptions = rSearchItem.GetSearchOptions();
+ i18nutil::SearchOptions2 aSearchOptions = rSearchItem.GetSearchOptions();
aSearchOptions.Locale = *ScGlobal::GetLocale();
if (aSearchOptions.searchString.isEmpty() || ( rSearchItem.GetRegExp() && aSearchOptions.searchString == "^$" ) )
@@ -814,8 +812,8 @@ bool ScTable::SearchAndReplace(
// This is also done in SvxSearchDialog CommandHdl, but not in API object.
if ( !rSearchItem.IsUseAsianOptions() )
aSearchOptions.transliterateFlags &=
- ( css::i18n::TransliterationModules_IGNORE_CASE |
- css::i18n::TransliterationModules_IGNORE_WIDTH );
+ ( TransliterationFlags::IGNORE_CASE |
+ TransliterationFlags::IGNORE_WIDTH );
pSearchText = new utl::TextSearch( aSearchOptions );
diff --git a/sc/source/core/tool/cellkeytranslator.cxx b/sc/source/core/tool/cellkeytranslator.cxx
index 013e640..8ccae17 100644
--- a/sc/source/core/tool/cellkeytranslator.cxx
+++ b/sc/source/core/tool/cellkeytranslator.cxx
@@ -21,11 +21,10 @@
#include <comphelper/processfactory.hxx>
#include <i18nlangtag/mslangid.hxx>
#include <i18nlangtag/lang.h>
+#include <i18nutil/transliteration.hxx>
#include <rtl/ustring.hxx>
#include <unotools/syslocale.hxx>
-#include <com/sun/star/i18n/TransliterationModules.hpp>
-
using ::com::sun::star::uno::Sequence;
using ::std::list;
@@ -171,7 +170,7 @@ void ScCellKeywordTranslator::transKeyword(OUString& rName, const lang::Locale*
ScCellKeywordTranslator::ScCellKeywordTranslator() :
maTransWrapper( ::comphelper::getProcessComponentContext(),
- i18n::TransliterationModules_LOWERCASE_UPPERCASE )
+ TransliterationFlags::LOWERCASE_UPPERCASE )
{
init();
}
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 626c9b3..57c1586 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -3338,7 +3338,7 @@ void ScInterpreter::ScChar()
static OUString lcl_convertIntoHalfWidth( const OUString & rStr )
{
static bool bFirstASCCall = true;
- static utl::TransliterationWrapper aTrans( ::comphelper::getProcessComponentContext(), 0 );
+ static utl::TransliterationWrapper aTrans( ::comphelper::getProcessComponentContext(), TransliterationFlags::NONE );
if( bFirstASCCall )
{
@@ -3352,7 +3352,7 @@ static OUString lcl_convertIntoHalfWidth( const OUString & rStr )
static OUString lcl_convertIntoFullWidth( const OUString & rStr )
{
static bool bFirstJISCall = true;
- static utl::TransliterationWrapper aTrans( ::comphelper::getProcessComponentContext(), 0 );
+ static utl::TransliterationWrapper aTrans( ::comphelper::getProcessComponentContext(), TransliterationFlags::NONE );
if( bFirstJISCall )
{
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 5273985..f2d85bc 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -714,7 +714,7 @@ bool ScDocFunc::DeleteCell(
return true;
}
-bool ScDocFunc::TransliterateText( const ScMarkData& rMark, sal_Int32 nType,
+bool ScDocFunc::TransliterateText( const ScMarkData& rMark, TransliterationFlags nType,
bool bApi )
{
ScDocShellModificator aModificator( rDocShell );
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 34e2f3b..7d35de7 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -1188,8 +1188,8 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
void ScDrawTextObjectBar::ExecuteTrans( SfxRequest& rReq )
{
- sal_Int32 nType = ScViewUtil::GetTransliterationType( rReq.GetSlot() );
- if ( nType )
+ TransliterationFlags nType = ScViewUtil::GetTransliterationType( rReq.GetSlot() );
+ if ( nType != TransliterationFlags::NONE )
{
ScDrawView* pView = pViewData->GetScDrawView();
OutlinerView* pOutView = pView->GetTextEditOutlinerView();
diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx
index 0c5f198..d3ec7e9 100644
--- a/sc/source/ui/inc/docfunc.hxx
+++ b/sc/source/ui/inc/docfunc.hxx
@@ -46,11 +46,10 @@ struct ScCellMergeOption;
class ScConditionalFormat;
class ScConditionalFormatList;
class ScUndoRemoveMerge;
+enum class TransliterationFlags;
namespace sc {
-
-struct ColRowSpan;
-
+ struct ColRowSpan;
}
class ScDocFunc
@@ -92,7 +91,7 @@ public:
bool DeleteCell(
const ScAddress& rPos, const ScMarkData& rMark, InsertDeleteFlags nFlags, bool bRecord );
- bool TransliterateText( const ScMarkData& rMark, sal_Int32 nType,
+ bool TransliterateText( const ScMarkData& rMark, TransliterationFlags nType,
bool bApi );
bool SetNormalString( bool& o_rbNumFmtSet, const ScAddress& rPos, const OUString& rText, bool bApi );
diff --git a/sc/source/ui/inc/undoblk.hxx b/sc/source/ui/inc/undoblk.hxx
index 4be768e..76e4433 100644
--- a/sc/source/ui/inc/undoblk.hxx
+++ b/sc/source/ui/inc/undoblk.hxx
@@ -846,7 +846,7 @@ class ScUndoTransliterate: public ScBlockUndo
{
public:
ScUndoTransliterate( ScDocShell* pNewDocShell, const ScMarkData& rMark,
- ScDocument* pNewUndoDoc, sal_Int32 nType );
+ ScDocument* pNewUndoDoc, TransliterationFlags nType );
virtual ~ScUndoTransliterate() override;
virtual void Undo() override;
@@ -860,7 +860,8 @@ private:
ScMarkData aMarkData;
std::unique_ptr<ScDocument>
pUndoDoc;
- sal_Int32 nTransliterationType;
+ TransliterationFlags
+ nTransliterationType;
};
class ScUndoClearItems: public ScBlockUndo
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 59f7af2..57f9a27 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -231,7 +231,7 @@ public:
void FillCrossDblClick();
void ConvertFormulaToValue();
- void TransliterateText( sal_Int32 nType );
+ void TransliterateText( TransliterationFlags nType );
ScAutoFormatData* CreateAutoFormatData();
void AutoFormat( sal_uInt16 nFormatNo );
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 46b5d47..8ab8095 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -1913,7 +1913,7 @@ bool ScUndoIndent::CanRepeat(SfxRepeatTarget& rTarget) const
}
ScUndoTransliterate::ScUndoTransliterate( ScDocShell* pNewDocShell, const ScMarkData& rMark,
- ScDocument* pNewUndoDoc, sal_Int32 nType ) :
+ ScDocument* pNewUndoDoc, TransliterationFlags nType ) :
ScBlockUndo( pNewDocShell, lcl_GetMultiMarkRange(rMark), SC_UNDO_AUTOHEIGHT ),
aMarkData( rMark ),
pUndoDoc( pNewUndoDoc ),
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 88c6fbc4..a6810db 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -98,8 +98,6 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <cppuhelper/bootstrap.hxx>
-#include <com/sun/star/i18n/TransliterationModules.hpp>
-#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
#include <memory>
@@ -2593,8 +2591,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
void ScCellShell::ExecuteTrans( SfxRequest& rReq )
{
- sal_Int32 nType = ScViewUtil::GetTransliterationType( rReq.GetSlot() );
- if ( nType )
+ TransliterationFlags nType = ScViewUtil::GetTransliterationType( rReq.GetSlot() );
+ if ( nType != TransliterationFlags::NONE )
{
GetViewData()->GetView()->TransliterateText( nType );
rReq.Done();
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list