[Libreoffice-commits] core.git: 2 commits - cui/source sc/inc

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sat Jul 27 12:12:43 UTC 2019


 cui/source/options/optbasic.cxx |  108 ++++++++++++++++------------------------
 cui/source/options/optbasic.hxx |   15 ++---
 sc/inc/scmod.hxx                |    2 
 3 files changed, 53 insertions(+), 72 deletions(-)

New commits:
commit 7360ddd34aa446e6439c733ef0f819a58d709744
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Jul 27 11:46:17 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Jul 27 14:11:45 2019 +0200

    cid#1401328 Uncaught exception
    
    Change-Id: I1c4bdd4afec30d7d52054d8c9bd4958191c480f8
    Reviewed-on: https://gerrit.libreoffice.org/76470
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx
index a82ac9337b12..363a9dd2a354 100644
--- a/sc/inc/scmod.hxx
+++ b/sc/inc/scmod.hxx
@@ -87,7 +87,7 @@ class SAL_DLLPUBLIC_RTTI ScModule: public SfxModule, public SfxListener, public
     ScMessagePool*      m_pMessagePool;
     // there is no global InputHandler anymore, each View has its own
     ScInputHandler*     m_pRefInputHandler;
-    std::unique_ptr<ScViewCfg>        m_pViewCfg;
+    std::unique_ptr<ScViewCfg, o3tl::default_delete<ScViewCfg>> m_pViewCfg;
     std::unique_ptr<ScDocCfg, o3tl::default_delete<ScDocCfg>> m_pDocCfg;
     std::unique_ptr<ScAppCfg, o3tl::default_delete<ScAppCfg>> m_pAppCfg;
     std::unique_ptr<ScDefaultsCfg>    m_pDefaultsCfg;
commit bee82941206bfae3f57a3008babec7c16b129b5d
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jul 26 17:33:06 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Jul 27 14:11:30 2019 +0200

    weld SvxBasicIDEOptionsPage
    
    Change-Id: I3f5a7fe106075194e90e0da6f6538882024adec1
    Reviewed-on: https://gerrit.libreoffice.org/76454
    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/optbasic.cxx b/cui/source/options/optbasic.cxx
index 688b4e7e4f83..56a52fbcd45c 100644
--- a/cui/source/options/optbasic.cxx
+++ b/cui/source/options/optbasic.cxx
@@ -22,49 +22,36 @@
 #include <iostream>
 #include <officecfg/Office/BasicIDE.hxx>
 
