20#include <config_features.h>
47#include <rtl/ustrbuf.hxx>
48#include <editeng/editids.hrc>
49#include <svx/svxids.hrc>
54#include <officecfg/Office/Common.hxx>
55#include <officecfg/Setup.hxx>
58#if HAVE_FEATURE_BREAKPAD
62#include <com/sun/star/configuration/theDefaultProvider.hpp>
63#include <com/sun/star/container/XNameAccess.hpp>
64#include <com/sun/star/container/XNameReplace.hpp>
65#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
66#include <com/sun/star/beans/NamedValue.hpp>
67#include <com/sun/star/beans/PropertyAttribute.hpp>
68#include <com/sun/star/beans/XPropertySet.hpp>
69#include <com/sun/star/util/XChangesBatch.hpp>
70#include <com/sun/star/uno/Any.hxx>
71#include <com/sun/star/container/XContentEnumerationAccess.hpp>
72#include <com/sun/star/container/XSet.hpp>
73#include <com/sun/star/i18n/ScriptType.hpp>
74#include <com/sun/star/office/Quickstart.hpp>
75#include <com/sun/star/linguistic2/XLinguProperties.hpp>
84#include <bitmaps.hlst>
91#include <com/sun/star/datatransfer/clipboard/SystemClipboard.hpp>
95#include <systools/win32/winstoreutil.hxx>
103using namespace ::
utl;
111 return DeactivateRC::LeavePage;
116OUString impl_SystemFileOpenServiceName()
119 return "com.sun.star.ui.dialogs.SystemFilePicker";
121 return "com.sun.star.ui.dialogs.AquaFilePicker";
127bool lcl_HasSystemFilePicker()
136 Reference< XContentEnumerationAccess > xEnumAccess( xFactory, UNO_QUERY );
137 Reference< XSet > xSet( xFactory, UNO_QUERY );
139 if ( ! xEnumAccess.is() || ! xSet.is() )
144 OUString aFileService = impl_SystemFileOpenServiceName();
145 Reference< XEnumeration > xEnum = xEnumAccess->createContentEnumeration( aFileService );
146 if ( xEnum.is() && xEnum->hasMoreElements() )
149 catch (
const IllegalArgumentException&)
152 catch (
const ElementExistException&)
160 :
SfxTabPage(pPage, pController,
"cui/ui/optgeneralpage.ui",
"OptGeneralPage", &
rSet)
161 , m_xExtHelpCB(m_xBuilder->weld_check_button(
"exthelp"))
162 , m_xPopUpNoHelpCB(m_xBuilder->weld_check_button(
"popupnohelp"))
163 , m_xShowTipOfTheDay(m_xBuilder->weld_check_button(
"cbShowTipOfTheDay"))
164 , m_xFileDlgFrame(m_xBuilder->weld_widget(
"filedlgframe"))
165 , m_xFileDlgROImage(m_xBuilder->weld_widget(
"lockimage"))
166 , m_xFileDlgCB(m_xBuilder->weld_check_button(
"filedlg"))
167 , m_xDocStatusCB(m_xBuilder->weld_check_button(
"docstatus"))
168 , m_xYearFrame(m_xBuilder->weld_widget(
"yearframe"))
169 , m_xYearValueField(m_xBuilder->weld_spin_button(
"year"))
170 , m_xToYearFT(m_xBuilder->weld_label(
"toyear"))
171#
if HAVE_FEATURE_BREAKPAD
172 , m_xPrivacyFrame(m_xBuilder->weld_widget(
"privacyframe"))
173 , m_xCrashReport(m_xBuilder->weld_check_button(
"crashreport"))
176 , m_xQuickStarterFrame(m_xBuilder->weld_widget(
"quickstarter"))
177 , m_xQuickLaunchCB(m_xBuilder->weld_check_button(
"quicklaunch"))
178 , m_xFileAssocFrame(m_xBuilder->weld_widget(
"fileassoc"))
179 , m_xFileAssocBtn(m_xBuilder->weld_button(
"assocfiles"))
180 , m_xPerformFileExtCheck(m_xBuilder->weld_check_button(
"cbPerformFileExtCheck"))
183 if (!lcl_HasSystemFilePicker())
185 else if (officecfg::Office::Common::Misc::UseSystemFileDialog::isReadOnly())
191#if HAVE_FEATURE_BREAKPAD
192 m_xPrivacyFrame->show();
198 if (!sal::systools::IsStorePackagedApp())
199 m_xQuickStarterFrame->show();
201 m_xFileAssocFrame->show();
217 return std::make_unique<OfaMiscTabPage>( pPage, pController, *rAttrSet );
222 bool bModified =
false;
226 officecfg::Office::Common::Help::BuiltInHelpNotInstalledPopUp::set(
m_xPopUpNoHelpCB->get_active(), batch);
229 officecfg::Office::Common::Help::ExtendedTip::set(
m_xExtHelpCB->get_active(), batch);
233 officecfg::Office::Common::Misc::ShowTipOfTheDay::set(
m_xShowTipOfTheDay->get_active(), batch);
239 officecfg::Office::Common::Misc::UseSystemFileDialog::set( !
m_xFileDlgCB->get_active(), batch );
245 officecfg::Office::Common::Print::PrintingModifiesDocument::set(
m_xDocStatusCB->get_active(), batch);
250 sal_uInt16 nNum =
static_cast<sal_uInt16
>(
m_xYearValueField->get_text().toInt32());
251 if ( pUInt16Item && pUInt16Item->
GetValue() != nNum )
257#if HAVE_FEATURE_BREAKPAD
258 if (m_xCrashReport->get_state_changed_from_saved())
260 officecfg::Office::Common::Misc::CrashReport::set(m_xCrashReport->get_active(), batch);
266 if (m_xPerformFileExtCheck->get_state_changed_from_saved())
268 officecfg::Office::Common::Misc::PerformFileExtCheck::set(
269 m_xPerformFileExtCheck->get_active(), batch);
273 if( m_xQuickLaunchCB->get_state_changed_from_saved())
287 m_xExtHelpCB->set_active( officecfg::Office::Common::Help::Tip::get() &&
288 officecfg::Office::Common::Help::ExtendedTip::get() );
290 m_xPopUpNoHelpCB->set_active( officecfg::Office::Common::Help::BuiltInHelpNotInstalledPopUp::get() );
292 m_xShowTipOfTheDay->set_active( officecfg::Office::Common::Misc::ShowTipOfTheDay::get() );
294 m_xFileDlgCB->set_active( !officecfg::Office::Common::Misc::UseSystemFileDialog::get() );
297 m_xDocStatusCB->set_active(officecfg::Office::Common::Print::PrintingModifiesDocument::get());
308#if HAVE_FEATURE_BREAKPAD
309 m_xCrashReport->set_active(officecfg::Office::Common::Misc::CrashReport::get() && CrashReporter::IsDumpEnable());
310 m_xCrashReport->set_sensitive(!officecfg::Office::Common::Misc::CrashReport::isReadOnly() && CrashReporter::IsDumpEnable());
311 m_xCrashReport->save_state();
317 if ( SfxItemState::SET == eState )
319 else if ( SfxItemState::DISABLED == eState )
322 m_xQuickStarterFrame->hide();
325 m_xQuickLaunchCB->save_state();
327 m_xPerformFileExtCheck->set_active(
328 officecfg::Office::Common::Misc::PerformFileExtCheck::get());
329 m_xPerformFileExtCheck->save_state();
330 m_xPerformFileExtCheck->set_sensitive(!officecfg::Office::Common::Misc::PerformFileExtCheck::isReadOnly());
336 OUString aOutput( m_aStrDateInfo );
337 OUString
aStr( m_xYearValueField->get_text() );
338 sal_Int32 nNum =
aStr.toInt32();
339 if (
aStr.getLength() != 4 || nNum < m_xYearValueField->get_min() || nNum > m_xYearValueField->get_max() )
344 aOutput += OUString::number( nNum );
346 m_xToYearFT->set_label( aOutput );
367 typedef std::vector< std::pair<OUString,Sequence<OUString> > >
ServiceVector;
376 mbHWAccelAvailable(false),
377 mbHWAccelChecked(false)
381 Reference<XMultiServiceFactory> xConfigProvider(
382 css::configuration::theDefaultProvider::get(
387 {
"nodepath",
Any(OUString(
"/org.openoffice.Office.Canvas"))}
390 xConfigProvider->createInstanceWithArguments(
391 "com.sun.star.configuration.ConfigurationUpdateAccess",
397 {
"nodepath",
Any(OUString(
"/org.openoffice.Office.Canvas/CanvasServiceList"))}
399 Reference<XNameAccess> xNameAccess(
400 xConfigProvider->createInstanceWithArguments(
401 "com.sun.star.configuration.ConfigurationAccess",
402 aArgs2 ), UNO_QUERY_THROW );
403 Reference<XHierarchicalNameAccess> xHierarchicalNameAccess(
404 xNameAccess, UNO_QUERY_THROW);
406 Sequence<OUString> serviceNames = xNameAccess->getElementNames();
407 const OUString* pCurr = serviceNames.getConstArray();
408 const OUString*
const pEnd = pCurr + serviceNames.getLength();
409 while( pCurr != pEnd )
411 Reference<XNameAccess> xEntryNameAccess(
412 xHierarchicalNameAccess->getByHierarchicalName(*pCurr),
415 if( xEntryNameAccess.is() )
417 Sequence<OUString> preferredImplementations;
418 if( xEntryNameAccess->getByName(
"PreferredImplementations") >>= preferredImplementations )
442 const OUString* pCurrImpl = availableImpl.second.getConstArray();
443 const OUString*
const pEndImpl = pCurrImpl + availableImpl.second.getLength();
445 while( pCurrImpl != pEndImpl )
449 Reference<XPropertySet> xPropSet(
xFactory->createInstance(
452 bool bHasAccel(
false);
453 if( xPropSet->getPropertyValue(
"HardwareAcceleration") >>= bHasAccel )
474 bool bForceLastEntry(
false);
481 return !bForceLastEntry;
491 Property aProp = xInfo->getPropertyByName(
"ForceSafeServiceImpl");
492 return ((aProp.Attributes & css::beans::PropertyAttribute::READONLY ) == css::beans::PropertyAttribute::READONLY);
497 Reference< XNameReplace > xNameReplace(
500 if( !xNameReplace.is() )
503 xNameReplace->replaceByName(
"ForceSafeServiceImpl",
Any(!_bEnabled) );
505 Reference< XChangesBatch > xChangesBatch(
508 if( !xChangesBatch.is() )
511 xChangesBatch->commitChanges();
522 :
SfxTabPage(pPage, pController,
"cui/ui/optviewpage.ui",
"OptViewPage", &
rSet)
523 , nSizeLB_InitialSelection(0)
524 , nSidebarSizeLB_InitialSelection(0)
525 , nNotebookbarSizeLB_InitialSelection(0)
526 , nStyleLB_InitialSelection(0)
528 , m_xIconSizeLB(m_xBuilder->weld_combo_box(
"iconsize"))
529 , m_xSidebarIconSizeLB(m_xBuilder->weld_combo_box(
"sidebariconsize"))
530 , m_xNotebookbarIconSizeLB(m_xBuilder->weld_combo_box(
"notebookbariconsize"))
531 , m_xDarkModeFrame(m_xBuilder->weld_widget(
"darkmode"))
532 , m_xAppearanceStyleLB(m_xBuilder->weld_combo_box(
"appearance"))
533 , m_xIconStyleLB(m_xBuilder->weld_combo_box(
"iconstyle"))
534 , m_xFontAntiAliasing(m_xBuilder->weld_check_button(
"aafont"))
535 , m_xAAPointLimitLabel(m_xBuilder->weld_label(
"aafrom"))
536 , m_xAAPointLimit(m_xBuilder->weld_metric_spin_button(
"aanf",
FieldUnit::
PIXEL))
537 , m_xFontShowCB(m_xBuilder->weld_check_button(
"showfontpreview"))
538 , m_xUseHardwareAccell(m_xBuilder->weld_check_button(
"useaccel"))
539 , m_xUseAntiAliase(m_xBuilder->weld_check_button(
"useaa"))
540 , m_xUseSkia(m_xBuilder->weld_check_button(
"useskia"))
541 , m_xForceSkiaRaster(m_xBuilder->weld_check_button(
"forceskiaraster"))
542 , m_xSkiaStatusEnabled(m_xBuilder->weld_label(
"skiaenabled"))
543 , m_xSkiaStatusDisabled(m_xBuilder->weld_label(
"skiadisabled"))
544 , m_xSkiaLog(m_xBuilder->weld_button(
"btnSkialog"))
545 , m_xMouseMiddleLB(m_xBuilder->weld_combo_box(
"mousemiddle"))
546 , m_xMoreIcons(m_xBuilder->weld_button(
"btnMoreIcons"))
547 , m_xRunGPTests(m_xBuilder->weld_button(
"btn_rungptest"))
548 , m_sAutoStr(m_xIconStyleLB->get_text(0))
551 const bool bHasDarkMode = sToolKitName.startsWith(
"gtk") || sToolKitName ==
"osx" || sToolKitName ==
"win";
587 m_xIconStyleLB->append(installIconTheme.GetThemeId(), installIconTheme.GetDisplayName());
597 m_xGraphicsTestDialog.
run();
603 "AdditionsTag", OUString(
"Icons")) };
609 bool bAAEnabled = m_xFontAntiAliasing->get_active();
611 m_xAAPointLimitLabel->set_sensitive(bAAEnabled);
612 m_xAAPointLimit->set_sensitive(bAAEnabled);
623 css::uno::Reference<css::datatransfer::clipboard::XClipboard> xClipboard =
624 css::datatransfer::clipboard::SystemClipboard::create(
628 m_xSkiaLog->set_from_icon_name(RID_SVXBMP_COPY);
644 bool skiaHidden =
true;
668 m_xUseSkia->set_sensitive(!officecfg::Office::Common::VCL::UseSkia::isReadOnly());
682 return std::make_unique<OfaViewTabPage>(pPage, pController, *rAttrSet);
687 bool bModified =
false;
688 bool bDarkModeOptModified =
false;
689 bool bRepaintWindows(
false);
693 const sal_Int32 nSizeLB_NewSelection =
m_xIconSizeLB->get_active();
698 switch( nSizeLB_NewSelection )
705 SAL_WARN(
"cui.options",
"OfaViewTabPage::FillItemSet(): This state of m_xIconSizeLB should not be possible!");
715 switch( nSidebarSizeLB_NewSelection )
717 case 0: eSet = ToolBoxButtonSize::DontCare;
break;
718 case 1: eSet = ToolBoxButtonSize::Small;
break;
719 case 2: eSet = ToolBoxButtonSize::Large;
break;
721 SAL_WARN(
"cui.options",
"OfaViewTabPage::FillItemSet(): This state of m_xSidebarIconSizeLB should not be possible!");
723 officecfg::Office::Common::Misc::SidebarIconSize::set(
static_cast<sal_Int16
>(eSet), xChanges);
731 switch( nNotebookbarSizeLB_NewSelection )
733 case 0: eSet = ToolBoxButtonSize::DontCare;
break;
734 case 1: eSet = ToolBoxButtonSize::Small;
break;
735 case 2: eSet = ToolBoxButtonSize::Large;
break;
737 SAL_WARN(
"cui.options",
"OfaViewTabPage::FillItemSet(): This state of m_xNotebookbarIconSizeLB should not be possible!");
739 officecfg::Office::Common::Misc::NotebookbarIconSize::set(
static_cast<sal_Int16
>(eSet), xChanges);
742 const sal_Int32 nStyleLB_NewSelection =
m_xIconStyleLB->get_active();
749 bool bAppearanceChanged =
false;
755 if(eNewMiddleMouse > 2)
758 if ( eNewMiddleMouse !=
static_cast<short>(eOldMiddleMouse) )
760 officecfg::Office::Common::View::Dialog::MiddleMouseButton::set(eNewMiddleMouse, batch);
761 bAppearanceChanged =
true;
767 officecfg::Office::Common::View::FontAntiAliasing::Enabled::set(b, batch);
768 bAppearanceChanged =
true;
774 officecfg::Office::Common::View::FontAntiAliasing::MinPixelHeight::set(
i, batch);
775 bAppearanceChanged =
true;
780 officecfg::Office::Common::Font::View::ShowFontBoxWYSIWYG::set(
m_xFontShowCB->get_active(), xChanges);
786 bDarkModeOptModified =
true;
807 bRepaintWindows =
true;
811 if (
m_xUseSkia->get_state_changed_from_saved() ||
814 officecfg::Office::Common::VCL::UseSkia::set(
m_xUseSkia->get_active(), xChanges);
815 officecfg::Office::Common::VCL::ForceSkiaRaster::set(
m_xForceSkiaRaster->get_active(), xChanges);
821 if (bDarkModeOptModified)
824 if ( bAppearanceChanged )
841 if (
m_xUseSkia->get_state_changed_from_saved() ||
871 if( eSidebarIconSize == ToolBoxButtonSize::DontCare )
873 else if( eSidebarIconSize == ToolBoxButtonSize::Small )
875 else if( eSidebarIconSize == ToolBoxButtonSize::Large )
880 if( eNotebookbarIconSize == ToolBoxButtonSize::DontCare )
882 else if( eNotebookbarIconSize == ToolBoxButtonSize::Small )
884 else if( eNotebookbarIconSize == ToolBoxButtonSize::Large )
909 sal_Int16 nMiddleMouseButton = officecfg::Office::Common::View::Dialog::MiddleMouseButton::get();
913 bool bFontAntiAliasing = officecfg::Office::Common::View::FontAntiAliasing::Enabled::get();
915 sal_Int16 nFontAntiAliasingMinPixelHeight = officecfg::Office::Common::View::FontAntiAliasing::MinPixelHeight::get();
916 m_xAAPointLimit->set_value(nFontAntiAliasingMinPixelHeight, FieldUnit::PIXEL);
919 m_xFontShowCB->set_active(officecfg::Office::Common::Font::View::ShowFontBoxWYSIWYG::get());
938 m_xUseSkia->set_active(officecfg::Office::Common::VCL::UseSkia::get());
939 m_xForceSkiaRaster->set_active(officecfg::Office::Common::VCL::ForceSkiaRaster::get());
979constexpr OUStringLiteral
sAccessSrvc =
u"com.sun.star.configuration.ConfigurationAccess";
980constexpr OUStringLiteral
sAccessUpdSrvc =
u"com.sun.star.configuration.ConfigurationUpdateAccess";
989 sal_Int32 nPatterns = aDateAcceptancePatterns.getLength();
990 OUStringBuffer
aBuf( nPatterns * 6 );
991 SAL_WARN_IF( !nPatterns,
"cui.options",
"No date acceptance pattern");
994 const OUString* pPatterns = aDateAcceptancePatterns.getConstArray();
995 aBuf.append( pPatterns[0]);
996 for (sal_Int32
i=1;
i < nPatterns; ++
i)
997 aBuf.append(
";" + pPatterns[
i]);
999 return aBuf.makeStringAndClear();
1005 LanguageTag GetInstalledLocaleForSystemUILanguage()
1007 css::uno::Sequence<OUString> inst(officecfg::Setup::Office::InstalledLocales::get()->getElementNames());
1013 :
SfxTabPage(pPage, pController,
"cui/ui/optlanguagespage.ui",
"OptLanguagesPage", &
rSet)
1015 , m_bDatePatternsValid(false)
1016 , m_xUserInterfaceLB(m_xBuilder->weld_combo_box(
"userinterface"))
1017 , m_xLocaleSettingFT(m_xBuilder->weld_label(
"localesettingFT"))
1018 , m_xLocaleSettingLB(new
SvxLanguageBox(m_xBuilder->weld_combo_box(
"localesetting")))
1019 , m_xDecimalSeparatorCB(m_xBuilder->weld_check_button(
"decimalseparator"))
1020 , m_xCurrencyFT(m_xBuilder->weld_label(
"defaultcurrency"))
1021 , m_xCurrencyLB(m_xBuilder->weld_combo_box(
"currencylb"))
1022 , m_xDatePatternsFT(m_xBuilder->weld_label(
"dataaccpatterns"))
1023 , m_xDatePatternsED(m_xBuilder->weld_entry(
"datepatterns"))
1024 , m_xWesternLanguageLB(new
SvxLanguageBox(m_xBuilder->weld_combo_box(
"westernlanguage")))
1025 , m_xWesternLanguageFT(m_xBuilder->weld_label(
"western"))
1026 , m_xAsianLanguageLB(new
SvxLanguageBox(m_xBuilder->weld_combo_box(
"asianlanguage")))
1027 , m_xComplexLanguageLB(new
SvxLanguageBox(m_xBuilder->weld_combo_box(
"complexlanguage")))
1028 , m_xCurrentDocCB(m_xBuilder->weld_check_button(
"currentdoc"))
1029 , m_xAsianSupportCB(m_xBuilder->weld_check_button(
"asiansupport"))
1030 , m_xCTLSupportCB(m_xBuilder->weld_check_button(
"ctlsupport"))
1031 , m_xIgnoreLanguageChangeCB(m_xBuilder->weld_check_button(
"ignorelanguagechange"))
1048 css::configuration::theDefaultProvider::get(
1053 theConfigProvider->createInstanceWithArguments(
sAccessSrvc, theArgs ), UNO_QUERY_THROW );
1056 std::vector< std::pair<sal_Int32, OUString> > aUILanguages;
1063 aUILanguages.emplace_back(
i+1, aLangStr);
1067 std::sort(aUILanguages.begin(), aUILanguages.end(), [](
const auto& l1,
const auto& l2) {
1068 static const auto aSorter = comphelper::string::NaturalStringSorter(
1069 comphelper::getProcessComponentContext(),
1070 Application::GetSettings().GetUILanguageTag().getLocale());
1071 return aSorter.compare(l1.second, l2.second) < 0;
1075 for (
const auto & [ nGroupID, sGroupName ] : aUILanguages)
1085 theConfigProvider->createInstanceWithArguments(
sAccessSrvc, theArgs2 ), UNO_QUERY_THROW );
1108 SvxLanguageListFlags::WESTERN | SvxLanguageListFlags::ONLY_KNOWN,
true,
false,
true,
true,
1112 SvxLanguageListFlags::CJK | SvxLanguageListFlags::ONLY_KNOWN,
true,
false,
true,
true,
1116 SvxLanguageListFlags::CTL | SvxLanguageListFlags::ONLY_KNOWN,
true,
false,
true,
true,
1120 SvxLanguageListFlags::ALL | SvxLanguageListFlags::ONLY_KNOWN,
false,
false,
false,
true,
1132 OUString aTwoSpace(
" " );
1133 sal_uInt16 nCurrCount = rCurrTab.
size();
1134 std::vector< const NfCurrencyEntry* > aCurrencies;
1136 for ( sal_uInt16 j=1; j < nCurrCount; ++j )
1138 aCurrencies.push_back(&rCurrTab[j]);
1140 std::sort(aCurrencies.begin(), aCurrencies.end(),
1141 [](
const NfCurrencyEntry* c1,
const NfCurrencyEntry* c2) {
1142 return c1->GetBankSymbol().compareTo(c2->GetBankSymbol()) < 0;
1145 for (
auto &
v : aCurrencies)
1147 OUString aStr_ =
v->GetBankSymbol() +
1188 return std::make_unique<OfaLanguagesTabPage>(pPage, pController, *rAttrSet);
1191static void lcl_Update(std::unique_ptr<SfxVoidItem> pInvalidItems[], std::unique_ptr<SfxBoolItem> pBoolItems[], sal_uInt16 nCount)
1200 if(pCurrentFrm == pViewFrm)
1212 pLangConfig->aSysLocaleOptions.BlockBroadcasts(
true );
1213 pLangConfig->aCTLLanguageOptions.BlockBroadcasts(
true );
1214 pLangConfig->aLinguConfig.BlockBroadcasts(
true );
1232 pLangConfig->aCTLLanguageOptions.SetCTLSequenceCheckingRestricted(bOn);
1233 pLangConfig->aCTLLanguageOptions.SetCTLSequenceChecking(bOn);
1234 pLangConfig->aCTLLanguageOptions.SetCTLSequenceCheckingTypeAndReplace(bOn);
1240 OUString aLangString;
1250 css::configuration::theDefaultProvider::get(
1254 theConfigProvider->createInstanceWithArguments(
sAccessUpdSrvc, theArgs ), UNO_QUERY_THROW );
1260 Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges();
1270 Reference< XComponentContext > xContext(
1272 css::office::Quickstart::createAndSetVeto(xContext,
false,
false,
false);
1293 if ( eOldLocale != eNewLocale )
1303 pLangConfig->aSysLocaleOptions.SetLocaleConfigString( sNewLang );
1307 bool bNewCJK = bool( nNewType & SvtScriptType::ASIAN );
1319 OUString sOldCurr =
pLangConfig->aSysLocaleOptions.GetCurrencyConfigString();
1321 const NfCurrencyEntry* pCurr =
sId ==
"default" ? nullptr : weld::fromId<const NfCurrencyEntry*>(
sId);
1325 pCurr->GetBankSymbol(), pCurr->GetLanguage() );
1326 if ( sOldCurr != sNewCurr )
1327 pLangConfig->aSysLocaleOptions.SetCurrencyConfigString( sNewCurr );
1339 bool bCurrentDocCBChanged =
m_xCurrentDocCB->get_state_changed_from_saved();
1342 if( (bCurrentDocCBChanged && !bCurrentDocCBChecked) || bValChanged)
1345 if(!bCurrentDocCBChecked)
1350 pLangConfig->aLinguConfig.SetProperty(
u"DefaultLocale", aValue );
1351 if (xLinguProp.is())
1352 xLinguProp->setDefaultLocale( aLocale );
1354 if(pCurrentDocShell)
1357 SID_ATTR_LANGUAGE));
1361 if( (bCurrentDocCBChanged && !bCurrentDocCBChecked) || bValChanged)
1364 if(!bCurrentDocCBChecked)
1369 pLangConfig->aLinguConfig.SetProperty(
u"DefaultLocale_CJK", aValue );
1370 if (xLinguProp.is())
1371 xLinguProp->setDefaultLocale_CJK( aLocale );
1373 if(pCurrentDocShell)
1376 SID_ATTR_CHAR_CJK_LANGUAGE));
1380 if( (bCurrentDocCBChanged && !bCurrentDocCBChecked) || bValChanged)
1383 if(!bCurrentDocCBChecked)
1388 pLangConfig->aLinguConfig.SetProperty(
u"DefaultLocale_CTL", aValue );
1389 if (xLinguProp.is())
1390 xLinguProp->setDefaultLocale_CTL( aLocale );
1392 if(pCurrentDocShell)
1395 SID_ATTR_CHAR_CTL_LANGUAGE));
1405 const sal_uInt16 STATE_COUNT = 2;
1407 std::unique_ptr<SfxBoolItem> pBoolItems[STATE_COUNT];
1408 pBoolItems[0].reset(
new SfxBoolItem(SID_VERTICALTEXT_STATE,
false));
1409 pBoolItems[1].reset(
new SfxBoolItem(SID_TEXT_FITTOSIZE_VERTICAL,
false));
1411 std::unique_ptr<SfxVoidItem> pInvalidItems[STATE_COUNT];
1412 pInvalidItems[0].reset(
new SfxVoidItem(SID_VERTICALTEXT_STATE));
1413 pInvalidItems[1].reset(
new SfxVoidItem(SID_TEXT_FITTOSIZE_VERTICAL));
1415 lcl_Update(pInvalidItems, pBoolItems, STATE_COUNT);
1426 const sal_uInt16 STATE_COUNT = 1;
1427 std::unique_ptr<SfxBoolItem> pBoolItems[STATE_COUNT];
1428 pBoolItems[0].reset(
new SfxBoolItem(SID_CTLFONT_STATE,
false));
1429 std::unique_ptr<SfxVoidItem> pInvalidItems[STATE_COUNT];
1430 pInvalidItems[0].reset(
new SfxVoidItem(SID_CTLFONT_STATE));
1431 lcl_Update(pInvalidItems, pBoolItems, STATE_COUNT);
1434 if (
pLangConfig->aSysLocaleOptions.IsModified() )
1440 pLangConfig->aSysLocaleOptions.BlockBroadcasts(
false );
1441 pLangConfig->aCTLLanguageOptions.BlockBroadcasts(
false );
1442 pLangConfig->aLinguConfig.BlockBroadcasts(
false );
1471 const NfCurrencyEntry* pCurr =
nullptr;
1472 OUString sCurrency =
pLangConfig->aSysLocaleOptions.GetCurrencyConfigString();
1473 if ( !sCurrency.isEmpty() )
1481 OUString
sId = !pCurr ? OUString(
"default") :
weld::toId(pCurr);
1488 OUString aDatePatternsString =
pLangConfig->aSysLocaleOptions.GetDatePatternsConfigString();
1489 if (aDatePatternsString.isEmpty())
1498 bool bModified =
false;
1522 aWestLang =
pLangConfig->aLinguConfig.GetProperty(
u"DefaultLocale");
1524 aWestLang >>= aLocale;
1528 aCJKLang =
pLangConfig->aLinguConfig.GetProperty(
u"DefaultLocale_CJK");
1530 aCJKLang >>= aLocale;
1533 aCTLLang =
pLangConfig->aLinguConfig.GetProperty(
u"DefaultLocale_CTL");
1535 aCTLLang >>= aLocale;
1542 if(pCurrentDocShell)
1550 eCurLang = eTempCurLang;
1557 eCurLangCJK = eTempCurLang;
1564 eCurLangCTL = eTempCurLang;
1588 bool bEnable = !
pLangConfig->aLinguConfig.IsReadOnly(
u"DefaultLocale" );
1605 bool bCheck = rBox.get_active();
1606 if ( m_xAsianSupportCB.get() == &rBox )
1608 bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly(
u"DefaultLocale_CJK");
1609 bCheck = ( bCheck && !bReadonly );
1610 m_xAsianLanguageLB->set_sensitive( bCheck );
1611 if (rBox.get_sensitive())
1612 m_bOldAsian = bCheck;
1614 else if ( m_xCTLSupportCB.get() == &rBox )
1616 bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly(
u"DefaultLocale_CTL");
1617 bCheck = ( bCheck && !bReadonly );
1618 m_xComplexLanguageLB->set_sensitive( bCheck );
1619 if (rBox.get_sensitive())
1623 SAL_WARN(
"cui.options",
"OfaLanguagesTabPage::SupportHdl(): wrong rBox" );
1628 void lcl_checkLanguageCheckBox(
weld::CheckButton& _rCB,
bool _bNewValue,
bool _bOldValue)
1642 LanguageType eLang = m_xLocaleSettingLB->get_active_id();
1648 bool bIsCTLFixed = bool(
nType & SvtScriptType::COMPLEX);
1649 lcl_checkLanguageCheckBox(*m_xCTLSupportCB, bIsCTLFixed, m_bOldCtl);
1650 SupportHdl(*m_xCTLSupportCB);
1656 bool bIsCJKFixed = bool(
nType & SvtScriptType::ASIAN);
1657 lcl_checkLanguageCheckBox(*m_xAsianSupportCB, bIsCJKFixed, m_bOldAsian);
1658 SupportHdl(*m_xAsianSupportCB);
1663 const OUString aDefaultID =
"default";
1665 m_xCurrencyLB->remove_id(aDefaultID);
1666 OUString aDefaultCurr = m_sSystemDefaultString +
" - " + rCurr.GetBankSymbol();
1667 m_xCurrencyLB->insert(0, aDefaultCurr, &aDefaultID,
nullptr,
nullptr);
1668 assert(m_xCurrencyLB->find_id(aDefaultID) != -1);
1669 m_xCurrencyLB->set_active_text(aDefaultCurr);
1675 OUString sTempLabel(m_sDecimalSeparatorLabel);
1676 sTempLabel = sTempLabel.replaceFirst(
"%1", aLocaleWrapper.
getNumDecimalSep() );
1677 m_xDecimalSeparatorCB->set_label(sTempLabel);
1681 m_bDatePatternsValid =
true;
1682 m_xDatePatternsED->set_text( aDatePatternsString);
1688 OUString aPatterns(rEd.get_text());
1689 bool bModified =
false;
1690 const bool bValid = validateDatePatterns( bModified, aPatterns);
1695 const int nCursorPos = rEd.get_position();
1696 rEd.set_text(aPatterns);
1697 rEd.set_position(nCursorPos);
1703 m_bDatePatternsValid = bValid;
1709 if (!rPatterns.isEmpty())
1711 OUStringBuffer
aBuf( rPatterns);
1712 sal_Int32 nChar = 0;
1713 for (sal_Int32
nIndex=0;
nIndex >= 0 && bValid; ++nChar)
1715 const OUString aPat( rPatterns.getToken( 0,
';',
nIndex));
1716 if (aPat.isEmpty() &&
nIndex < 0)
1723 else if (aPat.getLength() < 2)
1728 bY = bM = bD =
false;
1730 if (aPat.getLength() == 3)
1742 for (sal_Int32
i = 0;
i < aPat.getLength() && bValid; )
1744 const sal_Int32 j =
i;
1745 const sal_uInt32 c = aPat.iterateCodePoints( &
i);
1788 if (!(bY || bM || bD))
1795 bValid &= (bY || bM || bD);
1799 rPatterns =
aBuf.makeStringAndClear();
const StyleSettings & GetStyleSettings() const
static OUString GetToolkitName()
static bool hasNativeFileSelection()
static vcl::Window * GetNextTopLevelWindow(vcl::Window const *pWindow)
static const AllSettings & GetSettings()
static vcl::Window * GetFirstTopLevelWindow()
void EnabledHardwareAcceleration(bool _bEnabled) const
bool IsHardwareAccelerationRO() const
bool IsHardwareAccelerationAvailable() const
std::vector< std::pair< OUString, Sequence< OUString > > > ServiceVector
Reference< XNameAccess > mxForceFlagNameAccess
ServiceVector maAvailableImplementations
bool IsHardwareAccelerationEnabled() const
sal_uInt16 GetValue() const
virtual short run() override
LanguageType getLanguageType(bool bResolveSystem=true) const
bool isSystemLocale() const
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
LanguageTag & makeFallback()
static OUString convertToBcp47(LanguageType nLangID)
static LanguageType convertToLanguageType(const css::lang::Locale &rLocale, bool bResolveSystem=true)
static LanguageType convertToLanguageTypeWithFallback(const OUString &rBcp47)
static css::uno::Reference< css::linguistic2::XLinguProperties > GetLinguPropertySet()
const OUString & getNumDecimalSepAlt() const
const css::uno::Sequence< OUString > & getDateAcceptancePatterns() const
const OUString & getNumDecimalSep() const
static void SetDarkMode(int nMode)
static bool needsSequenceChecking(LanguageType nLang)
static LanguageType resolveSystemLanguageByScriptType(LanguageType nLang, sal_Int16 nType)
static LanguageType getConfiguredSystemLanguage()
std::unique_ptr< weld::CheckButton > m_xCurrentDocCB
std::unique_ptr< weld::ComboBox > m_xUserInterfaceLB
std::unique_ptr< weld::CheckButton > m_xDecimalSeparatorCB
OUString m_sSystemDefaultString
std::unique_ptr< weld::Label > m_xLocaleSettingFT
std::unique_ptr< SvxLanguageBox > m_xLocaleSettingLB
OUString m_sDecimalSeparatorLabel
std::unique_ptr< SvxLanguageBox > m_xAsianLanguageLB
std::unique_ptr< weld::CheckButton > m_xCTLSupportCB
std::unique_ptr< weld::CheckButton > m_xAsianSupportCB
std::unique_ptr< weld::Label > m_xDatePatternsFT
std::unique_ptr< weld::Label > m_xWesternLanguageFT
std::unique_ptr< weld::Entry > m_xDatePatternsED
OUString m_sUserLocaleValue
std::unique_ptr< weld::CheckButton > m_xIgnoreLanguageChangeCB
bool m_bDatePatternsValid
bool validateDatePatterns(bool &rbModified, OUString &rPatterns)
std::unique_ptr< LanguageConfig_Impl > pLangConfig
virtual ~OfaLanguagesTabPage() override
std::unique_ptr< SvxLanguageBox > m_xComplexLanguageLB
std::unique_ptr< weld::Label > m_xCurrencyFT
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
virtual bool FillItemSet(SfxItemSet *rSet) override
std::unique_ptr< SvxLanguageBox > m_xWesternLanguageLB
OfaLanguagesTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
std::unique_ptr< weld::ComboBox > m_xCurrencyLB
virtual void Reset(const SfxItemSet *rSet) override
std::unique_ptr< weld::CheckButton > m_xFileDlgCB
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
std::unique_ptr< weld::CheckButton > m_xExtHelpCB
std::unique_ptr< weld::CheckButton > m_xDocStatusCB
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
virtual bool FillItemSet(SfxItemSet *rSet) override
std::unique_ptr< weld::Widget > m_xYearFrame
std::unique_ptr< weld::Widget > m_xFileDlgFrame
std::unique_ptr< weld::CheckButton > m_xPopUpNoHelpCB
std::unique_ptr< weld::SpinButton > m_xYearValueField
virtual ~OfaMiscTabPage() override
std::unique_ptr< weld::CheckButton > m_xShowTipOfTheDay
OfaMiscTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
std::unique_ptr< weld::Widget > m_xFileDlgROImage
virtual void Reset(const SfxItemSet *rSet) override
std::unique_ptr< weld::Label > m_xToYearFT
std::unique_ptr< weld::Button > m_xSkiaLog
std::unique_ptr< weld::CheckButton > m_xForceSkiaRaster
std::unique_ptr< weld::ComboBox > m_xSidebarIconSizeLB
sal_Int32 nStyleLB_InitialSelection
void UpdateHardwareAccelStatus()
std::unique_ptr< weld::MetricSpinButton > m_xAAPointLimit
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
std::unique_ptr< weld::ComboBox > m_xIconStyleLB
virtual bool FillItemSet(SfxItemSet *rSet) override
std::unique_ptr< weld::ComboBox > m_xNotebookbarIconSizeLB
std::unique_ptr< weld::Label > m_xSkiaStatusDisabled
std::unique_ptr< weld::CheckButton > m_xUseAntiAliase
std::unique_ptr< weld::Label > m_xSkiaStatusEnabled
std::unique_ptr< weld::CheckButton > m_xFontShowCB
std::unique_ptr< weld::ComboBox > m_xAppearanceStyleLB
std::unique_ptr< weld::Button > m_xRunGPTests
sal_Int32 nNotebookbarSizeLB_InitialSelection
std::unique_ptr< CanvasSettings > pCanvasSettings
OfaViewTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
std::unique_ptr< weld::CheckButton > m_xUseSkia
std::unique_ptr< weld::ComboBox > m_xIconSizeLB
virtual void Reset(const SfxItemSet *rSet) override
std::unique_ptr< weld::CheckButton > m_xUseHardwareAccell
std::unique_ptr< weld::Button > m_xMoreIcons
std::unique_ptr< weld::CheckButton > m_xFontAntiAliasing
sal_Int32 nSidebarSizeLB_InitialSelection
std::unique_ptr< weld::ComboBox > m_xMouseMiddleLB
std::unique_ptr< weld::Widget > m_xDarkModeFrame
std::vector< vcl::IconThemeInfo > mInstalledIconThemes
sal_Int32 nSizeLB_InitialSelection
virtual ~OfaViewTabPage() override
void SetState(const SfxItemSet &rSet)
void InvalidateAll(bool bWithMsg)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
SfxOkDialogController * GetDialogController() const
void SetExchangeSupport()
const SfxPoolItem * GetOldItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
weld::Window * GetFrameWeld() const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
SfxBindings & GetBindings()
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
std::vector< vcl::IconThemeInfo > const & GetInstalledIconThemes() const
OUString GetAutomaticallyChosenIconTheme() const
static bool IsCTLFontEnabled()
void SetDefault(SvtCompatibilityEntry::Index rIdx, bool rValue)
static OUString GetLanguageString(const LanguageType eType)
bool IconThemeWasSetAutomatically() const
static sal_Int16 GetSymbolsSize()
void SetIconTheme(const OUString &)
void SetSymbolsSize(sal_Int16 eSet)
static OUString GetIconTheme()
void SetIgnoreKashida_CTL(bool bVal)
void SetIgnoreDiacritics_CTL(bool bVal)
void GetCurrencyAbbrevAndLanguage(OUString &rAbbrev, LanguageType &eLang) const
static OUString CreateCurrencyConfigString(const OUString &rAbbrev, LanguageType eLang)
static std::shared_ptr< ConfigurationChanges > create()
static const vcl::IconThemeInfo & FindIconThemeById(const std::vector< vcl::IconThemeInfo > &themes, const OUString &themeId)
const OUString & GetDisplayName() const
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
static void CopyStringTo(const OUString &rContent, const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &rxClipboard, const vcl::ILibreOfficeKitNotifier *pNotifier=nullptr)
virtual void set_active(bool active)=0
#define TOOLS_WARN_EXCEPTION(area, stream)
virtual tools::Long GetValue() const override
Reference< XSingleServiceFactory > xFactory
#define LANGUAGE_USER_SYSTEM_CONFIG
#define LANGUAGE_DONTKNOW
OUString SVT_DLLPUBLIC getInstalledLocaleForSystemUILanguage(css::uno::Sequence< OUString > const &installed, bool bRequestInstallIfMissing, const OUString &rPreferredLocale=OUString())
SVT_DLLPUBLIC OUString ApplyLreOrRleEmbedding(const OUString &rText)
#define LINK(Instance, Class, Member)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
if(aStr !=aBuf) UpdateName_Impl(m_xFollowLb.get()
VCL_DLLPUBLIC OUString readLog()
VCL_DLLPUBLIC bool isVCLSkiaEnabled()
SvtScriptType GetScriptTypeOfLanguage(LanguageType nLang)
bool IsAAPossibleOnThisSystem()
void SetAntiAliasing(bool bOn, bool bTemporary)
SVT_DLLPUBLIC void SetApplicationDefaults(Application *pApp)
css::uno::Sequence< css::uno::Any > InitAnyPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
bool dispatchCommand(const OUString &rCommand, const uno::Reference< css::frame::XFrame > &rFrame, const css::uno::Sequence< css::beans::PropertyValue > &rArguments, const uno::Reference< css::frame::XDispatchResultListener > &rListener)
Reference< XMultiServiceFactory > getProcessServiceFactory()
Reference< XComponentContext > getProcessComponentContext()
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
const LocaleDataWrapper & GetLocaleDataWrapper(LanguageType nLang)
VCL_DLLPUBLIC void LaunchRegistrationUI()
OUString toId(const void *pValue)
Reference< XNameAccess > m_xContainer
IMPL_LINK_NOARG(OfaMiscTabPage, TwoFigureHdl, weld::SpinButton &, void)
constexpr OUStringLiteral sAccessUpdSrvc
constexpr OUStringLiteral sUserLocalePath
IMPL_LINK(OfaLanguagesTabPage, SupportHdl, weld::Toggleable &, rBox, void)
static OUString lcl_getDatePatternsConfigString(const LocaleDataWrapper &rLocaleWrapper)
static bool DisplayNameCompareLessThan(const vcl::IconThemeInfo &rInfo1, const vcl::IconThemeInfo &rInfo2)
static void lcl_Update(std::unique_ptr< SfxVoidItem > pInvalidItems[], std::unique_ptr< SfxBoolItem > pBoolItems[], sal_uInt16 nCount)
constexpr OUStringLiteral sInstalledLocalesPath
constexpr OUStringLiteral sUserLocaleKey
static Sequence< OUString > seqInstalledLanguages
IMPL_STATIC_LINK_NOARG(OfaViewTabPage, OnMoreIconsClick, weld::Button &, void)
static bool bLanguageCurrentDoc_Impl
constexpr OUStringLiteral sAccessSrvc
SvtCTLOptions aCTLLanguageOptions
SvtLinguConfig aLinguConfig
SvtSysLocaleOptions aSysLocaleOptions
VCL_DLLPUBLIC Application * GetpApp()