summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-08-19 15:22:34 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-08-19 17:25:31 +0200
commit3a5a81e74308c03b2cf774cccb78f3a102d5be72 (patch)
tree30ee2ea7c2daaf491130030863285595d2974941 /unotools
parent6ee46adb446f5350df2b1efc7fc3ffe2506dfaa0 (diff)
Fold Bootstrap::Impl::getVersionValue into its single use
...thereby fixing that it returns _sDefault instead of an empty string when "version.ini (versionrc) doesn't exist" Change-Id: Ie38afb6d87bd908f8a9773daaf5cee56751ae950 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101000 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/config/bootstrap.cxx28
1 files changed, 10 insertions, 18 deletions
diff --git a/unotools/source/config/bootstrap.cxx b/unotools/source/config/bootstrap.cxx
index 24a5752d3fc1..eccf92f696ad 100644
--- a/unotools/source/config/bootstrap.cxx
+++ b/unotools/source/config/bootstrap.cxx
@@ -99,7 +99,6 @@ public: // construction and initialization
// access helper
OUString getBootstrapValue(OUString const& _sName, OUString const& _sDefault) const;
- static bool getVersionValue(OUString const& _sName, OUString& _rValue, OUString const& _sDefault);
const OUString& getImplName() const { return m_aImplName; }
@@ -543,9 +542,17 @@ OUString Bootstrap::getProductKey(OUString const& _sDefault)
OUString Bootstrap::getBuildIdData(OUString const& _sDefault)
{
+ // try to open version.ini (versionrc)
+ OUString uri;
+ rtl::Bootstrap::get( "BRAND_BASE_DIR", uri);
+ rtl::Bootstrap aData( uri + "/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("version") );
+ if ( aData.getHandle() == nullptr )
+ // version.ini (versionrc) doesn't exist
+ return _sDefault;
+
+ // read value
OUString sBuildId;
- // read buildid from version.ini (versionrc)
- utl::Bootstrap::Impl::getVersionValue( BOOTSTRAP_ITEM_BUILDID, sBuildId, _sDefault );
+ aData.getFrom(BOOTSTRAP_ITEM_BUILDID,sBuildId,_sDefault);
return sBuildId;
}
@@ -703,21 +710,6 @@ OUString Bootstrap::Impl::getBootstrapValue(OUString const& _sName, OUString con
return sResult;
}
-bool Bootstrap::Impl::getVersionValue(OUString const& _sName, OUString& _rValue, OUString const& _sDefault)
-{
- // try to open version.ini (versionrc)
- OUString uri;
- rtl::Bootstrap::get( "BRAND_BASE_DIR", uri);
- rtl::Bootstrap aData( uri + "/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("version") );
- if ( aData.getHandle() == nullptr )
- // version.ini (versionrc) doesn't exist
- return false;
-
- // read value
- aData.getFrom(_sName,_rValue,_sDefault);
- return true;
-}
-
} // namespace utl
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */