rpms/openoffice.org/devel openoffice.org-3.2.0.ooo108330.embeddedobj.outplace.readonly.os.dispatch.patch, NONE, 1.1 openoffice.org-3.2.0.ooo96362.filter.nondeterministic.order.patch, NONE, 1.1 workspace.cmcfixes70.patch, NONE, 1.1 openoffice.org.spec, 1.2124, 1.2125 openoffice.org-3.2.0.oooXXXXX.embeddedobj.outplace.readonly.os.dispatch.patch, 1.1, NONE openoffice.org-3.3.0.ooo80674.cmyk-for-jpeg-images.patch, 1.1, NONE

Caolan McNamara caolanm at fedoraproject.org
Thu Jan 14 17:05:47 UTC 2010


Author: caolanm

Update of /cvs/pkgs/rpms/openoffice.org/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv6290

Modified Files:
	openoffice.org.spec 
Added Files:
	openoffice.org-3.2.0.ooo108330.embeddedobj.outplace.readonly.os.dispatch.patch 
	openoffice.org-3.2.0.ooo96362.filter.nondeterministic.order.patch 
	workspace.cmcfixes70.patch 
Removed Files:
	openoffice.org-3.2.0.oooXXXXX.embeddedobj.outplace.readonly.os.dispatch.patch 
	openoffice.org-3.3.0.ooo80674.cmyk-for-jpeg-images.patch 
Log Message:
reshuffle things a bit, apply cmyk fix to binfilter as well and add deterministic ordering to filter

openoffice.org-3.2.0.ooo108330.embeddedobj.outplace.readonly.os.dispatch.patch:
 inc/oleembobj.hxx  |    2 +
 msole/oleembed.cxx |  103 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 msole/olemisc.cxx  |    3 +
 3 files changed, 107 insertions(+), 1 deletion(-)

--- NEW FILE openoffice.org-3.2.0.ooo108330.embeddedobj.outplace.readonly.os.dispatch.patch ---
diff -ru embeddedobj.orig/source/inc/oleembobj.hxx embeddedobj/source/inc/oleembobj.hxx
--- embeddedobj.orig/source/inc/oleembobj.hxx	2008-07-22 15:38:57.000000000 +0100
+++ embeddedobj/source/inc/oleembobj.hxx	2010-01-14 15:21:16.000000000 +0000
@@ -189,6 +189,8 @@
 
 	::rtl::OUString m_aTempURL;
 
+	::rtl::OUString m_aTempDumpURL;
+
 	// STAMPIT solution
 	// the following member is used during verb execution to detect whether the verb execution modifies the object
 	VerbExecutionController m_aVerbExecutionController;
diff -ru embeddedobj.orig/source/msole/oleembed.cxx embeddedobj/source/msole/oleembed.cxx
--- embeddedobj.orig/source/msole/oleembed.cxx	2008-07-22 15:39:09.000000000 +0100
+++ embeddedobj/source/msole/oleembed.cxx	2010-01-14 15:48:28.000000000 +0000
@@ -49,10 +49,16 @@
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/frame/XLoadable.hpp>
 #include <com/sun/star/document/XStorageBasedDocument.hpp>
+#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/system/XSystemShellExecute.hpp>
+#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
 
 #include <rtl/logfile.hxx>
 #include <cppuhelper/interfacecontainer.h>
 #include <comphelper/mimeconfighelper.hxx>
+#include <comphelper/storagehelper.hxx>
 
 
 #include <targetstatecontrol.hxx>
@@ -677,6 +683,84 @@
 	return m_nObjectState;
 }
 
