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>
98 using namespace ::
utl;
106 return DeactivateRC::LeavePage;
111 OUString impl_SystemFileOpenServiceName()
114 return "com.sun.star.ui.dialogs.SystemFilePicker";
116 return "com.sun.star.ui.dialogs.AquaFilePicker";
122 bool 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_xPrintDlgCB(m_xBuilder->weld_check_button(
"printdlg"))
163 , m_xDocStatusCB(m_xBuilder->weld_check_button(
"docstatus"))
164 , m_xYearFrame(m_xBuilder->weld_widget(
"yearframe"))
165 , m_xYearValueField(m_xBuilder->weld_spin_button(
"year"))
166 , m_xToYearFT(m_xBuilder->weld_label(
"toyear"))
167 , m_xCrashReport(m_xBuilder->weld_check_button(
"crashreport"))
168 , m_xQuickStarterFrame(m_xBuilder->weld_widget(
"quickstarter"))
169 , m_xHelpImproveLabel(m_xBuilder->weld_label(
"label7"))
171 , m_xQuickLaunchCB(m_xBuilder->weld_check_button(
"systray"))
173 , m_xQuickLaunchCB(m_xBuilder->weld_check_button(
"quicklaunch"))
176 , m_xFileAssocFrame(m_xBuilder->weld_widget(
"fileassoc"))
177 , m_xFileAssocBtn(m_xBuilder->weld_button(
"assocfiles"))
178 , m_xPerformFileExtCheck(m_xBuilder->weld_check_button(
"cbPerformFileExtCheck"))
181 if (!lcl_HasSystemFilePicker())
183 else if (officecfg::Office::Common::Misc::UseSystemFileDialog::isReadOnly())
199 m_xFileAssocFrame->show();
215 return std::make_unique<OfaMiscTabPage>( pPage, pController, *rAttrSet );
220 bool bModified =
false;
224 officecfg::Office::Common::Help::BuiltInHelpNotInstalledPopUp::set(
m_xPopUpNoHelpCB->get_active(), batch);
227 officecfg::Office::Common::Help::ExtendedTip::set(
m_xExtHelpCB->get_active(), batch);
231 officecfg::Office::Common::Misc::ShowTipOfTheDay::set(
m_xShowTipOfTheDay->get_active(), batch);
237 officecfg::Office::Common::Misc::UseSystemFileDialog::set( !
m_xFileDlgCB->get_active(), batch );
243 officecfg::Office::Common::Print::PrintingModifiesDocument::set(
m_xDocStatusCB->get_active(), batch);
248 sal_uInt16 nNum =
static_cast<sal_uInt16
>(
m_xYearValueField->get_text().toInt32());
249 if ( pUInt16Item && pUInt16Item->
GetValue() != nNum )
255 #if HAVE_FEATURE_BREAKPAD
258 officecfg::Office::Common::Misc::CrashReport::set(
m_xCrashReport->get_active(), batch);
264 if (m_xPerformFileExtCheck->get_state_changed_from_saved())
266 officecfg::Office::Common::Misc::PerformFileExtCheck::set(
267 m_xPerformFileExtCheck->get_active(), batch);
285 m_xExtHelpCB->set_active( officecfg::Office::Common::Help::Tip::get() &&
286 officecfg::Office::Common::Help::ExtendedTip::get() );
288 m_xPopUpNoHelpCB->set_active( officecfg::Office::Common::Help::BuiltInHelpNotInstalledPopUp::get() );
290 m_xShowTipOfTheDay->set_active( officecfg::Office::Common::Misc::ShowTipOfTheDay::get() );
292 m_xFileDlgCB->set_active( !officecfg::Office::Common::Misc::UseSystemFileDialog::get() );
295 m_xDocStatusCB->set_active(officecfg::Office::Common::Print::PrintingModifiesDocument::get());
306 #if HAVE_FEATURE_BREAKPAD
307 m_xCrashReport->set_active(officecfg::Office::Common::Misc::CrashReport::get() && CrashReporter::IsDumpEnable());
308 m_xCrashReport->set_sensitive(!officecfg::Office::Common::Misc::CrashReport::isReadOnly() && CrashReporter::IsDumpEnable());
316 if ( SfxItemState::SET == eState )
318 else if ( SfxItemState::DISABLED == eState )
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"))}
400 xConfigProvider->createInstanceWithArguments(
401 "com.sun.star.configuration.ConfigurationAccess",
402 aArgs2 ), UNO_QUERY_THROW );
404 xNameAccess, UNO_QUERY_THROW);
407 const OUString* pCurr = serviceNames.getConstArray();
408 const OUString*
const pEnd = pCurr + serviceNames.getLength();
409 while( pCurr != pEnd )
412 xHierarchicalNameAccess->getByHierarchicalName(*pCurr),
415 if( xEntryNameAccess.is() )
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 )
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)
529 , m_xIconSizeLB(m_xBuilder->weld_combo_box(
"iconsize"))
530 , m_xSidebarIconSizeLB(m_xBuilder->weld_combo_box(
"sidebariconsize"))
531 , m_xNotebookbarIconSizeLB(m_xBuilder->weld_combo_box(
"notebookbariconsize"))
532 , m_xIconStyleLB(m_xBuilder->weld_combo_box(
"iconstyle"))
533 , m_xFontAntiAliasing(m_xBuilder->weld_check_button(
"aafont"))
534 , m_xAAPointLimitLabel(m_xBuilder->weld_label(
"aafrom"))
535 , m_xAAPointLimit(m_xBuilder->weld_metric_spin_button(
"aanf",
FieldUnit::
PIXEL))
536 , m_xMenuIconBox(m_xBuilder->weld_widget(
"menuiconsbox"))
537 , m_xMenuIconsLB(m_xBuilder->weld_combo_box(
"menuicons"))
538 , m_xContextMenuShortcutsLB(m_xBuilder->weld_combo_box(
"contextmenushortcuts"))
539 , m_xFontShowCB(m_xBuilder->weld_check_button(
"showfontpreview"))
540 , m_xUseHardwareAccell(m_xBuilder->weld_check_button(
"useaccel"))
541 , m_xUseAntiAliase(m_xBuilder->weld_check_button(
"useaa"))
542 , m_xUseSkia(m_xBuilder->weld_check_button(
"useskia"))
543 , m_xForceSkiaRaster(m_xBuilder->weld_check_button(
"forceskiaraster"))
544 , m_xSkiaStatusEnabled(m_xBuilder->weld_label(
"skiaenabled"))
545 , m_xSkiaStatusDisabled(m_xBuilder->weld_label(
"skiadisabled"))
546 , m_xMousePosLB(m_xBuilder->weld_combo_box(
"mousepos"))
547 , m_xMouseMiddleLB(m_xBuilder->weld_combo_box(
"mousemiddle"))
548 , m_xMoreIcons(m_xBuilder->weld_button(
"btnMoreIcons"))
549 , m_xRunGPTests(m_xBuilder->weld_button(
"btn_rungptest"))
569 OUString entryForAuto = sAutoStr +
" (" +
578 m_xIconStyleLB->append(installIconTheme.GetThemeId(), installIconTheme.GetDisplayName());
582 m_xMoreIcons->set_from_icon_name(
"cmd/sc_additionsdialog.png");
594 m_xGraphicsTestDialog.
run();
600 "AdditionsTag", OUString(
"Icons")) };
606 bool bAAEnabled = m_xFontAntiAliasing->get_active();
608 m_xAAPointLimitLabel->set_sensitive(bAAEnabled);
609 m_xAAPointLimit->set_sensitive(bAAEnabled);
627 #if HAVE_FEATURE_SKIA
628 bool skiaHidden =
true;
652 m_xUseSkia->set_sensitive(!officecfg::Office::Common::VCL::UseSkia::isReadOnly());
665 return std::make_unique<OfaViewTabPage>(pPage, pController, *rAttrSet);
670 bool bModified =
false;
671 bool bMenuOptModified =
false;
672 bool bRepaintWindows(
false);
676 const sal_Int32 nSizeLB_NewSelection =
m_xIconSizeLB->get_active();
681 switch( nSizeLB_NewSelection )
688 OSL_FAIL(
"OfaViewTabPage::FillItemSet(): This state of m_xIconSizeLB should not be possible!" );
698 switch( nSidebarSizeLB_NewSelection )
700 case 0: eSet = ToolBoxButtonSize::DontCare;
break;
701 case 1: eSet = ToolBoxButtonSize::Small;
break;
702 case 2: eSet = ToolBoxButtonSize::Large;
break;
704 OSL_FAIL(
"OfaViewTabPage::FillItemSet(): This state of m_xSidebarIconSizeLB should not be possible!" );
706 officecfg::Office::Common::Misc::SidebarIconSize::set(static_cast<sal_Int16>(eSet), xChanges);
714 switch( nNotebookbarSizeLB_NewSelection )
716 case 0: eSet = ToolBoxButtonSize::DontCare;
break;
717 case 1: eSet = ToolBoxButtonSize::Small;
break;
718 case 2: eSet = ToolBoxButtonSize::Large;
break;
720 OSL_FAIL(
"OfaViewTabPage::FillItemSet(): This state of m_xNotebookbarIconSizeLB should not be possible!" );
722 officecfg::Office::Common::Misc::NotebookbarIconSize::set(static_cast<sal_Int16>(eSet), xChanges);
725 const sal_Int32 nStyleLB_NewSelection =
m_xIconStyleLB->get_active();
732 bool bAppearanceChanged =
false;
737 if(eNewSnap > SnapType::NONE)
738 eNewSnap = SnapType::NONE;
740 if ( eNewSnap != eOldSnap )
743 bAppearanceChanged =
true;
749 if(eNewMiddleMouse > 2)
752 if ( eNewMiddleMouse != static_cast<short>(eOldMiddleMouse) )
754 pAppearanceCfg->SetMiddleMouseButton( static_cast<MouseMiddleButtonAction>(eNewMiddleMouse) );
755 bAppearanceChanged =
true;
761 bAppearanceChanged =
true;
767 bAppearanceChanged =
true;
772 officecfg::Office::Common::Font::View::ShowFontBoxWYSIWYG::set(
m_xFontShowCB->get_active(), xChanges);
778 officecfg::Office::Common::View::Menu::IsSystemIconsInMenus::set(
m_xMenuIconsLB->get_active() == 0, xChanges);
779 officecfg::Office::Common::View::Menu::ShowIconsInMenues::set(
m_xMenuIconsLB->get_active() == 2, xChanges);
781 bMenuOptModified =
true;
782 bAppearanceChanged =
true;
787 officecfg::Office::Common::View::Menu::ShortcutsInContextMenus::set(
793 bMenuOptModified =
true;
794 bAppearanceChanged =
true;
814 bRepaintWindows =
true;
818 if (
m_xUseSkia->get_state_changed_from_saved() ||
821 officecfg::Office::Common::VCL::UseSkia::set(
m_xUseSkia->get_active(), xChanges);
822 officecfg::Office::Common::VCL::ForceSkiaRaster::set(
m_xForceSkiaRaster->get_active(), xChanges);
828 if( bMenuOptModified )
838 if ( bAppearanceChanged )
855 if (
m_xUseSkia->get_state_changed_from_saved() ||
885 if( eSidebarIconSize == ToolBoxButtonSize::DontCare )
887 else if( eSidebarIconSize == ToolBoxButtonSize::Small )
889 else if( eSidebarIconSize == ToolBoxButtonSize::Large )
894 if( eNotebookbarIconSize == ToolBoxButtonSize::DontCare )
896 else if( eNotebookbarIconSize == ToolBoxButtonSize::Small )
898 else if( eNotebookbarIconSize == ToolBoxButtonSize::Large )
928 m_xFontShowCB->set_active(officecfg::Office::Common::Font::View::ShowFontBoxWYSIWYG::get());
929 bool bSystemMenuIcons = officecfg::Office::Common::View::Menu::IsSystemIconsInMenus::get();
930 bool bMenuIcons = officecfg::Office::Common::View::Menu::ShowIconsInMenues::get();
931 m_xMenuIconsLB->set_active(bSystemMenuIcons ? 0 : (bMenuIcons ? 2 : 1));
934 TriState eContextMenuShortcuts =
static_cast<TriState>(officecfg::Office::Common::View::Menu::ShortcutsInContextMenus::get());
956 m_xUseSkia->set_active(officecfg::Office::Common::VCL::UseSkia::get());
957 m_xForceSkiaRaster->set_active(officecfg::Office::Common::VCL::ForceSkiaRaster::get());
982 #if HAVE_FEATURE_SKIA
997 constexpr OUStringLiteral
sAccessSrvc =
u"com.sun.star.configuration.ConfigurationAccess";
998 constexpr OUStringLiteral
sAccessUpdSrvc =
u"com.sun.star.configuration.ConfigurationUpdateAccess";
1007 sal_Int32 nPatterns = aDateAcceptancePatterns.getLength();
1008 OUStringBuffer
aBuf( nPatterns * 6 );
1009 SAL_WARN_IF( !nPatterns,
"cui.options",
"No date acceptance pattern");
1012 const OUString* pPatterns = aDateAcceptancePatterns.getConstArray();
1013 aBuf.append( pPatterns[0]);
1014 for (sal_Int32
i=1;
i < nPatterns; ++
i)
1015 aBuf.append(
';').append( pPatterns[
i]);
1017 return aBuf.makeStringAndClear();
1023 LanguageTag GetInstalledLocaleForSystemUILanguage()
1025 css::uno::Sequence<OUString> inst(officecfg::Setup::Office::InstalledLocales::get()->getElementNames());
1031 :
SfxTabPage(pPage, pController,
"cui/ui/optlanguagespage.ui",
"OptLanguagesPage", &rSet)
1033 , m_bDatePatternsValid(
false)
1034 , m_xUserInterfaceLB(m_xBuilder->weld_combo_box(
"userinterface"))
1035 , m_xLocaleSettingFT(m_xBuilder->weld_label(
"localesettingFT"))
1036 , m_xLocaleSettingLB(new
SvxLanguageBox(m_xBuilder->weld_combo_box(
"localesetting")))
1037 , m_xDecimalSeparatorCB(m_xBuilder->weld_check_button(
"decimalseparator"))
1038 , m_xCurrencyFT(m_xBuilder->weld_label(
"defaultcurrency"))
1039 , m_xCurrencyLB(m_xBuilder->weld_combo_box(
"currencylb"))
1040 , m_xDatePatternsFT(m_xBuilder->weld_label(
"dataaccpatterns"))
1041 , m_xDatePatternsED(m_xBuilder->weld_entry(
"datepatterns"))
1042 , m_xWesternLanguageLB(new
SvxLanguageBox(m_xBuilder->weld_combo_box(
"westernlanguage")))
1043 , m_xWesternLanguageFT(m_xBuilder->weld_label(
"western"))
1044 , m_xAsianLanguageLB(new
SvxLanguageBox(m_xBuilder->weld_combo_box(
"asianlanguage")))
1045 , m_xComplexLanguageLB(new
SvxLanguageBox(m_xBuilder->weld_combo_box(
"complexlanguage")))
1046 , m_xCurrentDocCB(m_xBuilder->weld_check_button(
"currentdoc"))
1047 , m_xAsianSupportCB(m_xBuilder->weld_check_button(
"asiansupport"))
1048 , m_xCTLSupportCB(m_xBuilder->weld_check_button(
"ctlsupport"))
1049 , m_xIgnoreLanguageChangeCB(m_xBuilder->weld_check_button(
"ignorelanguagechange"))
1065 Reference< XMultiServiceFactory > theConfigProvider(
1066 css::configuration::theDefaultProvider::get(
1069 Sequence< Any > theArgs{
Any(NamedValue(
"nodepath",
Any(OUString(sInstalledLocalesPath)))) };
1071 theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs ), UNO_QUERY_THROW );
1072 seqInstalledLanguages = theNameAccess->getElementNames();
1074 std::vector< std::pair<sal_Int32, OUString> > aUILanguages;
1075 for (sal_Int32
i=0;
i<seqInstalledLanguages.getLength();
i++)
1080 OUString aLangStr( SvtLanguageTable::GetLanguageString( aLang ) );
1081 aUILanguages.emplace_back(i+1, aLangStr);
1085 std::sort(aUILanguages.begin(), aUILanguages.end(), [](
const auto& l1,
const auto& l2) {
1089 return aSorter.compare(l1.second, l2.second) < 0;
1093 for (
const auto & [ nGroupID, sGroupName ] : aUILanguages)
1101 Sequence< Any > theArgs2{
Any(NamedValue(
"nodepath",
Any(OUString(sUserLocalePath)))) };
1103 theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs2 ), UNO_QUERY_THROW );
1104 if (theNameAccess->hasByName(sUserLocaleKey))
1112 if ( d > 0 && seqInstalledLanguages.getLength() > d-1 && seqInstalledLanguages[d-1] ==
m_sUserLocaleValue)
1126 SvxLanguageListFlags::WESTERN | SvxLanguageListFlags::ONLY_KNOWN,
true,
false,
true,
true,
1130 SvxLanguageListFlags::CJK | SvxLanguageListFlags::ONLY_KNOWN,
true,
false,
true,
true,
1134 SvxLanguageListFlags::CTL | SvxLanguageListFlags::ONLY_KNOWN,
true,
false,
true,
true,
1138 SvxLanguageListFlags::ALL | SvxLanguageListFlags::ONLY_KNOWN,
false,
false,
false,
true,
1150 OUString aTwoSpace(
" " );
1151 sal_uInt16 nCurrCount = rCurrTab.
size();
1152 std::vector< const NfCurrencyEntry* > aCurrencies;
1154 for ( sal_uInt16 j=1; j < nCurrCount; ++j )
1156 aCurrencies.push_back(&rCurrTab[j]);
1158 std::sort(aCurrencies.begin(), aCurrencies.end(),
1159 [](
const NfCurrencyEntry* c1,
const NfCurrencyEntry* c2) {
1160 return c1->GetBankSymbol().compareTo(c2->GetBankSymbol()) < 0;
1163 for (
auto &
v : aCurrencies)
1165 OUString aStr_ =
v->GetBankSymbol() +
1206 return std::make_unique<OfaLanguagesTabPage>(pPage, pController, *rAttrSet);
1209 static void lcl_Update(std::unique_ptr<SfxVoidItem> pInvalidItems[], std::unique_ptr<SfxBoolItem> pBoolItems[], sal_uInt16 nCount)
1216 for(sal_uInt16
i = 0;
i < nCount;
i++)
1218 if(pCurrentFrm == pViewFrm)
1230 pLangConfig->aSysLocaleOptions.BlockBroadcasts(
true );
1231 pLangConfig->aCTLLanguageOptions.BlockBroadcasts(
true );
1232 pLangConfig->aLinguConfig.BlockBroadcasts(
true );
1250 pLangConfig->aCTLLanguageOptions.SetCTLSequenceCheckingRestricted(bOn);
1251 pLangConfig->aCTLLanguageOptions.SetCTLSequenceChecking(bOn);
1252 pLangConfig->aCTLLanguageOptions.SetCTLSequenceCheckingTypeAndReplace(bOn);
1258 OUString aLangString;
1260 if( d > 0 && seqInstalledLanguages.getLength() > d-1)
1261 aLangString = seqInstalledLanguages[d-1];
1267 Reference< XMultiServiceFactory > theConfigProvider(
1268 css::configuration::theDefaultProvider::get(
1270 Sequence< Any > theArgs{
Any(NamedValue(
"nodepath",
Any(OUString(sUserLocalePath)))) };
1272 theConfigProvider->createInstanceWithArguments(sAccessUpdSrvc, theArgs ), UNO_QUERY_THROW );
1277 xProp->setPropertyValue(sUserLocaleKey,
Any(aLangString));
1278 Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges();
1290 css::office::Quickstart::createAndSetVeto(xContext,
false,
false,
false);
1302 aLanguageTag.makeFallback().getLanguageType());
1311 if ( eOldLocale != eNewLocale )
1321 pLangConfig->aSysLocaleOptions.SetLocaleConfigString( sNewLang );
1325 bool bNewCJK = bool( nNewType & SvtScriptType::ASIAN );
1337 OUString sOldCurr =
pLangConfig->aSysLocaleOptions.GetCurrencyConfigString();
1339 const NfCurrencyEntry* pCurr = sId ==
"default" ?
nullptr : weld::fromId<const NfCurrencyEntry*>(sId);
1343 pCurr->GetBankSymbol(), pCurr->GetLanguage() );
1344 if ( sOldCurr != sNewCurr )
1345 pLangConfig->aSysLocaleOptions.SetCurrencyConfigString( sNewCurr );
1356 bLanguageCurrentDoc_Impl = bCurrentDocCBChecked;
1357 bool bCurrentDocCBChanged =
m_xCurrentDocCB->get_state_changed_from_saved();
1360 if( (bCurrentDocCBChanged && !bCurrentDocCBChecked) || bValChanged)
1363 if(!bCurrentDocCBChecked)
1368 pLangConfig->aLinguConfig.SetProperty(
u"DefaultLocale", aValue );
1369 if (xLinguProp.is())
1370 xLinguProp->setDefaultLocale( aLocale );
1372 if(pCurrentDocShell)
1375 SID_ATTR_LANGUAGE));
1379 if( (bCurrentDocCBChanged && !bCurrentDocCBChecked) || bValChanged)
1382 if(!bCurrentDocCBChecked)
1387 pLangConfig->aLinguConfig.SetProperty(
u"DefaultLocale_CJK", aValue );
1388 if (xLinguProp.is())
1389 xLinguProp->setDefaultLocale_CJK( aLocale );
1391 if(pCurrentDocShell)
1394 SID_ATTR_CHAR_CJK_LANGUAGE));
1398 if( (bCurrentDocCBChanged && !bCurrentDocCBChecked) || bValChanged)
1401 if(!bCurrentDocCBChecked)
1406 pLangConfig->aLinguConfig.SetProperty(
u"DefaultLocale_CTL", aValue );
1407 if (xLinguProp.is())
1408 xLinguProp->setDefaultLocale_CTL( aLocale );
1410 if(pCurrentDocShell)
1413 SID_ATTR_CHAR_CTL_LANGUAGE));
1423 const sal_uInt16 STATE_COUNT = 2;
1425 std::unique_ptr<SfxBoolItem> pBoolItems[STATE_COUNT];
1426 pBoolItems[0].reset(
new SfxBoolItem(SID_VERTICALTEXT_STATE,
false));
1427 pBoolItems[1].reset(
new SfxBoolItem(SID_TEXT_FITTOSIZE_VERTICAL,
false));
1429 std::unique_ptr<SfxVoidItem> pInvalidItems[STATE_COUNT];
1430 pInvalidItems[0].reset(
new SfxVoidItem(SID_VERTICALTEXT_STATE));
1431 pInvalidItems[1].reset(
new SfxVoidItem(SID_TEXT_FITTOSIZE_VERTICAL));
1433 lcl_Update(pInvalidItems, pBoolItems, STATE_COUNT);
1444 const sal_uInt16 STATE_COUNT = 1;
1445 std::unique_ptr<SfxBoolItem> pBoolItems[STATE_COUNT];
1446 pBoolItems[0].reset(
new SfxBoolItem(SID_CTLFONT_STATE,
false));
1447 std::unique_ptr<SfxVoidItem> pInvalidItems[STATE_COUNT];
1448 pInvalidItems[0].reset(
new SfxVoidItem(SID_CTLFONT_STATE));
1449 lcl_Update(pInvalidItems, pBoolItems, STATE_COUNT);
1452 if (
pLangConfig->aSysLocaleOptions.IsModified() )
1458 pLangConfig->aSysLocaleOptions.BlockBroadcasts(
false );
1459 pLangConfig->aCTLLanguageOptions.BlockBroadcasts(
false );
1460 pLangConfig->aLinguConfig.BlockBroadcasts(
false );
1468 if ( aLanguageTag.isSystemLocale() )
1489 const NfCurrencyEntry* pCurr =
nullptr;
1490 OUString sCurrency =
pLangConfig->aSysLocaleOptions.GetCurrencyConfigString();
1491 if ( !sCurrency.isEmpty() )
1499 OUString
sId = !pCurr ? OUString(
"default") :
weld::toId(pCurr);
1506 OUString aDatePatternsString =
pLangConfig->aSysLocaleOptions.GetDatePatternsConfigString();
1507 if (aDatePatternsString.isEmpty())
1533 aWestLang =
pLangConfig->aLinguConfig.GetProperty(
u"DefaultLocale");
1535 aWestLang >>= aLocale;
1539 aCJKLang =
pLangConfig->aLinguConfig.GetProperty(
u"DefaultLocale_CJK");
1541 aCJKLang >>= aLocale;
1544 aCTLLang =
pLangConfig->aLinguConfig.GetProperty(
u"DefaultLocale_CTL");
1546 aCTLLang >>= aLocale;
1553 if(pCurrentDocShell)
1561 eCurLang = eTempCurLang;
1568 eCurLangCJK = eTempCurLang;
1575 eCurLangCTL = eTempCurLang;
1599 bool bEnable = !
pLangConfig->aLinguConfig.IsReadOnly(
u"DefaultLocale" );
1616 bool bCheck = rBox.get_active();
1617 if ( m_xAsianSupportCB.get() == &rBox )
1619 bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly(
u"DefaultLocale_CJK");
1620 bCheck = ( bCheck && !bReadonly );
1621 m_xAsianLanguageLB->set_sensitive( bCheck );
1622 if (rBox.get_sensitive())
1623 m_bOldAsian = bCheck;
1625 else if ( m_xCTLSupportCB.get() == &rBox )
1627 bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly(
u"DefaultLocale_CTL");
1628 bCheck = ( bCheck && !bReadonly );
1629 m_xComplexLanguageLB->set_sensitive( bCheck );
1630 if (rBox.get_sensitive())
1634 SAL_WARN(
"cui.options",
"OfaLanguagesTabPage::SupportHdl(): wrong rBox" );
1639 void lcl_checkLanguageCheckBox(
weld::CheckButton& _rCB,
bool _bNewValue,
bool _bOldValue)
1653 LanguageType eLang = m_xLocaleSettingLB->get_active_id();
1659 bool bIsCTLFixed = bool(nType & SvtScriptType::COMPLEX);
1660 lcl_checkLanguageCheckBox(*m_xCTLSupportCB, bIsCTLFixed, m_bOldCtl);
1661 SupportHdl(*m_xCTLSupportCB);
1667 bool bIsCJKFixed = bool(nType & SvtScriptType::ASIAN);
1668 lcl_checkLanguageCheckBox(*m_xAsianSupportCB, bIsCJKFixed, m_bOldAsian);
1669 SupportHdl(*m_xAsianSupportCB);
1674 const OUString aDefaultID =
"default";
1676 m_xCurrencyLB->remove_id(aDefaultID);
1677 OUString aDefaultCurr = m_sSystemDefaultString +
" - " + rCurr.GetBankSymbol();
1678 m_xCurrencyLB->insert(0, aDefaultCurr, &aDefaultID,
nullptr,
nullptr);
1679 assert(m_xCurrencyLB->find_id(aDefaultID) != -1);
1680 m_xCurrencyLB->set_active_text(aDefaultCurr);
1687 OUString sTempLabel(m_sDecimalSeparatorLabel);
1688 sTempLabel = sTempLabel.replaceFirst(
"%1", aLocaleWrapper.
getNumDecimalSep() );
1689 m_xDecimalSeparatorCB->set_label(sTempLabel);
1693 m_bDatePatternsValid =
true;
1694 m_xDatePatternsED->set_text( aDatePatternsString);
1699 const OUString aPatterns(rEd.get_text());
1700 OUStringBuffer
aBuf( aPatterns);
1701 sal_Int32 nChar = 0;
1703 bool bModified =
false;
1704 if (!aPatterns.isEmpty())
1706 for (sal_Int32
nIndex=0;
nIndex >= 0 && bValid; ++nChar)
1708 const OUString aPat( aPatterns.getToken( 0,
';',
nIndex));
1709 if (aPat.isEmpty() &&
nIndex < 0)
1716 else if (aPat.getLength() < 2)
1721 bY = bM = bD =
false;
1723 for (sal_Int32
i = 0;
i < aPat.getLength() && bValid; )
1725 const sal_Int32 j =
i;
1726 const sal_uInt32 c = aPat.iterateCodePoints( &
i);
1769 if (!(bY || bM || bD))
1776 bValid &= (bY || bM || bD);
1784 const int nCursorPos = rEd.get_position();
1785 rEd.set_text(aBuf.makeStringAndClear());
1786 rEd.set_position(nCursorPos);
1792 m_bDatePatternsValid = bValid;
constexpr OUStringLiteral sAccessUpdSrvc
#define LINK(Instance, Class, Member)
std::unique_ptr< SvxLanguageBox > m_xComplexLanguageLB
virtual short run() override
OfaMiscTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
IMPL_STATIC_LINK_NOARG(OfaViewTabPage, OnMoreIconsClick, weld::Button &, void)
std::unique_ptr< weld::ComboBox > m_xIconStyleLB
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
IMPL_LINK(OfaLanguagesTabPage, SupportHdl, weld::Toggleable &, rBox, void)
SvtSysLocaleOptions aSysLocaleOptions
std::unique_ptr< weld::Widget > m_xFileDlgROImage
void SetState(const SfxItemSet &rSet)
static bool bLanguageCurrentDoc_Impl
static std::shared_ptr< ConfigurationChanges > create()
static OUString CreateCurrencyConfigString(const OUString &rAbbrev, LanguageType eLang)
void SetStyleSettings(const StyleSettings &rSet)
std::unique_ptr< weld::SpinButton > m_xYearValueField
std::unique_ptr< weld::ComboBox > m_xIconSizeLB
constexpr OUStringLiteral sInstalledLocalesPath
std::unique_ptr< weld::ComboBox > m_xMenuIconsLB
static LanguageType convertToLanguageType(const css::lang::Locale &rLocale, bool bResolveSystem=true)
std::unique_ptr< weld::Widget > m_xQuickStarterFrame
static OUString convertToBcp47(LanguageType nLangID)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
std::unique_ptr< SvxLanguageBox > m_xLocaleSettingLB
const StyleSettings & GetStyleSettings() const
std::unique_ptr< weld::ComboBox > m_xNotebookbarIconSizeLB
static const AllSettings & GetSettings()
std::vector< vcl::IconThemeInfo > const & GetInstalledIconThemes() const
ServiceVector maAvailableImplementations
constexpr OUStringLiteral sUserLocalePath
sal_uInt16 GetValue() const
bool m_bDatePatternsValid
static LanguageType resolveSystemLanguageByScriptType(LanguageType nLang, sal_Int16 nType)
std::unique_ptr< weld::ComboBox > m_xSidebarIconSizeLB
static OUString lcl_getDatePatternsConfigString(const LocaleDataWrapper &rLocaleWrapper)
sal_Int32 nStyleLB_InitialSelection
sal_Int16 GetSymbolsSize() const
std::unique_ptr< weld::CheckButton > m_xExtHelpCB
SvtLinguConfig aLinguConfig
static SfxObjectShell * Current()
void GetCurrencyAbbrevAndLanguage(OUString &rAbbrev, LanguageType &eLang) const
virtual ~OfaLanguagesTabPage() override
static void lcl_Update(std::unique_ptr< SfxVoidItem > pInvalidItems[], std::unique_ptr< SfxBoolItem > pBoolItems[], sal_uInt16 nCount)
std::unique_ptr< weld::CheckButton > m_xFileDlgCB
std::unique_ptr< weld::MetricSpinButton > m_xAAPointLimit
bool IsHardwareAccelerationEnabled() const
std::unique_ptr< weld::CheckButton > m_xFontAntiAliasing
void SetAntiAliasing(bool bOn, bool bTemporary)
static css::uno::Reference< css::linguistic2::XLinguProperties > GetLinguPropertySet()
std::unique_ptr< weld::Label > m_xCurrencyFT
OUString GetIconTheme() const
Reference< XNameAccess > m_xContainer
std::vector< std::pair< OUString, Sequence< OUString > > > ServiceVector
static LanguageType convertToLanguageTypeWithFallback(const OUString &rBcp47)
std::unique_ptr< weld::Label > m_xHelpImproveLabel
std::unique_ptr< weld::Label > m_xLocaleSettingFT
std::unique_ptr< weld::CheckButton > m_xIgnoreLanguageChangeCB
std::unique_ptr< weld::ComboBox > m_xMousePosLB
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)
void SetExchangeSupport()
LanguageTag & makeFallback()
constexpr OUStringLiteral sUserLocaleKey
bool IsHardwareAccelerationRO() const
SvtCTLOptions aCTLLanguageOptions
OUString GetAutomaticallyChosenIconTheme() const
void EnabledHardwareAcceleration(bool _bEnabled) const
OfaViewTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
void SetIgnoreKashida_CTL(bool bVal)
std::unique_ptr< weld::Widget > m_xYearFrame
bool IsHardwareAccelerationAvailable() const
virtual tools::Long GetValue() const override
std::unique_ptr< weld::Label > m_xSkiaStatusDisabled
static vcl::Window * GetFirstTopLevelWindow()
std::unique_ptr< weld::Button > m_xMoreIcons
const SfxPoolItem * GetOldItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
const OUString & getNumDecimalSep() const
std::unique_ptr< weld::CheckButton > m_xCurrentDocCB
std::unique_ptr< weld::ComboBox > m_xCurrencyLB
VCL_DLLPUBLIC void LaunchRegistrationUI()
void SetSymbolsSize(sal_Int16 eSet)
#define TOOLS_WARN_EXCEPTION(area, stream)
std::unique_ptr< weld::CheckButton > m_xForceSkiaRaster
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const css::uno::Sequence< OUString > & getDateAcceptancePatterns() const
std::unique_ptr< weld::Label > m_xWesternLanguageFT
css::uno::Sequence< css::uno::Any > InitAnyPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
std::unique_ptr< weld::Label > m_xToYearFT
static void SetSettings(const AllSettings &rSettings)
std::unique_ptr< weld::CheckButton > m_xQuickLaunchCB
std::unique_ptr< weld::ComboBox > m_xMouseMiddleLB
std::unique_ptr< weld::CheckButton > m_xCrashReport
SfxBindings & GetBindings()
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
static const vcl::IconThemeInfo & FindIconThemeById(const std::vector< vcl::IconThemeInfo > &themes, const OUString &themeId)
virtual void set_active(bool active)=0
static SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
std::unique_ptr< SvxLanguageBox > m_xAsianLanguageLB
static OUString GetToolkitName()
OUString ApplyLreOrRleEmbedding(const OUString &rText)
Reference< XNameAccess > mxForceFlagNameAccess
SvtScriptType GetScriptTypeOfLanguage(LanguageType nLang)
#define LANGUAGE_DONTKNOW
const LocaleDataWrapper & GetLocaleDataWrapper(LanguageType nLang)
std::unique_ptr< weld::ComboBox > m_xContextMenuShortcutsLB
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
void UpdateHardwareAccelStatus()
static Sequence< OUString > seqInstalledLanguages
std::unique_ptr< weld::Label > m_xDatePatternsFT
IMPL_LINK_NOARG(OfaMiscTabPage, TwoFigureHdl, weld::SpinButton &, void)
bool IsAAPossibleOnThisSystem()
std::unique_ptr< SvtTabAppearanceCfg > pAppearanceCfg
static bool DisplayNameCompareLessThan(const vcl::IconThemeInfo &rInfo1, const vcl::IconThemeInfo &rInfo2)
constexpr OUStringLiteral sAccessSrvc
static void MergeSystemSettings(AllSettings &rSettings)
const LanguageTag & getLocale()
std::unique_ptr< weld::CheckButton > m_xUseHardwareAccell
bool IsReadOnly(EOption eOption)
OUString m_sSystemDefaultString
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
OUString toId(const void *pValue)
std::unique_ptr< weld::Label > m_xSkiaStatusEnabled
virtual bool FillItemSet(SfxItemSet *rSet) override
Reference< XMultiServiceFactory > getProcessServiceFactory()
weld::Window * GetFrameWeld() const
#define LANGUAGE_USER_SYSTEM_CONFIG
static SfxViewFrame * Current()
VCL_DLLPUBLIC bool isVCLSkiaEnabled()
sal_Int32 nNotebookbarSizeLB_InitialSelection
std::unique_ptr< weld::CheckButton > m_xUseAntiAliase
static vcl::Window * GetNextTopLevelWindow(vcl::Window const *pWindow)
OUString m_sDecimalSeparatorLabel
OUString getInstalledLocaleForSystemUILanguage(const css::uno::Sequence< OUString > &rLocaleElementNames, bool bRequestInstallIfMissing, const OUString &rPreferredLocale)
std::unique_ptr< weld::Button > m_xRunGPTests
#define SAL_WARN_IF(condition, area, stream)
std::unique_ptr< CanvasSettings > pCanvasSettings
void SetIgnoreDiacritics_CTL(bool bVal)
std::unique_ptr< weld::CheckButton > m_xDocStatusCB
virtual bool FillItemSet(SfxItemSet *rSet) override
static LanguageType getConfiguredSystemLanguage()
if(aStr!=aBuf) UpdateName_Impl(m_xFollowLb.get()
OfaLanguagesTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
virtual void Reset(const SfxItemSet *rSet) override
Reference< XComponentContext > getProcessComponentContext()
std::unique_ptr< LanguageConfig_Impl > pLangConfig
SfxOkDialogController * GetDialogController() const
std::unique_ptr< weld::Widget > m_xFileDlgFrame
std::unique_ptr< weld::ComboBox > m_xUserInterfaceLB
std::unique_ptr< weld::CheckButton > m_xDecimalSeparatorCB
void SetIconTheme(const OUString &)
virtual bool FillItemSet(SfxItemSet *rSet) override
std::unique_ptr< weld::Entry > m_xDatePatternsED
std::unique_ptr< weld::CheckButton > m_xPopUpNoHelpCB
static OUString GetLanguageString(const LanguageType eType)
virtual ~OfaMiscTabPage() override
std::unique_ptr< weld::Widget > m_xMenuIconBox
static SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
void InvalidateAll(bool bWithMsg)
#define SAL_WARN(area, stream)
Reference< XSingleServiceFactory > xFactory
void SetDefault(SvtCompatibilityEntry::Index rIdx, bool rValue)
static bool needsSequenceChecking(LanguageType nLang)
const OUString & GetDisplayName() const
sal_Int32 nSizeLB_InitialSelection
virtual ~OfaViewTabPage() override
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
std::unique_ptr< SvxLanguageBox > m_xWesternLanguageLB
std::unique_ptr< weld::CheckButton > m_xShowTipOfTheDay
sal_Int32 nSidebarSizeLB_InitialSelection
virtual void Reset(const SfxItemSet *rSet) override
virtual void Reset(const SfxItemSet *rSet) override
bool IconThemeWasSetAutomatically() const
std::vector< vcl::IconThemeInfo > mInstalledIconThemes
std::unique_ptr< weld::CheckButton > m_xUseSkia
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
std::unique_ptr< weld::CheckButton > m_xFontShowCB
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
bool m_bDetectedRangeSegmentation false
std::unique_ptr< weld::CheckButton > m_xAsianSupportCB
std::unique_ptr< weld::CheckButton > m_xCTLSupportCB
OUString m_sUserLocaleValue
static bool hasNativeFileSelection()