Update ooo320-m1
[ooovba.git] / goodies / source / filter.vcl / eppm / dlgeppm.cxx
blob86f4f92d186da4f5cf67ea2bb1fb01155b148238
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dlgeppm.cxx,v $
10 * $Revision: 1.9 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_goodies.hxx"
33 #ifndef GCC
34 #endif
35 #include <tools/ref.hxx>
36 #include <svtools/FilterConfigItem.hxx>
37 #include <vcl/msgbox.hxx>
38 #include "dlgeppm.hxx"
39 #include "dlgeppm.hrc"
40 #include "strings.hrc"
42 /*************************************************************************
44 |* Ctor
46 \************************************************************************/
48 DlgExportEPPM::DlgExportEPPM( FltCallDialogParameter& rPara ) :
49 ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_EPPM, *rPara.pResMgr ) ),
50 rFltCallPara ( rPara ),
51 aGrpFormat ( this, ResId( GRP_FORMAT, *rPara.pResMgr ) ),
52 aRBRaw ( this, ResId( RB_RAW, *rPara.pResMgr ) ),
53 aRBASCII ( this, ResId( RB_ASCII, *rPara.pResMgr ) ),
54 aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ),
55 aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ),
56 aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ),
57 pMgr ( rPara.pResMgr )
59 FreeResource();
61 // Config-Parameter lesen
63 String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/PPM" ) );
64 pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
65 sal_Int32 nFormat = pConfigItem->ReadInt32( String( ResId( KEY_FORMAT, *pMgr ) ), 0 );
67 BOOL bCheck = FALSE;
68 if ( !nFormat )
69 bCheck ^= TRUE;
70 aRBRaw.Check( bCheck );
71 bCheck ^= TRUE;
72 aRBASCII.Check( bCheck );
74 aBtnOK.SetClickHdl( LINK( this, DlgExportEPPM, OK ) );
77 DlgExportEPPM::~DlgExportEPPM()
79 delete pConfigItem;
82 /*************************************************************************
84 |* Speichert eingestellte Werte in ini-Datei
86 \************************************************************************/
88 IMPL_LINK( DlgExportEPPM, OK, void *, EMPTYARG )
90 // Config-Parameter schreiben
91 sal_Int32 nFormat = 0;
92 if ( aRBASCII.IsChecked() )
93 nFormat++;
94 pConfigItem->WriteInt32( String( ResId( KEY_FORMAT, *pMgr ) ), nFormat );
95 rFltCallPara.aFilterData = pConfigItem->GetFilterData();
96 EndDialog( RET_OK );
98 return 0;