[ooo-build-commit] Branch 'ooo/master' - 4 commits - i18npool/source tools/bootstrp vcl/aqua vcl/source

Jan Holesovsky kendy at kemper.freedesktop.org
Tue Jul 28 18:22:18 PDT 2009


 i18npool/source/calendar/calendar_gregorian.cxx |   34 ++++++++++++
 tools/bootstrp/md5.cxx                          |   64 +++++++++++++++++++++++-
 vcl/aqua/source/gdi/salatslayout.cxx            |    5 -
 vcl/source/gdi/outdev3.cxx                      |    7 +-
 vcl/source/window/window.cxx                    |   12 ++++
 5 files changed, 113 insertions(+), 9 deletions(-)

New commits:
commit 0e66b3f1766e755b2472358f27c291678d3bad16
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date:   Tue Jul 28 16:27:10 2009 +0000

    CWS-TOOLING: integrate CWS thaical311_DEV300
    2009-07-21 12:42:57 +0200 er  r274181 : #i102356# init: force Gregorian calendar in spite of what ICU may default to for a locale

diff --git a/i18npool/source/calendar/calendar_gregorian.cxx b/i18npool/source/calendar/calendar_gregorian.cxx
index fd1edc2..7bed274 100644
--- a/i18npool/source/calendar/calendar_gregorian.cxx
+++ b/i18npool/source/calendar/calendar_gregorian.cxx
@@ -148,10 +148,42 @@ void SAL_CALL
 Calendar_gregorian::init(Era *_eraArray)
 {
         cCalendar = "com.sun.star.i18n.Calendar_gregorian";
+
+        // #i102356# With icu::Calendar::createInstance(UErrorCode) in a Thai 
+        // th_TH system locale we accidentally used a Buddhist calendar. Though 
+        // the ICU documentation says that should be the case only for 
+        // th_TH_TRADITIONAL (and ja_JP_TRADITIONAL Gengou), a plain th_TH 
+        // already triggers that behavior, ja_JP does not. Strange enough, 
+        // passing a th_TH locale to the calendar creation doesn't trigger 
+        // this.
+        // See also http://userguide.icu-project.org/datetime/calendar
+
+        // Whatever ICU offers as the default calendar for a locale, ensure we 
+        // have a Gregorian calendar as requested.
+
+        /* XXX: with the current implementation the aLocale member variable is 
+         * not set prior to loading a calendar from locale data. This
+         * creates an empty (root) locale for ICU, but at least the correct 
+         * calendar is used. The language part must not be NULL (respectively 
+         * not all, language and country and variant), otherwise the current 
+         * default locale would be used again and the calendar keyword ignored. 
+         * */
+        icu::Locale aIcuLocale( "", NULL, NULL, "calendar=gregorian");
+
         UErrorCode status;
-        body = icu::Calendar::createInstance(status = U_ZERO_ERROR);
+        body = icu::Calendar::createInstance( aIcuLocale, status = U_ZERO_ERROR);
         if (!body || !U_SUCCESS(status)) throw ERROR;
 
+#if 0
+        {
+            icu::Locale loc;
+            loc = body->getLocale( ULOC_ACTUAL_LOCALE, status = U_ZERO_ERROR);
+            fprintf( stderr, "\nICU calendar actual locale: %s\n", loc.getName());
+            loc = body->getLocale( ULOC_VALID_LOCALE, status = U_ZERO_ERROR);
+            fprintf( stderr,   "ICU calendar valid  locale: %s\n", loc.getName());
+        }
+#endif
+
         eraArray=_eraArray;
 }
 