-SvxBasicIDEOptionsPage::SvxBasicIDEOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet )
-: SfxTabPage(pParent, "OptBasicIDEPage", "cui/ui/optbasicidepage.ui", &rSet)
+SvxBasicIDEOptionsPage::SvxBasicIDEOptionsPage(TabPageParent pParent, const SfxItemSet& rSet)
+    : SfxTabPage(pParent, "cui/ui/optbasicidepage.ui", "OptBasicIDEPage", &rSet)
+    , m_xCodeCompleteChk(m_xBuilder->weld_check_button("codecomplete_enable"))
+    , m_xAutocloseProcChk(m_xBuilder->weld_check_button("autoclose_proc"))
+    , m_xAutocloseParenChk(m_xBuilder->weld_check_button("autoclose_paren"))
+    , m_xAutocloseQuotesChk(m_xBuilder->weld_check_button("autoclose_quotes"))
+    , m_xAutoCorrectChk(m_xBuilder->weld_check_button("autocorrect"))
+    , m_xUseExtendedTypesChk(m_xBuilder->weld_check_button("extendedtypes_enable"))
 {
-    get(pCodeCompleteChk, "codecomplete_enable");
-    get(pAutocloseProcChk, "autoclose_proc");
-    get(pAutocloseParenChk, "autoclose_paren");
-    get(pAutocloseQuotesChk, "autoclose_quotes");
-    get(pAutoCorrectChk, "autocorrect");
-    get(pUseExtendedTypesChk, "extendedtypes_enable");
-
     LoadConfig();
 }
 
 SvxBasicIDEOptionsPage::~SvxBasicIDEOptionsPage()
 {
-    disposeOnce();
-}
-
-void SvxBasicIDEOptionsPage::dispose()
-{
-    pCodeCompleteChk.clear();
-    pAutocloseProcChk.clear();
-    pAutocloseParenChk.clear();
-    pAutocloseQuotesChk.clear();
-    pAutoCorrectChk.clear();
-    pUseExtendedTypesChk.clear();
-    SfxTabPage::dispose();
 }
 
 void SvxBasicIDEOptionsPage::LoadConfig()
 {
-    pCodeCompleteChk->Check( officecfg::Office::BasicIDE::Autocomplete::CodeComplete::get() );
-    pCodeCompleteChk->Enable( !officecfg::Office::BasicIDE::Autocomplete::CodeComplete::isReadOnly() );
-    pAutocloseProcChk->Check( officecfg::Office::BasicIDE::Autocomplete::AutocloseProc::get() );
-    pAutocloseProcChk->Enable( !officecfg::Office::BasicIDE::Autocomplete::AutocloseProc::isReadOnly() );
-    pAutocloseQuotesChk->Check( officecfg::Office::BasicIDE::Autocomplete::AutocloseDoubleQuotes::get() );
-    pAutocloseQuotesChk->Enable( !officecfg::Office::BasicIDE::Autocomplete::AutocloseDoubleQuotes::isReadOnly() );
-    pAutocloseParenChk->Check( officecfg::Office::BasicIDE::Autocomplete::AutocloseParenthesis::get() );
-    pAutocloseParenChk->Enable( !officecfg::Office::BasicIDE::Autocomplete::AutocloseParenthesis::isReadOnly() );
-    pAutoCorrectChk->Check( officecfg::Office::BasicIDE::Autocomplete::AutoCorrect::get() );
-    pAutoCorrectChk->Enable( !officecfg::Office::BasicIDE::Autocomplete::AutoCorrect::isReadOnly() );
-    pUseExtendedTypesChk->Check( officecfg::Office::BasicIDE::Autocomplete::UseExtended::get() );
-    pUseExtendedTypesChk->Enable( !officecfg::Office::BasicIDE::Autocomplete::UseExtended::isReadOnly() );
+    m_xCodeCompleteChk->set_active( officecfg::Office::BasicIDE::Autocomplete::CodeComplete::get() );
+    m_xCodeCompleteChk->set_sensitive( !officecfg::Office::BasicIDE::Autocomplete::CodeComplete::isReadOnly() );
+    m_xAutocloseProcChk->set_active( officecfg::Office::BasicIDE::Autocomplete::AutocloseProc::get() );
+    m_xAutocloseProcChk->set_sensitive( !officecfg::Office::BasicIDE::Autocomplete::AutocloseProc::isReadOnly() );
+    m_xAutocloseQuotesChk->set_active( officecfg::Office::BasicIDE::Autocomplete::AutocloseDoubleQuotes::get() );
+    m_xAutocloseQuotesChk->set_sensitive( !officecfg::Office::BasicIDE::Autocomplete::AutocloseDoubleQuotes::isReadOnly() );
+    m_xAutocloseParenChk->set_active( officecfg::Office::BasicIDE::Autocomplete::AutocloseParenthesis::get() );
+    m_xAutocloseParenChk->set_sensitive( !officecfg::Office::BasicIDE::Autocomplete::AutocloseParenthesis::isReadOnly() );
+    m_xAutoCorrectChk->set_active( officecfg::Office::BasicIDE::Autocomplete::AutoCorrect::get() );
+    m_xAutoCorrectChk->set_sensitive( !officecfg::Office::BasicIDE::Autocomplete::AutoCorrect::isReadOnly() );
+    m_xUseExtendedTypesChk->set_active( officecfg::Office::BasicIDE::Autocomplete::UseExtended::get() );
+    m_xUseExtendedTypesChk->set_sensitive( !officecfg::Office::BasicIDE::Autocomplete::UseExtended::isReadOnly() );
 }
 
 bool SvxBasicIDEOptionsPage::FillItemSet( SfxItemSet* /*rCoreSet*/ )
