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>
106 return DeactivateRC::LeavePage;
111OUString impl_SystemFileOpenServiceName()
114 return "com.sun.star.ui.dialogs.SystemFilePicker";
116 return "com.sun.star.ui.dialogs.AquaFilePicker";
122bool lcl_HasSystemFilePicker()
131 Reference< XContentEnumerationAccess > xEnumAccess( xFactory, UNO_QUERY );
132 Reference< XSet > xSet( xFactory, UNO_QUERY );
134 if ( ! xEnumAccess.is() || ! xSet.is() )
139 OUString aFileService = impl_SystemFileOpenServiceName();
140 Reference< XEnumeration > xEnum = xEnumAccess->createContentEnumeration( aFileService );
141 if ( xEnum.is() && xEnum->hasMoreElements() )
144 catch (
const IllegalArgumentException&)
147 catch (
const ElementExistException&)
155 :
SfxTabPage(pPage, pController,
"cui/ui/optgeneralpage.ui",
"OptGeneralPage", &
rSet)
156 , m_xExtHelpCB(m_xBuilder->weld_check_button(
"exthelp"))
157 , m_xPopUpNoHelpCB(m_xBuilder->weld_check_button(
"popupnohelp"))
158 , m_xShowTipOfTheDay(m_xBuilder->weld_check_button(
"cbShowTipOfTheDay"))
159 , m_xFileDlgFrame(m_xBuilder->weld_widget(
"filedlgframe"))
160 , m_xFileDlgROImage(m_xBuilder->weld_widget(
"lockimage"))
161 , m_xFileDlgCB(m_xBuilder->weld_check_button(
"filedlg"))
162 , m_xDocStatusCB(m_xBuilder->weld_check_button(
"docstatus"))
163 , m_xYearFrame(m_xBuilder->weld_widget(
"yearframe"))
164 , m_xYearValueField(m_xBuilder->weld_spin_button(
"year"))
165 , m_xToYearFT(m_xBuilder->weld_label(
"toyear"))
166 , m_xCrashReport(m_xBuilder->weld_check_button(
"crashreport"))
167 , m_xQuickStarterFrame(m_xBuilder->weld_widget(
"quickstarter"))
168 , m_xHelpImproveLabel(m_xBuilder->weld_label(
"label7"))
170 , m_xQuickLaunchCB(m_xBuilder->weld_check_button(
"systray"))
172 , m_xQuickLaunchCB(m_xBuilder->weld_check_button(
"quicklaunch"))
175 , m_xFileAssocFrame(m_xBuilder->weld_widget(
"fileassoc"))
176 , m_xFileAssocBtn(m_xBuilder->weld_button(
"assocfiles"))
177 , m_xPerformFileExtCheck(m_xBuilder->weld_check_button(
"cbPerformFileExtCheck"))
180 if (!lcl_HasSystemFilePicker())
182 else if (officecfg::Office::Common::Misc::UseSystemFileDialog::isReadOnly())
198 m_xFileAssocFrame->show();
214 return std::make_unique<OfaMiscTabPage>( pPage, pController, *rAttrSet );
219 bool bModified =
false;
223 officecfg::Office::Common::Help::BuiltInHelpNotInstalledPopUp::set(
m_xPopUpNoHelpCB->get_active(), batch);
226 officecfg::Office::Common::Help::ExtendedTip::set(
m_xExtHelpCB->get_active(), batch);
230 officecfg::Office::Common::Misc::ShowTipOfTheDay::set(
m_xShowTipOfTheDay->get_active(), batch);
236 officecfg::Office::Common::Misc::UseSystemFileDialog::set( !
m_xFileDlgCB->get_active(), batch );
242 officecfg::Office::Common::Print::PrintingModifiesDocument::set(
m_xDocStatusCB->get_active(), batch);
247 sal_uInt16 nNum =
static_cast<sal_uInt16
>(
m_xYearValueField->get_text().toInt32());
248 if ( pUInt16Item && pUInt16Item->
GetValue() != nNum )
254#if HAVE_FEATURE_BREAKPAD
257 officecfg::Office::Common::Misc::CrashReport::set(
m_xCrashReport->get_active(), batch);
263 if (m_xPerformFileExtCheck->get_state_changed_from_saved())
265 officecfg::Office::Common::Misc::PerformFileExtCheck::set(
266 m_xPerformFileExtCheck->get_active(), batch);
284 m_xExtHelpCB->set_active( officecfg::Office::Common::Help::Tip::get() &&
285 officecfg::Office::Common::Help::ExtendedTip::get() );
287 m_xPopUpNoHelpCB->set_active( officecfg::Office::Common::Help::BuiltInHelpNotInstalledPopUp::get() );
289 m_xShowTipOfTheDay->set_active( officecfg::Office::Common::Misc::ShowTipOfTheDay::get() );
291 m_xFileDlgCB->set_active( !officecfg::Office::Common::Misc::UseSystemFileDialog::get() );
294 m_xDocStatusCB->set_active(officecfg::Office::Common::Print::PrintingModifiesDocument::get());
305#if HAVE_FEATURE_BREAKPAD
306 m_xCrashReport->set_active(officecfg::Office::Common::Misc::CrashReport::get() && CrashReporter::IsDumpEnable());
307 m_xCrashReport->set_sensitive(!officecfg::Office::Common::Misc::CrashReport::isReadOnly() && CrashReporter::IsDumpEnable());
315 if ( SfxItemState::SET == eState )
317 else if ( SfxItemState::DISABLED == eState )
326 m_xPerformFileExtCheck->set_active(
327 officecfg::Office::Common::Misc::PerformFileExtCheck::get());
328 m_xPerformFileExtCheck->save_state();
329 m_xPerformFileExtCheck->set_sensitive(!officecfg::Office::Common::Misc::PerformFileExtCheck::isReadOnly());
335 OUString aOutput( m_aStrDateInfo );
336 OUString
aStr( m_xYearValueField->get_text() );
337 sal_Int32 nNum =
aStr.toInt32();
338 if (
aStr.getLength() != 4 || nNum < m_xYearValueField->get_min() || nNum > m_xYearValueField->get_max() )
343 aOutput += OUString::number( nNum );
345 m_xToYearFT->set_label( aOutput );
366 typedef std::vector< std::pair<OUString,Sequence<OUString> > >
ServiceVector;
375 mbHWAccelAvailable(false),
376 mbHWAccelChecked(false)
380 Reference<XMultiServiceFactory> xConfigProvider(
381 css::configuration::theDefaultProvider::get(
386 {
"nodepath",
Any(OUString(
"/org.openoffice.Office.Canvas"))}
389 xConfigProvider->createInstanceWithArguments(
390 "com.sun.star.configuration.ConfigurationUpdateAccess",
396 {
"nodepath",
Any(OUString(
"/org.openoffice.Office.Canvas/CanvasServiceList"))}
398 Reference<XNameAccess> xNameAccess(
399 xConfigProvider->createInstanceWithArguments(
400 "com.sun.star.configuration.ConfigurationAccess",
401 aArgs2 ), UNO_QUERY_THROW );
402 Reference<XHierarchicalNameAccess> xHierarchicalNameAccess(
403 xNameAccess, UNO_QUERY_THROW);
405 Sequence<OUString> serviceNames = xNameAccess->getElementNames();
406 const OUString* pCurr = serviceNames.getConstArray();
407 const OUString*
const pEnd = pCurr + serviceNames.getLength();
408 while( pCurr != pEnd )
410 Reference<XNameAccess> xEntryNameAccess(
411 xHierarchicalNameAccess->getByHierarchicalName(*pCurr),
414 if( xEntryNameAccess.is() )
416 Sequence<OUString> preferredImplementations;
417 if( xEntryNameAccess->getByName(
"PreferredImplementations") >>= preferredImplementations )
441 const OUString* pCurrImpl = availableImpl.second.getConstArray();
442 const OUString*
const pEndImpl = pCurrImpl + availableImpl.second.getLength();
444 while( pCurrImpl != pEndImpl )
448 Reference<XPropertySet> xPropSet(
xFactory->createInstance(
451 bool bHasAccel(
false);
452 if( xPropSet->getPropertyValue(
"HardwareAcceleration") >>= bHasAccel )
473 bool bForceLastEntry(
false);
480 return !bForceLastEntry;
490 Property aProp = xInfo->getPropertyByName(
"ForceSafeServiceImpl");
491 return ((aProp.Attributes & css::beans::PropertyAttribute::READONLY ) == css::beans::PropertyAttribute::READONLY);
496 Reference< XNameReplace > xNameReplace(
499 if( !xNameReplace.is() )
502 xNameReplace->replaceByName(
"ForceSafeServiceImpl",
Any(!_bEnabled) );
504 Reference< XChangesBatch > xChangesBatch(
507 if( !xChangesBatch.is() )
510 xChangesBatch->commitChanges();
521 :
SfxTabPage(pPage, pController,
"cui/ui/optviewpage.ui",
"OptViewPage", &
rSet)
522 , nSizeLB_InitialSelection(0)
523 , nSidebarSizeLB_InitialSelection(0)
524 , nNotebookbarSizeLB_InitialSelection(0)
525 , 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_xIconStyleLB(m_xBuilder->weld_combo_box(
"iconstyle"))
532 , m_xFontAntiAliasing(m_xBuilder->weld_check_button(
"aafont"))
533 , m_xAAPointLimitLabel(m_xBuilder->weld_label(
"aafrom"))
534 , m_xAAPointLimit(m_xBuilder->weld_metric_spin_button(
"aanf",
FieldUnit::
PIXEL))
535 , m_xMenuIconBox(m_xBuilder->weld_widget(
"menuiconsbox"))
536 , m_xMenuIconsLB(m_xBuilder->weld_combo_box(
"menuicons"))
537 , m_xContextMenuShortcutsLB(m_xBuilder->weld_combo_box(
"contextmenushortcuts"))
538 , m_xFontShowCB(m_xBuilder->weld_check_button(
"showfontpreview"))
539 , m_xUseHardwareAccell(m_xBuilder->weld_check_button(
"useaccel"))
540 , m_xUseAntiAliase(m_xBuilder->weld_check_button(
"useaa"))
541 , m_xUseSkia(m_xBuilder->weld_check_button(
"useskia"))
542 , m_xForceSkiaRaster(m_xBuilder->weld_check_button(
"forceskiaraster"))
543 , m_xSkiaStatusEnabled(m_xBuilder->weld_label(
"skiaenabled"))
544 , m_xSkiaStatusDisabled(m_xBuilder->weld_label(
"skiadisabled"))
545 , m_xMousePosLB(m_xBuilder->weld_combo_box(
"mousepos"))
546 , m_xMouseMiddleLB(m_xBuilder->weld_combo_box(
"mousemiddle"))
547 , m_xMoreIcons(m_xBuilder->weld_button(
"btnMoreIcons"))
548 , m_xRunGPTests(m_xBuilder->weld_button(
"btn_rungptest"))
568 OUString entryForAuto = sAutoStr +
" (" +
577 m_xIconStyleLB->append(installIconTheme.GetThemeId(), installIconTheme.GetDisplayName());
581 m_xMoreIcons->set_from_icon_name(
"cmd/sc_additionsdialog.png");
593 m_xGraphicsTestDialog.
run();
599 "AdditionsTag", OUString(
"Icons")) };
605 bool bAAEnabled = m_xFontAntiAliasing->get_active();
607 m_xAAPointLimitLabel->set_sensitive(bAAEnabled);
608 m_xAAPointLimit->set_sensitive(bAAEnabled);
627 bool skiaHidden =
true;
651 m_xUseSkia->set_sensitive(!officecfg::Office::Common::VCL::UseSkia::isReadOnly());
664 return std::make_unique<OfaViewTabPage>(pPage, pController, *rAttrSet);
669 bool bModified =
false;
670 bool bMenuOptModified =
false;
671 bool bRepaintWindows(
false);
675 const sal_Int32 nSizeLB_NewSelection =
m_xIconSizeLB->get_active();
680 switch( nSizeLB_NewSelection )
687 OSL_FAIL(
"OfaViewTabPage::FillItemSet(): This state of m_xIconSizeLB should not be possible!" );
697 switch( nSidebarSizeLB_NewSelection )
699 case 0: eSet = ToolBoxButtonSize::DontCare;
break;
700 case 1: eSet = ToolBoxButtonSize::Small;
break;
701 case 2: eSet = ToolBoxButtonSize::Large;
break;
703 OSL_FAIL(
"OfaViewTabPage::FillItemSet(): This state of m_xSidebarIconSizeLB should not be possible!" );
705 officecfg::Office::Common::Misc::SidebarIconSize::set(
static_cast<sal_Int16
>(eSet), xChanges);
713 switch( nNotebookbarSizeLB_NewSelection )
715 case 0: eSet = ToolBoxButtonSize::DontCare;
break;
716 case 1: eSet = ToolBoxButtonSize::Small;
break;
717 case 2: eSet = ToolBoxButtonSize::Large;
break;
719 OSL_FAIL(
"OfaViewTabPage::FillItemSet(): This state of m_xNotebookbarIconSizeLB should not be possible!" );
721 officecfg::Office::Common::Misc::NotebookbarIconSize::set(
static_cast<sal_Int16
>(eSet), xChanges);
724 const sal_Int32 nStyleLB_NewSelection =
m_xIconStyleLB->get_active();
731 bool bAppearanceChanged =
false;
736 if(eNewSnap > SnapType::NONE)
737 eNewSnap = SnapType::NONE;
739 if ( eNewSnap != eOldSnap )
742 bAppearanceChanged =
true;
748 if(eNewMiddleMouse > 2)
751 if ( eNewMiddleMouse !=
static_cast<short>(eOldMiddleMouse) )
754 bAppearanceChanged =
true;
760 bAppearanceChanged =
true;
766 bAppearanceChanged =
true;
771 officecfg::Office::Common::Font::View::ShowFontBoxWYSIWYG::set(
m_xFontShowCB->get_active(), xChanges);
777 officecfg::Office::Common::View::Menu::IsSystemIconsInMenus::set(
m_xMenuIconsLB->get_active() == 0, xChanges);
778 officecfg::Office::Common::View::Menu::ShowIconsInMenues::set(
m_xMenuIconsLB->get_active() == 2, xChanges);
780 bMenuOptModified =
true;
781 bAppearanceChanged =
true;
786 officecfg::Office::Common::View::Menu::ShortcutsInContextMenus::set(
792 bMenuOptModified =
true;
793 bAppearanceChanged =
true;
813 bRepaintWindows =
true;
817 if (
m_xUseSkia->get_state_changed_from_saved() ||
820 officecfg::Office::Common::VCL::UseSkia::set(
m_xUseSkia->get_active(), xChanges);
821 officecfg::Office::Common::VCL::ForceSkiaRaster::set(
m_xForceSkiaRaster->get_active(), xChanges);
827 if( bMenuOptModified )
837 if ( bAppearanceChanged )
854 if (
m_xUseSkia->get_state_changed_from_saved() ||
884 if( eSidebarIconSize == ToolBoxButtonSize::DontCare )
886 else if( eSidebarIconSize == ToolBoxButtonSize::Small )
888 else if( eSidebarIconSize == ToolBoxButtonSize::Large )
893 if( eNotebookbarIconSize == ToolBoxButtonSize::DontCare )
895 else if( eNotebookbarIconSize == ToolBoxButtonSize::Small )
897 else if( eNotebookbarIconSize == ToolBoxButtonSize::Large )
927 m_xFontShowCB->set_active(officecfg::Office::Common::Font::View::ShowFontBoxWYSIWYG::get());
928 bool bSystemMenuIcons = officecfg::Office::Common::View::Menu::IsSystemIconsInMenus::get();
929 bool bMenuIcons = officecfg::Office::Common::View::Menu::ShowIconsInMenues::get();
930 m_xMenuIconsLB->set_active(bSystemMenuIcons ? 0 : (bMenuIcons ? 2 : 1));
933 TriState eContextMenuShortcuts =
static_cast<TriState>(officecfg::Office::Common::View::Menu::ShortcutsInContextMenus::get());
955 m_xUseSkia->set_active(officecfg::Office::Common::VCL::UseSkia::get());
956 m_xForceSkiaRaster->set_active(officecfg::Office::Common::VCL::ForceSkiaRaster::get());
996constexpr OUStringLiteral
sAccessSrvc =
u"com.sun.star.configuration.ConfigurationAccess";
997constexpr OUStringLiteral
sAccessUpdSrvc =
u"com.sun.star.configuration.ConfigurationUpdateAccess";
1006 sal_Int32 nPatterns = aDateAcceptancePatterns.getLength();
1007 OUStringBuffer
aBuf( nPatterns * 6 );
1008 SAL_WARN_IF( !nPatterns,
"cui.options",
"No date acceptance pattern");
1011 const OUString* pPatterns = aDateAcceptancePatterns.getConstArray();
1012 aBuf.append( pPatterns[0]);
1013 for (sal_Int32
i=1;
i < nPatterns; ++
i)
1014 aBuf.append(
';').append( pPatterns[
i]);
1016 return aBuf.makeStringAndClear();
1022 LanguageTag GetInstalledLocaleForSystemUILanguage()
1024 css::uno::Sequence<OUString> inst(officecfg::Setup::Office::InstalledLocales::get()->getElementNames());
1030 :
SfxTabPage(pPage, pController,
"cui/ui/optlanguagespage.ui",
"OptLanguagesPage", &
rSet)
1032 , m_bDatePatternsValid(false)
1033 , m_xUserInterfaceLB(m_xBuilder->weld_combo_box(
"userinterface"))
1034 , m_xLocaleSettingFT(m_xBuilder->weld_label(
"localesettingFT"))
1035 , m_xLocaleSettingLB(new
SvxLanguageBox(m_xBuilder->weld_combo_box(
"localesetting")))
1036 , m_xDecimalSeparatorCB(m_xBuilder->weld_check_button(
"decimalseparator"))
1037 , m_xCurrencyFT(m_xBuilder->weld_label(
"defaultcurrency"))
1038 , m_xCurrencyLB(m_xBuilder->weld_combo_box(
"currencylb"))
1039 , m_xDatePatternsFT(m_xBuilder->weld_label(
"dataaccpatterns"))
1040 , m_xDatePatternsED(m_xBuilder->weld_entry(
"datepatterns"))
1041 , m_xWesternLanguageLB(new
SvxLanguageBox(m_xBuilder->weld_combo_box(
"westernlanguage")))
1042 , m_xWesternLanguageFT(m_xBuilder->weld_label(
"western"))
1043 , m_xAsianLanguageLB(new
SvxLanguageBox(m_xBuilder->weld_combo_box(
"asianlanguage")))
1044 , m_xComplexLanguageLB(new
SvxLanguageBox(m_xBuilder->weld_combo_box(
"complexlanguage")))
1045 , m_xCurrentDocCB(m_xBuilder->weld_check_button(
"currentdoc"))
1046 , m_xAsianSupportCB(m_xBuilder->weld_check_button(
"asiansupport"))
1047 , m_xCTLSupportCB(m_xBuilder->weld_check_button(
"ctlsupport"))
1048 , m_xIgnoreLanguageChangeCB(m_xBuilder->weld_check_button(
"ignorelanguagechange"))
1065 css::configuration::theDefaultProvider::get(
1070 theConfigProvider->createInstanceWithArguments(
sAccessSrvc, theArgs ), UNO_QUERY_THROW );
1073 std::vector< std::pair<sal_Int32, OUString> > aUILanguages;
1080 aUILanguages.emplace_back(
i+1, aLangStr);
1084 std::sort(aUILanguages.begin(), aUILanguages.end(), [](
const auto& l1,
const auto& l2) {
1085 static const auto aSorter = comphelper::string::NaturalStringSorter(
1086 comphelper::getProcessComponentContext(),
1087 Application::GetSettings().GetLanguageTag().getLocale());
1088 return aSorter.compare(l1.second, l2.second) < 0;
1092 for (
const auto & [ nGroupID, sGroupName ] : aUILanguages)
1102 theConfigProvider->createInstanceWithArguments(
sAccessSrvc, theArgs2 ), UNO_QUERY_THROW );
1125 SvxLanguageListFlags::WESTERN | SvxLanguageListFlags::ONLY_KNOWN,
true,
false,
true,
true,
1129 SvxLanguageListFlags::CJK | SvxLanguageListFlags::ONLY_KNOWN,
true,
false,
true,
true,
1133 SvxLanguageListFlags::CTL | SvxLanguageListFlags::ONLY_KNOWN,
true,
false,
true,
true,
1137 SvxLanguageListFlags::ALL | SvxLanguageListFlags::ONLY_KNOWN,
false,
false,
false,
true,
1149 OUString aTwoSpace(
" " );
1150 sal_uInt16 nCurrCount = rCurrTab.
size();
1151 std::vector< const NfCurrencyEntry* > aCurrencies;
1153 for ( sal_uInt16 j=1; j < nCurrCount; ++j )
1155 aCurrencies.push_back(&rCurrTab[j]);
1157 std::sort(aCurrencies.begin(), aCurrencies.end(),
1158 [](
const NfCurrencyEntry* c1,
const NfCurrencyEntry* c2) {
1159 return c1->GetBankSymbol().compareTo(c2->GetBankSymbol()) < 0;
1162 for (
auto &
v : aCurrencies)
1164 OUString aStr_ =
v->GetBankSymbol() +
1205 return std::make_unique<OfaLanguagesTabPage>(pPage, pController, *rAttrSet);
1208static void lcl_Update(std::unique_ptr<SfxVoidItem> pInvalidItems[], std::unique_ptr<SfxBoolItem> pBoolItems[], sal_uInt16 nCount)
1217 if(pCurrentFrm == pViewFrm)
1229 pLangConfig->aSysLocaleOptions.BlockBroadcasts(
true );
1230 pLangConfig->aCTLLanguageOptions.BlockBroadcasts(
true );
1231 pLangConfig->aLinguConfig.BlockBroadcasts(
true );
1249 pLangConfig->aCTLLanguageOptions.SetCTLSequenceCheckingRestricted(bOn);
1250 pLangConfig->aCTLLanguageOptions.SetCTLSequenceChecking(bOn);
1251 pLangConfig->aCTLLanguageOptions.SetCTLSequenceCheckingTypeAndReplace(bOn);
1257 OUString aLangString;
1267 css::configuration::theDefaultProvider::get(
1271 theConfigProvider->createInstanceWithArguments(
sAccessUpdSrvc, theArgs ), UNO_QUERY_THROW );
1277 Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges();
1287 Reference< XComponentContext > xContext(
1289 css::office::Quickstart::createAndSetVeto(xContext,
false,
false,
false);
1310 if ( eOldLocale != eNewLocale )
1320 pLangConfig->aSysLocaleOptions.SetLocaleConfigString( sNewLang );
1324 bool bNewCJK = bool( nNewType & SvtScriptType::ASIAN );
1336 OUString sOldCurr =
pLangConfig->aSysLocaleOptions.GetCurrencyConfigString();
1338 const NfCurrencyEntry* pCurr =
sId ==
"default" ? nullptr : weld::fromId<const NfCurrencyEntry*>(
sId);
1342 pCurr->GetBankSymbol(), pCurr->GetLanguage() );
1343 if ( sOldCurr != sNewCurr )
1344 pLangConfig->aSysLocaleOptions.SetCurrencyConfigString( sNewCurr );
1356 bool bCurrentDocCBChanged =
m_xCurrentDocCB->get_state_changed_from_saved();
1359 if( (bCurrentDocCBChanged && !bCurrentDocCBChecked) || bValChanged)
1362 if(!bCurrentDocCBChecked)
1367 pLangConfig->aLinguConfig.SetProperty(
u"DefaultLocale", aValue );
1368 if (xLinguProp.is())
1369 xLinguProp->setDefaultLocale( aLocale );
1371 if(pCurrentDocShell)
1374 SID_ATTR_LANGUAGE));
1378 if( (bCurrentDocCBChanged && !bCurrentDocCBChecked) || bValChanged)
1381 if(!bCurrentDocCBChecked)
1386 pLangConfig->aLinguConfig.SetProperty(
u"DefaultLocale_CJK", aValue );
1387 if (xLinguProp.is())
1388 xLinguProp->setDefaultLocale_CJK( aLocale );
1390 if(pCurrentDocShell)
1393 SID_ATTR_CHAR_CJK_LANGUAGE));
1397 if( (bCurrentDocCBChanged && !bCurrentDocCBChecked) || bValChanged)
1400 if(!bCurrentDocCBChecked)
1405 pLangConfig->aLinguConfig.SetProperty(
u"DefaultLocale_CTL", aValue );
1406 if (xLinguProp.is())
1407 xLinguProp->setDefaultLocale_CTL( aLocale );
1409 if(pCurrentDocShell)
1412 SID_ATTR_CHAR_CTL_LANGUAGE));
1422 const sal_uInt16 STATE_COUNT = 2;
1424 std::unique_ptr<SfxBoolItem> pBoolItems[STATE_COUNT];
1425 pBoolItems[0].reset(
new SfxBoolItem(SID_VERTICALTEXT_STATE,
false));
1426 pBoolItems[1].reset(
new SfxBoolItem(SID_TEXT_FITTOSIZE_VERTICAL,
false));
1428 std::unique_ptr<SfxVoidItem> pInvalidItems[STATE_COUNT];
1429 pInvalidItems[0].reset(
new SfxVoidItem(SID_VERTICALTEXT_STATE));
1430 pInvalidItems[1].reset(
new SfxVoidItem(SID_TEXT_FITTOSIZE_VERTICAL));
1432 lcl_Update(pInvalidItems, pBoolItems, STATE_COUNT);
1443 const sal_uInt16 STATE_COUNT = 1;
1444 std::unique_ptr<SfxBoolItem> pBoolItems[STATE_COUNT];
1445 pBoolItems[0].reset(
new SfxBoolItem(SID_CTLFONT_STATE,
false));
1446 std::unique_ptr<SfxVoidItem> pInvalidItems[STATE_COUNT];
1447 pInvalidItems[0].reset(
new SfxVoidItem(SID_CTLFONT_STATE));
1448 lcl_Update(pInvalidItems, pBoolItems, STATE_COUNT);
1451 if (
pLangConfig->aSysLocaleOptions.IsModified() )
1457 pLangConfig->aSysLocaleOptions.BlockBroadcasts(
false );
1458 pLangConfig->aCTLLanguageOptions.BlockBroadcasts(
false );
1459 pLangConfig->aLinguConfig.BlockBroadcasts(
false );
1488 const NfCurrencyEntry* pCurr =
nullptr;
1489 OUString sCurrency =
pLangConfig->aSysLocaleOptions.GetCurrencyConfigString();
1490 if ( !sCurrency.isEmpty() )
1498 OUString
sId = !pCurr ? OUString(
"default") :
weld::toId(pCurr);
1505 OUString aDatePatternsString =
pLangConfig->aSysLocaleOptions.GetDatePatternsConfigString();
1506 if (aDatePatternsString.isEmpty())
1515 bool bModified =
false;
1539 aWestLang =
pLangConfig->aLinguConfig.GetProperty(
u"DefaultLocale");
1541 aWestLang >>= aLocale;
1545 aCJKLang =
pLangConfig->aLinguConfig.GetProperty(
u"DefaultLocale_CJK");
1547 aCJKLang >>= aLocale;
1550 aCTLLang =
pLangConfig->aLinguConfig.GetProperty(
u"DefaultLocale_CTL");
1552 aCTLLang >>= aLocale;
1559 if(pCurrentDocShell)
1567 eCurLang = eTempCurLang;
1574 eCurLangCJK = eTempCurLang;
1581 eCurLangCTL = eTempCurLang;
1605 bool bEnable = !
pLangConfig->aLinguConfig.IsReadOnly(
u"DefaultLocale" );
1622 bool bCheck = rBox.get_active();
1623 if ( m_xAsianSupportCB.get() == &rBox )
1625 bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly(
u"DefaultLocale_CJK");
1626 bCheck = ( bCheck && !bReadonly );
1627 m_xAsianLanguageLB->set_sensitive( bCheck );
1628 if (rBox.get_sensitive())
1629 m_bOldAsian = bCheck;
1631 else if ( m_xCTLSupportCB.get() == &rBox )
1633 bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly(
u"DefaultLocale_CTL");
1634 bCheck = ( bCheck && !bReadonly );
1635 m_xComplexLanguageLB->set_sensitive( bCheck );
1636 if (rBox.get_sensitive())
1640 SAL_WARN(
"cui.options",
"OfaLanguagesTabPage::SupportHdl(): wrong rBox" );
1645 void lcl_checkLanguageCheckBox(
weld::CheckButton& _rCB,
bool _bNewValue,
bool _bOldValue)
1659 LanguageType eLang = m_xLocaleSettingLB->get_active_id();
1665 bool bIsCTLFixed = bool(
nType & SvtScriptType::COMPLEX);
1666 lcl_checkLanguageCheckBox(*m_xCTLSupportCB, bIsCTLFixed, m_bOldCtl);
1667 SupportHdl(*m_xCTLSupportCB);
1673 bool bIsCJKFixed = bool(
nType & SvtScriptType::ASIAN);
1674 lcl_checkLanguageCheckBox(*m_xAsianSupportCB, bIsCJKFixed, m_bOldAsian);
1675 SupportHdl(*m_xAsianSupportCB);
1680 const OUString aDefaultID =
"default";
1682 m_xCurrencyLB->remove_id(aDefaultID);
1683 OUString aDefaultCurr = m_sSystemDefaultString +
" - " + rCurr.GetBankSymbol();
1684 m_xCurrencyLB->insert(0, aDefaultCurr, &aDefaultID,
nullptr,
nullptr);
1685 assert(m_xCurrencyLB->find_id(aDefaultID) != -1);
1686 m_xCurrencyLB->set_active_text(aDefaultCurr);
1692 OUString sTempLabel(m_sDecimalSeparatorLabel);
1693 sTempLabel = sTempLabel.replaceFirst(
"%1", aLocaleWrapper.
getNumDecimalSep() );
1694 m_xDecimalSeparatorCB->set_label(sTempLabel);
1698 m_bDatePatternsValid =
true;
1699 m_xDatePatternsED->set_text( aDatePatternsString);
1705 OUString aPatterns(rEd.get_text());
1706 bool bModified =
false;
1707 const bool bValid = validateDatePatterns( bModified, aPatterns);
1712 const int nCursorPos = rEd.get_position();
1713 rEd.set_text(aPatterns);
1714 rEd.set_position(nCursorPos);
1720 m_bDatePatternsValid = bValid;
1726 if (!rPatterns.isEmpty())
1728 OUStringBuffer
aBuf( rPatterns);
1729 sal_Int32 nChar = 0;
1730 for (sal_Int32
nIndex=0;
nIndex >= 0 && bValid; ++nChar)
1732 const OUString aPat( rPatterns.getToken( 0,
';',
nIndex));
1733 if (aPat.isEmpty() &&
nIndex < 0)
1740 else if (aPat.getLength() < 2)
1745 bY = bM = bD =
false;
1747 if (aPat.getLength() == 3)
1759 for (sal_Int32
i = 0;
i < aPat.getLength() && bValid; )
1761 const sal_Int32 j =
i;
1762 const sal_uInt32 c = aPat.iterateCodePoints( &
i);
1805 if (!(bY || bM || bD))
1812 bValid &= (bY || bM || bD);
1816 rPatterns =
aBuf.makeStringAndClear();
const StyleSettings & GetStyleSettings() const
void SetStyleSettings(const StyleSettings &rSet)
static void MergeSystemSettings(AllSettings &rSettings)
static OUString GetToolkitName()
static bool hasNativeFileSelection()
static vcl::Window * GetNextTopLevelWindow(vcl::Window const *pWindow)
static const AllSettings & GetSettings()
static void SetSettings(const AllSettings &rSettings)
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 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::Widget > m_xQuickStarterFrame
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
std::unique_ptr< weld::CheckButton > m_xQuickLaunchCB
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
std::unique_ptr< weld::Label > m_xHelpImproveLabel
virtual ~OfaMiscTabPage() override
std::unique_ptr< weld::CheckButton > m_xCrashReport
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::CheckButton > m_xForceSkiaRaster
std::unique_ptr< weld::ComboBox > m_xSidebarIconSizeLB
sal_Int32 nStyleLB_InitialSelection
void UpdateHardwareAccelStatus()
std::unique_ptr< weld::MetricSpinButton > m_xAAPointLimit
std::unique_ptr< SvtTabAppearanceCfg > pAppearanceCfg
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::Widget > m_xMenuIconBox
std::unique_ptr< weld::ComboBox > m_xMousePosLB
std::unique_ptr< weld::ComboBox > m_xMenuIconsLB
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::Button > m_xRunGPTests
std::unique_ptr< weld::ComboBox > m_xContextMenuShortcutsLB
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::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
void SetDefault(SvtCompatibilityEntry::Index rIdx, bool rValue)
static OUString GetLanguageString(const LanguageType eType)
bool IconThemeWasSetAutomatically() const
sal_Int16 GetSymbolsSize() const
void SetIconTheme(const OUString &)
OUString GetIconTheme() const
void SetSymbolsSize(sal_Int16 eSet)
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
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
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 bool isVCLSkiaEnabled()
bool IsReadOnly(EOption eOption)
SvtScriptType GetScriptTypeOfLanguage(LanguageType nLang)
bool IsAAPossibleOnThisSystem()
void SetAntiAliasing(bool bOn, bool bTemporary)
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()