diff options
-rw-r--r-- | l10ntools/source/filter/utils/XMLHelper.java | 2 | ||||
-rw-r--r-- | svtools/source/filter.vcl/jpeg/jpeg.cxx | 45 | ||||
-rw-r--r-- | svtools/source/filter.vcl/jpeg/jpegc.c | 44 | ||||
-rw-r--r-- | svtools/source/filter.vcl/jpeg/makefile.mk | 4 | ||||
-rw-r--r-- | ucbhelper/source/client/content.cxx | 6 | ||||
-rw-r--r-- | unotools/source/config/configitem.cxx | 6 | ||||
-rw-r--r-- | unotools/source/config/confignode.cxx | 3 | ||||
-rw-r--r-- | unotools/source/config/fltrcfg.cxx | 2 |
8 files changed, 52 insertions, 60 deletions
diff --git a/l10ntools/source/filter/utils/XMLHelper.java b/l10ntools/source/filter/utils/XMLHelper.java index edd7508cbf94..175d04ebacef 100644 --- a/l10ntools/source/filter/utils/XMLHelper.java +++ b/l10ntools/source/filter/utils/XMLHelper.java @@ -804,7 +804,7 @@ public class XMLHelper sHeader.append(sVersion); sHeader.append("\" encoding=\""); sHeader.append(sEncoding); - sHeader.append("\"?>\n<!DOCTYPE oor:component-data SYSTEM \"../../../../component-update.dtd\">\n"); + sHeader.append("\"?>\n"); sHeader.append("<oor:component-data xmlns:oor=\"http://openoffice.org/2001/registry\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" oor:package=\""); sHeader.append(sPath); sHeader.append("\" oor:name=\""); diff --git a/svtools/source/filter.vcl/jpeg/jpeg.cxx b/svtools/source/filter.vcl/jpeg/jpeg.cxx index 045dd00cc96f..7fd2e09a82dd 100644 --- a/svtools/source/filter.vcl/jpeg/jpeg.cxx +++ b/svtools/source/filter.vcl/jpeg/jpeg.cxx @@ -30,22 +30,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" @@ -396,11 +390,7 @@ void* JPEGReader::CreateBitmap( void* pParam ) 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(); @@ -463,15 +453,9 @@ void JPEGReader::FillBitmap() 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 ); } } @@ -651,19 +635,11 @@ void* JPEGWriter::GetScanline( long nY ) for( long nX = 0L; nX < nWidth; nX++ ) { aColor = pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( nY, nX ) ); -#ifndef SYSTEM_JPEG - *pTmp++ = aColor.GetBlue(); - if ( bGreys ) - continue; - *pTmp++ = aColor.GetGreen(); - *pTmp++ = aColor.GetRed(); -#else *pTmp++ = aColor.GetRed(); if ( bGreys ) continue; *pTmp++ = aColor.GetGreen(); *pTmp++ = aColor.GetBlue(); -#endif } } else @@ -671,19 +647,11 @@ void* JPEGWriter::GetScanline( long nY ) for( long nX = 0L; nX < nWidth; nX++ ) { aColor = pAcc->GetPixel( nY, nX ); -#ifndef SYSTEM_JPEG - *pTmp++ = aColor.GetBlue(); - if ( bGreys ) - continue; - *pTmp++ = aColor.GetGreen(); - *pTmp++ = aColor.GetRed(); -#else *pTmp++ = aColor.GetRed(); if ( bGreys ) continue; *pTmp++ = aColor.GetGreen(); *pTmp++ = aColor.GetBlue(); -#endif } } @@ -738,14 +706,7 @@ BOOL JPEGWriter::Write( const Graphic& rGraphic ) if( pAcc ) { - if ( bGreys ) - bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL ); - else -#ifndef SYSTEM_JPEG - bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_BGR ); -#else - bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB ); -#endif + bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB ); if( !bNative ) pBuffer = new BYTE[ AlignedWidth4Bytes( bGreys ? pAcc->Width() * 8L : pAcc->Width() * 24L ) ]; diff --git a/svtools/source/filter.vcl/jpeg/jpegc.c b/svtools/source/filter.vcl/jpeg/jpegc.c index 78602556097b..29b4749a7b51 100644 --- a/svtools/source/filter.vcl/jpeg/jpegc.c +++ b/svtools/source/filter.vcl/jpeg/jpegc.c @@ -31,7 +31,8 @@ #include "jpeglib.h" #include "jerror.h" #include "jpeg.h" - +#include "rtl/alloc.h" +#include "osl/diagnose.h" struct my_error_mgr { @@ -78,6 +79,9 @@ void ReadJPEG( void* pJPEGReader, void* pIStm, long* pLines ) 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; @@ -103,8 +107,12 @@ void ReadJPEG( void* pJPEGReader, void* pIStm, long* pLines ) cinfo.output_gamma = 1.0; cinfo.raw_data_out = FALSE; cinfo.quantize_colors = FALSE; - if ( cinfo.jpeg_color_space != JCS_GRAYSCALE ) + 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 ) @@ -148,6 +156,14 @@ void ReadJPEG( void* pJPEGReader, void* pIStm, long* pLines ) 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 ) @@ -160,17 +176,37 @@ void ReadJPEG( void* pJPEGReader, void* pIStm, long* pLines ) 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; + break; pTmp += nAlignedWidth; } } jpeg_finish_decompress( &cinfo ); + if (pScanLineBuffer!=NULL) { + rtl_freeMemory( pScanLineBuffer ); + pScanLineBuffer=NULL; + } Exit: diff --git a/svtools/source/filter.vcl/jpeg/makefile.mk b/svtools/source/filter.vcl/jpeg/makefile.mk index 653ca77ed7eb..c782c520324c 100644 --- a/svtools/source/filter.vcl/jpeg/makefile.mk +++ b/svtools/source/filter.vcl/jpeg/makefile.mk @@ -35,10 +35,6 @@ TARGET=jpeg .INCLUDE : settings.mk .INCLUDE : $(PRJ)$/util$/svt.pmk -.IF "$(SYSTEM_JPEG)" == "YES" -CFLAGS+=-DSYSTEM_JPEG -.ENDIF - SOLARINC+=-I../../inc # --- Files -------------------------------------------------------- diff --git a/ucbhelper/source/client/content.cxx b/ucbhelper/source/client/content.cxx index 451c629694c6..4debb1728bfe 100644 --- a/ucbhelper/source/client/content.cxx +++ b/ucbhelper/source/client/content.cxx @@ -337,12 +337,14 @@ static Reference< XContent > getContent( if ( xProvider.is() ) { Reference< XContent > xContent; + rtl::OUString msg; try { xContent = xProvider->queryContent( xId ); } - catch ( IllegalIdentifierException const & ) + catch ( IllegalIdentifierException const & e ) { + msg = e.Message; // handled below. } @@ -355,7 +357,7 @@ static Reference< XContent > getContent( throw ContentCreationException( rtl::OUString::createFromAscii( - "Unable to create Content!" ), + "Unable to create Content! " ) + msg, Reference< XInterface >(), ContentCreationError_CONTENT_CREATION_FAILED ); } diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx index eda74f873b5f..e191f471057a 100644 --- a/unotools/source/config/configitem.cxx +++ b/unotools/source/config/configitem.cxx @@ -600,9 +600,9 @@ Sequence< Any > ConfigItem::GetProperties(const Sequence< OUString >& rNames) else pRet[i] = xHierarchyAccess->getByHierarchicalName(pNames[i]); } - #ifdef DBG_UTIL catch(Exception& rEx) { +#if OSL_DEBUG_LEVEL > 0 OString sMsg("XHierarchicalNameAccess: "); sMsg += OString(rEx.Message.getStr(), rEx.Message.getLength(), @@ -619,10 +619,10 @@ Sequence< Any > ConfigItem::GetProperties(const Sequence< OUString >& rNames) pNames[i].getLength(), RTL_TEXTENCODING_ASCII_US); OSL_ENSURE(sal_False, sMsg.getStr()); - } #else - catch(Exception&){} + (void) rEx; // avoid warning #endif + } } // In special mode "ALL_LOCALES" we must convert localized values to Sequence< PropertyValue >. diff --git a/unotools/source/config/confignode.cxx b/unotools/source/config/confignode.cxx index f196ebba0863..802a63782cf9 100644 --- a/unotools/source/config/confignode.cxx +++ b/unotools/source/config/confignode.cxx @@ -159,7 +159,6 @@ namespace utl if (getEscape()) { Reference< XStringEscape > xEscaper(m_xDirectAccess, UNO_QUERY); - OSL_ENSURE(xEscaper.is(), "OConfigurationNode::normalizeName: missing an interface!"); if (xEscaper.is() && sName.getLength()) { try @@ -333,8 +332,6 @@ namespace utl void OConfigurationNode::setEscape(sal_Bool _bEnable) { m_bEscapeNames = _bEnable && Reference< XStringEscape >::query(m_xDirectAccess).is(); - OSL_ENSURE(m_bEscapeNames || !_bEnable, - "OConfigurationNode::setEscape: escaping not enabled - missing the appropriate interface on the node!"); } //------------------------------------------------------------------------ diff --git a/unotools/source/config/fltrcfg.cxx b/unotools/source/config/fltrcfg.cxx index f9a12e900b7d..94f7ff07d7d7 100644 --- a/unotools/source/config/fltrcfg.cxx +++ b/unotools/source/config/fltrcfg.cxx @@ -531,7 +531,7 @@ void SvtFilterOptions::SetWriter2WinWord( BOOL bFlag ) BOOL SvtFilterOptions::IsUseEnhancedFields() const { return false; // disable for now; -// return pImp->IsFlag( FILTERCFG_USE_ENHANCED_FIELDS ); +// return pImp->IsFlag( FILTERCFG_USE_ENHANCED_FIELDS ); } void SvtFilterOptions::SetUseEnhancedFields( BOOL bFlag ) |