Anonymous avatar Anonymous committed 625d466

CWS-TOOLING: integrate CWS onlineupdate7_DEV300

Comments (0)

Files changed (10)

extensions/source/update/check/updatecheck.cxx

  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: updatecheck.cxx,v $
- * $Revision: 1.21 $
+ * $Revision: 1.21.76.1 $
  *
  * This file is part of OpenOffice.org.
  *
 namespace 
 { 
 
-static rtl::OUString getBootstrapValue(const rtl::OUString& aFile, const rtl::OUString& aValue)
-{    
-    rtl::OUString aPath, aRet;
-    if( rtl::Bootstrap::get(UNISTRING("BRAND_BASE_DIR"), aPath) )
-    {
-        aPath  += UNISTRING("/program/");
-        aPath  += aFile;
-
-        rtl::Bootstrap aVersionFile(aPath);
-        aVersionFile.getFrom(aValue, aRet, rtl::OUString());
-    }
-    return aRet;
+static inline rtl::OUString getBuildId()
+{
+	rtl::OUString aPathVal(UNISTRING("${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("version") ":buildid}"));
+	rtl::Bootstrap::expandMacros(aPathVal);
+	return aPathVal;
 }
 
 //------------------------------------------------------------------------------
-
-static inline rtl::OUString getBuildId()
-{
-    return getBootstrapValue(UNISTRING( SAL_CONFIGFILE( "version" ) ), UNISTRING("buildid") );
-}
-
-//------------------------------------------------------------------------------
-
 static inline rtl::OUString getBaseInstallation()
 {
-    return getBootstrapValue(UNISTRING( SAL_CONFIGFILE( "bootstrap" ) ), UNISTRING("BaseInstallation") );
+	rtl::OUString aPathVal(UNISTRING("${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("bootstrap") ":BaseInstallation}"));
+	rtl::Bootstrap::expandMacros(aPathVal);
+	return aPathVal;
 }
 
 //------------------------------------------------------------------------------

extensions/source/update/check/updatehdl.cxx

 #include "osl/thread.hxx"
 #include "osl/file.hxx"
 #include "rtl/ustring.hxx"
+#include "rtl/bootstrap.hxx"
 
 #include "com/sun/star/uno/Sequence.h"
 
         sString = UNISTRING("Missing ") + sKey;
     }
 
-    searchAndReplaceAll( sString, UNISTRING( "%PRODUCTNAME" ), msProductName );
-    searchAndReplaceAll( sString, UNISTRING( "%PRODUCTVERSION" ), msProductVersion );
-
     return sString;
 }
 
 
     if ( !xBundle.is() ) return;
 
-    getProductName();
-
     msChecking      = loadString( xBundle, RID_UPDATE_STR_CHECKING );
     msCheckingError = loadString( xBundle, RID_UPDATE_STR_CHECKING_ERR );
     msNoUpdFound    = loadString( xBundle, RID_UPDATE_STR_NO_UPD_FOUND );
+
     msUpdFound      = loadString( xBundle, RID_UPDATE_STR_UPD_FOUND );
+    setFullVersion( msUpdFound );
+
     msDlgTitle      = loadString( xBundle, RID_UPDATE_STR_DLG_TITLE );
     msDownloadPause = loadString( xBundle, RID_UPDATE_STR_DOWNLOAD_PAUSE );
     msDownloadError = loadString( xBundle, RID_UPDATE_STR_DOWNLOAD_ERR );
 }
 
 //--------------------------------------------------------------------
-void UpdateHandler::getProductName()
+void UpdateHandler::setFullVersion( rtl::OUString& rString )
 {
     if( !mxContext.is() )
         throw uno::RuntimeException( UNISTRING( "getProductName: empty component context" ), *this );
                                                                          aArgumentList );                                    
 
     uno::Reference< container::XNameAccess > xNameAccess( xConfigAccess, uno::UNO_QUERY_THROW );
-    rtl::OUString aProductName;
 
-    xNameAccess->getByName(UNISTRING("ooName")) >>= msProductName;
-    xNameAccess->getByName(UNISTRING("ooSetupVersion")) >>= msProductVersion;
+    rtl::OUString aProductVersion;
+    rtl::OUString aProductFullVersion;
+
+    xNameAccess->getByName(UNISTRING("ooSetupVersion")) >>= aProductVersion;
+    aProductFullVersion = aProductVersion;
+
+    sal_Int32 nVerIndex = rString.indexOf( aProductVersion );
+    if ( nVerIndex != -1 )
+    {
+        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 = aProductFullVersion.indexOf( '.' );
+            if ( nIndex == -1 )
+            {
+                aProductFullVersion += UNISTRING( "." );
+                aProductFullVersion += aVersionMinor;
+            }
+            else
+            {
+                nIndex = aProductFullVersion.indexOf( '.', nIndex+1 );
+            }
+            if ( nIndex == -1 )
+            {
+                aProductFullVersion += UNISTRING( "." );
+                aProductFullVersion += aVersionMicro;
+            }
+            else
+            {
+                aProductFullVersion = aProductFullVersion.replaceAt( nIndex+1, aProductFullVersion.getLength()-nIndex-1, aVersionMicro );
+            }
+        }
+        rString = rString.replaceAt( nVerIndex, aProductVersion.getLength(), aProductFullVersion );
+    }
 }
 
 //--------------------------------------------------------------------