commit 6993536628f2d3739214f4147147212264cf5fa4
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date:   Tue Jul 28 16:11:04 2009 +0000

    CWS-TOOLING: integrate CWS filepicker01
    2009-07-03 13:21:25 +0200 cd  r273690 : #i102319# Use GetSelectedFiles() instead of GetMPath() to retrieve a set of selected files
    2009-07-01 14:27:56 +0200 cd  r273582 : #i64800# Use ParseDisplayName correctly and don't allocate memory for an output parameter
    2009-07-01 10:47:47 +0200 cd  r273553 : #i102701# Make P1 fix for CWS filepicker01, too.
    2009-06-29 11:58:09 +0200 cd  r273463 : i102319# File picker should NOT set multi selection as a default.
    2009-06-29 11:49:10 +0200 cd  r273461 : #i102319# Use XFilePicker2 interface to retrieve files from multi selection
    2009-06-26 15:42:43 +0200 cd  r273423 : #i99759# Release solar mutex before blocking on execute() when using system file picker
    2009-06-26 15:35:50 +0200 cd  r273422 : #i99759# Don't release solar mutex in shutdown(). Must be done before calling execute()
    2009-06-23 11:40:02 +0200 cd  r273267 : #i95425# Fixed wrong initialization of TimeValue members
    2009-06-23 10:35:20 +0200 cd  r273262 : #i99759# Fix deadlock on Windows XP/2000 because of removing Picker Thread from sfx2. Now CAsyncEventNotifierThread releases the solar mutex before blocking
    2009-06-22 11:59:15 +0200 cd  r273209 : #i102948# Remove links from toolbar object when using lazy delete as the toolbar manager is now destroyed before the toolbar
    2009-06-22 11:22:14 +0200 cd  r273204 : #i99759# Don't use a new thread to call the file picker. As a consequence this thread is also calling Application::Yield() and therefore is fighting with the main thread for messages
    2009-06-22 11:13:32 +0200 cd  r273203 : #i99759# Solar mutex must be locked before calling Application::Yield()
    2009-06-19 15:23:01 +0200 cd  r273161 : #i102948# Remove/add decorated window from/into old/new parent decorated window list
    2009-06-19 12:49:37 +0200 cd  r273156 : #i101843# Use new COM based dialog implementation from Windows Vista on

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index f247bdb..2b14764 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -6221,6 +6221,15 @@ void Window::SetParent( Window* pNewParent )
             pSysWin->GetTaskPaneList()->RemoveWindow( this );
         }
     }
+    // remove ownerdraw decorated windows from list in the top-most frame window
+    if( (GetStyle() & WB_OWNERDRAWDECORATION) && mpWindowImpl->mbFrame )
+    {
+        ::std::vector< Window* >& rList = ImplGetOwnerDrawList();
+        ::std::vector< Window* >::iterator p;
+        p = ::std::find( rList.begin(), rList.end(), this );
+        if( p != rList.end() )
+            rList.erase( p );
+    }
 
     ImplSetFrameParent( pNewParent );
 
@@ -6350,6 +6359,9 @@ void Window::SetParent( Window* pNewParent )
     if( bChangeTaskPaneList )
         pNewSysWin->GetTaskPaneList()->AddWindow( this );
 
+    if( (GetStyle() & WB_OWNERDRAWDECORATION) && mpWindowImpl->mbFrame )
+        ImplGetOwnerDrawList().push_back( this );
+
     if ( bVisible )
         Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
 }
commit 92b37ac70561ccf1320c5ab8e04ddc947ddf3298
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date:   Tue Jul 28 10:28:03 2009 +0000

    CWS-TOOLING: integrate CWS ooo311gsl06_DEV300
    2009-07-21 16:30:28 +0200 hdu  r274204 : #i102486# right align text one pixel left of right edge
    2009-07-20 16:47:50 +0200 hdu  r274150 : #i103446# fix use case of GetTextBreak() when there is no room at all for the text

diff --git a/vcl/aqua/source/gdi/salatslayout.cxx b/vcl/aqua/source/gdi/salatslayout.cxx
index aafb40a..2c70739 100755
--- a/vcl/aqua/source/gdi/salatslayout.cxx
+++ b/vcl/aqua/source/gdi/salatslayout.cxx
@@ -6,9 +6,6 @@
  *
  * OpenOffice.org - a multi-platform office productivity suite
  *
- * $RCSfile: salatslayout.cxx,v $
- * $Revision: 1.12 $
- *
  * This file is part of OpenOffice.org.
  *
  * OpenOffice.org is free software: you can redistribute it and/or modify
@@ -745,6 +742,8 @@ int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) cons
 
     // get a quick overview on what could fit
     const long nPixelWidth = (nMaxWidth - (nCharExtra * mnCharCount)) / nFactor;
+    if( nPixelWidth <= 0 )
+        return mnMinCharPos;
 
     // check assumptions
     DBG_ASSERT( !mnTrailingSpaceWidth, "ATSLayout::GetTextBreak() with nTSW!=0" );
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 12391d1..2d5acfd 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -7,7 +7,6 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: outdev3.cxx,v $
- * $Revision: 1.240.14.5 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -6484,7 +6483,7 @@ SalLayout* OutputDevice::ImplLayout( const String& rOrigStr,
             nRTLOffset = nPixelWidth;
         else
             nRTLOffset = pSalLayout->GetTextWidth() / pSalLayout->GetUnitsPerPixel();
-        pSalLayout->DrawOffset().X() = -nRTLOffset;
+        pSalLayout->DrawOffset().X() = 1 - nRTLOffset;
     }
 
     return pSalLayout;