+namespace
+{
+    bool lcl_CopyStream(uno::Reference<io::XInputStream> xIn, uno::Reference<io::XOutputStream> xOut)
+    {
+        const sal_Int32 nChunkSize = 4096;
+        uno::Sequence< sal_Int8 > aData(nChunkSize);
+        sal_Int32 nTotalRead = 0;
+        sal_Int32 nRead;
+        do
+        {
+            nRead = xIn->readBytes(aData, nChunkSize);
+            nTotalRead += nRead;
+            xOut->writeBytes(aData);
+        } while (nRead == nChunkSize);
+        return nTotalRead != 0;
+    }
+
+    //Dump the objects content to a tempfile, just the "CONTENTS" stream if
+    //there is one for non-compound documents, otherwise the whole content.
+    //
+    //On success a file is returned which must be removed by the caller
+    rtl::OUString lcl_ExtractObject(::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
+        ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xObjectStream)
+    {
+        uno::Reference <beans::XPropertySet> xNativeTempFile(
+            xFactory->createInstance(
+                ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.TempFile"))), uno::UNO_QUERY_THROW);
+        uno::Reference < io::XStream > xStream(xNativeTempFile, uno::UNO_QUERY_THROW);
+
+        uno::Sequence< uno::Any > aArgs( 2 );
+        aArgs[0] <<= xObjectStream;
+        aArgs[1] <<= (sal_Bool)sal_True; // do not create copy
+        uno::Reference< container::XNameContainer > xNameContainer(
+            xFactory->createInstanceWithArguments(
+                ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.OLESimpleStorage")),
+                aArgs ), uno::UNO_QUERY_THROW );
+        
+        uno::Reference< io::XStream > xCONTENTS;
+        xNameContainer->getByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CONTENTS"))) >>= xCONTENTS;
+
+        sal_Bool bCopied = xCONTENTS.is() && lcl_CopyStream(xCONTENTS->getInputStream(), xStream->getOutputStream());
+
+        uno::Reference< io::XSeekable > xSeekableStor(xObjectStream, uno::UNO_QUERY);
+        if (xSeekableStor.is())
+            xSeekableStor->seek(0);
+
+        if (!bCopied)
+            bCopied = lcl_CopyStream(xObjectStream->getInputStream(), xStream->getOutputStream());
+
+        rtl::OUString sUrl;
+
+        if (bCopied)
+        {
+            xNativeTempFile->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RemoveFile")),
+                uno::makeAny(sal_False));
+            uno::Any aUrl = xNativeTempFile->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Uri")));
+            aUrl >>= sUrl;
+
+            xNativeTempFile = uno::Reference<beans::XPropertySet>();
+
+            uno::Reference<ucb::XSimpleFileAccess> xSimpleFileAccess(
+                xFactory->createInstance(
+                    ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess"))),
+                    uno::UNO_QUERY_THROW);
+
+            xSimpleFileAccess->setReadOnly(sUrl, sal_True);
+        }
+        else
+        {
+            xNativeTempFile->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RemoveFile")),
+                uno::makeAny(sal_True));
+        }
+
+        return sUrl;
+
+    }
+}
+
 //----------------------------------------------
 void SAL_CALL OleEmbeddedObject::doVerb( sal_Int32 nVerbID )
 		throw ( lang::IllegalArgumentException,
@@ -792,10 +876,27 @@
 			}
 
 			if ( !m_pOwnView || !m_pOwnView->Open() )
-				throw embed::UnreachableStateException();
+            {
+                //Make a RO copy and see if the OS can find something to at
+                //least display the content for us
+                if (!m_aTempDumpURL.getLength())
+                    m_aTempDumpURL = lcl_ExtractObject(m_xFactory, m_xObjectStream);
+                if (m_aTempDumpURL.getLength())
+                {
+                    uno::Reference< system::XSystemShellExecute > xSystemShellExecute( m_xFactory->createInstance(
+                        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.system.SystemShellExecute"))),
+                        uno::UNO_QUERY_THROW);
+                    xSystemShellExecute->execute(m_aTempDumpURL, ::rtl::OUString(), system::SystemShellExecuteFlags::DEFAULTS);
+                }
+			    else
+				    throw embed::UnreachableStateException();
+            }
 		}
 		else
+		{
+
 			throw embed::UnreachableStateException();
+		}
 	}
 }
 
diff -ru embeddedobj.orig/source/msole/olemisc.cxx embeddedobj/source/msole/olemisc.cxx
--- embeddedobj.orig/source/msole/olemisc.cxx	2008-07-22 15:39:22.000000000 +0100
+++ embeddedobj/source/msole/olemisc.cxx	2010-01-14 15:21:16.000000000 +0000
@@ -161,6 +161,9 @@
 
 	if ( m_aTempURL.getLength() )
        	KillFile_Impl( m_aTempURL, m_xFactory );
+
+	if ( m_aTempDumpURL.getLength() )
+       	KillFile_Impl( m_aTempDumpURL, m_xFactory );
 }
 
 //------------------------------------------------------

openoffice.org-3.2.0.ooo96362.filter.nondeterministic.order.patch:
 typedetection.cxx |   35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

--- NEW FILE openoffice.org-3.2.0.ooo96362.filter.nondeterministic.order.patch ---
diff -ru filter.orig/source/config/cache/typedetection.cxx filter/source/config/cache/typedetection.cxx
--- filter.orig/source/config/cache/typedetection.cxx	2010-01-14 16:09:44.000000000 +0000
+++ filter/source/config/cache/typedetection.cxx	2010-01-14 16:10:31.000000000 +0000
@@ -609,6 +609,36 @@
         return sal_False;
 }
 
+namespace
+{
+    bool CSVAtStart(const rtl::OUString &rLHS, const rtl::OUString &rRHS)
+    {
+        sal_Int32 nCompare = rLHS.compareTo(rRHS);
+        if (nCompare != 0)
+        {
+            if (rRHS.equalsAscii("Text - txt - csv (StarCalc)"))
+                return false;
+            else if (rLHS.equalsAscii("Text - txt - csv (StarCalc)"))
+                return true;
+        }
+        return nCompare < 0;
+    }
+
+    bool TextFormatDetectorAtEnd(const rtl::OUString &rLHS, const rtl::OUString &rRHS)
+    {
+        sal_Int32 nCompare = rLHS.compareTo(rRHS);
+        if (nCompare != 0)
+        {
+            if (rRHS.equalsAscii("com.sun.star.text.FormatDetector"))
+                return true;
+            else if (rLHS.equalsAscii("com.sun.star.text.FormatDetector"))
+                return false;
+        }
+        return nCompare < 0;
+    }
+
+}
+
 /*-----------------------------------------------
     14.11.2003 12:11
 -----------------------------------------------*/
