Linux x86 build fix
[LibreOffice.git] / svtools / source / filter / exportdialog.cxx
blob62eb286601eeaddcff5b77f3926e24c66ffb4263
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <tools/stream.hxx>
22 #include <tools/fract.hxx>
23 #include <vcl/graphicfilter.hxx>
24 #include <vcl/FilterConfigItem.hxx>
25 #include <svtools/svtools.hrc>
26 #include <svtools/svtresid.hxx>
27 #include <com/sun/star/awt/Size.hpp>
28 #include <com/sun/star/drawing/GraphicExportFilter.hpp>
29 #include <com/sun/star/drawing/XDrawView.hpp>
30 #include <com/sun/star/frame/XModel.hpp>
31 #include <com/sun/star/frame/XController.hpp>
32 #include <com/sun/star/graphic/PrimitiveFactory2D.hpp>
33 #include <com/sun/star/geometry/AffineMatrix2D.hpp>
34 #include <com/sun/star/io/XStream.hpp>
35 #include <com/sun/star/view/XSelectionSupplier.hpp>
36 #include <unotools/streamwrap.hxx>
37 #include <vcl/msgbox.hxx>
38 #include <vcl/svapp.hxx>
39 #include <vcl/outdev.hxx>
40 #include <vcl/graph.hxx>
41 #include <rtl/ustrbuf.hxx>
42 #include <basegfx/matrix/b2dhommatrix.hxx>
43 #include <comphelper/processfactory.hxx>
44 #include "exportdialog.hxx"
46 #define FORMAT_UNKNOWN 0
47 #define FORMAT_JPG 1
48 #define FORMAT_PNG 2
49 #define FORMAT_BMP 3
50 #define FORMAT_GIF 4
51 #define FORMAT_PBM 5
52 #define FORMAT_PGM 6
53 #define FORMAT_PPM 7
54 #define FORMAT_PCT 8
55 #define FORMAT_RAS 9
56 #define FORMAT_TIF 10
57 #define FORMAT_XPM 11
58 #define FORMAT_WMF 12
59 #define FORMAT_EMF 13
60 #define FORMAT_EPS 14
61 #define FORMAT_MET 15
62 #define FORMAT_SVG 16
63 #define FORMAT_SVM 17
65 #define UNIT_DEFAULT -1
66 #define UNIT_INCH 0
67 #define UNIT_CM 1
68 #define UNIT_MM 2
69 #define UNIT_POINT 3
70 #define UNIT_PIXEL 4
71 #define UNIT_MAX_ID UNIT_PIXEL
73 using namespace ::com::sun::star;
75 static sal_Int16 GetFilterFormat(const OUString& rExt)
77 sal_Int16 nFormat = FORMAT_UNKNOWN;
78 if ( rExt == "JPG" )
79 nFormat = FORMAT_JPG;
80 else if ( rExt == "PNG" )
81 nFormat = FORMAT_PNG;
82 else if ( rExt == "BMP" )
83 nFormat = FORMAT_BMP;
84 else if ( rExt == "GIF" )
85 nFormat = FORMAT_GIF;
86 else if ( rExt == "PBM" )
87 nFormat = FORMAT_PBM;
88 else if ( rExt == "PGM" )
89 nFormat = FORMAT_PGM;
90 else if ( rExt == "PPM" )
91 nFormat = FORMAT_PPM;
92 else if ( rExt == "PCT" )
93 nFormat = FORMAT_PCT;
94 else if ( rExt == "RAS" )
95 nFormat = FORMAT_RAS;
96 else if ( rExt == "TIF" )
97 nFormat = FORMAT_TIF;
98 else if ( rExt == "XPM" )
99 nFormat = FORMAT_XPM;
100 else if ( rExt == "WMF" )
101 nFormat = FORMAT_WMF;
102 else if ( rExt == "EMF" )
103 nFormat = FORMAT_EMF;
104 else if ( rExt == "EPS" )
105 nFormat = FORMAT_EPS;
106 else if ( rExt == "MET" )
107 nFormat = FORMAT_MET;
108 else if ( rExt == "SVG" )
109 nFormat = FORMAT_SVG;
110 else if ( rExt == "SVM" )
111 nFormat = FORMAT_SVM;
112 return nFormat;
115 static MapUnit GetMapUnit( sal_Int32 nUnit )
117 MapUnit aMapUnit( MAP_PIXEL );
118 switch( nUnit )
120 case UNIT_INCH : aMapUnit = MAP_INCH; break;
121 case UNIT_CM : aMapUnit = MAP_CM; break;
122 case UNIT_MM : aMapUnit = MAP_MM; break;
123 case UNIT_POINT : aMapUnit = MAP_POINT; break;
124 case UNIT_PIXEL : aMapUnit = MAP_PIXEL; break;
126 return aMapUnit;
129 sal_Int32 ExportDialog::GetDefaultUnit()
131 sal_Int32 nDefaultUnit = UNIT_CM;
132 switch( mrFltCallPara.eFieldUnit )
134 // case FUNIT_NONE :
135 // case FUNIT_PERCENT :
136 // case FUNIT_CUSTOM :
137 default: nDefaultUnit = UNIT_CM; break;
139 case FUNIT_MILE : // PASSTHROUGH INTENDED
140 case FUNIT_FOOT :
141 case FUNIT_TWIP :
142 case FUNIT_PICA : nDefaultUnit = UNIT_INCH; break;
144 case FUNIT_KM : // PASSTHROUGH INTENDED
145 case FUNIT_M :
146 case FUNIT_100TH_MM : nDefaultUnit = UNIT_CM; break;
148 case FUNIT_INCH : nDefaultUnit = UNIT_INCH; break;
149 case FUNIT_CM : nDefaultUnit = UNIT_CM; break;
150 case FUNIT_MM : nDefaultUnit = UNIT_MM; break;
151 case FUNIT_POINT : nDefaultUnit = UNIT_POINT; break;
153 return nDefaultUnit;
156 static basegfx::B2DRange GetShapeRangeForXShape( const uno::Reference< drawing::XShape >& rxShape,
157 const uno::Reference< graphic::XPrimitiveFactory2D >& rxPrimitiveFactory2D, const uno::Sequence< beans::PropertyValue >& rViewInformation )
159 basegfx::B2DRange aShapeRange;
161 const uno::Sequence< beans::PropertyValue > aParams;
162 const uno::Sequence< uno::Reference< graphic::XPrimitive2D > > aPrimitiveSequence( rxPrimitiveFactory2D->createPrimitivesFromXShape( rxShape, aParams ) );
164 const sal_Int32 nCount = aPrimitiveSequence.getLength();
165 for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
167 const geometry::RealRectangle2D aRect( aPrimitiveSequence[ nIndex ]->getRange( rViewInformation ) );
168 aShapeRange.expand( basegfx::B2DTuple( aRect.X1, aRect.Y1 ) );
169 aShapeRange.expand( basegfx::B2DTuple( aRect.X2, aRect.Y2 ) );
171 return aShapeRange;
174 uno::Sequence< beans::PropertyValue > ExportDialog::GetFilterData( bool bUpdateConfig )
176 if ( bUpdateConfig )
178 sal_Int32 nUnit = mpLbSizeX->GetSelectEntryPos();
179 if ( nUnit < 0 )
180 nUnit = UNIT_CM;
182 if ( ( mnInitialResolutionUnit == UNIT_DEFAULT ) && ( nUnit == GetDefaultUnit() ) )
183 nUnit = UNIT_DEFAULT;
185 // updating ui configuration
186 if ( mbIsPixelFormat )
188 if ( nUnit > UNIT_MAX_ID )
189 nUnit = UNIT_PIXEL;
191 sal_Int32 nResolution = mpNfResolution->GetValue();
192 if ( nResolution < 1 )
193 nResolution = 96;
195 mpOptionsItem->WriteInt32(OUString("PixelExportUnit"), nUnit);
196 mpOptionsItem->WriteInt32(OUString("PixelExportResolution"), nResolution);
197 mpOptionsItem->WriteInt32(OUString("PixelExportResolutionUnit"), mpLbResolution->GetSelectEntryPos());
199 else
201 if ( nUnit >= UNIT_PIXEL )
202 nUnit = UNIT_CM;
204 mpOptionsItem->WriteInt32(OUString("VectorExportUnit"), nUnit);
208 FilterConfigItem* pFilterOptions;
209 if ( bUpdateConfig )
210 pFilterOptions = mpFilterOptionsItem;
211 else
213 uno::Sequence< beans::PropertyValue > aFilterData( mpFilterOptionsItem->GetFilterData() );
214 pFilterOptions = new FilterConfigItem( &aFilterData );
217 const OUString sLogicalWidth("LogicalWidth");
218 const OUString sLogicalHeight("LogicalHeight");
219 if ( mbIsPixelFormat )
221 pFilterOptions->WriteInt32(OUString("PixelWidth"), static_cast< sal_Int32 >( maSize.Width ) );
222 pFilterOptions->WriteInt32(OUString("PixelHeight"), static_cast< sal_Int32 >( maSize.Height ) );
223 if ( maResolution.Width && maResolution.Height )
225 const double f100thmmPerPixelX = 100000.0 / maResolution.Width;
226 const double f100thmmPerPixelY = 100000.0 / maResolution.Height;
227 sal_Int32 nLogicalWidth = static_cast< sal_Int32 >( f100thmmPerPixelX * maSize.Width );
228 sal_Int32 nLogicalHeight= static_cast< sal_Int32 >( f100thmmPerPixelY * maSize.Height );
229 if ( nLogicalWidth && nLogicalHeight )
231 pFilterOptions->WriteInt32( sLogicalWidth, nLogicalWidth );
232 pFilterOptions->WriteInt32( sLogicalHeight, nLogicalHeight );
236 else
238 pFilterOptions->WriteInt32( sLogicalWidth, static_cast< sal_Int32 >( maSize.Width ) );
239 pFilterOptions->WriteInt32( sLogicalHeight, static_cast< sal_Int32 >( maSize.Height ) );
241 switch ( mnFormat )
243 case FORMAT_JPG :
245 sal_Int32 nColor = mpLbColorDepth->GetSelectEntryPos();
246 if ( nColor == 1 )
247 nColor = 0;
248 else
249 nColor = 1;
250 pFilterOptions->WriteInt32(OUString("ColorMode"), nColor);
251 pFilterOptions->WriteInt32(OUString("Quality"), static_cast<sal_Int32>(mpSbCompression->GetThumbPos()));
253 break;
255 case FORMAT_PNG :
257 pFilterOptions->WriteInt32(OUString("Compression"), static_cast<sal_Int32>(mpSbCompression->GetThumbPos()));
258 sal_Int32 nInterlace = 0;
259 if ( mpCbInterlaced->IsChecked() )
260 nInterlace++;
261 pFilterOptions->WriteInt32(OUString("Interlaced"), nInterlace);
262 sal_Int32 nValue = 0;
263 if ( mpCbSaveTransparency->IsChecked() )
264 nValue++;
265 pFilterOptions->WriteInt32(OUString("Translucent"), nValue);
267 break;
269 case FORMAT_BMP :
271 pFilterOptions->WriteInt32(OUString("Color"), mpLbColorDepth->GetSelectEntryPos() + 1);
272 pFilterOptions->WriteBool(OUString("RLE_Coding"), mpCbRLEEncoding->IsChecked());
274 break;
276 case FORMAT_GIF :
278 sal_Int32 nValue = 0;
279 if ( mpCbInterlaced->IsChecked() )
280 nValue++;
281 pFilterOptions->WriteInt32(OUString("Interlaced"), nValue);
283 nValue = 0;
284 if (mpCbSaveTransparency->IsChecked())
285 nValue++;
286 pFilterOptions->WriteInt32(OUString("Translucent"), nValue);
288 break;
290 case FORMAT_PBM :
291 case FORMAT_PGM :
292 case FORMAT_PPM :
294 sal_Int32 nFormat = 0;
295 if ( mpRbText->IsChecked() )
296 nFormat++;
297 pFilterOptions->WriteInt32(OUString("FileFormat"), nFormat);
299 break;
301 case FORMAT_EPS :
303 sal_Int32 nCheck = 0;
304 if ( mpCbEPSPreviewTIFF->IsChecked() )
305 nCheck++;
306 if ( mpCbEPSPreviewEPSI->IsChecked() )
307 nCheck += 2;
308 pFilterOptions->WriteInt32(OUString("Preview"), nCheck);
310 nCheck = 1;
311 if ( mpRbEPSLevel2->IsChecked() )
312 nCheck++;
313 pFilterOptions->WriteInt32(OUString("Version"), nCheck);
315 nCheck = 1;
316 if ( mpRbEPSColorFormat2->IsChecked() )
317 nCheck++;
318 pFilterOptions->WriteInt32(OUString("ColorFormat"), nCheck);
320 nCheck = 1;
321 if ( mpRbEPSCompressionNone->IsChecked() )
322 nCheck++;
323 pFilterOptions->WriteInt32(OUString("CompressionMode"), nCheck);
325 break;
328 uno::Sequence< beans::PropertyValue > aRet( pFilterOptions->GetFilterData() );
329 if ( !bUpdateConfig )
330 delete pFilterOptions;
331 return aRet;
335 awt::Size ExportDialog::GetOriginalSize()
337 basegfx::B2DRange aShapesRange;
339 if ( mxPage.is () )
341 uno::Reference< beans::XPropertySet > xPagePropSet( mxPage, uno::UNO_QUERY );
342 if ( xPagePropSet.is() )
344 sal_Int32 nWidth = 0;
345 sal_Int32 nHeight= 0;
346 com::sun::star::uno::Any aAny;
347 aAny = xPagePropSet->getPropertyValue("Width");
348 aAny >>= nWidth;
349 aAny = xPagePropSet->getPropertyValue("Height");
350 aAny >>= nHeight;
351 aShapesRange = basegfx::B2DRange( 0, 0, nWidth, nHeight );
354 else
356 uno::Reference< graphic::XPrimitiveFactory2D > xPrimitiveFactory = graphic::PrimitiveFactory2D::create( mxContext );
358 basegfx::B2DHomMatrix aViewTransformation( Application::GetDefaultDevice()->GetViewTransformation() );
359 com::sun::star::geometry::AffineMatrix2D aTransformation;
360 aTransformation.m00 = aViewTransformation.get(0,0);
361 aTransformation.m01 = aViewTransformation.get(0,1);
362 aTransformation.m02 = aViewTransformation.get(0,2);
363 aTransformation.m10 = aViewTransformation.get(1,0);
364 aTransformation.m11 = aViewTransformation.get(1,1);
365 aTransformation.m12 = aViewTransformation.get(1,2);
367 const OUString sViewTransformation( "ViewTransformation" );
368 uno::Sequence< beans::PropertyValue > aViewInformation( 1 );
369 aViewInformation[ 0 ].Value <<= aTransformation;
370 aViewInformation[ 0 ].Name = sViewTransformation;
372 if ( mxShape.is() )
373 aShapesRange = GetShapeRangeForXShape( mxShape, xPrimitiveFactory, aViewInformation );
374 else if ( mxShapes.is() )
376 const sal_Int32 nCount = mxShapes->getCount();
377 for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
379 uno::Reference< drawing::XShape > xShape;
380 mxShapes->getByIndex( nIndex ) >>= xShape;
381 aShapesRange.expand( GetShapeRangeForXShape( xShape, xPrimitiveFactory, aViewInformation ) );
385 return awt::Size( static_cast<sal_Int32>(aShapesRange.getWidth()), static_cast<sal_Int32>(aShapesRange.getHeight()) );
388 void ExportDialog::GetGraphicSource()
390 if ( mxSourceDocument.is() )
392 uno::Reference< frame::XModel > xModel( mxSourceDocument, uno::UNO_QUERY );
393 if ( xModel.is() )
395 uno::Reference< frame::XController > xController( xModel->getCurrentController() );
396 if ( xController.is() )
398 if ( mbExportSelection ) // check if there is a selection
400 uno::Reference< view::XSelectionSupplier > xSelectionSupplier( xController, uno::UNO_QUERY );
401 if ( xSelectionSupplier.is() )
403 uno::Any aAny( xSelectionSupplier->getSelection() );
404 if ( ! ( aAny >>= mxShapes ) )
405 aAny >>= mxShape;
408 if ( !mxShape.is() && !mxShapes.is() )
410 uno::Reference< drawing::XDrawView > xDrawView( xController, uno::UNO_QUERY );
411 if ( xDrawView.is() )
413 uno::Reference< drawing::XDrawPage > xCurrentPage( xDrawView->getCurrentPage() );
414 if ( xCurrentPage.is() )
416 mxPage = xCurrentPage; // exporting whole page
425 bool ExportDialog::GetGraphicStream()
427 bool bRet = false;
429 if ( !IsTempExportAvailable() )
431 delete mpTempStream, mpTempStream = new SvMemoryStream();
432 maBitmap = Bitmap();
433 return bRet;
436 bool bRecreateOutputStream = mpTempStream->Tell() == 0;
438 static uno::Sequence< beans::PropertyValue > aOldFilterData;
439 uno::Sequence< beans::PropertyValue > aNewFilterData( GetFilterData( false ) );
440 if ( aOldFilterData != aNewFilterData )
442 aOldFilterData = aNewFilterData;
443 bRecreateOutputStream = true;
447 if ( bRecreateOutputStream )
449 delete mpTempStream, mpTempStream = new SvMemoryStream();
450 maBitmap = Bitmap();
452 uno::Reference < io::XStream > xStream( new utl::OStreamWrapper( *mpTempStream ) );
453 uno::Reference < io::XOutputStream > xOutputStream( xStream->getOutputStream() );
455 uno::Reference< drawing::XGraphicExportFilter > xGraphicExporter =
456 drawing::GraphicExportFilter::create( mxContext );
458 OUString sFormat( maExt );
459 uno::Sequence< beans::PropertyValue > aDescriptor( 3 );
460 aDescriptor[0].Name = "OutputStream";
461 aDescriptor[0].Value <<= xOutputStream;
462 aDescriptor[1].Name = "FilterName";
463 aDescriptor[1].Value <<= sFormat;
464 aDescriptor[2].Name = "FilterData";
465 aDescriptor[2].Value <<= aNewFilterData;
467 uno::Reference< lang::XComponent > xSourceDoc;
468 if ( mxPage.is() )
469 xSourceDoc = uno::Reference< lang::XComponent >( mxPage, uno::UNO_QUERY_THROW );
470 else if ( mxShapes.is() )
471 xSourceDoc = uno::Reference< lang::XComponent >( mxShapes, uno::UNO_QUERY_THROW );
472 else if ( mxShape.is() )
473 xSourceDoc = uno::Reference< lang::XComponent >( mxShape, uno::UNO_QUERY_THROW );
474 if ( xSourceDoc.is() )
476 xGraphicExporter->setSourceDocument( xSourceDoc );
477 xGraphicExporter->filter( aDescriptor );
478 bRet = true;
480 if ( mnFormat == FORMAT_JPG )
482 mpTempStream->Seek( STREAM_SEEK_TO_BEGIN );
483 maBitmap = GetGraphicBitmap( *mpTempStream );
484 mpTempStream->Seek( STREAM_SEEK_TO_END );
488 else
489 bRet = true;
491 catch( uno::Exception& )
494 // ups
497 return bRet;
500 Bitmap ExportDialog::GetGraphicBitmap( SvStream& rInputStream )
502 Bitmap aRet;
503 Graphic aGraphic;
504 GraphicFilter aFilter( false );
505 if ( aFilter.ImportGraphic( aGraphic, "", rInputStream, GRFILTER_FORMAT_NOTFOUND, NULL, GraphicFilterImportFlags::NONE, static_cast<com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >*>(NULL), NULL ) == GRFILTER_OK )
507 aRet = aGraphic.GetBitmap();
509 return aRet;
512 sal_uInt32 ExportDialog::GetRawFileSize() const
514 sal_uInt64 nRawFileSize = 0;
515 if ( mbIsPixelFormat )
517 sal_Int32 nBitsPerPixel = 24;
518 OUString aEntry( mpLbColorDepth->GetSelectEntry() );
519 if ( ms1BitTreshold == aEntry )
520 nBitsPerPixel = 1;
521 else if ( ms1BitDithered == aEntry )
522 nBitsPerPixel = 1;
523 else if ( ms4BitGrayscale == aEntry )
524 nBitsPerPixel = 4;
525 else if ( ms4BitColorPalette == aEntry )
526 nBitsPerPixel = 8;
527 else if ( ms8BitGrayscale == aEntry )
528 nBitsPerPixel = 8;
529 else if ( ms8BitColorPalette == aEntry )
530 nBitsPerPixel = 8;
531 else if ( ms24BitColor == aEntry )
532 nBitsPerPixel = 24;
534 if ( mbIsPixelFormat )
536 nRawFileSize = ( maSize.Width * nBitsPerPixel + 7 ) &~ 7; // rounding up to 8 bits
537 nRawFileSize /= 8; // in bytes
538 nRawFileSize *= maSize.Height;
540 if ( nRawFileSize > SAL_MAX_UINT32 )
541 nRawFileSize = 0;
543 return static_cast< sal_uInt32 >( nRawFileSize );
546 // checks if the source dimension/resolution is not too big
547 // to determine the exact graphic output size and preview for jpg
548 bool ExportDialog::IsTempExportAvailable() const
550 return GetRawFileSize() < static_cast< sal_uInt32 >( mnMaxFilesizeForRealtimePreview );
553 ExportDialog::ExportDialog(FltCallDialogParameter& rPara,
554 const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
555 const com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rxSourceDocument,
556 bool bExportSelection, bool bIsPixelFormat)
557 : ModalDialog(rPara.pWindow, "GraphicExportDialog", "svt/ui/graphicexport.ui")
558 , mrFltCallPara(rPara)
559 , mxContext(rxContext)
560 , mxSourceDocument(rxSourceDocument)
561 , mpSbCompression(NULL)
562 , mpNfCompression(NULL)
563 , msEstimatedSizePix1(SVT_RESSTR(STR_SVT_ESTIMATED_SIZE_PIX_1))
564 , msEstimatedSizePix2(SVT_RESSTR(STR_SVT_ESTIMATED_SIZE_PIX_2))
565 , msEstimatedSizeVec(SVT_RESSTR(STR_SVT_ESTIMATED_SIZE_VEC))
566 , ms1BitTreshold(SVT_RESSTR(STR_SVT_1BIT_THRESHOLD))
567 , ms1BitDithered(SVT_RESSTR(STR_SVT_1BIT_DITHERED))
568 , ms4BitGrayscale(SVT_RESSTR(STR_SVT_4BIT_GRAYSCALE))
569 , ms4BitColorPalette(SVT_RESSTR(STR_SVT_4BIT_COLOR_PALETTE))
570 , ms8BitGrayscale(SVT_RESSTR(STR_SVT_8BIT_GRAYSCALE))
571 , ms8BitColorPalette(SVT_RESSTR(STR_SVT_8BIT_COLOR_PALETTE))
572 , ms24BitColor(SVT_RESSTR(STR_SVT_24BIT_TRUE_COLOR))
573 , maExt(rPara.aFilterExt)
574 , mnFormat(FORMAT_UNKNOWN)
575 , mnMaxFilesizeForRealtimePreview(0)
576 , mpTempStream(new SvMemoryStream())
577 , maOriginalSize(awt::Size(0, 0))
578 , mbIsPixelFormat(bIsPixelFormat)
579 , mbExportSelection(bExportSelection)
580 , mbPreserveAspectRatio(true)
582 get(mpMfSizeX, "widthmf-nospin");
583 get(mpMfSizeY, "heightmf-nospin");
584 get(mpLbSizeX, "widthlb");
585 get(mpFtResolution, "resolutionft");
586 get(mpNfResolution, "resolutionmf-nospin");
587 get(mpLbResolution, "resolutionlb");
589 get(mpColorDepth, "colordepth");
590 get(mpLbColorDepth, "colordepthlb");
592 get(mpJPGQuality, "jpgquality");
593 get(mpPNGCompression, "pngcompression");
595 get(mpBMPCompression, "bmpcompression");
596 get(mpCbRLEEncoding, "rlecb");
598 get(mpMode, "mode");
599 get(mpCbInterlaced, "interlacedcb");
601 get(mpDrawingObjects, "drawingobjects");
602 get(mpCbSaveTransparency, "savetransparencycb");
604 get(mpEncoding, "encoding");
605 get(mpRbBinary, "binarycb");
606 get(mpRbText, "textcb");
608 get(mpEPSGrid, "epsgrid");
609 get(mpCbEPSPreviewTIFF, "tiffpreviewcb");
610 get(mpCbEPSPreviewEPSI, "epsipreviewcb");
611 get(mpRbEPSLevel1, "level1rb");
612 get(mpRbEPSLevel2, "level2rb");
613 get(mpRbEPSColorFormat1, "color1rb");
614 get(mpRbEPSColorFormat2, "color2rb");
615 get(mpRbEPSCompressionLZW, "compresslzw");
616 get(mpRbEPSCompressionNone, "compressnone");
618 GetGraphicSource();
620 get(mpInfo, "information");
621 get(mpFtEstimatedSize, "estsizeft");;
623 get(mpBtnOK, "ok");
625 maExt = maExt.toAsciiUpperCase();
627 OUString aFilterConfigPath( "Office.Common/Filter/Graphic/Export/" );
628 mpOptionsItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
629 aFilterConfigPath += maExt;
630 mpFilterOptionsItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
632 mnInitialResolutionUnit = mbIsPixelFormat
633 ? mpOptionsItem->ReadInt32(OUString("PixelExportUnit"), UNIT_DEFAULT)
634 : mpOptionsItem->ReadInt32(OUString( "VectorExportUnit"), UNIT_DEFAULT);
636 mnMaxFilesizeForRealtimePreview = mpOptionsItem->ReadInt32(OUString("MaxFilesizeForRealtimePreview"), 0);
637 mpFtEstimatedSize->SetText(OUString(" \n "));
639 SetText( GetText().replaceFirst("%1", maExt) ); //Set dialog title
641 mnFormat = GetFilterFormat( maExt );
643 Size aResolution( Application::GetDefaultDevice()->LogicToPixel( Size( 100, 100 ), MAP_CM ) );
644 maResolution.Width = aResolution.Width();
645 maResolution.Height= aResolution.Height();
646 maOriginalSize = GetOriginalSize();
647 if ( bIsPixelFormat )
649 double fPixelsPer100thmm = static_cast< double >( maResolution.Width ) / 100000.0;
650 maSize = awt::Size( static_cast< sal_Int32 >( ( fPixelsPer100thmm * maOriginalSize.Width ) + 0.5 ),
651 static_cast< sal_Int32 >( ( fPixelsPer100thmm * maOriginalSize.Height ) + 0.5 ) );
653 else
655 maSize = maOriginalSize;
658 setupControls();
660 // Size
661 mpLbSizeX->SetSelectHdl( LINK( this, ExportDialog, UpdateHdl ) );
663 if (mpSbCompression)
664 mpSbCompression->SetScrollHdl(LINK(this, ExportDialog, SbCompressionUpdateHdl));
665 if (mpNfCompression)
666 mpNfCompression->SetModifyHdl(LINK(this, ExportDialog, UpdateHdl));
668 mpMfSizeX->SetModifyHdl( LINK( this, ExportDialog, UpdateHdlMtfSizeX ) );
669 mpMfSizeY->SetModifyHdl( LINK( this, ExportDialog, UpdateHdlMtfSizeY ) );
671 mpNfResolution->SetModifyHdl( LINK( this, ExportDialog, UpdateHdlNfResolution ) );
672 mpLbResolution->SetSelectHdl( LINK( this, ExportDialog, UpdateHdl ) );
674 mpLbColorDepth->SetSelectHdl( LINK( this, ExportDialog, UpdateHdl ) );
676 mpCbInterlaced->SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
678 mpCbSaveTransparency->SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
680 mpCbEPSPreviewTIFF->SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
681 mpCbEPSPreviewEPSI->SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
683 mpRbEPSCompressionLZW->SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
684 mpRbEPSCompressionNone->SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
686 mpRbBinary->SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
687 mpRbText->SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
689 // BMP
690 mpCbRLEEncoding->SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
692 // EPS
693 mpRbEPSLevel1->SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
694 mpRbEPSLevel2->SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) );
696 mpBtnOK->SetClickHdl( LINK( this, ExportDialog, OK ) );
698 updateControls();
701 void ExportDialog::setupSizeControls()
703 sal_Int32 nUnit = mnInitialResolutionUnit;
704 if (nUnit == UNIT_DEFAULT)
705 nUnit = GetDefaultUnit();
707 if (!mbIsPixelFormat)
709 mpFtResolution->Hide();
710 mpNfResolution->Hide();
711 mpLbResolution->Hide();
712 mpLbSizeX->RemoveEntry( UNIT_PIXEL ); // removing pixel
713 if ( nUnit >= UNIT_PIXEL )
714 nUnit = UNIT_CM;
716 else if ( nUnit > UNIT_MAX_ID )
717 nUnit = UNIT_PIXEL;
718 if ( nUnit < 0 )
719 nUnit = UNIT_CM;
720 mpLbSizeX->SelectEntryPos( static_cast< sal_uInt16 >( nUnit ) );
722 if ( mbIsPixelFormat ) // TODO: (metafileresolutionsupport) should be supported for vector formats also... this makes
723 { // sense eg for bitmap fillings in metafiles, to preserve high dpi output
724 // (atm without special vector support the bitmaps are rendered with 96dpi)
725 sal_Int32 nResolution = mpOptionsItem->ReadInt32(OUString("PixelExportResolution"), 96);
726 if ( nResolution < 1 )
727 nResolution = 96;
728 mpNfResolution->SetValue( nResolution );
730 sal_Int32 nResolutionUnit = mpOptionsItem->ReadInt32(OUString("PixelExportResolutionUnit"), 1);
731 if ( ( nResolutionUnit < 0 ) || ( nResolutionUnit > 2 ) )
732 nResolutionUnit = 1;
733 mpLbResolution->SelectEntryPos( static_cast< sal_uInt16 >( nResolutionUnit ) );
737 void ExportDialog::createFilterOptions()
739 switch( mnFormat )
741 case FORMAT_JPG :
743 sal_Int32 nColor = mpFilterOptionsItem->ReadInt32(OUString("ColorMode"), 0);
744 if ( nColor == 1 )
745 nColor = 0;
746 else
747 nColor = 1;
748 mpLbColorDepth->InsertEntry( ms8BitGrayscale );
749 mpLbColorDepth->InsertEntry( ms24BitColor );
750 mpLbColorDepth->SelectEntryPos( nColor );
751 mpColorDepth->Show();
753 // Quality
754 mpJPGQuality->Show();
755 sal_Int32 nQuality = mpFilterOptionsItem->ReadInt32(OUString("Quality"), 75);
756 if ((nQuality < 1 ) || (nQuality > 100))
757 nQuality = 75;
758 get(mpSbCompression, "compressionjpgsb");
759 get(mpNfCompression, "compressionjpgnf-nospin");
760 mpSbCompression->SetRangeMin( 1 );
761 mpSbCompression->SetRangeMax( 100 );
762 mpNfCompression->SetMin( 1 );
763 mpNfCompression->SetMax( 100 );
764 mpNfCompression->SetValue( nQuality );
765 mpNfCompression->SetStrictFormat( true );
767 break;
768 case FORMAT_PNG :
770 // Compression 1..9
771 mpPNGCompression->Show();
772 sal_Int32 nCompression = mpFilterOptionsItem->ReadInt32(OUString("Compression"), 6);
773 if ( ( nCompression < 1 ) || ( nCompression > 9 ) )
774 nCompression = 6;
776 get(mpSbCompression, "compressionpngsb");
777 get(mpNfCompression, "compressionpngnf-nospin");
778 mpSbCompression->SetRangeMin( 1 );
779 mpSbCompression->SetRangeMax( 9 );
780 mpNfCompression->SetMin( 1 );
781 mpNfCompression->SetMax( 9 );
782 mpNfCompression->SetValue( 9 );
783 mpNfCompression->SetStrictFormat( true );
785 // Interlaced
786 mpMode->Show();
787 mpCbInterlaced->Check(mpFilterOptionsItem->ReadInt32(OUString("Interlaced"), 0) != 0);
789 // Transparency
790 mpDrawingObjects->Show();
791 mpCbSaveTransparency->Check(mpFilterOptionsItem->ReadInt32(OUString("Translucent"), 1) != 0);
793 break;
794 case FORMAT_BMP :
796 sal_Int32 nColor = mpFilterOptionsItem->ReadInt32(OUString("Color"), 0);
797 if ( nColor == 0 )
798 nColor = 6;
799 else
800 nColor--;
801 mpLbColorDepth->InsertEntry( ms1BitTreshold );
802 mpLbColorDepth->InsertEntry( ms1BitDithered );
803 mpLbColorDepth->InsertEntry( ms4BitGrayscale );
804 mpLbColorDepth->InsertEntry( ms4BitColorPalette );
805 mpLbColorDepth->InsertEntry( ms8BitGrayscale );
806 mpLbColorDepth->InsertEntry( ms8BitColorPalette );
807 mpLbColorDepth->InsertEntry( ms24BitColor );
808 mpLbColorDepth->SelectEntryPos( nColor );
809 mpColorDepth->Show();
811 // RLE coding
812 mpBMPCompression->Show();
813 mpCbRLEEncoding->Check(mpFilterOptionsItem->ReadBool(OUString("RLE_Coding"), true));
815 break;
816 case FORMAT_GIF :
818 // Interlaced
819 mpMode->Show();
820 mpCbInterlaced->Check(mpFilterOptionsItem->ReadInt32(OUString("Interlaced"), 1) != 0);
822 // Transparency
823 mpDrawingObjects->Show();
824 mpCbSaveTransparency->Check(mpFilterOptionsItem->ReadInt32(OUString("Translucent"), 1) != 0);
826 break;
827 case FORMAT_PBM :
828 case FORMAT_PGM :
829 case FORMAT_PPM :
831 // RB Binary / Text
832 mpEncoding->Show();
833 sal_Int32 nFormat = mpFilterOptionsItem->ReadInt32(OUString("FileFormat"), 1);
834 mpRbBinary->Check( nFormat == 0 );
835 mpRbText->Check( nFormat != 0 );
837 break;
838 case FORMAT_EPS :
840 mpEPSGrid->Show();
842 sal_Int32 nPreview = mpFilterOptionsItem->ReadInt32(OUString("Preview"), 0);
843 sal_Int32 nVersion = mpFilterOptionsItem->ReadInt32(OUString("Version"), 2);
844 sal_Int32 nColor = mpFilterOptionsItem->ReadInt32(OUString("ColorFormat"), 0);
845 sal_Int32 nCompr = mpFilterOptionsItem->ReadInt32(OUString("CompressionMode"), 2);
847 mpFilterOptionsItem->ReadInt32(OUString("TextMode"), 0);
849 mpCbEPSPreviewTIFF->Check( ( nPreview & 1 ) != 0 );
850 mpCbEPSPreviewEPSI->Check( ( nPreview & 2 ) != 0 );
852 mpRbEPSLevel1->Check( nVersion == 1 );
853 mpRbEPSLevel2->Check( nVersion == 2 );
855 mpRbEPSColorFormat1->Check( nColor == 1 );
856 mpRbEPSColorFormat2->Check( nColor != 1 );
858 mpRbEPSCompressionLZW->Check( nCompr == 1 );
859 mpRbEPSCompressionNone->Check( nCompr != 1 );
861 break;
865 void ExportDialog::setupControls()
867 setupSizeControls();
868 createFilterOptions();
870 if (mnMaxFilesizeForRealtimePreview || mbIsPixelFormat)
871 mpInfo->Show();
874 static OUString ImpValueOfInKB( const sal_Int64& rVal )
876 double fVal( static_cast<double>( rVal ) );
877 fVal /= ( 1 << 10 );
878 fVal += 0.05;
879 OUStringBuffer aVal( OUString::number( fVal ) );
880 sal_Int32 nX( OUString( aVal.getStr() ).indexOf( '.', 0 ) );
881 if ( nX > 0 )
882 aVal.setLength( nX + 2 );
883 return aVal.makeStringAndClear();
886 void ExportDialog::updateControls()
888 GetGraphicStream();
890 // Size Controls
891 if ( !mbIsPixelFormat )
893 awt::Size aSize100thmm( maSize );
894 Size aSize( LogicToLogic( Size( aSize100thmm.Width * 100, aSize100thmm.Height * 100 ), MAP_100TH_MM,
895 MapMode( GetMapUnit( mpLbSizeX->GetSelectEntryPos() ) ) ) );
896 mpMfSizeX->SetValue( aSize.Width() );
897 mpMfSizeY->SetValue( aSize.Height() );
899 else
901 MapUnit aMapUnit( GetMapUnit( mpLbSizeX->GetSelectEntryPos() ) );
902 if ( aMapUnit == MAP_PIXEL )
903 { // calculating pixel count via resolution and original graphic size
904 mpMfSizeX->SetDecimalDigits( 0 );
905 mpMfSizeY->SetDecimalDigits( 0 );
906 mpMfSizeX->SetValue( maSize.Width );
907 mpMfSizeY->SetValue( maSize.Height );
909 else
911 mpMfSizeX->SetDecimalDigits( 2 );
912 mpMfSizeY->SetDecimalDigits( 2 );
913 double fRatio;
914 switch( GetMapUnit( mpLbSizeX->GetSelectEntryPos() ) )
916 case MAP_INCH : fRatio = static_cast< double >( maResolution.Width ) * 0.0254; break;
917 case MAP_MM : fRatio = static_cast< double >( maResolution.Width ) * 0.001; break;
918 case MAP_POINT :fRatio = ( static_cast< double >( maResolution.Width ) * 0.0254 ) / 72.0; break;
919 default:
920 case MAP_CM : fRatio = static_cast< double >( maResolution.Width ) * 0.01; break;
922 mpMfSizeX->SetValue( static_cast< sal_Int32 >( ( static_cast< double >( maSize.Width * 100 ) / fRatio ) + 0.5 ) );
923 mpMfSizeY->SetValue( static_cast< sal_Int32 >( ( static_cast< double >( maSize.Height * 100 ) / fRatio ) + 0.5 ) );
926 sal_Int32 nResolution = 0;
927 switch( mpLbResolution->GetSelectEntryPos() )
929 case 0 : nResolution = maResolution.Width / 100; break; // pixels / cm
930 case 2 : nResolution = maResolution.Width; break; // pixels / meter
931 default:
932 case 1 : nResolution = static_cast< sal_Int32 >(maResolution.Width * 0.0254); break; // pixels / inch
934 mpNfResolution->SetValue( nResolution );
936 if (mpSbCompression && mpSbCompression->IsVisible() && mpNfCompression)
937 mpSbCompression->SetThumbPos(mpNfCompression->GetValue());
939 // updating estimated size
940 sal_Int64 nRealFileSize( mpTempStream->Tell() );
941 if ( mbIsPixelFormat )
943 OUString aEst( nRealFileSize ? msEstimatedSizePix2 : msEstimatedSizePix1 );
944 sal_Int64 nRawFileSize( GetRawFileSize() );
945 sal_Int32 nInd = aEst.indexOf( "%" );
946 if (nInd != -1)
947 aEst = aEst.replaceAt( nInd, 2, ImpValueOfInKB( nRawFileSize ) );
949 if ( nRealFileSize && nInd != -1 )
951 nInd = aEst.indexOf( "%", nInd );
952 if (nInd != -1)
953 aEst = aEst.replaceAt( nInd, 2, ImpValueOfInKB( nRealFileSize ) );
955 mpFtEstimatedSize->SetText( aEst );
957 else
959 if ( mnMaxFilesizeForRealtimePreview )
961 OUString aEst( msEstimatedSizeVec );
962 sal_Int32 nInd = aEst.indexOf( "%" );
963 if (nInd != -1)
964 aEst = aEst.replaceAt( nInd, 2, ImpValueOfInKB( nRealFileSize ) );
965 mpFtEstimatedSize->SetText( aEst );
969 // EPS
970 if ( mpRbEPSLevel1->IsVisible() )
972 bool bEnabled = !mpRbEPSLevel1->IsChecked();
973 mpRbEPSColorFormat1->Enable( bEnabled );
974 mpRbEPSColorFormat2->Enable( bEnabled );
975 mpRbEPSCompressionLZW->Enable( bEnabled );
976 mpRbEPSCompressionNone->Enable( bEnabled );
980 ExportDialog::~ExportDialog()
982 disposeOnce();
985 void ExportDialog::dispose()
987 delete mpFilterOptionsItem;
988 delete mpOptionsItem;
989 mpMfSizeX.clear();
990 mpLbSizeX.clear();
991 mpMfSizeY.clear();
992 mpFtResolution.clear();
993 mpNfResolution.clear();
994 mpLbResolution.clear();
995 mpColorDepth.clear();
996 mpLbColorDepth.clear();
997 mpJPGQuality.clear();
998 mpPNGCompression.clear();
999 mpSbCompression.clear();
1000 mpNfCompression.clear();
1001 mpMode.clear();
1002 mpCbInterlaced.clear();
1003 mpBMPCompression.clear();
1004 mpCbRLEEncoding.clear();
1005 mpDrawingObjects.clear();
1006 mpCbSaveTransparency.clear();
1007 mpEncoding.clear();
1008 mpRbBinary.clear();
1009 mpRbText.clear();
1010 mpEPSGrid.clear();
1011 mpCbEPSPreviewTIFF.clear();
1012 mpCbEPSPreviewEPSI.clear();
1013 mpRbEPSLevel1.clear();
1014 mpRbEPSLevel2.clear();
1015 mpRbEPSColorFormat1.clear();
1016 mpRbEPSColorFormat2.clear();
1017 mpRbEPSCompressionLZW.clear();
1018 mpRbEPSCompressionNone.clear();
1019 mpInfo.clear();
1020 mpFtEstimatedSize.clear();
1021 mpBtnOK.clear();
1022 ModalDialog::dispose();
1026 /*************************************************************************
1028 |* stores values set in the ini-file
1030 \************************************************************************/
1031 IMPL_LINK_NOARG(ExportDialog, UpdateHdl)
1033 updateControls();
1034 return 0;
1037 IMPL_LINK_NOARG(ExportDialog, UpdateHdlMtfSizeX)
1039 double fRatio = static_cast< double >( maOriginalSize.Height ) / maOriginalSize.Width;
1041 if ( mbIsPixelFormat )
1043 switch( GetMapUnit( mpLbSizeX->GetSelectEntryPos() ) )
1045 case MAP_INCH : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.0254 * mpMfSizeX->GetValue() / 100.0 + 0.5 ); break;
1046 case MAP_CM : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.01 * mpMfSizeX->GetValue() / 100.0 + 0.5 ); break;
1047 case MAP_MM : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.001 * mpMfSizeX->GetValue() / 100.0 + 0.5 ); break;
1048 case MAP_POINT : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.0254 * mpMfSizeX->GetValue() / 100.0 * 72 + 0.5 ); break;
1049 default:
1050 case MAP_PIXEL : maSize.Width = mpMfSizeX->GetValue(); break;
1052 maSize.Height = static_cast< sal_Int32 >( fRatio * maSize.Width + 0.5 );
1054 else
1056 Fraction aFract( 1, 100 );
1057 sal_Int32 nWidth = mpMfSizeX->GetValue();
1058 sal_Int32 nHeight= static_cast< sal_Int32 >( nWidth * fRatio );
1059 const Size aSource( static_cast< sal_Int32 >( nWidth ), static_cast< sal_Int32 >( nHeight ) );
1060 MapMode aSourceMapMode( GetMapUnit( mpLbSizeX->GetSelectEntryPos() ),Point(), aFract, aFract );
1061 Size aDest( LogicToLogic( aSource, aSourceMapMode, MAP_100TH_MM ) );
1063 maSize.Width = aDest.Width();
1064 if ( mbPreserveAspectRatio )
1065 maSize.Height = aDest.Height();
1067 updateControls();
1068 return 0;
1071 IMPL_LINK_NOARG(ExportDialog, UpdateHdlMtfSizeY)
1073 double fRatio = static_cast< double >( maOriginalSize.Width ) / maOriginalSize.Height;
1075 if ( mbIsPixelFormat )
1077 switch( GetMapUnit( mpLbSizeX->GetSelectEntryPos() ) )
1079 case MAP_INCH : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.0254 * mpMfSizeY->GetValue() / 100.0 + 0.5 ); break;
1080 case MAP_CM : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.01 * mpMfSizeY->GetValue() / 100.0 + 0.5 ); break;
1081 case MAP_MM : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.001 * mpMfSizeY->GetValue() / 100.0 + 0.5 ); break;
1082 case MAP_POINT : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.0254 * mpMfSizeY->GetValue() / 100.0 * 72 + 0.5 ); break;
1083 default:
1084 case MAP_PIXEL : maSize.Height = mpMfSizeY->GetValue(); break;
1086 maSize.Width = static_cast< sal_Int32 >( fRatio * maSize.Height + 0.5 );
1088 else
1090 Fraction aFract( 1, 100 );
1091 sal_Int32 nHeight= mpMfSizeY->GetValue();
1092 sal_Int32 nWidth = static_cast< sal_Int32 >( nHeight * fRatio );
1093 const Size aSource( static_cast< sal_Int32 >( nWidth ), static_cast< sal_Int32 >( nHeight ) );
1094 MapMode aSourceMapMode( GetMapUnit( mpLbSizeX->GetSelectEntryPos() ),Point(), aFract, aFract );
1095 Size aDest( LogicToLogic( aSource, aSourceMapMode, MAP_100TH_MM ) );
1097 maSize.Height = aDest.Height();
1098 if ( mbPreserveAspectRatio )
1099 maSize.Width = aDest.Width();
1101 updateControls();
1102 return 0;
1105 IMPL_LINK_NOARG(ExportDialog, UpdateHdlNfResolution)
1107 sal_Int32 nResolution = mpNfResolution->GetValue();
1108 if ( mpLbResolution->GetSelectEntryPos() == 0 ) // pixels / cm
1109 nResolution *= 100;
1110 else if ( mpLbResolution->GetSelectEntryPos() == 1 ) // pixels / inch
1111 nResolution = static_cast< sal_Int32 >( ( ( static_cast< double >( nResolution ) + 0.5 ) / 0.0254 ) );
1112 maResolution.Width = nResolution;
1113 maResolution.Height= nResolution;
1115 updateControls();
1116 return 0;
1119 IMPL_LINK_NOARG(ExportDialog, SbCompressionUpdateHdl)
1121 mpNfCompression->SetValue( mpSbCompression->GetThumbPos() );
1122 updateControls();
1123 return 0;
1126 IMPL_LINK_NOARG(ExportDialog, OK)
1128 // writing config parameter
1131 mrFltCallPara.aFilterData = GetFilterData( true );
1132 EndDialog( RET_OK );
1134 return 0;
1137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */