20 #include <config_features.h>
21 #include <config_vclplug.h>
45 #include <rtl/ustrbuf.hxx>
46 #include <editeng/editids.hrc>
47 #include <svx/svxids.hrc>
52 #include <officecfg/Office/Common.hxx>
53 #include <officecfg/Setup.hxx>
56 #if HAVE_FEATURE_BREAKPAD
60 #include <com/sun/star/configuration/theDefaultProvider.hpp>
61 #include <com/sun/star/container/XNameAccess.hpp>
62 #include <com/sun/star/container/XNameReplace.hpp>
63 #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
64 #include <com/sun/star/beans/NamedValue.hpp>
65 #include <com/sun/star/beans/PropertyAttribute.hpp>
66 #include <com/sun/star/beans/XPropertySet.hpp>
67 #include <com/sun/star/util/XChangesBatch.hpp>
68 #include <com/sun/star/uno/Any.hxx>
69 #include <com/sun/star/container/XContentEnumerationAccess.hpp>
70 #include <com/sun/star/container/XSet.hpp>
71 #include <com/sun/star/i18n/ScriptType.hpp>
72 #include <com/sun/star/office/Quickstart.hpp>
73 #include <com/sun/star/linguistic2/XLinguProperties.hpp>
99 using namespace ::
utl;
107 return DeactivateRC::LeavePage;
112 OUString impl_SystemFileOpenServiceName()
115 return "com.sun.star.ui.dialogs.SystemFilePicker";
117 return "com.sun.star.ui.dialogs.AquaFilePicker";
123 bool lcl_HasSystemFilePicker()
132 Reference< XContentEnumerationAccess > xEnumAccess( xFactory, UNO_QUERY );
133 Reference< XSet > xSet( xFactory, UNO_QUERY );
135 if ( ! xEnumAccess.is() || ! xSet.is() )
140 OUString aFileService = impl_SystemFileOpenServiceName();
141 Reference< XEnumeration > xEnum = xEnumAccess->createContentEnumeration( aFileService );
142 if ( xEnum.is() && xEnum->hasMoreElements() )
145 catch (
const IllegalArgumentException&)
148 catch (
const ElementExistException&)
156 :
SfxTabPage(pPage, pController,
"cui/ui/optgeneralpage.ui",
"OptGeneralPage", &rSet)
157 , m_xExtHelpCB(m_xBuilder->weld_check_button(
"exthelp"))
158 , m_xPopUpNoHelpCB(m_xBuilder->weld_check_button(
"popupnohelp"))
159 , m_xShowTipOfTheDay(m_xBuilder->weld_check_button(
"cbShowTipOfTheDay"))
160 , m_xFileDlgFrame(m_xBuilder->weld_widget(
"filedlgframe"))
161 , m_xPrintDlgFrame(m_xBuilder->weld_widget(
"printdlgframe"))
162 , m_xFileDlgROImage(m_xBuilder->weld_widget(
"lockimage"))
163 , m_xFileDlgCB(m_xBuilder->weld_check_button(
"filedlg"))
164 , m_xPrintDlgCB(m_xBuilder->weld_check_button(
"printdlg"))
165 , m_xDocStatusCB(m_xBuilder->weld_check_button(
"docstatus"))
166 , m_xYearFrame(m_xBuilder->weld_widget(
"yearframe"))
167 , m_xYearValueField(m_xBuilder->weld_spin_button(
"year"))
168 , m_xToYearFT(m_xBuilder->weld_label(
"toyear"))
169 , m_xCollectUsageInfo(m_xBuilder->weld_check_button(
"collectusageinfo"))
170 , m_xCrashReport(m_xBuilder->weld_check_button(
"crashreport"))
171 , m_xQuickStarterFrame(m_xBuilder->weld_widget(
"quickstarter"))
173 , m_xQuickLaunchCB(m_xBuilder->weld_check_button(
"systray"))
175 , m_xQuickLaunchCB(m_xBuilder->weld_check_button(
"quicklaunch"))
178 , m_xFileAssocFrame(m_xBuilder->weld_widget(
"fileassoc"))
179 , m_xFileAssocBtn(m_xBuilder->weld_button(
"assocfiles"))
182 if (!lcl_HasSystemFilePicker())
184 else if (officecfg::Office::Common::Misc::UseSystemFileDialog::isReadOnly())
193 if (!officecfg::Office::Common::Misc::ExperimentalMode::get())
207 m_xFileAssocFrame->show();
223 return std::make_unique<OfaMiscTabPage>( pPage, pController, *rAttrSet );
228 bool bModified =
false;
240 officecfg::Office::Common::Misc::ShowTipOfTheDay::set(
m_xShowTipOfTheDay->get_active(), batch);
246 std::shared_ptr< comphelper::ConfigurationChanges > xChanges(
248 officecfg::Office::Common::Misc::UseSystemFileDialog::set( !
m_xFileDlgCB->get_active(), xChanges );
255 std::shared_ptr< comphelper::ConfigurationChanges > xChanges(
257 officecfg::Office::Common::Misc::UseSystemPrintDialog::set( !
m_xPrintDlgCB->get_active(), xChanges );
264 officecfg::Office::Common::Print::PrintingModifiesDocument::set(
m_xDocStatusCB->get_active(), batch);
269 sal_uInt16 nNum =
static_cast<sal_uInt16
>(
m_xYearValueField->get_text().toInt32());
270 if ( pUInt16Item && pUInt16Item->
GetValue() != nNum )
278 officecfg::Office::Common::Misc::CollectUsageInformation::set(
m_xCollectUsageInfo->get_active(), batch);
282 #if HAVE_FEATURE_BREAKPAD
285 officecfg::Office::Common::Misc::CrashReport::set(
m_xCrashReport->get_active(), batch);
308 m_xShowTipOfTheDay->set_active( officecfg::Office::Common::Misc::ShowTipOfTheDay::get() );
310 m_xFileDlgCB->set_active( !officecfg::Office::Common::Misc::UseSystemFileDialog::get() );
312 m_xPrintDlgCB->set_active( !officecfg::Office::Common::Misc::UseSystemPrintDialog::get() );
315 m_xDocStatusCB->set_active(officecfg::Office::Common::Print::PrintingModifiesDocument::get());
319 if ( SfxItemState::SET == rSet->
GetItemState( SID_ATTR_YEAR2000,
false, &pItem ) )
327 m_xCollectUsageInfo->set_active(officecfg::Office::Common::Misc::CollectUsageInformation::get());
328 m_xCollectUsageInfo->set_sensitive(!officecfg::Office::Common::Misc::CollectUsageInformation::isReadOnly());
331 #if HAVE_FEATURE_BREAKPAD
332 m_xCrashReport->set_active(officecfg::Office::Common::Misc::CrashReport::get() && CrashReporter::IsDumpEnable());
333 m_xCrashReport->set_sensitive(!officecfg::Office::Common::Misc::CrashReport::isReadOnly() && CrashReporter::IsDumpEnable());
340 if ( SfxItemState::SET == eState )
342 else if ( SfxItemState::DISABLED == eState )
353 OUString aOutput( m_aStrDateInfo );
354 OUString
aStr( m_xYearValueField->get_text() );
355 sal_Int32 nNum =
aStr.toInt32();
356 if (
aStr.getLength() != 4 || nNum < m_xYearValueField->get_min() || nNum > m_xYearValueField->get_max() )
361 aOutput += OUString::number( nNum );
363 m_xToYearFT->set_label( aOutput );
369 const bool bUninit = SUCCEEDED(CoInitializeEx(
nullptr, COINIT_APARTMENTTHREADED));
370 IApplicationAssociationRegistrationUI* pIf =
nullptr;
371 HRESULT res = CoCreateInstance(CLSID_ApplicationAssociationRegistrationUI,
nullptr,
372 CLSCTX_INPROC_SERVER, IID_IApplicationAssociationRegistrationUI,
373 reinterpret_cast<LPVOID*>(&pIf));
375 if (SUCCEEDED(res) && pIf)
382 pIf->LaunchAdvancedAssociationUI(o3tl::toW(expanded.getStr()));
401 typedef std::vector< std::pair<OUString,Sequence<OUString> > >
ServiceVector;
410 mxForceFlagNameAccess(),
411 mbHWAccelAvailable(false),
412 mbHWAccelChecked(false)
416 Reference<XMultiServiceFactory> xConfigProvider(
417 css::configuration::theDefaultProvider::get(
422 {
"nodepath",
Any(OUString(
"/org.openoffice.Office.Canvas"))}
425 xConfigProvider->createInstanceWithArguments(
426 "com.sun.star.configuration.ConfigurationUpdateAccess",
432 {
"nodepath",
Any(OUString(
"/org.openoffice.Office.Canvas/CanvasServiceList"))}
435 xConfigProvider->createInstanceWithArguments(
436 "com.sun.star.configuration.ConfigurationAccess",
437 aArgs2 ), UNO_QUERY_THROW );
439 xNameAccess, UNO_QUERY_THROW);
442 const OUString* pCurr = serviceNames.getConstArray();
443 const OUString*
const pEnd = pCurr + serviceNames.getLength();
444 while( pCurr != pEnd )
447 xHierarchicalNameAccess->getByHierarchicalName(*pCurr),
450 if( xEntryNameAccess.is() )
453 if( xEntryNameAccess->getByName(
"PreferredImplementations") >>= preferredImplementations )
477 const OUString* pCurrImpl = availableImpl.second.getConstArray();
478 const OUString*
const pEndImpl = pCurrImpl + availableImpl.second.getLength();
480 while( pCurrImpl != pEndImpl )
487 bool bHasAccel(
false);
488 if( xPropSet->getPropertyValue(
"HardwareAcceleration") >>= bHasAccel )
509 bool bForceLastEntry(
false);
516 return !bForceLastEntry;
526 Property aProp = xInfo->getPropertyByName(
"ForceSafeServiceImpl");
527 return ((aProp.Attributes & css::beans::PropertyAttribute::READONLY ) == css::beans::PropertyAttribute::READONLY);
532 Reference< XNameReplace > xNameReplace(
535 if( !xNameReplace.is() )
538 xNameReplace->replaceByName(
"ForceSafeServiceImpl",
Any(!_bEnabled) );
540 Reference< XChangesBatch > xChangesBatch(
543 if( !xChangesBatch.is() )
546 xChangesBatch->commitChanges();
557 :
SfxTabPage(pPage, pController,
"cui/ui/optviewpage.ui",
"OptViewPage", &rSet)
558 , nSizeLB_InitialSelection(0)
559 , nSidebarSizeLB_InitialSelection(0)
560 , nNotebookbarSizeLB_InitialSelection(0)
561 , nStyleLB_InitialSelection(0)
565 , m_xIconSizeLB(m_xBuilder->weld_combo_box(
"iconsize"))
566 , m_xSidebarIconSizeLB(m_xBuilder->weld_combo_box(
"sidebariconsize"))
567 , m_xNotebookbarIconSizeLB(m_xBuilder->weld_combo_box(
"notebookbariconsize"))
568 , m_xIconStyleLB(m_xBuilder->weld_combo_box(
"iconstyle"))
569 , m_xFontAntiAliasing(m_xBuilder->weld_check_button(
"aafont"))
570 , m_xAAPointLimitLabel(m_xBuilder->weld_label(
"aafrom"))
571 , m_xAAPointLimit(m_xBuilder->weld_metric_spin_button(
"aanf",
FieldUnit::
PIXEL))
572 , m_xMenuIconBox(m_xBuilder->weld_widget(
"menuiconsbox"))
573 , m_xMenuIconsLB(m_xBuilder->weld_combo_box(
"menuicons"))
574 , m_xContextMenuShortcutsLB(m_xBuilder->weld_combo_box(
"contextmenushortcuts"))
575 , m_xFontShowCB(m_xBuilder->weld_check_button(
"showfontpreview"))
576 , m_xUseHardwareAccell(m_xBuilder->weld_check_button(
"useaccel"))
577 , m_xUseAntiAliase(m_xBuilder->weld_check_button(
"useaa"))
578 , m_xUseSkia(m_xBuilder->weld_check_button(
"useskia"))
579 , m_xForceSkiaRaster(m_xBuilder->weld_check_button(
"forceskiaraster"))
580 , m_xSkiaStatusEnabled(m_xBuilder->weld_label(
"skiaenabled"))
581 , m_xSkiaStatusDisabled(m_xBuilder->weld_label(
"skiadisabled"))
582 , m_xMousePosLB(m_xBuilder->weld_combo_box(
"mousepos"))
583 , m_xMouseMiddleLB(m_xBuilder->weld_combo_box(
"mousemiddle"))
584 , m_xMoreIcons(m_xBuilder->weld_button(
"btnMoreIcons"))
604 OUString entryForAuto = sAutoStr +
" (" +
613 m_xIconStyleLB->append(installIconTheme.GetThemeId(), installIconTheme.GetDisplayName());
617 m_xMoreIcons->set_from_icon_name(
"cmd/sc_additionsdialog.png");
627 css::uno::Sequence<css::beans::PropertyValue> aArgs(1);
628 aArgs[0].Name =
"AdditionsTag";
629 aArgs[0].Value <<= OUString(
"Icons");
635 bool bAAEnabled = m_xFontAntiAliasing->get_active();
637 m_xAAPointLimitLabel->set_sensitive(bAAEnabled);
638 m_xAAPointLimit->set_sensitive(bAAEnabled);
656 #if HAVE_FEATURE_SKIA
657 bool skiaHidden =
true;
678 m_xUseSkia->set_sensitive(!officecfg::Office::Common::VCL::UseSkia::isReadOnly());
691 return std::make_unique<OfaViewTabPage>(pPage, pController, *rAttrSet);
698 bool bModified =
false;
699 bool bMenuOptModified =
false;
700 bool bRepaintWindows(
false);
703 const sal_Int32 nSizeLB_NewSelection =
m_xIconSizeLB->get_active();
708 switch( nSizeLB_NewSelection )
715 OSL_FAIL(
"OfaViewTabPage::FillItemSet(): This state of m_xIconSizeLB should not be possible!" );
725 switch( nSidebarSizeLB_NewSelection )
727 case 0: eSet = ToolBoxButtonSize::DontCare;
break;
728 case 1: eSet = ToolBoxButtonSize::Small;
break;
729 case 2: eSet = ToolBoxButtonSize::Large;
break;
731 OSL_FAIL(
"OfaViewTabPage::FillItemSet(): This state of m_xSidebarIconSizeLB should not be possible!" );
741 switch( nNotebookbarSizeLB_NewSelection )
743 case 0: eSet = ToolBoxButtonSize::DontCare;
break;
744 case 1: eSet = ToolBoxButtonSize::Small;
break;
745 case 2: eSet = ToolBoxButtonSize::Large;
break;
747 OSL_FAIL(
"OfaViewTabPage::FillItemSet(): This state of m_xNotebookbarIconSizeLB should not be possible!" );
752 const sal_Int32 nStyleLB_NewSelection =
m_xIconStyleLB->get_active();
759 bool bAppearanceChanged =
false;
764 if(eNewSnap > SnapType::NONE)
765 eNewSnap = SnapType::NONE;
767 if ( eNewSnap != eOldSnap )
770 bAppearanceChanged =
true;
776 if(eNewMiddleMouse > 2)
779 if ( eNewMiddleMouse != static_cast<short>(eOldMiddleMouse) )
781 pAppearanceCfg->SetMiddleMouseButton( static_cast<MouseMiddleButtonAction>(eNewMiddleMouse) );
782 bAppearanceChanged =
true;
788 bAppearanceChanged =
true;
794 bAppearanceChanged =
true;
800 officecfg::Office::Common::Font::View::ShowFontBoxWYSIWYG::set(
m_xFontShowCB->get_active(), batch);
811 bMenuOptModified =
true;
812 bAppearanceChanged =
true;
821 bMenuOptModified =
true;
822 bAppearanceChanged =
true;
842 bRepaintWindows =
true;
846 if (
m_xUseSkia->get_state_changed_from_saved() ||
850 officecfg::Office::Common::VCL::UseSkia::set(
m_xUseSkia->get_active(), batch);
851 officecfg::Office::Common::VCL::ForceSkiaRaster::set(
m_xForceSkiaRaster->get_active(), batch);
856 if( bMenuOptModified )
866 if ( bAppearanceChanged )
883 if (
m_xUseSkia->get_state_changed_from_saved() ||
954 m_xFontShowCB->set_active(officecfg::Office::Common::Font::View::ShowFontBoxWYSIWYG::get());
981 m_xUseSkia->set_active(officecfg::Office::Common::VCL::UseSkia::get());
982 m_xForceSkiaRaster->set_active(officecfg::Office::Common::VCL::ForceSkiaRaster::get());
1007 #if HAVE_FEATURE_SKIA
1022 constexpr OUStringLiteral
sAccessSrvc =
u"com.sun.star.configuration.ConfigurationAccess";
1023 constexpr OUStringLiteral
sAccessUpdSrvc =
u"com.sun.star.configuration.ConfigurationUpdateAccess";
1032 sal_Int32 nPatterns = aDateAcceptancePatterns.getLength();
1033 OUStringBuffer
aBuf( nPatterns * 6 );
1034 SAL_WARN_IF( !nPatterns,
"cui.options",
"No date acceptance pattern");
1037 const OUString* pPatterns = aDateAcceptancePatterns.getConstArray();
1038 aBuf.append( pPatterns[0]);
1039 for (sal_Int32
i=1;
i < nPatterns; ++
i)
1040 aBuf.append(
';').append( pPatterns[
i]);
1042 return aBuf.makeStringAndClear();
1048 LanguageTag GetInstalledLocaleForSystemUILanguage()
1050 css::uno::Sequence<OUString> inst(officecfg::Setup::Office::InstalledLocales::get()->getElementNames());
1056 :
SfxTabPage(pPage, pController,
"cui/ui/optlanguagespage.ui",
"OptLanguagesPage", &rSet)
1058 , m_bDatePatternsValid(false)
1059 , m_xUserInterfaceLB(m_xBuilder->weld_combo_box(
"userinterface"))
1060 , m_xLocaleSettingFT(m_xBuilder->weld_label(
"localesettingFT"))
1061 , m_xLocaleSettingLB(new
SvxLanguageBox(m_xBuilder->weld_combo_box(
"localesetting")))
1062 , m_xDecimalSeparatorCB(m_xBuilder->weld_check_button(
"decimalseparator"))
1063 , m_xCurrencyFT(m_xBuilder->weld_label(
"defaultcurrency"))
1064 , m_xCurrencyLB(m_xBuilder->weld_combo_box(
"currencylb"))
1065 , m_xDatePatternsFT(m_xBuilder->weld_label(
"dataaccpatterns"))
1066 , m_xDatePatternsED(m_xBuilder->weld_entry(
"datepatterns"))
1067 , m_xWesternLanguageLB(new
SvxLanguageBox(m_xBuilder->weld_combo_box(
"westernlanguage")))
1068 , m_xWesternLanguageFT(m_xBuilder->weld_label(
"western"))
1069 , m_xAsianLanguageLB(new
SvxLanguageBox(m_xBuilder->weld_combo_box(
"asianlanguage")))
1070 , m_xComplexLanguageLB(new
SvxLanguageBox(m_xBuilder->weld_combo_box(
"complexlanguage")))
1071 , m_xCurrentDocCB(m_xBuilder->weld_check_button(
"currentdoc"))
1072 , m_xAsianSupportCB(m_xBuilder->weld_check_button(
"asiansupport"))
1073 , m_xCTLSupportCB(m_xBuilder->weld_check_button(
"ctlsupport"))
1074 , m_xIgnoreLanguageChangeCB(m_xBuilder->weld_check_button(
"ignorelanguagechange"))
1090 Reference< XMultiServiceFactory > theConfigProvider(
1091 css::configuration::theDefaultProvider::get(
1093 Sequence< Any > theArgs(1);
1097 theArgs[0] <<= NamedValue(
"nodepath",
Any(OUString(sInstalledLocalesPath)));
1099 theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs ), UNO_QUERY_THROW );
1100 seqInstalledLanguages = theNameAccess->getElementNames();
1102 std::vector< std::pair<sal_Int32, OUString> > aUILanguages;
1103 for (sal_Int32
i=0;
i<seqInstalledLanguages.getLength();
i++)
1108 OUString aLangStr( SvtLanguageTable::GetLanguageString( aLang ) );
1109 aUILanguages.emplace_back(i+1, aLangStr);
1113 std::sort(aUILanguages.begin(), aUILanguages.end(), [](
const auto& l1,
const auto& l2) {
1117 return aSorter.compare(l1.second, l2.second) < 0;
1121 for (
const auto & [ nGroupID, sGroupName ] : aUILanguages)
1129 Sequence< Any > theArgs2(1);
1130 theArgs2[0] <<= NamedValue(
"nodepath",
Any(OUString(sUserLocalePath)));
1132 theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs2 ), UNO_QUERY_THROW );
1133 if (theNameAccess->hasByName(sUserLocaleKey))
1141 if ( d > 0 && seqInstalledLanguages.getLength() > d-1 && seqInstalledLanguages[d-1] ==
m_sUserLocaleValue)
1155 SvxLanguageListFlags::WESTERN | SvxLanguageListFlags::ONLY_KNOWN,
true,
false,
true,
true,
1159 SvxLanguageListFlags::CJK | SvxLanguageListFlags::ONLY_KNOWN,
true,
false,
true,
true,
1163 SvxLanguageListFlags::CTL | SvxLanguageListFlags::ONLY_KNOWN,
true,
false,
true,
true,
1167 SvxLanguageListFlags::ALL | SvxLanguageListFlags::ONLY_KNOWN,
false,
false,
false,
true,
1179 OUString aTwoSpace(
" " );
1180 sal_uInt16 nCurrCount = rCurrTab.
size();
1181 std::vector< const NfCurrencyEntry* > aCurrencies;
1183 for ( sal_uInt16 j=1; j < nCurrCount; ++j )
1185 aCurrencies.push_back(&rCurrTab[j]);
1187 std::sort(aCurrencies.begin(), aCurrencies.end(),
1188 [](
const NfCurrencyEntry* c1,
const NfCurrencyEntry* c2) {
1189 return c1->GetBankSymbol().compareTo(c2->GetBankSymbol()) < 0;
1192 for (
auto &
v : aCurrencies)
1194 OUString aStr_ =
v->GetBankSymbol() +
1200 m_xCurrencyLB->append(OUString::number(reinterpret_cast<sal_Int64>(
v)), aStr_);
1235 return std::make_unique<OfaLanguagesTabPage>(pPage, pController, *rAttrSet);
1238 static void lcl_Update(std::unique_ptr<SfxVoidItem> pInvalidItems[], std::unique_ptr<SfxBoolItem> pBoolItems[], sal_uInt16 nCount)
1245 for(sal_uInt16
i = 0;
i < nCount;
i++)
1247 if(pCurrentFrm == pViewFrm)
1259 pLangConfig->aSysLocaleOptions.BlockBroadcasts(
true );
1260 pLangConfig->aLanguageOptions.BlockBroadcasts(
true );
1261 pLangConfig->aLinguConfig.BlockBroadcasts(
true );
1279 pLangConfig->aLanguageOptions.SetCTLSequenceCheckingRestricted(bOn);
1280 pLangConfig->aLanguageOptions.SetCTLSequenceChecking(bOn);
1281 pLangConfig->aLanguageOptions.SetCTLSequenceCheckingTypeAndReplace(bOn);
1287 OUString aLangString;
1289 if( d > 0 && seqInstalledLanguages.getLength() > d-1)
1290 aLangString = seqInstalledLanguages[d-1];
1296 Reference< XMultiServiceFactory > theConfigProvider(
1297 css::configuration::theDefaultProvider::get(
1299 Sequence< Any > theArgs(1);
1300 theArgs[0] <<= NamedValue(
"nodepath",
Any(OUString(sUserLocalePath)));
1302 theConfigProvider->createInstanceWithArguments(sAccessUpdSrvc, theArgs ), UNO_QUERY_THROW );
1307 xProp->setPropertyValue(sUserLocaleKey,
Any(aLangString));
1308 Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges();
1320 css::office::Quickstart::createAndSetVeto(xContext,
false,
false,
false);
1332 aLanguageTag.makeFallback().getLanguageType());
1341 if ( eOldLocale != eNewLocale )
1351 pLangConfig->aSysLocaleOptions.SetLocaleConfigString( sNewLang );
1355 bool bNewCJK = bool( nNewType & SvtScriptType::ASIAN );
1367 OUString sOldCurr =
pLangConfig->aSysLocaleOptions.GetCurrencyConfigString();
1369 const NfCurrencyEntry* pCurr = sId ==
"default" ?
nullptr :
reinterpret_cast<const NfCurrencyEntry*
>(sId.toInt64());
1373 pCurr->GetBankSymbol(), pCurr->GetLanguage() );
1374 if ( sOldCurr != sNewCurr )
1375 pLangConfig->aSysLocaleOptions.SetCurrencyConfigString( sNewCurr );
1386 bLanguageCurrentDoc_Impl = bCurrentDocCBChecked;
1387 bool bCurrentDocCBChanged =
m_xCurrentDocCB->get_state_changed_from_saved();
1390 if( (bCurrentDocCBChanged && !bCurrentDocCBChecked) || bValChanged)
1393 if(!bCurrentDocCBChecked)
1398 pLangConfig->aLinguConfig.SetProperty(
"DefaultLocale", aValue );
1399 if (xLinguProp.is())
1400 xLinguProp->setDefaultLocale( aLocale );
1402 if(pCurrentDocShell)
1405 SID_ATTR_LANGUAGE));
1409 if( (bCurrentDocCBChanged && !bCurrentDocCBChecked) || bValChanged)
1412 if(!bCurrentDocCBChecked)
1417 pLangConfig->aLinguConfig.SetProperty(
"DefaultLocale_CJK", aValue );
1418 if (xLinguProp.is())
1419 xLinguProp->setDefaultLocale_CJK( aLocale );
1421 if(pCurrentDocShell)
1424 SID_ATTR_CHAR_CJK_LANGUAGE));
1428 if( (bCurrentDocCBChanged && !bCurrentDocCBChecked) || bValChanged)
1431 if(!bCurrentDocCBChecked)
1436 pLangConfig->aLinguConfig.SetProperty(
"DefaultLocale_CTL", aValue );
1437 if (xLinguProp.is())
1438 xLinguProp->setDefaultLocale_CTL( aLocale );
1440 if(pCurrentDocShell)
1443 SID_ATTR_CHAR_CTL_LANGUAGE));
1453 const sal_uInt16 STATE_COUNT = 2;
1455 std::unique_ptr<SfxBoolItem> pBoolItems[STATE_COUNT];
1456 pBoolItems[0].reset(
new SfxBoolItem(SID_VERTICALTEXT_STATE,
false));
1457 pBoolItems[1].reset(
new SfxBoolItem(SID_TEXT_FITTOSIZE_VERTICAL,
false));
1459 std::unique_ptr<SfxVoidItem> pInvalidItems[STATE_COUNT];
1460 pInvalidItems[0].reset(
new SfxVoidItem(SID_VERTICALTEXT_STATE));
1461 pInvalidItems[1].reset(
new SfxVoidItem(SID_TEXT_FITTOSIZE_VERTICAL));
1463 lcl_Update(pInvalidItems, pBoolItems, STATE_COUNT);
1474 const sal_uInt16 STATE_COUNT = 1;
1475 std::unique_ptr<SfxBoolItem> pBoolItems[STATE_COUNT];
1476 pBoolItems[0].reset(
new SfxBoolItem(SID_CTLFONT_STATE,
false));
1477 std::unique_ptr<SfxVoidItem> pInvalidItems[STATE_COUNT];
1478 pInvalidItems[0].reset(
new SfxVoidItem(SID_CTLFONT_STATE));
1479 lcl_Update(pInvalidItems, pBoolItems, STATE_COUNT);
1482 if (
pLangConfig->aSysLocaleOptions.IsModified() )
1488 pLangConfig->aSysLocaleOptions.BlockBroadcasts(
false );
1489 pLangConfig->aLanguageOptions.BlockBroadcasts(
false );
1490 pLangConfig->aLinguConfig.BlockBroadcasts(
false );
1498 if ( aLanguageTag.isSystemLocale() )
1519 const NfCurrencyEntry* pCurr =
nullptr;
1520 OUString sCurrency =
pLangConfig->aSysLocaleOptions.GetCurrencyConfigString();
1521 if ( !sCurrency.isEmpty() )
1529 OUString
sId = !pCurr ? OUString(
"default") : OUString::number(reinterpret_cast<sal_Int64>(pCurr));
1536 OUString aDatePatternsString =
pLangConfig->aSysLocaleOptions.GetDatePatternsConfigString();
1537 if (aDatePatternsString.isEmpty())
1563 aWestLang =
pLangConfig->aLinguConfig.GetProperty(
"DefaultLocale");
1565 aWestLang >>= aLocale;
1569 aCJKLang =
pLangConfig->aLinguConfig.GetProperty(
"DefaultLocale_CJK");
1571 aCJKLang >>= aLocale;
1574 aCTLLang =
pLangConfig->aLinguConfig.GetProperty(
"DefaultLocale_CTL");
1576 aCTLLang >>= aLocale;
1583 if(pCurrentDocShell)
1588 if( SfxItemState::SET == rSet->
GetItemState(SID_ATTR_LANGUAGE,
false, &pLang))
1592 eCurLang = eTempCurLang;
1595 if( SfxItemState::SET == rSet->
GetItemState(SID_ATTR_CHAR_CJK_LANGUAGE,
false, &pLang))
1599 eCurLangCJK = eTempCurLang;
1602 if( SfxItemState::SET == rSet->
GetItemState(SID_ATTR_CHAR_CTL_LANGUAGE,
false, &pLang))
1606 eCurLangCTL = eTempCurLang;
1630 bool bEnable = !
pLangConfig->aLinguConfig.IsReadOnly(
"DefaultLocale" );
1647 bool bCheck = rBox.get_active();
1648 if ( m_xAsianSupportCB.get() == &rBox )
1650 bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly(
"DefaultLocale_CJK");
1651 bCheck = ( bCheck && !bReadonly );
1652 m_xAsianLanguageLB->set_sensitive( bCheck );
1653 if (rBox.get_sensitive())
1654 m_bOldAsian = bCheck;
1656 else if ( m_xCTLSupportCB.get() == &rBox )
1658 bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly(
"DefaultLocale_CTL");
1659 bCheck = ( bCheck && !bReadonly );
1660 m_xComplexLanguageLB->set_sensitive( bCheck );
1661 if (rBox.get_sensitive())
1665 SAL_WARN(
"cui.options",
"OfaLanguagesTabPage::SupportHdl(): wrong rBox" );
1670 void lcl_checkLanguageCheckBox(
weld::CheckButton& _rCB,
bool _bNewValue,
bool _bOldValue)
1684 LanguageType eLang = m_xLocaleSettingLB->get_active_id();
1690 bool bIsCTLFixed = bool(nType & SvtScriptType::COMPLEX);
1691 lcl_checkLanguageCheckBox(*m_xCTLSupportCB, bIsCTLFixed, m_bOldCtl);
1692 SupportHdl(*m_xCTLSupportCB);
1698 bool bIsCJKFixed = bool(nType & SvtScriptType::ASIAN);
1699 lcl_checkLanguageCheckBox(*m_xAsianSupportCB, bIsCJKFixed, m_bOldAsian);
1700 SupportHdl(*m_xAsianSupportCB);
1705 const OUString aDefaultID =
"default";
1707 m_xCurrencyLB->remove_id(aDefaultID);
1708 OUString aDefaultCurr = m_sSystemDefaultString +
" - " + rCurr.GetBankSymbol();
1709 m_xCurrencyLB->insert(0, aDefaultCurr, &aDefaultID,
nullptr,
nullptr);
1710 assert(m_xCurrencyLB->find_id(aDefaultID) != -1);
1711 m_xCurrencyLB->set_active_text(aDefaultCurr);
1718 OUString sTempLabel(m_sDecimalSeparatorLabel);
1719 sTempLabel = sTempLabel.replaceFirst(
"%1", aLocaleWrapper.
getNumDecimalSep() );
1720 m_xDecimalSeparatorCB->set_label(sTempLabel);
1724 m_bDatePatternsValid =
true;
1725 m_xDatePatternsED->set_text( aDatePatternsString);
1730 const OUString aPatterns(rEd.get_text());
1731 OUStringBuffer
aBuf( aPatterns);
1732 sal_Int32 nChar = 0;
1734 bool bModified =
false;
1735 if (!aPatterns.isEmpty())
1737 for (sal_Int32
nIndex=0;
nIndex >= 0 && bValid; ++nChar)
1739 const OUString aPat( aPatterns.getToken( 0,
';',
nIndex));
1740 if (aPat.isEmpty() &&
nIndex < 0)
1747 else if (aPat.getLength() < 2)
1752 bY = bM = bD =
false;
1754 for (sal_Int32
i = 0;
i < aPat.getLength() && bValid; )
1756 const sal_Int32 j =
i;
1757 const sal_uInt32 c = aPat.iterateCodePoints( &
i);
1800 if (!(bY || bM || bD))
1807 bValid &= (bY || bM || bD);
1812 rEd.replace_selection(aBuf.makeStringAndClear());
1817 m_bDatePatternsValid = bValid;
constexpr OUStringLiteral sAccessUpdSrvc
#define LINK(Instance, Class, Member)
std::unique_ptr< SvxLanguageBox > m_xComplexLanguageLB
ToolBoxButtonSize GetNotebookbarIconSize() const
OfaMiscTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
bool IsExtendedHelp() const
IMPL_STATIC_LINK_NOARG(OfaViewTabPage, OnMoreIconsClick, weld::Button &, void)
std::unique_ptr< weld::ComboBox > m_xIconStyleLB
SvtSysLocaleOptions aSysLocaleOptions
void SetNotebookbarIconSize(ToolBoxButtonSize eSet)
std::unique_ptr< weld::Widget > m_xFileDlgROImage
void SetState(const SfxItemSet &rSet)
static bool bLanguageCurrentDoc_Impl
static OUString CreateCurrencyConfigString(const OUString &rAbbrev, LanguageType eLang)
void SetStyleSettings(const StyleSettings &rSet)
std::unique_ptr< weld::SpinButton > m_xYearValueField
OUString ExpandVariables(const OUString &rString)
std::unique_ptr< weld::ComboBox > m_xIconSizeLB
constexpr OUStringLiteral sInstalledLocalesPath
std::unique_ptr< weld::ComboBox > m_xMenuIconsLB
std::unique_ptr< SvtOptionsDrawinglayer > mpDrawinglayerOpt
static LanguageType convertToLanguageType(const css::lang::Locale &rLocale, bool bResolveSystem=true)
std::unique_ptr< weld::Widget > m_xQuickStarterFrame
static OUString convertToBcp47(LanguageType nLangID)
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
static css::uno::Reference< css::linguistic2::XLinguProperties > GetLinguPropertySet()
IMPL_LINK(OfaLanguagesTabPage, SupportHdl, weld::ToggleButton &, rBox, void)
std::unique_ptr< weld::Label > m_xCurrencyFT
OUString GetIconTheme() const
std::vector< std::pair< OUString, Sequence< OUString > > > ServiceVector
static LanguageType convertToLanguageTypeWithFallback(const OUString &rBcp47)
std::unique_ptr< weld::Label > m_xLocaleSettingFT
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
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
static std::shared_ptr< ConfigurationChanges > create(css::uno::Reference< css::uno::XComponentContext > const &context=comphelper::getProcessComponentContext())
OUString GetAutomaticallyChosenIconTheme() const
std::unique_ptr< weld::CheckButton > m_xCollectUsageInfo
void EnabledHardwareAcceleration(bool _bEnabled) const
static SvtScriptType GetScriptTypeOfLanguage(LanguageType nLang)
OfaViewTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
ToolBoxButtonSize GetSidebarIconSize() const
void SetIgnoreKashida_CTL(bool bVal)
std::unique_ptr< weld::Widget > m_xYearFrame
void SetSidebarIconSize(ToolBoxButtonSize eSet)
bool IsHardwareAccelerationAvailable() const
SvtLanguageOptions aLanguageOptions
std::unique_ptr< weld::Label > m_xSkiaStatusDisabled
static vcl::Window * GetFirstTopLevelWindow()
std::unique_ptr< weld::Button > m_xMoreIcons
static LanguageType getSystemLanguage()
bool IsOfflineHelpPopUp() const
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
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
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)
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
#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
bool IconThemeWasSetAutomatically()
css::uno::Sequence< OUString > getDateAcceptancePatterns() const
IMPL_LINK_NOARG(OfaMiscTabPage, TwoFigureHdl, weld::SpinButton &, void)
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()
void SetExtendedHelp(bool b)
std::unique_ptr< weld::CheckButton > m_xUseHardwareAccell
OUString m_sSystemDefaultString
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
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)
#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
std::unique_ptr< weld::CheckButton > m_xPrintDlgCB
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_xPrintDlgFrame
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
if(!pCandidateA->getEnd().equal(pCandidateB->getStart()))
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
void SetOfflineHelpPopUp(bool b)
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)
std::unique_ptr< weld::CheckButton > m_xAsianSupportCB
std::unique_ptr< weld::CheckButton > m_xCTLSupportCB
OUString m_sUserLocaleValue
static bool hasNativeFileSelection()