summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2015-12-31 10:26:43 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-01-04 14:44:33 +0000
commitf14d64fa71565e86c98348f9c54cc6cab53649d8 (patch)
tree830034b8c4ac9e9bf83f049fabb3138f9a854486 /cui/source
parent549e900b4b0047b8cb6c236ea50a3fc046e5fb51 (diff)
these fields can be static constants
Change-Id: Id56e219782d7f858cdeb26232c7aabd4f643c9d9 Reviewed-on: https://gerrit.libreoffice.org/21020 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/options/optinet2.cxx79
-rw-r--r--cui/source/options/optinet2.hxx9
2 files changed, 40 insertions, 48 deletions
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index abfff4ba14bd..b288c9983407 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -144,6 +144,15 @@ bool SvxNoSpaceEdit::set_property(const OString &rKey, const OString &rValue)
}
+static const char g_aProxyModePN[] = "ooInetProxyType";
+static const char g_aHttpProxyPN[] = "ooInetHTTPProxyName";
+static const char g_aHttpPortPN[] = "ooInetHTTPProxyPort";
+static const char g_aHttpsProxyPN[] = "ooInetHTTPSProxyName";
+static const char g_aHttpsPortPN[] = "ooInetHTTPSProxyPort";
+static const char g_aFtpProxyPN[] = "ooInetFTPProxyName";
+static const char g_aFtpPortPN[] = "ooInetFTPProxyPort";
+static const char g_aNoProxyDescPN[] = "ooInetNoProxy";
+
/********************************************************************/
/* */
/* SvxProxyTabPage */
@@ -152,14 +161,6 @@ bool SvxNoSpaceEdit::set_property(const OString &rKey, const OString &rValue)
SvxProxyTabPage::SvxProxyTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
: SfxTabPage(pParent, "OptProxyPage","cui/ui/optproxypage.ui", &rSet)
- , aProxyModePN("ooInetProxyType")
- , aHttpProxyPN("ooInetHTTPProxyName")
- , aHttpPortPN("ooInetHTTPProxyPort")
- , aHttpsProxyPN("ooInetHTTPSProxyName")
- , aHttpsPortPN("ooInetHTTPSProxyPort")
- , aFtpProxyPN("ooInetFTPProxyName")
- , aFtpPortPN("ooInetFTPProxyPort")
- , aNoProxyDescPN("ooInetNoProxy")
{
get(m_pProxyModeLB, "proxymode");
@@ -247,42 +248,42 @@ void SvxProxyTabPage::ReadConfigData_Impl()
sal_Int32 nIntValue = 0;
OUString aStringValue;
- if( xNameAccess->getByName(aProxyModePN) >>= nIntValue )
+ if( xNameAccess->getByName(g_aProxyModePN) >>= nIntValue )
{
m_pProxyModeLB->SelectEntryPos( nIntValue );
}
- if( xNameAccess->getByName(aHttpProxyPN) >>= aStringValue )
+ if( xNameAccess->getByName(g_aHttpProxyPN) >>= aStringValue )
{
m_pHttpProxyED->SetText( aStringValue );
}
- if( xNameAccess->getByName(aHttpPortPN) >>= nIntValue )
+ if( xNameAccess->getByName(g_aHttpPortPN) >>= nIntValue )
{
m_pHttpPortED->SetText( OUString::number( nIntValue ));
}
- if( xNameAccess->getByName(aHttpsProxyPN) >>= aStringValue )
+ if( xNameAccess->getByName(g_aHttpsProxyPN) >>= aStringValue )
{
m_pHttpsProxyED->SetText( aStringValue );
}
- if( xNameAccess->getByName(aHttpsPortPN) >>= nIntValue )
+ if( xNameAccess->getByName(g_aHttpsPortPN) >>= nIntValue )
{
m_pHttpsPortED->SetText( OUString::number( nIntValue ));
}
- if( xNameAccess->getByName(aFtpProxyPN) >>= aStringValue )
+ if( xNameAccess->getByName(g_aFtpProxyPN) >>= aStringValue )
{
m_pFtpProxyED->SetText( aStringValue );
}
- if( xNameAccess->getByName(aFtpPortPN) >>= nIntValue )
+ if( xNameAccess->getByName(g_aFtpPortPN) >>= nIntValue )
{
m_pFtpPortED->SetText( OUString::number( nIntValue ));
}
- if( xNameAccess->getByName(aNoProxyDescPN) >>= aStringValue )
+ if( xNameAccess->getByName(g_aNoProxyDescPN) >>= aStringValue )
{
m_pNoProxyForED->SetText( aStringValue );
}
@@ -311,37 +312,37 @@ void SvxProxyTabPage::ReadConfigDefaults_Impl()
sal_Int32 nIntValue = 0;
OUString aStringValue;
- if( xPropertyState->getPropertyDefault(aHttpProxyPN) >>= aStringValue )
+ if( xPropertyState->getPropertyDefault(g_aHttpProxyPN) >>= aStringValue )
{
m_pHttpProxyED->SetText( aStringValue );
}
- if( xPropertyState->getPropertyDefault(aHttpPortPN) >>= nIntValue )
+ if( xPropertyState->getPropertyDefault(g_aHttpPortPN) >>= nIntValue )
{
m_pHttpPortED->SetText( OUString::number( nIntValue ));
}
- if( xPropertyState->getPropertyDefault(aHttpsProxyPN) >>= aStringValue )
+ if( xPropertyState->getPropertyDefault(g_aHttpsProxyPN) >>= aStringValue )
{
m_pHttpsProxyED->SetText( aStringValue );
}
- if( xPropertyState->getPropertyDefault(aHttpsPortPN) >>= nIntValue )
+ if( xPropertyState->getPropertyDefault(g_aHttpsPortPN) >>= nIntValue )
{
m_pHttpsPortED->SetText( OUString::number( nIntValue ));
}
- if( xPropertyState->getPropertyDefault(aFtpProxyPN) >>= aStringValue )
+ if( xPropertyState->getPropertyDefault(g_aFtpProxyPN) >>= aStringValue )
{
m_pFtpProxyED->SetText( aStringValue );
}
- if( xPropertyState->getPropertyDefault(aFtpPortPN) >>= nIntValue )
+ if( xPropertyState->getPropertyDefault(g_aFtpPortPN) >>= nIntValue )
{
m_pFtpPortED->SetText( OUString::number( nIntValue ));
}
- if( xPropertyState->getPropertyDefault(aNoProxyDescPN) >>= aStringValue )
+ if( xPropertyState->getPropertyDefault(g_aNoProxyDescPN) >>= aStringValue )
{
m_pNoProxyForED->SetText( aStringValue );
}
@@ -367,14 +368,14 @@ void SvxProxyTabPage::RestoreConfigDefaults_Impl()
{
Reference< beans::XPropertyState > xPropertyState(m_xConfigurationUpdateAccess, UNO_QUERY_THROW);
- xPropertyState->setPropertyToDefault(aProxyModePN);
- xPropertyState->setPropertyToDefault(aHttpProxyPN);
- xPropertyState->setPropertyToDefault(aHttpPortPN);
- xPropertyState->setPropertyToDefault(aHttpsProxyPN);
- xPropertyState->setPropertyToDefault(aHttpsPortPN);
- xPropertyState->setPropertyToDefault(aFtpProxyPN);
- xPropertyState->setPropertyToDefault(aFtpPortPN);
- xPropertyState->setPropertyToDefault(aNoProxyDescPN);
+ xPropertyState->setPropertyToDefault(g_aProxyModePN);
+ xPropertyState->setPropertyToDefault(g_aHttpProxyPN);
+ xPropertyState->setPropertyToDefault(g_aHttpPortPN);
+ xPropertyState->setPropertyToDefault(g_aHttpsProxyPN);
+ xPropertyState->setPropertyToDefault(g_aHttpsPortPN);
+ xPropertyState->setPropertyToDefault(g_aFtpProxyPN);
+ xPropertyState->setPropertyToDefault(g_aFtpPortPN);
+ xPropertyState->setPropertyToDefault(g_aNoProxyDescPN);
Reference< util::XChangesBatch > xChangesBatch(m_xConfigurationUpdateAccess, UNO_QUERY_THROW);
xChangesBatch->commitChanges();
@@ -427,50 +428,50 @@ bool SvxProxyTabPage::FillItemSet(SfxItemSet* )
return true;
}
- xPropertySet->setPropertyValue(aProxyModePN,
+ xPropertySet->setPropertyValue(g_aProxyModePN,
makeAny((sal_Int32) nSelPos));
bModified = true;
}
if(m_pHttpProxyED->IsValueChangedFromSaved())
{
- xPropertySet->setPropertyValue( aHttpProxyPN, makeAny(m_pHttpProxyED->GetText()));
+ xPropertySet->setPropertyValue( g_aHttpProxyPN, makeAny(m_pHttpProxyED->GetText()));
bModified = true;
}
if ( m_pHttpPortED->IsValueChangedFromSaved())
{
- xPropertySet->setPropertyValue( aHttpPortPN, makeAny(m_pHttpPortED->GetText().toInt32()));
+ xPropertySet->setPropertyValue( g_aHttpPortPN, makeAny(m_pHttpPortED->GetText().toInt32()));
bModified = true;
}
if( m_pHttpsProxyED->IsValueChangedFromSaved() )
{
- xPropertySet->setPropertyValue( aHttpsProxyPN, makeAny(m_pHttpsProxyED->GetText()) );
+ xPropertySet->setPropertyValue( g_aHttpsProxyPN, makeAny(m_pHttpsProxyED->GetText()) );
bModified = true;
}
if ( m_pHttpsPortED->IsValueChangedFromSaved() )
{
- xPropertySet->setPropertyValue( aHttpsPortPN, makeAny(m_pHttpsPortED->GetText().toInt32()) );
+ xPropertySet->setPropertyValue( g_aHttpsPortPN, makeAny(m_pHttpsPortED->GetText().toInt32()) );
bModified = true;
}
if( m_pFtpProxyED->IsValueChangedFromSaved())
{
- xPropertySet->setPropertyValue( aFtpProxyPN, makeAny(m_pFtpProxyED->GetText()) );
+ xPropertySet->setPropertyValue( g_aFtpProxyPN, makeAny(m_pFtpProxyED->GetText()) );
bModified = true;
}
if ( m_pFtpPortED->IsValueChangedFromSaved() )
{
- xPropertySet->setPropertyValue( aFtpPortPN, makeAny(m_pFtpPortED->GetText().toInt32()));
+ xPropertySet->setPropertyValue( g_aFtpPortPN, makeAny(m_pFtpPortED->GetText().toInt32()));
bModified = true;
}
if ( m_pNoProxyForED->IsValueChangedFromSaved() )
{
- xPropertySet->setPropertyValue( aNoProxyDescPN, makeAny( m_pNoProxyForED->GetText()));
+ xPropertySet->setPropertyValue( g_aNoProxyDescPN, makeAny( m_pNoProxyForED->GetText()));
bModified = true;
}
diff --git a/cui/source/options/optinet2.hxx b/cui/source/options/optinet2.hxx
index 57236c0d7f26..16fc4c94aaf6 100644
--- a/cui/source/options/optinet2.hxx
+++ b/cui/source/options/optinet2.hxx
@@ -79,15 +79,6 @@ private:
VclPtr<Edit> m_pNoProxyForED;
VclPtr<FixedText> m_pNoProxyDescFT;
- const OUString aProxyModePN;
- const OUString aHttpProxyPN;
- const OUString aHttpPortPN;
- const OUString aHttpsProxyPN;
- const OUString aHttpsPortPN;
- const OUString aFtpProxyPN;
- const OUString aFtpPortPN;
- const OUString aNoProxyDescPN;
-
css::uno::Reference< css::uno::XInterface > m_xConfigurationUpdateAccess;
void EnableControls_Impl(bool bEnable);