diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2005-09-28 12:22:00 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2005-09-28 12:22:00 +0000 |
commit | f9e6d8d7c33a308f6f1c15929dd839de2abae3b5 (patch) | |
tree | 2e40ce0d8c80421e67f037c8e7479fad4667e141 /unotools | |
parent | d3dd7087dee2d2df2bc2f001c92217be1fd5f195 (diff) |
INTEGRATION: CWS nativefixer18 (1.17.18); FILE MERGED
2005/09/26 16:32:31 is 1.17.18.2: RESYNC: (1.17-1.18); FILE MERGED
2005/08/04 11:30:02 pb 1.17.18.1: fix: #124825# read build id from version.ini
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/bootstrap.cxx | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/unotools/source/config/bootstrap.cxx b/unotools/source/config/bootstrap.cxx index 8cdfa70b8dc7..55523daed355 100644 --- a/unotools/source/config/bootstrap.cxx +++ b/unotools/source/config/bootstrap.cxx @@ -4,9 +4,9 @@ * * $RCSfile: bootstrap.cxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: rt $ $Date: 2005-09-09 09:41:19 $ + * last change: $Author: hr $ $Date: 2005-09-28 13:22:00 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -149,6 +149,7 @@ namespace utl // access helper OUString getBootstrapValue(OUString const& _sName, OUString const& _sDefault) const; + sal_Bool getVersionValue(OUString const& _sName, OUString& _rValue, OUString const& _sDefault) const; OUString getImplName() const { return m_aImplName; } @@ -699,7 +700,13 @@ OUString Bootstrap::getBuildIdData(OUString const& _sDefault) { OUString const csBuildIdItem(RTL_CONSTASCII_USTRINGPARAM(BOOTSTRAP_ITEM_BUILDID)); - return data().getBootstrapValue( csBuildIdItem, _sDefault ); + OUString sBuildId; + // read buildid from version.ini (versionrc), if it doesn't exist or buildid is empty + if ( data().getVersionValue( csBuildIdItem, sBuildId, _sDefault ) != sal_True || + sBuildId.getLength() == 0 ) + // read buildid from bootstrap.ini (bootstraprc) + sBuildId = data().getBootstrapValue( csBuildIdItem, _sDefault ); + return sBuildId; } // --------------------------------------------------------------------------------------- @@ -932,5 +939,20 @@ OUString Bootstrap::Impl::getBootstrapValue(OUString const& _sName, OUString con } // --------------------------------------------------------------------------------------- +sal_Bool Bootstrap::Impl::getVersionValue(OUString const& _sName, OUString& _rValue, OUString const& _sDefault) const +{ + // try to open version.ini (versionrc) + rtl::Bootstrap aData( getExecutableDirectory() + + OUString(RTL_CONSTASCII_USTRINGPARAM("/"SAL_CONFIGFILE("version"))) ); + if ( aData.getHandle() == NULL ) + // version.ini (versionrc) doesn't exist + return sal_False; + + // read value + aData.getFrom(_sName,_rValue,_sDefault); + return sal_True; +} +// --------------------------------------------------------------------------------------- + } // namespace utl |