[Libreoffice-commits] .: 10 commits - basegfx/source vcl/aqua vcl/source

René Engelhard rene at kemper.freedesktop.org
Fri Nov 26 08:51:45 PST 2010


 basegfx/source/polygon/b2dtrapezoid.cxx |    4 +--
 vcl/aqua/source/gdi/salatslayout.cxx    |    5 ++--
 vcl/source/gdi/metaact.cxx              |   36 +++++++++++++++++++++++---------
 vcl/source/gdi/pdfwriter_impl.cxx       |    9 +++++++-
 vcl/source/gdi/pngread.cxx              |   28 ++++++++++++++++--------
 5 files changed, 58 insertions(+), 24 deletions(-)

New commits:
commit d7e44eeabaadebd8d0d1a274495bd6c3bdb28405
Merge: 99c03fe... ab88cd6...
Author: Rene Engelhard <rene at debian.org>
Date:   Fri Nov 26 17:50:30 2010 +0100

    Merge branch 'libreoffice-3-3'

commit ab88cd6451351ad518f82d5faedc3a1576016e85
Merge: 87ae510... 6b4f105...
Author: Rene Engelhard <rene at debian.org>
Date:   Fri Nov 26 17:42:01 2010 +0100

    Merge commit 'ooo/OOO330_m17' into libreoffice-3-3

diff --cc vcl/aqua/source/gdi/salatslayout.cxx
index 64ca461,f070400..d6abb0c
mode 100644,100755..100644
--- a/vcl/aqua/source/gdi/salatslayout.cxx
+++ b/vcl/aqua/source/gdi/salatslayout.cxx
commit 6b4f105b8284ba89b0ffa33f9b0d8cd8d57c3600
Author: obo <obo at openoffice.org>
Date:   Wed Nov 24 16:52:49 2010 +0100

    #i115761# Impress freezes opening the attached odp file(s)

diff --git a/basegfx/source/polygon/b2dtrapezoid.cxx b/basegfx/source/polygon/b2dtrapezoid.cxx
index e2651f1..b5328ae 100644
--- a/basegfx/source/polygon/b2dtrapezoid.cxx
+++ b/basegfx/source/polygon/b2dtrapezoid.cxx
@@ -798,6 +798,7 @@ namespace basegfx
                                         if(splitEdgeAtGivenPoint(aLeft, *pNewLeft, aCurrent))
                                         {
                                             maNewPoints.push_back(pNewLeft);
+                                            bDone = true;
                                         }
                                         else
                                         {
@@ -809,13 +810,12 @@ namespace basegfx
                                         if(splitEdgeAtGivenPoint(aRight, *pNewRight, aCurrent))
                                         {
                                             maNewPoints.push_back(pNewRight);
+                                            bDone = true;
                                         }
                                         else
                                         {
                                             delete pNewRight;
                                         }
-                                        
-                                        bDone = true;
                                     }
                                 }
 
commit a2c8496f5d2d5db46f64e7c34d9fcf8c70ddf3d3
Merge: cc6ad25... 4367320...
Author: Kurt Zenker <kz at openoffice.org>
Date:   Tue Nov 23 16:56:24 2010 +0100

    CWS-TOOLING: integrate CWS os145

commit cc6ad25bf82098db768fdbddaa90422039045745
Merge: 36ef734... 9503af7...
Author: Kurt Zenker <kz at openoffice.org>
Date:   Tue Nov 23 16:52:15 2010 +0100

    CWS-TOOLING: integrate CWS pdffix03

commit 4367320ccdc56db3f08164faeeb15e1727a0cadf
Author: sj <sj at openoffice.org>
Date:   Mon Nov 22 19:00:24 2010 +0100

    os145: #b7001886# fixing small ppt import problem, improving png reader

diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx
index c7c50ac..364769a 100644
--- a/vcl/source/gdi/pngread.cxx
+++ b/vcl/source/gdi/pngread.cxx
@@ -411,7 +411,9 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
 
             case PNGCHUNK_IDAT :
             {
-                if ( !mbIDAT )		// the gfx is finished, but there may be left a zlibCRC of about 4Bytes
+                if ( !mpInflateInBuf )	// taking care that the header has properly been read
+                    mbStatus = FALSE;
+                else if ( !mbIDAT )		// the gfx is finished, but there may be left a zlibCRC of about 4Bytes
                     ImplReadIDAT();
             }
             break;
