LibreOffice Module cui (master)  1
optgdlg.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <config_features.h>
21 #include <svl/numformat.hxx>
22 #include <svl/zforlist.hxx>
23 #include <svl/currencytable.hxx>
24 #include <svtools/langhelp.hxx>
25 #include <unotools/lingucfg.hxx>
26 #if defined(_WIN32)
27 #include <unotools/resmgr.hxx>
28 #endif
29 #include <sfx2/bindings.hxx>
30 #include <sfx2/viewfrm.hxx>
31 #include <i18nlangtag/mslangid.hxx>
34 #include <svl/languageoptions.hxx>
35 #include <svl/cjkoptions.hxx>
36 #include <svl/ctloptions.hxx>
37 #include <svtools/miscopt.hxx>
39 #include <sfx2/objsh.hxx>
41 #include <svtools/langtab.hxx>
42 #include <editeng/unolingu.hxx>
43 #include <editeng/langitem.hxx>
45 #include <comphelper/string.hxx>
46 #include <rtl/ustrbuf.hxx>
47 #include <editeng/editids.hrc>
48 #include <svx/svxids.hrc>
49 #include <svl/intitem.hxx>
50 #include <GraphicsTestsDialog.hxx>
51 #include <unotools/searchopt.hxx>
52 #include <sal/log.hxx>
53 #include <officecfg/Office/Common.hxx>
54 #include <officecfg/Setup.hxx>
56 #include <tools/diagnose_ex.h>
57 #if HAVE_FEATURE_BREAKPAD
58 #include <desktop/crashreport.hxx>
59 #endif
60 
61 #include <com/sun/star/configuration/theDefaultProvider.hpp>
62 #include <com/sun/star/container/XNameAccess.hpp>
63 #include <com/sun/star/container/XNameReplace.hpp>
64 #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
65 #include <com/sun/star/beans/NamedValue.hpp>
66 #include <com/sun/star/beans/PropertyAttribute.hpp>
67 #include <com/sun/star/beans/XPropertySet.hpp>
68 #include <com/sun/star/util/XChangesBatch.hpp>
69 #include <com/sun/star/uno/Any.hxx>
70 #include <com/sun/star/container/XContentEnumerationAccess.hpp>
71 #include <com/sun/star/container/XSet.hpp>
72 #include <com/sun/star/i18n/ScriptType.hpp>
73 #include <com/sun/star/office/Quickstart.hpp>
74 #include <com/sun/star/linguistic2/XLinguProperties.hpp>
76 
77 #include <vcl/vclenum.hxx>
78 #include <vcl/svapp.hxx>
79 #include <vcl/settings.hxx>
80 #include <vcl/window.hxx>
81 #include <vcl/IconThemeInfo.hxx>
82 #include <vcl/skia/SkiaHelper.hxx>
83 #include "optgdlg.hxx"
84 #include <svtools/apearcfg.hxx>
87 #include <svtools/imgdef.hxx>
88 
89 #if defined(_WIN32)
90 #include <vcl/fileregistration.hxx>
91 #endif
92 using namespace ::com::sun::star::uno;
93 using namespace ::com::sun::star::lang;
94 using namespace ::com::sun::star::beans;
95 using namespace ::com::sun::star::container;
96 using namespace ::com::sun::star::util;
97 using namespace ::utl;
98 
99 // class OfaMiscTabPage --------------------------------------------------
100 
102 {
103  if ( pSet_ )
104  FillItemSet( pSet_ );
105  return DeactivateRC::LeavePage;
106 }
107 
108 namespace
109 {
110 OUString impl_SystemFileOpenServiceName()
111 {
112  #if defined(_WIN32)
113  return "com.sun.star.ui.dialogs.SystemFilePicker";
114  #elif defined MACOSX
115  return "com.sun.star.ui.dialogs.AquaFilePicker";
116  #else
117  return OUString();
118  #endif
119 }
120 
121 bool lcl_HasSystemFilePicker()
122 {
124  return true;
125 
126  // Otherwise fall-back on querying services
127  bool bRet = false;
128  Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
129 
130  Reference< XContentEnumerationAccess > xEnumAccess( xFactory, UNO_QUERY );
131  Reference< XSet > xSet( xFactory, UNO_QUERY );
132 
133  if ( ! xEnumAccess.is() || ! xSet.is() )
134  return bRet;
135 
136  try
137  {
138  OUString aFileService = impl_SystemFileOpenServiceName();
139  Reference< XEnumeration > xEnum = xEnumAccess->createContentEnumeration( aFileService );
140  if ( xEnum.is() && xEnum->hasMoreElements() )
141  bRet = true;
142  }
143  catch (const IllegalArgumentException&)
144  {
145  }
146  catch (const ElementExistException&)
147  {
148  }
149  return bRet;
150 }
151 }
152 
154  : SfxTabPage(pPage, pController, "cui/ui/optgeneralpage.ui", "OptGeneralPage", &rSet)
155  , m_xExtHelpCB(m_xBuilder->weld_check_button("exthelp"))
156  , m_xPopUpNoHelpCB(m_xBuilder->weld_check_button("popupnohelp"))
157  , m_xShowTipOfTheDay(m_xBuilder->weld_check_button("cbShowTipOfTheDay"))
158  , m_xFileDlgFrame(m_xBuilder->weld_widget("filedlgframe"))
159  , m_xFileDlgROImage(m_xBuilder->weld_widget("lockimage"))
160  , m_xFileDlgCB(m_xBuilder->weld_check_button("filedlg"))
161  , m_xPrintDlgCB(m_xBuilder->weld_check_button("printdlg"))
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")) //"Help Improve"
169 #if defined(UNX)
170  , m_xQuickLaunchCB(m_xBuilder->weld_check_button("systray"))
171 #else
172  , m_xQuickLaunchCB(m_xBuilder->weld_check_button("quicklaunch"))
173 #endif
174 #if defined(_WIN32)
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"))
178 #endif
179 {
180  if (!lcl_HasSystemFilePicker())
181  m_xFileDlgFrame->hide();
182  else if (officecfg::Office::Common::Misc::UseSystemFileDialog::isReadOnly())
183  {
184  m_xFileDlgROImage->show();
185  m_xFileDlgCB->set_sensitive(false);
186  }
187 
188  m_xQuickLaunchCB->show();
189 
190  //Only available in Win or if building the gtk systray
191 #if !defined(_WIN32)
192  m_xQuickStarterFrame->hide();
193  //Hide frame label in case of no content
194  m_xHelpImproveLabel->hide();
195 #endif
196 
197 #if defined(_WIN32)
198  m_xFileAssocFrame->show();
199  m_xFileAssocBtn->connect_clicked(LINK(this, OfaMiscTabPage, FileAssocClick));
200 #endif
201 
202  m_aStrDateInfo = m_xToYearFT->get_label();
203  m_xYearValueField->connect_value_changed( LINK( this, OfaMiscTabPage, TwoFigureHdl ) );
204 
206 }
207 
209 {
210 }
211 
212 std::unique_ptr<SfxTabPage> OfaMiscTabPage::Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet )
213 {
214  return std::make_unique<OfaMiscTabPage>( pPage, pController, *rAttrSet );
215 }
216 
218 {
219  bool bModified = false;
220  std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
221 
222  if ( m_xPopUpNoHelpCB->get_state_changed_from_saved() )
223  officecfg::Office::Common::Help::BuiltInHelpNotInstalledPopUp::set(m_xPopUpNoHelpCB->get_active(), batch);
224 
225  if ( m_xExtHelpCB->get_state_changed_from_saved() )
226  officecfg::Office::Common::Help::ExtendedTip::set(m_xExtHelpCB->get_active(), batch);
227 
228  if ( m_xShowTipOfTheDay->get_state_changed_from_saved() )
229  {
230  officecfg::Office::Common::Misc::ShowTipOfTheDay::set(m_xShowTipOfTheDay->get_active(), batch);
231  bModified = true;
232  }
233 
234  if ( m_xFileDlgCB->get_state_changed_from_saved() )
235  {
236  officecfg::Office::Common::Misc::UseSystemFileDialog::set( !m_xFileDlgCB->get_active(), batch );
237  bModified = true;
238  }
239 
240  if (m_xDocStatusCB->get_state_changed_from_saved())
241  {
242  officecfg::Office::Common::Print::PrintingModifiesDocument::set(m_xDocStatusCB->get_active(), batch);
243  bModified = true;
244  }
245 
246  const SfxUInt16Item* pUInt16Item = dynamic_cast< const SfxUInt16Item* >( GetOldItem( *rSet, SID_ATTR_YEAR2000 ) );
247  sal_uInt16 nNum = static_cast<sal_uInt16>(m_xYearValueField->get_text().toInt32());
248  if ( pUInt16Item && pUInt16Item->GetValue() != nNum )
249  {
250  bModified = true;
251  rSet->Put( SfxUInt16Item( SID_ATTR_YEAR2000, nNum ) );
252  }
253 
254 #if HAVE_FEATURE_BREAKPAD
255  if (m_xCrashReport->get_state_changed_from_saved())
256  {
257  officecfg::Office::Common::Misc::CrashReport::set(m_xCrashReport->get_active(), batch);
258  bModified = true;
259  }
260 #endif
261 
262 #if defined(_WIN32)
263  if (m_xPerformFileExtCheck->get_state_changed_from_saved())
264  {
265  officecfg::Office::Common::Misc::PerformFileExtCheck::set(
266  m_xPerformFileExtCheck->get_active(), batch);
267  bModified = true;
268  }
269 #endif
270 
271  batch->commit();
272 
273  if( m_xQuickLaunchCB->get_state_changed_from_saved())
274  {
275  rSet->Put(SfxBoolItem(SID_ATTR_QUICKLAUNCHER, m_xQuickLaunchCB->get_active()));
276  bModified = true;
277  }
278 
279  return bModified;
280 }
281 
283 {
284  m_xExtHelpCB->set_active( officecfg::Office::Common::Help::Tip::get() &&
285  officecfg::Office::Common::Help::ExtendedTip::get() );
286  m_xExtHelpCB->save_state();
287  m_xPopUpNoHelpCB->set_active( officecfg::Office::Common::Help::BuiltInHelpNotInstalledPopUp::get() );
288  m_xPopUpNoHelpCB->save_state();
289  m_xShowTipOfTheDay->set_active( officecfg::Office::Common::Misc::ShowTipOfTheDay::get() );
290  m_xShowTipOfTheDay->save_state();
291  m_xFileDlgCB->set_active( !officecfg::Office::Common::Misc::UseSystemFileDialog::get() );
292  m_xFileDlgCB->save_state();
293 
294  m_xDocStatusCB->set_active(officecfg::Office::Common::Print::PrintingModifiesDocument::get());
295  m_xDocStatusCB->save_state();
296 
297  const SfxPoolItem* pItem = nullptr;
298  if ( SfxItemState::SET == rSet->GetItemState( SID_ATTR_YEAR2000, false, &pItem ) )
299  {
300  m_xYearValueField->set_value( static_cast<const SfxUInt16Item*>(pItem)->GetValue() );
301  TwoFigureHdl(*m_xYearValueField);
302  }
303  else
304  m_xYearFrame->set_sensitive(false);
305 
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());
309  m_xCrashReport->save_state();
310 #else
311  m_xCrashReport->hide();
312 #endif
313 
314  SfxItemState eState = rSet->GetItemState( SID_ATTR_QUICKLAUNCHER, false, &pItem );
315  if ( SfxItemState::SET == eState )
316  m_xQuickLaunchCB->set_active( static_cast<const SfxBoolItem*>(pItem)->GetValue() );
317  else if ( SfxItemState::DISABLED == eState )
318  {
319  // quickstart not installed
320  m_xQuickStarterFrame->hide();
321  }
322 
323  m_xQuickLaunchCB->save_state();
324 
325 #if defined(_WIN32)
326  m_xPerformFileExtCheck->set_active(
327  officecfg::Office::Common::Misc::PerformFileExtCheck::get());
328  m_xPerformFileExtCheck->save_state();
329 #endif
330 }
331 
333 {
334  OUString aOutput( m_aStrDateInfo );
335  OUString aStr( m_xYearValueField->get_text() );
336  sal_Int32 nNum = aStr.toInt32();
337  if ( aStr.getLength() != 4 || nNum < m_xYearValueField->get_min() || nNum > m_xYearValueField->get_max() )
338  aOutput += "????";
339  else
340  {
341  nNum += 99;
342  aOutput += OUString::number( nNum );
343  }
344  m_xToYearFT->set_label( aOutput );
345 }
346 
347 #if defined(_WIN32)
348 IMPL_STATIC_LINK_NOARG(OfaMiscTabPage, FileAssocClick, weld::Button&, void)
349 {
351 }
352 #endif
353 
355 {
356 public:
357  CanvasSettings();
358 
359  bool IsHardwareAccelerationEnabled() const;
360  bool IsHardwareAccelerationAvailable() const;
361  bool IsHardwareAccelerationRO() const;
362  void EnabledHardwareAcceleration( bool _bEnabled ) const;
363 
364 private:
365  typedef std::vector< std::pair<OUString,Sequence<OUString> > > ServiceVector;
366 
369  mutable bool mbHWAccelAvailable;
370  mutable bool mbHWAccelChecked;
371 };
372 
374  mbHWAccelAvailable(false),
375  mbHWAccelChecked(false)
376 {
377  try
378  {
379  Reference<XMultiServiceFactory> xConfigProvider(
380  css::configuration::theDefaultProvider::get(
382 
383  Sequence<Any> aArgs1(comphelper::InitAnyPropertySequence(
384  {
385  {"nodepath", Any(OUString("/org.openoffice.Office.Canvas"))}
386  }));
388  xConfigProvider->createInstanceWithArguments(
389  "com.sun.star.configuration.ConfigurationUpdateAccess",
390  aArgs1 ),
391  UNO_QUERY_THROW );
392 
393  Sequence<Any> aArgs2(comphelper::InitAnyPropertySequence(
394  {
395  {"nodepath", Any(OUString("/org.openoffice.Office.Canvas/CanvasServiceList"))}
396  }));
397  Reference<XNameAccess> xNameAccess(
398  xConfigProvider->createInstanceWithArguments(
399  "com.sun.star.configuration.ConfigurationAccess",
400  aArgs2 ), UNO_QUERY_THROW );
401  Reference<XHierarchicalNameAccess> xHierarchicalNameAccess(
402  xNameAccess, UNO_QUERY_THROW);
403 
404  Sequence<OUString> serviceNames = xNameAccess->getElementNames();
405  const OUString* pCurr = serviceNames.getConstArray();
406  const OUString* const pEnd = pCurr + serviceNames.getLength();
407  while( pCurr != pEnd )
408  {
409  Reference<XNameAccess> xEntryNameAccess(
410  xHierarchicalNameAccess->getByHierarchicalName(*pCurr),
411  UNO_QUERY );
412 
413  if( xEntryNameAccess.is() )
414  {
415  Sequence<OUString> preferredImplementations;
416  if( xEntryNameAccess->getByName("PreferredImplementations") >>= preferredImplementations )
417  maAvailableImplementations.emplace_back(*pCurr,preferredImplementations );
418  }
419 
420  ++pCurr;
421  }
422  }
423  catch (const Exception&)
424  {
425  }
426 }
427 
429 {
430  if( !mbHWAccelChecked )
431  {
432  mbHWAccelChecked = true;
433 
434  Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
435 
436  // check whether any of the service lists has an
437  // implementation that presents the "HardwareAcceleration" property
438  for (auto const& availableImpl : maAvailableImplementations)
439  {
440  const OUString* pCurrImpl = availableImpl.second.getConstArray();
441  const OUString* const pEndImpl = pCurrImpl + availableImpl.second.getLength();
442 
443  while( pCurrImpl != pEndImpl )
444  {
445  try
446  {
447  Reference<XPropertySet> xPropSet( xFactory->createInstance(
448  pCurrImpl->trim() ),
449  UNO_QUERY_THROW );
450  bool bHasAccel(false);
451  if( xPropSet->getPropertyValue("HardwareAcceleration") >>= bHasAccel )
452  if( bHasAccel )
453  {
454  mbHWAccelAvailable = true;
455  return mbHWAccelAvailable;
456  }
457  }
458  catch (const Exception&)
459  {
460  }
461 
462  ++pCurrImpl;
463  }
464  }
465  }
466 
467  return mbHWAccelAvailable;
468 }
469 
471 {
472  bool bForceLastEntry(false);
473  if( !mxForceFlagNameAccess.is() )
474  return true;
475 
476  if( !(mxForceFlagNameAccess->getByName("ForceSafeServiceImpl") >>= bForceLastEntry) )
477  return true;
478 
479  return !bForceLastEntry;
480 }
481 
483 {
485  if (!xSet.is())
486  return true;
487 
488  Reference< XPropertySetInfo > xInfo = xSet->getPropertySetInfo();
489  Property aProp = xInfo->getPropertyByName("ForceSafeServiceImpl");
490  return ((aProp.Attributes & css::beans::PropertyAttribute::READONLY ) == css::beans::PropertyAttribute::READONLY);
491 }
492 
494 {
495  Reference< XNameReplace > xNameReplace(
496  mxForceFlagNameAccess, UNO_QUERY );
497 
498  if( !xNameReplace.is() )
499  return;
500 
501  xNameReplace->replaceByName( "ForceSafeServiceImpl", Any(!_bEnabled) );
502 
503  Reference< XChangesBatch > xChangesBatch(
504  mxForceFlagNameAccess, UNO_QUERY );
505 
506  if( !xChangesBatch.is() )
507  return;
508 
509  xChangesBatch->commitChanges();
510 }
511 
512 // class OfaViewTabPage --------------------------------------------------
513 
514 static bool DisplayNameCompareLessThan(const vcl::IconThemeInfo& rInfo1, const vcl::IconThemeInfo& rInfo2)
515 {
516  return rInfo1.GetDisplayName().compareTo(rInfo2.GetDisplayName()) < 0;
517 }
518 
520  : SfxTabPage(pPage, pController, "cui/ui/optviewpage.ui", "OptViewPage", &rSet)
521  , nSizeLB_InitialSelection(0)
522  , nSidebarSizeLB_InitialSelection(0)
523  , nNotebookbarSizeLB_InitialSelection(0)
524  , nStyleLB_InitialSelection(0)
525  , pAppearanceCfg(new SvtTabAppearanceCfg)
526  , pCanvasSettings(new CanvasSettings)
527  , m_xIconSizeLB(m_xBuilder->weld_combo_box("iconsize"))
528  , m_xSidebarIconSizeLB(m_xBuilder->weld_combo_box("sidebariconsize"))
529  , m_xNotebookbarIconSizeLB(m_xBuilder->weld_combo_box("notebookbariconsize"))
530  , m_xIconStyleLB(m_xBuilder->weld_combo_box("iconstyle"))
531  , m_xFontAntiAliasing(m_xBuilder->weld_check_button("aafont"))
532  , m_xAAPointLimitLabel(m_xBuilder->weld_label("aafrom"))
533  , m_xAAPointLimit(m_xBuilder->weld_metric_spin_button("aanf", FieldUnit::PIXEL))
534  , m_xMenuIconBox(m_xBuilder->weld_widget("menuiconsbox"))
535  , m_xMenuIconsLB(m_xBuilder->weld_combo_box("menuicons"))
536  , m_xContextMenuShortcutsLB(m_xBuilder->weld_combo_box("contextmenushortcuts"))
537  , m_xFontShowCB(m_xBuilder->weld_check_button("showfontpreview"))
538  , m_xUseHardwareAccell(m_xBuilder->weld_check_button("useaccel"))
539  , m_xUseAntiAliase(m_xBuilder->weld_check_button("useaa"))
540  , m_xUseSkia(m_xBuilder->weld_check_button("useskia"))
541  , m_xForceSkiaRaster(m_xBuilder->weld_check_button("forceskiaraster"))
542  , m_xSkiaStatusEnabled(m_xBuilder->weld_label("skiaenabled"))
543  , m_xSkiaStatusDisabled(m_xBuilder->weld_label("skiadisabled"))
544  , m_xMousePosLB(m_xBuilder->weld_combo_box("mousepos"))
545  , m_xMouseMiddleLB(m_xBuilder->weld_combo_box("mousemiddle"))
546  , m_xMoreIcons(m_xBuilder->weld_button("btnMoreIcons"))
547  , m_xRunGPTests(m_xBuilder->weld_button("btn_rungptest"))
548 {
549  if (Application::GetToolkitName().startsWith("gtk"))
550  m_xMenuIconBox->hide();
551 
552  m_xFontAntiAliasing->connect_toggled( LINK( this, OfaViewTabPage, OnAntialiasingToggled ) );
553 
554  m_xUseSkia->connect_toggled(LINK(this, OfaViewTabPage, OnUseSkiaToggled));
555 
556  // Set known icon themes
557  OUString sAutoStr( m_xIconStyleLB->get_text( 0 ) );
558  m_xIconStyleLB->clear();
560  mInstalledIconThemes = aStyleSettings.GetInstalledIconThemes();
562 
563  // Start with the automatically chosen icon theme
564  OUString autoThemeId = aStyleSettings.GetAutomaticallyChosenIconTheme();
566 
567  OUString entryForAuto = sAutoStr + " (" +
568  autoIconTheme.GetDisplayName() +
569  ")";
570  m_xIconStyleLB->append("auto", entryForAuto); // index 0 means choose style automatically
571 
572  // separate auto and other icon themes
573  m_xIconStyleLB->append_separator("");
574 
575  for (auto const& installIconTheme : mInstalledIconThemes)
576  m_xIconStyleLB->append(installIconTheme.GetThemeId(), installIconTheme.GetDisplayName());
577 
578  m_xIconStyleLB->set_active(0);
579 
580  m_xMoreIcons->set_from_icon_name("cmd/sc_additionsdialog.png");
581  m_xMoreIcons->connect_clicked(LINK(this, OfaViewTabPage, OnMoreIconsClick));
582  m_xRunGPTests->connect_clicked( LINK( this, OfaViewTabPage, OnRunGPTestClick));
583 }
584 
586 {
587 }
588 
589 IMPL_LINK_NOARG(OfaViewTabPage, OnRunGPTestClick, weld::Button&, void)
590 {
591  GraphicsTestsDialog m_xGraphicsTestDialog(m_xContainer.get());
592  m_xGraphicsTestDialog.run();
593 }
594 
596 {
597  css::uno::Sequence<css::beans::PropertyValue> aArgs(1);
598  aArgs[0].Name = "AdditionsTag";
599  aArgs[0].Value <<= OUString("Icons");
600  comphelper::dispatchCommand(".uno:AdditionsDialog", aArgs);
601 }
602 
603 IMPL_LINK_NOARG( OfaViewTabPage, OnAntialiasingToggled, weld::Toggleable&, void )
604 {
605  bool bAAEnabled = m_xFontAntiAliasing->get_active();
606 
607  m_xAAPointLimitLabel->set_sensitive(bAAEnabled);
608  m_xAAPointLimit->set_sensitive(bAAEnabled);
609 }
610 
612 {
613  UpdateSkiaStatus();
614 }
615 
617 {
618  m_xUseSkia->hide();
619  m_xForceSkiaRaster->hide();
620  m_xSkiaStatusEnabled->hide();
621  m_xSkiaStatusDisabled->hide();
622 }
623 
625 {
626 #if HAVE_FEATURE_SKIA
627  bool skiaHidden = true;
628 
629  // For now Skia is used mainly on Windows, enable the controls there.
630  if (Application::GetToolkitName() == "win")
631  skiaHidden = false;
632  // It can also be used on Linux, but only with the rarely used 'gen' backend.
633  if (Application::GetToolkitName() == "x11")
634  skiaHidden = false;
635  // OSX backend has Skia support too.
636  if (Application::GetToolkitName() == "osx")
637  skiaHidden = false;
638 
639  if (skiaHidden)
640  {
641  HideSkiaWidgets();
642  return;
643  }
644 
645  // Easier than a custom translation string.
646  bool bEnabled = SkiaHelper::isVCLSkiaEnabled();
647  m_xSkiaStatusEnabled->set_visible(bEnabled);
648  m_xSkiaStatusDisabled->set_visible(!bEnabled);
649 
650  // FIXME: should really add code to show a 'lock' icon here.
651  m_xUseSkia->set_sensitive(!officecfg::Office::Common::VCL::UseSkia::isReadOnly());
652  m_xForceSkiaRaster->set_sensitive(m_xUseSkia->get_active() && !officecfg::Office::Common::VCL::ForceSkiaRaster::isReadOnly());
653 
654  // Technically the 'use hardware acceleration' option could be used to mean !forceSkiaRaster, but the implementation
655  // of the option is so tied to the implementation of the canvas module that it's simpler to ignore it.
657 #else
658  HideSkiaWidgets();
659 #endif
660 }
661 
662 std::unique_ptr<SfxTabPage> OfaViewTabPage::Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet )
663 {
664  return std::make_unique<OfaViewTabPage>(pPage, pController, *rAttrSet);
665 }
666 
668 {
669  bool bModified = false;
670  bool bMenuOptModified = false;
671  bool bRepaintWindows(false);
672  std::shared_ptr<comphelper::ConfigurationChanges> xChanges(comphelper::ConfigurationChanges::create());
673 
674  SvtMiscOptions aMiscOptions;
675  const sal_Int32 nSizeLB_NewSelection = m_xIconSizeLB->get_active();
676  if( nSizeLB_InitialSelection != nSizeLB_NewSelection )
677  {
678  // from now on it's modified, even if via auto setting the same size was set as now selected in the LB
679  sal_Int16 eSet = SFX_SYMBOLS_SIZE_AUTO;
680  switch( nSizeLB_NewSelection )
681  {
682  case 0: eSet = SFX_SYMBOLS_SIZE_AUTO; break;
683  case 1: eSet = SFX_SYMBOLS_SIZE_SMALL; break;
684  case 2: eSet = SFX_SYMBOLS_SIZE_LARGE; break;
685  case 3: eSet = SFX_SYMBOLS_SIZE_32; break;
686  default:
687  OSL_FAIL( "OfaViewTabPage::FillItemSet(): This state of m_xIconSizeLB should not be possible!" );
688  }
689  aMiscOptions.SetSymbolsSize( eSet );
690  }
691 
692  const sal_Int32 nSidebarSizeLB_NewSelection = m_xSidebarIconSizeLB->get_active();
693  if( nSidebarSizeLB_InitialSelection != nSidebarSizeLB_NewSelection )
694  {
695  // from now on it's modified, even if via auto setting the same size was set as now selected in the LB
696  ToolBoxButtonSize eSet = ToolBoxButtonSize::DontCare;
697  switch( nSidebarSizeLB_NewSelection )
698  {
699  case 0: eSet = ToolBoxButtonSize::DontCare; break;
700  case 1: eSet = ToolBoxButtonSize::Small; break;
701  case 2: eSet = ToolBoxButtonSize::Large; break;
702  default:
703  OSL_FAIL( "OfaViewTabPage::FillItemSet(): This state of m_xSidebarIconSizeLB should not be possible!" );
704  }
705  officecfg::Office::Common::Misc::SidebarIconSize::set(static_cast<sal_Int16>(eSet), xChanges);
706  }
707 
708  const sal_Int32 nNotebookbarSizeLB_NewSelection = m_xNotebookbarIconSizeLB->get_active();
709  if( nNotebookbarSizeLB_InitialSelection != nNotebookbarSizeLB_NewSelection )
710  {
711  // from now on it's modified, even if via auto setting the same size was set as now selected in the LB
712  ToolBoxButtonSize eSet = ToolBoxButtonSize::DontCare;
713  switch( nNotebookbarSizeLB_NewSelection )
714  {
715  case 0: eSet = ToolBoxButtonSize::DontCare; break;
716  case 1: eSet = ToolBoxButtonSize::Small; break;
717  case 2: eSet = ToolBoxButtonSize::Large; break;
718  default:
719  OSL_FAIL( "OfaViewTabPage::FillItemSet(): This state of m_xNotebookbarIconSizeLB should not be possible!" );
720  }
721  officecfg::Office::Common::Misc::NotebookbarIconSize::set(static_cast<sal_Int16>(eSet), xChanges);
722  }
723 
724  const sal_Int32 nStyleLB_NewSelection = m_xIconStyleLB->get_active();
725  if( nStyleLB_InitialSelection != nStyleLB_NewSelection )
726  {
727  aMiscOptions.SetIconTheme(m_xIconStyleLB->get_active_id());
728  nStyleLB_InitialSelection = nStyleLB_NewSelection;
729  }
730 
731  bool bAppearanceChanged = false;
732 
733  // Mouse Snap Mode
734  SnapType eOldSnap = pAppearanceCfg->GetSnapMode();
735  SnapType eNewSnap = static_cast<SnapType>(m_xMousePosLB->get_active());
736  if(eNewSnap > SnapType::NONE)
737  eNewSnap = SnapType::NONE;
738 
739  if ( eNewSnap != eOldSnap )
740  {
741  pAppearanceCfg->SetSnapMode(eNewSnap );
742  bAppearanceChanged = true;
743  }
744 
745  // Middle Mouse Button
746  MouseMiddleButtonAction eOldMiddleMouse = pAppearanceCfg->GetMiddleMouseButton();
747  short eNewMiddleMouse = m_xMouseMiddleLB->get_active();
748  if(eNewMiddleMouse > 2)
749  eNewMiddleMouse = 2;
750 
751  if ( eNewMiddleMouse != static_cast<short>(eOldMiddleMouse) )
752  {
753  pAppearanceCfg->SetMiddleMouseButton( static_cast<MouseMiddleButtonAction>(eNewMiddleMouse) );
754  bAppearanceChanged = true;
755  }
756 
757  if (m_xFontAntiAliasing->get_state_changed_from_saved())
758  {
759  pAppearanceCfg->SetFontAntiAliasing(m_xFontAntiAliasing->get_active());
760  bAppearanceChanged = true;
761  }
762 
763  if (m_xAAPointLimit->get_value_changed_from_saved())
764  {
765  pAppearanceCfg->SetFontAntialiasingMinPixelHeight(m_xAAPointLimit->get_value(FieldUnit::PIXEL));
766  bAppearanceChanged = true;
767  }
768 
769  if (m_xFontShowCB->get_state_changed_from_saved())
770  {
771  officecfg::Office::Common::Font::View::ShowFontBoxWYSIWYG::set(m_xFontShowCB->get_active(), xChanges);
772  bModified = true;
773  }
774 
775  if (m_xMenuIconsLB->get_value_changed_from_saved())
776  {
777  TriState eMenuIcons = m_xMenuIconsLB->get_active() == 0 ?
779  static_cast<TriState>(m_xMenuIconsLB->get_active() - 1);
780  // Output cache of current setting as possibly modified by System Theme for older version
782  officecfg::Office::Common::View::Menu::IsSystemIconsInMenus::set(eMenuIcons == TRISTATE_INDET, xChanges);
783  officecfg::Office::Common::View::Menu::ShowIconsInMenues::set(bMenuIcons, xChanges);
784  bModified = true;
785  bMenuOptModified = true;
786  bAppearanceChanged = true;
787  }
788 
789  if (m_xContextMenuShortcutsLB->get_value_changed_from_saved())
790  {
791  officecfg::Office::Common::View::Menu::ShortcutsInContextMenus::set(
792  m_xContextMenuShortcutsLB->get_active() == 0 ?
794  static_cast<TriState>(m_xContextMenuShortcutsLB->get_active() - 1),
795  xChanges);
796  bModified = true;
797  bMenuOptModified = true;
798  bAppearanceChanged = true;
799  }
800 
801  // #i95644# if disabled, do not use value, see in ::Reset()
802  if (m_xUseHardwareAccell->get_sensitive())
803  {
804  if(m_xUseHardwareAccell->get_state_changed_from_saved())
805  {
806  pCanvasSettings->EnabledHardwareAcceleration(m_xUseHardwareAccell->get_active());
807  bModified = true;
808  }
809  }
810 
811  // #i95644# if disabled, do not use value, see in ::Reset()
812  if (m_xUseAntiAliase->get_sensitive())
813  {
815  {
816  SvtOptionsDrawinglayer::SetAntiAliasing(m_xUseAntiAliase->get_active(), /*bTemporary*/false);
817  bModified = true;
818  bRepaintWindows = true;
819  }
820  }
821 
822  if (m_xUseSkia->get_state_changed_from_saved() ||
823  m_xForceSkiaRaster->get_state_changed_from_saved())
824  {
825  officecfg::Office::Common::VCL::UseSkia::set(m_xUseSkia->get_active(), xChanges);
826  officecfg::Office::Common::VCL::ForceSkiaRaster::set(m_xForceSkiaRaster->get_active(), xChanges);
827  bModified = true;
828  }
829 
830  xChanges->commit();
831 
832  if( bMenuOptModified )
833  {
834  // Set changed settings to the application instance
835  AllSettings aAllSettings = Application::GetSettings();
836  StyleSettings aStyleSettings = aAllSettings.GetStyleSettings();
837  aAllSettings.SetStyleSettings(aStyleSettings);
838  Application::MergeSystemSettings( aAllSettings );
839  Application::SetSettings(aAllSettings);
840  }
841 
842  if ( bAppearanceChanged )
843  {
844  pAppearanceCfg->Commit();
845  pAppearanceCfg->SetApplicationDefaults ( GetpApp() );
846  }
847 
848  if(bRepaintWindows)
849  {
851 
852  while(pAppWindow)
853  {
854  pAppWindow->Invalidate();
855  pAppWindow = Application::GetNextTopLevelWindow(pAppWindow);
856  }
857  }
858 
859  if (m_xUseSkia->get_state_changed_from_saved() ||
860  m_xForceSkiaRaster->get_state_changed_from_saved())
861  {
862  SolarMutexGuard aGuard;
866  GetDialogController()->response(RET_OK);
867  }
868 
869  return bModified;
870 }
871 
873 {
874  SvtMiscOptions aMiscOptions;
875 
876  if (aMiscOptions.GetSymbolsSize() != SFX_SYMBOLS_SIZE_AUTO)
877  {
879 
880  if (aMiscOptions.GetSymbolsSize() == SFX_SYMBOLS_SIZE_LARGE)
882  else if (aMiscOptions.GetSymbolsSize() == SFX_SYMBOLS_SIZE_32)
884  }
886  m_xIconSizeLB->save_value();
887 
888  ToolBoxButtonSize eSidebarIconSize = static_cast<ToolBoxButtonSize>(officecfg::Office::Common::Misc::SidebarIconSize::get());
889  if( eSidebarIconSize == ToolBoxButtonSize::DontCare )
890  ; // do nothing
891  else if( eSidebarIconSize == ToolBoxButtonSize::Small )
893  else if( eSidebarIconSize == ToolBoxButtonSize::Large )
896  m_xSidebarIconSizeLB->save_value();
897  ToolBoxButtonSize eNotebookbarIconSize = static_cast<ToolBoxButtonSize>(officecfg::Office::Common::Misc::NotebookbarIconSize::get());
898  if( eNotebookbarIconSize == ToolBoxButtonSize::DontCare )
899  ; // do nothing
900  else if( eNotebookbarIconSize == ToolBoxButtonSize::Small )
902  else if( eNotebookbarIconSize == ToolBoxButtonSize::Large )
905  m_xNotebookbarIconSizeLB->save_value();
906 
907  if (aMiscOptions.IconThemeWasSetAutomatically()) {
909  }
910  else {
911  const OUString& selected = aMiscOptions.GetIconTheme();
912  const vcl::IconThemeInfo& selectedInfo =
914  nStyleLB_InitialSelection = m_xIconStyleLB->find_text(selectedInfo.GetDisplayName());
915  }
916 
918  m_xIconStyleLB->save_value();
919 
920  // Mouse Snap
921  m_xMousePosLB->set_active(static_cast<sal_Int32>(pAppearanceCfg->GetSnapMode()));
922  m_xMousePosLB->save_value();
923 
924  // Mouse Snap
925  m_xMouseMiddleLB->set_active(static_cast<short>(pAppearanceCfg->GetMiddleMouseButton()));
926  m_xMouseMiddleLB->save_value();
927 
928  m_xFontAntiAliasing->set_active( pAppearanceCfg->IsFontAntiAliasing() );
929  m_xAAPointLimit->set_value(pAppearanceCfg->GetFontAntialiasingMinPixelHeight(), FieldUnit::PIXEL);
930 
931  // WorkingSet
932  m_xFontShowCB->set_active(officecfg::Office::Common::Font::View::ShowFontBoxWYSIWYG::get());
933  bool bMenuIcons = officecfg::Office::Common::View::Menu::ShowIconsInMenues::get();
934  bool bSystemMenuIcons = officecfg::Office::Common::View::Menu::IsSystemIconsInMenus::get();
935  TriState eMenuIcons = bSystemMenuIcons ? TRISTATE_INDET : static_cast<TriState>(bMenuIcons);
936  m_xMenuIconsLB->set_active(eMenuIcons == 2 ? 0 : eMenuIcons + 1);
937  m_xMenuIconsLB->save_value();
938 
939  TriState eContextMenuShortcuts = static_cast<TriState>(officecfg::Office::Common::View::Menu::ShortcutsInContextMenus::get());
940  bool bContextMenuShortcutsNonDefault = eContextMenuShortcuts == TRISTATE_FALSE || eContextMenuShortcuts == TRISTATE_TRUE;
941  m_xContextMenuShortcutsLB->set_active(bContextMenuShortcutsNonDefault ? eContextMenuShortcuts + 1 : 0);
942  m_xContextMenuShortcutsLB->save_value();
943 
945  m_xUseHardwareAccell->save_state();
946 
947  { // #i95644# AntiAliasing
949  {
951  }
952  else
953  {
954  m_xUseAntiAliase->set_active(false);
955  m_xUseAntiAliase->set_sensitive(false);
956  }
957 
958  m_xUseAntiAliase->save_state();
959  }
960 
961  m_xUseSkia->set_active(officecfg::Office::Common::VCL::UseSkia::get());
962  m_xForceSkiaRaster->set_active(officecfg::Office::Common::VCL::ForceSkiaRaster::get());
963  m_xUseSkia->save_state();
964  m_xForceSkiaRaster->save_state();
965 
966  m_xFontAntiAliasing->save_state();
967  m_xAAPointLimit->save_value();
968  m_xFontShowCB->save_state();
969 
970  OnAntialiasingToggled(*m_xFontAntiAliasing);
972 }
973 
975 {
976  // #i95644# HW accel (unified to disable mechanism)
977  if(pCanvasSettings->IsHardwareAccelerationAvailable())
978  {
979  m_xUseHardwareAccell->set_active(pCanvasSettings->IsHardwareAccelerationEnabled());
980  m_xUseHardwareAccell->set_sensitive(!pCanvasSettings->IsHardwareAccelerationRO());
981  }
982  else
983  {
984  m_xUseHardwareAccell->set_active(false);
985  m_xUseHardwareAccell->set_sensitive(false);
986  }
987 #if HAVE_FEATURE_SKIA
988  m_xUseHardwareAccell->set_sensitive(!m_xUseSkia->get_active());
989 #endif
990 }
991 
993 {
997 };
998 
999 static bool bLanguageCurrentDoc_Impl = false;
1000 
1001 // some things we'll need...
1002 constexpr OUStringLiteral sAccessSrvc = u"com.sun.star.configuration.ConfigurationAccess";
1003 constexpr OUStringLiteral sAccessUpdSrvc = u"com.sun.star.configuration.ConfigurationUpdateAccess";
1004 constexpr OUStringLiteral sInstalledLocalesPath = u"org.openoffice.Setup/Office/InstalledLocales";
1005 constexpr OUStringLiteral sUserLocalePath = u"org.openoffice.Office.Linguistic/General";
1006 constexpr OUStringLiteral sUserLocaleKey = u"UILocale";
1008 
1009 static OUString lcl_getDatePatternsConfigString( const LocaleDataWrapper& rLocaleWrapper )
1010 {
1011  Sequence< OUString > aDateAcceptancePatterns = rLocaleWrapper.getDateAcceptancePatterns();
1012  sal_Int32 nPatterns = aDateAcceptancePatterns.getLength();
1013  OUStringBuffer aBuf( nPatterns * 6 ); // 6 := length of Y-M-D;
1014  SAL_WARN_IF( !nPatterns, "cui.options", "No date acceptance pattern");
1015  if (nPatterns)
1016  {
1017  const OUString* pPatterns = aDateAcceptancePatterns.getConstArray();
1018  aBuf.append( pPatterns[0]);
1019  for (sal_Int32 i=1; i < nPatterns; ++i)
1020  aBuf.append(';').append( pPatterns[i]);
1021  }
1022  return aBuf.makeStringAndClear();
1023 }
1024 
1025 namespace
1026 {
1027  //what ui language will be selected by default if the user override of General::UILocale is unset ?
1028  LanguageTag GetInstalledLocaleForSystemUILanguage()
1029  {
1030  css::uno::Sequence<OUString> inst(officecfg::Setup::Office::InstalledLocales::get()->getElementNames());
1032  }
1033 }
1034 
1036  : SfxTabPage(pPage, pController, "cui/ui/optlanguagespage.ui", "OptLanguagesPage", &rSet)
1037  , pLangConfig(new LanguageConfig_Impl)
1038  , m_bDatePatternsValid(false)
1039  , m_xUserInterfaceLB(m_xBuilder->weld_combo_box("userinterface"))
1040  , m_xLocaleSettingFT(m_xBuilder->weld_label("localesettingFT"))
1041  , m_xLocaleSettingLB(new SvxLanguageBox(m_xBuilder->weld_combo_box("localesetting")))
1042  , m_xDecimalSeparatorCB(m_xBuilder->weld_check_button("decimalseparator"))
1043  , m_xCurrencyFT(m_xBuilder->weld_label("defaultcurrency"))
1044  , m_xCurrencyLB(m_xBuilder->weld_combo_box("currencylb"))
1045  , m_xDatePatternsFT(m_xBuilder->weld_label("dataaccpatterns"))
1046  , m_xDatePatternsED(m_xBuilder->weld_entry("datepatterns"))
1047  , m_xWesternLanguageLB(new SvxLanguageBox(m_xBuilder->weld_combo_box("westernlanguage")))
1048  , m_xWesternLanguageFT(m_xBuilder->weld_label("western"))
1049  , m_xAsianLanguageLB(new SvxLanguageBox(m_xBuilder->weld_combo_box("asianlanguage")))
1050  , m_xComplexLanguageLB(new SvxLanguageBox(m_xBuilder->weld_combo_box("complexlanguage")))
1051  , m_xCurrentDocCB(m_xBuilder->weld_check_button("currentdoc"))
1052  , m_xAsianSupportCB(m_xBuilder->weld_check_button("asiansupport"))
1053  , m_xCTLSupportCB(m_xBuilder->weld_check_button("ctlsupport"))
1054  , m_xIgnoreLanguageChangeCB(m_xBuilder->weld_check_button("ignorelanguagechange"))
1055 {
1056  // tdf#125483 save original default label
1058 
1059  // initialize user interface language selection
1061 
1062  OUString aUILang = m_sSystemDefaultString +
1063  " - " +
1064  SvtLanguageTable::GetLanguageString(GetInstalledLocaleForSystemUILanguage().getLanguageType());
1065 
1066  m_xUserInterfaceLB->append("0", aUILang);
1067  m_xUserInterfaceLB->append_separator("");
1068  try
1069  {
1070  Reference< XMultiServiceFactory > theConfigProvider(
1071  css::configuration::theDefaultProvider::get(
1073  Sequence< Any > theArgs(1);
1074  Reference< XNameAccess > theNameAccess;
1075 
1076  // find out which locales are currently installed and add them to the listbox
1077  theArgs[0] <<= NamedValue("nodepath", Any(OUString(sInstalledLocalesPath)));
1078  theNameAccess.set(
1079  theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs ), UNO_QUERY_THROW );
1080  seqInstalledLanguages = theNameAccess->getElementNames();
1082  std::vector< std::pair<sal_Int32, OUString> > aUILanguages;
1083  for (sal_Int32 i=0; i<seqInstalledLanguages.getLength(); i++)
1084  {
1085  aLang = LanguageTag::convertToLanguageTypeWithFallback(seqInstalledLanguages[i]);
1086  if (aLang != LANGUAGE_DONTKNOW)
1087  {
1088  OUString aLangStr( SvtLanguageTable::GetLanguageString( aLang ) );
1089  aUILanguages.emplace_back(i+1, aLangStr);
1090  }
1091  }
1092 
1093  std::sort(aUILanguages.begin(), aUILanguages.end(), [](const auto& l1, const auto& l2) {
1094  static const auto aSorter = comphelper::string::NaturalStringSorter(
1096  Application::GetSettings().GetLanguageTag().getLocale());
1097  return aSorter.compare(l1.second, l2.second) < 0;
1098  });
1099 
1100  // tdf#114694: append the sorted list after the default entry and separator.
1101  for (const auto & [ nGroupID, sGroupName ] : aUILanguages)
1102  {
1103  m_xUserInterfaceLB->append(OUString::number(nGroupID), sGroupName);
1104  }
1105 
1106  m_xUserInterfaceLB->set_active(0);
1107 
1108  // find out whether the user has a specific locale specified
1109  Sequence< Any > theArgs2(1);
1110  theArgs2[0] <<= NamedValue("nodepath", Any(OUString(sUserLocalePath)));
1111  theNameAccess.set(
1112  theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs2 ), UNO_QUERY_THROW );
1113  if (theNameAccess->hasByName(sUserLocaleKey))
1114  theNameAccess->getByName(sUserLocaleKey) >>= m_sUserLocaleValue;
1115  // select the user specified locale in the listbox
1116  if (!m_sUserLocaleValue.isEmpty())
1117  {
1118  for (sal_Int32 i = 0, nEntryCount = m_xUserInterfaceLB->get_count(); i < nEntryCount; ++i)
1119  {
1120  sal_Int32 d = m_xUserInterfaceLB->get_id(i).toInt32();
1121  if ( d > 0 && seqInstalledLanguages.getLength() > d-1 && seqInstalledLanguages[d-1] == m_sUserLocaleValue)
1122  m_xUserInterfaceLB->set_active(i);
1123  }
1124  }
1125 
1126  }
1127  catch (const Exception &)
1128  {
1129  // we'll just leave the box in its default setting and won't
1130  // even give it event handler...
1131  TOOLS_WARN_EXCEPTION("cui.options", "ignoring" );
1132  }
1133 
1134  m_xWesternLanguageLB->SetLanguageList(
1135  SvxLanguageListFlags::WESTERN | SvxLanguageListFlags::ONLY_KNOWN, true, false, true, true,
1136  LANGUAGE_SYSTEM, css::i18n::ScriptType::LATIN);
1137 
1138  m_xAsianLanguageLB->SetLanguageList(
1139  SvxLanguageListFlags::CJK | SvxLanguageListFlags::ONLY_KNOWN, true, false, true, true,
1140  LANGUAGE_SYSTEM, css::i18n::ScriptType::ASIAN);
1141 
1142  m_xComplexLanguageLB->SetLanguageList(
1143  SvxLanguageListFlags::CTL | SvxLanguageListFlags::ONLY_KNOWN, true, false, true, true,
1144  LANGUAGE_SYSTEM, css::i18n::ScriptType::COMPLEX);
1145 
1146  m_xLocaleSettingLB->SetLanguageList(
1147  SvxLanguageListFlags::ALL | SvxLanguageListFlags::ONLY_KNOWN, false, false, false, true,
1148  LANGUAGE_USER_SYSTEM_CONFIG, css::i18n::ScriptType::WEAK);
1149 
1151  const NfCurrencyEntry& rCurr = SvNumberFormatter::GetCurrencyEntry( LANGUAGE_SYSTEM );
1152  // insert SYSTEM entry
1153  OUString aDefaultCurr = m_sSystemDefaultString + " - " + rCurr.GetBankSymbol();
1154  m_xCurrencyLB->append("default", aDefaultCurr);
1155  m_xCurrencyLB->append_separator("");
1156 
1157  assert(m_xCurrencyLB->find_id("default") != -1);
1158  // all currencies
1159  OUString aTwoSpace( " " );
1160  sal_uInt16 nCurrCount = rCurrTab.size();
1161  std::vector< const NfCurrencyEntry* > aCurrencies;
1162  // first entry is SYSTEM, skip it
1163  for ( sal_uInt16 j=1; j < nCurrCount; ++j )
1164  {
1165  aCurrencies.push_back(&rCurrTab[j]);
1166  }
1167  std::sort(aCurrencies.begin(), aCurrencies.end(),
1168  [](const NfCurrencyEntry* c1, const NfCurrencyEntry* c2) {
1169  return c1->GetBankSymbol().compareTo(c2->GetBankSymbol()) < 0;
1170  });
1171 
1172  for (auto &v : aCurrencies)
1173  {
1174  OUString aStr_ = v->GetBankSymbol() +
1175  aTwoSpace +
1176  v->GetSymbol();
1177  aStr_ = ApplyLreOrRleEmbedding( aStr_ ) +
1178  aTwoSpace +
1179  ApplyLreOrRleEmbedding( SvtLanguageTable::GetLanguageString( v->GetLanguage() ) );
1180  m_xCurrencyLB->append(OUString::number(reinterpret_cast<sal_Int64>(v)), aStr_);
1181  }
1182 
1183  m_xCurrencyLB->set_active(0);
1184 
1185  m_xLocaleSettingLB->connect_changed( LINK( this, OfaLanguagesTabPage, LocaleSettingHdl ) );
1186  m_xDatePatternsED->connect_changed( LINK( this, OfaLanguagesTabPage, DatePatternsHdl ) );
1187 
1188  Link<weld::Toggleable&,void> aLink( LINK( this, OfaLanguagesTabPage, SupportHdl ) );
1189  m_xAsianSupportCB->connect_toggled( aLink );
1190  m_xCTLSupportCB->connect_toggled( aLink );
1191 
1193  m_xAsianSupportCB->set_active(m_bOldAsian);
1194  m_xAsianSupportCB->save_state();
1196  m_xAsianSupportCB->set_sensitive(!bReadonly);
1197  SupportHdl(*m_xAsianSupportCB);
1198 
1199  m_bOldCtl = pLangConfig->aCTLLanguageOptions.IsCTLFontEnabled();
1200  m_xCTLSupportCB->set_active(m_bOldCtl);
1201  m_xCTLSupportCB->save_state();
1202  bReadonly = pLangConfig->aCTLLanguageOptions.IsReadOnly(SvtCTLOptions::E_CTLFONT);
1203  m_xCTLSupportCB->set_sensitive(!bReadonly);
1204  SupportHdl(*m_xCTLSupportCB);
1205 
1206  m_xIgnoreLanguageChangeCB->set_active( pLangConfig->aSysLocaleOptions.IsIgnoreLanguageChange() );
1207 }
1208 
1210 {
1211 }
1212 
1213 std::unique_ptr<SfxTabPage> OfaLanguagesTabPage::Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet )
1214 {
1215  return std::make_unique<OfaLanguagesTabPage>(pPage, pController, *rAttrSet);
1216 }
1217 
1218 static void lcl_Update(std::unique_ptr<SfxVoidItem> pInvalidItems[], std::unique_ptr<SfxBoolItem> pBoolItems[], sal_uInt16 nCount)
1219 {
1220  SfxViewFrame* pCurrentFrm = SfxViewFrame::Current();
1221  SfxViewFrame* pViewFrm = SfxViewFrame::GetFirst();
1222  while(pViewFrm)
1223  {
1224  SfxBindings& rBind = pViewFrm->GetBindings();
1225  for(sal_uInt16 i = 0; i < nCount; i++)
1226  {
1227  if(pCurrentFrm == pViewFrm)
1228  rBind.InvalidateAll(false);
1229  rBind.SetState( *pInvalidItems[i] );
1230  rBind.SetState( *pBoolItems[i] );
1231  }
1232  pViewFrm = SfxViewFrame::GetNext(*pViewFrm);
1233  }
1234 }
1235 
1237 {
1238  // lock configuration broadcasters so that we can coordinate the notifications
1239  pLangConfig->aSysLocaleOptions.BlockBroadcasts( true );
1240  pLangConfig->aCTLLanguageOptions.BlockBroadcasts( true );
1241  pLangConfig->aLinguConfig.BlockBroadcasts( true );
1242 
1243  /*
1244  * Sequence checking only matters when CTL support is enabled.
1245  *
1246  * So we only need to check for sequence checking if
1247  * a) previously it was unchecked and is now checked or
1248  * b) it was already checked but the CTL language has changed
1249  */
1250  if (
1251  m_xCTLSupportCB->get_active() &&
1252  (m_xCTLSupportCB->get_saved_state() != TRISTATE_TRUE ||
1253  m_xComplexLanguageLB->get_active_id_changed_from_saved())
1254  )
1255  {
1256  //sequence checking has to be switched on depending on the selected CTL language
1257  LanguageType eCTLLang = m_xComplexLanguageLB->get_active_id();
1258  bool bOn = MsLangId::needsSequenceChecking( eCTLLang);
1259  pLangConfig->aCTLLanguageOptions.SetCTLSequenceCheckingRestricted(bOn);
1260  pLangConfig->aCTLLanguageOptions.SetCTLSequenceChecking(bOn);
1261  pLangConfig->aCTLLanguageOptions.SetCTLSequenceCheckingTypeAndReplace(bOn);
1262  }
1263  try
1264  {
1265  // handle settings for UI Language
1266  // a change of setting needs to bring up a warning message
1267  OUString aLangString;
1268  sal_Int32 d = m_xUserInterfaceLB->get_active_id().toInt32();
1269  if( d > 0 && seqInstalledLanguages.getLength() > d-1)
1270  aLangString = seqInstalledLanguages[d-1];
1271 
1272  /*
1273  if( m_xUserInterfaceLB->GetSelectedEntryPos() > 0)
1274  aLangString = ConvertLanguageToIsoString(m_xUserInterfaceLB->get_active_id());
1275  */
1276  Reference< XMultiServiceFactory > theConfigProvider(
1277  css::configuration::theDefaultProvider::get(
1279  Sequence< Any > theArgs(1);
1280  theArgs[0] <<= NamedValue("nodepath", Any(OUString(sUserLocalePath)));
1282  theConfigProvider->createInstanceWithArguments(sAccessUpdSrvc, theArgs ), UNO_QUERY_THROW );
1283  if ( m_sUserLocaleValue != aLangString)
1284  {
1285  // OSL_FAIL("UserInterface language was changed, restart.");
1286  // write new value
1287  xProp->setPropertyValue(sUserLocaleKey, Any(aLangString));
1288  Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges();
1289  // display info
1290  SolarMutexGuard aGuard;
1294  GetDialogController()->response(RET_OK);
1295 
1296  // tell quickstarter to stop being a veto listener
1297 
1300  css::office::Quickstart::createAndSetVeto(xContext, false, false, false/*DisableVeto*/);
1301  }
1302  }
1303  catch (const Exception&)
1304  {
1305  // we'll just leave the box in its default setting and won't
1306  // even give it event handler...
1307  TOOLS_WARN_EXCEPTION("cui.options", "ignoring");
1308  }
1309 
1310  LanguageTag aLanguageTag( pLangConfig->aSysLocaleOptions.GetLanguageTag());
1311  LanguageType eOldLocale = (aLanguageTag.isSystemLocale() ? LANGUAGE_SYSTEM :
1312  aLanguageTag.makeFallback().getLanguageType());
1313  LanguageType eNewLocale = m_xLocaleSettingLB->get_active_id();
1314 
1315  // If the "Default ..." entry was selected that means SYSTEM, the actual
1316  // eNewLocale value is temporary for the dialog only, do not resolve to
1317  // what system currently is.
1318  if (eNewLocale == LANGUAGE_USER_SYSTEM_CONFIG)
1319  eNewLocale = LANGUAGE_SYSTEM;
1320 
1321  if ( eOldLocale != eNewLocale )
1322  {
1323  // an empty string denotes SYSTEM locale
1324  OUString sNewLang;
1325  if ( eNewLocale != LANGUAGE_SYSTEM )
1326  sNewLang = LanguageTag::convertToBcp47( eNewLocale);
1327 
1328  // locale nowadays get to AppSettings via notification
1329  // this will happen after releasing the lock on the ConfigurationBroadcaster at
1330  // the end of this method
1331  pLangConfig->aSysLocaleOptions.SetLocaleConfigString( sNewLang );
1332  rSet->Put( SfxBoolItem( SID_OPT_LOCALE_CHANGED, true ) );
1333 
1335  bool bNewCJK = bool( nNewType & SvtScriptType::ASIAN );
1336  SvtCompatibilityOptions aCompatOpts;
1338  }
1339 
1340  if(m_xDecimalSeparatorCB->get_state_changed_from_saved())
1341  pLangConfig->aSysLocaleOptions.SetDecimalSeparatorAsLocale(m_xDecimalSeparatorCB->get_active());
1342 
1343  if(m_xIgnoreLanguageChangeCB->get_state_changed_from_saved())
1344  pLangConfig->aSysLocaleOptions.SetIgnoreLanguageChange(m_xIgnoreLanguageChangeCB->get_active());
1345 
1346  // Configured currency, for example, USD-en-US or EUR-de-DE, or empty for locale default.
1347  OUString sOldCurr = pLangConfig->aSysLocaleOptions.GetCurrencyConfigString();
1348  OUString sId = m_xCurrencyLB->get_active_id();
1349  const NfCurrencyEntry* pCurr = sId == "default" ? nullptr : reinterpret_cast<const NfCurrencyEntry*>(sId.toInt64());
1350  OUString sNewCurr;
1351  if ( pCurr )
1353  pCurr->GetBankSymbol(), pCurr->GetLanguage() );
1354  if ( sOldCurr != sNewCurr )
1355  pLangConfig->aSysLocaleOptions.SetCurrencyConfigString( sNewCurr );
1356 
1357  // Configured date acceptance patterns, for example Y-M-D;M-D or empty for
1358  // locale default.
1359  if (m_bDatePatternsValid && m_xDatePatternsED->get_value_changed_from_saved())
1360  pLangConfig->aSysLocaleOptions.SetDatePatternsConfigString( m_xDatePatternsED->get_text());
1361 
1362  SfxObjectShell* pCurrentDocShell = SfxObjectShell::Current();
1363  Reference< css::linguistic2::XLinguProperties > xLinguProp = LinguMgr::GetLinguPropertySet();
1364  bool bCurrentDocCBChecked = m_xCurrentDocCB->get_active();
1365  if (m_xCurrentDocCB->get_sensitive())
1366  bLanguageCurrentDoc_Impl = bCurrentDocCBChecked;
1367  bool bCurrentDocCBChanged = m_xCurrentDocCB->get_state_changed_from_saved();
1368 
1369  bool bValChanged = m_xWesternLanguageLB->get_active_id_changed_from_saved();
1370  if( (bCurrentDocCBChanged && !bCurrentDocCBChecked) || bValChanged)
1371  {
1372  LanguageType eSelectLang = m_xWesternLanguageLB->get_active_id();
1373  if(!bCurrentDocCBChecked)
1374  {
1375  Any aValue;
1376  Locale aLocale = LanguageTag::convertToLocale( eSelectLang, false);
1377  aValue <<= aLocale;
1378  pLangConfig->aLinguConfig.SetProperty( "DefaultLocale", aValue );
1379  if (xLinguProp.is())
1380  xLinguProp->setDefaultLocale( aLocale );
1381  }
1382  if(pCurrentDocShell)
1383  {
1384  rSet->Put(SvxLanguageItem(MsLangId::resolveSystemLanguageByScriptType(eSelectLang, css::i18n::ScriptType::LATIN),
1385  SID_ATTR_LANGUAGE));
1386  }
1387  }
1388  bValChanged = m_xAsianLanguageLB->get_active_id_changed_from_saved();
1389  if( (bCurrentDocCBChanged && !bCurrentDocCBChecked) || bValChanged)
1390  {
1391  LanguageType eSelectLang = m_xAsianLanguageLB->get_active_id();
1392  if(!bCurrentDocCBChecked)
1393  {
1394  Any aValue;
1395  Locale aLocale = LanguageTag::convertToLocale( eSelectLang, false);
1396  aValue <<= aLocale;
1397  pLangConfig->aLinguConfig.SetProperty( "DefaultLocale_CJK", aValue );
1398  if (xLinguProp.is())
1399  xLinguProp->setDefaultLocale_CJK( aLocale );
1400  }
1401  if(pCurrentDocShell)
1402  {
1403  rSet->Put(SvxLanguageItem(MsLangId::resolveSystemLanguageByScriptType(eSelectLang, css::i18n::ScriptType::ASIAN),
1404  SID_ATTR_CHAR_CJK_LANGUAGE));
1405  }
1406  }
1407  bValChanged = m_xComplexLanguageLB->get_active_id_changed_from_saved();
1408  if( (bCurrentDocCBChanged && !bCurrentDocCBChecked) || bValChanged)
1409  {
1410  LanguageType eSelectLang = m_xComplexLanguageLB->get_active_id();
1411  if(!bCurrentDocCBChecked)
1412  {
1413  Any aValue;
1414  Locale aLocale = LanguageTag::convertToLocale( eSelectLang, false);
1415  aValue <<= aLocale;
1416  pLangConfig->aLinguConfig.SetProperty( "DefaultLocale_CTL", aValue );
1417  if (xLinguProp.is())
1418  xLinguProp->setDefaultLocale_CTL( aLocale );
1419  }
1420  if(pCurrentDocShell)
1421  {
1422  rSet->Put(SvxLanguageItem(MsLangId::resolveSystemLanguageByScriptType(eSelectLang, css::i18n::ScriptType::COMPLEX),
1423  SID_ATTR_CHAR_CTL_LANGUAGE));
1424  }
1425  }
1426 
1427  if(m_xAsianSupportCB->get_state_changed_from_saved() )
1428  {
1429  bool bChecked = m_xAsianSupportCB->get_active();
1430  SvtCJKOptions::SetAll(bChecked);
1431 
1432  //iterate over all bindings to invalidate vertical text direction
1433  const sal_uInt16 STATE_COUNT = 2;
1434 
1435  std::unique_ptr<SfxBoolItem> pBoolItems[STATE_COUNT];
1436  pBoolItems[0].reset(new SfxBoolItem(SID_VERTICALTEXT_STATE, false));
1437  pBoolItems[1].reset(new SfxBoolItem(SID_TEXT_FITTOSIZE_VERTICAL, false));
1438 
1439  std::unique_ptr<SfxVoidItem> pInvalidItems[STATE_COUNT];
1440  pInvalidItems[0].reset(new SfxVoidItem(SID_VERTICALTEXT_STATE));
1441  pInvalidItems[1].reset(new SfxVoidItem(SID_TEXT_FITTOSIZE_VERTICAL));
1442 
1443  lcl_Update(pInvalidItems, pBoolItems, STATE_COUNT);
1444  }
1445 
1446  if ( m_xCTLSupportCB->get_state_changed_from_saved() )
1447  {
1448  SvtSearchOptions aOpt;
1449  aOpt.SetIgnoreDiacritics_CTL(true);
1450  aOpt.SetIgnoreKashida_CTL(true);
1451  aOpt.Commit();
1452  pLangConfig->aCTLLanguageOptions.SetCTLFontEnabled( m_xCTLSupportCB->get_active() );
1453 
1454  const sal_uInt16 STATE_COUNT = 1;
1455  std::unique_ptr<SfxBoolItem> pBoolItems[STATE_COUNT];
1456  pBoolItems[0].reset(new SfxBoolItem(SID_CTLFONT_STATE, false));
1457  std::unique_ptr<SfxVoidItem> pInvalidItems[STATE_COUNT];
1458  pInvalidItems[0].reset(new SfxVoidItem(SID_CTLFONT_STATE));
1459  lcl_Update(pInvalidItems, pBoolItems, STATE_COUNT);
1460  }
1461 
1462  if ( pLangConfig->aSysLocaleOptions.IsModified() )
1463  pLangConfig->aSysLocaleOptions.Commit();
1464 
1465  // first release the lock on the ConfigurationBroadcaster for Locale changes
1466  // it seems that our code relies on the fact that before other changes like e.g. currency
1467  // are broadcasted locale changes have been done
1468  pLangConfig->aSysLocaleOptions.BlockBroadcasts( false );
1469  pLangConfig->aCTLLanguageOptions.BlockBroadcasts( false );
1470  pLangConfig->aLinguConfig.BlockBroadcasts( false );
1471 
1472  return false;
1473 }
1474 
1476 {
1477  LanguageTag aLanguageTag( pLangConfig->aSysLocaleOptions.GetLanguageTag());
1478  if ( aLanguageTag.isSystemLocale() )
1480  else
1481  m_xLocaleSettingLB->set_active_id( aLanguageTag.makeFallback().getLanguageType());
1482  bool bReadonly = pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::EOption::Locale);
1483  m_xLocaleSettingLB->set_sensitive(!bReadonly);
1484  m_xLocaleSettingFT->set_sensitive(!bReadonly);
1485 
1486 
1487  m_xDecimalSeparatorCB->set_active( pLangConfig->aSysLocaleOptions.IsDecimalSeparatorAsLocale());
1488  m_xDecimalSeparatorCB->save_state();
1489 
1490  m_xIgnoreLanguageChangeCB->set_active( pLangConfig->aSysLocaleOptions.IsIgnoreLanguageChange());
1491  m_xIgnoreLanguageChangeCB->save_state();
1492 
1493  // let LocaleSettingHdl enable/disable checkboxes for CJK/CTL support
1494  // #i15812# must be done *before* the configured currency is set
1495  // and update the decimal separator used for the given locale
1496  LocaleSettingHdl(*m_xLocaleSettingLB->get_widget());
1497 
1498  // configured currency, for example, USD-en-US or EUR-de-DE, or empty for locale default
1499  const NfCurrencyEntry* pCurr = nullptr;
1500  OUString sCurrency = pLangConfig->aSysLocaleOptions.GetCurrencyConfigString();
1501  if ( !sCurrency.isEmpty() )
1502  {
1503  LanguageType eLang;
1504  OUString aAbbrev;
1505  SvtSysLocaleOptions::GetCurrencyAbbrevAndLanguage( aAbbrev, eLang, sCurrency );
1506  pCurr = SvNumberFormatter::GetCurrencyEntry( aAbbrev, eLang );
1507  }
1508  // if pCurr==nullptr the SYSTEM entry is selected
1509  OUString sId = !pCurr ? OUString("default") : OUString::number(reinterpret_cast<sal_Int64>(pCurr));
1510  m_xCurrencyLB->set_active_id(sId);
1511  bReadonly = pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::EOption::Currency);
1512  m_xCurrencyLB->set_sensitive(!bReadonly);
1513  m_xCurrencyFT->set_sensitive(!bReadonly);
1514 
1515  // date acceptance patterns
1516  OUString aDatePatternsString = pLangConfig->aSysLocaleOptions.GetDatePatternsConfigString();
1517  if (aDatePatternsString.isEmpty())
1518  {
1520  aDatePatternsString = lcl_getDatePatternsConfigString( rLocaleWrapper);
1521  }
1522  // Let's assume patterns are valid at this point.
1523  m_bDatePatternsValid = true;
1524  m_xDatePatternsED->set_text(aDatePatternsString);
1525  bReadonly = pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::EOption::DatePatterns);
1526  m_xDatePatternsED->set_sensitive(!bReadonly);
1527  m_xDatePatternsFT->set_sensitive(!bReadonly);
1528  m_xDatePatternsED->save_value();
1529 
1530  //western/CJK/CLK language
1531  LanguageType eCurLang = LANGUAGE_NONE;
1532  LanguageType eCurLangCJK = LANGUAGE_NONE;
1533  LanguageType eCurLangCTL = LANGUAGE_NONE;
1534  SfxObjectShell* pCurrentDocShell = SfxObjectShell::Current();
1535  //collect the configuration values first
1536  m_xCurrentDocCB->set_sensitive(false);
1537 
1538  Any aWestLang;
1539  Any aCJKLang;
1540  Any aCTLLang;
1541  try
1542  {
1543  aWestLang = pLangConfig->aLinguConfig.GetProperty("DefaultLocale");
1544  Locale aLocale;
1545  aWestLang >>= aLocale;
1546 
1547  eCurLang = LanguageTag::convertToLanguageType( aLocale, false);
1548 
1549  aCJKLang = pLangConfig->aLinguConfig.GetProperty("DefaultLocale_CJK");
1550  aLocale = Locale();
1551  aCJKLang >>= aLocale;
1552  eCurLangCJK = LanguageTag::convertToLanguageType( aLocale, false);
1553 
1554  aCTLLang = pLangConfig->aLinguConfig.GetProperty("DefaultLocale_CTL");
1555  aLocale = Locale();
1556  aCTLLang >>= aLocale;
1557  eCurLangCTL = LanguageTag::convertToLanguageType( aLocale, false);
1558  }
1559  catch (const Exception&)
1560  {
1561  }
1562  //overwrite them by the values provided by the DocShell
1563  if(pCurrentDocShell)
1564  {
1565  m_xCurrentDocCB->set_sensitive(true);
1566  m_xCurrentDocCB->set_active(bLanguageCurrentDoc_Impl);
1567  const SfxPoolItem* pLang;
1568  if( SfxItemState::SET == rSet->GetItemState(SID_ATTR_LANGUAGE, false, &pLang))
1569  {
1570  LanguageType eTempCurLang = static_cast<const SvxLanguageItem*>(pLang)->GetValue();
1571  if (MsLangId::resolveSystemLanguageByScriptType(eCurLang, css::i18n::ScriptType::LATIN) != eTempCurLang)
1572  eCurLang = eTempCurLang;
1573  }
1574 
1575  if( SfxItemState::SET == rSet->GetItemState(SID_ATTR_CHAR_CJK_LANGUAGE, false, &pLang))
1576  {
1577  LanguageType eTempCurLang = static_cast<const SvxLanguageItem*>(pLang)->GetValue();
1578  if (MsLangId::resolveSystemLanguageByScriptType(eCurLangCJK, css::i18n::ScriptType::ASIAN) != eTempCurLang)
1579  eCurLangCJK = eTempCurLang;
1580  }
1581 
1582  if( SfxItemState::SET == rSet->GetItemState(SID_ATTR_CHAR_CTL_LANGUAGE, false, &pLang))
1583  {
1584  LanguageType eTempCurLang = static_cast<const SvxLanguageItem*>(pLang)->GetValue();
1585  if (MsLangId::resolveSystemLanguageByScriptType(eCurLangCTL, css::i18n::ScriptType::COMPLEX) != eTempCurLang)
1586  eCurLangCTL = eTempCurLang;
1587  }
1588  }
1589  if(LANGUAGE_NONE == eCurLang || LANGUAGE_DONTKNOW == eCurLang)
1590  m_xWesternLanguageLB->set_active_id(LANGUAGE_NONE);
1591  else
1592  m_xWesternLanguageLB->set_active_id(eCurLang);
1593 
1594  if(LANGUAGE_NONE == eCurLangCJK || LANGUAGE_DONTKNOW == eCurLangCJK)
1595  m_xAsianLanguageLB->set_active_id(LANGUAGE_NONE);
1596  else
1597  m_xAsianLanguageLB->set_active_id(eCurLangCJK);
1598 
1599  if(LANGUAGE_NONE == eCurLangCTL || LANGUAGE_DONTKNOW == eCurLangCTL)
1600  m_xComplexLanguageLB->set_active_id(LANGUAGE_NONE);
1601  else
1602  m_xComplexLanguageLB->set_active_id(eCurLangCTL);
1603 
1604  m_xWesternLanguageLB->save_active_id();
1605  m_xAsianLanguageLB->save_active_id();
1606  m_xComplexLanguageLB->save_active_id();
1607  m_xIgnoreLanguageChangeCB->save_state();
1608  m_xCurrentDocCB->save_state();
1609 
1610  bool bEnable = !pLangConfig->aLinguConfig.IsReadOnly( "DefaultLocale" );
1611  m_xWesternLanguageFT->set_sensitive( bEnable );
1612  m_xWesternLanguageLB->set_sensitive( bEnable );
1613 
1614  // check the box "For the current document only"
1615  // set the focus to the Western Language box
1616  const SfxPoolItem* pLang = nullptr;
1617  if ( SfxItemState::SET == rSet->GetItemState(SID_SET_DOCUMENT_LANGUAGE, false, &pLang ) && static_cast<const SfxBoolItem*>(pLang)->GetValue() )
1618  {
1619  m_xWesternLanguageLB->grab_focus();
1620  m_xCurrentDocCB->set_sensitive(true);
1621  m_xCurrentDocCB->set_active(true);
1622  }
1623 }
1624 
1626 {
1627  bool bCheck = rBox.get_active();
1628  if ( m_xAsianSupportCB.get() == &rBox )
1629  {
1630  bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly("DefaultLocale_CJK");
1631  bCheck = ( bCheck && !bReadonly );
1632  m_xAsianLanguageLB->set_sensitive( bCheck );
1633  if (rBox.get_sensitive())
1634  m_bOldAsian = bCheck;
1635  }
1636  else if ( m_xCTLSupportCB.get() == &rBox )
1637  {
1638  bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly("DefaultLocale_CTL");
1639  bCheck = ( bCheck && !bReadonly );
1640  m_xComplexLanguageLB->set_sensitive( bCheck );
1641  if (rBox.get_sensitive())
1642  m_bOldCtl = bCheck;
1643  }
1644  else
1645  SAL_WARN( "cui.options", "OfaLanguagesTabPage::SupportHdl(): wrong rBox" );
1646 }
1647 
1648 namespace
1649 {
1650  void lcl_checkLanguageCheckBox(weld::CheckButton& _rCB, bool _bNewValue, bool _bOldValue)
1651  {
1652  if ( _bNewValue )
1653  _rCB.set_active(true);
1654  else
1655  _rCB.set_active( _bOldValue );
1656 // #i15082# do not call save_state() in running dialog...
1657 // _rCB.save_state();
1658  _rCB.set_sensitive( !_bNewValue );
1659  }
1660 }
1661 
1663 {
1664  LanguageType eLang = m_xLocaleSettingLB->get_active_id();
1666  // first check if CTL must be enabled
1667  // #103299# - if CTL font setting is not readonly
1668  if(!pLangConfig->aCTLLanguageOptions.IsReadOnly(SvtCTLOptions::E_CTLFONT))
1669  {
1670  bool bIsCTLFixed = bool(nType & SvtScriptType::COMPLEX);
1671  lcl_checkLanguageCheckBox(*m_xCTLSupportCB, bIsCTLFixed, m_bOldCtl);
1672  SupportHdl(*m_xCTLSupportCB);
1673  }
1674  // second check if CJK must be enabled
1675  // #103299# - if CJK support is not readonly
1677  {
1678  bool bIsCJKFixed = bool(nType & SvtScriptType::ASIAN);
1679  lcl_checkLanguageCheckBox(*m_xAsianSupportCB, bIsCJKFixed, m_bOldAsian);
1680  SupportHdl(*m_xAsianSupportCB);
1681  }
1682 
1683  const NfCurrencyEntry& rCurr = SvNumberFormatter::GetCurrencyEntry(
1685  const OUString aDefaultID = "default";
1686  // Update the "Default ..." currency.
1687  m_xCurrencyLB->remove_id(aDefaultID);
1688  OUString aDefaultCurr = m_sSystemDefaultString + " - " + rCurr.GetBankSymbol();
1689  m_xCurrencyLB->insert(0, aDefaultCurr, &aDefaultID, nullptr, nullptr);
1690  assert(m_xCurrencyLB->find_id(aDefaultID) != -1);
1691  m_xCurrencyLB->set_active_text(aDefaultCurr);
1692 
1693  // obtain corresponding locale data
1694  LanguageTag aLanguageTag( eLang);
1695  LocaleDataWrapper aLocaleWrapper( aLanguageTag );
1696 
1697  // update the decimal separator key of the related CheckBox
1698  OUString sTempLabel(m_sDecimalSeparatorLabel);
1699  sTempLabel = sTempLabel.replaceFirst("%1", aLocaleWrapper.getNumDecimalSep() );
1700  m_xDecimalSeparatorCB->set_label(sTempLabel);
1701 
1702  // update the date acceptance patterns
1703  OUString aDatePatternsString = lcl_getDatePatternsConfigString( aLocaleWrapper);
1704  m_bDatePatternsValid = true;
1705  m_xDatePatternsED->set_text( aDatePatternsString);
1706 }
1707 
1708 IMPL_LINK( OfaLanguagesTabPage, DatePatternsHdl, weld::Entry&, rEd, void )
1709 {
1710  const OUString aPatterns(rEd.get_text());
1711  OUStringBuffer aBuf( aPatterns);
1712  sal_Int32 nChar = 0;
1713  bool bValid = true;
1714  bool bModified = false;
1715  if (!aPatterns.isEmpty())
1716  {
1717  for (sal_Int32 nIndex=0; nIndex >= 0 && bValid; ++nChar)
1718  {
1719  const OUString aPat( aPatterns.getToken( 0, ';', nIndex));
1720  if (aPat.isEmpty() && nIndex < 0)
1721  {
1722  // Indicating failure when about to append a pattern is too
1723  // confusing. Empty patterns are ignored anyway when sequencing
1724  // to SvtSysLocale.
1725  continue; // for
1726  }
1727  else if (aPat.getLength() < 2)
1728  bValid = false;
1729  else
1730  {
1731  bool bY, bM, bD;
1732  bY = bM = bD = false;
1733  bool bSep = true;
1734  for (sal_Int32 i = 0; i < aPat.getLength() && bValid; /*nop*/)
1735  {
1736  const sal_Int32 j = i;
1737  const sal_uInt32 c = aPat.iterateCodePoints( &i);
1738  // Only one Y,M,D per pattern, separated by any character(s).
1739  switch (c)
1740  {
1741  case 'y':
1742  case 'Y':
1743  if (bY || !bSep)
1744  bValid = false;
1745  else if (c == 'y')
1746  {
1747  aBuf[nChar] = 'Y';
1748  bModified = true;
1749  }
1750  bY = true;
1751  bSep = false;
1752  break;
1753  case 'm':
1754  case 'M':
1755  if (bM || !bSep)
1756  bValid = false;
1757  else if (c == 'm')
1758  {
1759  aBuf[nChar] = 'M';
1760  bModified = true;
1761  }
1762  bM = true;
1763  bSep = false;
1764  break;
1765  case 'd':
1766  case 'D':
1767  if (bD || !bSep)
1768  bValid = false;
1769  else if (c == 'd')
1770  {
1771  aBuf[nChar] = 'D';
1772  bModified = true;
1773  }
1774  bD = true;
1775  bSep = false;
1776  break;
1777  default:
1778  // A pattern must not start with a separator (but
1779  // may end with).
1780  if (!(bY || bM || bD))
1781  bValid = false;
1782  bSep = true;
1783  }
1784  nChar += i-j;
1785  }
1786  // At least one of Y,M,D
1787  bValid &= (bY || bM || bD);
1788  }
1789  }
1790  }
1791  if (bModified)
1792  {
1793  // gtk3 keeps the cursor position on equal length set_text() but at
1794  // least the 'gen' backend does not and resets to 0.
1795  const int nCursorPos = rEd.get_position();
1796  rEd.set_text(aBuf.makeStringAndClear());
1797  rEd.set_position(nCursorPos);
1798  }
1799  if (bValid)
1800  rEd.set_message_type(weld::EntryMessageType::Normal);
1801  else
1802  rEd.set_message_type(weld::EntryMessageType::Error);
1803  m_bDatePatternsValid = bValid;
1804 }
1805 
1806 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr OUStringLiteral sAccessUpdSrvc
Definition: optgdlg.cxx:1003
#define LANGUAGE_NONE
std::unique_ptr< SvxLanguageBox > m_xComplexLanguageLB
Definition: optgdlg.hxx:161
virtual short run() override
FieldUnit
OfaMiscTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: optgdlg.cxx:153
sal_Int32 nIndex
IMPL_STATIC_LINK_NOARG(OfaViewTabPage, OnMoreIconsClick, weld::Button &, void)
Definition: optgdlg.cxx:595
void HideSkiaWidgets()
Definition: optgdlg.cxx:616
std::unique_ptr< weld::ComboBox > m_xIconStyleLB
Definition: optgdlg.hxx:91
IMPL_LINK(OfaLanguagesTabPage, SupportHdl, weld::Toggleable &, rBox, void)
Definition: optgdlg.cxx:1625
SvtSysLocaleOptions aSysLocaleOptions
Definition: optgdlg.cxx:995
ToolBoxButtonSize
std::unique_ptr< weld::Widget > m_xFileDlgROImage
Definition: optgdlg.hxx:39
void SetState(const SfxItemSet &rSet)
static const NfCurrencyEntry & GetCurrencyEntry(LanguageType)
static bool bLanguageCurrentDoc_Impl
Definition: optgdlg.cxx:999
std::string GetValue
static OUString CreateCurrencyConfigString(const OUString &rAbbrev, LanguageType eLang)
void SetStyleSettings(const StyleSettings &rSet)
std::unique_ptr< weld::SpinButton > m_xYearValueField
Definition: optgdlg.hxx:44
std::unique_ptr< weld::ComboBox > m_xIconSizeLB
Definition: optgdlg.hxx:88
constexpr OUStringLiteral sInstalledLocalesPath
Definition: optgdlg.cxx:1004
std::unique_ptr< weld::ComboBox > m_xMenuIconsLB
Definition: optgdlg.hxx:98
static LanguageType convertToLanguageType(const css::lang::Locale &rLocale, bool bResolveSystem=true)
std::unique_ptr< weld::Widget > m_xQuickStarterFrame
Definition: optgdlg.hxx:47
static OUString convertToBcp47(LanguageType nLangID)
std::unique_ptr< SvxLanguageBox > m_xLocaleSettingLB
Definition: optgdlg.hxx:151
const StyleSettings & GetStyleSettings() const
std::unique_ptr< weld::ComboBox > m_xNotebookbarIconSizeLB
Definition: optgdlg.hxx:90
static const AllSettings & GetSettings()
std::vector< vcl::IconThemeInfo > const & GetInstalledIconThemes() const
ServiceVector maAvailableImplementations
Definition: optgdlg.cxx:368
constexpr OUStringLiteral sUserLocalePath
Definition: optgdlg.cxx:1005
sal_uInt16 GetValue() const
aBuf
static LanguageType resolveSystemLanguageByScriptType(LanguageType nLang, sal_Int16 nType)
std::unique_ptr< weld::ComboBox > m_xSidebarIconSizeLB
Definition: optgdlg.hxx:89
static OUString lcl_getDatePatternsConfigString(const LocaleDataWrapper &rLocaleWrapper)
Definition: optgdlg.cxx:1009
sal_Int32 nStyleLB_InitialSelection
Definition: optgdlg.hxx:81
sal_Int16 GetSymbolsSize() const
std::unique_ptr< weld::CheckButton > m_xExtHelpCB
Definition: optgdlg.hxx:35
SvtLinguConfig aLinguConfig
Definition: optgdlg.cxx:996
static SfxObjectShell * Current()
void GetCurrencyAbbrevAndLanguage(OUString &rAbbrev, LanguageType &eLang) const
virtual ~OfaLanguagesTabPage() override
Definition: optgdlg.cxx:1209
static const NfCurrencyTable & GetTheCurrencyTable()
TRISTATE_TRUE
static void lcl_Update(std::unique_ptr< SfxVoidItem > pInvalidItems[], std::unique_ptr< SfxBoolItem > pBoolItems[], sal_uInt16 nCount)
Definition: optgdlg.cxx:1218
std::unique_ptr< weld::CheckButton > m_xFileDlgCB
Definition: optgdlg.hxx:40
std::unique_ptr< weld::MetricSpinButton > m_xAAPointLimit
Definition: optgdlg.hxx:95
bool IsHardwareAccelerationEnabled() const
Definition: optgdlg.cxx:470
std::unique_ptr< weld::CheckButton > m_xFontAntiAliasing
Definition: optgdlg.hxx:93
void SetAll(bool bSet)
void SetAntiAliasing(bool bOn, bool bTemporary)
static css::uno::Reference< css::linguistic2::XLinguProperties > GetLinguPropertySet()
SFX_SYMBOLS_SIZE_SMALL
std::unique_ptr< weld::Label > m_xCurrencyFT
Definition: optgdlg.hxx:153
OUString GetIconTheme() const
Reference< XNameAccess > m_xContainer
std::vector< std::pair< OUString, Sequence< OUString > > > ServiceVector
Definition: optgdlg.cxx:365
static LanguageType convertToLanguageTypeWithFallback(const OUString &rBcp47)
std::unique_ptr< weld::Label > m_xHelpImproveLabel
Definition: optgdlg.hxx:48
std::unique_ptr< weld::Label > m_xLocaleSettingFT
Definition: optgdlg.hxx:150
RESTART_REASON_LANGUAGE_CHANGE
std::unique_ptr< weld::CheckButton > m_xIgnoreLanguageChangeCB
Definition: optgdlg.hxx:165
std::unique_ptr< weld::ComboBox > m_xMousePosLB
Definition: optgdlg.hxx:112
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()
OUString m_aStrDateInfo
Definition: optgdlg.hxx:33
constexpr OUStringLiteral sUserLocaleKey
Definition: optgdlg.cxx:1006
bool IsHardwareAccelerationRO() const
Definition: optgdlg.cxx:482
static std::shared_ptr< ConfigurationChanges > create(css::uno::Reference< css::uno::XComponentContext > const &context=comphelper::getProcessComponentContext())
SvtCTLOptions aCTLLanguageOptions
Definition: optgdlg.cxx:994
OUString GetAutomaticallyChosenIconTheme() const
void EnabledHardwareAcceleration(bool _bEnabled) const
Definition: optgdlg.cxx:493
Application * GetpApp()
OfaViewTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: optgdlg.cxx:519
void SetIgnoreKashida_CTL(bool bVal)
double d
std::unique_ptr< weld::Widget > m_xYearFrame
Definition: optgdlg.hxx:43
TRISTATE_INDET
bool IsHardwareAccelerationAvailable() const
Definition: optgdlg.cxx:428
std::unique_ptr< weld::Label > m_xSkiaStatusDisabled
Definition: optgdlg.hxx:110
static vcl::Window * GetFirstTopLevelWindow()
std::unique_ptr< weld::Button > m_xMoreIcons
Definition: optgdlg.hxx:114
static LanguageType getSystemLanguage()
const SfxPoolItem * GetOldItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
SVT_DLLPUBLIC bool executeRestartDialog(css::uno::Reference< css::uno::XComponentContext > const &context, weld::Window *parent, RestartReason reason)
const OUString & getNumDecimalSep() const
std::unique_ptr< weld::CheckButton > m_xCurrentDocCB
Definition: optgdlg.hxx:162
std::unique_ptr< weld::ComboBox > m_xCurrencyLB
Definition: optgdlg.hxx:154
VCL_DLLPUBLIC void LaunchRegistrationUI()
SvtScriptType
void SetSymbolsSize(sal_Int16 eSet)
#define TOOLS_WARN_EXCEPTION(area, stream)
std::unique_ptr< weld::CheckButton > m_xForceSkiaRaster
Definition: optgdlg.hxx:107
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
int i
const css::uno::Sequence< OUString > & getDateAcceptancePatterns() const
std::unique_ptr< weld::Label > m_xWesternLanguageFT
Definition: optgdlg.hxx:159
css::uno::Sequence< css::uno::Any > InitAnyPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
#define LANGUAGE_SYSTEM
SFX_SYMBOLS_SIZE_AUTO
std::unique_ptr< weld::Label > m_xToYearFT
Definition: optgdlg.hxx:45
static void SetSettings(const AllSettings &rSettings)
std::unique_ptr< weld::CheckButton > m_xQuickLaunchCB
Definition: optgdlg.hxx:49
std::unique_ptr< weld::ComboBox > m_xMouseMiddleLB
Definition: optgdlg.hxx:113
std::unique_ptr< weld::CheckButton > m_xCrashReport
Definition: optgdlg.hxx:46
SfxBindings & GetBindings()
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: optgdlg.cxx:1213
TRISTATE_FALSE
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
Definition: optgdlg.hxx:160
static OUString GetToolkitName()
OUString ApplyLreOrRleEmbedding(const OUString &rText)
float u
Reference< XNameAccess > mxForceFlagNameAccess
Definition: optgdlg.cxx:367
SvtScriptType GetScriptTypeOfLanguage(LanguageType nLang)
#define LANGUAGE_DONTKNOW
const LocaleDataWrapper & GetLocaleDataWrapper(LanguageType nLang)
std::unique_ptr< weld::ComboBox > m_xContextMenuShortcutsLB
Definition: optgdlg.hxx:100
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: optgdlg.cxx:101
void UpdateHardwareAccelStatus()
Definition: optgdlg.cxx:974
static Sequence< OUString > seqInstalledLanguages
Definition: optgdlg.cxx:1007
std::unique_ptr< weld::Label > m_xDatePatternsFT
Definition: optgdlg.hxx:155
bool IconThemeWasSetAutomatically()
IMPL_LINK_NOARG(OfaMiscTabPage, TwoFigureHdl, weld::SpinButton &, void)
Definition: optgdlg.cxx:332
std::unique_ptr< SvtTabAppearanceCfg > pAppearanceCfg
Definition: optgdlg.hxx:83
static bool DisplayNameCompareLessThan(const vcl::IconThemeInfo &rInfo1, const vcl::IconThemeInfo &rInfo2)
Definition: optgdlg.cxx:514
constexpr OUStringLiteral sAccessSrvc
Definition: optgdlg.cxx:1002
static void MergeSystemSettings(AllSettings &rSettings)
const LanguageTag & getLocale()
float v
std::unique_ptr< weld::CheckButton > m_xUseHardwareAccell
Definition: optgdlg.hxx:104
bool IsReadOnly(EOption eOption)
OUString m_sSystemDefaultString
Definition: optgdlg.hxx:144
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
std::unique_ptr< weld::Label > m_xSkiaStatusEnabled
Definition: optgdlg.hxx:109
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optgdlg.cxx:217
Reference< XMultiServiceFactory > getProcessServiceFactory()
weld::Window * GetFrameWeld() const
#define LANGUAGE_USER_SYSTEM_CONFIG
static SfxViewFrame * Current()
VCL_DLLPUBLIC bool isVCLSkiaEnabled()
sal_Int32 nNotebookbarSizeLB_InitialSelection
Definition: optgdlg.hxx:80
SfxItemState
std::unique_ptr< weld::CheckButton > m_xUseAntiAliase
Definition: optgdlg.hxx:105
static vcl::Window * GetNextTopLevelWindow(vcl::Window const *pWindow)
OUString m_sDecimalSeparatorLabel
Definition: optgdlg.hxx:145
OUString getInstalledLocaleForSystemUILanguage(const css::uno::Sequence< OUString > &rLocaleElementNames, bool bRequestInstallIfMissing, const OUString &rPreferredLocale)
void UpdateSkiaStatus()
Definition: optgdlg.cxx:624
bool GetUseImagesInMenus() const
std::unique_ptr< weld::Button > m_xRunGPTests
Definition: optgdlg.hxx:115
#define SAL_WARN_IF(condition, area, stream)
std::unique_ptr< CanvasSettings > pCanvasSettings
Definition: optgdlg.hxx:84
bool mbHWAccelChecked
Definition: optgdlg.cxx:370
void SetIgnoreDiacritics_CTL(bool bVal)
std::unique_ptr< weld::CheckButton > m_xDocStatusCB
Definition: optgdlg.hxx:42
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optgdlg.cxx:667
SFX_SYMBOLS_SIZE_32
if(aStr!=aBuf) UpdateName_Impl(m_xFollowLb.get()
RET_OK
OfaLanguagesTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: optgdlg.cxx:1035
RESTART_REASON_SKIA
virtual void Reset(const SfxItemSet *rSet) override
Definition: optgdlg.cxx:872
Reference< XComponentContext > getProcessComponentContext()
bool mbHWAccelAvailable
Definition: optgdlg.cxx:369
QPRO_FUNC_TYPE nType
std::unique_ptr< LanguageConfig_Impl > pLangConfig
Definition: optgdlg.hxx:141
SfxOkDialogController * GetDialogController() const
std::unique_ptr< weld::Widget > m_xFileDlgFrame
Definition: optgdlg.hxx:38
std::unique_ptr< weld::ComboBox > m_xUserInterfaceLB
Definition: optgdlg.hxx:149
std::unique_ptr< weld::CheckButton > m_xDecimalSeparatorCB
Definition: optgdlg.hxx:152
void SetIconTheme(const OUString &)
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optgdlg.cxx:1236
std::unique_ptr< weld::Entry > m_xDatePatternsED
Definition: optgdlg.hxx:156
std::unique_ptr< weld::CheckButton > m_xPopUpNoHelpCB
Definition: optgdlg.hxx:36
static OUString GetLanguageString(const LanguageType eType)
SFX_SYMBOLS_SIZE_LARGE
DeactivateRC
virtual ~OfaMiscTabPage() override
Definition: optgdlg.cxx:208
std::unique_ptr< weld::Widget > m_xMenuIconBox
Definition: optgdlg.hxx:97
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
size_t size() const
sal_Int32 nSizeLB_InitialSelection
Definition: optgdlg.hxx:78
virtual ~OfaViewTabPage() override
Definition: optgdlg.cxx:585
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: optgdlg.cxx:662
std::unique_ptr< SvxLanguageBox > m_xWesternLanguageLB
Definition: optgdlg.hxx:158
std::unique_ptr< weld::CheckButton > m_xShowTipOfTheDay
Definition: optgdlg.hxx:37
sal_Int32 nSidebarSizeLB_InitialSelection
Definition: optgdlg.hxx:79
virtual void Reset(const SfxItemSet *rSet) override
Definition: optgdlg.cxx:282
virtual void Reset(const SfxItemSet *rSet) override
Definition: optgdlg.cxx:1475
TriState
bool IsAnyEnabled()
std::vector< vcl::IconThemeInfo > mInstalledIconThemes
Definition: optgdlg.hxx:86
std::unique_ptr< weld::CheckButton > m_xUseSkia
Definition: optgdlg.hxx:106
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: optgdlg.cxx:212
SnapType
aStr
std::unique_ptr< weld::CheckButton > m_xFontShowCB
Definition: optgdlg.hxx:102
virtual void set_sensitive(bool sensitive)=0
MouseMiddleButtonAction
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
std::unique_ptr< weld::CheckButton > m_xAsianSupportCB
Definition: optgdlg.hxx:163
std::unique_ptr< weld::CheckButton > m_xCTLSupportCB
Definition: optgdlg.hxx:164
OUString m_sUserLocaleValue
Definition: optgdlg.hxx:143
static bool hasNativeFileSelection()
OUString sId