@@ -632,6 +662,9 @@
         lIProps[PROPNAME_DOCUMENTSERVICE] <<= sPreSelDocumentService;
         lFilters = m_rCache->getMatchingItemsByProps(FilterCache::E_FILTER, lIProps);
 
+        //#i96362#, place Filters into some deterministic order, ideally with CSV at the start
+        std::sort(lFilters.begin(), lFilters.end(), CSVAtStart);
+
         aLock.clear();
         // <- SAFE --------------------------
     }
@@ -864,6 +897,8 @@
     // SAFE -> ----------------------------------
     ::osl::ResettableMutexGuard aLock(m_aLock);
     OUStringList lDetectors = m_rCache->getItemNames(FilterCache::E_DETECTSERVICE);
+    //#i96362#, place Detectors into some deterministic order, ideally with Writer's detect at the end
+    std::sort(lDetectors.begin(), lDetectors.end(), TextFormatDetectorAtEnd);
     aLock.clear();
     // <- SAFE ----------------------------------
 

workspace.cmcfixes70.patch:
 binfilter/bf_svtools/source/filter.vcl/jpeg/makefile.mk  |    4 
 binfilter/bf_svtools/source/filter.vcl/jpeg/svt_jpeg.cxx |   36 ----
 binfilter/bf_svtools/source/filter.vcl/jpeg/svt_jpegc.c  |   54 +++++-
 jpeg/jpeg-6b.patch                                       |  117 ---------------
 solenv/inc/libs.mk                                       |    2 
 svtools/source/filter.vcl/jpeg/jpeg.cxx                  |   36 ----
 svtools/source/filter.vcl/jpeg/jpegc.c                   |   54 +++++-
 svtools/source/filter.vcl/jpeg/makefile.mk               |    4 
 8 files changed, 96 insertions(+), 211 deletions(-)

--- NEW FILE workspace.cmcfixes70.patch ---
diff -r b9c9dd11b0a1 -r ab0345143841 binfilter/bf_svtools/source/filter.vcl/jpeg/makefile.mk
--- a/binfilter/bf_svtools/source/filter.vcl/jpeg/makefile.mk	Thu Jan 07 15:14:24 2010 +0100
+++ b/binfilter/bf_svtools/source/filter.vcl/jpeg/makefile.mk	Thu Jan 14 13:47:52 2010 +0000
@@ -39,10 +39,6 @@
 .INCLUDE :  settings.mk
 INC+= -I$(PRJ)$/inc$/bf_svtools
 
-.IF "$(SYSTEM_JPEG)" == "YES"
-CFLAGS+=-DSYSTEM_JPEG
-.ENDIF
-
 # --- Files --------------------------------------------------------
 
 SLOFILES=	$(SLO)$/svt_jpegc.obj \
diff -r b9c9dd11b0a1 -r ab0345143841 binfilter/bf_svtools/source/filter.vcl/jpeg/svt_jpeg.cxx
--- a/binfilter/bf_svtools/source/filter.vcl/jpeg/svt_jpeg.cxx	Thu Jan 07 15:14:24 2010 +0100
+++ b/binfilter/bf_svtools/source/filter.vcl/jpeg/svt_jpeg.cxx	Thu Jan 14 13:47:52 2010 +0000
@@ -32,22 +32,16 @@
 
 #include <tools/solar.h>
 
-#ifdef SYSTEM_JPEG
-#define INT32 JPEG_INT32
-#endif
-
 extern "C"
 {
+	#define INT32 JPEG_INT32
 	#include "stdio.h"
 	#include "jpeg.h"
 	#include "jpeglib.h"
 	#include "jerror.h"
+	#undef INT32
 }
 
-#ifdef SYSTEM_JPEG
-#undef INT32
-#endif
-
 #define _JPEGPRIVATE
 #include <vcl/bmpacc.hxx>
 #include "jpeg.hxx"
@@ -401,11 +395,7 @@
 
 		if(
 			( bGray && ( BMP_FORMAT_8BIT_PAL == nFormat ) ) ||
-#ifndef SYSTEM_JPEG
-			( !bGray && ( BMP_FORMAT_24BIT_TC_BGR == nFormat ) )
-#else
 			( !bGray && ( BMP_FORMAT_24BIT_TC_RGB == nFormat ) )
-#endif
 		  )
 		{
 			pBmpBuf = pAcc->GetBuffer();
@@ -468,15 +458,9 @@
 
 				for( long nX = 0L; nX < nWidth; nX++ )
 				{
-#ifndef SYSTEM_JPEG
-					aColor.SetBlue( *pTmp++ );
-					aColor.SetGreen( *pTmp++ );
-					aColor.SetRed( *pTmp++ );
-#else
 					aColor.SetRed( *pTmp++ );
 					aColor.SetGreen( *pTmp++ );
 					aColor.SetBlue( *pTmp++ );
-#endif
 					pAcc->SetPixel( nY, nX, aColor );
 				}
 			}