@@ -72,46 +59,46 @@ bool SvxBasicIDEOptionsPage::FillItemSet( SfxItemSet* /*rCoreSet*/ )
     bool bModified = false;
     std::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() );
 
-    if( pAutocloseProcChk->IsValueChangedFromSaved() )
+    if( m_xAutocloseProcChk->get_state_changed_from_saved() )
     {
-        officecfg::Office::BasicIDE::Autocomplete::AutocloseProc::set( pAutocloseProcChk->IsChecked(), batch );
-        CodeCompleteOptions::SetProcedureAutoCompleteOn( pAutocloseProcChk->IsChecked() );
+        officecfg::Office::BasicIDE::Autocomplete::AutocloseProc::set( m_xAutocloseProcChk->get_active(), batch );
+        CodeCompleteOptions::SetProcedureAutoCompleteOn( m_xAutocloseProcChk->get_active() );
         bModified = true;
     }
 
-    if( pCodeCompleteChk->IsValueChangedFromSaved() )
+    if( m_xCodeCompleteChk->get_state_changed_from_saved() )
     {
         //std::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() );
-        officecfg::Office::BasicIDE::Autocomplete::CodeComplete::set( pCodeCompleteChk->IsChecked(), batch );
-        CodeCompleteOptions::SetCodeCompleteOn( pCodeCompleteChk->IsChecked() );
+        officecfg::Office::BasicIDE::Autocomplete::CodeComplete::set( m_xCodeCompleteChk->get_active(), batch );
+        CodeCompleteOptions::SetCodeCompleteOn( m_xCodeCompleteChk->get_active() );
         bModified = true;
     }
 
-    if( pUseExtendedTypesChk->IsValueChangedFromSaved() )
+    if( m_xUseExtendedTypesChk->get_state_changed_from_saved() )
     {
-        officecfg::Office::BasicIDE::Autocomplete::UseExtended::set( pUseExtendedTypesChk->IsChecked(), batch );
-        CodeCompleteOptions::SetExtendedTypeDeclaration( pUseExtendedTypesChk->IsChecked() );
+        officecfg::Office::BasicIDE::Autocomplete::UseExtended::set( m_xUseExtendedTypesChk->get_active(), batch );
+        CodeCompleteOptions::SetExtendedTypeDeclaration( m_xUseExtendedTypesChk->get_active() );
         bModified = true;
     }
 
-    if( pAutocloseParenChk->IsValueChangedFromSaved() )
+    if( m_xAutocloseParenChk->get_state_changed_from_saved() )
     {
-        officecfg::Office::BasicIDE::Autocomplete::AutocloseParenthesis::set( pAutocloseParenChk->IsChecked(), batch );
-        CodeCompleteOptions::SetAutoCloseParenthesisOn( pAutocloseParenChk->IsChecked() );
+        officecfg::Office::BasicIDE::Autocomplete::AutocloseParenthesis::set( m_xAutocloseParenChk->get_active(), batch );
+        CodeCompleteOptions::SetAutoCloseParenthesisOn( m_xAutocloseParenChk->get_active() );
         bModified = true;
     }
 
-    if( pAutocloseQuotesChk->IsValueChangedFromSaved() )
+    if( m_xAutocloseQuotesChk->get_state_changed_from_saved() )
     {
-        officecfg::Office::BasicIDE::Autocomplete::AutocloseDoubleQuotes::set( pAutocloseQuotesChk->IsChecked(), batch );
-        CodeCompleteOptions::SetAutoCloseQuotesOn( pAutocloseQuotesChk->IsChecked() );
+        officecfg::Office::BasicIDE::Autocomplete::AutocloseDoubleQuotes::set( m_xAutocloseQuotesChk->get_active(), batch );
+        CodeCompleteOptions::SetAutoCloseQuotesOn( m_xAutocloseQuotesChk->get_active() );
         bModified = true;
     }
 
