diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-26 13:51:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-27 11:58:23 +0200 |
commit | 5db72ef0b381671b7867bda759098a92909e06d8 (patch) | |
tree | 986bc625c30f226a2498791ed4a6463f2b6fd913 | |
parent | f8ddaaf0f5e1fb61e0d4404ea28757bc652ae4be (diff) |
drop SvtLanguageOptions class
since it is just a wrapper over SvtCJKOptions and SvtCTLOptions.
Later I will replace those two with the equivalent officecfg calls
Change-Id: I61c5667a05f75d42643175f2c28c29d7a590b15c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119516
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
32 files changed, 136 insertions, 222 deletions
diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx index b941deab6ab9..4be4d1918bb4 100644 --- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx +++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx @@ -48,6 +48,7 @@ #include <com/sun/star/chart2/XAxis.hpp> #include <svl/intitem.hxx> #include <svl/languageoptions.hxx> +#include <svl/ctloptions.hxx> #include <svx/svxids.hrc> @@ -462,7 +463,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 (SvtLanguageOptions().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 f6642c920968..85caad7560e2 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -93,6 +93,7 @@ #include <com/sun/star/view/XSelectionSupplier.hpp> #include <svl/itempool.hxx> #include <svl/languageoptions.hxx> +#include <svl/ctloptions.hxx> #include <comphelper/classids.hxx> #include <servicenames_charttypes.hxx> @@ -1258,7 +1259,7 @@ bool lcl_IsPieOrDonut( const uno::Reference< XDiagram >& xDiagram ) void lcl_setDefaultWritingMode( const std::shared_ptr< DrawModelWrapper >& pDrawModelWrapper, ChartModel& rModel) { //get writing mode from parent document: - if( !SvtLanguageOptions().IsCTLFontEnabled() ) + if( !SvtCTLOptions().IsCTLFontEnabled() ) return; try diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx index 0e3ea7de79e9..1cc1303241a0 100644 --- a/chart2/source/view/main/VLegend.cxx +++ b/chart2/source/view/main/VLegend.cxx @@ -41,6 +41,7 @@ #include <com/sun/star/chart2/data/PivotTableFieldEntry.hpp> #include <rtl/math.hxx> #include <svl/languageoptions.hxx> +#include <svl/ctloptions.hxx> #include <tools/diagnose_ex.h> #include <tools/UnitConversion.hxx> @@ -800,7 +801,7 @@ bool lcl_shouldSymbolsBePlacedOnTheLeftSide( const Reference< beans::XPropertySe bool bSymbolsLeftSide = true; try { - if( SvtLanguageOptions().IsCTLFontEnabled() ) + if( SvtCTLOptions().IsCTLFontEnabled() ) { if(xLegendProp.is()) { diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index e55eca6dcf09..ba3d77e88da5 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -31,6 +31,8 @@ #include <i18nlangtag/languagetag.hxx> #include <unotools/compatibility.hxx> #include <svl/languageoptions.hxx> +#include <svl/cjkoptions.hxx> +#include <svl/ctloptions.hxx> #include <svtools/miscopt.hxx> #include <unotools/syslocaleoptions.hxx> #include <sfx2/objsh.hxx> @@ -985,7 +987,8 @@ void OfaViewTabPage::UpdateHardwareAccelStatus() struct LanguageConfig_Impl { - SvtLanguageOptions aLanguageOptions; + SvtCJKOptions aCJKLanguageOptions; + SvtCTLOptions aCTLLanguageOptions; SvtSysLocaleOptions aSysLocaleOptions; SvtLinguConfig aLinguConfig; }; @@ -1183,17 +1186,17 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(weld::Container* pPage, weld::DialogCon m_xAsianSupportCB->connect_toggled( aLink ); m_xCTLSupportCB->connect_toggled( aLink ); - m_bOldAsian = pLangConfig->aLanguageOptions.IsAnyEnabled(); + m_bOldAsian = pLangConfig->aCJKLanguageOptions.IsAnyEnabled(); m_xAsianSupportCB->set_active(m_bOldAsian); m_xAsianSupportCB->save_state(); - bool bReadonly = pLangConfig->aLanguageOptions.IsReadOnly(SvtLanguageOptions::E_ALLCJK); + bool bReadonly = pLangConfig->aCJKLanguageOptions.IsReadOnly(SvtCJKOptions::E_ALL); m_xAsianSupportCB->set_sensitive(!bReadonly); SupportHdl(*m_xAsianSupportCB); - m_bOldCtl = pLangConfig->aLanguageOptions.IsCTLFontEnabled(); + m_bOldCtl = pLangConfig->aCTLLanguageOptions.IsCTLFontEnabled(); m_xCTLSupportCB->set_active(m_bOldCtl); m_xCTLSupportCB->save_state(); - bReadonly = pLangConfig->aLanguageOptions.IsReadOnly(SvtLanguageOptions::E_CTLFONT); + bReadonly = pLangConfig->aCTLLanguageOptions.IsReadOnly(SvtCTLOptions::E_CTLFONT); m_xCTLSupportCB->set_sensitive(!bReadonly); SupportHdl(*m_xCTLSupportCB); @@ -1231,7 +1234,8 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet ) { // lock configuration broadcasters so that we can coordinate the notifications pLangConfig->aSysLocaleOptions.BlockBroadcasts( true ); - pLangConfig->aLanguageOptions.BlockBroadcasts( true ); + pLangConfig->aCTLLanguageOptions.BlockBroadcasts( true ); + pLangConfig->aCJKLanguageOptions.BlockBroadcasts( true ); pLangConfig->aLinguConfig.BlockBroadcasts( true ); /* @@ -1250,9 +1254,9 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet ) //sequence checking has to be switched on depending on the selected CTL language LanguageType eCTLLang = m_xComplexLanguageLB->get_active_id(); bool bOn = MsLangId::needsSequenceChecking( eCTLLang); - pLangConfig->aLanguageOptions.SetCTLSequenceCheckingRestricted(bOn); - pLangConfig->aLanguageOptions.SetCTLSequenceChecking(bOn); - pLangConfig->aLanguageOptions.SetCTLSequenceCheckingTypeAndReplace(bOn); + pLangConfig->aCTLLanguageOptions.SetCTLSequenceCheckingRestricted(bOn); + pLangConfig->aCTLLanguageOptions.SetCTLSequenceChecking(bOn); + pLangConfig->aCTLLanguageOptions.SetCTLSequenceCheckingTypeAndReplace(bOn); } try { @@ -1421,7 +1425,7 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet ) if(m_xAsianSupportCB->get_state_changed_from_saved() ) { bool bChecked = m_xAsianSupportCB->get_active(); - pLangConfig->aLanguageOptions.SetAll(bChecked); + pLangConfig->aCJKLanguageOptions.SetAll(bChecked); //iterate over all bindings to invalidate vertical text direction const sal_uInt16 STATE_COUNT = 2; @@ -1443,7 +1447,7 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet ) aOpt.SetIgnoreDiacritics_CTL(true); aOpt.SetIgnoreKashida_CTL(true); aOpt.Commit(); - pLangConfig->aLanguageOptions.SetCTLFontEnabled( m_xCTLSupportCB->get_active() ); + pLangConfig->aCTLLanguageOptions.SetCTLFontEnabled( m_xCTLSupportCB->get_active() ); const sal_uInt16 STATE_COUNT = 1; std::unique_ptr<SfxBoolItem> pBoolItems[STATE_COUNT]; @@ -1460,7 +1464,8 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet ) // it seems that our code relies on the fact that before other changes like e.g. currency // are broadcasted locale changes have been done pLangConfig->aSysLocaleOptions.BlockBroadcasts( false ); - pLangConfig->aLanguageOptions.BlockBroadcasts( false ); + pLangConfig->aCJKLanguageOptions.BlockBroadcasts( false ); + pLangConfig->aCTLLanguageOptions.BlockBroadcasts( false ); pLangConfig->aLinguConfig.BlockBroadcasts( false ); return false; @@ -1659,7 +1664,7 @@ IMPL_LINK_NOARG(OfaLanguagesTabPage, LocaleSettingHdl, weld::ComboBox&, void) SvtScriptType nType = SvtLanguageOptions::GetScriptTypeOfLanguage(eLang); // first check if CTL must be enabled // #103299# - if CTL font setting is not readonly - if(!pLangConfig->aLanguageOptions.IsReadOnly(SvtLanguageOptions::E_CTLFONT)) + if(!pLangConfig->aCTLLanguageOptions.IsReadOnly(SvtCTLOptions::E_CTLFONT)) { bool bIsCTLFixed = bool(nType & SvtScriptType::COMPLEX); lcl_checkLanguageCheckBox(*m_xCTLSupportCB, bIsCTLFixed, m_bOldCtl); @@ -1667,7 +1672,7 @@ IMPL_LINK_NOARG(OfaLanguagesTabPage, LocaleSettingHdl, weld::ComboBox&, void) } // second check if CJK must be enabled // #103299# - if CJK support is not readonly - if(!pLangConfig->aLanguageOptions.IsReadOnly(SvtLanguageOptions::E_ALLCJK)) + if(!pLangConfig->aCJKLanguageOptions.IsReadOnly(SvtCJKOptions::E_ALL)) { bool bIsCJKFixed = bool(nType & SvtScriptType::ASIAN); lcl_checkLanguageCheckBox(*m_xAsianSupportCB, bIsCJKFixed, m_bOldAsian); diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 0d617a8d3552..14263c10a782 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -90,6 +90,8 @@ #include <svl/flagitem.hxx> #include <svl/intitem.hxx> #include <svl/languageoptions.hxx> +#include <svl/cjkoptions.hxx> +#include <svl/ctloptions.hxx> #include <svx/databaseregistrationui.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/urlobj.hxx> @@ -1416,7 +1418,8 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) } // Language options - SvtLanguageOptions aLanguageOptions; + SvtCJKOptions aCJKLanguageOptions; + SvtCTLOptions aCTLLanguageOptions; if ( !lcl_isOptionHidden( SID_LANGUAGE_OPTIONS, aOptionsDlgOpt ) ) { setGroupName(u"LanguageSettings", CuiResId(SID_LANGUAGE_OPTIONS_RES[0].first)); @@ -1426,9 +1429,9 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) nPageId = static_cast<sal_uInt16>(SID_LANGUAGE_OPTIONS_RES[i].second); if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) ) continue; - if ( ( RID_SVXPAGE_JSEARCH_OPTIONS != nPageId || aLanguageOptions.IsJapaneseFindEnabled() ) && - ( RID_SVXPAGE_ASIAN_LAYOUT != nPageId || aLanguageOptions.IsAsianTypographyEnabled() ) && - ( RID_SVXPAGE_OPTIONS_CTL != nPageId || aLanguageOptions.IsCTLFontEnabled() ) ) + if ( ( RID_SVXPAGE_JSEARCH_OPTIONS != nPageId || aCJKLanguageOptions.IsJapaneseFindEnabled() ) && + ( RID_SVXPAGE_ASIAN_LAYOUT != nPageId || aCJKLanguageOptions.IsAsianTypographyEnabled() ) && + ( RID_SVXPAGE_OPTIONS_CTL != nPageId || aCTLLanguageOptions.IsCTLFontEnabled() ) ) AddTabPage(nPageId, CuiResId(SID_LANGUAGE_OPTIONS_RES[i].first), nGroup); } } @@ -1458,8 +1461,8 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) nPageId = static_cast<sal_uInt16>(SID_SW_EDITOPTIONS_RES[i].second); if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) ) continue; - if ( ( RID_SW_TP_STD_FONT_CJK != nPageId || aLanguageOptions.IsCJKFontEnabled() ) && - ( RID_SW_TP_STD_FONT_CTL != nPageId || aLanguageOptions.IsCTLFontEnabled() ) && + if ( ( RID_SW_TP_STD_FONT_CJK != nPageId || aCJKLanguageOptions.IsCJKFontEnabled() ) && + ( RID_SW_TP_STD_FONT_CTL != nPageId || aCTLLanguageOptions.IsCTLFontEnabled() ) && ( RID_SW_TP_MAILCONFIG != nPageId || MailMergeCfg_Impl().IsEmailSupported() ) ) 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 42619a063d98..3eadffd81c65 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -33,6 +33,8 @@ #include <sfx2/module.hxx> #include <svl/eitem.hxx> #include <svl/languageoptions.hxx> +#include <svl/cjkoptions.hxx> +#include <svl/ctloptions.hxx> #include <svx/SmartTagMgr.hxx> #include <com/sun/star/smarttags/XSmartTagRecognizer.hpp> #include <rtl/strbuf.hxx> @@ -103,9 +105,9 @@ OfaAutoCorrDlg::OfaAutoCorrDlg(weld::Window* pParent, const SfxItemSet* _pSet ) //! will be set to LANGUAGE_UNDETERMINED SvxLanguageListFlags nLangList = SvxLanguageListFlags::WESTERN; - if( SvtLanguageOptions().IsCTLFontEnabled() ) + if( SvtCTLOptions().IsCTLFontEnabled() ) nLangList |= SvxLanguageListFlags::CTL; - if( SvtLanguageOptions().IsCJKFontEnabled() ) + if( SvtCJKOptions().IsCJKFontEnabled() ) nLangList |= SvxLanguageListFlags::CJK; m_xLanguageLB->SetLanguageList( nLangList, true, true ); m_xLanguageLB->set_active_id( LANGUAGE_NONE ); diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 821dac2bad05..051ede05495e 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -24,6 +24,8 @@ #include <svx/svxids.hrc> #include <svtools/unitconv.hxx> #include <svl/languageoptions.hxx> +#include <svl/cjkoptions.hxx> +#include <svl/ctloptions.hxx> #include <chardlg.hxx> #include <editeng/fontitem.hxx> #include <editeng/postitem.hxx> @@ -218,9 +220,10 @@ SvxCharNamePage::SvxCharNamePage(weld::Container* pPage, weld::DialogController* #endif m_pImpl->m_aNoStyleText = CuiResId( RID_SVXSTR_CHARNAME_NOSTYLE ); - SvtLanguageOptions aLanguageOptions; - bool bShowCJK = aLanguageOptions.IsCJKFontEnabled(); - bool bShowCTL = aLanguageOptions.IsCTLFontEnabled(); + SvtCJKOptions aCJKLanguageOptions; + SvtCTLOptions aCTLLanguageOptions; + bool bShowCJK = aCJKLanguageOptions.IsCJKFontEnabled(); + bool bShowCTL = aCTLLanguageOptions.IsCTLFontEnabled(); bool bShowNonWestern = bShowCJK || bShowCTL; if (bShowNonWestern) @@ -1415,7 +1418,7 @@ void SvxCharEffectsPage::Initialize() m_xOutlineBtn->connect_toggled(LINK(this, SvxCharEffectsPage, OutlineBtnClickHdl)); m_xShadowBtn->connect_toggled(LINK(this, SvxCharEffectsPage, ShadowBtnClickHdl)); - if ( !SvtLanguageOptions().IsAsianTypographyEnabled() ) + if ( !SvtCJKOptions().IsAsianTypographyEnabled() ) { m_xEmphasisFT->hide(); m_xEmphasisLB->hide(); diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index 44f29780904c..f3d0bfe79987 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -22,6 +22,8 @@ #include <sfx2/printer.hxx> #include <sfx2/viewsh.hxx> #include <svl/languageoptions.hxx> +#include <svl/cjkoptions.hxx> +#include <svl/ctloptions.hxx> #include <svtools/unitconv.hxx> #include <vcl/svapp.hxx> #include <vcl/weld.hxx> @@ -190,9 +192,10 @@ SvxPageDescPage::SvxPageDescPage(weld::Container* pPage, weld::DialogController* // this page needs ExchangeSupport SetExchangeSupport(); - SvtLanguageOptions aLangOptions; - bool bCJK = aLangOptions.IsAsianTypographyEnabled(); - bool bCTL = aLangOptions.IsCTLFontEnabled(); + SvtCTLOptions aCTLLanguageOptions; + SvtCJKOptions aCJKLanguageOptions; + bool bCJK = aCJKLanguageOptions.IsAsianTypographyEnabled(); + bool bCTL = aCTLLanguageOptions.IsCTLFontEnabled(); bool bWeb = false; const SfxPoolItem* pItem; diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index 015853180882..d91507c81208 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -994,10 +994,10 @@ SvxParaAlignTabPage::SvxParaAlignTabPage(weld::Container* pPage, weld::DialogCon { SetExchangeSupport(); - SvtLanguageOptions aLangOptions; + SvtCJKOptions aCJKLanguageOptions; sal_uInt16 nLastLinePos = LASTLINEPOS_DEFAULT; - if ( aLangOptions.IsAsianTypographyEnabled() ) + if ( aCJKLanguageOptions.IsAsianTypographyEnabled() ) { m_xLeft->set_label(m_xLeftBottom->get_label()); m_xRight->set_label(m_xRightTop->get_label()); @@ -1326,7 +1326,7 @@ void SvxParaAlignTabPage::EnableJustifyExt() m_xLastLineFT->show(); m_xLastLineLB->show(); m_xExpandCB->show(); - SvtLanguageOptions aCJKOptions; + SvtCJKOptions aCJKOptions; if (aCJKOptions.IsAsianTypographyEnabled()) m_xSnapToGridCB->show(); diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 828ba1be3d5f..bcfc1fd63c37 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -47,6 +47,8 @@ #include <i18nlangtag/languagetag.hxx> #include <o3tl/char16_t2wchar_t.hxx> #include <svl/languageoptions.hxx> +#include <svl/cjkoptions.hxx> +#include <svl/ctloptions.hxx> #include <svtools/javacontext.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/frame/theAutoRecovery.hpp> @@ -1219,7 +1221,8 @@ struct ExecuteGlobals Reference < css::document::XDocumentEventListener > xGlobalBroadcaster; bool bRestartRequested; bool bUseSystemFileDialog; - std::unique_ptr<SvtLanguageOptions> pLanguageOptions; + std::unique_ptr<SvtCJKOptions> pCJKLanguageOptions; + std::unique_ptr<SvtCTLOptions> pCTLLanguageOptions; std::unique_ptr<SvtPathOptions> pPathOptions; rtl::Reference< JVMloadThread > xJVMloadThread; @@ -1453,7 +1456,8 @@ int Desktop::Main() #endif // keep a language options instance... - pExecGlobals->pLanguageOptions.reset( new SvtLanguageOptions(true)); + pExecGlobals->pCJKLanguageOptions.reset( new SvtCJKOptions(true)); + pExecGlobals->pCTLLanguageOptions.reset( new SvtCTLOptions(true)); css::document::DocumentEvent aEvent; aEvent.EventName = "OnStartApp"; @@ -1699,7 +1703,8 @@ int Desktop::doShutdown() // be sure that path/language options gets destroyed before // UCB is deinitialized - pExecGlobals->pLanguageOptions.reset(); + pExecGlobals->pCJKLanguageOptions.reset(); + pExecGlobals->pCTLLanguageOptions.reset(); pExecGlobals->pPathOptions.reset(); comphelper::ThreadPool::getSharedOptimalPool().shutdown(); diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx index 8742820dde51..cc93f249bbd6 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -57,6 +57,7 @@ class NotifyEvent; class SfxInPlaceClient; namespace vcl { class PrinterController; } +namespace com::sun::star::beans { struct PropertyValue; } namespace com::sun::star::datatransfer::clipboard { class XClipboardListener; } namespace com::sun::star::datatransfer::clipboard { class XClipboardNotifier; } namespace com::sun::star::embed { class XEmbeddedObject; } diff --git a/include/svl/languageoptions.hxx b/include/svl/languageoptions.hxx index 9ae8475dd9eb..a7f229c69025 100644 --- a/include/svl/languageoptions.hxx +++ b/include/svl/languageoptions.hxx @@ -22,7 +22,6 @@ #include <svl/svldllapi.h> #include <sal/types.h> #include <o3tl/typed_flags_set.hxx> -#include <unotools/configitem.hxx> #include <unotools/options.hxx> #include <i18nlangtag/lang.h> #include <memory> @@ -44,69 +43,35 @@ namespace o3tl template<> struct typed_flags<SvtScriptType> : is_typed_flags<SvtScriptType, 0x0f> {}; } -class SvtCJKOptions; -class SvtCTLOptions; - -class SVL_DLLPUBLIC SvtLanguageOptions final : public ::utl::detail::Options +namespace SvtLanguageOptions { -private: - std::unique_ptr<SvtCJKOptions> m_pCJKOptions; - std::unique_ptr<SvtCTLOptions> m_pCTLOptions; - -public: - enum EOption - { - // cjk options - E_CJKFONT, - E_VERTICALTEXT, - E_ASIANTYPOGRAPHY, - E_JAPANESEFIND, - E_RUBY, - E_CHANGECASEMAP, - E_DOUBLELINES, - E_EMPHASISMARKS, - E_VERTICALCALLOUT, - E_ALLCJK, - // ctl options - E_CTLFONT, - E_CTLSEQUENCECHECKING, - E_CTLCURSORMOVEMENT, - E_CTLTEXTNUMERALS - }; - - // bDontLoad is for referencing purposes only - SvtLanguageOptions( bool _bDontLoad = false ); - virtual ~SvtLanguageOptions() override; - // CJK options - bool IsCJKFontEnabled() const; - bool IsVerticalTextEnabled() const; - bool IsAsianTypographyEnabled() const; - bool IsJapaneseFindEnabled() const; - void SetAll( bool _bSet ); - bool IsAnyEnabled() const; +// SVL_DLLPUBLIC bool IsCJKFontEnabled() { m_pCJKOptions->IsCJKFontEnabled(); } +// SVL_DLLPUBLIC bool IsVerticalTextEnabled() m_pCJKOptions->IsVerticalTextEnabled(); +// SVL_DLLPUBLIC bool IsAsianTypographyEnabled() m_pCJKOptions->IsAsianTypographyEnabled(); +// SVL_DLLPUBLIC bool IsJapaneseFindEnabled() m_pCJKOptions->IsJapaneseFindEnabled(); +// SVL_DLLPUBLIC void SetAll( bool _bSet ) m_pCJKOptions->SetAll( _bSet ); +// SVL_DLLPUBLIC bool IsAnyEnabled() m_pCJKOptions->IsAnyEnabled(); // CTL options - void SetCTLFontEnabled( bool _bEnabled ); - bool IsCTLFontEnabled() const; - - void SetCTLSequenceChecking( bool _bEnabled ); + //SVL_DLLPUBLIC void SetCTLFontEnabled( bool _bEnabled ) m_pCTLOptions->SetCTLFontEnabled( _bEnabled ); +// SVL_DLLPUBLIC bool IsCTLFontEnabled() m_pCTLOptions->IsCTLFontEnabled(); - void SetCTLSequenceCheckingRestricted( bool _bEnable ); +// SVL_DLLPUBLIC void SetCTLSequenceChecking( bool _bEnabled ) m_pCTLOptions->SetCTLSequenceChecking( _bEnabled ); - void SetCTLSequenceCheckingTypeAndReplace( bool _bEnable ); + //SVL_DLLPUBLIC void SetCTLSequenceCheckingRestricted( bool _bEnable ) m_pCTLOptions->SetCTLSequenceCheckingRestricted( _bEnable ); - bool IsReadOnly(EOption eOption) const; +// SVL_DLLPUBLIC void SetCTLSequenceCheckingTypeAndReplace( bool _bEnable ) m_pCTLOptions->SetCTLSequenceCheckingTypeAndReplace( _bEnable ); // returns for a language the scripttype - static SvtScriptType GetScriptTypeOfLanguage( LanguageType nLang ); + SVL_DLLPUBLIC SvtScriptType GetScriptTypeOfLanguage( LanguageType nLang ); // convert from css::i18n::ScriptType constants to SvtScriptType - static SvtScriptType FromI18NToSvtScriptType( sal_Int16 nI18NType ); + SVL_DLLPUBLIC SvtScriptType FromI18NToSvtScriptType( sal_Int16 nI18NType ); - static sal_Int16 FromSvtScriptTypeToI18N( SvtScriptType nI18NType ); + SVL_DLLPUBLIC sal_Int16 FromSvtScriptTypeToI18N( SvtScriptType nI18NType ); - static sal_Int16 GetI18NScriptTypeOfLanguage( LanguageType nLang ); + SVL_DLLPUBLIC sal_Int16 GetI18NScriptTypeOfLanguage( LanguageType nLang ); }; diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index c681c4878a42..8f7d7402bdaf 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -88,6 +88,9 @@ namespace sfx2 { class LinkManager; } +namespace com::sun::star::beans { + struct PropertyValue; +} enum class SdrHintKind diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 932b287beb2a..d1a799a74778 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -35,6 +35,7 @@ #include <svl/intitem.hxx> #include <svl/zforlist.hxx> #include <svl/zformat.hxx> +#include <svl/ctloptions.hxx> #include <unotools/transliterationwrapper.hxx> #include <sal/log.hxx> #include <osl/diagnose.h> @@ -224,7 +225,7 @@ void ScDocument::ModifyStyleSheet( SfxStyleSheetBase& rStyleSheet, if ( (nOldScale != nNewScale) || (nOldScaleToPages != nNewScaleToPages) ) InvalidateTextWidth( rStyleSheet.GetName() ); - if( SvtLanguageOptions().IsCTLFontEnabled() ) + if( SvtCTLOptions().IsCTLFontEnabled() ) { const SfxPoolItem *pItem = nullptr; if( rChanges.GetItemState(ATTR_WRITINGDIR, true, &pItem ) == SfxItemState::SET ) diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index 553c6dc8370b..876817538a98 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -55,6 +55,8 @@ #include <svl/stritem.hxx> #include <svl/whiter.hxx> #include <svl/languageoptions.hxx> +#include <svl/cjkoptions.hxx> +#include <svl/ctloptions.hxx> #include <svx/svxdlg.hxx> #include <vcl/EnumContext.hxx> @@ -962,9 +964,8 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet ) // issue 21255 - Notes now support rich text formatting. } - SvtLanguageOptions aLangOpt; - bool bDisableCTLFont = !aLangOpt.IsCTLFontEnabled(); - bool bDisableVerticalText = !aLangOpt.IsVerticalTextEnabled(); + bool bDisableCTLFont = !SvtCTLOptions().IsCTLFontEnabled(); + bool bDisableVerticalText = !SvtCJKOptions().IsVerticalTextEnabled(); SdrView* pView = mrViewData.GetScDrawView(); SfxItemSet aAttrSet(pView->GetModel()->GetItemPool()); diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index cb67ced9817f..3a9a214050df 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -35,6 +35,8 @@ #include <svl/stritem.hxx> #include <svl/zformat.hxx> #include <svl/languageoptions.hxx> +#include <svl/cjkoptions.hxx> +#include <svl/ctloptions.hxx> #include <editeng/boxitem.hxx> #include <editeng/langitem.hxx> #include <svx/numinf.hxx> @@ -2746,9 +2748,8 @@ void ScFormatShell::GetTextDirectionState( SfxItemSet& rSet ) eBidiDir = EEHorizontalTextDirection::L2R; } - SvtLanguageOptions aLangOpt; - bool bDisableCTLFont = !aLangOpt.IsCTLFontEnabled(); - bool bDisableVerticalText = !aLangOpt.IsVerticalTextEnabled(); + bool bDisableCTLFont = !SvtCTLOptions().IsCTLFontEnabled(); + bool bDisableVerticalText = !SvtCJKOptions().IsVerticalTextEnabled(); SfxWhichIter aIter( rSet ); sal_uInt16 nWhich = aIter.FirstWhich(); diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx index af00b3bdb76d..578f77edbf66 100644 --- a/sc/source/ui/view/tabvwsh2.cxx +++ b/sc/source/ui/view/tabvwsh2.cxx @@ -23,6 +23,8 @@ #include <svl/whiter.hxx> #include <unotools/moduleoptions.hxx> #include <svl/languageoptions.hxx> +#include <svl/cjkoptions.hxx> +#include <svl/ctloptions.hxx> #include <sfx2/dispatch.hxx> #include <tools/UnitConversion.hxx> @@ -426,7 +428,7 @@ void ScTabViewShell::GetDrawState(SfxItemSet &rSet) case SID_DRAW_TEXT_VERTICAL: case SID_DRAW_CAPTION_VERTICAL: - if ( !SvtLanguageOptions().IsVerticalTextEnabled() ) + if ( !SvtCJKOptions().IsVerticalTextEnabled() ) rSet.DisableItem( nWhich ); else rSet.Put( SfxBoolItem( nWhich, nDrawSfxId == nWhich ) ); diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index 57b0bf6696d1..41f53159b174 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -27,6 +27,7 @@ #include <basic/sbstar.hxx> #include <basic/sberrors.hxx> #include <svl/languageoptions.hxx> +#include <svl/ctloptions.hxx> #include <svl/stritem.hxx> #include <svl/whiter.hxx> #include <vcl/svapp.hxx> @@ -972,8 +973,7 @@ void ScTabViewShell::GetStateTable( SfxItemSet& rSet ) case FID_TAB_RTL: { - SvtLanguageOptions aLangOpt; - if ( !aLangOpt.IsCTLFontEnabled() ) + if ( !SvtCTLOptions().IsCTLFontEnabled() ) rSet.DisableItem( nWhich ); else rSet.Put( SfxBoolItem( nWhich, rDoc.IsLayoutRTL( nTab ) ) ); diff --git a/sd/source/ui/controller/slidelayoutcontroller.cxx b/sd/source/ui/controller/slidelayoutcontroller.cxx index 1fcef5fa98de..989dd9493db5 100644 --- a/sd/source/ui/controller/slidelayoutcontroller.cxx +++ b/sd/source/ui/controller/slidelayoutcontroller.cxx @@ -26,6 +26,7 @@ #include <vcl/toolbox.hxx> #include <svl/languageoptions.hxx> +#include <svl/cjkoptions.hxx> #include <svtools/toolbarmenu.hxx> #include <svtools/valueset.hxx> @@ -180,8 +181,7 @@ LayoutToolbarMenu::LayoutToolbarMenu(SlideLayoutController* pControl, weld::Widg OSL_ASSERT(false); } - SvtLanguageOptions aLanguageOptions; - const bool bVerticalEnabled = aLanguageOptions.IsVerticalTextEnabled(); + const bool bVerticalEnabled = SvtCJKOptions().IsVerticalTextEnabled(); mxLayoutSet1->SetSelectHdl( LINK( this, LayoutToolbarMenu, SelectValueSetHdl ) ); diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx index 469ee474a222..4f4ee2ca59b5 100644 --- a/sd/source/ui/sidebar/LayoutMenu.cxx +++ b/sd/source/ui/sidebar/LayoutMenu.cxx @@ -47,6 +47,7 @@ #include <sfx2/request.hxx> #include <sfx2/viewfrm.hxx> #include <svl/languageoptions.hxx> +#include <svl/cjkoptions.hxx> #include <svl/stritem.hxx> #include <svl/intitem.hxx> #include <vcl/commandevent.hxx> @@ -496,8 +497,7 @@ SfxRequest LayoutMenu::CreateRequest ( void LayoutMenu::Fill() { - SvtLanguageOptions aLanguageOptions; - bool bVertical = aLanguageOptions.IsVerticalTextEnabled(); + bool bVertical = SvtCJKOptions().IsVerticalTextEnabled(); SdDrawDocument* pDocument = mrBase.GetDocument(); bool bRightToLeft = (pDocument!=nullptr && pDocument->GetDefaultWritingMode() == WritingMode_RL_TB); diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index 3e28a56a489d..312e08f29521 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -37,6 +37,8 @@ #include <svl/stritem.hxx> #include <svl/style.hxx> #include <svl/languageoptions.hxx> +#include <svl/cjkoptions.hxx> +#include <svl/ctloptions.hxx> #include <sfx2/tplpitem.hxx> #include <editeng/escapementitem.hxx> #include <svx/svdoutl.hxx> @@ -142,9 +144,8 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) SfxWhichIter aIter( rSet ); sal_uInt16 nWhich = aIter.FirstWhich(); SfxItemSet aAttrSet( mpView->GetDoc().GetPool() ); - SvtLanguageOptions aLangOpt; - bool bDisableParagraphTextDirection = !aLangOpt.IsCTLFontEnabled(); - bool bDisableVerticalText = !aLangOpt.IsVerticalTextEnabled(); + bool bDisableParagraphTextDirection = !SvtCTLOptions().IsCTLFontEnabled(); + bool bDisableVerticalText = !SvtCJKOptions().IsVerticalTextEnabled(); mpView->GetAttributes( aAttrSet ); diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index a2f9ae6141af..1f1263fd99bb 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -57,6 +57,7 @@ #include <svtools/insdlg.hxx> #include <unotools/moduleoptions.hxx> #include <svl/languageoptions.hxx> +#include <svl/cjkoptions.hxx> #include <comphelper/processfactory.hxx> #include <sfx2/request.hxx> @@ -331,7 +332,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) } ViewShell::GetMenuState(rSet); - bool bDisableVerticalText = !SvtLanguageOptions().IsVerticalTextEnabled(); + bool bDisableVerticalText = !SvtCJKOptions().IsVerticalTextEnabled(); if ( bDisableVerticalText ) { diff --git a/svl/source/config/languageoptions.cxx b/svl/source/config/languageoptions.cxx index faaa93e2ddba..e04abe80f4da 100644 --- a/svl/source/config/languageoptions.cxx +++ b/svl/source/config/languageoptions.cxx @@ -38,107 +38,13 @@ #endif using namespace ::com::sun::star; -// global -namespace { struct ALMutex : public rtl::Static< std::mutex, ALMutex > {}; } -SvtLanguageOptions::SvtLanguageOptions( bool _bDontLoad ) +namespace SvtLanguageOptions { - // Global access, must be guarded (multithreading) - std::lock_guard aGuard( ALMutex::get() ); - - m_pCJKOptions.reset(new SvtCJKOptions( _bDontLoad )); - m_pCTLOptions.reset(new SvtCTLOptions( _bDontLoad )); - m_pCTLOptions->AddListener(this); - m_pCJKOptions->AddListener(this); -} -SvtLanguageOptions::~SvtLanguageOptions() -{ - // Global access, must be guarded (multithreading) - std::lock_guard aGuard( ALMutex::get() ); - - m_pCTLOptions->RemoveListener(this); - m_pCJKOptions->RemoveListener(this); - - m_pCJKOptions.reset(); - m_pCTLOptions.reset(); -} -// CJK options -bool SvtLanguageOptions::IsCJKFontEnabled() const -{ - return m_pCJKOptions->IsCJKFontEnabled(); -} -bool SvtLanguageOptions::IsVerticalTextEnabled() const -{ - return m_pCJKOptions->IsVerticalTextEnabled(); -} -bool SvtLanguageOptions::IsAsianTypographyEnabled() const -{ - return m_pCJKOptions->IsAsianTypographyEnabled(); -} -bool SvtLanguageOptions::IsJapaneseFindEnabled() const -{ - return m_pCJKOptions->IsJapaneseFindEnabled(); -} -void SvtLanguageOptions::SetAll( bool _bSet ) -{ - m_pCJKOptions->SetAll( _bSet ); -} -bool SvtLanguageOptions::IsAnyEnabled() const -{ - return m_pCJKOptions->IsAnyEnabled(); -} -// CTL options -void SvtLanguageOptions::SetCTLFontEnabled( bool _bEnabled ) -{ - m_pCTLOptions->SetCTLFontEnabled( _bEnabled ); -} -bool SvtLanguageOptions::IsCTLFontEnabled() const -{ - return m_pCTLOptions->IsCTLFontEnabled(); -} -void SvtLanguageOptions::SetCTLSequenceChecking( bool _bEnabled ) -{ - m_pCTLOptions->SetCTLSequenceChecking( _bEnabled ); -} - -void SvtLanguageOptions::SetCTLSequenceCheckingRestricted( bool _bEnable ) -{ - m_pCTLOptions->SetCTLSequenceCheckingRestricted( _bEnable ); -} - -void SvtLanguageOptions::SetCTLSequenceCheckingTypeAndReplace( bool _bEnable ) -{ - m_pCTLOptions->SetCTLSequenceCheckingTypeAndReplace( _bEnable ); -} - -bool SvtLanguageOptions::IsReadOnly(SvtLanguageOptions::EOption eOption) const -{ - bool bReadOnly = false; - switch(eOption) - { - // cjk options - case SvtLanguageOptions::E_CJKFONT : bReadOnly = m_pCJKOptions->IsReadOnly(SvtCJKOptions::E_CJKFONT ); break; - case SvtLanguageOptions::E_VERTICALTEXT : bReadOnly = m_pCJKOptions->IsReadOnly(SvtCJKOptions::E_VERTICALTEXT ); break; - case SvtLanguageOptions::E_ASIANTYPOGRAPHY : bReadOnly = m_pCJKOptions->IsReadOnly(SvtCJKOptions::E_ASIANTYPOGRAPHY); break; - case SvtLanguageOptions::E_JAPANESEFIND : bReadOnly = m_pCJKOptions->IsReadOnly(SvtCJKOptions::E_JAPANESEFIND ); break; - case SvtLanguageOptions::E_RUBY : bReadOnly = m_pCJKOptions->IsReadOnly(SvtCJKOptions::E_RUBY ); break; - case SvtLanguageOptions::E_CHANGECASEMAP : bReadOnly = m_pCJKOptions->IsReadOnly(SvtCJKOptions::E_CHANGECASEMAP ); break; - case SvtLanguageOptions::E_DOUBLELINES : bReadOnly = m_pCJKOptions->IsReadOnly(SvtCJKOptions::E_DOUBLELINES ); break; - case SvtLanguageOptions::E_EMPHASISMARKS : bReadOnly = m_pCJKOptions->IsReadOnly(SvtCJKOptions::E_EMPHASISMARKS ); break; - case SvtLanguageOptions::E_VERTICALCALLOUT : bReadOnly = m_pCJKOptions->IsReadOnly(SvtCJKOptions::E_VERTICALCALLOUT); break; - case SvtLanguageOptions::E_ALLCJK : bReadOnly = m_pCJKOptions->IsReadOnly(SvtCJKOptions::E_ALL ); break; - // ctl options - case SvtLanguageOptions::E_CTLFONT : bReadOnly = m_pCTLOptions->IsReadOnly(SvtCTLOptions::E_CTLFONT ); break; - case SvtLanguageOptions::E_CTLSEQUENCECHECKING : bReadOnly = m_pCTLOptions->IsReadOnly(SvtCTLOptions::E_CTLSEQUENCECHECKING); break; - case SvtLanguageOptions::E_CTLCURSORMOVEMENT : bReadOnly = m_pCTLOptions->IsReadOnly(SvtCTLOptions::E_CTLCURSORMOVEMENT ); break; - case SvtLanguageOptions::E_CTLTEXTNUMERALS : bReadOnly = m_pCTLOptions->IsReadOnly(SvtCTLOptions::E_CTLTEXTNUMERALS ); break; - } - return bReadOnly; -} // returns for a language the scripttype -SvtScriptType SvtLanguageOptions::GetScriptTypeOfLanguage( LanguageType nLang ) +SvtScriptType GetScriptTypeOfLanguage( LanguageType nLang ) { if( LANGUAGE_DONTKNOW == nLang ) nLang = LANGUAGE_ENGLISH_US; @@ -161,7 +67,7 @@ SvtScriptType SvtLanguageOptions::GetScriptTypeOfLanguage( LanguageType nLang ) return nScript; } -SvtScriptType SvtLanguageOptions::FromI18NToSvtScriptType( sal_Int16 nI18NType ) +SvtScriptType FromI18NToSvtScriptType( sal_Int16 nI18NType ) { switch ( nI18NType ) { @@ -174,7 +80,7 @@ SvtScriptType SvtLanguageOptions::FromI18NToSvtScriptType( sal_Int16 nI18NType ) return SvtScriptType::NONE; } -sal_Int16 SvtLanguageOptions::FromSvtScriptTypeToI18N( SvtScriptType nItemType ) +sal_Int16 FromSvtScriptTypeToI18N( SvtScriptType nItemType ) { switch ( nItemType ) { @@ -188,12 +94,12 @@ sal_Int16 SvtLanguageOptions::FromSvtScriptTypeToI18N( SvtScriptType nItemType ) return 0; } -sal_Int16 SvtLanguageOptions::GetI18NScriptTypeOfLanguage( LanguageType nLang ) +sal_Int16 GetI18NScriptTypeOfLanguage( LanguageType nLang ) { return FromSvtScriptTypeToI18N( GetScriptTypeOfLanguage( nLang ) ); } - +} // namespace SvtLanguageOptions static bool isKeyboardLayoutTypeInstalled(sal_Int16 scriptType) { diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index 8dcbcebcd446..8c3130a95c0f 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -44,6 +44,8 @@ #include <svl/itempool.hxx> #include <svl/stritem.hxx> #include <svl/languageoptions.hxx> +#include <svl/cjkoptions.hxx> +#include <svl/ctloptions.hxx> #include <editeng/colritem.hxx> #include <editeng/fontitem.hxx> @@ -188,9 +190,8 @@ public: mbUseFontNameAsText(false), mbTextInited(false) { - SvtLanguageOptions aLanguageOptions; - m_bCJKEnabled = aLanguageOptions.IsAnyEnabled(); - m_bCTLEnabled = aLanguageOptions.IsCTLFontEnabled(); + m_bCJKEnabled = SvtCJKOptions().IsAnyEnabled(); + m_bCTLEnabled = SvtCTLOptions().IsCTLFontEnabled(); mxBackColor = svtools::ColorConfig().GetColorValue(svtools::DOCCOLOR).nColor; Invalidate100PercentFontWidth(); } diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx index bf6d8fffcdca..bb6937277aa1 100644 --- a/svx/source/form/fmtextcontrolshell.cxx +++ b/svx/source/form/fmtextcontrolshell.cxx @@ -50,6 +50,7 @@ #include <svl/eitem.hxx> #include <svl/itempool.hxx> #include <svl/languageoptions.hxx> +#include <svl/ctloptions.hxx> #include <svtools/stringtransfer.hxx> #include <svl/whiter.hxx> #include <toolkit/helper/vclunohelper.hxx> @@ -899,7 +900,7 @@ namespace svx || ( nSlot == SID_ATTR_PARA_RIGHT_TO_LEFT ) ) { - if ( !SvtLanguageOptions().IsCTLFontEnabled() ) + if ( !SvtCTLOptions().IsCTLFontEnabled() ) { _rSet.DisableItem( nSlot ); nSlot = aIter.NextWhich(); diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx b/svx/source/sidebar/inspector/InspectorTextPanel.cxx index b1d2641335b9..57059958dfc9 100644 --- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx +++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx @@ -25,6 +25,8 @@ #include <svx/sidebar/InspectorTextPanel.hxx> #include <svl/languageoptions.hxx> +#include <svl/cjkoptions.hxx> +#include <svl/ctloptions.hxx> #include <com/sun/star/awt/FontSlant.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <inspectorvalues.hrc> @@ -58,9 +60,9 @@ InspectorTextPanel::InspectorTextPanel(weld::Widget* pParent) static bool GetPropertyValues(const OUString& rPropName, const uno::Any& rAny, OUString& rString) { // Hide Asian and Complex properties - if (!SvtLanguageOptions().IsCJKFontEnabled() && rPropName.indexOf("Asian") != -1) + if (!SvtCJKOptions().IsCJKFontEnabled() && rPropName.indexOf("Asian") != -1) return false; - if (!SvtLanguageOptions().IsCTLFontEnabled() && rPropName.indexOf("Complex") != -1) + if (!SvtCTLOptions().IsCTLFontEnabled() && rPropName.indexOf("Complex") != -1) return false; if (bool bValue; rAny >>= bValue) diff --git a/svx/source/tbxctrls/verttexttbxctrl.cxx b/svx/source/tbxctrls/verttexttbxctrl.cxx index 6be76a79f6c7..fcc799283253 100644 --- a/svx/source/tbxctrls/verttexttbxctrl.cxx +++ b/svx/source/tbxctrls/verttexttbxctrl.cxx @@ -20,6 +20,8 @@ #include <cppuhelper/supportsservice.hxx> #include <verttexttbxctrl.hxx> #include <svl/languageoptions.hxx> +#include <svl/cjkoptions.hxx> +#include <svl/ctloptions.hxx> #include <vcl/toolbox.hxx> #include <vcl/weld.hxx> #include <rtl/ustring.hxx> @@ -98,12 +100,12 @@ void SAL_CALL SvxVertCTLTextTbxCtrl::statusChanged(const css::frame::FeatureStat bool bEnabled = false; if (rEvent.FeatureURL.Complete == ".uno:VerticalTextState") { - SvtLanguageOptions aLangOptions; + SvtCJKOptions aLangOptions; bEnabled = m_bVisible && aLangOptions.IsVerticalTextEnabled(); } else if (rEvent.FeatureURL.Complete == ".uno:CTLFontState") { - SvtLanguageOptions aLangOptions; + SvtCTLOptions aLangOptions; bEnabled = m_bVisible && aLangOptions.IsCTLFontEnabled(); } else diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx index ad101ee6abf2..5ccd2a2d78d6 100644 --- a/sw/source/core/view/printdata.cxx +++ b/sw/source/core/view/printdata.cxx @@ -28,6 +28,8 @@ #include <docfld.hxx> #include <svl/languageoptions.hxx> +#include <svl/cjkoptions.hxx> +#include <svl/ctloptions.hxx> #include <toolkit/awt/vclxdevice.hxx> #include <unotools/moduleoptions.hxx> #include <vcl/outdev.hxx> @@ -169,8 +171,7 @@ SwPrintUIOptions::SwPrintUIOptions( } // check if either CJK or CTL is enabled - SvtLanguageOptions aLangOpt; - bool bRTL = aLangOpt.IsCJKFontEnabled() || aLangOpt.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/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index 86cbd0291d1e..1654dfca3e36 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -38,6 +38,7 @@ #include <sfx2/viewfrm.hxx> #include <svl/stritem.hxx> #include <svl/languageoptions.hxx> +#include <svl/ctloptions.hxx> #include <sfx2/htmlmode.hxx> #include <swmodule.hxx> #include <fchrfmt.hxx> @@ -612,7 +613,7 @@ IMPL_LINK_NOARG(ApplyStyle, ApplyHdl, LinkParamNone*, void) m_xTmp->SetItemSet( aTmpSet ); - if( SfxStyleFamily::Page == m_nFamily && SvtLanguageOptions().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/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index a34f9a86a5da..8e95354f9026 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -782,7 +782,7 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet) case SID_ATTR_PARA_LEFT_TO_RIGHT: case SID_ATTR_PARA_RIGHT_TO_LEFT: { - if ( !SvtLanguageOptions().IsCTLFontEnabled() ) + if ( !SvtCTLOptions().IsCTLFontEnabled() ) rSet.DisableItem( nWhich ); else { diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index c5437c3d4475..9eb7b9996696 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -861,7 +861,7 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet) case SID_TEXTDIRECTION_LEFT_TO_RIGHT: case SID_TEXTDIRECTION_TOP_TO_BOTTOM: - if (!SvtLanguageOptions().IsVerticalTextEnabled()) + if (!SvtCJKOptions().IsVerticalTextEnabled()) { rSet.DisableItem(nSlotId); nSlotId = 0; @@ -890,7 +890,7 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet) case SID_ATTR_PARA_LEFT_TO_RIGHT: case SID_ATTR_PARA_RIGHT_TO_LEFT: { - if (!SvtLanguageOptions().IsCTLFontEnabled()) + if (!SvtCTLOptions().IsCTLFontEnabled()) { rSet.DisableItem(nWhich); nSlotId = 0; diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx index 22e8d9451efa..9e336a019ba9 100644 --- a/sw/source/uibase/uiview/viewstat.cxx +++ b/sw/source/uibase/uiview/viewstat.cxx @@ -608,7 +608,7 @@ void SwView::GetDrawState(SfxItemSet &rSet) case SID_DRAW_TEXT_VERTICAL: case SID_DRAW_CAPTION_VERTICAL: - if ( bWeb || !SvtLanguageOptions().IsVerticalTextEnabled() ) + if ( bWeb || !SvtCJKOptions().IsVerticalTextEnabled() ) rSet.DisableItem( nWhich ); else if (nWhich != SID_DRAW_TEXT_VERTICAL) //tdf#113171 |