@@ -656,15 +640,9 @@
 				for( long nX = 0L; nX < nWidth; nX++ )
 				{
 					aColor = pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( nY, nX ) );
-#ifndef SYSTEM_JPEG
-					*pTmp++ = aColor.GetBlue();
-					*pTmp++ = aColor.GetGreen();
-					*pTmp++ = aColor.GetRed();
-#else
 					*pTmp++ = aColor.GetRed();
 					*pTmp++ = aColor.GetGreen();
 					*pTmp++ = aColor.GetBlue();
-#endif
 				}
 			}
 			else
@@ -672,15 +650,9 @@
 				for( long nX = 0L; nX < nWidth; nX++ )
 				{
 					aColor = pAcc->GetPixel( nY, nX );
-#ifndef SYSTEM_JPEG
-					*pTmp++ = aColor.GetBlue();
-					*pTmp++ = aColor.GetGreen();
-					*pTmp++ = aColor.GetRed();
-#else
 					*pTmp++ = aColor.GetRed();
 					*pTmp++ = aColor.GetGreen();
 					*pTmp++ = aColor.GetBlue();
-#endif
 				}
 			}
 
@@ -715,11 +687,7 @@
 
 	if( pAcc )
 	{
-#ifndef SYSTEM_JPEG
-		bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_BGR );
-#else
 		bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB );
-#endif
 
 		if( !bNative )
 			pBuffer = new BYTE[ AlignedWidth4Bytes( pAcc->Width() * 24L ) ];
diff -r b9c9dd11b0a1 -r ab0345143841 binfilter/bf_svtools/source/filter.vcl/jpeg/svt_jpegc.c
--- a/binfilter/bf_svtools/source/filter.vcl/jpeg/svt_jpegc.c	Thu Jan 07 15:14:24 2010 +0100
+++ b/binfilter/bf_svtools/source/filter.vcl/jpeg/svt_jpegc.c	Thu Jan 14 13:47:52 2010 +0000
@@ -35,6 +35,9 @@
 #include "jerror.h"
 #include "jpeg.h"
 
