summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sfx2/source/appl/appserv.cxx45
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;