unotools/source/config/bootstrap.cxx |   28 ++++++++++------------------
 1 file changed, 10 insertions(+), 18 deletions(-)

New commits:
commit 3a5a81e74308c03b2cf774cccb78f3a102d5be72
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Wed Aug 19 15:22:34 2020 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Wed Aug 19 17:25:31 2020 +0200

    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 <sberg...@redhat.com>

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: */
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to