+#include "rtl/alloc.h"
+#include "osl/diagnose.h"
+
 struct my_error_mgr
 {
 	struct jpeg_error_mgr pub;
@@ -80,6 +83,9 @@
     long                            nWidth;
     long                            nHeight;
     long                            nAlignedWidth;
+    JSAMPLE * range_limit;
+    HPBYTE pScanLineBuffer = NULL;
+    long nScanLineBufferComponents = 0;
     // declare bDecompCreated volatile because of gcc
     // warning: variable 'bDecompCreated' might be clobbered by `longjmp' or `vfork'
 	volatile long					bDecompCreated = 0;
@@ -105,8 +111,12 @@
 	cinfo.output_gamma = 1.0;
 	cinfo.raw_data_out = FALSE;
 	cinfo.quantize_colors = FALSE;
-	if ( cinfo.jpeg_color_space != JCS_GRAYSCALE )
-		cinfo.out_color_space = JCS_RGB;
+	if ( cinfo.jpeg_color_space == JCS_YCbCr )
+	    cinfo.out_color_space = JCS_RGB;
+	else if ( cinfo.jpeg_color_space == JCS_YCCK )
+	    cinfo.out_color_space = JCS_CMYK;
+
+	OSL_ASSERT(cinfo.out_color_space == JCS_CMYK || cinfo.out_color_space == JCS_GRAYSCALE || cinfo.out_color_space == JCS_RGB);
 
     /* change scale for preview import */
     if( nPreviewWidth || nPreviewHeight )
@@ -150,6 +160,14 @@
     aCreateBitmapParam.bGray = cinfo.output_components == 1;
 	pDIB = CreateBitmap( pJPEGReader, &aCreateBitmapParam );
     nAlignedWidth = aCreateBitmapParam.nAlignedWidth;
+    range_limit=cinfo.sample_range_limit;
+
+	if ( cinfo.out_color_space == JCS_CMYK )
+	{
+    		nScanLineBufferComponents = cinfo.output_width * 4;
+		pScanLineBuffer = rtl_allocateMemory( nScanLineBufferComponents );
+	}
+
 	if( pDIB )
 	{
 		if( aCreateBitmapParam.bTopDown )
@@ -162,17 +180,37 @@
 
 		for ( *pLines = 0; *pLines < nHeight; (*pLines)++ )
 		{
+		    if (pScanLineBuffer!=NULL) { // in other words cinfo.out_color_space == JCS_CMYK
+			int i;
+			int j;
+			jpeg_read_scanlines( &cinfo, (JSAMPARRAY) &pScanLineBuffer, 1 );
+			// convert CMYK to RGB
+			for( i=0, j=0; i < nScanLineBufferComponents; i+=4, j+=3 )
+			{
+			    int c_=255-pScanLineBuffer[i+0];
+			    int m_=255-pScanLineBuffer[i+1];
+			    int y_=255-pScanLineBuffer[i+2];
+			    int k_=255-pScanLineBuffer[i+3];
+			    pTmp[j+0]=range_limit[ 255L - ( c_ + k_ ) ];
+			    pTmp[j+1]=range_limit[ 255L - ( m_ + k_ ) ];
+			    pTmp[j+2]=range_limit[ 255L - ( y_ + k_ ) ];
+			}
+		    } else {
 			jpeg_read_scanlines( &cinfo, (JSAMPARRAY) &pTmp, 1 );
-
-			/* PENDING ??? */
-			if ( cinfo.err->msg_code == 113 )
-				break;
-
-			pTmp += nAlignedWidth;
+		    }
+		    /* PENDING ??? */
+		    if ( cinfo.err->msg_code == 113 )
+			break;
+		    
+		    pTmp += nAlignedWidth;
 		}
 	}
 
 	jpeg_finish_decompress( &cinfo );
+	if (pScanLineBuffer!=NULL) {
+	    rtl_freeMemory( pScanLineBuffer );
+	    pScanLineBuffer=NULL;
+	}
 
 Exit:
 
diff -r b9c9dd11b0a1 -r ab0345143841 jpeg/jpeg-6b.patch
--- a/jpeg/jpeg-6b.patch	Thu Jan 07 15:14:24 2010 +0100
+++ b/jpeg/jpeg-6b.patch	Thu Jan 14 13:47:52 2010 +0000
@@ -18,111 +18,6 @@
 +#undef RIGHT_SHIFT_IS_UNSIGNED
 +#define NO_GETENV
 +#endif
---- misc/jpeg-6b/jdcolor.c	1997-08-04 01:39:16.000000000 +0200
-+++ misc/build/jpeg-6b/jdcolor.c	2009-03-19 11:30:30.000000000 +0100
-@@ -284,6 +284,90 @@
-   }
- }
- 
-+METHODDEF(void)
-+ycck_rgb_convert (j_decompress_ptr cinfo,
-+		   JSAMPIMAGE input_buf, JDIMENSION input_row,
-+		   JSAMPARRAY output_buf, int num_rows)
-+{
-+	my_cconvert_ptr			cconvert = (my_cconvert_ptr) cinfo->cconvert;
-+	JDIMENSION				num_cols = cinfo->output_width;
-+	long					cc, cm, cy, ck;
-+	long					y, cb, cr;
-+	register JSAMPROW		outptr;
-+	register JSAMPROW		inptr0, inptr1, inptr2, inptr3;
-+	register JDIMENSION		col;
-+	register JSAMPLE*		range_limit = cinfo->sample_range_limit;
-+	register int*			Crrtab = cconvert->Cr_r_tab;
-+	register int*			Cbbtab = cconvert->Cb_b_tab;
-+	register INT32*			Crgtab = cconvert->Cr_g_tab;
-+	register INT32*			Cbgtab = cconvert->Cb_g_tab;
-+	SHIFT_TEMPS
-+
-+	while( --num_rows >= 0 )
-+	{
-+		inptr0 = input_buf[0][input_row];
-+		inptr1 = input_buf[1][input_row];
-+		inptr2 = input_buf[2][input_row];
-+		inptr3 = input_buf[3][input_row++];
-+
-+		for( col = 0, outptr = *output_buf++; col < num_cols; col++ )
-+		{
-+			y  = GETJSAMPLE(inptr0[col]);
-+			cb = GETJSAMPLE(inptr1[col]);
-+			cr = GETJSAMPLE(inptr2[col]);
-+
-+			// YCCK => CMYK
-+			cc = 255L - range_limit[MAXJSAMPLE - (y + Crrtab[cr])];
-+			cm = 255L - range_limit[MAXJSAMPLE - (y + ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS)))];
-+			cy = 255L - range_limit[MAXJSAMPLE - (y + Cbbtab[cb])];
-+			ck = 255L - inptr3[col];
-+
-+			// CMYK => RGB
-+			outptr[ RGB_RED ] = range_limit[ 255L - ( cc + ck ) ];
-+			outptr[ RGB_GREEN ] = range_limit[ 255L - ( cm + ck ) ];
-+			outptr[ RGB_BLUE ] = range_limit[ 255L - ( cy + ck ) ];
-+			outptr += RGB_PIXELSIZE;
-+		}
-+	}
-+}
-+
-+METHODDEF(void)
-+cmyk_rgb_convert (j_decompress_ptr cinfo,
-+		   JSAMPIMAGE input_buf, JDIMENSION input_row,
-+		   JSAMPARRAY output_buf, int num_rows)
-+{
-+	my_cconvert_ptr			cconvert = (my_cconvert_ptr) cinfo->cconvert;
-+	JDIMENSION				num_cols = cinfo->output_width;
-+	long					cc, cm, cy, ck;
-+	long					y, cb, cr;
-+	register JSAMPROW		outptr;
-+	register JSAMPROW		inptr0, inptr1, inptr2, inptr3;
-+	register JDIMENSION		col;
-+	register JSAMPLE*		range_limit = cinfo->sample_range_limit;
-+	SHIFT_TEMPS
-+
-+	while( --num_rows >= 0 )
-+	{
-+		inptr0 = input_buf[0][input_row];
-+		inptr1 = input_buf[1][input_row];
-+		inptr2 = input_buf[2][input_row];
-+		inptr3 = input_buf[3][input_row++];
-+
-+		for( col = 0, outptr = *output_buf++; col < num_cols; col++ )
-+		{
-+			cc  = 255 - GETJSAMPLE(inptr0[col]);
-+			cm  = 255 - GETJSAMPLE(inptr1[col]);
-+			cy  = 255 - GETJSAMPLE(inptr2[col]);
-+			ck  = 255 - GETJSAMPLE(inptr3[col]);
-+
-+			// CMYK => RGB
-+			outptr[ RGB_RED ] = range_limit[ 255L - ( cc + ck ) ];
-+			outptr[ RGB_GREEN ] = range_limit[ 255L - ( cm + ck ) ];
-+			outptr[ RGB_BLUE ] = range_limit[ 255L - ( cy + ck ) ];
-+			outptr += RGB_PIXELSIZE;
-+		}
-+	}
-+}
- 
- /*
-  * Empty method for start_pass.
-@@ -364,6 +448,11 @@
-       cconvert->pub.color_convert = gray_rgb_convert;
-     } else if (cinfo->jpeg_color_space == JCS_RGB && RGB_PIXELSIZE == 3) {
-       cconvert->pub.color_convert = null_convert;
-+	} else if (cinfo->jpeg_color_space == JCS_YCCK) {
-+	  cconvert->pub.color_convert = ycck_rgb_convert;
-+	  build_ycc_rgb_table(cinfo);
-+	} else if (cinfo->jpeg_color_space == JCS_CMYK) {
-+	  cconvert->pub.color_convert = cmyk_rgb_convert;
-     } else
-       ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
-     break;
 --- misc/jpeg-6b/jmorecfg.h	1997-08-10 01:58:56.000000000 +0200
 +++ misc/build/jpeg-6b/jmorecfg.h	2009-03-19 11:30:30.000000000 +0100
 @@ -157,8 +157,8 @@
@@ -136,18 +31,6 @@
  #endif
  
  /* Datatype used for image dimensions.  The JPEG standard only supports
-@@ -311,9 +311,9 @@
-  *    can't use color quantization if you change that value.
-  */
- 
--#define RGB_RED		0	/* Offset of Red in an RGB scanline element */
-+#define RGB_RED		2	/* Offset of Red in an RGB scanline element */
- #define RGB_GREEN	1	/* Offset of Green */
--#define RGB_BLUE	2	/* Offset of Blue */
-+#define RGB_BLUE	0	/* Offset of Blue */
- #define RGB_PIXELSIZE	3	/* JSAMPLEs per RGB scanline element */
- 
- 
 --- misc/jpeg-6b/makefile.mk	2009-03-19 11:30:46.000000000 +0100
 +++ misc/build/jpeg-6b/makefile.mk	2009-03-19 11:30:30.000000000 +0100
 @@ -1 +1,82 @@
