[Libreoffice-commits] core.git: 2 commits - cui/source cui/uiconfig
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Sat Jul 27 10:53:25 UTC 2019
cui/source/inc/optasian.hxx | 45 +++-----
cui/source/options/optaccessibility.cxx | 80 ++++++---------
cui/source/options/optaccessibility.hxx | 18 +--
cui/source/options/optasian.cxx | 169 ++++++++++++++------------------
cui/uiconfig/ui/optasianpage.ui | 21 +--
5 files changed, 142 insertions(+), 191 deletions(-)
New commits:
commit 31bdf49b8c96f408d7b02c9925633eb419f65211
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jul 26 20:32:10 2019 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Jul 27 12:52:26 2019 +0200
weld SvxAsianLayoutPage
Change-Id: I0bea0026177dcb056edd073cdd9c51e76273d169
Reviewed-on: https://gerrit.libreoffice.org/76456
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/cui/source/inc/optasian.hxx b/cui/source/inc/optasian.hxx
index c6999c279460..1aaeafa583df 100644
--- a/cui/source/inc/optasian.hxx
+++ b/cui/source/inc/optasian.hxx
@@ -21,41 +21,34 @@
#include <memory>
#include <sfx2/tabdlg.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/edit.hxx>
#include <svx/langbox.hxx>
+
struct SvxAsianLayoutPage_Impl;
class SvxAsianLayoutPage : public SfxTabPage
{
- VclPtr<RadioButton> m_pCharKerningRB;
- VclPtr<RadioButton> m_pCharPunctKerningRB;
-
- VclPtr<RadioButton> m_pNoCompressionRB;
- VclPtr<RadioButton> m_pPunctCompressionRB;
- VclPtr<RadioButton> m_pPunctKanaCompressionRB;
-
- VclPtr<FixedText> m_pLanguageFT;
- VclPtr<SvxLanguageBox> m_pLanguageLB;
- VclPtr<CheckBox> m_pStandardCB;
-
- VclPtr<FixedText> m_pStartFT;
- VclPtr<Edit> m_pStartED;
- VclPtr<FixedText> m_pEndFT;
- VclPtr<Edit> m_pEndED;
- VclPtr<FixedText> m_pHintFT;
-
std::unique_ptr<SvxAsianLayoutPage_Impl> pImpl;
- DECL_LINK(LanguageHdl, ListBox&, void);
- DECL_LINK(ChangeStandardHdl, Button*, void);
- DECL_LINK(ModifyHdl, Edit&, void);
+ std::unique_ptr<weld::RadioButton> m_xCharKerningRB;
+ std::unique_ptr<weld::RadioButton> m_xCharPunctKerningRB;
+ std::unique_ptr<weld::RadioButton> m_xNoCompressionRB;
+ std::unique_ptr<weld::RadioButton> m_xPunctCompressionRB;
+ std::unique_ptr<weld::RadioButton> m_xPunctKanaCompressionRB;
+ std::unique_ptr<weld::Label> m_xLanguageFT;
+ std::unique_ptr<LanguageBox> m_xLanguageLB;
+ std::unique_ptr<weld::CheckButton> m_xStandardCB;
+ std::unique_ptr<weld::Label> m_xStartFT;
+ std::unique_ptr<weld::Entry> m_xStartED;
+ std::unique_ptr<weld::Label> m_xEndFT;
+ std::unique_ptr<weld::Entry> m_xEndED;
+ std::unique_ptr<weld::Label> m_xHintFT;
+
+ DECL_LINK(LanguageHdl, weld::ComboBox&, void);
+ DECL_LINK(ChangeStandardHdl, weld::ToggleButton&, void);
+ DECL_LINK(ModifyHdl, weld::Entry&, void);
public:
- SvxAsianLayoutPage( vcl::Window* pParent, const SfxItemSet& rSet );
+ SvxAsianLayoutPage(TabPageParent pParent, const SfxItemSet& rSet );
virtual ~SvxAsianLayoutPage() override;
- virtual void dispose() override;
static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet );
static const sal_uInt16* GetRanges();
diff --git a/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx
index 8c4dc9e90e0d..883bcbb984a7 100644
--- a/cui/source/options/optasian.cxx
+++ b/cui/source/options/optasian.cxx
@@ -102,81 +102,60 @@ void SvxAsianLayoutPage_Impl::addForbiddenCharacters(
static LanguageType eLastUsedLanguageTypeForForbiddenCharacters(USHRT_MAX);
-SvxAsianLayoutPage::SvxAsianLayoutPage( vcl::Window* pParent, const SfxItemSet& rSet ) :
- SfxTabPage(pParent, "OptAsianPage", "cui/ui/optasianpage.ui", &rSet),
- pImpl(new SvxAsianLayoutPage_Impl)
+SvxAsianLayoutPage::SvxAsianLayoutPage(TabPageParent pParent, const SfxItemSet& rSet)
+ : SfxTabPage(pParent, "cui/ui/optasianpage.ui", "OptAsianPage", &rSet)
+ , pImpl(new SvxAsianLayoutPage_Impl)
+ , m_xCharKerningRB(m_xBuilder->weld_radio_button("charkerning"))
+ , m_xCharPunctKerningRB(m_xBuilder->weld_radio_button("charpunctkerning"))
+ , m_xNoCompressionRB(m_xBuilder->weld_radio_button("nocompression"))
+ , m_xPunctCompressionRB(m_xBuilder->weld_radio_button("punctcompression"))
+ , m_xPunctKanaCompressionRB(m_xBuilder->weld_radio_button("punctkanacompression"))
+ , m_xLanguageFT(m_xBuilder->weld_label("languageft"))
+ , m_xLanguageLB(new LanguageBox(m_xBuilder->weld_combo_box("language")))
+ , m_xStandardCB(m_xBuilder->weld_check_button("standard"))
+ , m_xStartFT(m_xBuilder->weld_label("startft"))
+ , m_xStartED(m_xBuilder->weld_entry("start"))
+ , m_xEndFT(m_xBuilder->weld_label("endft"))
+ , m_xEndED(m_xBuilder->weld_entry("end"))
+ , m_xHintFT(m_xBuilder->weld_label("hintft"))
{
- get(m_pCharKerningRB, "charkerning");
- get(m_pCharPunctKerningRB, "charpunctkerning");
- get(m_pNoCompressionRB, "nocompression");
- get(m_pPunctCompressionRB, "punctcompression");
- get(m_pPunctKanaCompressionRB, "punctkanacompression");
- get(m_pLanguageFT, "languageft");
- get(m_pLanguageLB, "language");
- get(m_pStandardCB, "standard");
- get(m_pStartFT, "startft");
- get(m_pStartED, "start");
- get(m_pEndFT, "endft");
- get(m_pEndED, "end");
- get(m_pHintFT, "hintft");
+ LanguageHdl(*m_xLanguageLB->get_widget());
+ m_xLanguageLB->connect_changed(LINK(this, SvxAsianLayoutPage, LanguageHdl));
+ m_xStandardCB->connect_toggled(LINK(this, SvxAsianLayoutPage, ChangeStandardHdl));
+ Link<weld::Entry&,void> aLk(LINK(this, SvxAsianLayoutPage, ModifyHdl));
+ m_xStartED->connect_changed(aLk);
+ m_xEndED->connect_changed(aLk);
- LanguageHdl(*m_pLanguageLB);
- m_pLanguageLB->SetSelectHdl(LINK(this, SvxAsianLayoutPage, LanguageHdl));
- m_pStandardCB->SetClickHdl(LINK(this, SvxAsianLayoutPage, ChangeStandardHdl));
- Link<Edit&,void> aLk(LINK(this, SvxAsianLayoutPage, ModifyHdl));
- m_pStartED->SetModifyHdl(aLk);
- m_pEndED->SetModifyHdl(aLk);
-
- m_pLanguageLB->SetLanguageList( SvxLanguageListFlags::FBD_CHARS, false, false );
+ m_xLanguageLB->SetLanguageList( SvxLanguageListFlags::FBD_CHARS, false, false );
}
SvxAsianLayoutPage::~SvxAsianLayoutPage()
{
- disposeOnce();
-}
-
-void SvxAsianLayoutPage::dispose()
-{
- pImpl.reset();
- m_pCharKerningRB.clear();
- m_pCharPunctKerningRB.clear();
- m_pNoCompressionRB.clear();
- m_pPunctCompressionRB.clear();
- m_pPunctKanaCompressionRB.clear();
- m_pLanguageFT.clear();
- m_pLanguageLB.clear();
- m_pStandardCB.clear();
- m_pStartFT.clear();
- m_pStartED.clear();
- m_pEndFT.clear();
- m_pEndED.clear();
- m_pHintFT.clear();
- SfxTabPage::dispose();
}
-VclPtr<SfxTabPage> SvxAsianLayoutPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxAsianLayoutPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
{
- return VclPtr<SvxAsianLayoutPage>::Create(pParent.pParent, *rAttrSet);
+ return VclPtr<SvxAsianLayoutPage>::Create(pParent, *rAttrSet);
}
bool SvxAsianLayoutPage::FillItemSet( SfxItemSet* )
{
- if(m_pCharKerningRB->IsValueChangedFromSaved())
+ if(m_xCharKerningRB->get_state_changed_from_saved())
{
- pImpl->aConfig.SetKerningWesternTextOnly(m_pCharKerningRB->IsChecked());
+ pImpl->aConfig.SetKerningWesternTextOnly(m_xCharKerningRB->get_active());
OUString sPunct(cIsKernAsianPunctuation);
if(pImpl->xPrSetInfo.is() && pImpl->xPrSetInfo->hasPropertyByName(sPunct))
{
- bool bVal = !m_pCharKerningRB->IsChecked();
+ bool bVal = !m_xCharKerningRB->get_active();
pImpl->xPrSet->setPropertyValue(sPunct, Any(bVal));
}
}
- if(m_pNoCompressionRB->IsValueChangedFromSaved() ||
- m_pPunctCompressionRB->IsValueChangedFromSaved())
+ if(m_xNoCompressionRB->get_state_changed_from_saved() ||
+ m_xPunctCompressionRB->get_state_changed_from_saved())
{
- CharCompressType nSet = m_pNoCompressionRB->IsChecked() ? CharCompressType::NONE :
- m_pPunctCompressionRB->IsChecked() ? CharCompressType::PunctuationOnly :
+ CharCompressType nSet = m_xNoCompressionRB->get_active() ? CharCompressType::NONE :
+ m_xPunctCompressionRB->get_active() ? CharCompressType::PunctuationOnly :
CharCompressType::PunctuationAndKana;
pImpl->aConfig.SetCharDistanceCompression(nSet);
OUString sCompress(cCharacterCompressionType);
@@ -204,7 +183,7 @@ bool SvxAsianLayoutPage::FillItemSet( SfxItemSet* )
OSL_FAIL("exception in XForbiddenCharacters");
}
}
- eLastUsedLanguageTypeForForbiddenCharacters = m_pLanguageLB->GetSelectedLanguage();
+ eLastUsedLanguageTypeForForbiddenCharacters = m_xLanguageLB->get_active_id();
return false;
}
@@ -250,31 +229,31 @@ void SvxAsianLayoutPage::Reset( const SfxItemSet* )
}
else
{
- m_pLanguageFT->Enable(false);
- m_pLanguageLB->Enable(false);
- m_pStandardCB->Enable(false);
- m_pStartFT->Enable(false);
- m_pStartED->Enable(false);
- m_pEndFT->Enable(false);
- m_pEndED->Enable(false);
- m_pHintFT->Enable(false);
+ m_xLanguageFT->set_sensitive(false);
+ m_xLanguageLB->set_sensitive(false);
+ m_xStandardCB->set_sensitive(false);
+ m_xStartFT->set_sensitive(false);
+ m_xStartED->set_sensitive(false);
+ m_xEndFT->set_sensitive(false);
+ m_xEndED->set_sensitive(false);
+ m_xHintFT->set_sensitive(false);
}
if(bKernWesternText)
- m_pCharKerningRB->Check();
+ m_xCharKerningRB->set_active(true);
else
- m_pCharPunctKerningRB->Check();
+ m_xCharPunctKerningRB->set_active(true);
switch(nCompress)
{
- case CharCompressType::NONE : m_pNoCompressionRB->Check(); break;
- case CharCompressType::PunctuationOnly : m_pPunctCompressionRB->Check(); break;
- default: m_pPunctKanaCompressionRB->Check();
+ case CharCompressType::NONE : m_xNoCompressionRB->set_active(true); break;
+ case CharCompressType::PunctuationOnly : m_xPunctCompressionRB->set_active(true); break;
+ default: m_xPunctKanaCompressionRB->set_active(true);
}
- m_pCharKerningRB->SaveValue();
- m_pNoCompressionRB->SaveValue();
- m_pPunctCompressionRB->SaveValue();
- m_pPunctKanaCompressionRB->SaveValue();
+ m_xCharKerningRB->save_state();
+ m_xNoCompressionRB->save_state();
+ m_xPunctCompressionRB->save_state();
+ m_xPunctKanaCompressionRB->save_state();
- m_pLanguageLB->SelectEntryPos(0);
+ m_xLanguageLB->set_active(0);
//preselect the system language in the box - if available
if(LanguageType(USHRT_MAX) == eLastUsedLanguageTypeForForbiddenCharacters)
{
@@ -285,14 +264,14 @@ void SvxAsianLayoutPage::Reset( const SfxItemSet* )
else if (MsLangId::isTraditionalChinese(eLastUsedLanguageTypeForForbiddenCharacters))
eLastUsedLanguageTypeForForbiddenCharacters = LANGUAGE_CHINESE_TRADITIONAL;
}
- m_pLanguageLB->SelectLanguage( eLastUsedLanguageTypeForForbiddenCharacters );
- LanguageHdl(*m_pLanguageLB);
+ m_xLanguageLB->set_active_id(eLastUsedLanguageTypeForForbiddenCharacters);
+ LanguageHdl(*m_xLanguageLB->get_widget());
}
-IMPL_LINK_NOARG(SvxAsianLayoutPage, LanguageHdl, ListBox&, void)
+IMPL_LINK_NOARG(SvxAsianLayoutPage, LanguageHdl, weld::ComboBox&, void)
{
//set current value
- LanguageType eSelectLanguage = m_pLanguageLB->GetSelectedLanguage();
+ LanguageType eSelectLanguage = m_xLanguageLB->get_active_id();
LanguageTag aLanguageTag( eSelectLanguage);
const Locale& aLocale( aLanguageTag.getLocale());
@@ -343,33 +322,33 @@ IMPL_LINK_NOARG(SvxAsianLayoutPage, LanguageHdl, ListBox&, void)
sStart = aForbidden.beginLine;
sEnd = aForbidden.endLine;
}
- m_pStandardCB->Check(!bAvail);
- m_pStartED->Enable(bAvail);
- m_pEndED->Enable(bAvail);
- m_pStartFT->Enable(bAvail);
- m_pEndFT->Enable(bAvail);
- m_pStartED->SetText(sStart);
- m_pEndED->SetText(sEnd);
+ m_xStandardCB->set_active(!bAvail);
+ m_xStartED->set_sensitive(bAvail);
+ m_xEndED->set_sensitive(bAvail);
+ m_xStartFT->set_sensitive(bAvail);
+ m_xEndFT->set_sensitive(bAvail);
+ m_xStartED->set_text(sStart);
+ m_xEndED->set_text(sEnd);
}
-IMPL_LINK(SvxAsianLayoutPage, ChangeStandardHdl, Button*, pBox, void)
+IMPL_LINK(SvxAsianLayoutPage, ChangeStandardHdl, weld::ToggleButton&, rBox, void)
{
- bool bCheck = static_cast<CheckBox*>(pBox)->IsChecked();
- m_pStartED->Enable(!bCheck);
- m_pEndED->Enable(!bCheck);
- m_pStartFT->Enable(!bCheck);
- m_pEndFT->Enable(!bCheck);
+ bool bCheck = rBox.get_active();
+ m_xStartED->set_sensitive(!bCheck);
+ m_xEndED->set_sensitive(!bCheck);
+ m_xStartFT->set_sensitive(!bCheck);
+ m_xEndFT->set_sensitive(!bCheck);
- ModifyHdl(*m_pStartED);
+ ModifyHdl(*m_xStartED);
}
-IMPL_LINK(SvxAsianLayoutPage, ModifyHdl, Edit&, rEdit, void)
+IMPL_LINK(SvxAsianLayoutPage, ModifyHdl, weld::Entry&, rEdit, void)
{
- LanguageType eSelectLanguage = m_pLanguageLB->GetSelectedLanguage();
+ LanguageType eSelectLanguage = m_xLanguageLB->get_active_id();
Locale aLocale( LanguageTag::convertToLocale( eSelectLanguage ));
- OUString sStart = m_pStartED->GetText();
- OUString sEnd = m_pEndED->GetText();
- bool bEnable = rEdit.IsEnabled();
+ OUString sStart = m_xStartED->get_text();
+ OUString sEnd = m_xEndED->get_text();
+ bool bEnable = rEdit.get_sensitive();
if(pImpl->xForbidden.is())
{
try
diff --git a/cui/uiconfig/ui/optasianpage.ui b/cui/uiconfig/ui/optasianpage.ui
index 7a063cb5d679..087bfd380d26 100644
--- a/cui/uiconfig/ui/optasianpage.ui
+++ b/cui/uiconfig/ui/optasianpage.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
<requires lib="LibreOffice" version="1.0"/>
@@ -36,7 +36,6 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
- <property name="group">charpunctkerning</property>
</object>
<packing>
<property name="expand">False</property>
@@ -52,7 +51,6 @@
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
- <property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">charkerning</property>
</object>
@@ -110,7 +108,6 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
- <property name="group">punctcompression</property>
</object>
<packing>
<property name="expand">False</property>
@@ -126,9 +123,8 @@
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
- <property name="active">True</property>
<property name="draw_indicator">True</property>
- <property name="group">punctkanacompression</property>
+ <property name="group">nocompression</property>
</object>
<packing>
<property name="expand">False</property>
@@ -144,7 +140,6 @@
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
- <property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">nocompression</property>
</object>
@@ -210,7 +205,7 @@
<property name="spacing">12</property>
<property name="homogeneous">True</property>
<child>
- <object class="svxcorelo-SvxLanguageBox" id="language">
+ <object class="GtkComboBoxText" id="language">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
@@ -247,10 +242,10 @@
<object class="GtkLabel" id="languageft">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="optasianpage|languageft">_Language:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">language</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -261,10 +256,10 @@
<object class="GtkLabel" id="startft">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="optasianpage|startft">Not _at start of line:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">start</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -275,10 +270,10 @@
<object class="GtkLabel" id="endft">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="optasianpage|endft">Not at _end of line:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">end</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -290,6 +285,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
+ <property name="activates_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
@@ -301,6 +297,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
+ <property name="activates_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
@@ -318,8 +315,8 @@
<object class="GtkLabel" id="hintft">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="optasianpage|hintft">Without user-defined line break symbols</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
commit ac1ae3e055f9104b40a12a8f5b6418817230af0d
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jul 26 20:12:30 2019 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Jul 27 12:51:46 2019 +0200
weld SvxAccessibilityOptionsTabPage
Change-Id: I77354538eb8ff31dcc3bfc3d5a7742e92b8cd7b5
Reviewed-on: https://gerrit.libreoffice.org/76455
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/cui/source/options/optaccessibility.cxx b/cui/source/options/optaccessibility.cxx
index 716fc042d7fe..47b44435e3f9 100644
--- a/cui/source/options/optaccessibility.cxx
+++ b/cui/source/options/optaccessibility.cxx
@@ -22,69 +22,53 @@
#include <vcl/svapp.hxx>
#include <officecfg/Office/Common.hxx>
-SvxAccessibilityOptionsTabPage::SvxAccessibilityOptionsTabPage(vcl::Window* pParent,
+SvxAccessibilityOptionsTabPage::SvxAccessibilityOptionsTabPage(TabPageParent pParent,
const SfxItemSet& rSet)
- : SfxTabPage(pParent, "OptAccessibilityPage",
- "cui/ui/optaccessibilitypage.ui", &rSet)
+ : SfxTabPage(pParent, "cui/ui/optaccessibilitypage.ui", "OptAccessibilityPage", &rSet)
+ , m_xAccessibilityTool(m_xBuilder->weld_check_button("acctool"))
+ , m_xTextSelectionInReadonly(m_xBuilder->weld_check_button("textselinreadonly"))
+ , m_xAnimatedGraphics(m_xBuilder->weld_check_button("animatedgraphics"))
+ , m_xAnimatedTexts(m_xBuilder->weld_check_button("animatedtext"))
+ , m_xAutoDetectHC(m_xBuilder->weld_check_button("autodetecthc"))
+ , m_xAutomaticFontColor(m_xBuilder->weld_check_button("autofontcolor"))
+ , m_xPagePreviews(m_xBuilder->weld_check_button("systempagepreviewcolor"))
{
- get(m_pAccessibilityTool, "acctool");
- get(m_pTextSelectionInReadonly, "textselinreadonly");
- get(m_pAnimatedGraphics, "animatedgraphics");
- get(m_pAnimatedTexts, "animatedtext");
-
- get(m_pAutoDetectHC, "autodetecthc");
- get(m_pAutomaticFontColor, "autofontcolor");
- get(m_pPagePreviews, "systempagepreviewcolor");
-
#ifdef UNX
// UNIX: read the gconf2 setting instead to use the checkbox
- m_pAccessibilityTool->Hide();
+ m_xAccessibilityTool->hide();
#endif
}
SvxAccessibilityOptionsTabPage::~SvxAccessibilityOptionsTabPage()
{
- disposeOnce();
-}
-
-void SvxAccessibilityOptionsTabPage::dispose()
-{
- m_pAccessibilityTool.clear();
- m_pTextSelectionInReadonly.clear();
- m_pAnimatedGraphics.clear();
- m_pAnimatedTexts.clear();
- m_pAutoDetectHC.clear();
- m_pAutomaticFontColor.clear();
- m_pPagePreviews.clear();
- SfxTabPage::dispose();
}
-VclPtr<SfxTabPage> SvxAccessibilityOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxAccessibilityOptionsTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
{
- return VclPtr<SvxAccessibilityOptionsTabPage>::Create(pParent.pParent, *rAttrSet);
+ return VclPtr<SvxAccessibilityOptionsTabPage>::Create(pParent, *rAttrSet);
}
bool SvxAccessibilityOptionsTabPage::FillItemSet( SfxItemSet* )
{
std::shared_ptr<comphelper::ConfigurationChanges> batch( comphelper::ConfigurationChanges::create() );
if ( !officecfg::Office::Common::Accessibility::IsForPagePreviews::isReadOnly() )
- officecfg::Office::Common::Accessibility::IsForPagePreviews::set(m_pPagePreviews->IsChecked(), batch);
+ officecfg::Office::Common::Accessibility::IsForPagePreviews::set(m_xPagePreviews->get_active(), batch);
if ( !officecfg::Office::Common::Accessibility::IsAllowAnimatedGraphics::isReadOnly() )
- officecfg::Office::Common::Accessibility::IsAllowAnimatedGraphics::set(m_pAnimatedGraphics->IsChecked(), batch);
+ officecfg::Office::Common::Accessibility::IsAllowAnimatedGraphics::set(m_xAnimatedGraphics->get_active(), batch);
if ( !officecfg::Office::Common::Accessibility::IsAllowAnimatedText::isReadOnly() )
- officecfg::Office::Common::Accessibility::IsAllowAnimatedText::set(m_pAnimatedTexts->IsChecked(), batch);
+ officecfg::Office::Common::Accessibility::IsAllowAnimatedText::set(m_xAnimatedTexts->get_active(), batch);
if ( !officecfg::Office::Common::Accessibility::IsAutomaticFontColor::isReadOnly() )
- officecfg::Office::Common::Accessibility::IsAutomaticFontColor::set(m_pAutomaticFontColor->IsChecked(), batch);
+ officecfg::Office::Common::Accessibility::IsAutomaticFontColor::set(m_xAutomaticFontColor->get_active(), batch);
if ( !officecfg::Office::Common::Accessibility::IsSelectionInReadonly::isReadOnly() )
- officecfg::Office::Common::Accessibility::IsSelectionInReadonly::set(m_pTextSelectionInReadonly->IsChecked(), batch);
+ officecfg::Office::Common::Accessibility::IsSelectionInReadonly::set(m_xTextSelectionInReadonly->get_active(), batch);
if ( !officecfg::Office::Common::Accessibility::AutoDetectSystemHC::isReadOnly() )
- officecfg::Office::Common::Accessibility::AutoDetectSystemHC::set(m_pAutoDetectHC->IsChecked(), batch);
+ officecfg::Office::Common::Accessibility::AutoDetectSystemHC::set(m_xAutoDetectHC->get_active(), batch);
batch->commit();
AllSettings aAllSettings = Application::GetSettings();
MiscSettings aMiscSettings = aAllSettings.GetMiscSettings();
#ifndef UNX
- aMiscSettings.SetEnableATToolSupport(m_pAccessibilityTool->IsChecked());
+ aMiscSettings.SetEnableATToolSupport(m_xAccessibilityTool->get_active());
#endif
aAllSettings.SetMiscSettings(aMiscSettings);
Application::MergeSystemSettings( aAllSettings );
@@ -95,33 +79,33 @@ bool SvxAccessibilityOptionsTabPage::FillItemSet( SfxItemSet* )
void SvxAccessibilityOptionsTabPage::Reset( const SfxItemSet* )
{
- m_pPagePreviews->Check( officecfg::Office::Common::Accessibility::IsForPagePreviews::get() );
+ m_xPagePreviews->set_active( officecfg::Office::Common::Accessibility::IsForPagePreviews::get() );
if( officecfg::Office::Common::Accessibility::IsForPagePreviews::isReadOnly() )
- m_pPagePreviews->Disable();
+ m_xPagePreviews->set_sensitive(false);
- m_pAnimatedGraphics->Check( officecfg::Office::Common::Accessibility::IsAllowAnimatedGraphics::get() );
+ m_xAnimatedGraphics->set_active( officecfg::Office::Common::Accessibility::IsAllowAnimatedGraphics::get() );
if( officecfg::Office::Common::Accessibility::IsAllowAnimatedGraphics::isReadOnly() )
- m_pAnimatedGraphics->Disable();
+ m_xAnimatedGraphics->set_sensitive(false);
- m_pAnimatedTexts->Check( officecfg::Office::Common::Accessibility::IsAllowAnimatedText::get() );
+ m_xAnimatedTexts->set_active( officecfg::Office::Common::Accessibility::IsAllowAnimatedText::get() );
if( officecfg::Office::Common::Accessibility::IsAllowAnimatedText::isReadOnly() )
- m_pAnimatedTexts->Disable();
+ m_xAnimatedTexts->set_sensitive(false);
- m_pAutomaticFontColor->Check( officecfg::Office::Common::Accessibility::IsAutomaticFontColor::get() );
+ m_xAutomaticFontColor->set_active( officecfg::Office::Common::Accessibility::IsAutomaticFontColor::get() );
if( officecfg::Office::Common::Accessibility::IsAutomaticFontColor::isReadOnly() )
- m_pAutomaticFontColor->Disable();
+ m_xAutomaticFontColor->set_sensitive(false);
- m_pTextSelectionInReadonly->Check( officecfg::Office::Common::Accessibility::IsSelectionInReadonly::get() );
+ m_xTextSelectionInReadonly->set_active( officecfg::Office::Common::Accessibility::IsSelectionInReadonly::get() );
if( officecfg::Office::Common::Accessibility::IsSelectionInReadonly::isReadOnly() )
- m_pTextSelectionInReadonly->Disable();
+ m_xTextSelectionInReadonly->set_sensitive(false);
- m_pAutoDetectHC->Check( officecfg::Office::Common::Accessibility::AutoDetectSystemHC::get() );
+ m_xAutoDetectHC->set_active( officecfg::Office::Common::Accessibility::AutoDetectSystemHC::get() );
if( officecfg::Office::Common::Accessibility::AutoDetectSystemHC::isReadOnly() )
- m_pAutoDetectHC->Disable();
+ m_xAutoDetectHC->set_sensitive(false);
AllSettings aAllSettings = Application::GetSettings();
const MiscSettings& aMiscSettings = aAllSettings.GetMiscSettings();
- m_pAccessibilityTool->Check(aMiscSettings.GetEnableATToolSupport());
+ m_xAccessibilityTool->set_active(aMiscSettings.GetEnableATToolSupport());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/optaccessibility.hxx b/cui/source/options/optaccessibility.hxx
index 359a2a286ab4..5a1ed1bbb3c2 100644
--- a/cui/source/options/optaccessibility.hxx
+++ b/cui/source/options/optaccessibility.hxx
@@ -20,22 +20,20 @@
#define INCLUDED_CUI_SOURCE_OPTIONS_OPTACCESSIBILITY_HXX
#include <sfx2/tabdlg.hxx>
-#include <vcl/button.hxx>
class SvxAccessibilityOptionsTabPage : public SfxTabPage
{
- VclPtr<CheckBox> m_pAccessibilityTool;
- VclPtr<CheckBox> m_pTextSelectionInReadonly;
- VclPtr<CheckBox> m_pAnimatedGraphics;
- VclPtr<CheckBox> m_pAnimatedTexts;
- VclPtr<CheckBox> m_pAutoDetectHC;
- VclPtr<CheckBox> m_pAutomaticFontColor;
- VclPtr<CheckBox> m_pPagePreviews;
+ std::unique_ptr<weld::CheckButton> m_xAccessibilityTool;
+ std::unique_ptr<weld::CheckButton> m_xTextSelectionInReadonly;
+ std::unique_ptr<weld::CheckButton> m_xAnimatedGraphics;
+ std::unique_ptr<weld::CheckButton> m_xAnimatedTexts;
+ std::unique_ptr<weld::CheckButton> m_xAutoDetectHC;
+ std::unique_ptr<weld::CheckButton> m_xAutomaticFontColor;
+ std::unique_ptr<weld::CheckButton> m_xPagePreviews;
public:
- SvxAccessibilityOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
+ SvxAccessibilityOptionsTabPage(TabPageParent pParent, const SfxItemSet& rSet);
virtual ~SvxAccessibilityOptionsTabPage() override;
- virtual void dispose() override;
static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) override;
More information about the Libreoffice-commits
mailing list