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