diff -r b9c9dd11b0a1 -r ab0345143841 solenv/inc/libs.mk
--- a/solenv/inc/libs.mk	Thu Jan 07 15:14:24 2010 +0100
+++ b/solenv/inc/libs.mk	Thu Jan 14 13:47:52 2010 +0000
@@ -210,7 +210,7 @@
 #i34482# Blackdown/Sun jdk is in the libsearch patch and has a libjpeg :-(
 .IF "$(OS)" == "FREEBSD"
 JPEG3RDLIB=/usr/local/lib/libjpeg.so
-.ELIF "$(CPUNAME)" == "X86_64"
+.ELIF "$(CPUNAME)" == "X86_64" || "$(CPUNAME)" == "S390X" || "$(CPUNAME)" == "POWERPC64"
 JPEG3RDLIB=/usr/lib64/libjpeg.so
 .ELSE
 JPEG3RDLIB=/usr/lib/libjpeg.so
diff -r b9c9dd11b0a1 -r ab0345143841 svtools/source/filter.vcl/jpeg/jpeg.cxx
--- a/svtools/source/filter.vcl/jpeg/jpeg.cxx	Thu Jan 07 15:14:24 2010 +0100
+++ b/svtools/source/filter.vcl/jpeg/jpeg.cxx	Thu Jan 14 13:47:52 2010 +0000
@@ -33,22 +33,16 @@
 
 #include <tools/solar.h>
 
-#ifdef SYSTEM_JPEG
-#define INT32 JPEG_INT32
-#endif
-
 extern "C"
 {
+	#define INT32 JPEG_INT32
 	#include "stdio.h"
 	#include "jpeg.h"
 	#include "jpeglib.h"
 	#include "jerror.h"
+	#undef INT32
 }
 
-#ifdef SYSTEM_JPEG
-#undef INT32
-#endif
-
 #define _JPEGPRIVATE
 #include <vcl/bmpacc.hxx>
 #include "jpeg.hxx"
