diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2008-11-20 11:46:52 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2008-11-20 11:46:52 +0000 |
commit | 4c501d12c5ed530b13d13468316f864394eb73d2 (patch) | |
tree | 9bc7d7bdd78b868ab1b557166c5397e03333e874 /unotools | |
parent | 4d22586d6f0cc0686f3b2c3353818f55a0e7b376 (diff) |
CWS-TOOLING: integrate CWS onlineupdate7_DEV300
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/inc/unotools/configmgr.hxx | 4 | ||||
-rw-r--r-- | unotools/source/config/configmgr.cxx | 51 |
2 files changed, 53 insertions, 2 deletions
diff --git a/unotools/inc/unotools/configmgr.hxx b/unotools/inc/unotools/configmgr.hxx index d9e89b655112..679e90b17249 100644 --- a/unotools/inc/unotools/configmgr.hxx +++ b/unotools/inc/unotools/configmgr.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: configmgr.hxx,v $ - * $Revision: 1.22 $ + * $Revision: 1.22.26.1 $ * * This file is part of OpenOffice.org. * @@ -58,6 +58,8 @@ namespace utl ConfigMgr_Impl* pMgrImpl; static ConfigManager* pConfigManager; + static void getBasisAboutBoxProductVersion( rtl::OUString& rVersion ); + public: ConfigManager(); ConfigManager(com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xConfigProvider); diff --git a/unotools/source/config/configmgr.cxx b/unotools/source/config/configmgr.cxx index a2965b91a6ef..6a5d163871cd 100644 --- a/unotools/source/config/configmgr.cxx +++ b/unotools/source/config/configmgr.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: configmgr.cxx,v $ - * $Revision: 1.47 $ + * $Revision: 1.47.14.1 $ * * This file is part of OpenOffice.org. * @@ -58,6 +58,8 @@ using namespace com::sun::star::beans; using namespace com::sun::star::container; #define C2U(cChar) OUString::createFromAscii(cChar) +#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) + //----------------------------------------------------------------------------- const char* cConfigBaseURL = "/org.openoffice."; //const char* cConfigBaseURL = "/com.sun.star."; @@ -567,7 +569,11 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp) aRet >>= rProductVersion; if ( eProp == ABOUTBOXPRODUCTVERSION ) + { aRet >>= rAboutBoxProductVersion; + getBasisAboutBoxProductVersion( rAboutBoxProductVersion ); + aRet <<= rAboutBoxProductVersion; + } if ( eProp == PRODUCTEXTENSION ) aRet >>= rProductExtension; @@ -580,6 +586,49 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp) return aRet; } + +/*---------------------------------------------------------------------------*/ +void ConfigManager::getBasisAboutBoxProductVersion( OUString& rVersion ) +{ + rtl::OUString aPackageVersion = UNISTRING( "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("version") ":OOOPackageVersion}" ); + rtl::Bootstrap::expandMacros( aPackageVersion ); + + if ( aPackageVersion.getLength() ) + { + sal_Int32 nTokIndex = 0; + rtl::OUString aVersionMinor = aPackageVersion.getToken( 1, '.', nTokIndex ); + rtl::OUString aVersionMicro; + + if ( nTokIndex > 0 ) + aVersionMicro = aPackageVersion.getToken( 0, '.', nTokIndex ); + + if ( aVersionMinor.getLength() == 0 ) + aVersionMinor = UNISTRING( "0" ); + if ( aVersionMicro.getLength() == 0 ) + aVersionMicro = UNISTRING( "0" ); + + sal_Int32 nIndex = rVersion.indexOf( '.' ); + if ( nIndex == -1 ) + { + rVersion += UNISTRING( "." ); + rVersion += aVersionMinor; + } + else + { + nIndex = rVersion.indexOf( '.', nIndex+1 ); + } + if ( nIndex == -1 ) + { + rVersion += UNISTRING( "." ); + rVersion += aVersionMicro; + } + else + { + rVersion = rVersion.replaceAt( nIndex+1, rVersion.getLength()-nIndex-1, aVersionMicro ); + } + } +} + /* -----------------------------12.12.00 17:22-------------------------------- ---------------------------------------------------------------------------*/ |