Index: sfx2/source/appl/appserv.cxx =================================================================== RCS file: /cvs/framework/sfx2/source/appl/appserv.cxx,v retrieving revision 1.75 diff -u -r1.75 appserv.cxx --- sfx2/source/appl/appserv.cxx 11 Apr 2008 12:00:36 -0000 1.75 +++ sfx2/source/appl/appserv.cxx 6 May 2008 08:01:08 -0000 @@ -438,12 +438,38 @@ case SID_ABOUT: { ::rtl::OUString aDefault; - String aVerId( utl::Bootstrap::getBuildIdData( aDefault )); + String aBuildId( utl::Bootstrap::getBuildIdData( aDefault )); + String aProductSource( utl::Bootstrap::getProductSource( aDefault )); - OSL_ENSURE( aVerId.Len() != 0, "No BUILDID in bootstrap file" ); + OSL_ENSURE( aBuildId.Len() != 0, "No BUILDID in bootstrap file" ); + OSL_ENSURE( aProductSource.Len() != 0, "No ProductSource in bootstrap file" ); - String aVersion( '[' ); - ( aVersion += aVerId ) += ']'; + // the product source is something like "DEV300", where the + // build id is something like "300m12(Build:12345)". For better readability, + // strip the duplicate UPD ("300"). + if ( aProductSource.Len() ) + { + bool bMatchingUPD = + ( aProductSource.Len() >= 3 ) + && ( aBuildId.Len() >= 3 ) + && ( aProductSource.Copy( aProductSource.Len() - 3 ) == aBuildId.Copy( 0, 3 ) ); + OSL_ENSURE( bMatchingUPD, "BUILDID and ProductSource do not match in their UPD" ); + if ( bMatchingUPD ) + { + aProductSource = aProductSource.Copy( 0, aProductSource.Len() - 3 ); + } + + // prepend the product source + aBuildId.Insert( aProductSource, 0 ); + } + + // the build id format is "milestone(build)[cwsname]". For readability, it would + // be nice to have some more spaces in there. + xub_StrLen nPos = 0; + if ( ( nPos = aBuildId.Search( sal_Unicode( '(' ) ) ) != STRING_NOTFOUND ) + aBuildId.Insert( sal_Unicode( ' ' ), nPos ); + if ( ( nPos = aBuildId.Search( sal_Unicode( '[' ) ) ) != STRING_NOTFOUND ) + aBuildId.Insert( sal_Unicode( ' ' ), nPos ); // About-Dialog suchen ResId aDialogResId( RID_DEFAULTABOUT, *pAppData_Impl->pLabelResMgr ); @@ -458,7 +484,7 @@ } // About-Dialog anzeigen - AboutDialog* pDlg = new AboutDialog( 0, aDialogResId, aVersion ); + AboutDialog* pDlg = new AboutDialog( 0, aDialogResId, aBuildId ); pDlg->Execute(); delete pDlg; bDone = TRUE; Index: unotools/inc/unotools/bootstrap.hxx =================================================================== RCS file: /cvs/util/unotools/inc/unotools/bootstrap.hxx,v retrieving revision 1.13 diff -u -r1.13 bootstrap.hxx --- unotools/inc/unotools/bootstrap.hxx 11 Apr 2008 13:05:29 -0000 1.13 +++ unotools/inc/unotools/bootstrap.hxx 6 May 2008 08:01:25 -0000 @@ -53,6 +53,10 @@ /// retrieve the product key; defaults to executable name (without extension) static rtl::OUString getProductKey(); + + /// retrieve the product source (MWS name) + static ::rtl::OUString getProductSource(rtl::OUString const& _sDefault); + /// retrieve the product key; uses the given default, if not found static rtl::OUString getProductKey(rtl::OUString const& _sDefault); Index: unotools/source/config/bootstrap.cxx =================================================================== RCS file: /cvs/util/unotools/source/config/bootstrap.cxx,v retrieving revision 1.25 diff -u -r1.25 bootstrap.cxx --- unotools/source/config/bootstrap.cxx 11 Apr 2008 13:22:23 -0000 1.25 +++ unotools/source/config/bootstrap.cxx 6 May 2008 08:01:28 -0000 @@ -53,6 +53,7 @@ #define BOOTSTRAP_DATA_NAME SAL_CONFIGFILE("bootstrap") #define BOOTSTRAP_ITEM_PRODUCT_KEY "ProductKey" +#define BOOTSTRAP_ITEM_PRODUCT_SOURCE "ProductSource" #define BOOTSTRAP_ITEM_VERSIONFILE "Location" #define BOOTSTRAP_ITEM_LOGO "Logo" #define BOOTSTRAP_ITEM_BUILDID "buildid" @@ -677,6 +678,17 @@ } // --------------------------------------------------------------------------------------- +OUString Bootstrap::getProductSource(OUString const& _sDefault) +{ + OUString const csProductSourceItem(RTL_CONSTASCII_USTRINGPARAM(BOOTSTRAP_ITEM_PRODUCT_SOURCE)); + + OUString sProductSource; + // read ProductSource from version.ini (versionrc) + data().getVersionValue( csProductSourceItem, sProductSource, _sDefault ); + return sProductSource; +} +// --------------------------------------------------------------------------------------- + OUString Bootstrap::getProductPatchLevel(OUString const& _sDefault) { OUString const csBuildIdItem(RTL_CONSTASCII_USTRINGPARAM(BOOTSTRAP_ITEM_PRODUCT_PATCH_LEVEL));