@@ -399,11 +393,7 @@
 
 		if(
 			( bGray && ( BMP_FORMAT_8BIT_PAL == nFormat ) ) ||
-#ifndef SYSTEM_JPEG
-			( !bGray && ( BMP_FORMAT_24BIT_TC_BGR == nFormat ) )
-#else
 			( !bGray && ( BMP_FORMAT_24BIT_TC_RGB == nFormat ) )
-#endif
 		  )
 		{
 			pBmpBuf = pAcc->GetBuffer();
@@ -466,15 +456,9 @@
 
 				for( long nX = 0L; nX < nWidth; nX++ )
 				{
-#ifndef SYSTEM_JPEG
-					aColor.SetBlue( *pTmp++ );
-					aColor.SetGreen( *pTmp++ );
-					aColor.SetRed( *pTmp++ );
-#else
 					aColor.SetRed( *pTmp++ );
 					aColor.SetGreen( *pTmp++ );
 					aColor.SetBlue( *pTmp++ );
-#endif
 					pAcc->SetPixel( nY, nX, aColor );
 				}
 			}
@@ -654,15 +638,9 @@
 				for( long nX = 0L; nX < nWidth; nX++ )
 				{
 					aColor = pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( nY, nX ) );
-#ifndef SYSTEM_JPEG
-					*pTmp++ = aColor.GetBlue();
-					*pTmp++ = aColor.GetGreen();
-					*pTmp++ = aColor.GetRed();
-#else
 					*pTmp++ = aColor.GetRed();
 					*pTmp++ = aColor.GetGreen();
 					*pTmp++ = aColor.GetBlue();
-#endif
 				}
 			}
 			else
@@ -670,15 +648,9 @@
 				for( long nX = 0L; nX < nWidth; nX++ )
 				{
 					aColor = pAcc->GetPixel( nY, nX );
-#ifndef SYSTEM_JPEG
-					*pTmp++ = aColor.GetBlue();
-					*pTmp++ = aColor.GetGreen();
-					*pTmp++ = aColor.GetRed();
-#else
 					*pTmp++ = aColor.GetRed();
 					*pTmp++ = aColor.GetGreen();
 					*pTmp++ = aColor.GetBlue();
-#endif
 				}
 			}
 
@@ -713,11 +685,7 @@
 
 	if( pAcc )
 	{
-#ifndef SYSTEM_JPEG
-		bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_BGR );
-#else
 		bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB );
-#endif
 
 		if( !bNative )
 			pBuffer = new BYTE[ AlignedWidth4Bytes( pAcc->Width() * 24L ) ];
diff -r b9c9dd11b0a1 -r ab0345143841 svtools/source/filter.vcl/jpeg/jpegc.c
--- a/svtools/source/filter.vcl/jpeg/jpegc.c	Thu Jan 07 15:14:24 2010 +0100
+++ b/svtools/source/filter.vcl/jpeg/jpegc.c	Thu Jan 14 13:47:52 2010 +0000
@@ -34,7 +34,8 @@
 #include "jpeglib.h"
 #include "jerror.h"
 #include "jpeg.h"