-    if( pAutoCorrectChk->IsValueChangedFromSaved() )
+    if( m_xAutoCorrectChk->get_state_changed_from_saved() )
     {
-        officecfg::Office::BasicIDE::Autocomplete::AutoCorrect::set( pAutoCorrectChk->IsChecked(), batch );
-        CodeCompleteOptions::SetAutoCorrectOn( pAutoCorrectChk->IsChecked() );
+        officecfg::Office::BasicIDE::Autocomplete::AutoCorrect::set( m_xAutoCorrectChk->get_active(), batch );
+        CodeCompleteOptions::SetAutoCorrectOn( m_xAutoCorrectChk->get_active() );
         bModified = true;
     }
 
@@ -124,22 +111,17 @@ bool SvxBasicIDEOptionsPage::FillItemSet( SfxItemSet* /*rCoreSet*/ )
 void SvxBasicIDEOptionsPage::Reset( const SfxItemSet* /*rSet*/ )
 {
     LoadConfig();
-    pCodeCompleteChk->SaveValue();
-
-    pAutocloseProcChk->SaveValue();
-
-    pAutocloseQuotesChk->SaveValue();
-
-    pAutocloseParenChk->SaveValue();
-
-    pAutoCorrectChk->SaveValue();
-
-    pUseExtendedTypesChk->SaveValue();
+    m_xCodeCompleteChk->save_state();
+    m_xAutocloseProcChk->save_state();
+    m_xAutocloseQuotesChk->save_state();
+    m_xAutocloseParenChk->save_state();
+    m_xAutoCorrectChk->save_state();
+    m_xUseExtendedTypesChk->save_state();
 }
 
 VclPtr<SfxTabPage> SvxBasicIDEOptionsPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet )
 {
-    return VclPtr<SvxBasicIDEOptionsPage>::Create( pParent.pParent, *rAttrSet );
+    return VclPtr<SvxBasicIDEOptionsPage>::Create( pParent, *rAttrSet );
 }
 
 void SvxBasicIDEOptionsPage::FillUserData()
diff --git a/cui/source/options/optbasic.hxx b/cui/source/options/optbasic.hxx
index 4981c89d5e90..0cf509ae2745 100644
--- a/cui/source/options/optbasic.hxx
+++ b/cui/source/options/optbasic.hxx
@@ -26,19 +26,18 @@
 class SvxBasicIDEOptionsPage: public SfxTabPage
 {
 private:
-    VclPtr<CheckBox> pCodeCompleteChk;
-    VclPtr<CheckBox> pAutocloseProcChk;
-    VclPtr<CheckBox> pAutocloseParenChk;
-    VclPtr<CheckBox> pAutocloseQuotesChk;
-    VclPtr<CheckBox> pAutoCorrectChk;
-    VclPtr<CheckBox> pUseExtendedTypesChk;
+    std::unique_ptr<weld::CheckButton> m_xCodeCompleteChk;
+    std::unique_ptr<weld::CheckButton> m_xAutocloseProcChk;
+    std::unique_ptr<weld::CheckButton> m_xAutocloseParenChk;
+    std::unique_ptr<weld::CheckButton> m_xAutocloseQuotesChk;
+    std::unique_ptr<weld::CheckButton> m_xAutoCorrectChk;
+    std::unique_ptr<weld::CheckButton> m_xUseExtendedTypesChk;
 
     void LoadConfig();
 
 public:
-    SvxBasicIDEOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet );
+    SvxBasicIDEOptionsPage(TabPageParent pParent, const SfxItemSet& rSet);
     virtual ~SvxBasicIDEOptionsPage() override;
-    virtual void dispose() override;
 
     static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet );
     virtual bool FillItemSet( SfxItemSet* rSet ) override;


More information about the Libreoffice-commits mailing list