tdf#155376 partially convert SvCTLOptions to officecfg
When accessibility is enabled, Calc will add tens of thousands of
listeners.
We then spend a significant chunk of time creating SvCTLOptions objects
(attached to ImpEditEngine) and adding and removing those objects from
the related listener lists.
But the required information is already globally cached by the officecfg
module, so we can avoid that overhead and just fetch it directly from
officecfg.
Change-Id: I7ff55fd7c4926866eb7086812275ba8bd6e84c75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152645
Tested-by: Jenkins
Reviewed-by: Patrick Luby <plubius@neooffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
index a0b548e..e885fda 100644
--- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
+++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
@@ -475,7 +475,7 @@ SchAttribTabDlg::SchAttribTabDlg(weld::Window* pParent,
AddTabPage("fontname", SchResId(STR_PAGE_FONT), RID_SVXPAGE_CHAR_NAME);
AddTabPage("effects", SchResId(STR_PAGE_FONT_EFFECTS), RID_SVXPAGE_CHAR_EFFECTS);
AddTabPage("numberformat", SchResId(STR_PAGE_NUMBERS), RID_SVXPAGE_NUMBERFORMAT);
if (SvtCTLOptions().IsCTLFontEnabled())
if (SvtCTLOptions::IsCTLFontEnabled())
{
/* When rotation is supported for equation text boxes, use
SchAlignmentTabPage::Create here. The special
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 449c392..d499aae 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -350,7 +350,7 @@ bool lcl_IsPieOrDonut( const rtl::Reference< Diagram >& xDiagram )
void lcl_setDefaultWritingMode( const std::shared_ptr< DrawModelWrapper >& pDrawModelWrapper, ChartModel& rModel)
{
//get writing mode from parent document:
if( !SvtCTLOptions().IsCTLFontEnabled() )
if( !SvtCTLOptions::IsCTLFontEnabled() )
return;
try
diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx
index dab52a4..885f1ac 100644
--- a/chart2/source/view/main/VLegend.cxx
+++ b/chart2/source/view/main/VLegend.cxx
@@ -807,7 +807,7 @@ bool lcl_shouldSymbolsBePlacedOnTheLeftSide( const Reference< beans::XPropertySe
bool bSymbolsLeftSide = true;
try
{
if( SvtCTLOptions().IsCTLFontEnabled() )
if( SvtCTLOptions::IsCTLFontEnabled() )
{
if(xLegendProp.is())
{
diff --git a/cui/source/options/optctl.cxx b/cui/source/options/optctl.cxx
index 52bd18f..869879c 100644
--- a/cui/source/options/optctl.cxx
+++ b/cui/source/options/optctl.cxx
@@ -106,13 +106,11 @@ bool SvxCTLOptionsPage::FillItemSet( SfxItemSet* )
void SvxCTLOptionsPage::Reset( const SfxItemSet* )
{
SvtCTLOptions aCTLOptions;
m_xSequenceCheckingCB->set_active( SvtCTLOptions::IsCTLSequenceChecking() );
m_xRestrictedCB->set_active( SvtCTLOptions::IsCTLSequenceCheckingRestricted() );
m_xTypeReplaceCB->set_active( SvtCTLOptions::IsCTLSequenceCheckingTypeAndReplace() );
m_xSequenceCheckingCB->set_active( aCTLOptions.IsCTLSequenceChecking() );
m_xRestrictedCB->set_active( aCTLOptions.IsCTLSequenceCheckingRestricted() );
m_xTypeReplaceCB->set_active( aCTLOptions.IsCTLSequenceCheckingTypeAndReplace() );
SvtCTLOptions::CursorMovement eMovement = aCTLOptions.GetCTLCursorMovement();
SvtCTLOptions::CursorMovement eMovement = SvtCTLOptions::GetCTLCursorMovement();
switch ( eMovement )
{
case SvtCTLOptions::MOVEMENT_LOGICAL :
@@ -127,7 +125,7 @@ void SvxCTLOptionsPage::Reset( const SfxItemSet* )
SAL_WARN( "cui.options", "SvxCTLOptionsPage::Reset(): invalid movement enum" );
}
sal_uInt16 nPos = static_cast<sal_uInt16>(aCTLOptions.GetCTLTextNumerals());
sal_uInt16 nPos = static_cast<sal_uInt16>(SvtCTLOptions::GetCTLTextNumerals());
DBG_ASSERT( nPos < m_xNumeralsLB->get_count(), "SvxCTLOptionsPage::Reset(): invalid numerals enum" );
m_xNumeralsLB->set_active(nPos);
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 5819171..ecd671e 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1169,7 +1169,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(weld::Container* pPage, weld::DialogCon
m_xAsianSupportCB->set_sensitive(!bReadonly);
SupportHdl(*m_xAsianSupportCB);
m_bOldCtl = pLangConfig->aCTLLanguageOptions.IsCTLFontEnabled();
m_bOldCtl = SvtCTLOptions::IsCTLFontEnabled();
m_xCTLSupportCB->set_active(m_bOldCtl);
m_xCTLSupportCB->save_state();
bReadonly = pLangConfig->aCTLLanguageOptions.IsReadOnly(SvtCTLOptions::E_CTLFONT);
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 98d8a3e..d3c65eb 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1369,7 +1369,6 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
}
// Language options
SvtCTLOptions aCTLLanguageOptions;
if ( !lcl_isOptionHidden( SID_LANGUAGE_OPTIONS, aOptionsDlgOpt ) )
{
setGroupName(u"LanguageSettings", CuiResId(SID_LANGUAGE_OPTIONS_RES[0].first));
@@ -1389,7 +1388,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
if ( ( RID_SVXPAGE_JSEARCH_OPTIONS != nPageId || SvtCJKOptions::IsJapaneseFindEnabled() ) &&
( RID_SVXPAGE_ASIAN_LAYOUT != nPageId || SvtCJKOptions::IsAsianTypographyEnabled() ) &&
( RID_SVXPAGE_OPTIONS_CTL != nPageId || aCTLLanguageOptions.IsCTLFontEnabled() ) )
( RID_SVXPAGE_OPTIONS_CTL != nPageId || SvtCTLOptions::IsCTLFontEnabled() ) )
AddTabPage(nPageId, CuiResId(SID_LANGUAGE_OPTIONS_RES[i].first), nGroup);
}
}
@@ -1420,7 +1419,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
continue;
if ( ( RID_SW_TP_STD_FONT_CJK != nPageId || SvtCJKOptions::IsCJKFontEnabled() ) &&
( RID_SW_TP_STD_FONT_CTL != nPageId || aCTLLanguageOptions.IsCTLFontEnabled() ) &&
( RID_SW_TP_STD_FONT_CTL != nPageId || SvtCTLOptions::IsCTLFontEnabled() ) &&
( RID_SW_TP_MAILCONFIG != nPageId || MailMergeCfgIsEmailSupported() ) )
AddTabPage( nPageId, CuiResId(SID_SW_EDITOPTIONS_RES[i].first), nGroup );
}
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 38a261a..378fb68 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -107,7 +107,7 @@ OfaAutoCorrDlg::OfaAutoCorrDlg(weld::Window* pParent, const SfxItemSet* _pSet )
//! will be set to LANGUAGE_UNDETERMINED
SvxLanguageListFlags nLangList = SvxLanguageListFlags::WESTERN;
if( SvtCTLOptions().IsCTLFontEnabled() )
if( SvtCTLOptions::IsCTLFontEnabled() )
nLangList |= SvxLanguageListFlags::CTL;
if( SvtCJKOptions::IsCJKFontEnabled() )
nLangList |= SvxLanguageListFlags::CJK;
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index ace220b..79cb8d4 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -245,9 +245,8 @@ SvxCharNamePage::SvxCharNamePage(weld::Container* pPage, weld::DialogController*
m_xEastFontNameLB = std::move(xCJKFontName);
m_xCTLFontNameLB = std::move(xCTLFontName);
SvtCTLOptions aCTLLanguageOptions;
bool bShowCJK = SvtCJKOptions::IsCJKFontEnabled();
bool bShowCTL = aCTLLanguageOptions.IsCTLFontEnabled();
bool bShowCTL = SvtCTLOptions::IsCTLFontEnabled();
bool bShowNonWestern = bShowCJK || bShowCTL;
if (!bShowNonWestern)
{
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index d40fef9..d810a94 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -191,9 +191,8 @@ SvxPageDescPage::SvxPageDescPage(weld::Container* pPage, weld::DialogController*
// this page needs ExchangeSupport
SetExchangeSupport();
SvtCTLOptions aCTLLanguageOptions;
bool bCJK = SvtCJKOptions::IsAsianTypographyEnabled();
bool bCTL = aCTLLanguageOptions.IsCTLFontEnabled();
bool bCTL = SvtCTLOptions::IsCTLFontEnabled();
bool bWeb = false;
const SfxUInt16Item* pHtmlModeItem = rAttr.GetItemIfSet(SID_HTML_MODE, false);
diff --git a/drawinglayer/source/processor2d/getdigitlanguage.cxx b/drawinglayer/source/processor2d/getdigitlanguage.cxx
index 858284b..464fbf6 100644
--- a/drawinglayer/source/processor2d/getdigitlanguage.cxx
+++ b/drawinglayer/source/processor2d/getdigitlanguage.cxx
@@ -18,7 +18,7 @@
#include "getdigitlanguage.hxx"
LanguageType drawinglayer::detail::getDigitLanguage() {
switch (SvtCTLOptions().GetCTLTextNumerals()) {
switch (SvtCTLOptions::GetCTLTextNumerals()) {
case SvtCTLOptions::NUMERALS_ARABIC:
return LANGUAGE_ENGLISH;
case SvtCTLOptions::NUMERALS_HINDI:
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index d263363..12e52b2 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1122,7 +1122,7 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v
{
if ( !rKeyEvent.GetKeyCode().IsMod2() || ( nCode == KEY_LEFT ) || ( nCode == KEY_RIGHT ) )
{
if ( pImpEditEngine->DoVisualCursorTraveling() && ( ( nCode == KEY_LEFT ) || ( nCode == KEY_RIGHT ) /* || ( nCode == KEY_HOME ) || ( nCode == KEY_END ) */ ) )
if ( ImpEditEngine::DoVisualCursorTraveling() && ( ( nCode == KEY_LEFT ) || ( nCode == KEY_RIGHT ) /* || ( nCode == KEY_HOME ) || ( nCode == KEY_END ) */ ) )
bSetCursorFlags = false; // Will be manipulated within visual cursor move
aCurSel = pImpEditEngine->MoveCursor( rKeyEvent, pEditView );
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 7bbd0fd..6db82ab 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -70,7 +70,6 @@ class SvxLRSpaceItem;
class TextRanger;
class SvKeyValueIterator;
class SvxForbiddenCharactersTable;
class SvtCTLOptions;
namespace vcl { class Window; }
class SvxNumberFormat;
namespace com::sun::star::datatransfer::clipboard {
@@ -513,7 +512,6 @@ private:
VclPtr<VirtualDevice> mpOwnDev;
svtools::ColorConfig maColorConfig;
mutable std::unique_ptr<SvtCTLOptions> pCTLOptions;
mutable std::unique_ptr<SfxItemSet> pEmptyItemSet;
EditUndoManager* pUndoManager;
@@ -718,8 +716,8 @@ private:
void ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* pParaPortion, tools::Long nRemainingWidth );
void ImplInitLayoutMode(OutputDevice& rOutDev, sal_Int32 nPara, sal_Int32 nIndex);
LanguageType ImplCalcDigitLang(LanguageType eCurLang) const;
void ImplInitDigitMode(OutputDevice& rOutDev, LanguageType eLang);
static LanguageType ImplCalcDigitLang(LanguageType eCurLang);
static void ImplInitDigitMode(OutputDevice& rOutDev, LanguageType eLang);
static OUString convertDigits(std::u16string_view rString, sal_Int32 nStt, sal_Int32 nLen, LanguageType eDigitLang);
EditPaM ReadText( SvStream& rInput, EditSelection aSel );
@@ -996,8 +994,8 @@ public:
void FormatAndLayout( EditView* pCurView = nullptr, bool bCalledFromUndo = false );
const svtools::ColorConfig& GetColorConfig() const { return maColorConfig; }
bool IsVisualCursorTravelingEnabled();
bool DoVisualCursorTraveling();
static bool IsVisualCursorTravelingEnabled();
static bool DoVisualCursorTraveling();
EditSelection ConvertSelection( sal_Int32 nStartPara, sal_Int32 nStartPos, sal_Int32 nEndPara, sal_Int32 nEndPos );
inline EPaM CreateEPaM( const EditPaM& rPaM ) const;
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 254e5e1..cc8b391 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -188,7 +188,6 @@ ImpEditEngine::~ImpEditEngine()
delete pUndoManager;
pTextRanger.reset();
mpIMEInfos.reset();
pCTLOptions.reset();
pSpellInfo.reset();
}
@@ -1632,15 +1631,13 @@ EditSelection ImpEditEngine::SelectSentence( const EditSelection& rCurSel )
bool ImpEditEngine::IsInputSequenceCheckingRequired( sal_Unicode nChar, const EditSelection& rCurSel ) const
{
uno::Reference < i18n::XBreakIterator > _xBI( ImplGetBreakIterator() );
if (!pCTLOptions)
pCTLOptions.reset( new SvtCTLOptions );
// get the index that really is first
const sal_Int32 nFirstPos = std::min(rCurSel.Min().GetIndex(), rCurSel.Max().GetIndex());
bool bIsSequenceChecking =
pCTLOptions->IsCTLFontEnabled() &&
pCTLOptions->IsCTLSequenceChecking() &&
SvtCTLOptions::IsCTLFontEnabled() &&
SvtCTLOptions::IsCTLSequenceChecking() &&
nFirstPos != 0 && /* first char needs not to be checked */
_xBI.is() && i18n::ScriptType::COMPLEX == _xBI->getScriptType( OUString( nChar ), 0 );
@@ -2643,20 +2640,18 @@ EditPaM ImpEditEngine::InsertTextUserInput( const EditSelection& rCurSel,
if (IsInputSequenceCheckingRequired( c, rCurSel ))
{
uno::Reference < i18n::XExtendedInputSequenceChecker > _xISC( ImplGetInputSequenceChecker() );
if (!pCTLOptions)
pCTLOptions.reset( new SvtCTLOptions );
if (_xISC)
{
const sal_Int32 nTmpPos = aPaM.GetIndex();
sal_Int16 nCheckMode = pCTLOptions->IsCTLSequenceCheckingRestricted() ?
sal_Int16 nCheckMode = SvtCTLOptions::IsCTLSequenceCheckingRestricted() ?
i18n::InputSequenceCheckMode::STRICT : i18n::InputSequenceCheckMode::BASIC;
// the text that needs to be checked is only the one
// before the current cursor position
const OUString aOldText( aPaM.GetNode()->Copy(0, nTmpPos) );
OUString aNewText( aOldText );
if (pCTLOptions->IsCTLSequenceCheckingTypeAndReplace())
if (SvtCTLOptions::IsCTLSequenceCheckingTypeAndReplace())
{
_xISC->correctInputSequence(aNewText, nTmpPos - 1, c, nCheckMode);
@@ -4462,10 +4457,7 @@ bool ImpEditEngine::IsVisualCursorTravelingEnabled()
{
bool bVisualCursorTravaling = false;
if( !pCTLOptions )
pCTLOptions.reset( new SvtCTLOptions );
if ( pCTLOptions->IsCTLFontEnabled() && ( pCTLOptions->GetCTLCursorMovement() == SvtCTLOptions::MOVEMENT_VISUAL ) )
if ( SvtCTLOptions::IsCTLFontEnabled() && ( SvtCTLOptions::GetCTLCursorMovement() == SvtCTLOptions::MOVEMENT_VISUAL ) )
{
bVisualCursorTravaling = true;
}
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 6cb45a3..bcf0c04 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -4578,18 +4578,16 @@ const SvxLRSpaceItem& ImpEditEngine::GetLRSpaceItem( ContentNode* pNode )
// select a representative text language for the digit type according to the
// text numeral setting:
LanguageType ImpEditEngine::ImplCalcDigitLang(LanguageType eCurLang) const
LanguageType ImpEditEngine::ImplCalcDigitLang(LanguageType eCurLang)
{
if (utl::ConfigManager::IsFuzzing())
return LANGUAGE_ENGLISH_US;
// #114278# Also setting up digit language from Svt options
// (cannot reliably inherit the outdev's setting)
if( !pCTLOptions )
pCTLOptions.reset( new SvtCTLOptions );
LanguageType eLang = eCurLang;
const SvtCTLOptions::TextNumerals nCTLTextNumerals = pCTLOptions->GetCTLTextNumerals();
const SvtCTLOptions::TextNumerals nCTLTextNumerals = SvtCTLOptions::GetCTLTextNumerals();
if ( SvtCTLOptions::NUMERALS_HINDI == nCTLTextNumerals )
eLang = LANGUAGE_ARABIC_SAUDI_ARABIA;
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index 730bc2c..1ca87af 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -2270,7 +2270,7 @@ namespace pcr
break;
case PROPERTY_ID_WRITING_MODE:
if ( !SvtCTLOptions().IsCTLFontEnabled() )
if ( !SvtCTLOptions::IsCTLFontEnabled() )
return true;
break;
}
diff --git a/include/svl/ctloptions.hxx b/include/svl/ctloptions.hxx
index 5140907..fe343265 100644
--- a/include/svl/ctloptions.hxx
+++ b/include/svl/ctloptions.hxx
@@ -39,16 +39,16 @@ public:
virtual ~SvtCTLOptions() override;
void SetCTLFontEnabled( bool _bEnabled );
bool IsCTLFontEnabled() const;
static bool IsCTLFontEnabled();
void SetCTLSequenceChecking( bool _bEnabled );
bool IsCTLSequenceChecking() const;
static bool IsCTLSequenceChecking();
void SetCTLSequenceCheckingRestricted( bool _bEnable );
bool IsCTLSequenceCheckingRestricted() const;
static bool IsCTLSequenceCheckingRestricted();
void SetCTLSequenceCheckingTypeAndReplace( bool _bEnable );
bool IsCTLSequenceCheckingTypeAndReplace() const;
static bool IsCTLSequenceCheckingTypeAndReplace();
enum CursorMovement
{
@@ -56,7 +56,7 @@ public:
MOVEMENT_VISUAL
};
void SetCTLCursorMovement( CursorMovement _eMovement );
CursorMovement GetCTLCursorMovement() const;
static CursorMovement GetCTLCursorMovement();
enum TextNumerals
{
@@ -66,7 +66,7 @@ public:
NUMERALS_CONTEXT
};
void SetCTLTextNumerals( TextNumerals _eNumerals );
TextNumerals GetCTLTextNumerals() const;
static TextNumerals GetCTLTextNumerals();
enum EOption
{
diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx
index cd82dd4..89c5247 100644
--- a/sc/inc/scmod.hxx
+++ b/sc/inc/scmod.hxx
@@ -181,7 +181,7 @@ public:
static void SetAutoSpellProperty( bool bSet );
static bool HasThesaurusLanguage( LanguageType nLang );
LanguageType GetOptDigitLanguage(); // from CTL options
static LanguageType GetOptDigitLanguage(); // from CTL options
ScNavipiCfg& GetNavipiCfg();
ScAddInCfg& GetAddInCfg();
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 7adf008..18f8115 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -133,7 +133,7 @@ SfxPrinter* ScDocument::GetPrinter(bool bCreateIfNotExist)
mpPrinter = VclPtr<SfxPrinter>::Create( std::move(pSet) );
mpPrinter->SetMapMode(MapMode(MapUnit::Map100thMM));
UpdateDrawPrinter();
mpPrinter->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() );
mpPrinter->SetDigitLanguage( ScModule::GetOptDigitLanguage() );
}
return mpPrinter;
@@ -153,7 +153,7 @@ void ScDocument::SetPrinter( VclPtr<SfxPrinter> const & pNewPrinter )
ScopedVclPtr<SfxPrinter> xKeepAlive( mpPrinter );
mpPrinter = pNewPrinter;
UpdateDrawPrinter();
mpPrinter->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() );
mpPrinter->SetDigitLanguage( ScModule::GetOptDigitLanguage() );
}
InvalidateTextWidth(nullptr, nullptr, false); // in both cases
}
@@ -225,7 +225,7 @@ void ScDocument::ModifyStyleSheet( SfxStyleSheetBase& rStyleSheet,
if ( (nOldScale != nNewScale) || (nOldScaleToPages != nNewScaleToPages) )
InvalidateTextWidth( rStyleSheet.GetName() );
if( SvtCTLOptions().IsCTLFontEnabled() )
if( SvtCTLOptions::IsCTLFontEnabled() )
{
if( rChanges.GetItemState(ATTR_WRITINGDIR ) == SfxItemState::SET )
ScChartHelper::DoUpdateAllCharts( *this );
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index d60b103..cfcd72f 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -919,7 +919,7 @@ void ScInputHandler::UpdateRefDevice()
// so the DigitLanguage can be safely modified (might use an own VDev instead of NULL).
if ( !( bTextWysiwyg && pActiveViewSh ) )
{
mpEditEngine->GetRefDevice()->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() );
mpEditEngine->GetRefDevice()->SetDigitLanguage( ScModule::GetOptDigitLanguage() );
}
}
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index a4c3bb4..ed36be7 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -928,7 +928,7 @@ SvtUserOptions& ScModule::GetUserOptions()
LanguageType ScModule::GetOptDigitLanguage()
{
SvtCTLOptions::TextNumerals eNumerals = GetCTLOptions().GetCTLTextNumerals();
SvtCTLOptions::TextNumerals eNumerals = SvtCTLOptions::GetCTLTextNumerals();
return ( eNumerals == SvtCTLOptions::NUMERALS_ARABIC ) ? LANGUAGE_ENGLISH_US :
( eNumerals == SvtCTLOptions::NUMERALS_HINDI) ? LANGUAGE_ARABIC_SAUDI_ARABIA :
LANGUAGE_SYSTEM;
diff --git a/sc/source/ui/docshell/sizedev.cxx b/sc/source/ui/docshell/sizedev.cxx
index c5b7e41..65e0337 100644
--- a/sc/source/ui/docshell/sizedev.cxx
+++ b/sc/source/ui/docshell/sizedev.cxx
@@ -40,7 +40,7 @@ ScSizeDeviceProvider::ScSizeDeviceProvider( ScDocShell* pDocSh )
else
{
pDevice = VclPtr<VirtualDevice>::Create();
pDevice->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() );
pDevice->SetDigitLanguage( ScModule::GetOptDigitLanguage() );
bOwner = true;
}
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 79f2bd1..afd3a59 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -975,7 +975,7 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
// issue 21255 - Notes now support rich text formatting.
}
bool bDisableCTLFont = !SvtCTLOptions().IsCTLFontEnabled();
bool bDisableCTLFont = !::SvtCTLOptions::IsCTLFontEnabled();
bool bDisableVerticalText = !SvtCJKOptions::IsVerticalTextEnabled();
SdrView* pView = mrViewData.GetScDrawView();
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 3473c08..1358fb8 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1482,7 +1482,7 @@ static OutputDevice* lcl_GetRenderDevice( const uno::Sequence<beans::PropertyVal
if ( pDevice )
{
pRet = pDevice->GetOutputDevice().get();
pRet->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() );
pRet->SetDigitLanguage( ScModule::GetOptDigitLanguage() );
}
}
}
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index c2acb2a..c1b36c2 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1972,7 +1972,7 @@ void ScFormatShell::GetTextDirectionState( SfxItemSet& rSet )
eBidiDir = EEHorizontalTextDirection::L2R;
}
bool bDisableCTLFont = !SvtCTLOptions().IsCTLFontEnabled();
bool bDisableCTLFont = !SvtCTLOptions::IsCTLFontEnabled();
bool bDisableVerticalText = !SvtCJKOptions::IsVerticalTextEnabled();
SfxWhichIter aIter( rSet );
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index d32313a..50b85f1 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -421,7 +421,7 @@ ScGridWindow::ScGridWindow( vcl::Window* pParent, ScViewData& rData, ScSplitPos
SetHelpId( HID_SC_WIN_GRIDWIN );
GetOutDev()->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() );
GetOutDev()->SetDigitLanguage( ScModule::GetOptDigitLanguage() );
EnableRTL( false );
bInitialPageBreaks = true;
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index 82e0732..3343088 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -127,7 +127,7 @@ ScPreview::ScPreview( vcl::Window* pParent, ScDocShell* pDocSh, ScPreviewShell*
SetHelpId( HID_SC_WIN_PREVIEW );
GetOutDev()->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() );
GetOutDev()->SetDigitLanguage( ScModule::GetOptDigitLanguage() );
}
ScPreview::~ScPreview()
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index 670efab..c9b65bb 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -537,7 +537,7 @@ void ScTabView::UpdateDrawTextOutliner()
void ScTabView::DigitLanguageChanged()
{
LanguageType eNewLang = SC_MOD()->GetOptDigitLanguage();
LanguageType eNewLang = ScModule::GetOptDigitLanguage();
for (VclPtr<ScGridWindow> & pWin : pGridWin)
if ( pWin )
pWin->GetOutDev()->SetDigitLanguage( eNewLang );
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 4c4415f..2ac3b93 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -1060,7 +1060,7 @@ void ScTabViewShell::GetStateTable( SfxItemSet& rSet )
case FID_TAB_RTL:
{
if ( !SvtCTLOptions().IsCTLFontEnabled() )
if ( !SvtCTLOptions::IsCTLFontEnabled() )
rSet.DisableItem( nWhich );
else
rSet.Put( SfxBoolItem( nWhich, rDoc.IsLayoutRTL( nTab ) ) );
diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx
index 3de98a0..68575ac 100644
--- a/sc/source/ui/view/viewutil.cxx
+++ b/sc/source/ui/view/viewutil.cxx
@@ -302,7 +302,7 @@ void ScViewUtil::HideDisabledSlot( SfxItemSet& rSet, SfxBindings& rBindings, sal
case SID_INSERT_RLM:
case SID_INSERT_LRM:
bEnabled = aCTLOptions.IsCTLFontEnabled();
bEnabled = SvtCTLOptions::IsCTLFontEnabled();
break;
default:
diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx
index ab0cf7d..843215c 100644
--- a/sd/source/ui/func/fubullet.cxx
+++ b/sd/source/ui/func/fubullet.cxx
@@ -292,8 +292,7 @@ void FuBullet::GetSlotState( SfxItemSet& rSet, ViewShell const * pViewShell, Sfx
const bool bTextEdit = pOLV;
SvtCTLOptions aCTLOptions;
const bool bCtlEnabled = aCTLOptions.IsCTLFontEnabled();
const bool bCtlEnabled = SvtCTLOptions::IsCTLFontEnabled();
if(!bTextEdit )
{
diff --git a/sd/source/ui/inc/WindowUpdater.hxx b/sd/source/ui/inc/WindowUpdater.hxx
index 2545af7..f57d889 100644
--- a/sd/source/ui/inc/WindowUpdater.hxx
+++ b/sd/source/ui/inc/WindowUpdater.hxx
@@ -84,7 +84,7 @@ public:
The device to update. When the given pointer is NULL then
nothing is done.
*/
void Update(OutputDevice* pDevice) const;
static void Update(OutputDevice* pDevice);
/** Callback that waits for notifications of a
<type>SvtCTLOptions</type> object.
@@ -116,7 +116,7 @@ private:
The output device to update. When it is <null/> then the call
is ignored.
*/
void UpdateWindow(OutputDevice* pDevice) const;
static void UpdateWindow(OutputDevice* pDevice);
};
} // end of namespace sd
diff --git a/sd/source/ui/view/WindowUpdater.cxx b/sd/source/ui/view/WindowUpdater.cxx
index c3f1bb5..3aa53fe 100644
--- a/sd/source/ui/view/WindowUpdater.cxx
+++ b/sd/source/ui/view/WindowUpdater.cxx
@@ -71,8 +71,7 @@ void WindowUpdater::SetDocument (SdDrawDocument* pDocument)
mpDocument = pDocument;
}
void WindowUpdater::Update (
OutputDevice* pDevice) const
/*static*/ void WindowUpdater::Update (OutputDevice* pDevice)
{
if (pDevice != nullptr)
{
@@ -80,12 +79,12 @@ void WindowUpdater::Update (
}
}
void WindowUpdater::UpdateWindow (OutputDevice* pDevice) const
/*static*/ void WindowUpdater::UpdateWindow (OutputDevice* pDevice)
{
if (pDevice == nullptr)
return;
SvtCTLOptions::TextNumerals aNumeralMode (maCTLOptions.GetCTLTextNumerals());
SvtCTLOptions::TextNumerals aNumeralMode (SvtCTLOptions::GetCTLTextNumerals());
LanguageType aLanguage;
// Now this is a bit confusing. The numerals in arabic languages
diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index a7204b99..8b6c0ff 100644
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -145,7 +145,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
SfxWhichIter aIter( rSet );
sal_uInt16 nWhich = aIter.FirstWhich();
SfxItemSet aAttrSet( mpView->GetDoc().GetPool() );
bool bDisableParagraphTextDirection = !SvtCTLOptions().IsCTLFontEnabled();
bool bDisableParagraphTextDirection = !SvtCTLOptions::IsCTLFontEnabled();
bool bDisableVerticalText = !SvtCJKOptions::IsVerticalTextEnabled();
mpView->GetAttributes( aAttrSet );
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index 0a0ccec7..d075dec 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -185,10 +185,9 @@ bool SfxObjectShell::CreatePreview_Impl( bool bFullContent, VirtualDevice* pDevi
}
LanguageType eLang;
SvtCTLOptions aCTLOptions;
if ( SvtCTLOptions::NUMERALS_HINDI == aCTLOptions.GetCTLTextNumerals() )
if ( SvtCTLOptions::NUMERALS_HINDI == SvtCTLOptions::GetCTLTextNumerals() )
eLang = LANGUAGE_ARABIC_SAUDI_ARABIA;
else if ( SvtCTLOptions::NUMERALS_ARABIC == aCTLOptions.GetCTLTextNumerals() )
else if ( SvtCTLOptions::NUMERALS_ARABIC == SvtCTLOptions::GetCTLTextNumerals() )
eLang = LANGUAGE_ENGLISH;
else
eLang = Application::GetSettings().GetLanguageTag().getLanguageType();
diff --git a/svl/source/config/ctloptions.cxx b/svl/source/config/ctloptions.cxx
index 288761b..eb636e0 100644
--- a/svl/source/config/ctloptions.cxx
+++ b/svl/source/config/ctloptions.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <osl/mutex.hxx>
#include "itemholder2.hxx"
#include <officecfg/Office/Common.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -60,24 +61,16 @@ public:
bool IsLoaded() const { return m_bIsLoaded; }
void SetCTLFontEnabled( bool _bEnabled );
bool IsCTLFontEnabled() const { return m_bCTLFontEnabled; }
void SetCTLSequenceChecking( bool _bEnabled );
bool IsCTLSequenceChecking() const { return m_bCTLSequenceChecking;}
void SetCTLSequenceCheckingRestricted( bool _bEnable );
bool IsCTLSequenceCheckingRestricted() const { return m_bCTLRestricted; }
void SetCTLSequenceCheckingTypeAndReplace( bool _bEnable );
bool IsCTLSequenceCheckingTypeAndReplace() const { return m_bCTLTypeAndReplace; }
void SetCTLCursorMovement( SvtCTLOptions::CursorMovement _eMovement );
SvtCTLOptions::CursorMovement
GetCTLCursorMovement() const { return m_eCTLCursorMovement; }
void SetCTLTextNumerals( SvtCTLOptions::TextNumerals _eNumerals );
SvtCTLOptions::TextNumerals
GetCTLTextNumerals() const { return m_eCTLTextNumerals; }
bool IsReadOnly(SvtCTLOptions::EOption eOption) const;
};
@@ -380,10 +373,9 @@ void SvtCTLOptions::SetCTLFontEnabled( bool _bEnabled )
m_pImpl->SetCTLFontEnabled( _bEnabled );
}
bool SvtCTLOptions::IsCTLFontEnabled() const
bool SvtCTLOptions::IsCTLFontEnabled()
{
assert(m_pImpl->IsLoaded());
return m_pImpl->IsCTLFontEnabled();
return officecfg::Office::Common::I18N::CTL::CTLFont::get();
}
void SvtCTLOptions::SetCTLSequenceChecking( bool _bEnabled )
@@ -392,10 +384,9 @@ void SvtCTLOptions::SetCTLSequenceChecking( bool _bEnabled )
m_pImpl->SetCTLSequenceChecking(_bEnabled);
}
bool SvtCTLOptions::IsCTLSequenceChecking() const
bool SvtCTLOptions::IsCTLSequenceChecking()
{
assert(m_pImpl->IsLoaded());
return m_pImpl->IsCTLSequenceChecking();
return officecfg::Office::Common::I18N::CTL::CTLSequenceChecking::get();
}
void SvtCTLOptions::SetCTLSequenceCheckingRestricted( bool _bEnable )
@@ -404,10 +395,9 @@ void SvtCTLOptions::SetCTLSequenceCheckingRestricted( bool _bEnable )
m_pImpl->SetCTLSequenceCheckingRestricted(_bEnable);
}
bool SvtCTLOptions::IsCTLSequenceCheckingRestricted() const
bool SvtCTLOptions::IsCTLSequenceCheckingRestricted()
{
assert(m_pImpl->IsLoaded());
return m_pImpl->IsCTLSequenceCheckingRestricted();
return officecfg::Office::Common::I18N::CTL::CTLSequenceCheckingRestricted::get();
}
void SvtCTLOptions::SetCTLSequenceCheckingTypeAndReplace( bool _bEnable )
@@ -416,10 +406,9 @@ void SvtCTLOptions::SetCTLSequenceCheckingTypeAndReplace( bool _bEnable )
m_pImpl->SetCTLSequenceCheckingTypeAndReplace(_bEnable);
}
bool SvtCTLOptions::IsCTLSequenceCheckingTypeAndReplace() const
bool SvtCTLOptions::IsCTLSequenceCheckingTypeAndReplace()
{
assert(m_pImpl->IsLoaded());
return m_pImpl->IsCTLSequenceCheckingTypeAndReplace();
return officecfg::Office::Common::I18N::CTL::CTLSequenceCheckingTypeAndReplace::get();
}
void SvtCTLOptions::SetCTLCursorMovement( SvtCTLOptions::CursorMovement _eMovement )
@@ -428,10 +417,9 @@ void SvtCTLOptions::SetCTLCursorMovement( SvtCTLOptions::CursorMovement _eMoveme
m_pImpl->SetCTLCursorMovement( _eMovement );
}
SvtCTLOptions::CursorMovement SvtCTLOptions::GetCTLCursorMovement() const
SvtCTLOptions::CursorMovement SvtCTLOptions::GetCTLCursorMovement()
{
assert(m_pImpl->IsLoaded());
return m_pImpl->GetCTLCursorMovement();
return static_cast<SvtCTLOptions::CursorMovement>(officecfg::Office::Common::I18N::CTL::CTLCursorMovement::get());
}
void SvtCTLOptions::SetCTLTextNumerals( SvtCTLOptions::TextNumerals _eNumerals )
@@ -440,10 +428,9 @@ void SvtCTLOptions::SetCTLTextNumerals( SvtCTLOptions::TextNumerals _eNumerals )
m_pImpl->SetCTLTextNumerals( _eNumerals );
}
SvtCTLOptions::TextNumerals SvtCTLOptions::GetCTLTextNumerals() const
SvtCTLOptions::TextNumerals SvtCTLOptions::GetCTLTextNumerals()
{
assert(m_pImpl->IsLoaded());
return m_pImpl->GetCTLTextNumerals();
return static_cast<SvtCTLOptions::TextNumerals>(officecfg::Office::Common::I18N::CTL::CTLTextNumerals::get());
}
bool SvtCTLOptions::IsReadOnly(EOption eOption) const
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index ba372d9..69cc901 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -188,7 +188,7 @@ public:
mbTextInited(false)
{
m_bCJKEnabled = SvtCJKOptions::IsAnyEnabled();
m_bCTLEnabled = SvtCTLOptions().IsCTLFontEnabled();
m_bCTLEnabled = SvtCTLOptions::IsCTLFontEnabled();
mxBackColor = svtools::ColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
Invalidate100PercentFontWidth();
}
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index b1c5c84..1e0bcd3 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -444,13 +444,12 @@ void SvxSearchDialog::Construct_Impl()
{
m_xJapMatchFullHalfWidthCB->hide();
}
SvtCTLOptions aCTLOptions;
// Do not disable and hide the m_xIncludeDiacritics button.
// Include Diacritics == Not Ignore Diacritics => A does not match A-Umlaut (Diaeresis).
// Confusingly these have negated names (following the UI) but the actual
// transliteration is to *ignore* diacritics if "included" (sensitive) is
// _not_ checked.
if(!aCTLOptions.IsCTLFontEnabled())
if(!SvtCTLOptions::IsCTLFontEnabled())
{
m_xIncludeDiacritics->set_active( true );
m_xIncludeKashida->set_active( true );
@@ -706,7 +705,6 @@ void SvxSearchDialog::ShowOptionalControls_Impl()
{
DBG_ASSERT( pSearchItem, "no search item" );
SvtCTLOptions aCTLOptions;
SvtModuleOptions::EFactory eFactory = getModule(rBindings);
bool bDrawApp = eFactory == SvtModuleOptions::EFactory::DRAW;
bool bWriterApp =
@@ -724,7 +722,7 @@ void SvxSearchDialog::ShowOptionalControls_Impl()
m_xSimilarityBtn->show();
m_xSelectionBtn->show();
m_xIncludeDiacritics->show();
m_xIncludeKashida->set_visible(aCTLOptions.IsCTLFontEnabled());
m_xIncludeKashida->set_visible(SvtCTLOptions::IsCTLFontEnabled());
m_xJapMatchFullHalfWidthCB->set_visible(SvtCJKOptions::IsCJKFontEnabled());
m_xJapOptionsCB->set_visible(SvtCJKOptions::IsJapaneseFindEnabled());
m_xJapOptionsBtn->set_visible(SvtCJKOptions::IsJapaneseFindEnabled());
diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx
index ede035b..e938a0a 100644
--- a/svx/source/form/fmtextcontrolshell.cxx
+++ b/svx/source/form/fmtextcontrolshell.cxx
@@ -894,7 +894,7 @@ namespace svx
|| ( nSlot == SID_ATTR_PARA_RIGHT_TO_LEFT )
)
{
if ( !SvtCTLOptions().IsCTLFontEnabled() )
if ( !SvtCTLOptions::IsCTLFontEnabled() )
{
_rSet.DisableItem( nSlot );
nSlot = aIter.NextWhich();
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index e2c76a9..9ae446b 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -159,11 +159,10 @@ void impl_executeSearch( const css::uno::Reference< css::uno::XComponentContext
}
}
SvtCTLOptions aCTLOptions;
TransliterationFlags nFlags = TransliterationFlags::NONE;
if (!aMatchCase)
nFlags |= TransliterationFlags::IGNORE_CASE;
if (aCTLOptions.IsCTLFontEnabled())
if (SvtCTLOptions::IsCTLFontEnabled())
nFlags |= TransliterationFlags::IGNORE_DIACRITICS_CTL
| TransliterationFlags::IGNORE_KASHIDA_CTL;
diff --git a/svx/source/tbxctrls/verttexttbxctrl.cxx b/svx/source/tbxctrls/verttexttbxctrl.cxx
index 480f3cc..1f36ee6 100644
--- a/svx/source/tbxctrls/verttexttbxctrl.cxx
+++ b/svx/source/tbxctrls/verttexttbxctrl.cxx
@@ -103,8 +103,7 @@ void SAL_CALL SvxVertCTLTextTbxCtrl::statusChanged(const css::frame::FeatureStat
}
else if (rEvent.FeatureURL.Complete == ".uno:CTLFontState")
{
SvtCTLOptions aLangOptions;
bEnabled = m_bVisible && aLangOptions.IsCTLFontEnabled();
bEnabled = m_bVisible && SvtCTLOptions::IsCTLFontEnabled();
}
else
{
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index a9e1d2d..4349fac 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -1686,10 +1686,8 @@ SwCursor::DoSetBidiLevelLeftRight(
const SwTextNode& rTNd = *rNode.GetTextNode();
sal_Int32 nPos = GetPoint()->GetContentIndex();
const SvtCTLOptions& rCTLOptions = SW_MOD()->GetCTLOptions();
if ( bVisualAllowed && rCTLOptions.IsCTLFontEnabled() &&
SvtCTLOptions::MOVEMENT_VISUAL ==
rCTLOptions.GetCTLCursorMovement() )
if ( bVisualAllowed && SvtCTLOptions::IsCTLFontEnabled() &&
SvtCTLOptions::MOVEMENT_VISUAL == SvtCTLOptions::GetCTLCursorMovement() )
{
// for visual cursor travelling (used in bidi layout)
// we first have to convert the logic to a visual position
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index dd436e0..32b8b26 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1632,7 +1632,7 @@ void SwTextFormatInfo::CtorInitTextFormatInfo( OutputDevice* pRenderContext, SwT
SetLineStart(TextFrameIndex(0));
SvtCTLOptions::TextNumerals const nTextNumerals(
SW_MOD()->GetCTLOptions().GetCTLTextNumerals());
SvtCTLOptions::GetCTLTextNumerals());
// cannot cache for NUMERALS_CONTEXT because we need to know the string
// for the whole paragraph now
if (nTextNumerals != SvtCTLOptions::NUMERALS_CONTEXT)
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 41124ce..a495e31 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -729,7 +729,7 @@ SwDigitModeModifier::SwDigitModeModifier( const OutputDevice& rOutp, LanguageTyp
eLang = LANGUAGE_ENGLISH_US;
else
{
const SvtCTLOptions::TextNumerals nTextNumerals = SW_MOD()->GetCTLOptions().GetCTLTextNumerals();
const SvtCTLOptions::TextNumerals nTextNumerals = SvtCTLOptions::GetCTLTextNumerals();
if ( SvtCTLOptions::NUMERALS_HINDI == nTextNumerals )
eLang = LANGUAGE_ARABIC_SAUDI_ARABIA;
diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx
index a63867f..a52473a 100644
--- a/sw/source/core/view/printdata.cxx
+++ b/sw/source/core/view/printdata.cxx
@@ -171,7 +171,7 @@ SwPrintUIOptions::SwPrintUIOptions(
}
// check if either CJK or CTL is enabled
bool bRTL = SvtCJKOptions::IsCJKFontEnabled() || SvtCTLOptions().IsCTLFontEnabled();
bool bRTL = SvtCJKOptions::IsCJKFontEnabled() || SvtCTLOptions::IsCTLFontEnabled();
// create sequence of print UI options
// (5 options are not available for Writer-Web)
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 6fd2e17..329462a 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -332,7 +332,7 @@ SwAddPrinterTabPage::SwAddPrinterTabPage(weld::Container* pPage, weld::DialogCon
}
m_xProspectCB_RTL->set_sensitive(false);
SvtCTLOptions aCTLOptions;
m_xProspectCB_RTL->set_visible(aCTLOptions.IsCTLFontEnabled());
m_xProspectCB_RTL->set_visible(SvtCTLOptions::IsCTLFontEnabled());
}
SwAddPrinterTabPage::~SwAddPrinterTabPage()
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index 338e801..028b9f1 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -1298,7 +1298,7 @@ void SwColumnPage::SetFrameMode(bool bMod)
void SwColumnPage::SetInSection(bool bSet)
{
if(!SW_MOD()->GetCTLOptions().IsCTLFontEnabled())
if(!SvtCTLOptions::IsCTLFontEnabled())
return;
m_xTextDirectionFT->set_visible(bSet);
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index 11894c4..51bd251 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -111,7 +111,7 @@ SwFormatTablePage::SwFormatTablePage(weld::Container* pPage, weld::DialogControl
if(const SfxUInt16Item* pModeItem = rSet.GetItemIfSet(SID_HTML_MODE, false))
m_bHtmlMode = 0 != (pModeItem->GetValue() & HTMLMODE_ON);
bool bCTL = SW_MOD()->GetCTLOptions().IsCTLFontEnabled();
bool bCTL = SvtCTLOptions::IsCTLFontEnabled();
m_xProperties->set_visible(!m_bHtmlMode && bCTL);
Init();
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index b22c116..d4a05bf 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -616,7 +616,7 @@ IMPL_LINK_NOARG(ApplyStyle, ApplyHdl, LinkParamNone*, void)
m_xTmp->SetItemSet( aTmpSet );
if( SfxStyleFamily::Page == m_nFamily && SvtCTLOptions().IsCTLFontEnabled() )
if( SfxStyleFamily::Page == m_nFamily && SvtCTLOptions::IsCTLFontEnabled() )
{
const SfxPoolItem *pItem = nullptr;
if( aTmpSet.GetItemState( m_rDocSh.GetPool().GetTrueWhich( SID_ATTR_FRAMEDIRECTION, false ) , true, &pItem ) == SfxItemState::SET )
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index b7d1eb9..d2dd874 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -967,7 +967,7 @@ OUString SwDocStyleSheet::GetDescription(MapUnit eUnit)
case RES_CHRATR_CTL_LANGUAGE:
case RES_CHRATR_CTL_POSTURE:
case RES_CHRATR_CTL_WEIGHT:
if(aCTLOptions.IsCTLFontEnabled())
if(SvtCTLOptions::IsCTLFontEnabled())
bIsDefault = true;
if(!bHasCTLFontPrefix)
{
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 2c62684..ba62bb8 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -764,9 +764,8 @@ void SwEditWin::StopInsFrame()
bool SwEditWin::IsInputSequenceCheckingRequired( const OUString &rText, const SwPaM& rCursor )
{
const SvtCTLOptions& rCTLOptions = SW_MOD()->GetCTLOptions();
if ( !rCTLOptions.IsCTLFontEnabled() ||
!rCTLOptions.IsCTLSequenceChecking() )
if ( !SvtCTLOptions::IsCTLFontEnabled() ||
!SvtCTLOptions::IsCTLSequenceChecking() )
return false;
if ( 0 == rCursor.Start()->GetContentIndex() ) /* first char needs not to be checked */
@@ -912,17 +911,15 @@ void SwEditWin::FlushInBuffer()
const OUString aOldText( rSh.GetCursor()->GetText() );
const sal_Int32 nOldLen = aOldText.getLength();
SvtCTLOptions& rCTLOptions = SW_MOD()->GetCTLOptions();
sal_Int32 nExpandSelection = 0;
if (nOldLen > 0)
{
sal_Int32 nTmpPos = nOldLen;
sal_Int16 nCheckMode = rCTLOptions.IsCTLSequenceCheckingRestricted() ?
sal_Int16 nCheckMode = SvtCTLOptions::IsCTLSequenceCheckingRestricted() ?
i18n::InputSequenceCheckMode::STRICT : i18n::InputSequenceCheckMode::BASIC;
OUString aNewText( aOldText );
if (rCTLOptions.IsCTLSequenceCheckingTypeAndReplace())
if (SvtCTLOptions::IsCTLSequenceCheckingTypeAndReplace())
{
for( sal_Int32 k = 0; k < m_aInBuffer.getLength(); ++k)
{
@@ -5830,7 +5827,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
nSlot = SID_ATTR_PARA_LEFT_TO_RIGHT;
else if(!pCommandData->IsLeftShift() && pCommandData->IsRightShift())
nSlot = SID_ATTR_PARA_RIGHT_TO_LEFT;
if(nSlot && SW_MOD()->GetCTLOptions().IsCTLFontEnabled())
if(nSlot && SvtCTLOptions::IsCTLFontEnabled())
GetView().GetViewFrame().GetDispatcher()->Execute(nSlot);
}
}
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index 4901123..4343cd8 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -809,7 +809,7 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet)
case SID_ATTR_PARA_LEFT_TO_RIGHT:
case SID_ATTR_PARA_RIGHT_TO_LEFT:
{
if ( !SvtCTLOptions().IsCTLFontEnabled() )
if ( !SvtCTLOptions::IsCTLFontEnabled() )
rSet.DisableItem( nWhich );
else
{
@@ -842,8 +842,7 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet)
case SID_INSERT_RLM :
case SID_INSERT_LRM :
{
SvtCTLOptions aCTLOptions;
bool bEnabled = aCTLOptions.IsCTLFontEnabled();
bool bEnabled = SvtCTLOptions::IsCTLFontEnabled();
m_rView.GetViewFrame().GetBindings().SetVisibleState( nWhich, bEnabled );
if(!bEnabled)
rSet.DisableItem(nWhich);
diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx
index 9042e7f..44ad4bd 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -878,7 +878,7 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet)
case SID_ATTR_PARA_LEFT_TO_RIGHT:
case SID_ATTR_PARA_RIGHT_TO_LEFT:
{
if (!SvtCTLOptions().IsCTLFontEnabled())
if (!SvtCTLOptions::IsCTLFontEnabled())
{
rSet.DisableItem(nWhich);
nSlotId = 0;
@@ -926,8 +926,7 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet)
case SID_INSERT_RLM:
case SID_INSERT_LRM:
{
SvtCTLOptions aCTLOptions;
bool bEnabled = aCTLOptions.IsCTLFontEnabled();
bool bEnabled = SvtCTLOptions::IsCTLFontEnabled();
GetView().GetViewFrame().GetBindings().SetVisibleState(nWhich, bEnabled);
if (!bEnabled)
rSet.DisableItem(nWhich);
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index fb5e2f8..02f4fce 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -2751,8 +2751,7 @@ void SwTextShell::GetState( SfxItemSet &rSet )
case SID_INSERT_RLM :
case SID_INSERT_LRM :
{
SvtCTLOptions aCTLOptions;
bool bEnabled = aCTLOptions.IsCTLFontEnabled();
bool bEnabled = SvtCTLOptions::IsCTLFontEnabled();
GetView().GetViewFrame().GetBindings().SetVisibleState( nWhich, bEnabled );
if(!bEnabled)
rSet.DisableItem(nWhich);
diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx
index 6a916f2..c5c90c8 100644
--- a/sw/source/uibase/shells/txtattr.cxx
+++ b/sw/source/uibase/shells/txtattr.cxx
@@ -770,7 +770,7 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet)
case SID_ATTR_PARA_LEFT_TO_RIGHT :
case SID_ATTR_PARA_RIGHT_TO_LEFT :
{
if ( !SW_MOD()->GetCTLOptions().IsCTLFontEnabled() )
if ( !SvtCTLOptions::IsCTLFontEnabled() )
{
rSet.DisableItem( nSlot );
nSlot = 0;
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx
index 820ae0b..a272fae 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -425,7 +425,7 @@ void SwView::ExecSearch(SfxRequest& rReq)
SfxItemSet aSet(m_pWrtShell->GetAttrPool(), aNormalAttr);
if( SW_MOD()->GetCTLOptions().IsCTLFontEnabled() )
if( SvtCTLOptions::IsCTLFontEnabled() )
{
aSet.MergeRange(RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_WEIGHT);
}
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index 90140a5..6bf7edd 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -612,14 +612,12 @@ uno::Reference < i18n::XExtendedInputSequenceChecker > const & TextEngine::GetIn
bool TextEngine::IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelection& rCurSel ) const
{
SvtCTLOptions aCTLOptions;
// get the index that really is first
const sal_Int32 nFirstPos = std::min(rCurSel.GetStart().GetIndex(), rCurSel.GetEnd().GetIndex());
bool bIsSequenceChecking =
aCTLOptions.IsCTLFontEnabled() &&
aCTLOptions.IsCTLSequenceChecking() &&
SvtCTLOptions::IsCTLFontEnabled() &&
SvtCTLOptions::IsCTLSequenceChecking() &&
nFirstPos != 0; /* first char needs not to be checked */
if (bIsSequenceChecking)
@@ -666,18 +664,17 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel,
if (bIsUserInput && IsInputSequenceCheckingRequired( c, rCurSel ))
{
uno::Reference < i18n::XExtendedInputSequenceChecker > xISC = GetInputSequenceChecker();
SvtCTLOptions aCTLOptions;
if (xISC.is())
{
sal_Int32 nTmpPos = aPaM.GetIndex();
sal_Int16 nCheckMode = aCTLOptions.IsCTLSequenceCheckingRestricted() ?
sal_Int16 nCheckMode = SvtCTLOptions::IsCTLSequenceCheckingRestricted() ?
i18n::InputSequenceCheckMode::STRICT : i18n::InputSequenceCheckMode::BASIC;
// the text that needs to be checked is only the one
// before the current cursor position
OUString aOldText( mpDoc->GetText( aPaM.GetPara() ).copy(0, nTmpPos) );
if (aCTLOptions.IsCTLSequenceCheckingTypeAndReplace())
if (SvtCTLOptions::IsCTLSequenceCheckingTypeAndReplace())
{
OUString aNewText( aOldText );
xISC->correctInputSequence( aNewText, nTmpPos - 1, c, nCheckMode );