-
+#include "rtl/alloc.h"
+#include "osl/diagnose.h"
 
 struct my_error_mgr
 {
@@ -81,6 +82,9 @@
     long                            nWidth;
     long                            nHeight;
     long                            nAlignedWidth;
+    JSAMPLE * range_limit;
+    HPBYTE pScanLineBuffer = NULL;
+    long nScanLineBufferComponents = 0;
     // declare bDecompCreated volatile because of gcc
     // warning: variable 'bDecompCreated' might be clobbered by `longjmp' or `vfork'
 	volatile long					bDecompCreated = 0;
@@ -106,8 +110,12 @@
 	cinfo.output_gamma = 1.0;
 	cinfo.raw_data_out = FALSE;
 	cinfo.quantize_colors = FALSE;
-	if ( cinfo.jpeg_color_space != JCS_GRAYSCALE )
-		cinfo.out_color_space = JCS_RGB;
+	if ( cinfo.jpeg_color_space == JCS_YCbCr )
+	    cinfo.out_color_space = JCS_RGB;
+	else if ( cinfo.jpeg_color_space == JCS_YCCK )
+	    cinfo.out_color_space = JCS_CMYK;
+
+	OSL_ASSERT(cinfo.out_color_space == JCS_CMYK || cinfo.out_color_space == JCS_GRAYSCALE || cinfo.out_color_space == JCS_RGB);
 
     /* change scale for preview import */
     if( nPreviewWidth || nPreviewHeight )
@@ -151,6 +159,14 @@
     aCreateBitmapParam.bGray = cinfo.output_components == 1;
 	pDIB = CreateBitmap( pJPEGReader, &aCreateBitmapParam );
     nAlignedWidth = aCreateBitmapParam.nAlignedWidth;
+    range_limit=cinfo.sample_range_limit;
+
+	if ( cinfo.out_color_space == JCS_CMYK )
+	{
+    		nScanLineBufferComponents = cinfo.output_width * 4;
+		pScanLineBuffer = rtl_allocateMemory( nScanLineBufferComponents );
+	}
+
 	if( pDIB )
 	{
 		if( aCreateBitmapParam.bTopDown )
@@ -163,17 +179,37 @@
 
 		for ( *pLines = 0; *pLines < nHeight; (*pLines)++ )
 		{
+		    if (pScanLineBuffer!=NULL) { // in other words cinfo.out_color_space == JCS_CMYK
+			int i;
+			int j;
+			jpeg_read_scanlines( &cinfo, (JSAMPARRAY) &pScanLineBuffer, 1 );
+			// convert CMYK to RGB
+			for( i=0, j=0; i < nScanLineBufferComponents; i+=4, j+=3 )
+			{
+			    int c_=255-pScanLineBuffer[i+0];
+			    int m_=255-pScanLineBuffer[i+1];
+			    int y_=255-pScanLineBuffer[i+2];
+			    int k_=255-pScanLineBuffer[i+3];
+			    pTmp[j+0]=range_limit[ 255L - ( c_ + k_ ) ];
+			    pTmp[j+1]=range_limit[ 255L - ( m_ + k_ ) ];
+			    pTmp[j+2]=range_limit[ 255L - ( y_ + k_ ) ];
+			}
+		    } else {
 			jpeg_read_scanlines( &cinfo, (JSAMPARRAY) &pTmp, 1 );
-
-			/* PENDING ??? */
-			if ( cinfo.err->msg_code == 113 )
-				break;
-
-			pTmp += nAlignedWidth;
+		    }
+		    /* PENDING ??? */
+		    if ( cinfo.err->msg_code == 113 )
+			break;
+		    
+		    pTmp += nAlignedWidth;
 		}
 	}
 
 	jpeg_finish_decompress( &cinfo );
+	if (pScanLineBuffer!=NULL) {
+	    rtl_freeMemory( pScanLineBuffer );
+	    pScanLineBuffer=NULL;
+	}
 
 Exit:
 
diff -r b9c9dd11b0a1 -r ab0345143841 svtools/source/filter.vcl/jpeg/makefile.mk
--- a/svtools/source/filter.vcl/jpeg/makefile.mk	Thu Jan 07 15:14:24 2010 +0100
+++ b/svtools/source/filter.vcl/jpeg/makefile.mk	Thu Jan 14 13:47:52 2010 +0000
@@ -39,10 +39,6 @@
 .INCLUDE :  settings.mk
 .INCLUDE :  $(PRJ)$/util$/svt.pmk
 
-.IF "$(SYSTEM_JPEG)" == "YES"
-CFLAGS+=-DSYSTEM_JPEG
-.ENDIF
-
 SOLARINC+=-I../../inc
 
 # --- Files --------------------------------------------------------


Index: openoffice.org.spec
===================================================================
RCS file: /cvs/pkgs/rpms/openoffice.org/devel/openoffice.org.spec,v
retrieving revision 1.2124
retrieving revision 1.2125
diff -u -p -r1.2124 -r1.2125
--- openoffice.org.spec	14 Jan 2010 16:18:48 -0000	1.2124
+++ openoffice.org.spec	14 Jan 2010 17:05:46 -0000	1.2125
@@ -128,8 +128,9 @@ Patch52: openoffice.org-3.2.0.ooo107834.
 Patch53: openoffice.org-3.3.0.ooo108047.writerfilter.safer-field-context-handling.patch
 Patch54: openoffice.org-3.3.0.ooo108246.svx.check-for-possible-out-of-bounds-index.patch
 Patch55: workspace.sw33bf02.patch
-Patch56: openoffice.org-3.2.0.oooXXXXX.embeddedobj.outplace.readonly.os.dispatch.patch
-Patch57: openoffice.org-3.3.0.ooo80674.cmyk-for-jpeg-images.patch
+Patch56: openoffice.org-3.2.0.ooo108330.embeddedobj.outplace.readonly.os.dispatch.patch
+Patch57: openoffice.org-3.2.0.ooo96362.filter.nondeterministic.order.patch
+Patch58: workspace.cmcfixes70.patch
 
 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
 %define instdir %{_libdir}
@@ -1685,8 +1686,9 @@ cp -p %{SOURCE5} external/unowinreg/unow
 %patch53 -p1 -b .ooo108047.writerfilter.safer-field-context-handling.patch
 %patch54 -p1 -b .ooo108246.svx.check-for-possible-out-of-bounds-index.patch
 %patch55 -p1 -b .workspace.sw33bf02.patch
-%patch56 -p0 -b .oooXXXXX.embeddedobj.outplace.readonly.os.dispatch.patch
-%patch57 -p1 -b .ooo80674.cmyk-for-jpeg-images.patch
+%patch56 -p0 -b .ooo108330.embeddedobj.outplace.readonly.os.dispatch.patch
+%patch57 -p0 -b .ooo96362.filter.nondeterministic.order.patch
+%patch58 -p0 -b .workspace.cmcfixes70.patch
 
 %build
 echo build start time is `date`, diskspace: `df -h . | tail -n 1`


--- openoffice.org-3.2.0.oooXXXXX.embeddedobj.outplace.readonly.os.dispatch.patch DELETED ---


--- openoffice.org-3.3.0.ooo80674.cmyk-for-jpeg-images.patch DELETED ---



More information about the scm-commits mailing list