diff options
author | Rüdiger Timm <rt@openoffice.org> | 2008-06-20 06:11:31 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2008-06-20 06:11:31 +0000 |
commit | 499a1613b28b32d3a6f4adc6d6cee1e0ecc6fc91 (patch) | |
tree | a49911ce7af818a9dba7748ea8e8fd3164f4efa5 /sfx2/source | |
parent | a2176f8d86a3464f1f2ef0a2760949887079721d (diff) |
INTEGRATION: CWS fwk88 (1.75.20); FILE MERGED
2008/05/26 11:45:47 pb 1.75.20.2: fix: #i89054# about box: prepend the mws name to the build id
2008/05/22 09:07:44 pb 1.75.20.1: fix: #i76868# no squared brackets around the build id anymore (aboutbox)
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index d3e5697a6e21..7e708f906e6b 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: appserv.cxx,v $ - * $Revision: 1.76 $ + * $Revision: 1.77 $ * * This file is part of OpenOffice.org. * @@ -439,15 +439,38 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - case SID_ABOUT: { - ::rtl::OUString aDefault; - String aVerId( utl::Bootstrap::getBuildIdData( aDefault )); - - OSL_ENSURE( aVerId.Len() != 0, "No BUILDID in bootstrap file" ); + ::rtl::OUString sDefault; + String sBuildId( utl::Bootstrap::getBuildIdData( sDefault ) ); + OSL_ENSURE( sBuildId.Len() > 0, "No BUILDID in bootstrap file" ); + String sProductSource( utl::Bootstrap::getProductSource( sDefault ) ); + OSL_ENSURE( sProductSource.Len() > 0, "No ProductSource in bootstrap file" ); + + // 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 ( sProductSource.Len() ) + { + bool bMatchingUPD = + ( sProductSource.Len() >= 3 ) + && ( sBuildId.Len() >= 3 ) + && ( sProductSource.Copy( sProductSource.Len() - 3 ) == sBuildId.Copy( 0, 3 ) ); + OSL_ENSURE( bMatchingUPD, "BUILDID and ProductSource do not match in their UPD" ); + if ( bMatchingUPD ) + sProductSource = sProductSource.Copy( 0, sProductSource.Len() - 3 ); + + // prepend the product source + sBuildId.Insert( sProductSource, 0 ); + } - String aVersion( '[' ); - ( aVersion += aVerId ) += ']'; + // 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 = sBuildId.Search( sal_Unicode( '(' ) ) ) != STRING_NOTFOUND ) + sBuildId.Insert( sal_Unicode( ' ' ), nPos ); + if ( ( nPos = sBuildId.Search( sal_Unicode( '[' ) ) ) != STRING_NOTFOUND ) + sBuildId.Insert( sal_Unicode( ' ' ), nPos ); - // About-Dialog suchen + // search for the resource of the about box ResId aDialogResId( RID_DEFAULTABOUT, *pAppData_Impl->pLabelResMgr ); ResMgr* pResMgr = pAppData_Impl->pLabelResMgr; if( ! pResMgr->IsAvailable( aDialogResId.SetRT( RSC_MODALDIALOG ) ) ) @@ -456,11 +479,11 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) aDialogResId.SetResMgr( pResMgr ); if ( !pResMgr->IsAvailable( aDialogResId ) ) { - DBG_ERROR( "No RID_DEFAULTABOUT in label-resource-dll" ); + DBG_ERRORFILE( "No RID_DEFAULTABOUT in label-resource-dll" ); } - // About-Dialog anzeigen - AboutDialog* pDlg = new AboutDialog( 0, aDialogResId, aVersion ); + // then show the about box + AboutDialog* pDlg = new AboutDialog( 0, aDialogResId, sBuildId ); pDlg->Execute(); delete pDlg; bDone = TRUE; |