View | Details | Raw Unified | Return to issue 89054
Collapse All | Expand All

(-)sfx2/source/appl/appserv.cxx (-5 / +31 lines)
Lines 438-449 Link Here
438
		case SID_ABOUT:
438
		case SID_ABOUT:
439
		{
439
		{
440
            ::rtl::OUString aDefault;
440
            ::rtl::OUString aDefault;
441
            String          aVerId( utl::Bootstrap::getBuildIdData( aDefault ));
441
            String          aBuildId( utl::Bootstrap::getBuildIdData( aDefault ));
442
            String          aProductSource( utl::Bootstrap::getProductSource( aDefault ));
442
443
443
            OSL_ENSURE( aVerId.Len() != 0, "No BUILDID in bootstrap file" );
444
            OSL_ENSURE( aBuildId.Len() != 0, "No BUILDID in bootstrap file" );
445
            OSL_ENSURE( aProductSource.Len() != 0, "No ProductSource in bootstrap file" );
444
446
445
            String aVersion( '[' );
447
            // the product source is something like "DEV300", where the
446
            ( aVersion += aVerId ) += ']';
448
            // build id is something like "300m12(Build:12345)". For better readability,
449
            // strip the duplicate UPD ("300").
450
            if ( aProductSource.Len() )
451
            {
452
                bool bMatchingUPD =
453
                        ( aProductSource.Len() >= 3 )
454
                    &&  ( aBuildId.Len() >= 3 )
455
                    &&  ( aProductSource.Copy( aProductSource.Len() - 3 ) == aBuildId.Copy( 0, 3 ) );
456
                OSL_ENSURE( bMatchingUPD, "BUILDID and ProductSource do not match in their UPD" );
457
                if ( bMatchingUPD )
458
                {
459
                    aProductSource = aProductSource.Copy( 0, aProductSource.Len() - 3 );
460
                }
461
462
                // prepend the product source
463
                aBuildId.Insert( aProductSource, 0 );
464
            }
465
466
            // the build id format is "milestone(build)[cwsname]". For readability, it would
467
            // be nice to have some more spaces in there.
468
            xub_StrLen nPos = 0;
469
            if ( ( nPos = aBuildId.Search( sal_Unicode( '(' ) ) ) != STRING_NOTFOUND )
470
                aBuildId.Insert( sal_Unicode( ' ' ), nPos );
471
            if ( ( nPos = aBuildId.Search( sal_Unicode( '[' ) ) ) != STRING_NOTFOUND )
472
                aBuildId.Insert( sal_Unicode( ' ' ), nPos );
447
473
448
            // About-Dialog suchen
474
            // About-Dialog suchen
449
            ResId aDialogResId( RID_DEFAULTABOUT, *pAppData_Impl->pLabelResMgr );
475
            ResId aDialogResId( RID_DEFAULTABOUT, *pAppData_Impl->pLabelResMgr );
Lines 458-464 Link Here
458
            }
484
            }
459
485
460
            // About-Dialog anzeigen
486
            // About-Dialog anzeigen
461
            AboutDialog* pDlg = new AboutDialog( 0, aDialogResId, aVersion );
487
            AboutDialog* pDlg = new AboutDialog( 0, aDialogResId, aBuildId );
462
			pDlg->Execute();
488
			pDlg->Execute();
463
			delete pDlg;
489
			delete pDlg;
464
			bDone = TRUE;
490
			bDone = TRUE;
(-)unotools/inc/unotools/bootstrap.hxx (+4 lines)
Lines 53-58 Link Here
53
53
54
        /// retrieve the product key; defaults to executable name (without extension)
54
        /// retrieve the product key; defaults to executable name (without extension)
55
        static rtl::OUString getProductKey();
55
        static rtl::OUString getProductKey();
56
57
        /// retrieve the product source (MWS name)
58
        static ::rtl::OUString getProductSource(rtl::OUString const& _sDefault);
59
56
        /// retrieve the product key; uses the given default, if not found
60
        /// retrieve the product key; uses the given default, if not found
57
        static rtl::OUString getProductKey(rtl::OUString const& _sDefault); 
61
        static rtl::OUString getProductKey(rtl::OUString const& _sDefault); 
58
62
(-)unotools/source/config/bootstrap.cxx (+12 lines)
Lines 53-58 Link Here
53
#define BOOTSTRAP_DATA_NAME                 SAL_CONFIGFILE("bootstrap")
53
#define BOOTSTRAP_DATA_NAME                 SAL_CONFIGFILE("bootstrap")
54
54
55
#define BOOTSTRAP_ITEM_PRODUCT_KEY			"ProductKey"
55
#define BOOTSTRAP_ITEM_PRODUCT_KEY			"ProductKey"
56
#define BOOTSTRAP_ITEM_PRODUCT_SOURCE       "ProductSource"
56
#define BOOTSTRAP_ITEM_VERSIONFILE			"Location"
57
#define BOOTSTRAP_ITEM_VERSIONFILE			"Location"
57
#define BOOTSTRAP_ITEM_LOGO					"Logo"
58
#define BOOTSTRAP_ITEM_LOGO					"Logo"
58
#define BOOTSTRAP_ITEM_BUILDID				"buildid"
59
#define BOOTSTRAP_ITEM_BUILDID				"buildid"
Lines 677-682 Link Here
677
}
678
}
678
// ---------------------------------------------------------------------------------------
679
// ---------------------------------------------------------------------------------------
679
680
681
OUString Bootstrap::getProductSource(OUString const& _sDefault)
682
{
683
    OUString const csProductSourceItem(RTL_CONSTASCII_USTRINGPARAM(BOOTSTRAP_ITEM_PRODUCT_SOURCE));
684
685
    OUString sProductSource;
686
    // read ProductSource from version.ini (versionrc)
687
    data().getVersionValue( csProductSourceItem, sProductSource, _sDefault );
688
    return sProductSource;
689
}
690
// ---------------------------------------------------------------------------------------
691
680
OUString Bootstrap::getProductPatchLevel(OUString const& _sDefault)
692
OUString Bootstrap::getProductPatchLevel(OUString const& _sDefault)
681
{
693
{
682
    OUString const csBuildIdItem(RTL_CONSTASCII_USTRINGPARAM(BOOTSTRAP_ITEM_PRODUCT_PATCH_LEVEL));
694
    OUString const csBuildIdItem(RTL_CONSTASCII_USTRINGPARAM(BOOTSTRAP_ITEM_PRODUCT_PATCH_LEVEL));

Return to issue 89054