@@ -527,7 +529,7 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
     mbIDAT = mbAlphaChannel = mbTransparent = FALSE;
     mbGrayScale = mbRGBTriple = FALSE;
     mnTargetDepth = mnPngDepth;
-    mnScansize = ( ( maOrigSize.Width() * mnPngDepth ) + 7 ) >> 3;
+    sal_uInt64 nScansize64 = ( ( static_cast< sal_uInt64 >( maOrigSize.Width() ) * mnPngDepth ) + 7 ) >> 3;
 
     // valid color types are 0,2,3,4 & 6
     switch ( mnColorType )
@@ -557,7 +559,7 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
         case 2 :	// each pixel is an RGB triple
         {
             mbRGBTriple = TRUE;
-            mnScansize *= 3;
+            nScansize64 *= 3;
             switch ( mnPngDepth )
             {
                 case 16 :			// we have to reduce the bitmap
@@ -590,7 +592,7 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
 
         case 4 :	// each pixel is a grayscale sample followed by an alpha sample
         {
-            mnScansize *= 2;
+            nScansize64 *= 2;
             mbAlphaChannel = TRUE;
             switch ( mnPngDepth )
             {
@@ -608,7 +610,7 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
         case 6 :	// each pixel is an RGB triple followed by an alpha sample
         {
             mbRGBTriple = TRUE;
-            mnScansize *= 4;
+            nScansize64 *= 4;
             mbAlphaChannel = TRUE;
             switch (mnPngDepth )
             {
@@ -626,16 +628,24 @@ BOOL PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
             return FALSE;
     }
 
-    mnBPP = mnScansize / maOrigSize.Width();
+    mnBPP = static_cast< sal_uInt32 >( nScansize64 / maOrigSize.Width() );
     if ( !mnBPP )
         mnBPP = 1;
 
-    mnScansize++;       // each scanline includes one filterbyte
+    nScansize64++;       // each scanline includes one filterbyte
+
+    if ( nScansize64 > SAL_MAX_UINT32 )
+        return FALSE;
+
+    mnScansize = static_cast< sal_uInt32 >( nScansize64 );
 
     // TODO: switch between both scanlines instead of copying
-    mpInflateInBuf = new BYTE[ mnScansize ];
+    mpInflateInBuf = new (std::nothrow) BYTE[ mnScansize ];
     mpScanCurrent = mpInflateInBuf;
-    mpScanPrior = new BYTE[ mnScansize ];
+    mpScanPrior = new (std::nothrow) BYTE[ mnScansize ];
+
+    if ( !mpInflateInBuf || !mpScanPrior )
+        return FALSE;
 
     // calculate target size from original size and the preview hint
     if( rPreviewSizeHint.Width() || rPreviewSizeHint.Height() )
commit 5771d00a7afe8d3e6744bfed8a4c66722e3e930a
Author: sj <sj at openoffice.org>
Date:   Mon Nov 22 18:54:49 2010 +0100

    os145: #b7001888# fixing small svm problem

diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index f4c7fc1..5c8ff4d 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -1441,19 +1441,35 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
     rIStm	>> mnLen;
     rIStm	>> nAryLen;
 
+    if ( mnIndex > mnLen )
+    {
+        mnIndex = 0;
+        mpDXAry = 0;
+        return;
+    }
+
     if( nAryLen )
     {
         // #i9762#, #106172# Ensure that DX array is at least mnLen entries long
-        const ULONG nIntAryLen( Max(nAryLen, static_cast<sal_uInt32>(mnLen)) );
-        mpDXAry = new sal_Int32[ nIntAryLen ];
-        
-        ULONG i;
-        for( i = 0UL; i < nAryLen; i++ )
-            rIStm >> mpDXAry[ i ];
-
-        // #106172# setup remainder
-        for( ; i < nIntAryLen; i++ )
-            mpDXAry[ i ] = 0;
+        if ( mnLen >= nAryLen )
+        {
+            mpDXAry = new (std::nothrow)sal_Int32[ mnLen ];
+            if ( mpDXAry )
+            {
+                   ULONG i;
+                for( i = 0UL; i < nAryLen; i++ )
+                    rIStm >> mpDXAry[ i ];
+
+                // #106172# setup remainder
+                for( ; i < mnLen; i++ )
+                    mpDXAry[ i ] = 0;
+            }
+        }
+        else
+        {
+            mpDXAry = NULL;
+            return;
+        }
     }
     else
         mpDXAry = NULL;
commit 9503af7802dfc29b77ffe5be30a43ac8356ec686
Author: Herbert Duerr [hdu] <herbert.duerr at oracle.com>
Date:   Mon Nov 22 10:29:58 2010 +0100

    #i108584# workaround unexpected ATSUBreakLine error result

diff --git a/vcl/aqua/source/gdi/salatslayout.cxx b/vcl/aqua/source/gdi/salatslayout.cxx
index ab569d8..f070400 100755
--- a/vcl/aqua/source/gdi/salatslayout.cxx
+++ b/vcl/aqua/source/gdi/salatslayout.cxx
@@ -753,7 +753,7 @@ int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) cons
 
     // initial measurement of text break position
     UniCharArrayOffset nBreakPos = mnMinCharPos;
-    ATSUTextMeasurement nATSUMaxWidth = Vcl2Fixed( nPixelWidth ); 
+    const ATSUTextMeasurement nATSUMaxWidth = Vcl2Fixed( nPixelWidth ); 
     if( nATSUMaxWidth <= 0xFFFF ) // #i108584# avoid ATSU rejecting the parameter
         return mnMinCharPos;      //           or do ATSUMaxWidth=0x10000;
     OSStatus eStatus = ATSUBreakLine( maATSULayout, mnMinCharPos,
@@ -782,7 +782,7 @@ int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) cons
     if( eStatus != noErr )
         return nBreakPos;
     const ATSUTextMeasurement nATSURemWidth = nATSUMaxWidth - (nRight - nLeft);
-    if( nATSURemWidth <= 0 )
+    if( nATSURemWidth <= 0xFFFF ) // #i108584# avoid ATSU rejecting the parameter
         return nBreakPos;
     UniCharArrayOffset nBreakPosInWord = nBreakPos;
     eStatus = ATSUBreakLine( maATSULayout, nBreakPos, nATSURemWidth, false, &nBreakPosInWord );
commit e34edfc437b112f5c0f2c90d00d3103f001f9060
Author: Herbert Duerr [hdu] <herbert.duerr at oracle.com>
Date:   Mon Nov 22 10:18:47 2010 +0100

    #i108584# workaround unexpected ATSUBreakLine error result

diff --git a/vcl/aqua/source/gdi/salatslayout.cxx b/vcl/aqua/source/gdi/salatslayout.cxx
index 3157afe..ab569d8 100755
--- a/vcl/aqua/source/gdi/salatslayout.cxx
+++ b/vcl/aqua/source/gdi/salatslayout.cxx
@@ -753,10 +753,11 @@ int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) cons
 
     // initial measurement of text break position
     UniCharArrayOffset nBreakPos = mnMinCharPos;
-    const ATSUTextMeasurement nATSUMaxWidth = Vcl2Fixed( nPixelWidth ); 
+    ATSUTextMeasurement nATSUMaxWidth = Vcl2Fixed( nPixelWidth ); 
+    if( nATSUMaxWidth <= 0xFFFF ) // #i108584# avoid ATSU rejecting the parameter
+        return mnMinCharPos;      //           or do ATSUMaxWidth=0x10000;
     OSStatus eStatus = ATSUBreakLine( maATSULayout, mnMinCharPos,
         nATSUMaxWidth, false, &nBreakPos );
-
     if( (eStatus != noErr) && (eStatus != kATSULineBreakInWord) )
         return STRING_LEN;
 
commit 1524ed903c0a8aa3ab57c7c20d53ad5654258850
Author: Herbert Duerr [hdu] <herbert.duerr at oracle.com>
Date:   Fri Nov 19 14:37:26 2010 +0100

    #i115618# fix bad PDF export regression for simple RTL cases

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 27e2667..f1037d2 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -7398,7 +7398,14 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT
                 // try to handle ligatures and such
                 if( i < nGlyphs-1 )
                 {
-                    pUnicodesPerGlyph[i] = nChars = pCharPosAry[i+1] - pCharPosAry[i];
+                    nChars = pCharPosAry[i+1] - pCharPosAry[i];
+                    // #i115618# fix for simple RTL+CTL cases	
+                    // TODO: sanitize for RTL ligatures, more complex CTL, etc.	
+                    if( nChars < 0 )
+                        nChars = -nChars;		    
+            else if( nChars == 0 )
+                        nChars = 1;		    
+                    pUnicodesPerGlyph[i] = nChars;
                     for( int n = 1; n < nChars; n++ )
                         aUnicodes.push_back( rText.GetChar( sal::static_int_cast<xub_StrLen>(pCharPosAry[i]+n) ) );
                 }


More information about the Libreoffice-commits mailing list