@@ -6919,13 +6918,13 @@ void OutputDevice::ImplDrawText( const Rectangle& rRect,
                 nStyle &= ~TEXT_DRAW_CLIP;
         }
 
-        // Vertikales Alignment
+        // horizontal text alignment
         if ( nStyle & TEXT_DRAW_RIGHT )
             aPos.X() += nWidth-nTextWidth;
         else if ( nStyle & TEXT_DRAW_CENTER )
             aPos.X() += (nWidth-nTextWidth)/2;
 
-        // Font Alignment
+        // vertical font alignment
         if ( eAlign == ALIGN_BOTTOM )
             aPos.Y() += nTextHeight;
         else if ( eAlign == ALIGN_BASELINE )
commit ad5c88fcc8744d52b0e1100cf8eb98a81f6a6474
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date:   Tue Jul 28 09:21:19 2009 +0000

    CWS-TOOLING: integrate CWS fwk112
    2009-07-17 08:54:15 +0200 cd  r274075 : #i102094# MinGW needs additional path info for linking
    2009-07-13 15:09:07 +0200 cd  r273938 : #i102094# Add special part for MinGW linking to imagehlp.lib
    2009-07-10 08:05:14 +0200 cd  r273871 : #i102094# Use size_t for constant values to fix warnings
    2009-07-09 13:45:27 +0200 cd  r273859 : #i102094# MinGW needs include malloc.h for function alloca
    2009-07-09 12:37:39 +0200 cd  r273856 : #i102094# Fix problem with signed/unsigned comparision warning
    2009-06-19 11:34:40 +0200 cd  r273154 : #i102094# Added comment for future maintenance
    2009-06-19 11:34:11 +0200 cd  r273153 : #i102094# Added comment for future maintenance
    2009-06-16 17:25:03 +0200 cd  r273032 : #i102094# Extend md5.cxx to detect Windows PE images and ignore PE header date+time/checksum to have the same MD5 checksum
    2009-06-16 17:22:47 +0200 cd  r273031 : #i102094# Added rebase custom action
    2009-06-16 17:01:12 +0200 cd  r273030 : #i102094# Use rebaseoo.exe instead of rebase.exe to prevent clash with build tool
    2009-06-16 17:00:34 +0200 cd  r273029 : #i102094# Execute rebase custom action for administrative installations
    2009-06-16 16:59:11 +0200 cd  r273028 : #i102094# Small changes for rebaseoo/rebasegui tools
    2009-06-16 16:58:29 +0200 cd  r273027 : i102094# Deliver rebase tool as rebaseoo.exe as build env already use a rebase.exe
    2009-06-16 16:57:15 +0200 cd  r273026 : i102094# Crash reporter should not use PE header date+time/checksum data for MD5 checksum
    2009-05-29 17:03:26 +0200 cd  r272474 : #i102094# Fix wrong deliver statement
    2009-05-29 14:55:35 +0200 cd  r272459 : #i102904# Make executables more robust. Add error message if installation cannot be found
    2009-05-28 17:41:07 +0200 cd  r272422 : CWS-TOOLING: rebase CWS fwk112 to trunk at 272291 (milestone: DEV300:m49)
    2009-05-28 17:31:27 +0200 cd  r272421 : #i10000# Resolve conflict on merge
    2009-05-28 15:32:09 +0200 cd  r272409 : #i102094# Added resource and localization files for rebasegui tool
    2009-05-27 13:56:33 +0200 cd  r272341 : #i102094# Added new command line tool to rebase libraries to a default virtual load address. Additional GUI tool to check the state of an installation
    2009-05-26 10:49:20 +0200 cd  r272285 : #i102094# New command line tool to rebase libraries to a default virtual load address
    2009-05-26 10:40:02 +0200 cd  r272282 : #i102094# New command line tool to rebase libraries to a default virtual load address
    2009-05-26 08:57:24 +0200 cd  r272280 : #i102094# Fixed wrong variable usage
    2009-05-26 08:41:29 +0200 cd  r272278 : #i102094# New command line tool to rebase libraries to a default virtual load address
    2009-05-20 16:47:24 +0200 cd  r272141 : #102094# Added missing include statement for debug build
    2009-05-20 15:39:21 +0200 is  r272136 : #102094# rebase to default value in installation
    2009-05-20 15:38:38 +0200 is  r272135 : #102094# rebase to default value in installation
    2009-05-20 15:37:45 +0200 is  r272134 : #102094# rebase to default value in installation

diff --git a/tools/bootstrp/md5.cxx b/tools/bootstrp/md5.cxx
index 21a2495..d727d1e 100644
--- a/tools/bootstrp/md5.cxx
+++ b/tools/bootstrp/md5.cxx
@@ -44,8 +44,62 @@
 #define FILE_OPEN_READ	"r"
 #endif
 