extensions/source/update/check/updatehdl.hxx

  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: updatehdl.hxx,v $
- * $Revision: 1.5 $
+ * $Revision: 1.5.94.1 $
  *
  * This file is part of OpenOffice.org.
  *
 
     osl::Mutex              maMutex;
 
-    rtl::OUString           msProductName;
-    rtl::OUString           msProductVersion;
     rtl::OUString           msNextVersion;
     rtl::OUString           msDownloadPath;
     rtl::OUString           msDownloadFile;
                                                 com::sun::star::awt::Rectangle const & rPosSize,
                                                 com::sun::star::uno::Sequence< com::sun::star::beans::NamedValue > const & rProps );
 
-    void                    getProductName();
+    void                    setFullVersion( rtl::OUString& rString );
     void                    searchAndReplaceAll( rtl::OUString &rText, const rtl::OUString &rWhat, const rtl::OUString &rWith ) const;
 
 public:

extensions/source/update/check/updateprotocol.cxx

  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: updateprotocol.cxx,v $
- * $Revision: 1.11 $
+ * $Revision: 1.11.70.1 $
  *
  * This file is part of OpenOffice.org.
  *
     ::rtl::OUString & rBuildID,
     ::rtl::OUString & rInstallSetID)
 {
-    rtl::OUString aPath, aPath2;
-    if( !rtl::Bootstrap::get(UNISTRING("BRAND_BASE_DIR"), aPath) )
+    rBuildID = UNISTRING( "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("version") ":ProductBuildid}" );
+    rtl::Bootstrap::expandMacros( rBuildID );
+    if ( ! rBuildID.getLength() )
         return false;
-    
-    aPath += UNISTRING( "/program/" SAL_CONFIGFILE( "version" ) );
 
-    rtl::Bootstrap aVersionFile(aPath);   
-    aVersionFile.getFrom(UNISTRING("ProductBuildid"), rBuildID, rtl::OUString());
-    aVersionFile.getFrom(UNISTRING("UpdateID"), rInstallSetID, rtl::OUString());
-    
-    rtl::OUString aValue;
-    aVersionFile.getFrom(UNISTRING("UpdateURL"), aValue, rtl::OUString());
+    rInstallSetID = UNISTRING( "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":UpdateID}" );
+    rtl::Bootstrap::expandMacros( rInstallSetID );
+    if ( ! rInstallSetID.getLength() )
+        return false;
+
+    rtl::OUString aValue( UNISTRING( "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":UpdateURL}" ) );
+    rtl::Bootstrap::expandMacros( aValue );
+
     if( aValue.getLength() > 0 )
     {
         rRepositoryList.realloc(1);
         rRepositoryList[0] = aValue;
     }
-    
+
     return true;
 }
 

extensions/source/update/feed/updatefeed.cxx

  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: updatefeed.cxx,v $
- * $Revision: 1.11 $
+ * $Revision: 1.11.52.2 $
  *
  * This file is part of OpenOffice.org.
  *
     m_xContentProvider(xContentProvider), m_xDocumentBuilder(xDocumentBuilder),
     m_xXPathAPI(xXPathAPI), m_aRequestHeaderList(2)
 {
-    rtl::OUString aPath;
-    if( rtl::Bootstrap::get( UNISTRING("BRAND_BASE_DIR"), aPath ) )
+    uno::Reference< lang::XMultiComponentFactory > xServiceManager(xContext->getServiceManager());   
+    if( !xServiceManager.is() )
+        throw uno::RuntimeException( 
+            UNISTRING("unable to obtain service manager from component context"), 
+            uno::Reference< uno::XInterface >());
+
+    uno::Reference< lang::XMultiServiceFactory > xConfigurationProvider( 
+        xServiceManager->createInstanceWithContext( 
+            UNISTRING("com.sun.star.configuration.ConfigurationProvider"), 
+            xContext ), 
+        uno::UNO_QUERY_THROW); 
+
+    rtl::OUStringBuffer buf;
+    rtl::OUString name;
+    getConfigurationItem(
+        xConfigurationProvider,
+        UNISTRING("org.openoffice.Setup/Product"),
+        UNISTRING("ooName")) >>= name;
+    buf.append(name);
+    buf.append(sal_Unicode(' '));
+    rtl::OUString version;
+    getConfigurationItem(
+        xConfigurationProvider,
+        UNISTRING("org.openoffice.Setup/Product"),
+        UNISTRING("ooSetupVersion")) >>= version;
+    buf.append(version);
+    rtl::OUString edition(
+        UNISTRING(
+            "${${BRAND_BASE_DIR}/program/edition/edition.ini:"
+            "EDITIONNAME}"));
+    rtl::Bootstrap::expandMacros(edition);
+    if (edition.getLength() != 0) {
+        buf.append(sal_Unicode(' '));
+        buf.append(edition);
+    }
+    rtl::OUString extension;
+    getConfigurationItem(
+        xConfigurationProvider,
+        UNISTRING("org.openoffice.Setup/Product"),
+        UNISTRING("ooSetupExtension")) >>= extension;
+    if (extension.getLength() != 0) {
+        buf.append(sal_Unicode(' '));
+        buf.append(extension);
+    }
+    rtl::OUString product(buf.makeStringAndClear());
+
+    rtl::OUString aBaseBuildId( UNISTRING( "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("version") ":buildid}" ) );
+    rtl::Bootstrap::expandMacros( aBaseBuildId );
+
+    rtl::OUString aBrandBuildId( UNISTRING( "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":buildid}" ) );
+    rtl::Bootstrap::expandMacros( aBrandBuildId );
+
+    rtl::OUString aUserAgent( UNISTRING( "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":UpdateUserAgent}" ) );
+    rtl::Bootstrap::expandMacros( aUserAgent );
+
+    if ( ! aBaseBuildId.equals( aBrandBuildId ) )
     {
-        uno::Reference< lang::XMultiComponentFactory > xServiceManager(xContext->getServiceManager());   
-        if( !xServiceManager.is() )
-            throw uno::RuntimeException( 
-                UNISTRING("unable to obtain service manager from component context"), 
-                uno::Reference< uno::XInterface >());
-        
-        uno::Reference< lang::XMultiServiceFactory > xConfigurationProvider( 
-            xServiceManager->createInstanceWithContext( 
-                UNISTRING("com.sun.star.configuration.ConfigurationProvider"), 
-                xContext ), 
-            uno::UNO_QUERY_THROW); 
+        sal_Int32 nIndex = aUserAgent.indexOf( aBrandBuildId, 0 );
+        if ( nIndex != -1 )
+            aUserAgent = aUserAgent.replaceAt( nIndex, aBrandBuildId.getLength(), aBaseBuildId );
+    }
 
-        aPath += UNISTRING( "/program/" SAL_CONFIGFILE( "version" ) );
+    for (sal_Int32 i = 0;;) {
+        i = aUserAgent.indexOfAsciiL(
+            RTL_CONSTASCII_STRINGPARAM("<PRODUCT>"), i);
+        if (i == -1) {
+            break;
+        }
+        aUserAgent = aUserAgent.replaceAt(
+            i, RTL_CONSTASCII_LENGTH("<PRODUCT>"), product);
+        i += product.getLength();
+    }
 
-        rtl::Bootstrap aVersionFile(aPath);
-        
-        rtl::OUStringBuffer buf;
-        rtl::OUString name;
-        getConfigurationItem(
-            xConfigurationProvider,
-            UNISTRING("org.openoffice.Setup/Product"),
-            UNISTRING("ooName")) >>= name;
-        buf.append(name);
-        buf.append(sal_Unicode(' '));
-        rtl::OUString version;
-        getConfigurationItem(
-            xConfigurationProvider,
-            UNISTRING("org.openoffice.Setup/Product"),
-            UNISTRING("ooSetupVersion")) >>= version;
-        buf.append(version);
-        rtl::OUString edition(
-            UNISTRING(
-                "${${BRAND_BASE_DIR}/program/edition/edition.ini:"
-                "EDITIONNAME}"));
-        rtl::Bootstrap::expandMacros(edition);
-        if (edition.getLength() != 0) {
-            buf.append(sal_Unicode(' '));
-            buf.append(edition);
-        }
-        rtl::OUString extension;
-        getConfigurationItem(
-            xConfigurationProvider,
-            UNISTRING("org.openoffice.Setup/Product"),
-            UNISTRING("ooSetupExtension")) >>= extension;
-        if (extension.getLength() != 0) {
-            buf.append(sal_Unicode(' '));
-            buf.append(extension);
-        }
-        rtl::OUString product(buf.makeStringAndClear());
-        rtl::OUString aUserAgent;
-        aVersionFile.getFrom(UNISTRING("UpdateUserAgent"), aUserAgent, rtl::OUString());
-        for (sal_Int32 i = 0;;) {
-            i = aUserAgent.indexOfAsciiL(
-                RTL_CONSTASCII_STRINGPARAM("<PRODUCT>"), i);
-            if (i == -1) {
-                break;
-            }
-            aUserAgent = aUserAgent.replaceAt(
-                i, RTL_CONSTASCII_LENGTH("<PRODUCT>"), product);
-            i += product.getLength();
-        }
-        
-        m_aRequestHeaderList[0].Name = UNISTRING("Accept-Language");
-        m_aRequestHeaderList[0].Value = getConfigurationItem( xConfigurationProvider, UNISTRING("org.openoffice.Setup/L10N"), UNISTRING("ooLocale") );
-        m_aRequestHeaderList[1].Name = UNISTRING("Accept-Encoding");
-        m_aRequestHeaderList[1].Value = uno::makeAny( UNISTRING("gzip,deflate") );
-        
-        if( aUserAgent.getLength() > 0 )
-        {
-            m_aRequestHeaderList.realloc(3);
-            m_aRequestHeaderList[2].Name = UNISTRING("User-Agent");
-            m_aRequestHeaderList[2].Value = uno::makeAny(aUserAgent);
-        }
+    m_aRequestHeaderList[0].Name = UNISTRING("Accept-Language");
+    m_aRequestHeaderList[0].Value = getConfigurationItem( xConfigurationProvider, UNISTRING("org.openoffice.Setup/L10N"), UNISTRING("ooLocale") );
+    m_aRequestHeaderList[1].Name = UNISTRING("Accept-Encoding");
+    m_aRequestHeaderList[1].Value = uno::makeAny( UNISTRING("gzip,deflate") );
+
+    if( aUserAgent.getLength() > 0 )
+    {
+        m_aRequestHeaderList.realloc(3);
+        m_aRequestHeaderList[2].Name = UNISTRING("User-Agent");
+        m_aRequestHeaderList[2].Value = uno::makeAny(aUserAgent);
     }
 }
 

scp2/source/onlineupdate/file_onlineupdate.scp

  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: file_onlineupdate.scp,v $
- * $Revision: 1.7 $
+ * $Revision: 1.7.116.1 $
  *
  * This file is part of OpenOffice.org.
  *
 
 #include "macros.inc"
 
-SPECIAL_UNO_COMPONENT_LIB_FILE( gid_File_Lib_Updchk , updchk.uno )
+SPECIAL_UNO_COMPONENT_LIB_FILE_PATCH( gid_File_Lib_Updchk , updchk.uno )
 
 File gid_File_Registry_Spool_Oo_Office_Addons_Onlineupdate_Xcu
     TXT_FILE_BODY;

scp2/source/ooo/file_library_ooo.scp

     Dir = gid_Dir_Program;
 End
 
-STD_UNO_LIB_FILE( gid_File_Lib_Utl , utl)
+STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Utl , utl)
 
 STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Uui, uui )
 
 
 STD_UNO_LIB_FILE( gid_File_Lib_Guesslang, guesslang )
 
-STD_UNO_LIB_FILE( gid_File_Lib_Updchkui , updchk )
+STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Updchkui , updchk )
 
-SPECIAL_UNO_COMPONENT_LIB_FILE( gid_File_Lib_Updatefeed , updatefeed.uno )
+SPECIAL_UNO_COMPONENT_LIB_FILE_PATCH( gid_File_Lib_Updatefeed , updatefeed.uno )
 
 #ifdef WNT
 File gid_File_Lib_Onlinecheck

scp2/source/ooo/profileitem_ooo.scp

     Key = "OOOBaseVersion";
     Value = "${OOOBASEVERSION}";
 End
+
+ProfileItem gid_Basis_Profileitem_Version_Ooopackageversion
+    ProfileID = gid_Profile_Version_Ini_Basis;
+    ModuleID = gid_Module_Root;
+    Section = "Version";
+    Key = "OOOPackageVersion";
+    Value = "${OOOPACKAGEVERSION}";
+End
+

unotools/inc/unotools/configmgr.hxx

  * 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.
  *
             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);

unotools/source/config/configmgr.cxx

  * 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.
  *
 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.";
         aRet >>= rProductVersion;
 
     if ( eProp == ABOUTBOXPRODUCTVERSION )
+    {
         aRet >>= rAboutBoxProductVersion;
+        getBasisAboutBoxProductVersion( rAboutBoxProductVersion );
+        aRet <<= rAboutBoxProductVersion;
+    }
 
     if ( eProp == PRODUCTEXTENSION )
         aRet >>= rProductExtension;
 
 	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--------------------------------
 
  ---------------------------------------------------------------------------*/
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.