From ddc4d5ab4592aee26bcc521d8a4d2d5b4ef2acd2 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Tue, 14 Nov 2006 15:12:31 +0000 Subject: INTEGRATION: CWS aw024 (1.3.18); FILE MERGED 2006/09/22 05:55:40 aw 1.3.18.8: RESYNC: (1.7-1.8); FILE MERGED 2006/09/07 10:36:41 aw 1.3.18.7: #i69169#stream pointer needs to be copied on local exporter 2006/08/03 19:39:09 aw 1.3.18.6: RESYNC: (1.6-1.7); FILE MERGED 2006/07/07 15:59:41 aw 1.3.18.5: adaptions after resync SRC680m171->SRC680m174 2006/07/04 17:43:49 aw 1.3.18.4: RESYNC: (1.5-1.6); FILE MERGED 2006/05/13 00:13:11 aw 1.3.18.3: RESYNC: (1.4-1.5); FILE MERGED 2005/09/20 04:36:06 aw 1.3.18.2: RESYNC: (1.3-1.4); FILE MERGED 2005/08/04 14:47:05 sj 1.3.18.1: #48467# using GraphicExporter component for exports, graphic filter progress now works now via xStatusIndicater instead of callback mechanism --- goodies/source/filter.vcl/etiff/etiff.cxx | 51 ++++++++++++++++++------------- 1 file changed, 29 insertions(+), 22 deletions(-) (limited to 'goodies/source/filter.vcl/etiff') diff --git a/goodies/source/filter.vcl/etiff/etiff.cxx b/goodies/source/filter.vcl/etiff/etiff.cxx index 44e42328a1f0..fa4615f68ed5 100644 --- a/goodies/source/filter.vcl/etiff/etiff.cxx +++ b/goodies/source/filter.vcl/etiff/etiff.cxx @@ -4,9 +4,9 @@ * * $RCSfile: etiff.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: obo $ $Date: 2006-09-17 15:44:50 $ + * last change: $Author: ihi $ $Date: 2006-11-14 16:12:31 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -78,8 +78,6 @@ class TIFFWriter { private: - PFilterCallback mpCallback; - void* mpCallerData; SvStream* mpOStm; UINT32 mnStreamOfs; @@ -113,6 +111,8 @@ private: ULONG nOffset; ULONG dwShift; + com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > xStatusIndicator; + void ImplCallback( UINT32 nPercent ); BOOL ImplWriteHeader( BOOL bMultiPage ); void ImplWritePalette(); @@ -129,9 +129,7 @@ public: TIFFWriter(); ~TIFFWriter(); - BOOL WriteTIFF( const Graphic& rGraphic, SvStream& rTIFF, - PFilterCallback pCallback, void* pCallerdata, - FilterConfigItem* pConfigItem ); + BOOL WriteTIFF( const Graphic& rGraphic, SvStream& rTIFF, FilterConfigItem* pFilterConfigItem ); }; // ------------------------------------------------------------------------ @@ -157,9 +155,7 @@ TIFFWriter::~TIFFWriter() // ------------------------------------------------------------------------ -BOOL TIFFWriter::WriteTIFF( const Graphic& rGraphic, SvStream& rTIFF, - PFilterCallback pCallback, void* pCallerdata, - FilterConfigItem* ) +BOOL TIFFWriter::WriteTIFF( const Graphic& rGraphic, SvStream& rTIFF, FilterConfigItem* pFilterConfigItem) { ULONG* pDummy = new ULONG; delete pDummy; // damit unter OS/2 // das richtige (Tools-)new @@ -167,9 +163,18 @@ BOOL TIFFWriter::WriteTIFF( const Graphic& rGraphic, SvStream& rTIFF, // in dieser DLL nur Vector-news // gibt; + if ( pFilterConfigItem ) + { + xStatusIndicator = pFilterConfigItem->GetStatusIndicator(); + if ( xStatusIndicator.is() ) + { + rtl::OUString aMsg; + xStatusIndicator->start( aMsg, 100 ); + } + } + + // #i69169# copy stream mpOStm = &rTIFF; - mpCallback = pCallback; - mpCallerData = pCallerdata; const UINT16 nOldFormat = mpOStm->GetNumberFormatInt(); mnStreamOfs = mpOStm->Tell(); @@ -240,6 +245,9 @@ BOOL TIFFWriter::WriteTIFF( const Graphic& rGraphic, SvStream& rTIFF, } mpOStm->SetNumberFormatInt( nOldFormat ); + if ( xStatusIndicator.is() ) + xStatusIndicator->end(); + return mbStatus; } @@ -247,13 +255,14 @@ BOOL TIFFWriter::WriteTIFF( const Graphic& rGraphic, SvStream& rTIFF, void TIFFWriter::ImplCallback( UINT32 nPercent ) { - if( nPercent >= mnLastPercent + 3 ) + if ( xStatusIndicator.is() ) { - mnLastPercent = nPercent; - - if( mpCallback && ( nPercent <= 100 ) && mbStatus ) - if ( ( (*mpCallback)( mpCallerData, (UINT16) nPercent ) ) ) - mbStatus = FALSE; + if( nPercent >= mnLastPercent + 3 ) + { + mnLastPercent = nPercent; + if ( nPercent <= 100 ) + xStatusIndicator->setValue( nPercent ); + } } } @@ -610,11 +619,9 @@ void TIFFWriter::EndCompression() // - exported function - // --------------------- -extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGraphic, - PFilterCallback pCallback, void* pCallerData, - FilterConfigItem* pConfigItem, BOOL ) +extern "C" BOOL __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem, BOOL ) { - return TIFFWriter().WriteTIFF( rGraphic, rStream, pCallback, pCallerData, pConfigItem ); + return TIFFWriter().WriteTIFF( rGraphic, rStream, pFilterConfigItem ); } #ifndef GCC -- cgit