+// Extended calc_md5_checksum to recognize Windows executables and libraries. To
+// create the same md5 checksum for a (code/data) identical file it ignores a different
+// date and header checksum. Please see crashrep/source/win32/soreport.cpp
+// where the same method is also used. The crash reporter uses the MD5
+// checksums to transfer them to the crash database. You have to make sure that both 
+// methods use the same algorithm otherwise there could be problems with stack reports.
+
+void normalize_pe_image(sal_uInt8* buffer, size_t nBufferSize)
+{
+    const int OFFSET_PE_OFFSET = 0x3c;
+    const int OFFSET_COFF_TIMEDATESTAMP = 4;
+    const int PE_SIGNATURE_SIZE = 4;
+    const int COFFHEADER_SIZE = 20;
+    const int OFFSET_PE_OPTIONALHEADER_CHECKSUM = 64;
+    
+    // Check the header part of the file buffer
+    if (buffer[0] == sal_uInt8('M') && buffer[1] == sal_uInt8('Z'))
+    {
+        unsigned long PEHeaderOffset = (long)buffer[OFFSET_PE_OFFSET];
+        if (PEHeaderOffset < nBufferSize-4)
+        {
+            if ( buffer[PEHeaderOffset+0] == sal_uInt8('P') &&
+                 buffer[PEHeaderOffset+1] == sal_uInt8('E') &&
+                 buffer[PEHeaderOffset+2] == 0 &&
+                 buffer[PEHeaderOffset+3] == 0 )
+            {
+                PEHeaderOffset += PE_SIGNATURE_SIZE;
+                if (PEHeaderOffset+OFFSET_COFF_TIMEDATESTAMP < nBufferSize-4)
+                {
+                    // Set timedatestamp and checksum fields to a normalized
+                    // value to enforce the same MD5 checksum for identical
+                    // Windows	executables/libraries.
+                    buffer[PEHeaderOffset+OFFSET_COFF_TIMEDATESTAMP+0] = 0;
+                    buffer[PEHeaderOffset+OFFSET_COFF_TIMEDATESTAMP+1] = 0;
+                    buffer[PEHeaderOffset+OFFSET_COFF_TIMEDATESTAMP+2] = 0;
+                    buffer[PEHeaderOffset+OFFSET_COFF_TIMEDATESTAMP+3] = 0;
+                }
+
+                if (PEHeaderOffset+COFFHEADER_SIZE+OFFSET_PE_OPTIONALHEADER_CHECKSUM < nBufferSize-4)
+                {
+                    // Set checksum to a normalized value
+                    buffer[PEHeaderOffset+COFFHEADER_SIZE+OFFSET_PE_OPTIONALHEADER_CHECKSUM] = 0;
+                    buffer[PEHeaderOffset+COFFHEADER_SIZE+OFFSET_PE_OPTIONALHEADER_CHECKSUM+1] = 0;
+                    buffer[PEHeaderOffset+COFFHEADER_SIZE+OFFSET_PE_OPTIONALHEADER_CHECKSUM+2] = 0;
+                    buffer[PEHeaderOffset+COFFHEADER_SIZE+OFFSET_PE_OPTIONALHEADER_CHECKSUM+3] = 0;
+                }
+            }
+        }
+    }
+}
+
 rtlDigestError calc_md5_checksum( const char *filename, ByteString &aChecksum )
 {
+    const size_t BUFFER_SIZE  = 0x1000;
+    const size_t MINIMAL_SIZE = 512;
+
     sal_uInt8 checksum[RTL_DIGEST_LENGTH_MD5];
     rtlDigestError	error = rtl_Digest_E_None;
 
@@ -58,11 +112,19 @@ rtlDigestError calc_md5_checksum( const char *filename, ByteString &aChecksum )
         if ( digest )
         {
             size_t			nBytesRead;
-            sal_uInt8		buffer[0x1000];
+            sal_uInt8		buffer[BUFFER_SIZE];
+            bool			bHeader(true);
 
             while ( rtl_Digest_E_None == error &&
                 0 != (nBytesRead = fread( buffer, 1, sizeof(buffer), fp )) )
             {
+                if (bHeader)
+                {
+                    bHeader = false;
+                    if (nBytesRead >= MINIMAL_SIZE && buffer[0] == sal_uInt8('M') && buffer[1] == sal_uInt8('Z') )
+                        normalize_pe_image(buffer, nBytesRead);
+                }
+                
                 error = rtl_digest_updateMD5( digest, buffer, nBytesRead );	
             }
 


More information about the ooo-build-commit mailing list