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