summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-27 09:11:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-09-27 11:02:56 +0200
commitcc1ed7fbce20f90650f96acc2846b6f232c8ab0f (patch)
treefcd441cdf9568861363894f63107967adf571f81 /sw
parentb50f595b34585f2927adfd44b4eaaafb8f600972 (diff)
loplugin:flatten in various
Change-Id: I42dca691ffadbddad38a7e8f978b1da9d5d9a7b0 Reviewed-on: https://gerrit.libreoffice.org/42842 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/vba/vbasystem.cxx30
1 files changed, 14 insertions, 16 deletions
diff --git a/sw/source/ui/vba/vbasystem.cxx b/sw/source/ui/vba/vbasystem.cxx
index 7781f6660c65..95eec3f1ed2e 100644
--- a/sw/source/ui/vba/vbasystem.cxx
+++ b/sw/source/ui/vba/vbasystem.cxx
@@ -90,14 +90,7 @@ uno::Any PrivateProfileStringListener::getValueEvent()
{
// get the private profile string
OUString sValue;
- if(!maFileName.isEmpty())
- {
- // get key/value from a file
- Config aCfg( maFileName );
- aCfg.SetGroup( maGroupName );
- sValue = OStringToOUString(aCfg.ReadKey(maKey), RTL_TEXTENCODING_DONTKNOW);
- }
- else
+ if(maFileName.isEmpty())
{
// get key/value from Windows registry
#ifdef _WIN32
@@ -129,6 +122,12 @@ uno::Any PrivateProfileStringListener::getValueEvent()
#endif
}
+ // get key/value from a file
+ Config aCfg( maFileName );
+ aCfg.SetGroup( maGroupName );
+ sValue = OStringToOUString(aCfg.ReadKey(maKey), RTL_TEXTENCODING_DONTKNOW);
+
+
return uno::makeAny( sValue );
}
@@ -137,14 +136,7 @@ void PrivateProfileStringListener::setValueEvent( const css::uno::Any& value )
// set the private profile string
OUString aValue;
value >>= aValue;
- if(!maFileName.isEmpty())
- {
- // set value into a file
- Config aCfg( maFileName );
- aCfg.SetGroup( maGroupName );
- aCfg.WriteKey( maKey, OUStringToOString(aValue, RTL_TEXTENCODING_DONTKNOW) );
- }
- else
+ if(maFileName.isEmpty())
{
//set value into Windows registry
#ifdef _WIN32
@@ -172,6 +164,12 @@ void PrivateProfileStringListener::setValueEvent( const css::uno::Any& value )
#endif
}
+ // set value into a file
+ Config aCfg( maFileName );
+ aCfg.SetGroup( maGroupName );
+ aCfg.WriteKey( maKey, OUStringToOString(aValue, RTL_TEXTENCODING_DONTKNOW) );
+
+
}
SwVbaSystem::SwVbaSystem( uno::Reference<uno::XComponentContext > const & xContext ): SwVbaSystem_BASE( uno::Reference< XHelperInterface >(), xContext )