Update ooo320-m1
[ooovba.git] / goodies / source / filter.vcl / epgm / dlgepgm.cxx
blobf208e400ff53f397ae167442da1e500517818e4c
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: dlgepgm.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
36 #include <tools/ref.hxx>
37 #include <svtools/FilterConfigItem.hxx>
38 #include <vcl/msgbox.hxx>
39 #include "dlgepgm.hxx"
40 #include "dlgepgm.hrc"
41 #include "strings.hrc"
43 /*************************************************************************
45 |* Ctor
47 \************************************************************************/
49 DlgExportEPGM::DlgExportEPGM( FltCallDialogParameter& rPara ) :
50 ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_EPGM, *rPara.pResMgr ) ),
51 rFltCallPara ( rPara ),
52 aGrpFormat ( this, ResId( GRP_FORMAT, *rPara.pResMgr ) ),
53 aRBRaw ( this, ResId( RB_RAW, *rPara.pResMgr ) ),
54 aRBASCII ( this, ResId( RB_ASCII, *rPara.pResMgr ) ),
55 aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ),
56 aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ),
57 aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ),
58 pMgr ( rPara.pResMgr )
60 FreeResource();
62 // Config-Parameter lesen
64 String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/PGM" ) );
65 pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
66 sal_Int32 nFormat = pConfigItem->ReadInt32( String( ResId( KEY_FORMAT, *pMgr ) ), 0 );
68 BOOL bCheck = FALSE;
69 if ( !nFormat )
70 bCheck ^= TRUE;
71 aRBRaw.Check( bCheck );
72 bCheck ^= TRUE;
73 aRBASCII.Check( bCheck );
75 aBtnOK.SetClickHdl( LINK( this, DlgExportEPGM, OK ) );
78 DlgExportEPGM::~DlgExportEPGM()
80 delete pConfigItem;
83 /*************************************************************************
85 |* Speichert eingestellte Werte in ini-Datei
87 \************************************************************************/
89 IMPL_LINK( DlgExportEPGM, OK, void *, EMPTYARG )
91 // Config-Parameter schreiben
92 sal_Int32 nFormat = 0;
93 if ( aRBASCII.IsChecked() )
94 nFormat++;
95 pConfigItem->WriteInt32( String( ResId( KEY_FORMAT, *pMgr ) ), nFormat );
96 rFltCallPara.aFilterData = pConfigItem->GetFilterData();
97 EndDialog( RET_OK );
99 return 0;