summaryrefslogtreecommitdiff
path: root/svtools/source
diff options
context:
space:
mode:
authorobo <obo@openoffice.org>2010-06-14 15:36:30 +0200
committerobo <obo@openoffice.org>2010-06-14 15:36:30 +0200
commitfcef6979902a4b520935e7d5d38924398010a9ab (patch)
tree7ab3ce933a393572ccfc64471445f250f07a64dc /svtools/source
parent865ca3f320f647d61f37243fb281dfd9571a08af (diff)
parent8f5ff4a4cbe7d33417a7b884e1c3093168738581 (diff)
CWS-TOOLING: integrate CWS vcl111
Diffstat (limited to 'svtools/source')
-rw-r--r--svtools/source/filter.vcl/filter/filter.cxx8
-rw-r--r--svtools/source/filter.vcl/jpeg/jpeg.cxx15
-rw-r--r--svtools/source/inc/jpeg.hxx11
3 files changed, 26 insertions, 8 deletions
diff --git a/svtools/source/filter.vcl/filter/filter.cxx b/svtools/source/filter.vcl/filter/filter.cxx
index e8121f1d7e94..c8a79d3a35cd 100644
--- a/svtools/source/filter.vcl/filter/filter.cxx
+++ b/svtools/source/filter.vcl/filter/filter.cxx
@@ -992,7 +992,8 @@ namespace { struct Cache : public rtl::Static<ImpFilterLibCache, Cache> {}; }
// -----------------
GraphicFilter::GraphicFilter( sal_Bool bConfig ) :
- bUseConfig ( bConfig )
+ bUseConfig ( bConfig ),
+ nExpGraphHint ( 0 )
{
ImplInit();
}
@@ -1678,6 +1679,7 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat
USHORT nFormatCount = GetExportFormatCount();
ResetLastError();
+ nExpGraphHint = 0;
if( nFormat == GRFILTER_FORMAT_DONTKNOW )
{
@@ -1850,8 +1852,10 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat
}
else if( aFilterName.EqualsIgnoreCaseAscii( EXP_JPEG ) )
{
- if( !ExportJPEG( rOStm, aGraphic, pFilterData ) )
+ bool bExportedGrayJPEG = false;
+ if( !ExportJPEG( rOStm, aGraphic, pFilterData, &bExportedGrayJPEG ) )
nStatus = GRFILTER_FORMATERROR;
+ nExpGraphHint = bExportedGrayJPEG ? GRFILTER_OUTHINT_GREY : 0;
if( rOStm.GetError() )
nStatus = GRFILTER_IOERROR;
diff --git a/svtools/source/filter.vcl/jpeg/jpeg.cxx b/svtools/source/filter.vcl/jpeg/jpeg.cxx
index 7fd2e09a82dd..a2de92171af3 100644
--- a/svtools/source/filter.vcl/jpeg/jpeg.cxx
+++ b/svtools/source/filter.vcl/jpeg/jpeg.cxx
@@ -590,10 +590,11 @@ ReadState JPEGReader::Read( Graphic& rGraphic )
// - JPEGWriter -
// --------------
-JPEGWriter::JPEGWriter( SvStream& rStm, const uno::Sequence< beans::PropertyValue >* pFilterData ) :
+JPEGWriter::JPEGWriter( SvStream& rStm, const uno::Sequence< beans::PropertyValue >* pFilterData, bool* pExportWasGrey ) :
rOStm ( rStm ),
pAcc ( NULL ),
- pBuffer ( NULL )
+ pBuffer ( NULL ),
+ pExpWasGrey ( pExportWasGrey )
{
FilterConfigItem aConfigItem( (uno::Sequence< beans::PropertyValue >*)pFilterData );
bGreys = aConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorMode" ) ), 0 ) != 0;
@@ -704,6 +705,9 @@ BOOL JPEGWriter::Write( const Graphic& rGraphic )
bGreys = sal_True;
}
+ if( pExpWasGrey )
+ *pExpWasGrey = bGreys;
+
if( pAcc )
{
bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB );
@@ -765,8 +769,11 @@ BOOL ImportJPEG( SvStream& rStm, Graphic& rGraphic, void* pCallerData, sal_Int32
// - ExportJPEG -
// --------------
-BOOL ExportJPEG( SvStream& rOStm, const Graphic& rGraphic, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData )
+BOOL ExportJPEG( SvStream& rOStm, const Graphic& rGraphic,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData,
+ bool* pExportWasGrey
+ )
{
- JPEGWriter aJPEGWriter( rOStm, pFilterData );
+ JPEGWriter aJPEGWriter( rOStm, pFilterData, pExportWasGrey );
return aJPEGWriter.Write( rGraphic );
}
diff --git a/svtools/source/inc/jpeg.hxx b/svtools/source/inc/jpeg.hxx
index 906bcd9ea2de..9923190c5e21 100644
--- a/svtools/source/inc/jpeg.hxx
+++ b/svtools/source/inc/jpeg.hxx
@@ -99,13 +99,16 @@ class JPEGWriter
sal_Bool bGreys;
sal_Int32 nQuality;
+ bool* pExpWasGrey;
+
com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > xStatusIndicator;
public:
void* GetScanline( long nY );
- JPEGWriter( SvStream& rOStm, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData );
+ JPEGWriter( SvStream& rOStm, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData,
+ bool* pExportWasGrey = NULL );
~JPEGWriter() {};
BOOL Write( const Graphic& rGraphic );
@@ -119,6 +122,10 @@ public:
BOOL ImportJPEG( SvStream& rStream, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags );
-BOOL ExportJPEG( SvStream& rStream, const Graphic& rGraphic, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData );
+BOOL ExportJPEG( SvStream& rStream,
+ const Graphic& rGraphic,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData,
+ bool* pExportWasGrey = NULL
+ );
#endif // _JPEG_HXX