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

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Wed Mar 25 16:37:46 UTC 2020


 cui/source/options/optinet2.cxx |   79 ++++++++++++++--------------------------
 1 file changed, 29 insertions(+), 50 deletions(-)

New commits:
commit d34f54776f51747658556c148eab0d0fc96ea3e0
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Tue Mar 24 22:45:05 2020 +0100
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Wed Mar 25 17:37:12 2020 +0100

    Related tdf#46037: use a bit of simplified config access (cui/optinet2)
    
    Change-Id: Ie784468030bf612ba4209e0619d07032a488f700
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91011
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    Tested-by: Jenkins

diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index a4acc0b96d9f..86a0431e03ad 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -191,61 +191,40 @@ std::unique_ptr<SfxTabPage> SvxProxyTabPage::Create(weld::Container* pPage, weld
 
 void SvxProxyTabPage::ReadConfigData_Impl()
 {
-    try {
-        Reference< container::XNameAccess > xNameAccess(m_xConfigurationUpdateAccess, UNO_QUERY_THROW);
-
-        sal_Int32 nIntValue = 0;
-        OUString  aStringValue;
-
-        if( xNameAccess->getByName(g_aProxyModePN) >>= nIntValue )
-        {
-            m_xProxyModeLB->set_active(nIntValue);
-        }
-
-        if( xNameAccess->getByName(g_aHttpProxyPN) >>= aStringValue )
-        {
-            m_xHttpProxyED->set_text( aStringValue );
-        }
-
-        if( xNameAccess->getByName(g_aHttpPortPN) >>= nIntValue )
-        {
-            m_xHttpPortED->set_text( OUString::number( nIntValue ));
-        }
-
-        if( xNameAccess->getByName(g_aHttpsProxyPN) >>= aStringValue )
-        {
-            m_xHttpsProxyED->set_text( aStringValue );
-        }
-
-        if( xNameAccess->getByName(g_aHttpsPortPN) >>= nIntValue )
-        {
-            m_xHttpsPortED->set_text( OUString::number( nIntValue ));
-        }
-
-        if( xNameAccess->getByName(g_aFtpProxyPN) >>= aStringValue )
-        {
-            m_xFtpProxyED->set_text( aStringValue );
-        }
+    sal_Int32 nIntValue = 0;
 
-        if( xNameAccess->getByName(g_aFtpPortPN) >>= nIntValue )
-        {
-            m_xFtpPortED->set_text( OUString::number( nIntValue ));
-        }
-
-        if( xNameAccess->getByName(g_aNoProxyDescPN) >>= aStringValue )
-        {
-            m_xNoProxyForED->set_text( aStringValue );
-        }
+    std::optional<sal_Int32> x(officecfg::Inet::Settings::ooInetProxyType::get());
+    if (x)
+    {
+        nIntValue = *x;
+        m_xProxyModeLB->set_active(nIntValue);
     }
-    catch (const container::NoSuchElementException&) {
-        SAL_WARN("cui.options", "SvxProxyTabPage::ReadConfigData_Impl: NoSuchElementException caught" );
+
+    m_xHttpProxyED->set_text( officecfg::Inet::Settings::ooInetHTTPProxyName::get() );
+    x = officecfg::Inet::Settings::ooInetHTTPProxyPort::get();
+    if (x)
+    {
+        nIntValue = *x;
+        m_xHttpPortED->set_text( OUString::number( nIntValue ));
     }
-    catch (const css::lang::WrappedTargetException &) {
-        SAL_WARN("cui.options", "SvxProxyTabPage::ReadConfigData_Impl: WrappedTargetException caught" );
+
+    m_xHttpsProxyED->set_text( officecfg::Inet::Settings::ooInetHTTPSProxyName::get() );
+    x = officecfg::Inet::Settings::ooInetHTTPSProxyPort::get();
+    if (x)
+    {
+        nIntValue = *x;
+        m_xHttpsPortED->set_text( OUString::number( nIntValue ));
     }
-    catch (const RuntimeException &) {
-        SAL_WARN("cui.options", "SvxProxyTabPage::ReadConfigData_Impl: RuntimeException caught" );
+
+    m_xFtpProxyED->set_text( officecfg::Inet::Settings::ooInetFTPProxyName::get() );
+    x = officecfg::Inet::Settings::ooInetFTPProxyPort::get();
+    if (x)
+    {
+        nIntValue = *x;
+        m_xFtpPortED->set_text( OUString::number( nIntValue ));
     }
+
+    m_xNoProxyForED->set_text( officecfg::Inet::Settings::ooInetNoProxy::get() );
 }
 
 void SvxProxyTabPage::ReadConfigDefaults_Impl()


More information about the Libreoffice-commits mailing list