From 499a1613b28b32d3a6f4adc6d6cee1e0ecc6fc91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Timm?= Date: Fri, 20 Jun 2008 06:11:31 +0000 Subject: [PATCH] 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) --- sfx2/source/appl/appserv.cxx | 43 +++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 10 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 )); + ::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" ); - OSL_ENSURE( aVerId.Len() != 0, "No BUILDID 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 ); - String aVersion( '[' ); - ( aVersion += aVerId ) += ']'; + // prepend the product source + sBuildId.Insert( sProductSource, 0 ); + } - // About-Dialog suchen + // 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 ); + + // 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;