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